@supersoniks/concorde 5.1.0 → 5.1.2
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/.agents/skills/concorde-docs/SKILL.md +153 -0
- package/.agents/skills/{concorde-component-docs/template.md → concorde-docs/templates/component.md} +6 -2
- package/.agents/skills/concorde-docs/templates/decorator.md +43 -0
- package/.agents/skills/concorde-docs/templates/guide.md +25 -0
- package/.claude/launch.json +15 -0
- package/.claude/vite.http.config.mjs +7 -0
- package/.taste-skill/after/desktop-fold.jpg +0 -0
- package/.taste-skill/after/desktop-page-01.jpg +0 -0
- package/.taste-skill/after/desktop-page-02.jpg +0 -0
- package/.taste-skill/after/desktop-page-03.jpg +0 -0
- package/.taste-skill/after/mobile-fold.jpg +0 -0
- package/.taste-skill/after/mobile-page-01.jpg +0 -0
- package/.taste-skill/after/report.json +4103 -0
- package/.taste-skill/after/tablet-fold.jpg +0 -0
- package/.taste-skill/after/tablet-page-01.jpg +0 -0
- package/.taste-skill/after/tablet-page-02.jpg +0 -0
- package/.taste-skill/before/desktop-fold.jpg +0 -0
- package/.taste-skill/before/desktop-page-01.jpg +0 -0
- package/.taste-skill/before/desktop-page-02.jpg +0 -0
- package/.taste-skill/before/mobile-fold.jpg +0 -0
- package/.taste-skill/before/mobile-page-01.jpg +0 -0
- package/.taste-skill/before/report.json +2556 -0
- package/.taste-skill/before/tablet-fold.jpg +0 -0
- package/.taste-skill/before/tablet-page-01.jpg +0 -0
- package/.taste-skill/direction.json +510 -0
- package/.taste-skill/notes.md +84 -0
- package/.taste-skill/prod/desktop-fold.jpg +0 -0
- package/.taste-skill/prod/desktop-page-01.jpg +0 -0
- package/.taste-skill/prod/desktop-page-02.jpg +0 -0
- package/.taste-skill/prod/desktop-page-03.jpg +0 -0
- package/.taste-skill/prod/mobile-fold.jpg +0 -0
- package/.taste-skill/prod/mobile-page-01.jpg +0 -0
- package/.taste-skill/prod/mobile-page-02.jpg +0 -0
- package/.taste-skill/prod/report.json +1973 -0
- package/.taste-skill/prod/tablet-fold.jpg +0 -0
- package/.taste-skill/prod/tablet-page-01.jpg +0 -0
- package/.taste-skill/prod/tablet-page-02.jpg +0 -0
- package/.tmp-cem/custom-elements.json +2013 -2013
- package/AUDIT.md +228 -0
- package/PLAN-AMELIORATION.md +220 -0
- package/PLAN-DOCS-AGENTS.md +80 -0
- package/README.md +3 -3
- package/ai/skills/concorde/SKILL.md +1 -1
- package/ai/skills/concorde-get-set-dp/SKILL.md +3 -3
- package/ai/skills/concorde-theme/SKILL.md +1 -1
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +16 -16
- package/concorde-core.es.js +235 -233
- package/dist/concorde-core.bundle.js +16 -16
- package/dist/concorde-core.es.js +235 -233
- package/dist/img/archive/concorde-001-2cv.webp +0 -0
- package/dist/img/archive/concorde-red-arrows-2002-poster.jpg +0 -0
- package/dist/img/archive/concorde-red-arrows-2002.webm +0 -0
- package/dist/img/archive/credits.json +28 -0
- package/docs/.htaccess +75 -0
- package/docs/404.html +15 -0
- package/docs/404.md +5 -0
- package/docs/assets/index-BgG6FFPt.js +11765 -0
- package/docs/assets/index-x89XINSG.css +1 -0
- package/docs/core/components/functional/date/date.html +211 -0
- package/docs/core/components/functional/date/date.md +150 -0
- package/docs/core/components/functional/fetch/fetch.html +180 -0
- package/docs/core/components/functional/fetch/fetch.md +108 -0
- package/docs/core/components/functional/if/if.html +65 -0
- package/docs/core/components/functional/if/if.md +34 -0
- package/docs/core/components/functional/jsonata/jsonata.html +110 -0
- package/docs/core/components/functional/jsonata/jsonata.md +61 -0
- package/docs/core/components/functional/list/list.html +198 -0
- package/docs/core/components/functional/list/list.md +121 -0
- package/docs/core/components/functional/mix/mix.html +78 -0
- package/docs/core/components/functional/mix/mix.md +46 -0
- package/docs/core/components/functional/queue/queue.html +155 -0
- package/docs/core/components/functional/queue/queue.md +51 -0
- package/docs/core/components/functional/router/router.html +154 -0
- package/docs/core/components/functional/router/router.md +93 -0
- package/docs/core/components/functional/sdui/sdui-extension-points.html +127 -0
- package/docs/core/components/functional/sdui/sdui-extension-points.md +94 -0
- package/docs/core/components/functional/sdui/sdui.html +397 -0
- package/docs/core/components/functional/sdui/sdui.md +307 -0
- package/docs/core/components/functional/states/states.html +141 -0
- package/docs/core/components/functional/states/states.md +112 -0
- package/docs/core/components/functional/submit/submit.html +178 -0
- package/docs/core/components/functional/submit/submit.md +106 -0
- package/docs/{crawl/core → core}/components/functional/subscriber/subscriber.html +6 -5
- package/docs/core/components/functional/subscriber/subscriber.md +91 -0
- package/docs/core/components/functional/translation/translation.html +60 -0
- package/docs/core/components/functional/translation/translation.md +38 -0
- package/docs/core/components/functional/value/value.html +81 -0
- package/docs/core/components/functional/value/value.md +47 -0
- package/docs/core/components/ui/alert/alert.html +201 -0
- package/docs/core/components/ui/alert/alert.md +186 -0
- package/docs/core/components/ui/alert-messages/alert-messages.html +132 -0
- package/docs/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/core/components/ui/badge/badge.html +197 -0
- package/docs/core/components/ui/badge/badge.md +181 -0
- package/docs/core/components/ui/button/button.html +309 -0
- package/docs/core/components/ui/button/button.md +216 -0
- package/docs/core/components/ui/captcha/captcha.html +80 -0
- package/docs/core/components/ui/captcha/captcha.md +56 -0
- package/docs/core/components/ui/card/card.html +254 -0
- package/docs/core/components/ui/card/card.md +215 -0
- package/docs/core/components/ui/divider/divider.html +144 -0
- package/docs/core/components/ui/divider/divider.md +126 -0
- package/docs/core/components/ui/form/checkbox/checkbox.html +200 -0
- package/docs/core/components/ui/form/checkbox/checkbox.md +125 -0
- package/docs/core/components/ui/form/fieldset/fieldset.html +238 -0
- package/docs/core/components/ui/form/fieldset/fieldset.md +161 -0
- package/docs/core/components/ui/form/form-actions/form-actions.html +122 -0
- package/docs/core/components/ui/form/form-actions/form-actions.md +98 -0
- package/docs/core/components/ui/form/form-layout/form-layout.html +115 -0
- package/docs/core/components/ui/form/form-layout/form-layout.md +109 -0
- package/docs/core/components/ui/form/input/input.html +235 -0
- package/docs/core/components/ui/form/input/input.md +142 -0
- package/docs/core/components/ui/form/radio/radio.html +144 -0
- package/docs/core/components/ui/form/radio/radio.md +78 -0
- package/docs/core/components/ui/form/select/select.html +178 -0
- package/docs/core/components/ui/form/select/select.md +86 -0
- package/docs/core/components/ui/form/switch/switch.html +146 -0
- package/docs/core/components/ui/form/switch/switch.md +80 -0
- package/docs/core/components/ui/form/textarea/textarea.html +162 -0
- package/docs/core/components/ui/form/textarea/textarea.md +82 -0
- package/docs/core/components/ui/group/group.html +113 -0
- package/docs/core/components/ui/group/group.md +77 -0
- package/docs/core/components/ui/icon/icon.html +223 -0
- package/docs/core/components/ui/icon/icon.md +214 -0
- package/docs/core/components/ui/image/image.html +194 -0
- package/docs/core/components/ui/image/image.md +167 -0
- package/docs/core/components/ui/link/link.html +101 -0
- package/docs/core/components/ui/link/link.md +81 -0
- package/docs/core/components/ui/loader/loader.html +114 -0
- package/docs/core/components/ui/loader/loader.md +87 -0
- package/docs/{crawl/core → core}/components/ui/menu/menu.html +189 -116
- package/docs/core/components/ui/menu/menu.md +370 -0
- package/docs/core/components/ui/modal/modal.html +324 -0
- package/docs/core/components/ui/modal/modal.md +211 -0
- package/docs/core/components/ui/pop/pop.html +250 -0
- package/docs/core/components/ui/pop/pop.md +216 -0
- package/docs/core/components/ui/progress/progress.html +132 -0
- package/docs/core/components/ui/progress/progress.md +109 -0
- package/docs/core/components/ui/table/table.html +333 -0
- package/docs/core/components/ui/table/table.md +267 -0
- package/docs/core/components/ui/theme/theme.html +116 -0
- package/docs/core/components/ui/theme/theme.md +97 -0
- package/docs/core/components/ui/toast/toast.html +185 -0
- package/docs/core/components/ui/toast/toast.md +147 -0
- package/docs/core/components/ui/tooltip/tooltip.html +112 -0
- package/docs/core/components/ui/tooltip/tooltip.md +89 -0
- package/docs/docs/decorators/ancestor-attribute.html +71 -0
- package/docs/docs/decorators/ancestor-attribute.md +59 -0
- package/docs/docs/decorators/auto-subscribe.html +61 -0
- package/docs/docs/decorators/auto-subscribe.md +40 -0
- package/docs/docs/decorators/bind.html +86 -0
- package/docs/docs/decorators/bind.md +77 -0
- package/docs/docs/decorators/get.html +166 -0
- package/docs/docs/decorators/get.md +160 -0
- package/docs/docs/decorators/handle.html +139 -0
- package/docs/docs/decorators/handle.md +119 -0
- package/docs/docs/decorators/on-assign.html +72 -0
- package/docs/docs/decorators/on-assign.md +63 -0
- package/docs/docs/decorators/patch.html +76 -0
- package/docs/docs/decorators/patch.md +44 -0
- package/docs/docs/decorators/post.html +150 -0
- package/docs/docs/decorators/post.md +134 -0
- package/docs/docs/decorators/publish.html +74 -0
- package/docs/docs/decorators/publish.md +56 -0
- package/docs/docs/decorators/put.html +83 -0
- package/docs/docs/decorators/put.md +51 -0
- package/docs/docs/decorators/subscribe.html +91 -0
- package/docs/docs/decorators/subscribe.md +87 -0
- package/docs/docs/decorators/wait-for-ancestors.html +82 -0
- package/docs/docs/decorators/wait-for-ancestors.md +76 -0
- package/docs/docs/directives/sub.html +79 -0
- package/docs/docs/directives/sub.md +75 -0
- package/docs/docs/directives/t.html +91 -0
- package/docs/docs/directives/t.md +73 -0
- package/docs/{crawl/docs/_getting-started → docs/getting-started}/ai-agents.html +12 -11
- package/{src/docs/_getting-started → docs/docs/getting-started}/ai-agents.md +3 -3
- package/docs/docs/getting-started/components.html +27 -0
- package/docs/docs/getting-started/components.md +5 -0
- package/docs/{crawl/docs/_getting-started → docs/getting-started}/create-a-component.html +11 -14
- package/docs/{src/docs/_getting-started → docs/getting-started}/create-a-component.md +3 -6
- package/docs/{crawl/docs/_core-concept → docs/getting-started}/dataFlow.html +26 -29
- package/docs/{src/docs/_core-concept → docs/getting-started}/dataFlow.md +17 -18
- package/docs/docs/getting-started/installation.html +69 -0
- package/docs/docs/getting-started/installation.md +36 -0
- package/docs/{crawl/docs/_getting-started → docs/getting-started}/my-first-component.html +13 -22
- package/docs/{src/docs/_getting-started → docs/getting-started}/my-first-component.md +5 -14
- package/docs/docs/getting-started/start.html +47 -0
- package/{src/docs/_getting-started → docs/docs/getting-started}/start.md +1 -13
- package/docs/docs/getting-started/theming.html +334 -0
- package/{src/docs/_getting-started → docs/docs/getting-started}/theming.md +2 -2
- package/docs/docs/index.html +99 -0
- package/docs/{crawl/docs/_misc → docs/misc}/api-configuration.html +18 -18
- package/docs/{src/docs/_misc → docs/misc}/api-configuration.md +10 -12
- package/docs/{crawl/docs/_misc → docs/misc}/dataProviderKey.html +12 -11
- package/{src/docs/_misc → docs/docs/misc}/dataProviderKey.md +4 -4
- package/docs/{crawl/docs/_misc → docs/misc}/docs-mock-api.html +25 -28
- package/docs/{src/docs/_misc → docs/misc}/docs-mock-api.md +12 -13
- package/docs/{crawl/docs/_misc → docs/misc}/dynamic-path.html +16 -15
- package/{src/docs/_misc → docs/docs/misc}/dynamic-path.md +8 -8
- package/docs/{crawl/docs/_misc → docs/misc}/endpoint.html +16 -15
- package/{src/docs/_misc → docs/docs/misc}/endpoint.md +8 -8
- package/docs/{crawl/docs/_misc → docs/misc}/html-integration.html +12 -15
- package/docs/{src/docs/_misc → docs/misc}/html-integration.md +4 -5
- package/docs/docs-mock-api-sw.js +60 -223
- package/docs/docs-mock-api-sw.js.map +4 -4
- package/docs/hubs/decorators.html +443 -0
- package/docs/hubs/form-components.html +404 -0
- package/docs/hubs/remote-data.html +371 -0
- package/docs/img/archive/concorde-001-2cv.webp +0 -0
- package/docs/img/archive/concorde-red-arrows-2002-poster.jpg +0 -0
- package/docs/img/archive/concorde-red-arrows-2002.webm +0 -0
- package/docs/img/archive/credits.json +28 -0
- package/docs/img/concorde/plane_01.jpg +0 -0
- package/docs/img/concorde/plane_02.jpg +0 -0
- package/docs/img/concorde/plane_03.jpg +0 -0
- package/docs/img/concorde/plane_04.jpg +0 -0
- package/docs/img/concorde/plane_05.jpg +0 -0
- package/docs/img/concorde/plane_06.jpg +0 -0
- package/docs/img/concorde/plane_07.jpg +0 -0
- package/docs/img/concorde/plane_08.jpg +0 -0
- package/docs/img/concorde/plane_09.jpg +0 -0
- package/docs/img/concorde/plane_10.jpg +0 -0
- package/docs/img/concorde/plane_11.jpg +0 -0
- package/docs/img/concorde/plane_12.jpg +0 -0
- package/docs/img/concorde/plane_13.jpg +0 -0
- package/docs/index.html +96 -67
- package/docs/index.md +22 -0
- package/docs/llms-full.txt +3329 -3295
- package/docs/llms.txt +94 -92
- package/docs/robots.txt +11 -10
- package/docs/sitemap.xml +78 -78
- package/docs/src/core/components/functional/date/date.md +91 -231
- package/docs/src/core/components/functional/fetch/fetch.md +66 -83
- package/docs/src/core/components/functional/if/if.md +28 -3
- package/docs/src/core/components/functional/jsonata/jsonata.md +42 -37
- package/docs/src/core/components/functional/list/list.md +99 -43
- package/docs/src/core/components/functional/mix/mix.md +31 -26
- package/docs/src/core/components/functional/queue/queue.md +40 -61
- package/docs/src/core/components/functional/router/router.md +64 -65
- package/docs/src/core/components/functional/sdui/component-catalog.gaps.json +511 -0
- package/docs/src/core/components/functional/sdui/component-catalog.json +3103 -0
- package/docs/src/core/components/functional/sdui/example.json +19 -86
- package/docs/src/core/components/functional/sdui/sdui-extension-points.md +94 -0
- package/docs/src/core/components/functional/sdui/sdui.md +196 -245
- package/docs/src/core/components/functional/states/states.md +86 -61
- package/docs/src/core/components/functional/submit/submit.md +64 -72
- package/docs/src/core/components/functional/translation/translation.md +38 -0
- package/docs/src/core/components/functional/value/value.md +34 -22
- package/docs/src/core/components/ui/alert/alert.md +139 -74
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +137 -83
- package/docs/src/core/components/ui/button/button.md +139 -105
- package/docs/src/core/components/ui/captcha/captcha.md +50 -6
- package/docs/src/core/components/ui/card/card.md +183 -65
- package/docs/src/core/components/ui/divider/divider.md +104 -13
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +90 -42
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +135 -103
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +71 -50
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +99 -34
- package/docs/src/core/components/ui/form/input/input.md +95 -95
- package/docs/src/core/components/ui/form/radio/radio.md +55 -34
- package/docs/src/core/components/ui/form/select/select.md +60 -45
- package/docs/src/core/components/ui/form/switch/switch.md +57 -34
- package/docs/src/core/components/ui/form/textarea/textarea.md +55 -38
- package/docs/src/core/components/ui/group/group.md +49 -47
- package/docs/src/core/components/ui/icon/icon.md +132 -43
- package/docs/src/core/components/ui/image/image.md +132 -72
- package/docs/src/core/components/ui/link/link.md +46 -8
- package/docs/src/core/components/ui/loader/loader.md +55 -23
- package/docs/src/core/components/ui/menu/menu.md +155 -114
- package/docs/src/core/components/ui/modal/modal.md +154 -62
- package/docs/src/core/components/ui/pop/pop.md +185 -65
- package/docs/src/core/components/ui/progress/progress.md +76 -30
- package/docs/src/core/components/ui/table/table.md +146 -334
- package/docs/src/core/components/ui/theme/theme.md +97 -0
- package/docs/src/core/components/ui/toast/toast.md +80 -99
- package/docs/src/core/components/ui/tooltip/tooltip.md +52 -45
- package/docs/src/docs/decorators/ancestor-attribute.md +59 -0
- package/docs/src/docs/decorators/auto-subscribe.md +40 -0
- package/docs/src/docs/decorators/bind.md +77 -0
- package/docs/src/docs/decorators/get.md +160 -0
- package/docs/src/docs/decorators/handle.md +119 -0
- package/docs/src/docs/decorators/on-assign.md +63 -0
- package/docs/src/docs/decorators/patch.md +44 -0
- package/docs/src/docs/decorators/post.md +134 -0
- package/docs/src/docs/decorators/publish.md +56 -0
- package/docs/src/docs/decorators/put.md +51 -0
- package/docs/src/docs/decorators/subscribe.md +87 -0
- package/docs/src/docs/decorators/wait-for-ancestors.md +76 -0
- package/docs/src/docs/directives/sub.md +75 -0
- package/docs/src/docs/directives/t.md +73 -0
- package/docs/src/docs/{_getting-started → getting-started}/ai-agents.md +3 -3
- package/docs/src/docs/getting-started/components.md +5 -0
- package/{src/docs/_getting-started → docs/src/docs/getting-started}/create-a-component.md +3 -6
- package/{src/docs/_core-concept → docs/src/docs/getting-started}/dataFlow.md +17 -18
- package/docs/src/docs/getting-started/installation.md +36 -0
- package/{src/docs/_getting-started → docs/src/docs/getting-started}/my-first-component.md +5 -14
- package/docs/src/docs/getting-started/start.md +35 -0
- package/docs/src/docs/getting-started/theming.md +253 -0
- package/{src/docs/_misc → docs/src/docs/misc}/api-configuration.md +10 -12
- package/docs/src/docs/{_misc → misc}/dataProviderKey.md +4 -4
- package/{src/docs/_misc → docs/src/docs/misc}/docs-mock-api.md +12 -13
- package/docs/src/docs/{_misc → misc}/dynamic-path.md +8 -8
- package/docs/src/docs/{_misc → misc}/endpoint.md +8 -8
- package/{src/docs/_misc → docs/src/docs/misc}/html-integration.md +4 -5
- package/docs/src/docs/search/docs-search.json +3729 -2949
- package/docs/src/tsconfig.json +176 -5
- package/index.html +94 -67
- package/package.json +11 -4
- package/public/docs-mock-api-sw.js +58 -223
- package/public/docs-mock-api-sw.js.map +4 -4
- package/public/img/archive/concorde-001-2cv.webp +0 -0
- package/public/img/archive/concorde-red-arrows-2002-poster.jpg +0 -0
- package/public/img/archive/concorde-red-arrows-2002.webm +0 -0
- package/public/img/archive/credits.json +28 -0
- package/public/img/concorde/plane_01.jpg +0 -0
- package/public/img/concorde/plane_02.jpg +0 -0
- package/public/img/concorde/plane_03.jpg +0 -0
- package/public/img/concorde/plane_04.jpg +0 -0
- package/public/img/concorde/plane_05.jpg +0 -0
- package/public/img/concorde/plane_06.jpg +0 -0
- package/public/img/concorde/plane_07.jpg +0 -0
- package/public/img/concorde/plane_08.jpg +0 -0
- package/public/img/concorde/plane_09.jpg +0 -0
- package/public/img/concorde/plane_10.jpg +0 -0
- package/public/img/concorde/plane_11.jpg +0 -0
- package/public/img/concorde/plane_12.jpg +0 -0
- package/public/img/concorde/plane_13.jpg +0 -0
- package/public/robots.txt +11 -10
- package/scripts/docs-markdown-vite-plugin.ts +37 -0
- package/scripts/docs-public-url.mjs +50 -0
- package/scripts/docs.htaccess +75 -0
- package/scripts/generate-crawl-docs.mjs +207 -116
- package/scripts/generate-crawl-docs.test.mjs +124 -0
- package/scripts/post-build-docs.js +34 -50
- package/scripts/post-build.mjs +0 -0
- package/src/core/components/functional/date/date.md +91 -231
- package/src/core/components/functional/fetch/fetch.md +66 -83
- package/src/core/components/functional/if/if.md +28 -3
- package/src/core/components/functional/if/if.ts +0 -0
- package/src/core/components/functional/jsonata/jsonata.md +42 -37
- package/src/core/components/functional/list/list.demo.ts +0 -0
- package/src/core/components/functional/list/list.md +99 -43
- package/src/core/components/functional/mix/mix.md +31 -26
- package/src/core/components/functional/queue/queue.demo.ts +10 -7
- package/src/core/components/functional/queue/queue.md +40 -61
- package/src/core/components/functional/router/router.demo.ts +16 -16
- package/src/core/components/functional/router/router.md +64 -65
- package/src/core/components/functional/router/router.ts +0 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +0 -0
- package/src/core/components/functional/sdui/component-catalog.gaps.json +1 -1
- package/src/core/components/functional/sdui/component-catalog.json +1 -1
- package/src/core/components/functional/sdui/example.json +19 -86
- package/src/core/components/functional/sdui/sdui-extension-points.md +1 -1
- package/src/core/components/functional/sdui/sdui.md +187 -358
- package/src/core/components/functional/sdui/types.ts +0 -0
- package/src/core/components/functional/states/states.demo.ts +21 -22
- package/src/core/components/functional/states/states.md +86 -61
- package/src/core/components/functional/states/states.ts +1 -1
- package/src/core/components/functional/submit/submit.md +64 -72
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/functional/translation/translation.md +38 -0
- package/src/core/components/functional/value/value.md +34 -22
- package/src/core/components/functional/value/value.ts +0 -0
- package/src/core/components/ui/_css/size.ts +0 -0
- package/src/core/components/ui/alert/alert.md +48 -58
- package/src/core/components/ui/badge/badge.md +27 -34
- package/src/core/components/ui/button/button.md +139 -106
- package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
- package/src/core/components/ui/captcha/captcha.md +17 -32
- package/src/core/components/ui/card/card.md +6 -6
- package/src/core/components/ui/divider/divider.md +8 -11
- package/src/core/components/ui/form/checkbox/checkbox.md +90 -42
- package/src/core/components/ui/form/fieldset/fieldset.md +31 -75
- package/src/core/components/ui/form/form-actions/form-actions.md +14 -16
- package/src/core/components/ui/form/form-layout/form-layout.md +19 -29
- package/src/core/components/ui/form/input/input.md +95 -95
- package/src/core/components/ui/form/radio/radio.md +55 -34
- package/src/core/components/ui/form/select/select.md +60 -45
- package/src/core/components/ui/form/switch/switch.md +57 -34
- package/src/core/components/ui/form/textarea/textarea.md +55 -38
- package/src/core/components/ui/group/group.md +35 -33
- package/src/core/components/ui/icon/icon.md +4 -4
- package/src/core/components/ui/image/image.md +41 -107
- package/src/core/components/ui/link/link.md +6 -6
- package/src/core/components/ui/loader/loader.md +30 -55
- package/src/core/components/ui/menu/menu.md +27 -27
- package/src/core/components/ui/modal/modal.md +72 -96
- package/src/core/components/ui/modal/modal.ts +14 -11
- package/src/core/components/ui/pop/pop.md +80 -158
- package/src/core/components/ui/progress/progress.md +2 -2
- package/src/core/components/ui/table/table.md +91 -255
- package/src/core/components/ui/theme/theme.md +11 -36
- package/src/core/components/ui/toast/toast.md +48 -117
- package/src/core/components/ui/tooltip/tooltip.md +27 -62
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/utils/DataBindObserver.ts +0 -0
- package/src/core/utils/LocationHandler.spec.ts +80 -0
- package/src/core/utils/LocationHandler.ts +5 -9
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/route.ts +0 -0
- package/src/docs/code.ts +88 -75
- package/src/docs/components/docs-demo-sources.ts +70 -147
- package/src/docs/components/docs-lit-demo.ts +20 -40
- package/src/docs/components/docs-source-link.ts +0 -82
- package/src/docs/decorators/ancestor-attribute.md +59 -0
- package/src/docs/decorators/auto-subscribe.md +40 -0
- package/src/docs/decorators/bind.md +77 -0
- package/src/docs/decorators/get.md +160 -0
- package/src/docs/decorators/handle.md +119 -0
- package/src/docs/decorators/on-assign.md +63 -0
- package/src/docs/decorators/patch.md +44 -0
- package/src/docs/decorators/post.md +134 -0
- package/src/docs/decorators/publish.md +56 -0
- package/src/docs/decorators/put.md +51 -0
- package/src/docs/decorators/subscribe.md +87 -0
- package/src/docs/decorators/wait-for-ancestors.md +76 -0
- package/src/docs/directives/sub.md +75 -0
- package/src/docs/directives/t.md +73 -0
- package/src/docs/docs-location.spec.ts +46 -0
- package/src/docs/docs-location.ts +123 -32
- package/src/docs/docs.ts +6 -2
- package/src/docs/example/decorators-demo-bind-demos.ts +81 -116
- package/src/docs/example/decorators-demo-geo.ts +30 -19
- package/src/docs/example/decorators-demo-post.ts +88 -186
- package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +165 -268
- package/src/docs/example/decorators-demo.ts +85 -98
- package/src/docs/example/docs-api-config-demos.ts +19 -20
- package/src/docs/example/docs-boarding-pass-demo.ts +134 -0
- package/src/docs/example/docs-flight-demos.ts +147 -0
- package/src/docs/example/docs-jsonata-demos.ts +52 -52
- package/src/docs/example/docs-list-demos.ts +43 -123
- package/src/docs/example/docs-provider-keys.ts +33 -28
- package/src/docs/example/docs-queue-demos.ts +37 -77
- package/src/docs/example/docs-router-demos.ts +20 -25
- package/src/docs/example/docs-submit-demos.ts +48 -48
- package/src/docs/example/docs-toggle-demos.ts +4 -3
- package/src/docs/example/users.ts +0 -0
- package/src/docs/getting-started/ai-agents.md +76 -0
- package/src/docs/getting-started/components.md +5 -0
- package/src/docs/getting-started/create-a-component.md +136 -0
- package/src/docs/getting-started/dataFlow.md +87 -0
- package/src/docs/getting-started/installation.md +36 -0
- package/src/docs/getting-started/my-first-component.md +227 -0
- package/src/docs/getting-started/start.md +35 -0
- package/src/docs/getting-started/theming.md +253 -0
- package/src/docs/header/header.ts +240 -71
- package/src/docs/home/catalog.ts +44 -0
- package/src/docs/home/home.ts +520 -0
- package/src/docs/home/mach-stage.ts +389 -0
- package/src/docs/layout.ts +12 -11
- package/src/docs/misc/api-configuration.md +79 -0
- package/src/docs/misc/dataProviderKey.md +168 -0
- package/src/docs/misc/docs-mock-api.md +62 -0
- package/src/docs/misc/dynamic-path.md +71 -0
- package/src/docs/misc/endpoint.md +45 -0
- package/src/docs/misc/html-integration.md +14 -0
- package/src/docs/mock-api/api-config-mock.ts +5 -0
- package/src/docs/mock-api/fixtures.ts +0 -278
- package/src/docs/mock-api/flights.ts +89 -0
- package/src/docs/mock-api/router.ts +3 -4
- package/src/docs/mock-api/urls.ts +1 -2
- package/src/docs/navigation/components-index.ts +56 -0
- package/src/docs/navigation/navigation.ts +219 -232
- package/src/docs/navigation/pager.ts +67 -0
- package/src/docs/navigation/toc.ts +101 -0
- package/src/docs/search/docs-search.json +2419 -4374
- package/src/docs/search/markdown-renderer.ts +33 -7
- package/src/docs/search/page.ts +9 -6
- package/src/docs/search/search.ts +154 -122
- package/src/docs/shiki/index.ts +109 -0
- package/src/docs/tailwind/css/base/scrollbar.css +22 -0
- package/src/docs/tailwind/css/base/theme.css +96 -0
- package/src/docs/tailwind/css/base/typography.css +4 -0
- package/src/docs/tailwind/css/docs/boarding-pass.css +65 -0
- package/src/docs/tailwind/css/docs/content.css +32 -0
- package/src/docs/tailwind/css/docs/page.css +10 -0
- package/src/docs/tailwind/css/docs.css +9 -0
- package/src/docs/tailwind/css/home/hero.css +210 -0
- package/src/docs/tailwind/css/home/motion.css +84 -0
- package/src/docs/tailwind/css/home/sections.css +416 -0
- package/src/docs/tailwind/css/tailwind.css +7 -185
- package/src/tsconfig.json +23 -2
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +8 -4
- package/vite.config.mts +11 -2
- package/.agents/skills/concorde-component-docs/SKILL.md +0 -194
- package/.github/workflows/ci.yml +0 -21
- package/.github-export-ignore +0 -30
- package/CONTRIBUTING.md +0 -59
- package/DEV.md +0 -54
- package/LICENSE +0 -21
- package/OPEN_SOURCE_CHECKPOINT.md +0 -133
- package/concorde-3d.bundle.js +0 -3960
- package/concorde-3d.es.js +0 -33433
- package/concorde-hugging-face-infer.bundle.js +0 -32
- package/concorde-hugging-face-infer.es.js +0 -2952
- package/concorde-interactive.bundle.js +0 -1157
- package/concorde-interactive.es.js +0 -10734
- package/concorde-shader.bundle.js +0 -116
- package/concorde-shader.es.js +0 -8353
- package/concorde-webgpu.bundle.js +0 -307
- package/concorde-webgpu.es.js +0 -8627
- package/docs/assets/index-D8MVWqY6.js +0 -12251
- package/docs/assets/index-DiD0qYvE.css +0 -1
- package/docs/crawl/core/components/functional/date/date.html +0 -190
- package/docs/crawl/core/components/functional/fetch/fetch.html +0 -109
- package/docs/crawl/core/components/functional/if/if.html +0 -27
- package/docs/crawl/core/components/functional/jsonata/jsonata.html +0 -79
- package/docs/crawl/core/components/functional/list/list.html +0 -70
- package/docs/crawl/core/components/functional/mix/mix.html +0 -45
- package/docs/crawl/core/components/functional/queue/queue.html +0 -96
- package/docs/crawl/core/components/functional/router/router.html +0 -106
- package/docs/crawl/core/components/functional/sdui/sdui.html +0 -269
- package/docs/crawl/core/components/functional/states/states.html +0 -66
- package/docs/crawl/core/components/functional/submit/submit.html +0 -160
- package/docs/crawl/core/components/functional/value/value.html +0 -51
- package/docs/crawl/core/components/ui/alert/alert.html +0 -110
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +0 -23
- package/docs/crawl/core/components/ui/badge/badge.html +0 -119
- package/docs/crawl/core/components/ui/button/button.html +0 -149
- package/docs/crawl/core/components/ui/captcha/captcha.html +0 -30
- package/docs/crawl/core/components/ui/card/card.html +0 -99
- package/docs/crawl/core/components/ui/divider/divider.html +0 -58
- package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +0 -73
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +0 -135
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +0 -79
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +0 -62
- package/docs/crawl/core/components/ui/form/input/input.html +0 -109
- package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +0 -38
- package/docs/crawl/core/components/ui/form/radio/radio.html +0 -56
- package/docs/crawl/core/components/ui/form/select/select.html +0 -73
- package/docs/crawl/core/components/ui/form/switch/switch.html +0 -56
- package/docs/crawl/core/components/ui/form/textarea/textarea.html +0 -59
- package/docs/crawl/core/components/ui/group/group.html +0 -82
- package/docs/crawl/core/components/ui/icon/icon.html +0 -133
- package/docs/crawl/core/components/ui/image/image.html +0 -110
- package/docs/crawl/core/components/ui/link/link.html +0 -42
- package/docs/crawl/core/components/ui/loader/loader.html +0 -50
- package/docs/crawl/core/components/ui/modal/modal.html +0 -117
- package/docs/crawl/core/components/ui/pop/pop.html +0 -102
- package/docs/crawl/core/components/ui/progress/progress.html +0 -58
- package/docs/crawl/core/components/ui/table/table.html +0 -413
- package/docs/crawl/core/components/ui/toast/toast.html +0 -122
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +0 -79
- package/docs/crawl/docs/_core-concept/overview.html +0 -66
- package/docs/crawl/docs/_core-concept/subscriber.html +0 -75
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +0 -116
- package/docs/crawl/docs/_decorators/auto-subscribe.html +0 -202
- package/docs/crawl/docs/_decorators/bind.html +0 -141
- package/docs/crawl/docs/_decorators/get.html +0 -149
- package/docs/crawl/docs/_decorators/handle.html +0 -165
- package/docs/crawl/docs/_decorators/on-assign.html +0 -355
- package/docs/crawl/docs/_decorators/patch.html +0 -78
- package/docs/crawl/docs/_decorators/post.html +0 -139
- package/docs/crawl/docs/_decorators/publish.html +0 -61
- package/docs/crawl/docs/_decorators/put.html +0 -78
- package/docs/crawl/docs/_decorators/subscribe.html +0 -109
- package/docs/crawl/docs/_decorators/wait-for-ancestors.html +0 -137
- package/docs/crawl/docs/_directives/sub.html +0 -93
- package/docs/crawl/docs/_getting-started/concorde-manual-install.html +0 -100
- package/docs/crawl/docs/_getting-started/concorde-outside.html +0 -58
- package/docs/crawl/docs/_getting-started/my-first-subscriber.html +0 -110
- package/docs/crawl/docs/_getting-started/pubsub.html +0 -62
- package/docs/crawl/docs/_getting-started/start.html +0 -76
- package/docs/crawl/docs/_getting-started/theming.html +0 -85
- package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +0 -138
- package/docs/crawl/hubs/decorators.html +0 -547
- package/docs/crawl/hubs/form-components.html +0 -359
- package/docs/crawl/hubs/remote-data.html +0 -452
- package/docs/crawl/index.html +0 -101
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -29
- package/docs/src/docs/_core-concept/overview.md +0 -57
- package/docs/src/docs/_core-concept/subscriber.md +0 -75
- package/docs/src/docs/_decorators/ancestor-attribute.md +0 -127
- package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
- package/docs/src/docs/_decorators/bind.md +0 -167
- package/docs/src/docs/_decorators/get.md +0 -162
- package/docs/src/docs/_decorators/handle.md +0 -175
- package/docs/src/docs/_decorators/on-assign.md +0 -390
- package/docs/src/docs/_decorators/patch.md +0 -70
- package/docs/src/docs/_decorators/post.md +0 -146
- package/docs/src/docs/_decorators/publish.md +0 -55
- package/docs/src/docs/_decorators/put.md +0 -70
- package/docs/src/docs/_decorators/subscribe.md +0 -100
- package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
- package/docs/src/docs/_directives/sub.md +0 -91
- package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
- package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
- package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
- package/docs/src/docs/_getting-started/pubsub.md +0 -37
- package/docs/src/docs/_getting-started/start.md +0 -47
- package/docs/src/docs/_getting-started/theming.md +0 -91
- package/docs/src/docs/_misc/formelement-subscriber-removal.md +0 -115
- package/docs/src/tsconfig.declarations.json +0 -22
- package/docs/src/tsconfig.emit.json +0 -23
- package/gitlab/job_github_mirror.sh +0 -39
- package/scripts/github-export.mjs +0 -150
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -29
- package/src/css.d.ts +0 -19
- package/src/docs/_core-concept/overview.md +0 -57
- package/src/docs/_core-concept/subscriber.md +0 -75
- package/src/docs/_decorators/ancestor-attribute.md +0 -128
- package/src/docs/_decorators/auto-subscribe.md +0 -202
- package/src/docs/_decorators/bind.md +0 -167
- package/src/docs/_decorators/get.md +0 -162
- package/src/docs/_decorators/handle.md +0 -175
- package/src/docs/_decorators/on-assign.md +0 -390
- package/src/docs/_decorators/patch.md +0 -70
- package/src/docs/_decorators/post.md +0 -146
- package/src/docs/_decorators/publish.md +0 -55
- package/src/docs/_decorators/put.md +0 -70
- package/src/docs/_decorators/subscribe.md +0 -100
- package/src/docs/_decorators/wait-for-ancestors.md +0 -163
- package/src/docs/_directives/sub.md +0 -91
- package/src/docs/_getting-started/concorde-manual-install.md +0 -133
- package/src/docs/_getting-started/concorde-outside.md +0 -33
- package/src/docs/_getting-started/my-first-subscriber.md +0 -120
- package/src/docs/_getting-started/pubsub.md +0 -37
- package/src/docs/_misc/formelement-subscriber-removal.md +0 -115
- package/src/docs/example/docs-input-autocomplete-demos.ts +0 -110
- package/src/docs/example/docs-joke-demos.ts +0 -297
- package/src/docs/prism/index.ts +0 -6
- package/src/docs/prism/prism.css +0 -158
- package/src/docs/prism/prism.js +0 -1022
- package/src/tsconfig.declarations.json +0 -22
- package/src/tsconfig.emit.json +0 -23
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/var de,De;const Xt=globalThis,mr=Xt.ShadowRoot&&(Xt.ShadyCSS===void 0||Xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gr=Symbol(),Hr=new WeakMap;let zr=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==gr)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(mr&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Hr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Hr.set(t,e))}return e}toString(){return this.cssText}};const Bn=n=>new zr(typeof n=="string"?n:n+"",void 0,gr),jn=(n,...e)=>{const t=n.length===1?n[0]:e.reduce(((r,i,u)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[u+1]),n[0]);return new zr(t,n,gr)},qn=(n,e)=>{if(mr)n.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const r=document.createElement("style"),i=Xt.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},Gr=mr?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return Bn(t)})(n):n;/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Hn,defineProperty:zn,getOwnPropertyDescriptor:Gn,getOwnPropertyNames:Vn,getOwnPropertySymbols:Wn,getPrototypeOf:Xn}=Object,Yt=globalThis,Vr=Yt.trustedTypes,Yn=Vr?Vr.emptyScript:"",Jn=Yt.reactiveElementPolyfillSupport,Lt=(n,e)=>n,Jt={toAttribute(n,e){switch(e){case Boolean:n=n?Yn: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}},vr=(n,e)=>!Hn(n,e),Wr={attribute:!0,type:String,converter:Jt,reflect:!1,useDefault:!1,hasChanged:vr};Symbol.metadata??=Symbol("metadata"),Yt.litPropertyMetadata??=new WeakMap;let _t=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=Wr){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(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&zn(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){const{get:i,set:u}=Gn(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){const h=i?.call(this);u?.call(this,o),this.requestUpdate(e,h,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Wr}static _$Ei(){if(this.hasOwnProperty(Lt("elementProperties")))return;const e=Xn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Lt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Lt("properties"))){const t=this.properties,r=[...Vn(t),...Wn(t)];for(const i of r)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,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 i of r)t.unshift(Gr(i))}else e!==void 0&&t.push(Gr(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),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){const u=(r.converter?.toAttribute!==void 0?r.converter:Jt).toAttribute(t,r.type);this._$Em=e,u==null?this.removeAttribute(i):this.setAttribute(i,u),this._$Em=null}}_$AK(e,t){const r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const u=r.getPropertyOptions(i),o=typeof u.converter=="function"?{fromAttribute:u.converter}:u.converter?.fromAttribute!==void 0?u.converter:Jt;this._$Em=i;const h=o.fromAttribute(t,u.type);this[i]=h??this._$Ej?.get(i)??h,this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){const i=this.constructor,u=this[e];if(r??=i.getPropertyOptions(e),!((r.hasChanged??vr)(u,t)||r.useDefault&&r.reflect&&u===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:u},o){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),u!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!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[i,u]of this._$Ep)this[i]=u;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[i,u]of r){const{wrapped:o}=u,h=this[i];o!==!0||this._$AL.has(i)||h===void 0||this.C(i,void 0,u,h)}}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){}};_t.elementStyles=[],_t.shadowRootOptions={mode:"open"},_t[Lt("elementProperties")]=new Map,_t[Lt("finalized")]=new Map,Jn?.({ReactiveElement:_t}),(Yt.reactiveElementVersions??=[]).push("2.1.1");/**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright 2017 Google LLC
|
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const br=globalThis,Kt=br.trustedTypes,Xr=Kt?Kt.createPolicy("lit-html",{createHTML:n=>n}):void 0,Yr="$lit$",lt=`lit$${Math.random().toFixed(9).slice(2)}$`,Jr="?"+lt,Kn=`<${Jr}>`,gt=document,Mt=()=>gt.createComment(""),Ut=n=>n===null||typeof n!="object"&&typeof n!="function",yr=Array.isArray,Zn=n=>yr(n)||typeof n?.[Symbol.iterator]=="function",wr=`[
|
|
14
|
-
\f\r]`,Ft=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Kr=/-->/g,Zr=/>/g,vt=RegExp(`>|${wr}(?:([^\\s"'>=/]+)(${wr}*=${wr}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Qr=/'/g,en=/"/g,tn=/^(?:script|style|textarea|title)$/i,Qn=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),rn=Qn(1),At=Symbol.for("lit-noChange"),Oe=Symbol.for("lit-nothing"),nn=new WeakMap,bt=gt.createTreeWalker(gt,129);function sn(n,e){if(!yr(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Xr!==void 0?Xr.createHTML(e):e}const ei=(n,e)=>{const t=n.length-1,r=[];let i,u=e===2?"<svg>":e===3?"<math>":"",o=Ft;for(let h=0;h<t;h++){const b=n[h];let T,M,S=-1,w=0;for(;w<b.length&&(o.lastIndex=w,M=o.exec(b),M!==null);)w=o.lastIndex,o===Ft?M[1]==="!--"?o=Kr:M[1]!==void 0?o=Zr:M[2]!==void 0?(tn.test(M[2])&&(i=RegExp("</"+M[2],"g")),o=vt):M[3]!==void 0&&(o=vt):o===vt?M[0]===">"?(o=i??Ft,S=-1):M[1]===void 0?S=-2:(S=o.lastIndex-M[2].length,T=M[1],o=M[3]===void 0?vt:M[3]==='"'?en:Qr):o===en||o===Qr?o=vt:o===Kr||o===Zr?o=Ft:(o=vt,i=void 0);const P=o===vt&&n[h+1].startsWith("/>")?" ":"";u+=o===Ft?b+Kn:S>=0?(r.push(T),b.slice(0,S)+Yr+b.slice(S)+lt+P):b+lt+(S===-2?h:P)}return[sn(n,u+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class Ot{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let u=0,o=0;const h=e.length-1,b=this.parts,[T,M]=ei(e,t);if(this.el=Ot.createElement(T,r),bt.currentNode=this.el.content,t===2||t===3){const S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(i=bt.nextNode())!==null&&b.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(const S of i.getAttributeNames())if(S.endsWith(Yr)){const w=M[o++],P=i.getAttribute(S).split(lt),D=/([.?@])?(.*)/.exec(w);b.push({type:1,index:u,name:D[2],strings:P,ctor:D[1]==="."?ri:D[1]==="?"?ni:D[1]==="@"?ii:Zt}),i.removeAttribute(S)}else S.startsWith(lt)&&(b.push({type:6,index:u}),i.removeAttribute(S));if(tn.test(i.tagName)){const S=i.textContent.split(lt),w=S.length-1;if(w>0){i.textContent=Kt?Kt.emptyScript:"";for(let P=0;P<w;P++)i.append(S[P],Mt()),bt.nextNode(),b.push({type:2,index:++u});i.append(S[w],Mt())}}}else if(i.nodeType===8)if(i.data===Jr)b.push({type:2,index:u});else{let S=-1;for(;(S=i.data.indexOf(lt,S+1))!==-1;)b.push({type:7,index:u}),S+=lt.length-1}u++}}static createElement(e,t){const r=gt.createElement("template");return r.innerHTML=e,r}}function xt(n,e,t=n,r){if(e===At)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl;const u=Ut(e)?void 0:e._$litDirective$;return i?.constructor!==u&&(i?._$AO?.(!1),u===void 0?i=void 0:(i=new u(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=xt(n,i._$AS(n,e.values),i,r)),e}class ti{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,i=(e?.creationScope??gt).importNode(t,!0);bt.currentNode=i;let u=bt.nextNode(),o=0,h=0,b=r[0];for(;b!==void 0;){if(o===b.index){let T;b.type===2?T=new $t(u,u.nextSibling,this,e):b.type===1?T=new b.ctor(u,b.name,b.strings,this,e):b.type===6&&(T=new si(u,this,e)),this._$AV.push(T),b=r[++h]}o!==b?.index&&(u=bt.nextNode(),o++)}return bt.currentNode=gt,i}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,i){this.type=2,this._$AH=Oe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.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=xt(this,e,t),Ut(e)?e===Oe||e==null||e===""?(this._$AH!==Oe&&this._$AR(),this._$AH=Oe):e!==this._$AH&&e!==At&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Zn(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!==Oe&&Ut(this._$AH)?this._$AA.nextSibling.data=e:this.T(gt.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Ot.createElement(sn(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{const u=new ti(i,this),o=u.u(this.options);u.p(t),this.T(o),this._$AH=u}}_$AC(e){let t=nn.get(e.strings);return t===void 0&&nn.set(e.strings,t=new Ot(e)),t}k(e){yr(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const u of e)i===t.length?t.push(r=new $t(this.O(Mt()),this.O(Mt()),this,this.options)):r=t[i],r._$AI(u),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$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 Zt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,u){this.type=1,this._$AH=Oe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=u,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Oe}_$AI(e,t=this,r,i){const u=this.strings;let o=!1;if(u===void 0)e=xt(this,e,t,0),o=!Ut(e)||e!==this._$AH&&e!==At,o&&(this._$AH=e);else{const h=e;let b,T;for(e=u[0],b=0;b<u.length-1;b++)T=xt(this,h[r+b],t,b),T===At&&(T=this._$AH[b]),o||=!Ut(T)||T!==this._$AH[b],T===Oe?e=Oe:e!==Oe&&(e+=(T??"")+u[b+1]),this._$AH[b]=T}o&&!i&&this.j(e)}j(e){e===Oe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ri extends Zt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Oe?void 0:e}}class ni extends Zt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Oe)}}class ii extends Zt{constructor(e,t,r,i,u){super(e,t,r,i,u),this.type=5}_$AI(e,t=this){if((e=xt(this,e,t,0)??Oe)===At)return;const r=this._$AH,i=e===Oe&&r!==Oe||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,u=e!==Oe&&(r===Oe||i);i&&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 si{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){xt(this,e)}}const ai=br.litHtmlPolyfillSupport;ai?.(Ot,$t),(br.litHtmlVersions??=[]).push("3.3.1");const oi=(n,e,t)=>{const r=t?.renderBefore??e;let i=r._$litPart$;if(i===void 0){const u=t?.renderBefore??null;r._$litPart$=i=new $t(e.insertBefore(Mt(),u),u,void 0,t??{})}return i._$AI(n),i};/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2017 Google LLC
|
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const Er=globalThis;class Nt extends _t{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=oi(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,Er.litElementHydrateSupport?.({LitElement:Nt});const ui=Er.litElementPolyfillSupport;ui?.({LitElement:Nt}),(Er.litElementVersions??=[]).push("4.2.1");/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2017 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const ci=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 li={attribute:!0,type:String,converter:Jt,reflect:!1,hasChanged:vr},fi=(n=li,e,t)=>{const{kind:r,metadata:i}=t;let u=globalThis.litPropertyMetadata.get(i);if(u===void 0&&globalThis.litPropertyMetadata.set(i,u=new Map),r==="setter"&&((n=Object.create(n)).wrapped=!0),u.set(t.name,n),r==="accessor"){const{name:o}=t;return{set(h){const b=e.get.call(this);e.set.call(this,h),this.requestUpdate(o,b,n)},init(h){return h!==void 0&&this.C(o,void 0,n,h),h}}}if(r==="setter"){const{name:o}=t;return function(h){const b=this[o];e.call(this,h),this.requestUpdate(o,b,n)}}throw Error("Unsupported decorator location: "+r)};function X(n){return(e,t)=>typeof t=="object"?fi(n,e,t):((r,i,u)=>{const o=i.hasOwnProperty(u);return i.constructor.createProperty(u,r),o?Object.getOwnPropertyDescriptor(i,u):void 0})(n,e,t)}/**
|
|
28
|
-
* @license
|
|
29
|
-
* Copyright 2017 Google LLC
|
|
30
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
-
*/function hi(n){return X({...n,state:!0,attribute:!1})}const _r="1";function di(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 at=class Ge{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 i=window.getComputedStyle(r);if(Ge.overflowMatches(i,t))return r}r=Ge.nextComposedAncestor(r)}return null}static getScrollableAncestor(e){return Ge.findAncestorByOverflow(e,["auto","scroll","hidden","overlay"])}static getScrollingAncestor(e){return Ge.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 Ge.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=Ge.readScopeAttributeOnElement(r,t);if(u!=null)return u}const i=r.parentNode||r.host;if(!i)break;r=i}return null}static getApiConfiguration(e){const t=Ge.getAncestorAttributeValue(e,"token"),r=Ge.getAncestorAttributeValue(e,"addHTTPResponse")!=null,i=Ge.getAncestorAttributeValue(e,"serviceURL");let u=null,o=null;const h=Ge.getAncestorAttributeValue(e,"tokenProvider"),b=Ge.getAncestorAttributeValue(e,"eventsApiToken");t||(u=Ge.getAncestorAttributeValue(e,"userName"),o=Ge.getAncestorAttributeValue(e,"password"));const T=Ge.getAncestorAttributeValue(e,"credentials")||void 0,M=e.getAttribute("cache"),S=e.hasAttribute("blockUntilDone"),w=e.hasAttribute("keepAlive");return{serviceURL:i,token:t,userName:u,password:o,authToken:b,tokenProvider:h,addHTTPResponse:r,credentials:T,cache:M,blockUntilDone:S,keepAlive:w}}static getClosestElement(e,t){let r=e;for(;r&&!(r.nodeName&&r.nodeName.toLowerCase()===t);){const i=r.parentNode||r.host;if(!i){r=null;break}r=i}return r?.nodeName?r:null}static getClosestForm(e){return Ge.getClosestElement(e,"form")}static getAncestorsByTagNames(e,t){const r=new Set(t.map(o=>o.toLowerCase())),i=[];let u=e.parentNode||e.host;for(;u;)u instanceof Element&&r.has(u.tagName.toLowerCase())&&i.push(u),u=u.parentNode||u.host;return i}static getAncestorsBySelectors(e,t){const r=[];let i=e.parentNode||e.host;for(;i;){if(i instanceof Element)for(const u of t)try{if(i.matches(u)){r.push(i);break}}catch{}i=i.parentNode||i.host}return r}static async loadJS(e){if(!di(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===_r?!0:new Promise(u=>{let o=!1;const h=T=>{o||(o=!0,T&&(r.dataset.concordeLoaded=_r),u(T))};r.addEventListener("load",()=>h(!0),{once:!0}),r.addEventListener("error",()=>h(!1),{once:!0});const b=r.readyState;if(b==="complete"||b==="loaded"){h(!0);return}Promise.resolve().then(()=>{Promise.resolve().then(()=>{o||h(!0)})})});const i=/\.es\.js(\?|#|$)/.test(e)||/[?&]module(?:&|=|$)/.test(e);return new Promise(u=>{const o=document.createElement("script");o.src=e,i&&(o.type="module"),o.onload=()=>{o.dataset.concordeLoaded=_r,u(!0)},o.onerror=()=>u(!1),document.head.appendChild(o)})}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)})}};function an(n){if(!n||typeof n!="object")return!1;const e=n;return typeof e.getFrameCanvas=="function"&&typeof e.frameSeq=="number"}function on(n){if(!n||typeof n!="object")return!1;const e=n;return typeof e.registerFrameConsumer=="function"&&typeof e.unregisterFrameConsumer=="function"}class pi{constructor(){this.tokens=new Map}sync(e){const t=new Set;for(const r of e)r&&on(r)&&t.add(r);for(const[r,i]of[...this.tokens])t.has(r)||(on(r)&&r.unregisterFrameConsumer(i),this.tokens.delete(r));for(const r of t){if(this.tokens.has(r))continue;const i={};r.registerFrameConsumer(i),this.tokens.set(r,i)}}clear(){this.sync([])}}const un="#__sonic_frame_";let mi=0;const Ar=new Map,cn=new WeakMap;function gi(n){const e=cn.get(n);if(e)return e;const t=`${un}${++mi}`;return Ar.set(t,n),cn.set(n,t),t}function vi(n){if(!n.startsWith(un))return null;const e=Ar.get(n)??null;return e&&!e.isConnected?(Ar.delete(n),null):e}function bi(n){if(n==null)return null;if(typeof n=="string"){const e=n.trim();return e?e.startsWith("#")?e:`#${e}`:null}return typeof Element<"u"&&n instanceof Element?n.id?`#${n.id}`:gi(n):null}function xr(n){return typeof n!="string"?null:n.trim()||null}function yi(n){if(n==null||n==="")return null;if(typeof n=="string")return xr(n);if(typeof n!="object")return null;const e=n;return xr(e.url)??xr(e.blobUrl)}function It(n){for(const e of n)try{URL.revokeObjectURL(e)}catch{}}let wi=class{static async queueTaskPromise(){return new Promise(e=>{window.queueMicrotask(()=>e(null))})}static async delayPromise(e){return new Promise(t=>{setTimeout(t,e)})}},ln="sonic";typeof __SONIC_PREFIX__<"u"&&(ln=__SONIC_PREFIX__);let fn=ln.replace(/-([a-z])/g,n=>n[1].toUpperCase());const Ei=fn.charAt(0).toUpperCase()+fn.slice(1);let _i=class Et{static areEqual(e,t){return e.length===t.length?e.every((r,i)=>r===t[i]):!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(i=>(i||{})[t]==r)}})})}),value:()=>({forKey:t=>Et.from(e.map(r=>r[t]))}),copy:()=>({fromKey:t=>({toKey:r=>{e.forEach(i=>{i[r]=Array.isArray(i[t])?[...i[t]]:typeof i[t]=="object"&&i[t]!=null?{...i[t]}:i[t]})}})})}),map:t=>Et.from(e.map(t)),filter:t=>Et.from(e.filter(t)),find:t=>e.find(t),some:t=>e.some(t),every:t=>e.every(t),group:()=>({byKey:t=>{const r=[],i=new Map;for(const u of e){const o=u[t];if(!i.has(o)){const h=r.length;i.set(o,h);const b={items:[]};b[t]=o,r.push(b)}r[i.get(o)].items.push(u)}return Et.from(r)}}),without:()=>({duplicates:()=>({forKey:t=>{const r=[...new Set(e.map(i=>i[t]))];return Et.from(r.map(i=>e.find(u=>u[t]==i)))}}),itemsIn:t=>({havingSameValue:()=>({forKey:r=>{const i=(u,o)=>h=>u[o]!=h[o];return Et.from(e.filter(u=>t.every(i(u,r))))}})})})}}},Sr=class{static ucFirst(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.substring(1)}static minutesDuration(e,t="",r="long"){t||(t=at.getLanguage());const i=(T,M)=>[Math.floor(T/M),T%M];function u(T,M,S){return new Intl.NumberFormat(T,{style:"unit",unit:M,unitDisplay:S}).format}const[o,h]=i(e,60),b=[];return o&&b.push(u(t,"hour",r)(o)),h&&b.push(u(t,"minute",r)(h)),new Intl.ListFormat(t,{style:"long",type:"conjunction"}).format(b)}static js(e){try{return Function("return "+e)()}catch{return""}}};class hn{constructor(e){this.path=e}toString(){return this.path}}function dn(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 dn(new hn(r))}})}const Ai=/\$\{|\{\$/;function xi(n){return Ai.test(n)}function Si(n){const e=n;if(xi(e))throw new Error("Static publisher path required for get/set/dp. Use @subscribe, @publish, or @handle for dynamic DataProviderKey paths.");return e}const Qt=function(n){return this instanceof Qt?dn(new hn(n)):new Qt(n)};let er=class ct{static shallowEqual(e,t,r=!0){const i=Object.keys(e),u=Object.keys(t);if(i.length!==u.length&&r)return!1;for(const o of i){const h=e[o],b=t[o];if(r?h!==b:h!=b)return!1}return!0}static deepEqual(e,t,r=!0){const i=Object.keys(e),u=Object.keys(t);if(i.length!==u.length&&r)return!1;for(const o of i){const h=e[o],b=t[o],T=ct.isObject(h)&&ct.isObject(b),M=r?h!==b:h!=b;if(T&&!ct.deepEqual(h,b)||!T&&M)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 i of t){const u=e[i];if(u===void 0)return;r&&ct.isObject(u)?e=Object.assign(Array.isArray(u)?[]:{},e,u):e=e[i]}return e}static traverseDotNotation(e,t,r=!1){return ct.traverse(e,t.split("."),r)}static getURLSearchArray(e,t=""){let r=[];for(let i in e){const u=e[i];t&&(i=t+"["+i+"]"),ct.isObject(u)?r=[...r,...this.getURLSearchArray(u,i)]:r.push(`${i}=${u}`)}return r}static getURLSearchString(e){return ct.getURLSearchArray(e,"").join("&")}};er.traverseDotNotation;function ki(n){return!1}function tr(n){return Object.prototype.hasOwnProperty.call(n,"__value")}function ft(n){return typeof n=="object"&&n!==null}let St="sonic";typeof __SONIC_PREFIX__>"u"&&(St="sonic");const kr=St=="sonic"?"publisher-proxies-data":St+"-publisher-proxies-data",dt=class dt{constructor(e,t,r){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,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(),dt.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(i=>{i(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 i=Object.getOwnPropertyDescriptor(r,e);i&&!i.set&&!i.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 i=this._value_[t];e.propertyMap&&e.propertyMap[t]&&(r=e.propertyMap[t]),typeof e[t]<"u"&&e[t]!==i&&(e[r]=i)}}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&&tr(this._value_)&&tr(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=tr(this._value_);if(this._parentKey_&&this.parent){const i=tr(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_]:i});else{const u=[];u[Number(this._parentKey_)]=i,this.parent.set(u)}else this.parent._value_[this._parentKey_]=i}if(r)return this._proxies_.forEach((i,u)=>{u!="_parent_"&&(i.set(null),this._publishDynamicFilling_(u,null))}),this._publishAssignement_(t),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const i in this._value_)this._value_[i]===void 0&&delete this._value_[i];if(this._proxies_.forEach((i,u)=>{const o=this._value_[u];u!="_parent_"&&o===void 0&&o!==null&&isNaN(Number(u))&&(i.set(null),this._publishDynamicFilling_(u,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),ft(this._value_))for(const i in this._value_){const u=e[i],h=ft(u)?u:{__value:u};if(!this._proxies_.has(i)){this._publishDynamicFilling_(i,u);continue}this._proxies_.get(i)?.set(h,!0),this._publishDynamicFilling_(i,u)}return!0}get(){if(Ti(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_||(dt.instancesCounter++,this._instanceCounter_=dt.instancesCounter),dt.instances.set(this._instanceCounter_,this),"<"+St+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+St+"-publisher-proxy>"}};dt.instances=new Map,dt.instancesCounter=0;let rr=dt;const pn=[];function Ti(n){pn.length>0&&pn[0].add(n)}const ve=class ve{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],ve.instance!=null)throw"Singleton / use getInstance";ve.instance=this,this.isLocalStrorageReady=this.cleanStorageData(),ve.initPageShowHandler()}static initPageShowHandler(){ve.pageShowHandlerInitialized||(ve.pageShowHandlerInitialized=!0,window.addEventListener("pageshow",e=>{e.persisted&&ve.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(kr),i=null;if(r&&(i=await this.decompress(r,"gzip")),i)try{this.localStorageData=JSON.parse(i)}catch{this.localStorageData={}}else r=await this.compress("{}","gzip"),localStorage.setItem(kr,r),this.localStorageData={};const u=1e3*60*60*12;for(const o in this.localStorageData){const h=this.localStorageData[o],b=new Date().getTime()-(h.expirationDelayMs||u);h.lastModifiationMS<b&&delete this.localStorageData[o]}e(!0)}catch{window.requestAnimationFrame(()=>{e(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(e){if(e){const t=ve.instances.get(e);return t||(console.warn("No PublisherManager instance registered with id:",e,"creating new one"),new ve)}return ve.instance==null?new ve:ve.instance}static get(e,t){return ve.getInstance().get(e,t)}async setLocalData(e,t){await this.isLocalStrorageReady,e.set(this.localStorageData[t+"¤lang_"+at.getLanguage()]?.data||e.get())}get(e,t){const r=t?.localStorageMode==="enabled",i=t?.invalidateOnPageShow===!0;if(!this.publishers.has(e)){const h=Tr({});this.set(e,h)}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)),i&&(u._invalidate_on_page_show_=i),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!==ve.saveId&&e%10!=0))try{if(!ve.changed||ve.saving)return;ve.saving=!0,ve.changed=!1;const t=Array.from(this.publishers.keys());let r=!1;for(const i of t){const u=this.publishers.get(i);if(!u?._is_savable_)continue;const o=u?.get();o&&(this.localStorageData[i+"¤lang_"+at.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:u._expiration_delay_,data:o},r=!0)}if(r){const i=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(kr,i)}if(ve.saving=!1,ve.changed){ve.saveId++;const i=ve.saveId;setTimeout(()=>this.saveToLocalStorage(i),1e3)}}catch{ve.saving=!1}}async compress(e,t){const r=new TextEncoder().encode(e),i=window,u=new i.CompressionStream(t),o=u.writable.getWriter();o.write(r),o.close();const h=await new Response(u.readable).arrayBuffer(),b=new Uint8Array(h);let T="";for(let M=0;M<b.length;M++)T+=String.fromCharCode(b[M]);return btoa(T)}async decompress(e,t){const r=atob(e),u=Uint8Array.from(r,M=>M.charCodeAt(0)).buffer,o=window,h=new o.DecompressionStream(t),b=h.writable.getWriter();b.write(u),b.close();const T=await new Response(h.readable).arrayBuffer();return new TextDecoder().decode(T)}};ve.buildDate="Sat Oct 03 2026 09:31:30 GMT+0200 (Central European Summer Time)",ve.changed=!1,ve.saving=!1,ve.saveId=0,ve.instance=null,ve.instances=new Map,ve.pageShowHandlerInitialized=!1;let $e=ve;if(typeof window<"u"){const n=window,e=Ei+"PublisherManager",t=n[e]||$e;if(n[e]||(n[e]=$e),t!==$e){const r=["instance","instances","changed","saving","saveId","pageShowHandlerInitialized"];for(const i of r)Object.defineProperty($e,i,{configurable:!0,get(){return t[i]},set(u){t[i]=u}})}}const Pi=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 Ci(n,e){return{get:function(t,r){if(typeof r=="string"&&Pi.has(r))return n[r];if(r==Symbol.toPrimitive)return()=>e().get();if(!n._proxies_.has(r)){const i=n._value_[r],u=Tr(ft(i)?i:{__value:i},n,r);u._proxies_.set("_parent_",e()),n._proxies_.set(r,u)}return n._proxies_.get(r)},set:function(t,r,i){if(r=="_value_")return n._value_=i,!0;if(r=="_cachedGet_")return n._cachedGet_=i,!0;if(r=="_assignmentId_")return n._assignmentId_=i,!0;if(r=="_is_savable_")return n._is_savable_=i,!0;if(r=="_expiration_delay_")return n._expiration_delay_=i,!0;if(r=="_invalidate_on_page_show_")return n._invalidate_on_page_show_=i,!0;if(r=="_instanceCounter_")return n._instanceCounter_=i,!0;if(!n._proxies_.has(r)){const o=Tr({},n,r);o._proxies_.set("_parent_",e()),n._proxies_.set(r,o)}return n._value_[r]!==i&&(n._value_[r]=i,n._publishDynamicFilling_(r,i),n._proxies_.get(r)?.set(ft(i)?i:{__value:i})),!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,i){return i&&"value"in i&&(n._value_[r]=i.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 Tr(n,e=null,t){const r=new rr(n,e,t);let i=null;const u=Ci(r,()=>i);return i=new Proxy(r,u),i}class Ri extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=e=>{this.innerHTML=e.toString()}}connectedCallback(){this.publisherId=this.getAttribute("publisher")||"",this.publisher=rr.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}}try{customElements.define(St+"-publisher-proxy",Ri)}catch{}const Di=(n,e)=>{{const t=n.split("."),r=t.shift()||"";let i=$e.get(r,e);i=er.traverse(i,t);const u=new Set;return u.add(i),u}};function mn(n,e,t){const r=Si(n);return Di(r,t).values().next().value}function Li(n,e){return ki()?mn(n,void 0,e):mn(n)}let Pr=(de=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(de.observedElements.keys()).forEach(e=>de.unObserve(e)))}static observe(e){if(!e||!de.enabled||de.observedElements.has(e))return;const t=new MutationObserver(de.onMutation),r={};r.childList=!0,r.subtree=!0,r.attributes=!0,r.attributeFilter=["data-bind"],t.observe(e,r),e.querySelectorAll("[data-bind]").forEach(i=>de.addPublisherListeners(i)),de.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=>de.removePublisherListeners(r)))}static onAdded(e){e.hasAttribute&&e.hasAttribute("data-bind")&&de.addPublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(t=>de.addPublisherListeners(t)):e.childNodes.forEach(t=>de.onAdded(t))}static onRemoved(e){e.hasAttribute&&e.hasAttribute("data-bind")&&de.removePublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(t=>de.removePublisherListeners(t)):e.childNodes.forEach(t=>de.onRemoved(t))}static onMutation(e){for(const t of e)switch(t.type){case"attributes":de.addPublisherListeners(t.target);break;case"childList":t.addedNodes.forEach(r=>{de.onAdded(r)}),t.removedNodes.forEach(r=>{de.onRemoved(r)});break}}static removePublisherListeners(e){const t=de.publisherListeners.get(e);t&&(de.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(i=>i.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,i=>i.substring(1).toUpperCase()),bindedVariablesDescriptor:de.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){de.removePublisherListeners(e);const t=at.getAncestorAttributeValue(e.parentNode||e.host||e,"dataProvider");if(!t)return;const r=$e.getInstance().get(t),i=de.getDataBindItems(e),u=[];i.forEach(o=>{const h=o.bindedVariablesDescriptor,b=o.propertyToUpdate;for(const T of h.variables){const M=T;let S=r;S=de.getSubPublisher(r,M);const w=e,P={publisher:S,onAssign:()=>{const D=h.variables.map(Y=>de.getSubPublisher(r,Y)?.get());let N=h.expression,Z=!1;if(D.length==1&&h.variables[0].join(".")==N.substring(1)){let Y=D[0];Y===null&&(Y=""),w[b]=Y;return}for(let Y=0;Y<D.length;Y++){let E=D[Y];const m=h.variables[Y];E===null&&(Z=!0,E=void 0),N=N.replace("$"+m.join("."),E)}if(N.indexOf("|")!=-1){const Y=N.indexOf("|");if(Y==0)N=Sr.js(N.substring(1));else{const E=N.substring(0,Y),m=N.substring(Y+1),U=Sr[E];N=Z?"":U?U(m):N}}else N=Z?"":N;w[b]=N}};S?.onAssign(P.onAssign),u.push(P)}}),de.publisherListeners.set(e,u)}},de.observedElements=new Map,de.enabled=!0,de.publisherListeners=new Map,de);Pr.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=Pr);let Mi=(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 T=document.location.origin,M=(t||T).toString(),w=r.indexOf("http")==0?new URL(r).origin!=T:!1,P=r=="",D=history.length<3,N=P&&D,Z=M!=document.location.href;if(w&&Z||N){const E=history.state||{};E.concorde=E.concorde||{},E.concorde.hasDoneHistoryBack=!0,history.pushState(E,document.title),history.back(),document.location.replace(M)}else history.back();return}let i=e.getAttribute("to")||"";if(i||(i=e.href?.toString()||""),!i)return;if(i.indexOf("#")==0){document.location.hash=i.substring(1);return}const u=new URL(i,document.location.href),o=u.pathname.split("/"),h=[];let b="";for(const T of o)T!=b&&h.push(T),b=T;i="/"+h.join("/")+u.search+(u.hash?u.hash:""),e.hasAttribute("pushState")?history.pushState(null,"",i):e.hasAttribute("replaceState")?history.replaceState(null,"",i):document.location.href=i}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),i=new URL(e.location||"",document.location.origin);let u=!1;e.autoActive=="strict"?u=r.pathname==i.pathname&&r.hash==i.hash&&r.search==i.search:e.autoActive=="strict-path-only"?u=r.pathname==i.pathname&&r.hash==i.hash:u=i.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 gn(n){if(n==null||typeof n!="object"||Array.isArray(n))return n;const e={...n};return delete e._sonic_http_response_,e}const ye=class ye{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){ye.tokens.delete(this.serviceURL);return}ye.invalidTokens.includes(e)||ye.tokens.set(this.serviceURL,e)}get token(){return ye.invalidTokens.includes(this._token)?ye.tokens.get(this.serviceURL):this._token}handleInvalidToken(e){e&&(ye.invalidTokens.includes(e)||(ye.invalidTokens.push(e),this.token=null))}async handleResult(e,t){ye.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=e;const r=e.headers.get("content-type")?.toLowerCase(),i=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&&er.isObject(u)&&(u._sonic_http_response_=e),i===498&&!ye.failledTokenUpdates.has(this.serviceURL))if(this.handleInvalidToken(this.token),t.apiMethod==="get"){const h=await this.get(t.path,t.additionalHeaders);if(h==null)throw new Error("GET retry failed after token refresh");u=h}else u=await this[t.apiMethod](t.path,t.data,t.method,t.additionalHeaders);return Li("sonic-api").lastResponse.set({http:e,processed:u}),u}async auth(){if(this.token)return;if(ye.tokens.has(this.serviceURL)){this.token=ye.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,i=await fetch(this.computeURL(this.tokenProvider,{serviceHost:r}),{headers:e,credentials:this.credentials,keepalive:this.keepAlive});try{const u=await i.json();u.token?this.token=u.token:ye.failledTokenUpdates.set(this.serviceURL,!0)}catch{ye.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(e,t){const r=$e.get(e),i=new URLSearchParams(t.split("?")[1]||""),u=r.get();let o=[];Array.isArray(u)?o=u:o=[u];const h=[];let b=Number.POSITIVE_INFINITY,T=0,M=0;if(i.has("limit")&&(b=parseInt(i.get("limit")||"0"),M++),i.has("offset")&&(T=parseInt(i.get("offset")||"0"),M++),M>0&&(i.delete("limit"),i.delete("offset")),i.size===0)return o.slice(T,T+b);for(const[S,w]of i.entries()){const P=w.split(",").map(D=>D.trim());for(const D of P)for(const N of o)if(typeof N!="object")isNaN(+N)?N.toString().toLowerCase().includes(w.toLowerCase())&&h.push(N):N===w&&h.push(N);else{const Z=N;if(!Z[S])continue;isNaN(+Z[S])?Z[S]?.toString().toLowerCase().includes(D.toLowerCase())&&h.push(N):Z[S]===D&&h.push(N)}}return h.slice(T,T+b)}firstCallDone(){return new Promise(e=>{if(!ye.firstCallDoneFlags.has(this.serviceURL))ye.firstCallDoneFlags.set(this.serviceURL,"loading"),e(!0);else{const t=()=>{[void 0,"loading"].includes(ye.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(),ye.firstCallDoneFlags.set(this.serviceURL,"loading"));const T=e.match(r);if(!T)throw new Error("dataProvider path is not valid");return await this.localGet(T[1],T[2])}const i={apiMethod:"get",path:e,additionalHeaders:t},u=await this.createHeaders(t),o=this.computeURL(e),h=JSON.stringify({url:o,headers:u,credentials:this.credentials,cache:this.cache,keepAlive:this.keepAlive});if(this.blockUntilDone&&(await this.firstCallDone(),ye.firstCallDoneFlags.set(this.serviceURL,"loading")),!ye.loadingGetPromises.has(h)){const T=new Promise(async M=>{try{const S=await fetch(o,{headers:u,credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),w=await this.handleResult(S,i);M({processed:w,response:this.lastResult})}catch{ye.firstCallDoneFlags.set(this.serviceURL,"error"),M(null)}});ye.loadingGetPromises.set(h,T)}const b=await ye.loadingGetPromises.get(h);return ye.loadingGetPromises.delete(h),b?(this.lastResult=b.response,b.processed):null}async getDetailed(e,t){const r=/dataProvider\((.*?)\)(.*?)$/.test(e),i=await this.get(e,t);if(i==null)return;const u=gn(i),o=this.computeURL(e);if(r)return{request:new Request(o,{method:"GET"}),result:u};const h=await this.createHeaders(t);return{request:new Request(o,{method:"GET",headers:new Headers(h),credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),response:this.lastResult,result:u}}async sendDetailed(e,t,r,i){const u=await this.send(e,t,r,i);if(u==null)return;const o=gn(u),h=this.computeURL(e),b=await this.createHeaders({Accept:"application/json","Content-Type":"application/json",...i});return{request:new Request(h,{method:r,headers:new Headers(b),credentials:this.credentials,body:JSON.stringify(t),keepalive:this.keepAlive}),response:this.lastResult,result:o}}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"]=at.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 i=new URL(r);for(const u in t)i.searchParams.set(u,t[u]);return i.toString().replace(/([^(https?:)])\/{2,}/g,"$1/")}async send(e,t,r="POST",i){const u={apiMethod:"send",path:e,additionalHeaders:i,method:r,data:t},o=await this.createHeaders(i);o.Accept="application/json",o["Content-Type"]="application/json";const h=await fetch(this.computeURL(e),{headers:o,credentials:this.credentials,method:r,body:JSON.stringify(t),keepalive:this.keepAlive});return await this.handleResult(h,u)}async submitFormData(e,t,r="POST",i){const u={apiMethod:"submitFormData",path:e,additionalHeaders:i,method:r,data:t},o=await this.createHeaders(i);o.Accept="application/json";const h=new FormData,b=t;for(const M in b)h.set(M,b[M]);const T=await fetch(this.computeURL(e),{headers:o,credentials:this.credentials,method:r,body:h,keepalive:this.keepAlive});return await this.handleResult(T,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)}};ye.loadingGetPromises=new Map,ye.tokens=new Map,ye.invalidTokens=[],ye.failledTokenUpdates=new Map,ye.firstCallDoneFlags=new Map;let Cr=ye;at.getApiConfiguration(document.body||document.documentElement);var vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ui(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bt={exports:{}},Fi=Bt.exports,bn;function Oi(){return bn||(bn=1,(function(n,e){var t=[].slice;(function(r,i){return e!==null?n.exports=i():r.UrlPattern=i()})(Fi,function(){var r,i,u,o,h,b,T,M,S,w,P,D,N,Z,Y;return S=function(E){return E.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},T=function(E,m){var U,_,C;for(C=[],U=-1,_=E.length;++U<_;)C=C.concat(m(E[U]));return C},Z=function(E,m){var U,_,C;for(C="",U=-1,_=E.length;++U<_;)C+=m(E[U]);return C},N=function(E){return new RegExp(E.toString()+"|").exec("").length-1},P=function(E,m){var U,_,C,z,O;for(z={},U=-1,C=E.length;++U<C;)_=E[U],O=m[U],O!=null&&(z[_]!=null?(Array.isArray(z[_])||(z[_]=[z[_]]),z[_].push(O)):z[_]=O);return z},r={},r.Result=function(E,m){this.value=E,this.rest=m},r.Tagged=function(E,m){this.tag=E,this.value=m},r.tag=function(E,m){return function(U){var _,C;if(_=m(U),_!=null)return C=new r.Tagged(E,_.value),new r.Result(C,_.rest)}},r.regex=function(E){return function(m){var U,_;if(U=E.exec(m),U!=null)return _=U[0],new r.Result(_,m.slice(_.length))}},r.sequence=function(){var E;return E=1<=arguments.length?t.call(arguments,0):[],function(m){var U,_,C,z,O,re;for(U=-1,_=E.length,re=[],z=m;++U<_;){if(C=E[U],O=C(z),O==null)return;re.push(O.value),z=O.rest}return new r.Result(re,z)}},r.pick=function(){var E,m;return E=arguments[0],m=2<=arguments.length?t.call(arguments,1):[],function(U){var _,C;if(C=r.sequence.apply(r,m)(U),C!=null)return _=C.value,C.value=_[E],C}},r.string=function(E){var m;return m=E.length,function(U){if(U.slice(0,m)===E)return new r.Result(E,U.slice(m))}},r.lazy=function(E){var m;return m=null,function(U){return m==null&&(m=E()),m(U)}},r.baseMany=function(E,m,U,_,C){var z,O,re,ae;for(re=C,ae=U?"":[];!(m!=null&&(z=m(re),z!=null)||(O=E(re),O==null));)U?ae+=O.value:ae.push(O.value),re=O.rest;if(!(_&&ae.length===0))return new r.Result(ae,re)},r.many1=function(E){return function(m){return r.baseMany(E,null,!1,!0,m)}},r.concatMany1Till=function(E,m){return function(U){return r.baseMany(E,m,!0,!0,U)}},r.firstChoice=function(){var E;return E=1<=arguments.length?t.call(arguments,0):[],function(m){var U,_,C,z;for(U=-1,_=E.length;++U<_;)if(C=E[U],z=C(m),z!=null)return z}},D=function(E){var m;return m={},m.wildcard=r.tag("wildcard",r.string(E.wildcardChar)),m.optional=r.tag("optional",r.pick(1,r.string(E.optionalSegmentStartChar),r.lazy(function(){return m.pattern}),r.string(E.optionalSegmentEndChar))),m.name=r.regex(new RegExp("^["+E.segmentNameCharset+"]+")),m.named=r.tag("named",r.pick(1,r.string(E.segmentNameStartChar),r.lazy(function(){return m.name}))),m.escapedChar=r.pick(1,r.string(E.escapeChar),r.regex(/^./)),m.static=r.tag("static",r.concatMany1Till(r.firstChoice(r.lazy(function(){return m.escapedChar}),r.regex(/^./)),r.firstChoice(r.string(E.segmentNameStartChar),r.string(E.optionalSegmentStartChar),r.string(E.optionalSegmentEndChar),m.wildcard))),m.token=r.lazy(function(){return r.firstChoice(m.wildcard,m.optional,m.named,m.static)}),m.pattern=r.many1(r.lazy(function(){return m.token})),m},M={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},b=function(E,m){if(Array.isArray(E))return Z(E,function(U){return b(U,m)});switch(E.tag){case"wildcard":return"(.*?)";case"named":return"(["+m+"]+)";case"static":return S(E.value);case"optional":return"(?:"+b(E.value,m)+")?"}},h=function(E,m){return m==null&&(m=M.segmentValueCharset),"^"+b(E,m)+"$"},o=function(E){if(Array.isArray(E))return T(E,o);switch(E.tag){case"wildcard":return["_"];case"named":return[E.value];case"static":return[];case"optional":return o(E.value)}},w=function(E,m,U,_){var C,z,O,re;if(_==null&&(_=!1),re=E[m],re==null){if(_)throw new Error("no values provided for key `"+m+"`");return}if(C=U[m]||0,z=Array.isArray(re)?re.length-1:0,C>z){if(_)throw new Error("too few values provided for key `"+m+"`");return}return O=Array.isArray(re)?re[C]:re,_&&(U[m]=C+1),O},u=function(E,m,U){var _,C;if(Array.isArray(E)){for(_=-1,C=E.length;++_<C;)if(u(E[_],m,U))return!0;return!1}switch(E.tag){case"wildcard":return w(m,"_",U,!1)!=null;case"named":return w(m,E.value,U,!1)!=null;case"static":return!1;case"optional":return u(E.value,m,U)}},Y=function(E,m,U){if(Array.isArray(E))return Z(E,function(_){return Y(_,m,U)});switch(E.tag){case"wildcard":return w(m,"_",U,!0);case"named":return w(m,E.value,U,!0);case"static":return E.value;case"optional":return u(E.value,m,U)?Y(E.value,m,U):""}},i=function(E,m){var U,_,C,z,O;if(E instanceof i){this.isRegex=E.isRegex,this.regex=E.regex,this.ast=E.ast,this.names=E.names;return}if(this.isRegex=E instanceof RegExp,!(typeof E=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=E,m!=null){if(!Array.isArray(m))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=N(this.regex),m.length!==U)throw new Error("regex contains "+U+" groups but array of group names contains "+m.length);this.names=m}return}if(E==="")throw new Error("argument must not be the empty string");if(O=E.replace(/\s+/g,""),O!==E)throw new Error("argument must not contain whitespace");if(_={escapeChar:m?.escapeChar||M.escapeChar,segmentNameStartChar:m?.segmentNameStartChar||M.segmentNameStartChar,segmentNameCharset:m?.segmentNameCharset||M.segmentNameCharset,segmentValueCharset:m?.segmentValueCharset||M.segmentValueCharset,optionalSegmentStartChar:m?.optionalSegmentStartChar||M.optionalSegmentStartChar,optionalSegmentEndChar:m?.optionalSegmentEndChar||M.optionalSegmentEndChar,wildcardChar:m?.wildcardChar||M.wildcardChar},z=D(_),C=z.pattern(E),C==null)throw new Error("couldn't parse pattern");if(C.rest!=="")throw new Error("could only partially parse pattern");this.ast=C.value,this.regex=new RegExp(h(this.ast,_.segmentValueCharset)),this.names=o(this.ast)},i.prototype.match=function(E){var m,U;return U=this.regex.exec(E),U==null?null:(m=U.slice(1),this.names?P(this.names,m):m)},i.prototype.stringify=function(E){if(E==null&&(E={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(E!==Object(E))throw new Error("argument must be an object or undefined");return Y(this.ast,E,{})},i.escapeForRegex=S,i.concatMap=T,i.stringConcatMap=Z,i.regexGroupCount=N,i.keysAndValuesToObject=P,i.P=r,i.newParser=D,i.defaultOptions=M,i.astNodeToRegexString=h,i.astNodeToNames=o,i.getParam=w,i.astNodeContainsSegmentsForProvidedParams=u,i.stringify=Y,i})})(Bt,Bt.exports)),Bt.exports}var $i=Oi();const Ni=Ui($i);class Rr{constructor(e){this.path=Rr.normalizePath(e)}getDataProviderKey(){return new Qt(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("?"),i=t.indexOf("#");let u=t.length;r>=0&&(u=Math.min(u,r)),i>=0&&(u=Math.min(u,i));let o=t.slice(0,u);const h=t.slice(u);if(o=o.replace(/^\/+/,""),o=o.replace(/\/+/g,"/"),!o&&h)throw new RangeError("Endpoint: path cannot be empty");return o+h}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 nr(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 Dr={exports:{}},yn;function Ii(){return yn||(yn=1,(function(n,e){(function(t){n.exports=t()})(function(){return(function(){function t(r,i,u){function o(T,M){if(!i[T]){if(!r[T]){var S=typeof nr=="function"&&nr;if(!M&&S)return S(T,!0);if(h)return h(T,!0);var w=new Error("Cannot find module '"+T+"'");throw w.code="MODULE_NOT_FOUND",w}var P=i[T]={exports:{}};r[T][0].call(P.exports,function(D){var N=r[T][1][D];return o(N||D)},P,P.exports,t,r,i,u)}return i[T].exports}for(var h=typeof nr=="function"&&nr,b=0;b<u.length;b++)o(u[b]);return o}return t})()({1:[function(t,r,i){const u=t("./utils"),o=(function(){const h=u.stringToArray,b=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],T=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],M=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],S=["Thousand","Million","Billion","Trillion"];function w(A,R){var k=function(j,I,L){var q="";if(j<=19)q=(I?" and ":"")+(L?T[j]:b[j]);else if(j<100){const he=Math.floor(j/10),ue=j%10;q=(I?" and ":"")+M[he-2],ue>0?q+="-"+k(ue,!1,L):L&&(q=q.substring(0,q.length-1)+"ieth")}else if(j<1e3){const he=Math.floor(j/100),ue=j%100;q=(I?", ":"")+b[he]+" Hundred",ue>0?q+=k(ue,!0,L):L&&(q+="th")}else{var K=Math.floor(Math.log10(j)/3);K>S.length&&(K=S.length);const he=Math.pow(10,K*3),ue=Math.floor(j/he),te=j-ue*he;q=(I?", ":"")+k(ue,!1,!1)+" "+S[K-1],te>0?q+=k(te,!0,L):L&&(q+="th")}return q},F=k(A,!1,R);return F}const P=Object.create(null);b.forEach(function(A,R){P[A.toLowerCase()]=R}),T.forEach(function(A,R){P[A.toLowerCase()]=R}),M.forEach(function(A,R){const k=A.toLowerCase();P[k]=(R+2)*10,P[k.substring(0,A.length-1)+"ieth"]=P[k]}),P.hundredth=100,S.forEach(function(A,R){const k=A.toLowerCase(),F=Math.pow(10,(R+1)*3);P[k]=F,P[k+"th"]=F});function D(A){const k=A.split(/,\s|\sand\s|[\s\\-]/).map(I=>P[I]);let F=[0];return k.forEach(I=>{if(I<100){let L=F.pop();L>=1e3&&(F.push(L),L=0),F.push(L+I)}else F.push(F.pop()*I)}),F.reduce((I,L)=>I+L,0)}const N=[[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"]],Z={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function Y(A){for(var R=0;R<N.length;R++){const k=N[R];if(A>=k[0])return k[1]+Y(A-k[0])}return""}function E(A){for(var R=0,k=1,F=A.length-1;F>=0;F--){const j=A[F],I=Z[j];I<k?R-=I:(k=I,R+=I)}return R}function m(A,R){for(var k=[],F=R.charCodeAt(0);A>0;)k.unshift(String.fromCharCode((A-1)%26+F)),A=Math.floor((A-1)/26);return k.join("")}function U(A,R){for(var k=R.charCodeAt(0),F=0,j=0;j<A.length;j++)F+=(A.charCodeAt(A.length-j-1)-k+1)*Math.pow(26,j);return F}function _(A,R){if(typeof A>"u")return;A=Math.floor(A);const k=ae(R);return O(A,k)}const C={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},z={UPPER:"upper",LOWER:"lower",TITLE:"title"};function O(A,R){let k;const F=A<0;switch(A=Math.abs(A),R.primary){case C.LETTERS:k=m(A,R.case===z.UPPER?"A":"a");break;case C.ROMAN:k=Y(A),R.case===z.UPPER&&(k=k.toUpperCase());break;case C.WORDS:k=w(A,R.ordinal),R.case===z.UPPER?k=k.toUpperCase():R.case===z.LOWER&&(k=k.toLowerCase());break;case C.DECIMAL:k=""+A;var j=R.mandatoryDigits-k.length;if(j>0){var I=new Array(j+1).join("0");k=I+k}if(R.zeroCode!==48&&(k=h(k).map(he=>String.fromCodePoint(he.codePointAt(0)+R.zeroCode-48)).join("")),R.regular){const he=Math.floor((k.length-1)/R.groupingSeparators.position);for(let ue=he;ue>0;ue--){const te=k.length-ue*R.groupingSeparators.position;k=k.substr(0,te)+R.groupingSeparators.character+k.substr(te)}}else R.groupingSeparators.reverse().forEach(he=>{const ue=k.length-he.position;k=k.substr(0,ue)+he.character+k.substr(ue)});if(R.ordinal){var L={1:"st",2:"nd",3:"rd"},q=k[k.length-1],K=L[q];(!K||k.length>1&&k[k.length-2]==="1")&&(K="th"),k=k+K}break;case C.SEQUENCE:throw{code:"D3130",value:R.token}}return F&&(k="-"+k),k}const re=[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 ae(A){const R={type:"integer",primary:C.DECIMAL,case:z.LOWER,ordinal:!1};let k,F;const j=A.lastIndexOf(";");switch(j===-1?k=A:(k=A.substring(0,j),F=A.substring(j+1),F[0]==="o"&&(R.ordinal=!0)),k){case"A":R.case=z.UPPER;case"a":R.primary=C.LETTERS;break;case"I":R.case=z.UPPER;case"i":R.primary=C.ROMAN;break;case"W":R.case=z.UPPER,R.primary=C.WORDS;break;case"Ww":R.case=z.TITLE,R.primary=C.WORDS;break;case"w":R.primary=C.WORDS;break;default:{let I=null,L=0,q=0,K=[],he=0;if(h(k).map(te=>te.codePointAt(0)).reverse().forEach(te=>{let Q=!1;for(let le=0;le<re.length;le++){const ee=re[le];if(te>=ee&&te<=ee+9){if(Q=!0,L++,he++,I===null)I=ee;else if(ee!==I)throw{code:"D3131"};break}}Q||(te===35?(he++,q++):K.push({position:he,character:String.fromCodePoint(te)}))}),L>0){R.primary=C.DECIMAL,R.zeroCode=I,R.mandatoryDigits=L,R.optionalDigits=q;const Q=function(le){if(le.length===0)return 0;const ee=le[0].character;for(let Le=1;Le<le.length;Le++)if(le[Le].character!==ee)return 0;const Ne=le.map(Le=>Le.position),Qe=function(Le,je){return je===0?Le:Qe(je,Le%je)},Be=Ne.reduce(Qe);for(let Le=1;Le<=Ne.length;Le++)if(Ne.indexOf(Le*Be)===-1)return 0;return Be}(K);Q>0?(R.regular=!0,R.groupingSeparators={position:Q,character:K[0].character}):(R.regular=!1,R.groupingSeparators=K)}else R.primary=C.SEQUENCE,R.token=k}}return R}const _e={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 ge(A){var R=[];const k={type:"datetime",parts:R},F=function(Q,le){if(le>Q){let ee=A.substring(Q,le);ee=ee.split("]]").join("]"),R.push({type:"literal",value:ee})}};for(var j=0,I=0;I<A.length;){if(A.charAt(I)==="["){if(A.charAt(I+1)==="["){F(j,I),R.push({type:"literal",value:"["}),I+=2,j=I;continue}if(F(j,I),j=I,I=A.indexOf("]",j),I===-1)throw{code:"D3135"};let Q=A.substring(j+1,I);Q=Q.split(/\s+/).join("");var L={type:"marker",component:Q.charAt(0)},q=Q.lastIndexOf(","),K;if(q!==-1){const le=Q.substring(q+1),ee=le.indexOf("-");let Ne,Qe;const Be=function(je){if(!(typeof je>"u"||je==="*"))return parseInt(je)};ee===-1?Ne=le:(Ne=le.substring(0,ee),Qe=le.substring(ee+1));const Le={min:Be(Ne),max:Be(Qe)};L.width=Le,K=Q.substring(1,q)}else K=Q.substring(1);if(K.length===1)L.presentation1=K;else if(K.length>1){var he=K.charAt(K.length-1);"atco".indexOf(he)!==-1?(L.presentation2=he,he==="o"&&(L.ordinal=!0),L.presentation1=K.substring(0,K.length-1)):L.presentation1=K}else L.presentation1=_e[L.component];if(typeof L.presentation1>"u")throw{code:"D3132",value:L.component};if(L.presentation1[0]==="n")L.names=z.LOWER;else if(L.presentation1[0]==="N")L.presentation1[1]==="n"?L.names=z.TITLE:L.names=z.UPPER;else if("YMDdFWwXxHhmsf".indexOf(L.component)!==-1){var ue=L.presentation1;if(L.presentation2&&(ue+=";"+L.presentation2),L.integerFormat=ae(ue),L.width&&L.width.min!==void 0&&L.integerFormat.mandatoryDigits<L.width.min&&(L.integerFormat.mandatoryDigits=L.width.min),L.component==="Y")if(L.n=-1,L.width&&L.width.max!==void 0)L.n=L.width.max,L.integerFormat.mandatoryDigits=L.n;else{var te=L.integerFormat.mandatoryDigits+L.integerFormat.optionalDigits;te>=2&&(L.n=te)}const le=R[R.length-1];le&&le.integerFormat&&(le.integerFormat.parseWidth=le.integerFormat.mandatoryDigits)}(L.component==="Z"||L.component==="z")&&(L.integerFormat=ae(L.presentation1)),R.push(L),j=I+1}I++}return F(j,I),k}const pe=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Pe=["January","February","March","April","May","June","July","August","September","October","November","December"],Je=1e3*60*60*24,ce=function(A){const R=Date.UTC(A.year,A.month);var k=new Date(R).getUTCDay();return k===0&&(k=7),k>4?R+(8-k)*Je:R-(k-1)*Je},me=function(A,R){return{year:A,month:R,nextMonth:function(){return R===11?me(A+1,0):me(A,R+1)},previousMonth:function(){return R===0?me(A-1,11):me(A,R-1)},nextYear:function(){return me(A+1,R)},previousYear:function(){return me(A-1,R)}}},We=function(A,R){return(R-A)/(Je*7)+1},ie=(A,R)=>{let k;switch(R){case"Y":k=A.getUTCFullYear();break;case"M":k=A.getUTCMonth()+1;break;case"D":k=A.getUTCDate();break;case"d":{const F=Date.UTC(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate()),j=Date.UTC(A.getUTCFullYear(),0);k=(F-j)/Je+1;break}case"F":k=A.getUTCDay(),k===0&&(k=7);break;case"W":{const F=me(A.getUTCFullYear(),0),j=ce(F),I=Date.UTC(F.year,A.getUTCMonth(),A.getUTCDate());let L=We(j,I);if(L>52){const q=ce(F.nextYear());I>=q&&(L=1)}else if(L<1){const q=ce(F.previousYear());L=We(q,I)}k=Math.floor(L);break}case"w":{const F=me(A.getUTCFullYear(),A.getUTCMonth()),j=ce(F),I=Date.UTC(F.year,F.month,A.getUTCDate());let L=We(j,I);if(L>4){const q=ce(F.nextMonth());I>=q&&(L=1)}else if(L<1){const q=ce(F.previousMonth());L=We(q,I)}k=Math.floor(L);break}case"X":{const F=me(A.getUTCFullYear(),0),j=ce(F),I=ce(F.nextYear()),L=A.getTime();L<j?k=F.year-1:L>=I?k=F.year+1:k=F.year;break}case"x":{const F=me(A.getUTCFullYear(),A.getUTCMonth()),j=ce(F),I=F.nextMonth(),L=ce(I),q=A.getTime();q<j?k=F.previousMonth().month+1:q>=L?k=I.month+1:k=F.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 Ce=null;function nt(A,R,k){var F=0,j=0;if(typeof k<"u"){const ue=parseInt(k);F=Math.floor(ue/100),j=ue%100}var I=function(ue,te){var Q=ie(ue,te.component);if("YMDdFWwXxHhms".indexOf(te.component)!==-1)if(te.component==="Y"&&te.n!==-1&&(Q=Q%Math.pow(10,te.n)),te.names){if(te.component==="M"||te.component==="x")Q=Pe[Q-1];else if(te.component==="F")Q=pe[Q];else throw{code:"D3133",value:te.component};te.names===z.UPPER?Q=Q.toUpperCase():te.names===z.LOWER&&(Q=Q.toLowerCase()),te.width&&Q.length>te.width.max&&(Q=Q.substring(0,te.width.max))}else Q=O(Q,te.integerFormat);else if(te.component==="f")Q=O(Q,te.integerFormat);else if(te.component==="Z"||te.component==="z"){const le=F*100+j;if(te.integerFormat.regular)Q=O(le,te.integerFormat);else{const ee=te.integerFormat.mandatoryDigits;if(ee===1||ee===2)Q=O(F,te.integerFormat),j!==0&&(Q+=":"+_(j,"00"));else if(ee===3||ee===4)Q=O(le,te.integerFormat);else throw{code:"D3134",value:ee}}le>=0&&(Q="+"+Q),te.component==="z"&&(Q="GMT"+Q),le===0&&te.presentation2==="t"&&(Q="Z")}else te.component==="P"&&te.names===z.UPPER&&(Q=Q.toUpperCase());return Q};let L;typeof R>"u"?(Ce===null&&(Ce=ge("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),L=Ce):L=ge(R);const q=(60*F+j)*60*1e3,K=new Date(A+q);let he="";return L.parts.forEach(function(ue){ue.type==="literal"?he+=ue.value:he+=I(K,ue)}),he}function d(A){var R=Object.create(null);if(A.type==="datetime")R.type="datetime",R.parts=A.parts.map(function(k){var F=Object.create(null);if(k.type==="literal")F.regex=k.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if(k.component==="Z"||k.component==="z"){let I;Array.isArray(k.integerFormat.groupingSeparators)||(I=k.integerFormat.groupingSeparators),F.regex="",k.component==="z"&&(F.regex="GMT"),F.regex+="[-+][0-9]+",I&&(F.regex+=I.character+"[0-9]+"),F.parse=function(L){k.component==="z"&&(L=L.substring(3));let q=0,K=0;return I?(q=Number.parseInt(L.substring(0,L.indexOf(I.character))),K=Number.parseInt(L.substring(L.indexOf(I.character)+1))):L.length-1<=2?q=Number.parseInt(L):(q=Number.parseInt(L.substring(0,3)),K=Number.parseInt(L.substring(3))),q*60+K}}else if(k.component==="f")F.regex="[0-9]+",F.parse=function(I){return parseFloat("0."+I.substring(0,3))*1e3};else if(k.integerFormat)F=d(k.integerFormat);else{F.regex="[a-zA-Z]+";var j=Object.create(null);if(k.component==="M"||k.component==="x")Pe.forEach(function(I,L){k.width&&k.width.max?j[I.substring(0,k.width.max)]=L+1:j[I]=L+1});else if(k.component==="F")pe.forEach(function(I,L){L>0&&(k.width&&k.width.max?j[I.substring(0,k.width.max)]=L:j[I]=L)});else if(k.component==="P")j={am:0,AM:0,pm:1,PM:1};else throw{code:"D3133",value:k.component};F.parse=function(I){return j[I]}}return F.component=k.component,F});else{R.type="integer";const k=A.case===z.UPPER;switch(A.primary){case C.LETTERS:R.regex=k?"[A-Z]+":"[a-z]+",R.parse=function(F){return U(F,k?"A":"a")};break;case C.ROMAN:R.regex=k?"[MDCLXVI]+":"[mdclxvi]+",R.parse=function(F){return E(k?F:F.toUpperCase())};break;case C.WORDS:R.regex="(?:"+u.keys(P).concat("and","[\\-, ]").join("|")+")+",R.parse=function(F){return D(F.toLowerCase())};break;case C.DECIMAL:R.regex="[0-9]",A.parseWidth?R.regex+=`{${A.parseWidth}}`:R.regex+="+",A.ordinal&&(R.regex+="(?:th|st|nd|rd)"),R.parse=function(F){let j=F;return A.ordinal&&(j=F.substring(0,F.length-2)),A.regular?j=j.split(",").join(""):A.groupingSeparators.forEach(I=>{j=j.split(I.character).join("")}),A.zeroCode!==48&&(j=j.split("").map(I=>String.fromCodePoint(I.codePointAt(0)-A.zeroCode+48)).join("")),parseInt(j)};break;case C.SEQUENCE:throw{code:"D3130",value:A.token}}}return R}function y(A,R){if(typeof A>"u")return;const k=ae(R);return d(k).parse(A)}function G(A,R){const k=ge(R),F=d(k),j="^"+F.parts.map(K=>"("+K.regex+")").join("")+"$";var L=new RegExp(j,"i").exec(A);if(L!==null){const ee=Object.create(null);for(let c=1;c<L.length;c++){const f=F.parts[c-1];f.parse&&(ee[f.component]=f.parse(L[c]))}if(Object.getOwnPropertyNames(ee).length===0)return;let Ne=0;const Qe=c=>{Ne<<=1,Ne+=c?1:0},Be=c=>!(~c&Ne)&&!!(c&Ne);"YXMxWwdD".split("").forEach(c=>Qe(ee[c]));const je=!Be(161)&&Be(130),ot=Be(84),Pt=!ot&&Be(72);Ne=0,"PHhmsf".split("").forEach(c=>Qe(ee[c]));const H=!Be(23)&&Be(47),tt=(je?"YD":ot?"XxwF":Pt?"XWF":"YMD")+(H?"Phmsf":"Hmsf"),zt=this.environment.timestamp;let it=!1,yt=!1;if(tt.split("").forEach(c=>{if(typeof ee[c]>"u")it?(ee[c]="MDd".indexOf(c)!==-1?1:0,yt=!0):ee[c]=ie(zt,c);else if(it=!0,yt)throw{code:"D3136"}}),ee.M>0?ee.M-=1:ee.M=0,je){const c=Date.UTC(ee.Y,0),f=(ee.d-1)*1e3*60*60*24,p=new Date(c+f);ee.M=p.getUTCMonth(),ee.D=p.getUTCDate()}if(ot)throw{code:"D3136"};if(Pt)throw{code:"D3136"};H&&(ee.H=ee.h===12?0:ee.h,ee.P===1&&(ee.H+=12));var q=Date.UTC(ee.Y,ee.M,ee.D,ee.H,ee.m,ee.s,ee.f);return(ee.Z||ee.z)&&(q-=(ee.Z||ee.z)*60*1e3),q}}var fe=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 Ae(A,R){if(!(typeof A>"u"))if(typeof R>"u"){if(!fe.test(A))throw{stack:new Error().stack,code:"D3110",value:A};return Date.parse(A)}else return G.call(this,A,R)}function we(A,R,k){if(!(typeof A>"u"))return nt.call(this,A,R,k)}return{formatInteger:_,parseInteger:y,fromMillis:we,toMillis:Ae}})();r.exports=o},{"./utils":6}],2:[function(t,r,i){(function(u){(function(){var o=t("./utils");const h=(()=>{var b=o.isNumeric,T=o.isArrayOfStrings,M=o.isArrayOfNumbers,S=o.isSequence,w=o.isFunction,P=o.isLambda,D=o.isPromise,N=o.getFunctionArity,Z=o.isDeepEqual,Y=o.stringToArray;function E(s){if(!(typeof s>"u")){var a=0;return s.forEach(function(l){a+=l}),a}}function m(s){return typeof s>"u"?0:s.length}function U(s){if(!(typeof s>"u"||s.length===0))return Math.max.apply(Math,s)}function _(s){if(!(typeof s>"u"||s.length===0))return Math.min.apply(Math,s)}function C(s){if(!(typeof s>"u"||s.length===0)){var a=0;return s.forEach(function(l){a+=l}),a/s.length}}function z(s,a=!1){if(!(typeof s>"u")){var l;if(typeof s=="string")l=s;else if(w(s))l="";else{if(typeof s=="number"&&!isFinite(s))throw{code:"D3001",value:s,stack:new Error().stack};var v=a?2:0;Array.isArray(s)&&s.outerWrapper&&(s=s[0]),l=JSON.stringify(s,function(g,x){return typeof x<"u"&&x!==null&&b(x)?x.toPrecision&&!Number.isInteger(x)?Number(x.toPrecision(15)):x:x&&w(x)?"":x},v)}return l}}function O(s,a,l){if(!(typeof s>"u")){var v=Y(s),g=v.length;if(g+a<0&&(a=0),typeof l<"u"){if(l<=0)return"";var x=a>=0?a+l:g+a+l;return v.slice(a,x).join("")}return v.slice(a).join("")}}function re(s,a){if(!(typeof s>"u")){var l=s.indexOf(a);return l>-1?s.substr(0,l):s}}function ae(s,a){if(!(typeof s>"u")){var l=s.indexOf(a);return l>-1?s.substr(l+a.length):s}}function _e(s){if(!(typeof s>"u"))return s.toLowerCase()}function ge(s){if(!(typeof s>"u"))return s.toUpperCase()}function pe(s){if(!(typeof s>"u"))return Y(s).length}function Pe(s){if(!(typeof s>"u")){var a=s.replace(/[ \t\n\r]+/gm," ");return a.charAt(0)===" "&&(a=a.substring(1)),a.charAt(a.length-1)===" "&&(a=a.substring(0,a.length-1)),a}}function Je(s,a,l){if(!(typeof s>"u")){(typeof l>"u"||l.length===0)&&(l=" ");var v;a=Math.trunc(a);var g=Math.abs(a)-pe(s);if(g>0){var x=new Array(g+1).join(l);l.length>1&&(x=O(x,0,g)),a>0?v=s+x:v=x+s}else v=s;return v}}async function ce(s,a){var l=s.apply(this,[a]);if(D(l)&&(l=await l),l&&!(typeof l.start=="number"||l.end==="number"||Array.isArray(l.groups)||w(l.next)))throw{code:"T1010",stack:new Error().stack};return l}async function me(s,a){if(!(typeof s>"u"||typeof a>"u")){var l;if(typeof a=="string")l=s.indexOf(a)!==-1;else{var v=await ce(a,s);l=typeof v<"u"}return l}}async function We(s,a,l){if(!(typeof s>"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 g=0,x=await ce(a,s);if(typeof x<"u")for(;typeof x<"u"&&(typeof l>"u"||g<l);)v.push({match:x.match,index:x.start,groups:x.groups}),x=await ce(x.next),g++}return v}}async function ie(s,a,l,v){if(!(typeof s>"u")){var g=this;if(a==="")throw{code:"D3010",stack:new Error().stack,value:a,index:2};if(v<0)throw{code:"D3011",stack:new Error().stack,value:v,index:4};var x;typeof l=="string"?x=function(Se){for(var Me="",be=0,Re=l.indexOf("$",be);Re!==-1&&be<l.length;){Me+=l.substring(be,Re),be=Re+1;var et=l.charAt(be);if(et==="$")Me+="$",be++;else if(et==="0")Me+=Se.match,be++;else{var qe;if(Se.groups.length===0?qe=1:qe=Math.floor(Math.log(Se.groups.length)*Math.LOG10E)+1,Re=parseInt(l.substring(be,be+qe),10),qe>1&&Re>Se.groups.length&&(Re=parseInt(l.substring(be,be+qe-1),10)),isNaN(Re))Me+="$";else{if(Se.groups.length>0){var st=Se.groups[Re-1];typeof st<"u"&&(Me+=st)}be+=Re.toString().length}}Re=l.indexOf("$",be)}return Me+=l.substring(be),Me}:x=l;var $="",B=0;if(typeof v>"u"||v>0){var se=0;if(typeof a=="string"){for(var J=s.indexOf(a,B);J!==-1&&(typeof v>"u"||se<v);)$+=s.substring(B,J),$+=l,B=J+a.length,se++,J=s.indexOf(a,B);$+=s.substring(B)}else{var Ee=await ce(a,s);if(typeof Ee<"u"){for(;typeof Ee<"u"&&(typeof v>"u"||se<v);){$+=s.substring(B,Ee.start);var xe=x.apply(g,[Ee]);if(D(xe)&&(xe=await xe),typeof xe=="string")$+=xe;else throw{code:"D3012",stack:new Error().stack,value:xe};B=Ee.start+Ee.match.length,se++,Ee=await ce(Ee.next)}$+=s.substring(B)}else $=s}}else $=s;return $}}function Ce(s){if(!(typeof s>"u")){var a=typeof window<"u"?window.btoa:function(l){return new u.Buffer.from(l,"binary").toString("base64")};return a(s)}}function nt(s){if(!(typeof s>"u")){var a=typeof window<"u"?window.atob:function(l){return new u.Buffer.from(l,"base64").toString("binary")};return a(s)}}function d(s){if(!(typeof s>"u")){var a;try{a=encodeURIComponent(s)}catch{throw{code:"D3140",stack:new Error().stack,value:s,functionName:"encodeUrlComponent"}}return a}}function y(s){if(!(typeof s>"u")){var a;try{a=encodeURI(s)}catch{throw{code:"D3140",stack:new Error().stack,value:s,functionName:"encodeUrl"}}return a}}function G(s){if(!(typeof s>"u")){var a;try{a=decodeURIComponent(s)}catch{throw{code:"D3140",stack:new Error().stack,value:s,functionName:"decodeUrlComponent"}}return a}}function fe(s){if(!(typeof s>"u")){var a;try{a=decodeURI(s)}catch{throw{code:"D3140",stack:new Error().stack,value:s,functionName:"decodeUrl"}}return a}}async function Ae(s,a,l){if(!(typeof s>"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 a=="string")v=s.split(a,l);else{var g=0,x=await ce(a,s);if(typeof x<"u"){for(var $=0;typeof x<"u"&&(typeof l>"u"||g<l);)v.push(s.substring($,x.start)),$=x.end,x=await ce(x.next),g++;(typeof l>"u"||g<l)&&v.push(s.substring($))}else v.push(s)}return v}}function we(s,a){if(!(typeof s>"u"))return typeof a>"u"&&(a=""),s.join(a)}function A(s,a,l){if(!(typeof s>"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":";"},g=v;typeof l<"u"&&o.keys(l).forEach(function(ne){g[ne]=l[ne]});for(var x=[],$=g["zero-digit"].charCodeAt(0),B=$;B<$+10;B++)x.push(String.fromCharCode(B));var se=x.concat([g["decimal-separator"],g["exponent-separator"],g["grouping-separator"],g.digit,g["pattern-separator"]]),J=a.split(g["pattern-separator"]);if(J.length>2)throw{code:"D3080",stack:new Error().stack};var Ee=function(ne){var Te=(function(){for(var Fe,Ze=0;Ze<ne.length;Ze++)if(Fe=ne.charAt(Ze),se.indexOf(Fe)!==-1&&Fe!==g["exponent-separator"])return ne.substring(0,Ze);return""})(),ze=(function(){for(var Fe,Ze=ne.length-1;Ze>=0;Ze--)if(Fe=ne.charAt(Ze),se.indexOf(Fe)!==-1&&Fe!==g["exponent-separator"])return ne.substring(Ze+1);return""})(),ke=ne.substring(Te.length,ne.length-ze.length),Xe,mt,Ye,wt,Ke=ne.indexOf(g["exponent-separator"],Te.length);Ke===-1||Ke>ne.length-ze.length?(Xe=ke,mt=void 0):(Xe=ke.substring(0,Ke),mt=ke.substring(Ke+1));var rt=Xe.indexOf(g["decimal-separator"]);return rt===-1?(Ye=Xe,wt=ze):(Ye=Xe.substring(0,rt),wt=Xe.substring(rt+1)),{prefix:Te,suffix:ze,activePart:ke,mantissaPart:Xe,exponentPart:mt,integerPart:Ye,fractionalPart:wt,subpicture:ne}},xe=function(ne){var Te,ze,ke=ne.subpicture,Xe=ke.indexOf(g["decimal-separator"]);Xe!==ke.lastIndexOf(g["decimal-separator"])&&(Te="D3081"),ke.indexOf(g.percent)!==ke.lastIndexOf(g.percent)&&(Te="D3082"),ke.indexOf(g["per-mille"])!==ke.lastIndexOf(g["per-mille"])&&(Te="D3083"),ke.indexOf(g.percent)!==-1&&ke.indexOf(g["per-mille"])!==-1&&(Te="D3084");var mt=!1;for(ze=0;ze<ne.mantissaPart.length;ze++){var Ye=ne.mantissaPart.charAt(ze);if(x.indexOf(Ye)!==-1||Ye===g.digit){mt=!0;break}}mt||(Te="D3085");var wt=ne.activePart.split("").map(function(Fe){return se.indexOf(Fe)===-1?"p":"a"}).join("");wt.indexOf("p")!==-1&&(Te="D3086"),Xe!==-1?(ke.charAt(Xe-1)===g["grouping-separator"]||ke.charAt(Xe+1)===g["grouping-separator"])&&(Te="D3087"):ne.integerPart.charAt(ne.integerPart.length-1)===g["grouping-separator"]&&(Te="D3088"),ke.indexOf(g["grouping-separator"]+g["grouping-separator"])!==-1&&(Te="D3089");var Ke=ne.integerPart.indexOf(g.digit);Ke!==-1&&ne.integerPart.substring(0,Ke).split("").filter(function(Fe){return x.indexOf(Fe)>-1}).length>0&&(Te="D3090"),Ke=ne.fractionalPart.lastIndexOf(g.digit),Ke!==-1&&ne.fractionalPart.substring(Ke).split("").filter(function(Fe){return x.indexOf(Fe)>-1}).length>0&&(Te="D3091");var rt=typeof ne.exponentPart=="string";if(rt&&ne.exponentPart.length>0&&(ke.indexOf(g.percent)!==-1||ke.indexOf(g["per-mille"])!==-1)&&(Te="D3092"),rt&&(ne.exponentPart.length===0||ne.exponentPart.split("").filter(function(Fe){return x.indexOf(Fe)===-1}).length>0)&&(Te="D3093"),Te)throw{code:Te,stack:new Error().stack}},Se=function(ne){var Te=function(Ie,dr){for(var Wt=[],ut=Ie.indexOf(g["grouping-separator"]);ut!==-1;){var pr=(dr?Ie.substring(0,ut):Ie.substring(ut)).split("").filter(function(Dt){return x.indexOf(Dt)!==-1||Dt===g.digit}).length;Wt.push(pr),ut=ne.integerPart.indexOf(g["grouping-separator"],ut+1)}return Wt},ze=Te(ne.integerPart),ke=function(Ie){if(Ie.length===0)return 0;for(var dr=function(pr,Dt){return Dt===0?pr:dr(Dt,pr%Dt)},Wt=Ie.reduce(dr),ut=1;ut<=Ie.length;ut++)if(Ie.indexOf(ut*Wt)===-1)return 0;return Wt},Xe=ke(ze),mt=Te(ne.fractionalPart,!0),Ye=ne.integerPart.split("").filter(function(Ie){return x.indexOf(Ie)!==-1}).length,wt=Ye,Ke=ne.fractionalPart.split(""),rt=Ke.filter(function(Ie){return x.indexOf(Ie)!==-1}).length,Fe=Ke.filter(function(Ie){return x.indexOf(Ie)!==-1||Ie===g.digit}).length,Ze=typeof ne.exponentPart=="string";Ye===0&&Fe===0&&(Ze?(rt=1,Fe=1):Ye=1),Ze&&Ye===0&&ne.integerPart.indexOf(g.digit)!==-1&&(Ye=1),Ye===0&&rt===0&&(rt=1);var In=0;return Ze&&(In=ne.exponentPart.split("").filter(function(Ie){return x.indexOf(Ie)!==-1}).length),{integerPartGroupingPositions:ze,regularGrouping:Xe,minimumIntegerPartSize:Ye,scalingFactor:wt,prefix:ne.prefix,fractionalPartGroupingPositions:mt,minimumFactionalPartSize:rt,maximumFactionalPartSize:Fe,minimumExponentSize:In,suffix:ne.suffix,picture:ne.subpicture}},Me=J.map(Ee);Me.forEach(xe);var be=Me.map(Se),Re=g["minus-sign"],et=g["zero-digit"],qe=g["decimal-separator"],st=g["grouping-separator"];be.length===1&&(be.push(JSON.parse(JSON.stringify(be[0]))),be[1].prefix=Re+be[1].prefix);var Ue;s>=0?Ue=be[0]:Ue=be[1];var Gt;Ue.picture.indexOf(g.percent)!==-1?Gt=s*100:Ue.picture.indexOf(g["per-mille"])!==-1?Gt=s*1e3:Gt=s;var pt,Rt;if(Ue.minimumExponentSize===0)pt=Gt;else{var Ms=Math.pow(10,Ue.scalingFactor),Us=Math.pow(10,Ue.scalingFactor-1);if(pt=Gt,Rt=0,pt!==0){for(;Math.abs(pt)<Us;)pt*=10,Rt-=1;for(;Math.abs(pt)>Ms;)pt/=10,Rt+=1}}var Fs=L(pt,Ue.maximumFactionalPartSize),$n=function(ne,Te){var ze=Math.abs(ne).toFixed(Te);return et!=="0"&&(ze=ze.split("").map(function(ke){return ke>="0"&&ke<="9"?x[ke.charCodeAt(0)-48]:ke}).join("")),ze},oe=$n(Fs,Ue.maximumFactionalPartSize),He=oe.indexOf(".");for(He===-1?oe=oe+qe:oe=oe.replace(".",qe);oe.charAt(0)===et;)oe=oe.substring(1);for(;oe.charAt(oe.length-1)===et;)oe=oe.substring(0,oe.length-1);He=oe.indexOf(qe);var Vt=Ue.minimumIntegerPartSize-He,Nn=Ue.minimumFactionalPartSize-(oe.length-He-1);if(oe=(Vt>0?new Array(Vt+1).join(et):"")+oe,oe=oe+(Nn>0?new Array(Nn+1).join(et):""),He=oe.indexOf(qe),Ue.regularGrouping>0)for(var Os=Math.floor((He-1)/Ue.regularGrouping),fr=1;fr<=Os;fr++)oe=[oe.slice(0,He-fr*Ue.regularGrouping),st,oe.slice(He-fr*Ue.regularGrouping)].join("");else Ue.integerPartGroupingPositions.forEach(function(ne){oe=[oe.slice(0,He-ne),st,oe.slice(He-ne)].join(""),He++});if(He=oe.indexOf(qe),Ue.fractionalPartGroupingPositions.forEach(function(ne){oe=[oe.slice(0,ne+He+1),st,oe.slice(ne+He+1)].join("")}),He=oe.indexOf(qe),(Ue.picture.indexOf(qe)===-1||He===oe.length-1)&&(oe=oe.substring(0,oe.length-1)),typeof Rt<"u"){var hr=$n(Rt,0);Vt=Ue.minimumExponentSize-hr.length,Vt>0&&(hr=new Array(Vt+1).join(et)+hr),oe=oe+g["exponent-separator"]+(Rt<0?Re:"")+hr}return oe=Ue.prefix+oe+Ue.suffix,oe}}function R(s,a){if(!(typeof s>"u")){if(s=L(s),typeof a>"u"?a=10:a=L(a),a<2||a>36)throw{code:"D3100",stack:new Error().stack,value:a};var l=s.toString(a);return l}}function k(s){var a;if(!(typeof s>"u")){if(typeof s=="number")a=s;else if(typeof s=="string"&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(s)&&!isNaN(parseFloat(s))&&isFinite(s))a=parseFloat(s);else if(typeof s=="string"&&/^(0[xX][0-9A-Fa-f]+)|(0[oO][0-7]+)|(0[bB][0-1]+)$/.test(s))a=Number(s);else if(s===!0)a=1;else if(s===!1)a=0;else throw{code:"D3030",value:s,stack:new Error().stack,index:1};return a}}function F(s){var a;if(!(typeof s>"u"))return a=Math.abs(s),a}function j(s){var a;if(!(typeof s>"u"))return a=Math.floor(s),a}function I(s){var a;if(!(typeof s>"u"))return a=Math.ceil(s),a}function L(s,a){var l;if(!(typeof s>"u")){if(a){var v=s.toString().split("e");s=+(v[0]+"e"+(v[1]?+v[1]+a:a))}l=Math.round(s);var g=l-s;return Math.abs(g)===.5&&Math.abs(l%2)===1&&(l=l-1),a&&(v=l.toString().split("e"),l=+(v[0]+"e"+(v[1]?+v[1]-a:-a))),Object.is(l,-0)&&(l=0),l}}function q(s){var a;if(!(typeof s>"u")){if(s<0)throw{stack:new Error().stack,code:"D3060",index:1,value:s};return a=Math.sqrt(s),a}}function K(s,a){var l;if(!(typeof s>"u")){if(l=Math.pow(s,a),!isFinite(l))throw{stack:new Error().stack,code:"D3061",index:1,value:s,exp:a};return l}}function he(){return Math.random()}function ue(s){if(!(typeof s>"u")){var a=!1;if(Array.isArray(s)){if(s.length===1)a=ue(s[0]);else if(s.length>1){var l=s.filter(function(v){return ue(v)});a=l.length>0}}else typeof s=="string"?s.length>0&&(a=!0):b(s)?s!==0&&(a=!0):s!==null&&typeof s=="object"&&!w(s)?o.keys(s).length>0&&(a=!0):typeof s=="boolean"&&s===!0&&(a=!0);return a}}function te(s){if(!(typeof s>"u"))return!ue(s)}function Q(s,a,l,v){var g=[a],x=N(s);return x>=2&&g.push(l),x>=3&&g.push(v),g}async function le(s,a){if(!(typeof s>"u")){for(var l=this.createSequence(),v=0;v<s.length;v++){var g=Q(a,s[v],v,s),x=await a.apply(this,g);typeof x<"u"&&l.push(x)}return l}}async function ee(s,a){if(!(typeof s>"u")){for(var l=this.createSequence(),v=0;v<s.length;v++){var g=s[v],x=Q(a,g,v,s),$=await a.apply(this,x);ue($)&&l.push(g)}return l}}async function Ne(s,a){if(!(typeof s>"u")){for(var l=!1,v,g=0;g<s.length;g++){var x=s[g],$=!0;if(typeof a<"u"){var B=Q(a,x,g,s),se=await a.apply(this,B);$=ue(se)}if($)if(!l)v=x,l=!0;else throw{stack:new Error().stack,code:"D3138",index:g}}if(!l)throw{stack:new Error().stack,code:"D3139"};return v}}function Qe(){for(var s=[],a=Array.prototype.slice.call(arguments),l=Math.min.apply(Math,a.map(function(x){return Array.isArray(x)?x.length:0})),v=0;v<l;v++){var g=a.map(x=>x[v]);s.push(g)}return s}async function Be(s,a,l){if(!(typeof s>"u")){var v,g=N(a);if(g<2)throw{stack:new Error().stack,code:"D3050",index:1};var x;for(typeof l>"u"&&s.length>0?(v=s[0],x=1):(v=l,x=0);x<s.length;){var $=[v,s[x]];g>=3&&$.push(x),g>=4&&$.push(s),v=await a.apply(this,$),x++}return v}}function Le(s){var a=this.createSequence();if(Array.isArray(s)){for(var l=Object.create(null),v=0;v<s.length;v++){var g=Le.call(this,s[v]);g.forEach(function(x){l[x]=!0})}a=Le.call(this,l)}else s!==null&&typeof s=="object"&&!w(s)&&o.keys(s).forEach(x=>a.push(x));return a}function je(s,a){var l;if(Array.isArray(s)){l=this.createSequence();for(var v=0;v<s.length;v++){var g=je.call(this,s[v],a);typeof g<"u"&&(Array.isArray(g)?g.forEach(x=>l.push(x)):l.push(g))}}else s!==null&&typeof s=="object"&&Object.prototype.hasOwnProperty.call(s,a)&&!w(s)&&(l=s[a]);return l}function ot(s,a){if(typeof s>"u")return a;if(typeof a>"u")return s;Array.isArray(s)||(s=this.createSequence(s)),Array.isArray(a)||(a=[a]);const l=s.length+a.length;if(this.options&&l>this.options.sequence)throw{code:"D2015",stack:new Error().stack,value:l};return s.concat(a)}function Pt(s){return!(typeof s>"u")}function Ct(s){var a=this.createSequence();if(Array.isArray(s))for(var l=0;l<s.length;l++)a=ot.call(this,a,Ct.call(this,s[l]));else if(s!==null&&typeof s=="object"&&!P(s))for(const g of o.keys(s)){var v=Object.create(null);v[g]=s[g],a.push(v)}else a=s;return a}function H(s){if(!(typeof s>"u")){var a=Object.create(null);return s.forEach(function(l){for(const v of o.keys(l))a[v]=l[v]}),a}}function cr(s){if(!(typeof s>"u")){if(s.length<=1)return s;for(var a=s.length,l=new Array(a),v=0;v<a;v++)l[a-v-1]=s[v];return l}}async function lr(s,a){var l=this.createSequence();for(const x of o.keys(s)){var v=Q(a,s[x],x,s),g=await a.apply(this,v);typeof g<"u"&&l.push(g)}return l}function tt(s){throw{code:"D3137",stack:new Error().stack,message:s||"$error() function evaluated"}}function zt(s,a){if(!s)throw{code:"D3141",stack:new Error().stack,message:a||"$assert() statement failed"}}function it(s){if(s!==void 0)return s===null?"null":b(s)?"number":typeof s=="string"?"string":typeof s=="boolean"?"boolean":Array.isArray(s)?"array":w(s)?"function":"object"}async function yt(s,a){if(!(typeof s>"u")){if(s.length<=1)return s;var l;if(typeof a>"u"){if(!M(s)&&!T(s))throw{stack:new Error().stack,code:"D3070",index:1};l=async function($,B){return $>B}}else l=a;var v=async function($,B){var se=async function(Ee,xe,Se){xe.length===0?Array.prototype.push.apply(Ee,Se):Se.length===0?Array.prototype.push.apply(Ee,xe):await l(xe[0],Se[0])?(Ee.push(Se[0]),await se(Ee,xe,Se.slice(1))):(Ee.push(xe[0]),await se(Ee,xe.slice(1),Se))},J=[];return await se(J,$,B),J},g=async function($){if(!Array.isArray($)||$.length<=1)return $;var B=Math.floor($.length/2),se=$.slice(0,B),J=$.slice(B);return se=await g(se),J=await g(J),await v(se,J)},x=await g(s);return x}}function c(s){if(!(typeof s>"u")){if(s.length<=1)return s;for(var a=new Array(s.length),l=0;l<s.length;l++){var v=Math.floor(Math.random()*(l+1));l!==v&&(a[l]=a[v]),a[v]=s[l]}return a}}function f(s){if(!(typeof s>"u")){if(!Array.isArray(s)||s.length<=1)return s;for(var a=S(s)?this.createSequence():[],l=0;l<s.length;l++){for(var v=s[l],g=!1,x=0;x<a.length;x++)if(Z(v,a[x])){g=!0;break}g||a.push(v)}return a}}async function p(s,a){var l=Object.create(null);for(const $ of o.keys(s)){var v=s[$],g=Q(a,v,$,s),x=await a.apply(this,g);ue(x)&&(l[$]=v)}return o.keys(l).length===0&&(l=void 0),l}return{sum:E,count:m,max:U,min:_,average:C,string:z,substring:O,substringBefore:re,substringAfter:ae,lowercase:_e,uppercase:ge,length:pe,trim:Pe,pad:Je,match:We,contains:me,replace:ie,split:Ae,join:we,formatNumber:A,formatBase:R,number:k,floor:j,ceil:I,round:L,abs:F,sqrt:q,power:K,random:he,boolean:ue,not:te,map:le,zip:Qe,filter:ee,single:Ne,foldLeft:Be,sift:p,keys:Le,lookup:je,append:ot,exists:Pt,spread:Ct,merge:H,reverse:cr,each:lr,error:tt,assert:zt,type:it,sort:yt,shuffle:c,distinct:f,base64encode:Ce,base64decode:nt,encodeUrlComponent:d,encodeUrl:y,decodeUrlComponent:G,decodeUrl:fe}})();r.exports=h}).call(this)}).call(this,typeof vn<"u"?vn:typeof self<"u"?self:typeof window<"u"?window:{})},{"./utils":6}],3:[function(t,r,i){var u=t("./datetime"),o=t("./functions"),h=t("./utils"),b=t("./parser"),T=t("./signature"),M=(function(){var S=h.isNumeric,w=h.isArrayOfStrings,P=h.isArrayOfNumbers,D=h.isSequence,N=h.isFunction,Z=h.isLambda,Y=h.isIterable,E=h.isPromise,m=h.getFunctionArity,U=h.isDeepEqual,_=tt(null);async function C(c,f,p){var s;p.base.depth++,p.base.guardrails();var a=p.lookup(Symbol.for("jsonata.__evaluate_entry"));switch(a&&await a(c,f,p),c.type){case"path":s=await z(c,f,p);break;case"binary":s=await pe(c,f,p);break;case"unary":s=await Pe(c,f,p);break;case"name":s=Je(c,f,p);break;case"string":case"number":case"value":s=ce(c);break;case"wildcard":s=me(c,f,p);break;case"descendant":s=ie(c,f,p);break;case"parent":s=p.lookup(c.slot.label);break;case"condition":s=await j(c,f,p);break;case"block":s=await I(c,f,p);break;case"bind":s=await F(c,f,p);break;case"regex":s=L(c,f,p);break;case"function":s=await Q(c,f,p);break;case"variable":s=q(c,f,p);break;case"lambda":s=Ne(c,f,p);break;case"partial":s=await Qe(c,f,p);break;case"apply":s=await te(c,f,p);break;case"transform":s=he(c,f,p);break}if(Object.prototype.hasOwnProperty.call(c,"predicate"))for(var l=0;l<c.predicate.length;l++)s=await ge(c.predicate[l].expr,s,p);c.type!=="path"&&Object.prototype.hasOwnProperty.call(c,"group")&&(s=await A(c.group,s,p));var v=p.lookup(Symbol.for("jsonata.__evaluate_exit"));return v&&await v(c,f,p,s),s&&D(s)&&!s.tupleStream&&(c.keepArray&&(s.keepSingleton=!0),s.length===0?s=void 0:s.length===1&&(s=s.keepSingleton?s:s[0])),p.base.depth--,s}async function z(c,f,p){var s;Array.isArray(f)&&c.steps[0].type!=="variable"?s=f:s=p.base.createSequence(f);for(var a,l=!1,v=void 0,g=0;g<c.steps.length;g++){var x=c.steps[g];if(x.tuple&&(l=!0),g===0&&x.consarray?a=await C(x,s,p):l?v=await _e(x,s,v,p):a=await re(x,s,p,g===c.steps.length-1),!l&&(typeof a>"u"||a.length===0))break;typeof x.focus>"u"&&(s=a)}if(l)if(c.tuple)a=v;else for(a=p.base.createSequence(),g=0;g<v.length;g++)a.push(v[g]["@"]);return c.keepSingletonArray&&(Array.isArray(a)&&a.cons&&!a.sequence&&(a=p.base.createSequence(a)),a.keepSingleton=!0),Object.prototype.hasOwnProperty.call(c,"group")&&(a=await A(c.group,l?v:a,p)),a}function O(c,f){var p=tt(c);for(const s of h.keys(f))p.bind(s,f[s]);return p}async function re(c,f,p,s){var a;if(c.type==="sort")return a=await K(c,f,p),c.stages&&(a=await ae(c.stages,a,p)),a;a=p.base.createSequence();for(var l=0;l<f.length;l++){var v=await C(c,f[l],p);if(c.stages)for(var g=0;g<c.stages.length;g++)v=await ge(c.stages[g].expr,v,p);typeof v<"u"&&a.push(v)}var x=p.base.createSequence();return s&&a.length===1&&Array.isArray(a[0])&&!D(a[0])?x=a[0]:Array.prototype.forEach.call(a,function($){!Array.isArray($)||$.cons?x.push($):Array.prototype.forEach.call($,B=>x.push(B))}),x}async function ae(c,f,p){for(var s=f,a=0;a<c.length;a++){var l=c[a];switch(l.type){case"filter":s=await ge(l.expr,s,p);break;case"index":for(var v=0;v<s.length;v++){var g=s[v];g[l.value]=v}break}}return s}async function _e(c,f,p,s){var a;if(c.type==="sort"){if(p)a=await K(c,p,s);else{var l=await K(c,f,s);a=s.base.createSequence(),a.tupleStream=!0;for(var v=0;v<l.length;v++){var g={"@":l[v]};g[c.index]=v,a.push(g)}}return c.stages&&(a=await ae(c.stages,a,s)),a}a=s.base.createSequence(),a.tupleStream=!0;var x=s;p===void 0&&(p=f.map(J=>({"@":J})));for(var $=0;$<p.length;$++){x=O(s,p[$]);var B=await C(c,p[$]["@"],x);if(typeof B<"u"){Array.isArray(B)||(B=[B]);for(var se=0;se<B.length;se++)g=Object.create(null),Object.assign(g,p[$]),B.tupleStream?Object.assign(g,B[se]):(c.focus?(g[c.focus]=B[se],g["@"]=p[$]["@"]):g["@"]=B[se],c.index&&(g[c.index]=se),c.ancestor&&(g[c.ancestor.label]=p[$]["@"])),a.push(g)}}return c.stages&&(a=await ae(c.stages,a,s)),a}async function ge(c,f,p){var s=p.base.createSequence();if(f&&f.tupleStream&&(s.tupleStream=!0),Array.isArray(f)||(f=p.base.createSequence(f)),c.type==="number"){var a=Math.floor(c.value);a<0&&(a=f.length+a);var l=await f[a];typeof l<"u"&&(Array.isArray(l)?s=l:s.push(l))}else for(a=0;a<f.length;a++){var l=f[a],v=l,g=p;f.tupleStream&&(v=l["@"],g=O(p,l));var x=await C(c,v,g);S(x)&&(x=[x]),P(x)?Array.prototype.forEach.call(x,function(B){var se=Math.floor(B);se<0&&(se=f.length+se),se===a&&s.push(l)}):o.boolean(x)&&s.push(l)}return s}async function pe(c,f,p){var s,a=await C(c.lhs,f,p),l=c.value,v=async()=>await C(c.rhs,f,p);if(l==="and"||l==="or")try{return await fe(a,v,l)}catch(x){throw x.position=c.position,x.token=l,x}var g=await v();try{switch(l){case"+":case"-":case"*":case"/":case"%":s=nt(a,g,l);break;case"=":case"!=":s=d(a,g,l);break;case"<":case"<=":case">":case">=":s=y(a,g,l);break;case"&":s=we(a,g);break;case"..":s=k(a,g,p);break;case"in":s=G(a,g);break}}catch(x){throw x.position=c.position,x.token=l,x}return s}async function Pe(c,f,p){var s,a={options:p.base.options,createSequence:p.base.createSequence};switch(c.value){case"-":if(s=await C(c.expression,f,p),typeof s>"u")s=void 0;else if(S(s))s=-s;else throw{code:"D1002",stack:new Error().stack,position:c.position,token:c.value,value:s};break;case"[":s=[];let g=await Promise.all(c.expressions.map(async(x,$)=>(p.isParallelCall=$>0,[x,await C(x,f,p)])));for(let x of g){var[l,v]=x;typeof v<"u"&&(l.value==="["?s.push(v):s=o.append.call(a,s,v))}c.consarray&&Object.defineProperty(s,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":s=await A(c,f,p);break}return s}function Je(c,f,p){var s={createSequence:p.base.createSequence};return o.lookup.call(s,f,c.value)}function ce(c){return c.value}function me(c,f,p){var s={options:p.base.options,createSequence:p.base.createSequence},a=s.createSequence();return Array.isArray(f)&&f.outerWrapper&&f.length>0&&(f=f[0]),f!==null&&typeof f=="object"&&!N(f)&&h.keys(f).forEach(function(l){var v=f[l];Array.isArray(v)?(v=We(v),a=o.append.call(s,a,v)):a.push(v)}),a}function We(c,f){return typeof f>"u"&&(f=[]),Array.isArray(c)?Array.prototype.forEach.call(c,function(p){We(p,f)}):f.push(c),f}function ie(c,f,p){var s,a=p.base.createSequence();return typeof f<"u"&&(Ce(f,a),a.length===1?s=a[0]:s=a),s}function Ce(c,f){Array.isArray(c)||f.push(c),Array.isArray(c)?Array.prototype.forEach.call(c,function(p){Ce(p,f)}):c!==null&&typeof c=="object"&&!N(c)&&h.keys(c).forEach(function(p){Ce(c[p],f)})}function nt(c,f,p){var s;if(typeof c<"u"&&!S(c))throw{code:"T2001",stack:new Error().stack,value:c};if(typeof f<"u"&&!S(f))throw{code:"T2002",stack:new Error().stack,value:f};if(typeof c>"u"||typeof f>"u")return s;switch(p){case"+":s=c+f;break;case"-":s=c-f;break;case"*":s=c*f;break;case"/":s=c/f;break;case"%":s=c%f;break}return s}function d(c,f,p){var s,a=typeof c,l=typeof f;if(a==="undefined"||l==="undefined")return!1;switch(p){case"=":s=U(c,f);break;case"!=":s=!U(c,f);break}return s}function y(c,f,p){var s,a=typeof c,l=typeof f,v=a==="undefined"||a==="string"||a==="number",g=l==="undefined"||l==="string"||l==="number";if(!v||!g)throw{code:"T2010",stack:new Error().stack,value:a==="string"||a==="number"?f:c};if(!(a==="undefined"||l==="undefined")){if(a!==l)throw{code:"T2009",stack:new Error().stack,value:c,value2:f};switch(p){case"<":s=c<f;break;case"<=":s=c<=f;break;case">":s=c>f;break;case">=":s=c>=f;break}return s}}function G(c,f){var p=!1;if(typeof c>"u"||typeof f>"u")return!1;Array.isArray(f)||(f=[f]);for(var s=0;s<f.length;s++)if(f[s]===c){p=!0;break}return p}async function fe(c,f,p){var s,a=Ae(c);switch(p){case"and":s=a&&Ae(await f());break;case"or":s=a||Ae(await f());break}return s}function Ae(c){var f=o.boolean(c);return typeof f>"u"?!1:f}function we(c,f){var p,s="",a="";return typeof c<"u"&&(s=o.string(c)),typeof f<"u"&&(a=o.string(f)),p=s.concat(a),p}async function A(c,f,p){var s=Object.create(null),a=Object.create(null),l=!!(f&&f.tupleStream),v={options:p.base.options,createSequence:p.base.createSequence};Array.isArray(f)||(p.base.options,f=v.createSequence(f)),f.length===0&&!l&&f.push(void 0);for(var g=0;g<f.length;g++)for(var x=f[g],$=l?O(p,x):p,B=0;B<c.lhs.length;B++){var se=c.lhs[B],J=await C(se[0],l?x["@"]:x,$);if(typeof J!="string"&&J!==void 0)throw{code:"T1003",stack:new Error().stack,position:c.position,value:J};if(J!==void 0){if(J==="_jsonata_lambda"||J==="_jsonata_function")throw{code:"D1013",stack:new Error().stack,position:c.position,value:J};var Ee={data:x,exprIndex:B};if(Object.prototype.hasOwnProperty.call(a,J)){if(a[J].exprIndex!==B)throw{code:"D1009",stack:new Error().stack,position:c.position,value:J};a[J].data=o.append.call(v,a[J].data,x)}else a[J]=Ee}}let xe=await Promise.all(h.keys(a).map(async(Me,be)=>{let Re=a[Me];var et=Re.data,qe=p;if(l){var st=R(Re.data,p);et=st["@"],delete st["@"],qe=O(p,st)}return p.isParallelCall=be>0,[Me,await C(c.lhs[Re.exprIndex][1],et,qe)]}));for(let Me of xe){var[J,Se]=await Me;typeof Se<"u"&&(s[J]=Se)}return s}function R(c,f){if(!Array.isArray(c))return c;var p=Object.create(null),s={options:f.base.options,createSequence:f.base.createSequence};Object.assign(p,c[0]);for(var a=1;a<c.length;a++)for(const l of h.keys(c[a]))p[l]=o.append.call(s,p[l],c[a][l]);return p}function k(c,f,p){var s;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 s;var a=f-c+1;if(a>1e7)throw{code:"D2014",stack:new Error().stack,value:a};if(p.base.options&&a>p.base.options.sequence)throw{code:"D2015",stack:new Error().stack,value:a};s=new Array(a);for(var l=c,v=0;l<=f;l++,v++)s[v]=l;return s.sequence=!0,s}async function F(c,f,p){var s=await C(c.rhs,f,p);return p.bind(c.lhs.value,s),s}async function j(c,f,p){var s,a=await C(c.condition,f,p);return o.boolean(a)?s=await C(c.then,f,p):typeof c.else<"u"&&(s=await C(c.else,f,p)),s}async function I(c,f,p){for(var s,a=tt(p),l=0;l<c.expressions.length;l++)s=await C(c.expressions[l],f,a);return s}function L(c,f,p){var s=new p.base.RegexEngine(c.value),a=function(l,v){var g;s.lastIndex=v||0;var x=s.exec(l);if(x!==null){if(g={match:x[0],start:x.index,end:x.index+x[0].length,groups:[]},x.length>1)for(var $=1;$<x.length;$++)g.groups.push(x[$]);g.next=function(){if(!(s.lastIndex>=l.length)){var B=a(l,s.lastIndex);if(B&&B.match==="")throw{code:"D1004",stack:new Error().stack,position:c.position,value:c.value.source};return B}}}return g};return a}function q(c,f,p){var s;return c.value===""?s=f&&f.outerWrapper?f[0]:f:s=p.lookup(c.value),s}async function K(c,f,p){var s,a=f,l=!!f.tupleStream,v=async function(x,$){for(var B=0,se=0;B===0&&se<c.terms.length;se++){var J=c.terms[se],Ee=x,xe=p;l&&(Ee=x["@"],xe=O(p,x));var Se=await C(J.expression,Ee,xe);Ee=$,xe=p,l&&(Ee=$["@"],xe=O(p,$));var Me=await C(J.expression,Ee,xe),be=typeof Se,Re=typeof Me;if(be==="undefined"){B=Re==="undefined"?0:1;continue}if(Re==="undefined"){B=-1;continue}if(!(be==="string"||be==="number")||!(Re==="string"||Re==="number"))throw{code:"T2008",stack:new Error().stack,position:c.position,value:be==="string"||be==="number"?Me:Se};if(be!==Re)throw{code:"T2007",stack:new Error().stack,position:c.position,value:Se,value2:Me};Se!==Me&&(Se<Me?B=-1:B=1,J.descending===!0&&(B=-B))}return B===1},g={environment:p,input:f};return s=await o.sort.apply(g,[a,v]),s}function he(c,f,p){var s=async function(a){if(!(typeof a>"u")){var l=p.lookup("clone");if(!N(l))throw{code:"T2013",stack:new Error().stack,position:c.position};var v=await le(l,[a],null,p),g=await C(c.pattern,v,p);if(typeof g<"u"){Array.isArray(g)||(g=[g]);for(var x=0;x<g.length;x++){var $=g[x],B=await C(c.update,$,p),se=typeof B;if(se!=="undefined"){if(se!=="object"||B===null||Array.isArray(B))throw{code:"T2011",stack:new Error().stack,position:c.update.position,value:B};for(const Se of h.keys(B))$[Se]=B[Se]}if(typeof c.delete<"u"){var J=await C(c.delete,$,p);if(typeof J<"u"){var Ee=J;if(Array.isArray(J)||(J=[J]),!w(J))throw{code:"T2012",stack:new Error().stack,position:c.delete.position,value:Ee};for(var xe=0;xe<J.length;xe++)typeof $=="object"&&$!==null&&delete $[J[xe]]}}}}return v}};return H(s,"<(oa):o>")}var ue=b("function($f, $g) { function($x){ $g($f($x)) } }");async function te(c,f,p){var s,a=await C(c.lhs,f,p);if(c.rhs.type==="function")s=await Q(c.rhs,f,p,{context:a});else{var l=await C(c.rhs,f,p);if(!N(l))throw{code:"T2006",stack:new Error().stack,position:c.position,value:l};if(N(a)){var v=await C(ue,null,p);s=await le(v,[a,l],null,p)}else s=await le(l,[a],null,p)}return s}async function Q(c,f,p,s){var a,l=await C(c.procedure,f,p);if(typeof l>"u"&&c.procedure.type==="path"&&p.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 s<"u"&&v.push(s.context);for(var g=0;g<c.arguments.length;g++){const $=await C(c.arguments[g],f,p);if(N($)){const B=async function(...se){return await le($,se,null,p)};B.arity=m($),v.push(B)}else v.push($)}var x=c.procedure.type==="path"?c.procedure.steps[0].value:c.procedure.value;try{typeof l=="object"&&(l.token=x,l.position=c.position),a=await le(l,v,f,p)}catch($){throw $.position||($.position=c.position),$.token||($.token=x),$}return a}async function le(c,f,p,s){var a;for(a=await ee(c,f,p,s);Z(a)&&a.thunk===!0;){var l=await C(a.body.procedure,a.input,a.environment);a.body.procedure.type==="variable"&&(l.token=a.body.procedure.value),l.position=a.body.procedure.position;for(var v=[],g=0;g<a.body.arguments.length;g++)v.push(await C(a.body.arguments[g],a.input,a.environment));a=await ee(l,v,p,s)}return a}async function ee(c,f,p,s){var a;try{var l=f;if(c&&(l=Be(c.signature,f,p)),Z(c))a=await Le(c,l);else if(c&&c._jsonata_function===!0){var v={environment:s,input:p,options:s.base.options,createSequence:s.base.createSequence};a=c.implementation.apply(v,l),Y(a)&&(a=a.next().value),E(a)&&(a=await a)}else if(typeof c=="function")a=c.apply(p,l),E(a)&&(a=await a);else throw{code:"T1006",stack:new Error().stack}}catch(g){throw c&&(typeof g.token>"u"&&typeof c.token<"u"&&(g.token=c.token),g.position=c.position||g.position),g}return a}function Ne(c,f,p){var s={_jsonata_lambda:!0,input:f,environment:p,arguments:c.arguments,signature:c.signature,body:c.body};return c.thunk===!0&&(s.thunk=!0),s.apply=async function(a,l){return await le(s,l,f,a?a.environment:p)},s}async function Qe(c,f,p){for(var s,a=[],l=0;l<c.arguments.length;l++){var v=c.arguments[l];v.type==="operator"&&v.value==="?"?a.push(v):a.push(await C(v,f,p))}var g=await C(c.procedure,f,p);if(typeof g>"u"&&c.procedure.type==="path"&&p.lookup(c.procedure.steps[0].value))throw{code:"T1007",stack:new Error().stack,position:c.position,token:c.procedure.steps[0].value};if(Z(g))s=je(g,a,p);else if(g&&g._jsonata_function===!0)s=ot(g.implementation,a,p);else if(typeof g=="function")s=ot(g,a,p);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 s}function Be(c,f,p){if(typeof c>"u")return f;var s=c.validate(f,p);return s}async function Le(c,f){var p,s=tt(c.environment);return Array.prototype.forEach.call(c.arguments,function(a,l){s.bind(a.value,f[l])}),typeof c.body=="function"?p=await Pt(c.body,s):p=await C(c.body,c.input,s),p}function je(c,f,p){var s=tt(c.environment||p),a=[];Array.prototype.forEach.call(c.arguments,function(v,g){var x=f[g];x&&x.type==="operator"&&x.value==="?"?a.push(v):s.bind(v.value,x)});var l={_jsonata_lambda:!0,input:c.input,environment:s,arguments:a,body:c.body};return l}function ot(c,f,p){var s=Ct(c);s=s.map(function(g){return"$"+g.trim()});var a="function("+s.join(", ")+"){ _ }",l=b(a);l.body=c;var v=je(l,f,p);return v}async function Pt(c,f){var p=Ct(c),s=p.map(function(v){return f.lookup(v.trim())}),a={environment:f,createSequence:f.base.createSequence},l=c.apply(a,s);return E(l)&&(l=await l),l}function Ct(c){var f=c.toString(),p=/\(([^)]*)\)/.exec(f)[1],s=p.split(",");return s}function H(c,f){var p={_jsonata_function:!0,implementation:c};return typeof f<"u"&&(p.signature=T(f)),p}async function cr(c,f){if(!(typeof c>"u")){var p=this.input;typeof f<"u"&&(p=f,Array.isArray(p)&&!D(p)&&(p=this.createSequence(p),p.outerWrapper=!0));try{var s=b(c,!1)}catch(l){throw it(l),{stack:new Error().stack,code:"D3120",value:l.message,error:l}}try{var a=await C(s,p,this.environment)}catch(l){throw it(l),{stack:new Error().stack,code:"D3121",value:l.message,error:l}}return a}}function lr(c){if(!(typeof c>"u"))return JSON.parse(o.string(c))}function tt(c){var f=Object.create(null);const p={bind:function(a,l){f[a]=l},lookup:function(a){var l;return Object.prototype.hasOwnProperty.call(f,a)?l=f[a]:c&&(l=c.lookup(a)),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 s=c.lookup(Symbol.for("jsonata.__createFrame_push"));s&&s(c,p),p.base=c.base}return p}_.bind("sum",H(o.sum,"<a<n>:n>")),_.bind("count",H(o.count,"<a:n>")),_.bind("max",H(o.max,"<a<n>:n>")),_.bind("min",H(o.min,"<a<n>:n>")),_.bind("average",H(o.average,"<a<n>:n>")),_.bind("string",H(o.string,"<x-b?:s>")),_.bind("substring",H(o.substring,"<s-nn?:s>")),_.bind("substringBefore",H(o.substringBefore,"<s-s:s>")),_.bind("substringAfter",H(o.substringAfter,"<s-s:s>")),_.bind("lowercase",H(o.lowercase,"<s-:s>")),_.bind("uppercase",H(o.uppercase,"<s-:s>")),_.bind("length",H(o.length,"<s-:n>")),_.bind("trim",H(o.trim,"<s-:s>")),_.bind("pad",H(o.pad,"<s-ns?:s>")),_.bind("match",H(o.match,"<s-f<s:o>n?:a<o>>")),_.bind("contains",H(o.contains,"<s-(sf):b>")),_.bind("replace",H(o.replace,"<s-(sf)(sf)n?:s>")),_.bind("split",H(o.split,"<s-(sf)n?:a<s>>")),_.bind("join",H(o.join,"<a<s>s?:s>")),_.bind("formatNumber",H(o.formatNumber,"<n-so?:s>")),_.bind("formatBase",H(o.formatBase,"<n-n?:s>")),_.bind("formatInteger",H(u.formatInteger,"<n-s:s>")),_.bind("parseInteger",H(u.parseInteger,"<s-s:n>")),_.bind("number",H(o.number,"<(nsb)-:n>")),_.bind("floor",H(o.floor,"<n-:n>")),_.bind("ceil",H(o.ceil,"<n-:n>")),_.bind("round",H(o.round,"<n-n?:n>")),_.bind("abs",H(o.abs,"<n-:n>")),_.bind("sqrt",H(o.sqrt,"<n-:n>")),_.bind("power",H(o.power,"<n-n:n>")),_.bind("random",H(o.random,"<:n>")),_.bind("boolean",H(o.boolean,"<x-:b>")),_.bind("not",H(o.not,"<x-:b>")),_.bind("map",H(o.map,"<af>")),_.bind("zip",H(o.zip,"<a+>")),_.bind("filter",H(o.filter,"<af>")),_.bind("single",H(o.single,"<af?>")),_.bind("reduce",H(o.foldLeft,"<afj?:j>")),_.bind("sift",H(o.sift,"<o-f?:o>")),_.bind("keys",H(o.keys,"<x-:a<s>>")),_.bind("lookup",H(o.lookup,"<x-s:x>")),_.bind("append",H(o.append,"<xx:a>")),_.bind("exists",H(o.exists,"<x:b>")),_.bind("spread",H(o.spread,"<x-:a<o>>")),_.bind("merge",H(o.merge,"<a<o>:o>")),_.bind("reverse",H(o.reverse,"<a:a>")),_.bind("each",H(o.each,"<o-f:a>")),_.bind("error",H(o.error,"<s?:x>")),_.bind("assert",H(o.assert,"<bs?:x>")),_.bind("type",H(o.type,"<x:s>")),_.bind("sort",H(o.sort,"<af?:a>")),_.bind("shuffle",H(o.shuffle,"<a:a>")),_.bind("distinct",H(o.distinct,"<x:x>")),_.bind("base64encode",H(o.base64encode,"<s-:s>")),_.bind("base64decode",H(o.base64decode,"<s-:s>")),_.bind("encodeUrlComponent",H(o.encodeUrlComponent,"<s-:s>")),_.bind("encodeUrl",H(o.encodeUrl,"<s-:s>")),_.bind("decodeUrlComponent",H(o.decodeUrlComponent,"<s-:s>")),_.bind("decodeUrl",H(o.decodeUrl,"<s-:s>")),_.bind("eval",H(cr,"<sx?:x>")),_.bind("toMillis",H(u.toMillis,"<s-s?:n>")),_.bind("fromMillis",H(u.fromMillis,"<n-s?s?:s>")),_.bind("clone",H(lr,"<(oa)-:o>"));var zt={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 it(c){var f=zt[c.code];if(typeof f<"u"){var p=f.replace(/\{\{\{([^}]+)}}}/g,function(){return c[arguments[1]]});p=p.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(c[arguments[1]])}),c.message=p}}function yt(c,f){var p,s;try{p=b(c,f&&f.recover),s=p.errors,delete p.errors}catch(v){throw it(v),v}var a=tt(_),l=new Date;return a.bind("now",H(function(v,g){return u.fromMillis(l.getTime(),v,g)},"<s?s?:s>")),a.bind("millis",H(function(){return l.getTime()},"<:n>")),{evaluate:async function(v,g,x){if(typeof s<"u"){var $={code:"S0500",position:0};throw it($),$}const B=tt(a);for(const J of h.keys(g))B.bind(J,g[J]);if(B.bind("$",v),l=new Date,B.timestamp=l,B.options=f,B.createSequence=function(){var J=[];return f&&f.sequence&&(J.push=function(...Ee){if(J.length+Ee.length>f.sequence)throw{code:"D2015",stack:new Error().stack,value:f.sequence};return Array.prototype.push.apply(J,Ee)}),J.sequence=!0,arguments.length===1&&J.push(arguments[0]),J},Array.isArray(v)&&!D(v)&&(v=B.createSequence(v),v.outerWrapper=!0),f&&(f.timeout||f.stack)){const J=Date.now();B.guardrails=function(){if(f.stack>0&&B.depth>f.stack)throw{code:"D1011",value:f.stack,stack:new Error().stack};if(f.timeout>0&&Date.now()-J>f.timeout)throw{code:"D1012",value:f.timeout,stack:new Error().stack}}}else B.guardrails=function(){};B.base=B,B.depth=0,f&&f.RegexEngine?B.RegexEngine=f.RegexEngine:B.RegexEngine=RegExp;var se;try{return se=await C(p,v,B),typeof x=="function"&&x(null,se),se}catch(J){throw it(J),J}},assign:function(v,g){a.bind(v,g)},registerFunction:function(v,g,x){var $=H(g,x);a.bind(v,$)},ast:function(){return p},errors:function(){return s}}}return yt.parser=b,yt})();r.exports=M},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(t,r,i){var u=t("./signature");const o=(()=>{var h={".":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:" "},T=function(S){var w=0,P=S.length,D=function(Y,E){var m={type:Y,value:E,position:w};return m},N=function(){for(var Y=w,E=0,m,U,_=function(z){if(S.charAt(z)==="/"&&E===0){for(var O=0;S.charAt(z-(O+1))==="\\";)O++;if(O%2===0)return!0}return!1};w<P;){var C=S.charAt(w);if(_(w)){if(m=S.substring(Y,w),m==="")throw{code:"S0301",stack:new Error().stack,position:w};for(w++,C=S.charAt(w),Y=w;C==="i"||C==="m";)w++,C=S.charAt(w);return U=S.substring(Y,w)+"g",new RegExp(m,U)}(C==="("||C==="["||C==="{")&&S.charAt(w-1)!=="\\"&&E++,(C===")"||C==="]"||C==="}")&&S.charAt(w-1)!=="\\"&&E--,w++}throw{code:"S0302",stack:new Error().stack,position:w}},Z=function(Y){if(w>=P)return null;for(var E=S.charAt(w);w<P&&`
|
|
33
|
-
\r\v`.indexOf(E)>-1;)w++,E=S.charAt(w);if(E==="/"&&S.charAt(w+1)==="*"){var m=w;for(w+=2,E=S.charAt(w);!(E==="*"&&S.charAt(w+1)==="/");)if(E=S.charAt(++w),w>=P)throw{code:"S0106",stack:new Error().stack,position:m};return w+=2,E=S.charAt(w),Z(Y)}if(Y!==!0&&E==="/")return w++,D("regex",N());if(E==="."&&S.charAt(w+1)===".")return w+=2,D("operator","..");if(E===":"&&S.charAt(w+1)==="=")return w+=2,D("operator",":=");if(E==="!"&&S.charAt(w+1)==="=")return w+=2,D("operator","!=");if(E===">"&&S.charAt(w+1)==="=")return w+=2,D("operator",">=");if(E==="<"&&S.charAt(w+1)==="=")return w+=2,D("operator","<=");if(E==="*"&&S.charAt(w+1)==="*")return w+=2,D("operator","**");if(E==="~"&&S.charAt(w+1)===">")return w+=2,D("operator","~>");if(E==="?"&&S.charAt(w+1)===":")return w+=2,D("operator","?:");if(E==="?"&&S.charAt(w+1)==="?")return w+=2,D("operator","??");if(Object.prototype.hasOwnProperty.call(h,E))return w++,D("operator",E);if(E==='"'||E==="'"){var U=E;w++;for(var _="";w<P;){if(E=S.charAt(w),E==="\\")if(w++,E=S.charAt(w),Object.prototype.hasOwnProperty.call(b,E))_+=b[E];else if(E==="u"){var C=S.substr(w+1,4);if(/^[0-9a-fA-F]+$/.test(C)){var z=parseInt(C,16);_+=String.fromCharCode(z),w+=4}else throw{code:"S0104",stack:new Error().stack,position:w}}else throw{code:"S0103",stack:new Error().stack,position:w,token:E};else{if(E===U)return w++,D("string",_);_+=E}w++}throw{code:"S0101",stack:new Error().stack,position:w}}var O=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/,re=O.exec(S.substring(w));if(re!==null){var ae=parseFloat(re[0]);if(!isNaN(ae)&&isFinite(ae))return w+=re[0].length,D("number",ae);throw{code:"S0102",stack:new Error().stack,position:w,token:re[0]}}var _e;if(E==="`"){w++;var ge=S.indexOf("`",w);if(ge!==-1)return _e=S.substring(w,ge),w=ge+1,D("name",_e);throw w=P,{code:"S0105",stack:new Error().stack,position:w}}for(var pe=w,Pe;;)if(Pe=S.charAt(pe),pe===P||`
|
|
34
|
-
\r\v`.indexOf(Pe)>-1||Object.prototype.hasOwnProperty.call(h,Pe)){if(S.charAt(w)==="$")return _e=S.substring(w+1,pe),w=pe,D("variable",_e);switch(_e=S.substring(w,pe),w=pe,_e){case"or":case"in":case"and":return D("operator",_e);case"true":return D("value",!0);case"false":return D("value",!1);case"null":return D("value",null);default:return w===P&&_e===""?null:D("name",_e)}}else pe++};return Z},M=function(S,w){var P,D,N=Object.create(null),Z=[],Y=function(){var d=[];P.id!=="(end)"&&d.push({type:P.type,value:P.value,position:P.position});for(var y=D();y!==null;)d.push(y),y=D();return d},E={nud:function(){var d={code:"S0211",token:this.value,position:this.position};if(w)return d.remaining=Y(),d.type="error",Z.push(d),d;throw d.stack=new Error().stack,d}},m=function(d,y){var G=N[d];return y=y||0,G?y>=G.lbp&&(G.lbp=y):(G=Object.create(E),G.id=G.value=d,G.lbp=y,N[d]=G),G},U=function(d){if(w){d.remaining=Y(),Z.push(d);var y=N["(error)"];return P=Object.create(y),P.error=d,P.type="(error)",P}else throw d.stack=new Error().stack,d},_=function(d,y){if(d&&P.id!==d){var G;P.id==="(end)"?G="S0203":G="S0202";var fe={code:G,position:P.position,token:P.value,value:d};return U(fe)}var Ae=D(y);if(Ae===null)return P=N["(end)"],P.position=S.length,P;var we=Ae.value,A=Ae.type,R;switch(A){case"name":case"variable":R=N["(name)"];break;case"operator":if(R=N[we],!R)return U({code:"S0204",stack:new Error().stack,position:Ae.position,token:we});break;case"string":case"number":case"value":R=N["(literal)"];break;case"regex":A="regex",R=N["(regex)"];break;default:return U({code:"S0205",stack:new Error().stack,position:Ae.position,token:we})}return P=Object.create(R),P.value=we,P.type=A,P.position=Ae.position,P},C=function(d){var y,G=P;for(_(null,!0),y=G.nud();d<P.lbp;)G=P,_(),y=G.led(y);return y},z=function(d){var y=m(d,0);y.nud=function(){return this}},O=function(d,y,G){var fe=y||h[d],Ae=m(d,fe);return Ae.led=G||function(we){return this.lhs=we,this.rhs=C(fe),this.type="binary",this},Ae},re=function(d,y,G){var fe=m(d,y);return fe.led=G,fe},ae=function(d,y){var G=m(d);return G.nud=y||function(){return this.expression=C(70),this.type="unary",this},G};z("(end)"),z("(name)"),z("(literal)"),z("(regex)"),m(":"),m(";"),m(","),m(")"),m("]"),m("}"),m(".."),O("."),O("+"),O("-"),O("*"),O("/"),O("%"),O("="),O("<"),O(">"),O("!="),O("<="),O(">="),O("&"),O("and"),O("or"),O("in"),z("and"),z("or"),z("in"),ae("-"),O("~>"),O("??",h["??"],function(d){return this.type="condition",this.condition={type:"function",value:"(",procedure:{type:"variable",value:"exists"},arguments:[JSON.parse(JSON.stringify(d))]},this.then=d,this.else=C(0),this}),re("(error)",10,function(d){return this.lhs=d,this.error=P.error,this.remaining=Y(),this.type="error",this}),ae("*",function(){return this.type="wildcard",this}),ae("**",function(){return this.type="descendant",this}),ae("%",function(){return this.type="parent",this}),O("(",h["("],function(d){if(this.procedure=d,this.type="function",this.arguments=[],P.id!==")")for(;P.type==="operator"&&P.id==="?"?(this.type="partial",this.arguments.push(P),_("?")):this.arguments.push(C(0)),P.id===",";)_(",");if(_(")",!0),d.type==="name"&&(d.value==="function"||d.value==="λ")){if(this.arguments.forEach(function(we,A){if(we.type!=="variable")return U({code:"S0208",stack:new Error().stack,position:we.position,token:we.value,value:A+1})}),this.type="lambda",P.id==="<"){for(var y=P.position,G=1,fe="<";G>0&&P.id!=="{"&&P.id!=="(end)";){var Ae=_();Ae.id===">"?G--:Ae.id==="<"&&G++,fe+=Ae.value}_(">");try{this.signature=u(fe)}catch(we){return we.position=y+we.offset,U(we)}}_("{"),this.body=C(0),_("}")}return this}),ae("(",function(){for(var d=[];P.id!==")"&&(d.push(C(0)),P.id===";");)_(";");return _(")",!0),this.type="block",this.expressions=d,this}),ae("[",function(){var d=[];if(P.id!=="]")for(;;){var y=C(0);if(P.id===".."){var G={type:"binary",value:"..",position:P.position,lhs:y};_(".."),G.rhs=C(0),y=G}if(d.push(y),P.id!==",")break;_(",")}return _("]",!0),this.expressions=d,this.type="unary",this}),O("[",h["["],function(d){if(P.id==="]"){for(var y=d;y&&y.type==="binary"&&y.value==="[";)y=y.lhs;return y.keepArray=!0,_("]"),d}else return this.lhs=d,this.rhs=C(h["]"]),this.type="binary",_("]",!0),this}),O("^",h["^"],function(d){_("(");for(var y=[];;){var G={descending:!1};if(P.id==="<"?_("<"):P.id===">"&&(G.descending=!0,_(">")),G.expression=C(0),y.push(G),P.id!==",")break;_(",")}return _(")"),this.lhs=d,this.rhs=y,this.type="binary",this});var _e=function(d){var y=[];if(P.id!=="}")for(;;){var G=C(0);_(":");var fe=C(0);if(y.push([G,fe]),P.id!==",")break;_(",")}return _("}",!0),typeof d>"u"?(this.lhs=y,this.type="unary"):(this.lhs=d,this.rhs=y,this.type="binary"),this};ae("{",_e),O("{",h["{"],_e),re(":=",h[":="],function(d){return d.type!=="variable"?U({code:"S0212",stack:new Error().stack,position:d.position,token:d.value}):(this.lhs=d,this.rhs=C(h[":="]-1),this.type="binary",this)}),O("@",h["@"],function(d){return this.lhs=d,this.rhs=C(h["@"]),this.rhs.type!=="variable"?U({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),O("#",h["#"],function(d){return this.lhs=d,this.rhs=C(h["#"]),this.rhs.type!=="variable"?U({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),O("?",h["?"],function(d){return this.type="condition",this.condition=d,this.then=C(0),P.id===":"&&(_(":"),this.else=C(0)),this}),O("?:",h["?:"],function(d){return this.type="condition",this.condition=JSON.parse(JSON.stringify(d)),this.then=d,this.else=C(0),this}),ae("|",function(){return this.type="transform",this.pattern=C(0),_("|"),this.update=C(0),P.id===","&&(_(","),this.delete=C(0)),_("|"),this});var ge=function(d){var y;if(d.type==="function"&&!d.predicate){var G={type:"lambda",thunk:!0,arguments:[],position:d.position};G.body=d,y=G}else if(d.type==="condition")d.then=ge(d.then),typeof d.else<"u"&&(d.else=ge(d.else)),y=d;else if(d.type==="block"){var fe=d.expressions.length;fe>0&&(d.expressions[fe-1]=ge(d.expressions[fe-1])),y=d}else y=d;return y},pe=0,Pe=0,Je=[],ce=function(d,y){switch(d.type){case"name":case"wildcard":y.level--,y.level===0&&(typeof d.ancestor>"u"||(Je[y.index].slot.label=d.ancestor.label),d.ancestor=y,d.tuple=!0);break;case"parent":y.level++;break;case"block":d.expressions.length>0&&(d.tuple=!0,y=ce(d.expressions[d.expressions.length-1],y));break;case"path":d.tuple=!0;var G=d.steps.length-1;for(y=ce(d.steps[G--],y);y.level>0&&G>=0;)y=ce(d.steps[G--],y);break;default:throw{code:"S0217",token:d.type,position:d.position}}return y},me=function(d,y){if(typeof y.seekingParent<"u"||y.type==="parent"){var G=typeof y.seekingParent<"u"?y.seekingParent:[];y.type==="parent"&&G.push(y.slot),typeof d.seekingParent>"u"?d.seekingParent=G:Array.prototype.push.apply(d.seekingParent,G)}},We=function(d){var y=d.steps.length-1,G=d.steps[y],fe=typeof G.seekingParent<"u"?G.seekingParent:[];G.type==="parent"&&fe.push(G.slot);for(var Ae=0;Ae<fe.length;Ae++){var we=fe[Ae];for(y=d.steps.length-2;we.level>0;){if(y<0){typeof d.seekingParent>"u"?d.seekingParent=[we]:d.seekingParent.push(we);break}for(var A=d.steps[y--];y>=0&&A.focus&&d.steps[y].focus;)A=d.steps[y--];we=ce(A,we)}}},ie=function(d){var y;switch(d.type){case"binary":switch(d.value){case".":var G=ie(d.lhs);G.type==="path"?y=G:y={type:"path",steps:[G]},G.type==="parent"&&(y.seekingParent=[G.slot]);var fe=ie(d.rhs);fe.type==="path"?Array.prototype.push.apply(y.steps,fe.steps):(typeof fe.predicate<"u"&&(fe.stages=fe.predicate,delete fe.predicate),y.steps.push(fe)),y.steps.filter(function(q){if(q.type==="number"||q.type==="value")throw{code:"S0213",stack:new Error().stack,position:q.position,value:q.value};return q.type==="string"}).forEach(function(q){q.type="name"}),y.steps.filter(function(q){return q.keepArray===!0}).length>0&&(y.keepSingletonArray=!0);var Ae=y.steps[0];Ae.type==="unary"&&Ae.value==="["&&(Ae.consarray=!0);var we=y.steps[y.steps.length-1];we.type==="unary"&&we.value==="["&&(we.consarray=!0),We(y);break;case"[":y=ie(d.lhs);var A=y,R="predicate";if(y.type==="path"&&(A=y.steps[y.steps.length-1],R="stages"),typeof A.group<"u")throw{code:"S0209",stack:new Error().stack,position:d.position};typeof A[R]>"u"&&(A[R]=[]);var k=ie(d.rhs);typeof k.seekingParent<"u"&&(k.seekingParent.forEach(q=>{q.level===1?ce(A,q):q.level--}),me(A,k)),A[R].push({type:"filter",expr:k,position:d.position});break;case"{":if(y=ie(d.lhs),typeof y.group<"u")throw{code:"S0210",stack:new Error().stack,position:d.position};y.group={lhs:d.rhs.map(function(q){return[ie(q[0]),ie(q[1])]}),position:d.position};break;case"^":y=ie(d.lhs),y.type!=="path"&&(y={type:"path",steps:[y]});var F={type:"sort",position:d.position};F.terms=d.rhs.map(function(q){var K=ie(q.expression);return me(F,K),{descending:q.descending,expression:K}}),y.steps.push(F),We(y);break;case":=":y={type:"bind",value:d.value,position:d.position},y.lhs=ie(d.lhs),y.rhs=ie(d.rhs),me(y,y.rhs);break;case"@":if(y=ie(d.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:d.position};if(A.type==="sort")throw{code:"S0216",stack:new Error().stack,position:d.position};d.keepArray&&(A.keepArray=!0),A.focus=d.rhs.value,A.tuple=!0;break;case"#":y=ie(d.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=d.rhs.value:A.stages.push({type:"index",value:d.rhs.value,position:d.position}),A.tuple=!0;break;case"~>":y={type:"apply",value:d.value,position:d.position},y.lhs=ie(d.lhs),y.rhs=ie(d.rhs),y.keepArray=y.lhs.keepArray||y.rhs.keepArray;break;default:y={type:d.type,value:d.value,position:d.position},y.lhs=ie(d.lhs),y.rhs=ie(d.rhs),me(y,y.lhs),me(y,y.rhs)}break;case"unary":y={type:d.type,value:d.value,position:d.position},d.value==="["?y.expressions=d.expressions.map(function(q){var K=ie(q);return me(y,K),K}):d.value==="{"?y.lhs=d.lhs.map(function(q){var K=ie(q[0]);me(y,K);var he=ie(q[1]);return me(y,he),[K,he]}):(y.expression=ie(d.expression),d.value==="-"&&y.expression.type==="number"?(y=y.expression,y.value=-y.value):me(y,y.expression));break;case"function":case"partial":y={type:d.type,name:d.name,value:d.value,position:d.position},y.arguments=d.arguments.map(function(q){var K=ie(q);return me(y,K),K}),y.procedure=ie(d.procedure);break;case"lambda":y={type:d.type,arguments:d.arguments,signature:d.signature,position:d.position};var j=ie(d.body);y.body=ge(j);break;case"condition":y={type:d.type,position:d.position},y.condition=ie(d.condition),me(y,y.condition),y.then=ie(d.then),me(y,y.then),typeof d.else<"u"&&(y.else=ie(d.else),me(y,y.else));break;case"transform":y={type:d.type,position:d.position},y.pattern=ie(d.pattern),y.update=ie(d.update),typeof d.delete<"u"&&(y.delete=ie(d.delete));break;case"block":y={type:d.type,position:d.position},y.expressions=d.expressions.map(function(q){var K=ie(q);return me(y,K),(K.consarray||K.type==="path"&&K.steps[0].consarray)&&(y.consarray=!0),K});break;case"name":y={type:"path",steps:[d]},d.keepArray&&(y.keepSingletonArray=!0);break;case"parent":y={type:"parent",slot:{label:"!"+pe++,level:1,index:Pe++}},Je.push(y);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":y=d;break;case"operator":if(d.value==="and"||d.value==="or"||d.value==="in")d.type="name",y=ie(d);else if(d.value==="?")y=d;else throw{code:"S0201",stack:new Error().stack,position:d.position,token:d.value};break;case"error":y=d,d.lhs&&(y=ie(d.lhs));break;default:var I="S0206";d.id==="(end)"&&(I="S0207");var L={code:I,position:d.position,token:d.value};if(w)return Z.push(L),{type:"error",error:L};throw L.stack=new Error().stack,L}return d.keepArray&&(y.keepArray=!0),y};D=T(S),_();var Ce=C(0);if(P.id!=="(end)"){var nt={code:"S0201",position:P.position,token:P.value};U(nt)}if(Ce=ie(Ce),Ce.type==="parent"||typeof Ce.seekingParent<"u")throw{code:"S0217",token:Ce.type,position:Ce.position};return Z.length>0&&(Ce.errors=Z),Ce};return M})();r.exports=o},{"./signature":5}],5:[function(t,r,i){var u=t("./utils");const o=(()=>{var h={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};function b(T){for(var M=1,S=[],w=Object.create(null),P=w;M<T.length;){var D=T.charAt(M);if(D===":")break;var N=function(){S.push(w),P=w,w=Object.create(null)},Z=function(O,re,ae,_e){for(var ge=1,pe=re;pe<O.length;)if(pe++,D=O.charAt(pe),D===_e){if(ge--,ge===0)break}else D===ae&&ge++;return pe};switch(D){case"s":case"n":case"b":case"l":case"o":w.regex="["+D+"m]",w.type=D,N();break;case"a":w.regex="[asnblfom]",w.type=D,w.array=!0,N();break;case"f":w.regex="f",w.type=D,N();break;case"j":w.regex="[asnblom]",w.type=D,N();break;case"x":w.regex="[asnblfom]",w.type=D,N();break;case"-":P.context=!0,P.contextRegex=new RegExp(P.regex),P.regex+="?";break;case"?":case"+":P.regex+=D;break;case"(":var Y=Z(T,M,"(",")"),E=T.substring(M+1,Y);if(E.indexOf("<")===-1)w.regex="["+E+"m]";else throw{code:"S0402",stack:new Error().stack,value:E,offset:M};w.type="("+E+")",M=Y,N();break;case"<":if(P.type==="a"||P.type==="f"){var m=Z(T,M,"<",">");P.subtype=T.substring(M+1,m),M=m}else throw{code:"S0401",stack:new Error().stack,value:P.type,offset:M};break}M++}var U="^"+S.map(function(O){return"("+O.regex+")"}).join("")+"$",_=new RegExp(U),C=function(O){var re;if(u.isFunction(O))re="f";else{var ae=typeof O;switch(ae){case"string":re="s";break;case"number":re="n";break;case"boolean":re="b";break;case"object":O===null?re="l":Array.isArray(O)?re="a":re="o";break;case"undefined":default:re="m"}}return re},z=function(O,re){for(var ae="^",_e=0,ge=0;ge<S.length;ge++){ae+=S[ge].regex;var pe=re.match(ae);if(pe===null)throw{code:"T0410",stack:new Error().stack,value:O[_e],index:_e+1};_e=pe[0].length}throw{code:"T0410",stack:new Error().stack,value:O[_e],index:_e+1}};return{definition:T,validate:function(O,re){var ae="";O.forEach(function(Pe){ae+=C(Pe)});var _e=_.exec(ae);if(_e){var ge=[],pe=0;return S.forEach(function(Pe,Je){var ce=O[pe],me=_e[Je+1];if(me==="")if(Pe.context&&Pe.contextRegex){var We=C(re);if(Pe.contextRegex.test(We))ge.push(re);else throw{code:"T0411",stack:new Error().stack,value:re,index:pe+1}}else ge.push(ce),pe++;else me.split("").forEach(function(ie){if(ce=O[pe],Pe.type==="a"){if(ie==="m")ce=void 0;else{var Ce=!0;if(typeof Pe.subtype<"u"){if(ie!=="a"&&me!==Pe.subtype)Ce=!1;else if(ie==="a"&&ce.length>0){var nt=C(ce[0]);if(nt!==Pe.subtype.charAt(0))Ce=!1;else{var d=ce.filter(function(y){return C(y)!==nt});Ce=d.length===0}}}if(!Ce)throw{code:"T0412",stack:new Error().stack,value:ce,index:pe+1,type:h[Pe.subtype]};ie!=="a"&&(ce=[ce])}ge.push(ce),pe++}else ge.push(ce),pe++})}),ge}z(O,ae)}}}return b})();r.exports=o},{"./utils":6}],6:[function(t,r,i){const u=(()=>{function o(m){var U=!1;if(typeof m=="number"&&(U=!isNaN(m),U&&!isFinite(m)))throw{code:"D1001",value:m,stack:new Error().stack};return U}function h(m){var U=!1;return Array.isArray(m)&&(U=m.filter(function(_){return typeof _!="string"}).length===0),U}function b(m){var U=!1;return Array.isArray(m)&&(U=m.filter(function(_){return!o(_)}).length===0),U}function T(m){return m.sequence===!0&&Array.isArray(m)}function M(m){return m&&(m._jsonata_function===!0||m._jsonata_lambda===!0)||typeof m=="function"}function S(m){var U=typeof m.arity=="number"?m.arity:typeof m.implementation=="function"?m.implementation.length:typeof m.length=="number"?m.length:m.arguments.length;return U}function w(m){return m&&m._jsonata_lambda===!0}var P=(typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator";function D(m){return typeof m=="object"&&m!==null&&P in m&&"next"in m&&typeof m.next=="function"}function N(m,U){if(m===U)return!0;if(typeof m=="object"&&typeof U=="object"&&m!==null&&U!==null){if(Array.isArray(m)&&Array.isArray(U)){if(m.length!==U.length)return!1;for(var _=0;_<m.length;_++)if(!N(m[_],U[_]))return!1;return!0}var C=Object.getOwnPropertyNames(m),z=Object.getOwnPropertyNames(U);if(C.length!==z.length)return!1;for(C=C.sort(),z=z.sort(),_=0;_<C.length;_++)if(C[_]!==z[_])return!1;for(_=0;_<C.length;_++){var O=C[_];if(!N(m[O],U[O]))return!1}return!0}return!1}function Z(m){return typeof m=="object"&&m!==null&&"then"in m&&typeof m.then=="function"}function Y(m){var U=[];for(let _ of m)U.push(_);return U}function E(m){return typeof m=="object"&&m!==null?Object.keys(m):[]}return{isNumeric:o,isArrayOfStrings:h,isArrayOfNumbers:b,isSequence:T,isFunction:M,isLambda:w,isIterable:D,getFunctionArity:S,isDeepEqual:N,stringToArray:Y,isPromise:Z,keys:E}})();r.exports=u},{}]},{},[3])(3)})})(Dr)),Dr.exports}Ii();const Bi=150,wn=10,ji=200,qi=16,En=new WeakMap;let _n=!1;function ir(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function jt(n){if(n===window)return{x:window.scrollX,y:window.scrollY};const e=n;return{x:e.scrollLeft,y:e.scrollTop}}function Hi(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 zi(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 kt(n){let e=En.get(n);if(!e){const t=jt(n);e={x:t.x,y:t.y,restoring:!1,watching:!1,userEngaged:!1,raf:0,stickyFrames:0},En.set(n,e)}return e}function sr(n){kt(n).userEngaged=!0}function ar(n){const e=kt(n);clearTimeout(e.settleTimer),e.settleTimer=setTimeout(()=>{e.userEngaged=!1,e.settleTimer=void 0},Bi)}function An(n,e){return e-n>=ji}function Tt(n){if(!ir())return;const e=kt(n);if(e.restoring)return;const t=jt(n);if(An(t.y,e.y)){Lr(n);return}e.x=t.x,e.y=t.y}function Gi(n){if(!ir())return;const e=kt(n),t=zi(n),r=e.x,i=t>0?Math.min(e.y,t):e.y,{x:u,y:o}=jt(n);if(!(Math.abs(r-u)<=wn&&Math.abs(i-o)<=wn)){e.restoring=!0;try{Hi(n,r,i)}finally{requestAnimationFrame(()=>{e.restoring=!1})}}}function Lr(n){const e=kt(n);if(e.stickyFrames=qi,e.raf)return;const t=()=>{e.raf=0,Gi(n),e.stickyFrames>0&&(e.stickyFrames--,e.raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)}function Mr(n){Lr(n)}function qt(n){if(!ir())return;const e=kt(n);if(e.watching)return;e.watching=!0;const t=n===window?window:n,r=()=>{if(e.restoring)return;const{y:D}=jt(n);if(An(D,e.y)){Lr(n);return}if(e.userEngaged){Tt(n),ar(n);return}Tt(n)},i=D=>xn(D)===n,u=D=>{i(D)&&(Tt(n),sr(n))},o=D=>{i(D)&&ar(n)},h=D=>{i(D)&&(Tt(n),sr(n),ar(n))};t.addEventListener("scroll",r,{passive:!0}),t.addEventListener("touchstart",u,{passive:!0}),t.addEventListener("touchend",o,{passive:!0}),t.addEventListener("touchcancel",o,{passive:!0}),t.addEventListener("wheel",h,{passive:!0}),t.addEventListener("pointerdown",u,{passive:!0}),t.addEventListener("pointerup",o,{passive:!0}),t.addEventListener("pointercancel",o,{passive:!0});const b=jt(n);if(e.x=b.x,e.y=b.y,n===window){const D=new ResizeObserver(()=>Mr(window));D.observe(document.documentElement),e.resizeObserver=D;return}const T=n,M=new ResizeObserver(()=>Mr(T));M.observe(T);for(const D of Array.from(T.children))M.observe(D);e.resizeObserver=M;const S=()=>Mr(T),w=new MutationObserver(D=>{for(const N of D)if(N.type==="childList")for(const Z of Array.from(N.addedNodes))Z instanceof Element&&M.observe(Z);S()});w.observe(T,{childList:!0,subtree:!0,characterData:!0});const P=T.getRootNode();P instanceof ShadowRoot&&P.host&&w.observe(P.host,{childList:!0,subtree:!0,characterData:!0}),e.mutationObserver=w}function xn(n){for(const e of n.composedPath())if(!(e===window||e===document)&&e instanceof HTMLElement&&Sn(e))return e;return window}function Sn(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 Ur(n){for(const t of n.composedPath())t===window||t===document||t instanceof HTMLElement&&Sn(t)&&qt(t);const e=xn(n);qt(e),n.type==="wheel"?(Tt(e),sr(e),ar(e)):(n.type==="touchstart"||n.type==="pointerdown")&&(Tt(e),sr(e))}function or(n){n instanceof Element&&n.classList?.contains("custom-scroll")&&qt(n),n.querySelectorAll?.(".custom-scroll").forEach(e=>{e instanceof HTMLElement&&qt(e)})}function Fr(n){or(n),new MutationObserver(t=>{for(const r of t)for(const i of Array.from(r.addedNodes))i instanceof Element&&or(i)}).observe(n,{childList:!0,subtree:!0})}function Or(n){n.querySelectorAll?.("*").forEach(e=>{e.shadowRoot&&(Fr(e.shadowRoot),Or(e.shadowRoot))})}function Vi(){const n=Element.prototype;if(n.__safariScrollGuardPatched)return;n.__safariScrollGuardPatched=!0;const e=n.attachShadow;n.attachShadow=function(r){const i=e.call(this,r);return Fr(i),i}}function Wi(){if(typeof window>"u"||_n||(_n=!0,!ir()))return;qt(window),Vi();const n={capture:!0,passive:!0};window.addEventListener("wheel",Ur,n),window.addEventListener("touchstart",Ur,n),window.addEventListener("pointerdown",Ur,n);const e=()=>{or(document),Or(document)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e(),new MutationObserver(r=>{for(const i of r)for(const u of Array.from(i.addedNodes))u instanceof Element&&(or(u),u.shadowRoot&&Fr(u.shadowRoot),Or(u))}).observe(document.documentElement,{childList:!0,subtree:!0})}const Xi=wi,Yi=_i,Ji=Pr,Ki=Sr,Zi=at,Qi=Mi,es=er,ts=Cr,rs=Ni;Wi(),window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Xi,Arrays:Yi,DataBindObserver:Ji,Format:Ki,HTML:Zi,LocationHandler:Qi,Objects:es,PublisherManager:$e,api:ts,URLPattern:rs,Endpoint:Rr,DataProviderKey:Qt};const ns=`#version 300 es
|
|
35
|
-
`,is=`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
|
-
/** Near / far caméra (0 dans sonic-shader standalone). */
|
|
58
|
-
uniform float uNear;
|
|
59
|
-
uniform float uFar;
|
|
60
|
-
|
|
61
|
-
out vec4 sonicFragColor;
|
|
62
|
-
|
|
63
|
-
/** Profondeur linéaire monde depuis une DepthTexture (0–1). */
|
|
64
|
-
float sonicLinearDepth(float d) {
|
|
65
|
-
float z = d * 2.0 - 1.0;
|
|
66
|
-
float n = max(uNear, 1e-4);
|
|
67
|
-
float f = max(uFar, n + 1e-4);
|
|
68
|
-
return (2.0 * n * f) / (f + n - z * (f - n));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
`,ss=`
|
|
72
|
-
void main() {
|
|
73
|
-
mainImage(sonicFragColor, gl_FragCoord.xy);
|
|
74
|
-
}
|
|
75
|
-
`,as=`#version 300 es
|
|
76
|
-
precision highp float;
|
|
77
|
-
layout(location = 0) in vec2 aPos;
|
|
78
|
-
void main() {
|
|
79
|
-
gl_Position = vec4(aPos, 0.0, 1.0);
|
|
80
|
-
}
|
|
81
|
-
`;function os(n,e){return is+(n?n+`
|
|
82
|
-
`:"")+e+`
|
|
83
|
-
`+ss}function us(n,e){return ns+os(n,e)}function $r(n){const e=(n??"").trim().toLowerCase();return e==="rgba16f"||e==="rgba16"||e==="half"?"rgba16f":e==="rgba32f"||e==="rgba32"||e==="float"?"rgba32f":"rgba8"}function cs(n){if(n==null)return"auto";const e=n.trim().toLowerCase();return e==="auto"?"auto":!(e==="false"||e==="0")}function ls(n){for(const e of n)for(const t of e)if(t.kind==="self")return!0;return!1}function fs(n,e){return n===!1?!1:n===!0?!0:!e}function Ht(n){if(n===""||n===null||n===void 0)return null;if(typeof n=="number")return n===0||n===1||n===2||n===3?n:null;const e=n.trim().toLowerCase();return e==="0"||e==="param0"?0:e==="1"||e==="param1"?1:e==="2"||e==="param2"?2:e==="3"||e==="param3"?3:null}function Nr(n){if(n===""||n===null||n===void 0)return null;const e=n.trim().toLowerCase();return e==="none"||e==="off"||e==="false"?null:e==="image"?"image":e==="buffer-a"||e==="buffera"||e==="a"?"bufferA":e==="buffer-b"||e==="bufferb"||e==="b"?"bufferB":e==="buffer-c"||e==="bufferc"||e==="c"?"bufferC":e==="buffer-d"||e==="bufferd"||e==="d"?"bufferD":null}function hs(n,e,t,r={}){const i=Math.max(0,Math.min(1,r.threshold??.5)),u=Math.max(0,Math.floor(r.maxCount??8)),o=Math.max(1,Math.floor(r.minDistance??16));if(u===0||e<1||t<1||n.length<e*t*4)return[];const h=n instanceof Float32Array,b=h?i:i*255,T=P=>h?P:P/255,M=[];for(let P=1;P<t-1;P++)for(let D=1;D<e-1;D++){const N=(P*e+D)*4,Z=n[N];if(Z<b)continue;let Y=!0;for(let E=-1;E<=1&&Y;E++)for(let m=-1;m<=1;m++){if(m===0&&E===0)continue;const U=((P+E)*e+(D+m))*4;if(n[U]>Z){Y=!1;break}}Y&&M.push({x:D,y:P,score:T(Z)})}M.sort((P,D)=>D.score-P.score);const S=[],w=o*o;for(const P of M){if(S.length>=u)break;let D=!0;for(const N of S){const Z=P.x-N.x,Y=P.y-N.y;if(Z*Z+Y*Y<w){D=!1;break}}D&&S.push(P)}return S}function kn(n,e,t,r,i=128){if(e<1||t<1)return null;const u=typeof n.w=="number"&&typeof n.h=="number"&&Number.isFinite(n.w)&&Number.isFinite(n.h)&&n.w>0&&n.h>0;let o,h,b,T;if(u)o=Math.floor(n.x*e),h=Math.floor(n.y*t),b=Math.max(1,Math.round(n.w*e)),T=Math.max(1,Math.round(n.h*t));else{const M=Math.min(i,Math.max(1,Math.floor(n.patch??r))),S=n.x*e,w=n.y*t;b=M,T=M,o=Math.floor(S-M/2),h=Math.floor(w-M/2)}return o<0&&(b+=o,o=0),h<0&&(T+=h,h=0),o+b>e&&(b=e-o),h+T>t&&(T=t-h),b<1||T<1?null:(b=Math.min(b,i),T=Math.min(T,i),{x:o,y:h,w:b,h:T})}function Tn(n){const e=Math.floor(n.length/4);if(e<1)return{r:0,g:0,b:0,a:0,luma:0};const t=n instanceof Float32Array;let r=0,i=0,u=0,o=0;for(let b=0;b<e;b++){const T=b*4;r+=n[T],i+=n[T+1],u+=n[T+2],o+=n[T+3]}const h=t?e:e*255;return r/=h,i/=h,u/=h,o/=h,{r,g:i,b:u,a:o,luma:.2126*r+.7152*i+.0722*u}}function Pn(n){if(n instanceof Uint8Array)return n;const e=new Uint8Array(n.length);for(let t=0;t<n.length;t++)e[t]=Math.max(0,Math.min(255,Math.round(n[t]*255)));return e}class ht extends Error{constructor(e,t,r){super(e),this.pass=t,this.infoLog=r,this.name="ShaderCompileError"}}const ds=["bufferA","bufferB","bufferC","bufferD","image"],Cn=["bufferA","bufferB","bufferC","bufferD"];function ps(n,e,t){if(!n)return{upload:!1,texSource:null};if(typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement){const r=n.currentSrc||n.src||"";return!r||!n.complete||n.naturalWidth<1?{upload:!1,texSource:null}:t===r&&e>0?{upload:!1,texSource:null,nextSrc:r}:{upload:!0,texSource:n,nextSrc:r}}if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement)return n.readyState<2||n.videoWidth<1?{upload:!1,texSource:null}:{upload:!0,texSource:n};if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement)return n.width<1||n.height<1?{upload:!1,texSource:null}:{upload:!0,texSource:n};if(an(n)){if(n.frameSeq===e)return{upload:!1,texSource:null};const r=n.getFrameCanvas();return!r||r.width<1||r.height<1?{upload:!1,texSource:null}:{upload:!0,texSource:r}}return{upload:!1,texSource:null}}function ms(n){return/\.(webm|mp4|ogg|mov)(\?|#|$)/i.test(n)}function gs(n){return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?{width:n.videoWidth||1,height:n.videoHeight||1}:typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement?{width:n.naturalWidth||n.width||1,height:n.naturalHeight||n.height||1}:"width"in n&&"height"in n?{width:Math.max(1,Number(n.width)||1),height:Math.max(1,Number(n.height)||1)}:{width:1,height:1}}function Rn(n,e,t,r){const i=n.createShader(e);if(!i)throw new ht("Unable to create shader",r,"");if(n.shaderSource(i,t),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const u=n.getShaderInfoLog(i)||"";throw n.deleteShader(i),new ht(`Compile error (${r}): ${u}`,r,u)}return i}function vs(n,e,t,r){const i=n.createProgram();if(!i)throw new ht("Unable to create program","link","");if(n.attachShader(i,e),n.attachShader(i,t),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS)){const u=n.getProgramInfoLog(i)||"";throw n.deleteProgram(i),new ht(`Link error (${r}): ${u}`,"link",u)}return i}function bs(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}`))}}let Dn=!1;function Ir(n,e){const t=$r(e);if(t==="rgba8")return{requested:t,active:"rgba8",internal:n.RGBA8,format:n.RGBA,type:n.UNSIGNED_BYTE,filter:n.LINEAR,float:!1};if(!n.getExtension("EXT_color_buffer_float"))return Dn||(Dn=!0,console.warn(`[sonic-shader] buffer-format="${t}" indisponible (pas d'EXT_color_buffer_float) → rgba8`)),Ir(n,"rgba8");if(t==="rgba16f")return{requested:t,active:"rgba16f",internal:n.RGBA16F,format:n.RGBA,type:n.HALF_FLOAT,filter:n.LINEAR,float:!0};const i=!!n.getExtension("OES_texture_float_linear");return{requested:t,active:"rgba32f",internal:n.RGBA32F,format:n.RGBA,type:n.FLOAT,filter:i?n.LINEAR:n.NEAREST,float:!0}}function Br(n,e,t,r){const i=r??{internal:n.RGBA8,format:n.RGBA,type:n.UNSIGNED_BYTE,filter:n.LINEAR},u=n.createTexture();if(!u)throw new Error("Unable to create texture");return n.bindTexture(n.TEXTURE_2D,u),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i.filter),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,i.filter),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,i.internal,e,t,0,i.format,i.type,null),u}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 jr(n,e,t,r){const i=[Br(n,e,t,r),Br(n,e,t,r)],u=[Ln(n,i[0]),Ln(n,i[1])];return{textures:i,framebuffers:u,index:0}}function ur(n,e){for(const t of e.textures)n.deleteTexture(t);for(const t of e.framebuffers)n.deleteFramebuffer(t)}function ys(n,e){const t=(n??"").trim();if(!t){const i=(e??"").trim();return i.startsWith("#")?{kind:"element",key:i}:i?{kind:"url",url:i}:{kind:"none"}}if(t.startsWith("#"))return{kind:"element",key:t};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 ws{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,this.elementResolver=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.bufferFmt=Ir(t,"rgba8"),this.initGeometry(),this.blackTexture=Br(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 activeBufferFormat(){return this.bufferFmt.active}setBufferFormat(e){const t=Ir(this.gl,e);if(t.active===this.bufferFmt.active&&t.filter===this.bufferFmt.filter)return this.bufferFmt=t,t.active;if(this.bufferFmt=t,this.width>=1&&this.height>=1)for(const r of Cn){const i=this.buffers.get(r);i&&ur(this.gl,i),this.programs.has(r)?this.buffers.set(r,jr(this.gl,this.width,this.height,this.bufferFmt)):this.buffers.delete(r)}return t.active}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)),i=Math.max(1,Math.floor(t));if(!(r===this.width&&i===this.height)){this.width=r,this.height=i,this.canvas.width=r,this.canvas.height=i;for(const u of Cn){const o=this.buffers.get(u);o&&ur(this.gl,o),this.programs.has(u)&&this.buffers.set(u,jr(this.gl,r,i,this.bufferFmt))}}}setSources(e,t){if(this.gl.isContextLost())throw new Error("WebGL context lost");this.disposePrograms(),this.passChannels=t,this.activePasses=[],this.vertexShader=Rn(this.gl,this.gl.VERTEX_SHADER,as,"vertex");for(const r of ds){const i=r==="image"?e.image:e[r];if(!i?.trim())continue;const u=us(e.common||"",i),o=Rn(this.gl,this.gl.FRAGMENT_SHADER,u,r),h=vs(this.gl,this.vertexShader,o,r);if(this.gl.deleteShader(o),this.programs.set(r,{program:h,uniforms:bs(this.gl,h)}),this.activePasses.push(r),r!=="image"&&this.width>0){const b=this.buffers.get(r);b&&ur(this.gl,b),this.buffers.set(r,jr(this.gl,this.width,this.height,this.bufferFmt))}}if(!this.programs.has("image"))throw new ht("image pass is required","image","Missing image shader source")}setPassChannels(e){if(this.gl.isContextLost())throw new Error("WebGL context lost");this.passChannels=e}async ensureTextures(e){const t=[...new Set(e.filter(Boolean))];await Promise.all(t.map(r=>this.loadTexture(r)))}ensureElementTexture(e){if(this.external.has(e))return;const t=this.gl,r=t.createTexture();r&&(t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA8,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,0,255])),this.external.set(e,{texture:r,width:1,height:1,url:e,lastSeq:0}))}updateElementTextures(e){const t=this.gl;for(const[r,i]of this.external){let u=i.video??i.source??null;r.startsWith("#")&&e&&(u=e(r),i.source=u),typeof HTMLVideoElement<"u"&&u instanceof HTMLVideoElement&&(i.video=u);const o=ps(u,i.lastSeq,i.lastSrc);if(!o.upload||!o.texSource)continue;const h=gs(o.texSource);t.bindTexture(t.TEXTURE_2D,i.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),i.width===h.width&&i.height===h.height&&i.lastSeq>0?t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,o.texSource):(t.texImage2D(t.TEXTURE_2D,0,t.RGBA8,t.RGBA,t.UNSIGNED_BYTE,o.texSource),i.width=h.width,i.height=h.height),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,0),an(u)?i.lastSeq=u.frameSeq:i.lastSeq=(i.lastSeq||0)+1,o.nextSrc!==void 0&&(i.lastSrc=o.nextSrc)}}updateVideoTextures(){this.updateElementTextures()}setVideosPlaying(e){for(const t of this.external.values()){const r=t.video||(typeof HTMLVideoElement<"u"&&t.source instanceof HTMLVideoElement?t.source:null);r&&(e?r.play().catch(()=>{}):r.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():ms(e)?this.loadVideoTexture(e):new Promise((r,i)=>{const u=new Image;u.crossOrigin="anonymous",u.onload=()=>{const o=this.gl,h=o.createTexture();if(!h){i(new Error("Unable to create texture"));return}o.bindTexture(o.TEXTURE_2D,h),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,1),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texImage2D(o.TEXTURE_2D,0,o.RGBA8,o.RGBA,o.UNSIGNED_BYTE,u),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,0),this.external.set(e,{texture:h,width:u.naturalWidth||u.width,height:u.naturalHeight||u.height,url:e,lastSeq:0}),r()},u.onerror=()=>i(new Error(`Failed to load texture: ${e}`)),u.src=e})}loadVideoTexture(e){return new Promise((t,r)=>{const i=document.createElement("video");i.crossOrigin="anonymous",i.muted=!0,i.loop=!0,i.playsInline=!0,i.preload="auto";let u=!1;const o=()=>{u||(u=!0,r(new Error(`Failed to load video: ${e}`)))},h=()=>{if(u||!i.videoWidth)return;u=!0;const b=this.gl,T=b.createTexture();if(!T){r(new Error("Unable to create texture"));return}b.bindTexture(b.TEXTURE_2D,T),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,i),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,0),this.external.set(e,{texture:T,width:i.videoWidth,height:i.videoHeight,url:e,video:i,lastSeq:0}),i.play().catch(()=>{}),t()};i.addEventListener("loadeddata",h),i.addEventListener("error",o),i.src=e,i.load()})}resolveChannel(e,t){const r={texture:this.blackTexture,width:1,height:1};if(t.kind==="none")return r;if(t.kind==="url"||t.kind==="element"){const o=t.kind==="url"?t.url:t.key,h=this.external.get(o);return h?{texture:h.texture,width:h.width,height:h.height}:r}const i=t.kind==="self"?e==="image"?null:e:t.buffer;if(!i)return r;const u=this.buffers.get(i);return u?{texture:u.textures[u.index],width:this.width,height:this.height}:r}bindChannels(e,t){const r=this.gl,i=this.passChannels.get(e)||[{kind:"none"},{kind:"none"},{kind:"none"},{kind:"none"}],u=[];for(let o=0;o<4;o++){const h=this.resolveChannel(e,i[o]);r.activeTexture(r.TEXTURE0+o),r.bindTexture(r.TEXTURE_2D,h.texture),t.iChannel[o]&&r.uniform1i(t.iChannel[o],o),u.push(h.width,h.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,i=this.width,u=this.height;if(e.iResolution&&r.uniform3f(e.iResolution,i,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 o=new Date;r.uniform4f(e.iDate,o.getFullYear(),o.getMonth(),o.getDate(),o.getHours()*3600+o.getMinutes()*60+o.getSeconds()+o.getMilliseconds()*.001)}e.iSampleRate&&r.uniform1f(e.iSampleRate,44100);for(let o=0;o<4;o++)e.uParam[o]&&r.uniform1f(e.uParam[o],t.params[o])}setElementResolver(e){this.elementResolver=e}render(e){const t=this.gl;if(!this.vao||this.width<1||this.height<1)return;this.updateElementTextures(this.elementResolver??void 0),t.bindVertexArray(this.vao),t.viewport(0,0,this.width,this.height),t.disable(t.DEPTH_TEST),t.disable(t.BLEND);for(const i of this.activePasses){if(i==="image")continue;const u=this.programs.get(i),o=this.buffers.get(i);if(!u||!o)continue;const h=1-o.index;t.bindFramebuffer(t.FRAMEBUFFER,o.framebuffers[h]),t.viewport(0,0,this.width,this.height),t.useProgram(u.program),this.setCommonUniforms(u.uniforms,e),this.bindChannels(i,u.uniforms),t.drawArrays(t.TRIANGLES,0,3),o.index=h}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,i){return this.readFramebufferRect(null,e,t,r,i)}readBufferRect(e,t,r,i,u){if(e==="image")return this.readRect(t,r,i,u);const o=this.buffers.get(e);return o?this.readFramebufferRect(o.framebuffers[o.index],t,r,i,u,this.bufferFmt.float):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,i,u,o=!1){const h=this.gl;if(h.isContextLost()||this.width<1||this.height<1)return null;let b=Math.floor(t),T=Math.floor(r),M=Math.floor(i),S=Math.floor(u);if(M<1||S<1||(b<0&&(M+=b,b=0),T<0&&(S+=T,T=0),b+M>this.width&&(M=this.width-b),T+S>this.height&&(S=this.height-T),M<1||S<1))return null;h.bindFramebuffer(h.FRAMEBUFFER,e);let w;return o?(w=new Float32Array(M*S*4),h.readPixels(b,T,M,S,h.RGBA,h.FLOAT,w)):(w=new Uint8Array(M*S*4),h.readPixels(b,T,M,S,h.RGBA,h.UNSIGNED_BYTE,w)),h.bindFramebuffer(h.FRAMEBUFFER,null),{x:b,y:T,width:M,height:S,data:w}}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())ur(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()}}}var Es=Object.defineProperty,_s=Object.getOwnPropertyDescriptor,W=(n,e,t,r)=>{for(var i=r>1?void 0:r?_s(e,t):e,u=n.length-1,o;u>=0;u--)(o=n[u])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Es(e,t,i),i};const As="sonic-shader",Mn=128,xs=["image","bufferA","bufferB","bufferC","bufferD","common","bufferFormat"],Ss=["channel0","channel1","channel2","channel3","imageCh0","imageCh1","imageCh2","imageCh3","bufferACh0","bufferACh1","bufferACh2","bufferACh3","bufferBCh0","bufferBCh1","bufferBCh2","bufferBCh3","bufferCCh0","bufferCCh1","bufferCCh2","bufferCCh3","bufferDCh0","bufferDCh1","bufferDCh2","bufferDCh3"],ks=["time","frame","mouseX","mouseY","hovering"],Ts=["param0","param1","param2","param3"],Ps=["channel0","channel1","channel2","channel3","imageCh0","imageCh1","imageCh2","imageCh3","bufferACh0","bufferACh1","bufferACh2","bufferACh3","bufferBCh0","bufferBCh1","bufferBCh2","bufferBCh3","bufferCCh0","bufferCCh1","bufferCCh2","bufferCCh3","bufferDCh0","bufferDCh1","bufferDCh2","bufferDCh3"],Cs=["sampleR","sampleG","sampleB","sampleA","sampleLuma"],Rs=["extracts","extractCount","extractSeq"];function Ds(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function Ve(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 Ls(n){if(n===null||n==="")return"";if(typeof n=="string")return n.trim();const e=yi(n);if(e)return e;if(n&&typeof n=="object"){const t=n.element,r=bi(t);return r||void 0}return""}function Un(n){if(!Array.isArray(n))return[];const e=[];for(const t of n){if(!t||typeof t!="object")continue;const r=t,i=Ve(r.x,NaN),u=Ve(r.y,NaN);if(!Number.isFinite(i)||!Number.isFinite(u))continue;const o={x:i,y:u,source:"manual"};typeof r.id=="string"&&r.id&&(o.id=r.id),"w"in r&&(o.w=Ve(r.w,0)),"h"in r&&(o.h=Ve(r.h,0)),"patch"in r&&(o.patch=Ve(r.patch,16)),e.push(o)}return e}const qr=4;async function Fn(n,e,t){if(typeof document>"u"||e<1||t<1)return null;try{const r=document.createElement("canvas");r.width=e,r.height=t;const i=r.getContext("2d");if(!i)return null;const u=i.createImageData(e,t),o=u.data;for(let T=0;T<t;T++){const M=(t-1-T)*e*qr,S=T*e*qr;for(let w=0;w<e*qr;w++)o[S+w]=n[M+w]}i.putImageData(u,0,0);const h=await new Promise(T=>{try{r.toBlob(M=>T(M),"image/png")}catch{T(null)}});return h?URL.createObjectURL(h):r.toDataURL("image/png")||null}catch{return null}}function On(n,e){n.blobUrl=e,n.url=e}let V=class extends Nt{constructor(){super(...arguments),this.image="",this.bufferA="",this.bufferB="",this.bufferC="",this.bufferD="",this.common="",this.channel0="",this.channel1="",this.channel2="",this.channel3="",this.imageCh0="",this.imageCh1="",this.imageCh2="",this.imageCh3="",this.bufferACh0="",this.bufferACh1="",this.bufferACh2="",this.bufferACh3="",this.bufferBCh0="",this.bufferBCh1="",this.bufferBCh2="",this.bufferBCh3="",this.bufferCCh0="",this.bufferCCh1="",this.bufferCCh2="",this.bufferCCh3="",this.bufferDCh0="",this.bufferDCh1="",this.bufferDCh2="",this.bufferDCh3="",this.play=!0,this.playOnHover=!1,this.mouse=!0,this.mouseMode="direct",this.mouseSpeed=8,this.hoverParam="",this.hoverSpeed=10,this.releaseOffscreen="auto",this.dprMax=2,this.bufferFormat="rgba8",this.activeBufferFormat="rgba8",this.param0=0,this.param1=0,this.param2=0,this.param3=0,this.dataProvider="",this.outDataProvider="",this.sample=!1,this.outInterval=80,this.extract=!1,this.extractInterval=0,this.extractSource="image",this.extractMask="none",this.extractThreshold=.5,this.extractMax=8,this.extractPatch=16,this.extractBitmaps=!1,this.extractDataProvider="",this.aspectRatio="",this.errorMessage="",this.runtime=null,this.raf=0,this.startTime=0,this.lastTime=0,this.frame=0,this.frameSeq=0,this.mouseVec=[0,0,0,0],this.mouseTarget=[0,0],this.mouseFollow=[0,0],this.mouseHasPointer=!1,this.pointerDown=!1,this.hovering=!1,this.hoverGoal=0,this.hoverMix=0,this.leaveRaf=0,this.outEventListeners=0,this.extractEventListeners=0,this.releasing=!1,this.inView=!0,this.resizeObserver=null,this.intersectionObserver=null,this.rebuildToken=0,this.rebindToken=0,this.frameConsumers=new pi,this.ready=!1,this.formPublisher=null,this.outPublisher=null,this.extractPublisher=null,this.lastOutAt=0,this.lastExtractAt=0,this.manualRois=[],this.lastBlobUrls=[],this.pendingRevokeUrls=[],this.extractRunning=!1,this.extractSeq=0,this.onFormMutation=()=>{const n=this.formPublisher?.get()??{};this.applyFormParams(n)},this.onContextLost=n=>{n.preventDefault(),!this.releasing&&(this.rebuildToken++,this.rebindToken++,this.stopLoop(),this.ready=!1,this.runtime=null)},this.onContextRestored=()=>{this.releasing||!this.inView||this.ensureRuntime()},this.loop=()=>{this.raf=requestAnimationFrame(this.loop),this.drawFrame(performance.now()),this.playOnHover&&!this.hovering&&this.hoverSettled()&&(this.stopLoop(),this.runtime?.setVideosPlaying(!1))},this.onPointerMove=n=>{if(!this.mouse)return;const{x:e,y:t}=this.localPointer(n);this.setPointerTarget(e,t),this.pointerDown&&(this.mouseVec[2]=e,this.mouseVec[3]=t)},this.onPointerDown=n=>{if(!this.mouse)return;this.pointerDown=!0,this.setPointerCapture?.(n.pointerId);const{x:e,y:t}=this.localPointer(n);this.setPointerTarget(e,t,!0),this.mouseVec[2]=e,this.mouseVec[3]=t},this.onPointerUp=n=>{if(!this.mouse)return;this.pointerDown=!1;const{x:e,y:t}=this.localPointer(n);this.setPointerTarget(e,t),this.mouseVec[2]=-Math.abs(this.mouseVec[2]),this.mouseVec[3]=-Math.abs(this.mouseVec[3])},this.onPointerEnter=()=>{this.leaveRaf&&(cancelAnimationFrame(this.leaveRaf),this.leaveRaf=0),this.hovering=!0,this.hoverGoal=1,this.syncPlayback()},this.onPointerLeave=()=>{this.leaveRaf&&cancelAnimationFrame(this.leaveRaf),this.leaveRaf=requestAnimationFrame(()=>{this.leaveRaf=0,!(!this.isConnected||this.matches(":hover"))&&(this.hovering=!1,this.hoverGoal=0,this.pointerDown=!1,this.syncPlayback())})}}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(),this.bindExtractPublisher()}addEventListener(n,e,t){n==="out"&&e&&this.outEventListeners++,n==="extract"&&e&&this.extractEventListeners++,super.addEventListener(n,e,t)}removeEventListener(n,e,t){n==="out"&&e&&(this.outEventListeners=Math.max(0,this.outEventListeners-1)),n==="extract"&&e&&(this.extractEventListeners=Math.max(0,this.extractEventListeners-1)),super.removeEventListener(n,e,t)}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.leaveRaf&&(cancelAnimationFrame(this.leaveRaf),this.leaveRaf=0),this.unbindFormProvider(),this.unbindContextEvents(),this.revokeBlobUrls();for(const n of this.pendingRevokeUrls)try{URL.revokeObjectURL(n)}catch{}this.pendingRevokeUrls=[],this.stopLoop(),this.frameConsumers.clear(),this.resizeObserver?.disconnect(),this.intersectionObserver?.disconnect(),this.rebuildToken++,this.rebindToken++,this.ready=!1,this.releasing=!0,this.runtime?.dispose(!0),this.runtime=null,this.outPublisher=null,this.releasing=!1}firstUpdated(){this.resizeObserver=new ResizeObserver(()=>this.syncSize()),this.resizeObserver.observe(this),this.intersectionObserver=new IntersectionObserver(n=>{this.inView=n.some(e=>e.isIntersecting),this.syncVisibility()},{threshold:0}),this.intersectionObserver.observe(this),this.bindFormProvider(),this.bindOutPublisher(),this.bindExtractPublisher(),requestAnimationFrame(()=>{(this.inView||!this.wantsReleaseOffscreen())&&this.ensureRuntime()})}updated(n){if(!this.runtime)return;const e=xs.some(r=>n.has(r)),t=Ss.some(r=>n.has(r));e?this.rebuild():t&&this.rebindChannels(),n.has("play")&&this.syncPlayback(),(n.has("releaseOffscreen")||t)&&this.syncVisibility(),(n.has("dataProvider")||n.has("outDataProvider")||n.has("extractDataProvider"))&&(this.bindFormProvider(),this.bindOutPublisher(),this.bindExtractPublisher()),n.has("aspectRatio")&&this.applyAspectRatio()}applyAspectRatio(n){const e=this.aspectRatio.trim();if(e){this.style.setProperty("--sonic-shader-ar",e.includes("/")?e:e.replace(":"," / "));return}const t=n||this.channel0,r=t?this.runtime?.getTextureSize(t):null;if(r){this.style.setProperty("--sonic-shader-ar",`${r.width} / ${r.height}`);return}this.style.removeProperty("--sonic-shader-ar")}resolveFormProviderId(){const n=this.dataProvider?.trim();return n||at.getAncestorAttributeValue(this,"dataProvider")||at.getAncestorAttributeValue(this,"formDataProvider")||""}unbindFormProvider(){this.formPublisher&&(this.formPublisher.offInternalMutation(this.onFormMutation),this.formPublisher=null)}bindFormProvider(){this.unbindFormProvider();const n=this.resolveFormProviderId();n&&(this.formPublisher=$e.get(n),this.formPublisher.onInternalMutation(this.onFormMutation),this.onFormMutation())}resolveOutProviderId(){const n=this.outDataProvider?.trim();return n||this.resolveFormProviderId()}bindOutPublisher(){const n=this.resolveOutProviderId();this.outPublisher=n?$e.get(n):null}resolveExtractProviderId(){const n=this.extractDataProvider?.trim();return n||this.resolveOutProviderId()}bindExtractPublisher(){const n=this.resolveExtractProviderId();this.extractPublisher=n?$e.get(n):null}applyFormParams(n){const e=n&&typeof n=="object"?n:{},t=Ht(this.hoverParam);t!==0&&(this.param0=Ve(e.param0,this.param0)),t!==1&&(this.param1=Ve(e.param1,this.param1)),t!==2&&(this.param2=Ve(e.param2,this.param2)),t!==3&&(this.param3=Ve(e.param3,this.param3)),"mouseSpeed"in e&&(this.mouseSpeed=Ve(e.mouseSpeed,this.mouseSpeed)),"hoverSpeed"in e&&(this.hoverSpeed=Ve(e.hoverSpeed,this.hoverSpeed)),"extractThreshold"in e&&(this.extractThreshold=Ve(e.extractThreshold,this.extractThreshold)),"extractMax"in e&&(this.extractMax=Ve(e.extractMax,this.extractMax)),"extractPatch"in e&&(this.extractPatch=Ve(e.extractPatch,this.extractPatch)),"rois"in e&&(this.manualRois=Un(e.rois));for(const r of Ps){if(!(r in e))continue;const i=Ls(e[r]);i!==void 0&&this[r]!==i&&(this[r]=i)}}effectiveParams(){const n=[this.param0,this.param1,this.param2,this.param3],e=Ht(this.hoverParam);return e!==null&&(n[e]=this.hoverMix),n}releaseRuntime(){this.rebuildToken++,this.rebindToken++,this.stopLoop(),this.ready=!1,this.releasing=!0,this.unbindContextEvents(),this.runtime?.dispose(!1),this.runtime=null,this.releasing=!1}getCanvas(){return this.renderRoot?.querySelector("canvas")??null}getFrameCanvas(){return!this.ready||!this.runtime||this.runtime.isLost?null:this.getCanvas()}lookupElement(n){if(!n.startsWith("#"))return null;const e=vi(n);if(e)return e;const t=n.slice(1);if(!t||t.startsWith("__sonic_frame_"))return null;const r=this.getRootNode();if(r instanceof Document||r instanceof ShadowRoot){const i=r.getElementById(t);if(i)return i}return typeof document<"u"?document.getElementById(t):null}bindContextEvents(){const n=this.getCanvas();n?.addEventListener("webglcontextlost",this.onContextLost),n?.addEventListener("webglcontextrestored",this.onContextRestored)}unbindContextEvents(){const n=this.getCanvas();n?.removeEventListener("webglcontextlost",this.onContextLost),n?.removeEventListener("webglcontextrestored",this.onContextRestored)}async ensureRuntime(){if(this.runtime&&!this.runtime.isLost||(this.runtime=null,await this.updateComplete,!this.isConnected||!this.inView&&this.wantsReleaseOffscreen()))return;const n=this.getCanvas();if(n)try{this.errorMessage="",this.runtime=new ws(n),this.runtime.setElementResolver(e=>this.lookupElement(e)),this.activeBufferFormat=this.runtime.setBufferFormat($r(this.bufferFormat)),this.bindContextEvents(),this.syncSize(),await this.rebuild()}catch(e){this.emitError(e)}}syncVisibility(){if(!this.inView&&this.wantsReleaseOffscreen()){this.releaseRuntime();return}if(this.inView&&(!this.runtime||this.runtime.isLost)){this.ensureRuntime();return}this.syncPlayback()}syncSize(){if(!this.runtime)return;const n=this.getBoundingClientRect(),e=Math.max(n.width,this.clientWidth,1),t=Math.max(n.height,this.clientHeight,1),r=Math.min(window.devicePixelRatio||1,this.dprMax);this.runtime.resize(e*r,t*r),this.ready&&this.drawFrame(performance.now())}buildChannels(n){const e=[this.channel0,this.channel1,this.channel2,this.channel3],t=n==="image"?[this.imageCh0,this.imageCh1,this.imageCh2,this.imageCh3]:n==="bufferA"?[this.bufferACh0,this.bufferACh1,this.bufferACh2,this.bufferACh3]:n==="bufferB"?[this.bufferBCh0,this.bufferBCh1,this.bufferBCh2,this.bufferBCh3]:n==="bufferC"?[this.bufferCCh0,this.bufferCCh1,this.bufferCCh2,this.bufferCCh3]:[this.bufferDCh0,this.bufferDCh1,this.bufferDCh2,this.bufferDCh3];return[0,1,2,3].map(r=>ys(t[r],e[r]))}collectUrls(n){const e=[];for(const t of n.values())for(const r of t)r.kind==="url"&&e.push(r.url);return e}collectElementKeys(n){const e=[];for(const t of n.values())for(const r of t)r.kind==="element"&&e.push(r.key);return[...new Set(e)]}syncFrameConsumers(n){const e=this.collectElementKeys(n).map(t=>this.lookupElement(t));this.frameConsumers.sync(e)}collectPassChannels(){const n=new Map;for(const e of["bufferA","bufferB","bufferC","bufferD","image"])n.set(e,this.buildChannels(e));return n}wantsReleaseOffscreen(){return fs(this.releaseOffscreen,ls(this.collectPassChannels().values()))}async rebindChannels(){if(!this.runtime||this.runtime.isLost||!this.image.trim())return;if(!this.ready){this.rebuild();return}const n=++this.rebindToken,e=this.collectPassChannels();try{const t=this.collectUrls(e);await this.runtime.ensureTextures(t);for(const i of this.collectElementKeys(e))this.runtime.ensureElementTexture(i);if(n!==this.rebindToken||!this.runtime||this.runtime.isLost)return;this.syncFrameConsumers(e);const r=this.channel0.startsWith("#")?"":this.channel0||t[0];this.applyAspectRatio(r),this.runtime.setPassChannels(e),this.syncSize()}catch(t){if(n!==this.rebindToken)return;this.emitError(t)}}async rebuild(){if(!this.runtime||this.runtime.isLost||!this.image.trim())return;this.rebindToken++;const n=++this.rebuildToken;this.errorMessage="";const e={common:this.common,image:this.image,bufferA:this.bufferA,bufferB:this.bufferB,bufferC:this.bufferC,bufferD:this.bufferD},t=this.collectPassChannels();try{this.syncSize(),this.activeBufferFormat=this.runtime.setBufferFormat($r(this.bufferFormat));const r=this.collectUrls(t);await this.runtime.ensureTextures(r);for(const u of this.collectElementKeys(t))this.runtime.ensureElementTexture(u);if(n!==this.rebuildToken||!this.runtime||this.runtime.isLost)return;this.syncFrameConsumers(t);const i=this.channel0.startsWith("#")?"":this.channel0||r[0];if(this.applyAspectRatio(i),this.syncSize(),this.runtime.setSources(e,t),n!==this.rebuildToken||!this.runtime||this.runtime.isLost)return;this.ready=!0,this.startTime=performance.now(),this.lastTime=this.startTime,this.frame=0,this.drawFrame(this.startTime),this.syncPlayback()}catch(r){if(n!==this.rebuildToken)return;this.ready=!1,this.stopLoop(),this.emitError(r)}}emitError(n){const e=n instanceof ht||n instanceof Error?n.message:String(n);this.errorMessage=e,this.dispatchEvent(new CustomEvent("error",{detail:{message:e,pass:n instanceof ht?n.pass:void 0,infoLog:n instanceof ht?n.infoLog:void 0},bubbles:!0,composed:!0}))}shouldAnimate(){return!this.play||!this.ready||!this.inView||Ds()||!this.runtime?!1:this.playOnHover?this.hovering||!this.hoverSettled():!0}hoverSettled(){return Ht(this.hoverParam)===null?!0:Math.abs(this.hoverMix-this.hoverGoal)<.002}syncPlayback(){this.shouldAnimate()?(this.runtime?.setVideosPlaying(!0),this.raf||(this.lastTime=performance.now(),this.loop())):(this.stopLoop(),this.runtime?.setVideosPlaying(!1),this.ready&&this.drawFrame(performance.now()))}stopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0)}drawFrame(n){if(!this.runtime||!this.ready)return;const e=(n-this.startTime)/1e3,t=Math.max(0,(n-this.lastTime)/1e3);this.lastTime=n,this.advanceMouseFollow(t),this.advanceHover(t);const r=this.effectiveParams();this.runtime.render({time:e,timeDelta:t,frame:this.frame++,mouse:this.mouseVec,params:r}),this.frameSeq++,this.maybePublishOut(n,e,r),this.maybeExtract(n,e)}round3(n){return Math.round(n*1e3)/1e3}buildOutput(n,e,t=!1){const{width:r,height:i}=this.runtime?.size??{width:1,height:1},u=this.mouseHasPointer,o=u&&r>0?this.mouseVec[0]/r:.5,h=u&&i>0?this.mouseVec[1]/i:.5,b=e??this.effectiveParams(),T={time:this.round3(n),frame:this.frame,mouseX:this.round3(o),mouseY:this.round3(h),hovering:this.hovering?1:0,param0:this.round3(b[0]),param1:this.round3(b[1]),param2:this.round3(b[2]),param3:this.round3(b[3])};if(t&&this.runtime){const M=u?this.mouseVec[0]:r*.5,S=u?this.mouseVec[1]:i*.5,[w,P,D,N]=this.runtime.readPixel(M,S),Z=w/255,Y=P/255,E=D/255,m=N/255;T.sampleR=this.round3(Z),T.sampleG=this.round3(Y),T.sampleB=this.round3(E),T.sampleA=this.round3(m),T.sampleLuma=this.round3(.2126*Z+.7152*Y+.0722*E)}return T}publisherFieldHasListener(n){return!!this.outPublisher?._proxies_?.get(n)?.hasListener?.()}hasOutConsumers(){if(this.outEventListeners>0)return!0;if(!this.outPublisher)return!1;for(const n of ks)if(this.publisherFieldHasListener(n))return!0;for(const n of Cs)if(this.publisherFieldHasListener(n))return!0;return!1}shouldSkipParamOutWrite(n){if(!Ts.includes(n)||!this.formPublisher||this.formPublisher!==this.outPublisher)return!1;const e=Ht(this.hoverParam);return e===null?!0:Number(n.slice(5))!==e}needsSampleRead(){return this.sample&&this.hasOutConsumers()}maybePublishOut(n,e,t){if(this.outPublisher||this.bindOutPublisher(),!this.hasOutConsumers())return;const r=Math.max(16,this.outInterval||80);if(n-this.lastOutAt<r)return;this.lastOutAt=n;const i=this.buildOutput(e,t,this.needsSampleRead()),u=this.outPublisher;if(u){for(const[o,h]of Object.entries(i))if(h!==void 0&&!this.shouldSkipParamOutWrite(o))try{u[o].set(h)}catch{}}this.dispatchEvent(new CustomEvent("out",{detail:i,bubbles:!0,composed:!0}))}revokeBlobUrls(){for(const n of this.lastBlobUrls)try{URL.revokeObjectURL(n)}catch{}this.lastBlobUrls=[]}scheduleRevokePreviousBlobs(n){const e=n.filter(r=>r.startsWith("blob:"));if(e.length===0)return;this.pendingRevokeUrls.push(...e);const t=e;window.setTimeout(()=>{for(const r of t){try{URL.revokeObjectURL(r)}catch{}const i=this.pendingRevokeUrls.indexOf(r);i>=0&&this.pendingRevokeUrls.splice(i,1)}},1500)}publisherHasFieldListener(n,e){return!!n?._proxies_?.get(e)?.hasListener?.()}hasExtractConsumers(){if(this.extractEventListeners>0)return!0;const n=this.extractPublisher;if(!n)return!1;for(const e of Rs)if(this.publisherHasFieldListener(n,e))return!0;return!1}syncManualRoisFromPublishers(){const n=e=>{if(e?.get)try{const t=e.get()??{};"rois"in t&&(this.manualRois=Un(t.rois))}catch{}};n(this.formPublisher),this.extractPublisher&&this.extractPublisher!==this.formPublisher&&n(this.extractPublisher)}resolveExtractInterval(){return this.extractInterval>0?Math.max(16,this.extractInterval):Math.max(16,this.outInterval||100)}async readRegion(n){return!this.runtime||!this.ready?null:await this.buildExtractItem(n,"manual",void 0)}async extractNow(){const n=(performance.now()-this.startTime)/1e3;return this.runExtract(n)}async maybeExtract(n,e){!this.extract||!this.ready||!this.runtime||(this.extractPublisher||this.bindExtractPublisher(),this.hasExtractConsumers()&&(n-this.lastExtractAt<this.resolveExtractInterval()||this.extractRunning||(this.lastExtractAt=n,await this.runExtract(e))))}async runExtract(n){const e={frame:this.frame,time:this.round3(n),items:[]};if(!this.runtime||!this.ready)return e;this.extractRunning=!0;try{this.syncManualRoisFromPublishers();const{width:t,height:r}=this.runtime.size,i=this.manualRois.map(S=>({...S,source:"manual"})),u=Nr(this.extractMask);if(u){const S=this.runtime.readBufferRect(u,0,0,t,r);if(S){const w=hs(S.data,S.width,S.height,{threshold:this.extractThreshold,maxCount:Math.max(0,Math.floor(this.extractMax)),minDistance:Math.max(8,Math.floor(Math.min(this.extractPatch/3,16)))}),P=w[0]?.score||1;for(let D=0;D<w.length;D++){const N=w[D];i.push({id:`detect-${D}`,x:(N.x+.5)/t,y:(N.y+.5)/r,patch:this.extractPatch,source:"detect",score:P>0?N.score/P:N.score})}}}const o=[];let h=0;const b=Nr(this.extractSource)??"image";for(const S of i){const w=S.source==="detect"?"detect":"manual";if(w==="detect"){if(h>=Math.max(0,Math.floor(this.extractMax)))continue;h++}const P=kn(S,t,r,this.extractPatch,Mn);if(!P)continue;const D=b==="image"?this.runtime.readRect(P.x,P.y,P.w,P.h):this.runtime.readBufferRect(b,P.x,P.y,P.w,P.h);if(!D)continue;const N=Pn(D.data),Z=Tn(D.data),Y={id:S.id||`${w}-${P.x}-${P.y}`,x:this.round3(D.x/t),y:this.round3(D.y/r),w:this.round3(D.width/t),h:this.round3(D.height/r),meanR:this.round3(Z.r),meanG:this.round3(Z.g),meanB:this.round3(Z.b),meanA:this.round3(Z.a),meanLuma:this.round3(Z.luma),source:w};typeof S.score=="number"&&(Y.score=this.round3(S.score)),o.push({item:Y,rgba:N,width:D.width,height:D.height})}if(this.extractBitmaps){const S=this.rebuildToken;for(const w of o){if(S!==this.rebuildToken||!this.isConnected){for(const D of o)D.item.blobUrl&&It([D.item.blobUrl]);return e}const P=await Fn(w.rgba,w.width,w.height);if(S!==this.rebuildToken||!this.isConnected){P&&It([P]);for(const D of o)D.item.blobUrl&&It([D.item.blobUrl]);return e}P&&On(w.item,P)}}if(!this.isConnected){for(const S of o)S.item.blobUrl&&It([S.item.blobUrl]);return e}const T=o.map(S=>S.item),M={frame:this.frame,time:this.round3(n),items:T};return this.publishExtract(M),M}finally{this.extractRunning=!1}}async buildExtractItem(n,e,t){if(!this.runtime)return null;const{width:r,height:i}=this.runtime.size,u=kn(n,r,i,this.extractPatch,Mn);if(!u)return null;const o=Nr(this.extractSource)??"image",h=o==="image"?this.runtime.readRect(u.x,u.y,u.w,u.h):this.runtime.readBufferRect(o,u.x,u.y,u.w,u.h);if(!h)return null;const b=Tn(h.data),T={id:n.id||`${e}-${u.x}-${u.y}`,x:this.round3(h.x/r),y:this.round3(h.y/i),w:this.round3(h.width/r),h:this.round3(h.height/i),meanR:this.round3(b.r),meanG:this.round3(b.g),meanB:this.round3(b.b),meanA:this.round3(b.a),meanLuma:this.round3(b.luma),source:e};if(typeof t=="number"&&(T.score=this.round3(t)),this.extractBitmaps){const M=this.rebuildToken,S=await Fn(Pn(h.data),h.width,h.height);if(M!==this.rebuildToken||!this.isConnected)return S&&It([S]),null;S&&On(T,S)}return T}publishExtract(n){this.scheduleRevokePreviousBlobs(this.lastBlobUrls),this.lastBlobUrls=[];for(const t of n.items)t.blobUrl&&this.lastBlobUrls.push(t.blobUrl);this.extractSeq++,this.extractPublisher||this.bindExtractPublisher();const e=this.extractPublisher;if(e)try{const t=e.get?.()??{};e.set({...t,rois:Array.isArray(t.rois)?t.rois:this.manualRois,extracts:n.items,extractCount:n.items.length,extractSeq:this.extractSeq})}catch{try{e.extracts.set(n.items),e.extractCount.set(n.items.length),e.extractSeq.set(this.extractSeq)}catch{}}this.dispatchEvent(new CustomEvent("extract",{detail:n,bubbles:!0,composed:!0}))}advanceMouseFollow(n){if(!this.mouse||this.mouseMode!=="target"||!this.mouseHasPointer)return;const e=Math.max(0,this.mouseSpeed),t=e<=0||n<=0?1:1-Math.exp(-e*n);this.mouseFollow[0]+=(this.mouseTarget[0]-this.mouseFollow[0])*t,this.mouseFollow[1]+=(this.mouseTarget[1]-this.mouseFollow[1])*t,this.mouseVec[0]=this.mouseFollow[0],this.mouseVec[1]=this.mouseFollow[1]}advanceHover(n){if(Ht(this.hoverParam)===null)return;const e=Math.max(0,this.hoverSpeed),t=e<=0||n<=0?1:1-Math.exp(-e*n),r=this.hoverMix+(this.hoverGoal-this.hoverMix)*t;this.hoverMix=Math.abs(r-this.hoverGoal)<.002?this.hoverGoal:r}localPointer(n){const e=this.getBoundingClientRect(),t=Math.min(window.devicePixelRatio||1,this.dprMax),r=(n.clientX-e.left)*t,i=(e.height-(n.clientY-e.top))*t;return{x:r,y:i}}setPointerTarget(n,e,t=!1){this.mouseTarget[0]=n,this.mouseTarget[1]=e,(!this.mouseHasPointer||t||this.mouseMode==="direct")&&(this.mouseHasPointer=!0,this.mouseFollow[0]=n,this.mouseFollow[1]=e,this.mouseVec[0]=n,this.mouseVec[1]=e)}render(){return rn`
|
|
84
|
-
<canvas part="canvas"></canvas>
|
|
85
|
-
${this.errorMessage?rn`<div class="err" part="error">${this.errorMessage}</div>`:null}
|
|
86
|
-
`}};V.styles=jn`
|
|
87
|
-
:host {
|
|
88
|
-
display: block;
|
|
89
|
-
position: relative;
|
|
90
|
-
width: 100%;
|
|
91
|
-
max-width: 100%;
|
|
92
|
-
height: auto;
|
|
93
|
-
aspect-ratio: var(--sonic-shader-ar, 16 / 9);
|
|
94
|
-
overflow: hidden;
|
|
95
|
-
background: #0a0a0a;
|
|
96
|
-
color: #f87171;
|
|
97
|
-
font: 12px/1.4 ui-monospace, monospace;
|
|
98
|
-
}
|
|
99
|
-
canvas {
|
|
100
|
-
position: absolute;
|
|
101
|
-
inset: 0;
|
|
102
|
-
width: 100%;
|
|
103
|
-
height: 100%;
|
|
104
|
-
display: block;
|
|
105
|
-
touch-action: none;
|
|
106
|
-
}
|
|
107
|
-
.err {
|
|
108
|
-
position: absolute;
|
|
109
|
-
inset: 0;
|
|
110
|
-
z-index: 1;
|
|
111
|
-
padding: 0.75rem;
|
|
112
|
-
background: rgba(0, 0, 0, 0.85);
|
|
113
|
-
white-space: pre-wrap;
|
|
114
|
-
overflow: auto;
|
|
115
|
-
}
|
|
116
|
-
`,W([X()],V.prototype,"image",2),W([X({attribute:"buffer-a"})],V.prototype,"bufferA",2),W([X({attribute:"buffer-b"})],V.prototype,"bufferB",2),W([X({attribute:"buffer-c"})],V.prototype,"bufferC",2),W([X({attribute:"buffer-d"})],V.prototype,"bufferD",2),W([X()],V.prototype,"common",2),W([X()],V.prototype,"channel0",2),W([X()],V.prototype,"channel1",2),W([X()],V.prototype,"channel2",2),W([X()],V.prototype,"channel3",2),W([X({attribute:"image-ch0"})],V.prototype,"imageCh0",2),W([X({attribute:"image-ch1"})],V.prototype,"imageCh1",2),W([X({attribute:"image-ch2"})],V.prototype,"imageCh2",2),W([X({attribute:"image-ch3"})],V.prototype,"imageCh3",2),W([X({attribute:"buffer-a-ch0"})],V.prototype,"bufferACh0",2),W([X({attribute:"buffer-a-ch1"})],V.prototype,"bufferACh1",2),W([X({attribute:"buffer-a-ch2"})],V.prototype,"bufferACh2",2),W([X({attribute:"buffer-a-ch3"})],V.prototype,"bufferACh3",2),W([X({attribute:"buffer-b-ch0"})],V.prototype,"bufferBCh0",2),W([X({attribute:"buffer-b-ch1"})],V.prototype,"bufferBCh1",2),W([X({attribute:"buffer-b-ch2"})],V.prototype,"bufferBCh2",2),W([X({attribute:"buffer-b-ch3"})],V.prototype,"bufferBCh3",2),W([X({attribute:"buffer-c-ch0"})],V.prototype,"bufferCCh0",2),W([X({attribute:"buffer-c-ch1"})],V.prototype,"bufferCCh1",2),W([X({attribute:"buffer-c-ch2"})],V.prototype,"bufferCCh2",2),W([X({attribute:"buffer-c-ch3"})],V.prototype,"bufferCCh3",2),W([X({attribute:"buffer-d-ch0"})],V.prototype,"bufferDCh0",2),W([X({attribute:"buffer-d-ch1"})],V.prototype,"bufferDCh1",2),W([X({attribute:"buffer-d-ch2"})],V.prototype,"bufferDCh2",2),W([X({attribute:"buffer-d-ch3"})],V.prototype,"bufferDCh3",2),W([X({type:Boolean,reflect:!0})],V.prototype,"play",2),W([X({type:Boolean,attribute:"play-on-hover"})],V.prototype,"playOnHover",2),W([X({type:Boolean})],V.prototype,"mouse",2),W([X({type:String,attribute:"mouse-mode"})],V.prototype,"mouseMode",2),W([X({type:Number,attribute:"mouse-speed"})],V.prototype,"mouseSpeed",2),W([X({attribute:"hover-param"})],V.prototype,"hoverParam",2),W([X({type:Number,attribute:"hover-speed"})],V.prototype,"hoverSpeed",2),W([X({attribute:"release-offscreen",converter:{fromAttribute:n=>cs(n),toAttribute:n=>n==="auto"?"auto":n===!1?"false":""}})],V.prototype,"releaseOffscreen",2),W([X({type:Number,attribute:"dpr-max"})],V.prototype,"dprMax",2),W([X({attribute:"buffer-format"})],V.prototype,"bufferFormat",2),W([X({attribute:"active-buffer-format",reflect:!0})],V.prototype,"activeBufferFormat",2),W([X({type:Number,attribute:"param0"})],V.prototype,"param0",2),W([X({type:Number,attribute:"param1"})],V.prototype,"param1",2),W([X({type:Number,attribute:"param2"})],V.prototype,"param2",2),W([X({type:Number,attribute:"param3"})],V.prototype,"param3",2),W([X({type:String})],V.prototype,"dataProvider",2),W([X({type:String,attribute:"out-data-provider"})],V.prototype,"outDataProvider",2),W([X({type:Boolean})],V.prototype,"sample",2),W([X({type:Number,attribute:"out-interval"})],V.prototype,"outInterval",2),W([X({type:Boolean})],V.prototype,"extract",2),W([X({type:Number,attribute:"extract-interval"})],V.prototype,"extractInterval",2),W([X({type:String,attribute:"extract-source"})],V.prototype,"extractSource",2),W([X({type:String,attribute:"extract-mask"})],V.prototype,"extractMask",2),W([X({type:Number,attribute:"extract-threshold"})],V.prototype,"extractThreshold",2),W([X({type:Number,attribute:"extract-max"})],V.prototype,"extractMax",2),W([X({type:Number,attribute:"extract-patch"})],V.prototype,"extractPatch",2),W([X({type:Boolean,attribute:"extract-bitmaps"})],V.prototype,"extractBitmaps",2),W([X({type:String,attribute:"extract-data-provider"})],V.prototype,"extractDataProvider",2),W([X({type:String,attribute:"aspect-ratio"})],V.prototype,"aspectRatio",2),W([hi()],V.prototype,"errorMessage",2),V=W([ci(As)],V)})();
|