@swisspost/design-system-components 1.3.10 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/check-non-empty-35b4d0b5.js +14 -0
- package/dist/cjs/check-non-empty-35b4d0b5.js.map +1 -0
- package/dist/cjs/check-one-of-4c2e8b2e.js +10 -0
- package/dist/cjs/check-one-of-4c2e8b2e.js.map +1 -0
- package/dist/cjs/{package-f6bb523d.js → check-type-508a21a5.js} +1 -10
- package/dist/cjs/check-type-508a21a5.js.map +1 -0
- package/dist/cjs/fade-8c6d4fa7.js +12 -0
- package/dist/cjs/fade-8c6d4fa7.js.map +1 -0
- package/dist/cjs/{index-272283b3.js → index-12cc37c9.js} +121 -5
- package/dist/{post-components/p-0096c140.js.map → cjs/index-12cc37c9.js.map} +1 -1
- package/dist/cjs/index-f8f6f146.js +28 -0
- package/dist/cjs/index-f8f6f146.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package-67091813.js +7 -0
- package/dist/cjs/package-67091813.js.map +1 -0
- package/dist/cjs/post-alert.cjs.entry.js +106 -0
- package/dist/cjs/post-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/post-collapsible.cjs.entry.js +6 -4
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-icon.cjs.entry.js +14 -29
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +35 -0
- package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +29 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +136 -0
- package/dist/cjs/post-tabs.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +5097 -0
- package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -0
- package/dist/collection/animations/fade.js +6 -0
- package/dist/collection/animations/fade.js.map +1 -0
- package/dist/collection/animations/index.js +2 -0
- package/dist/collection/animations/index.js.map +1 -0
- package/dist/collection/collection-manifest.json +6 -1
- package/dist/collection/components/post-alert/alert-types.js +2 -0
- package/dist/collection/components/post-alert/alert-types.js.map +1 -0
- package/dist/collection/components/post-alert/post-alert.css +563 -0
- package/dist/collection/components/post-alert/post-alert.js +256 -0
- package/dist/collection/components/post-alert/post-alert.js.map +1 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +7 -0
- package/dist/collection/components/post-tab-header/post-tab-header.css +337 -0
- package/dist/collection/components/post-tab-header/post-tab-header.js +68 -0
- package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.css +3 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +55 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -0
- package/dist/collection/components/post-tabs/post-tabs.css +148 -0
- package/dist/collection/components/post-tabs/post-tabs.js +208 -0
- package/dist/collection/components/post-tabs/post-tabs.js.map +1 -0
- package/dist/collection/components/post-tooltip/post-tooltip.css +194 -0
- package/dist/collection/components/post-tooltip/post-tooltip.js +338 -0
- package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -0
- package/dist/collection/components/post-tooltip/types.js +2 -0
- package/dist/collection/components/post-tooltip/types.js.map +1 -0
- package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +5 -0
- package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -0
- package/dist/collection/utils/property-checkers/index.js +3 -0
- package/dist/collection/utils/property-checkers/index.js.map +1 -1
- package/dist/components/check-non-empty.js +11 -0
- package/dist/components/check-non-empty.js.map +1 -0
- package/dist/components/check-one-of.js +8 -0
- package/dist/components/check-one-of.js.map +1 -0
- package/dist/{esm/package-bcf00737.js → components/check-type.js} +2 -9
- package/dist/components/check-type.js.map +1 -0
- package/dist/components/fade.js +9 -0
- package/dist/components/fade.js.map +1 -0
- package/dist/components/package.js +2 -20
- package/dist/components/package.js.map +1 -1
- package/dist/components/post-alert.d.ts +11 -0
- package/dist/components/post-alert.js +136 -0
- package/dist/components/post-alert.js.map +1 -0
- package/dist/components/post-collapsible.js +3 -1
- package/dist/components/post-collapsible.js.map +1 -1
- package/dist/components/post-icon.js +1 -141
- package/dist/components/post-icon.js.map +1 -1
- package/dist/components/post-icon2.js +146 -0
- package/dist/components/post-icon2.js.map +1 -0
- package/dist/components/post-tab-header.d.ts +11 -0
- package/dist/components/post-tab-header.js +52 -0
- package/dist/components/post-tab-header.js.map +1 -0
- package/dist/components/post-tab-panel.d.ts +11 -0
- package/dist/components/post-tab-panel.js +46 -0
- package/dist/components/post-tab-panel.js.map +1 -0
- package/dist/components/post-tabs.d.ts +11 -0
- package/dist/components/post-tabs.js +153 -0
- package/dist/components/post-tabs.js.map +1 -0
- package/dist/components/post-tooltip.d.ts +11 -0
- package/dist/components/post-tooltip.js +5118 -0
- package/dist/components/post-tooltip.js.map +1 -0
- package/dist/docs.json +441 -1
- package/dist/esm/check-non-empty-554bdf88.js +11 -0
- package/dist/esm/check-non-empty-554bdf88.js.map +1 -0
- package/dist/esm/check-one-of-ded5e15e.js +8 -0
- package/dist/esm/check-one-of-ded5e15e.js.map +1 -0
- package/dist/esm/check-type-18ebb4e7.js +16 -0
- package/dist/esm/check-type-18ebb4e7.js.map +1 -0
- package/dist/esm/fade-671f1489.js +9 -0
- package/dist/esm/fade-671f1489.js.map +1 -0
- package/dist/esm/{index-60a84798.js → index-5611074b.js} +121 -6
- package/dist/esm/index-5611074b.js.map +1 -0
- package/dist/esm/index-7f723686.js +24 -0
- package/dist/esm/index-7f723686.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-f5cb3167.js +5 -0
- package/dist/esm/package-f5cb3167.js.map +1 -0
- package/dist/esm/post-alert.entry.js +102 -0
- package/dist/esm/post-alert.entry.js.map +1 -0
- package/dist/esm/post-collapsible.entry.js +4 -2
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-icon.entry.js +6 -21
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-tab-header.entry.js +31 -0
- package/dist/esm/post-tab-header.entry.js.map +1 -0
- package/dist/esm/post-tab-panel.entry.js +25 -0
- package/dist/esm/post-tab-panel.entry.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +132 -0
- package/dist/esm/post-tabs.entry.js.map +1 -0
- package/dist/esm/post-tooltip.entry.js +5093 -0
- package/dist/esm/post-tooltip.entry.js.map +1 -0
- package/dist/post-components/p-12046db8.entry.js +2 -0
- package/dist/post-components/{p-99ccf0cf.entry.js.map → p-12046db8.entry.js.map} +1 -1
- package/dist/post-components/p-15fc087f.js +2 -0
- package/dist/post-components/p-15fc087f.js.map +1 -0
- package/dist/post-components/p-24b07f64.js +2 -0
- package/dist/post-components/p-24b07f64.js.map +1 -0
- package/dist/post-components/p-29535fea.entry.js +2 -0
- package/dist/post-components/p-29535fea.entry.js.map +1 -0
- package/dist/post-components/p-296af738.entry.js +2 -0
- package/dist/post-components/p-296af738.entry.js.map +1 -0
- package/dist/post-components/p-2b6ab354.entry.js +9 -0
- package/dist/post-components/p-2b6ab354.entry.js.map +1 -0
- package/dist/post-components/p-75a7b352.js +2 -0
- package/dist/post-components/p-75a7b352.js.map +1 -0
- package/dist/post-components/p-a14ec7bb.entry.js +2 -0
- package/dist/post-components/p-a14ec7bb.entry.js.map +1 -0
- package/dist/post-components/p-bcc705f1.js +2 -0
- package/dist/post-components/p-bcc705f1.js.map +1 -0
- package/dist/post-components/p-c7497ecb.entry.js +2 -0
- package/dist/post-components/p-c7497ecb.entry.js.map +1 -0
- package/dist/post-components/p-c8efe0ae.js +2 -0
- package/dist/post-components/p-c8efe0ae.js.map +1 -0
- package/dist/post-components/p-cc6e4eb8.entry.js +2 -0
- package/dist/post-components/p-cc6e4eb8.entry.js.map +1 -0
- package/dist/post-components/p-d94db268.js +3 -0
- package/dist/post-components/p-d94db268.js.map +1 -0
- package/dist/post-components/p-e5306504.js +2 -0
- package/dist/post-components/p-e5306504.js.map +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/post-components/post-components.esm.js.map +1 -1
- package/dist/types/animations/fade.d.ts +2 -0
- package/dist/types/animations/index.d.ts +1 -0
- package/dist/types/components/post-alert/alert-types.d.ts +2 -0
- package/dist/types/components/post-alert/post-alert.d.ts +49 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +11 -0
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +10 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +34 -0
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +66 -0
- package/dist/types/components/post-tooltip/types.d.ts +2 -0
- package/dist/types/components.d.ts +190 -0
- package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -0
- package/dist/types/utils/property-checkers/index.d.ts +3 -1
- package/package.json +13 -9
- package/dist/cjs/index-272283b3.js.map +0 -1
- package/dist/cjs/package-f6bb523d.js.map +0 -1
- package/dist/esm/index-60a84798.js.map +0 -1
- package/dist/esm/package-bcf00737.js.map +0 -1
- package/dist/post-components/p-0096c140.js +0 -3
- package/dist/post-components/p-4a3ff4c0.js +0 -2
- package/dist/post-components/p-4a3ff4c0.js.map +0 -1
- package/dist/post-components/p-99ccf0cf.entry.js +0 -2
- package/dist/post-components/p-cafa0281.entry.js +0 -2
- package/dist/post-components/p-cafa0281.entry.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,h as t,H as i,g as e}from"./p-d94db268.js";import{c as n}from"./p-bcc705f1.js";import{c as s}from"./p-75a7b352.js";import{v as a}from"./p-24b07f64.js";function r(o,t=[]){if(!Array.isArray(t))t=[t];const i=t.filter((t=>!o.classList.contains(t)));if(i.length)o.classList.add(...i);const e=o.scrollHeight;if(i.length)o.classList.remove(...i);return e}function d(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}async function c(o){return new Promise((t=>{if(d()){t()}else{o.ontransitionend=()=>{t();o.ontransitionend=null}}}))}const h=".accordion-item{border-block-start:2px solid hsl(0, 0%, 90%)}.accordion-header{font-size:1.0625rem;font-weight:700;line-height:1.5;margin:0}@media (min-width: 1024px){.accordion-header{font-size:1.25rem}}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;user-select:none;appearance:button;width:100%;position:relative;padding-block:1rem;padding-inline-start:1rem;padding-inline-end:2.5rem;text-align:start}.accordion-button:not(:disabled){cursor:pointer}.accordion-button:disabled{opacity:0.4}.accordion-button:focus{outline:none;box-shadow:0 0 0 0.125rem rgba(51, 51, 51, 0.25)}.accordion-button::after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6 7.6 7.6z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6 7.6 7.6z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;content:\"\";display:block;height:1.5rem;width:1.5rem;position:absolute;inset-inline-end:1rem;inset-block-start:50%;transform:translateY(-50%);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1);border:1px solid rgb(var(--post-bg-rgb, 255, 255, 255))}.accordion-button.collapsed::after{transform:translateY(-50%) rotate(-180deg)}.accordion-button>.text-truncate{display:block}@media (forced-colors: active), (-ms-high-contrast: active), (-ms-high-contrast: white-on-black){.accordion-button:hover:not(:disabled),.accordion-button:focus-visible:not(:disabled){outline:2px solid Highlight}.accordion-button:disabled{opacity:1 !important}}.accordion-body{padding:0.75rem 1rem 2.5rem;border-block-start:2px solid hsl(0, 0%, 90%)}.accordion-body h1,.accordion-body .h1{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media (min-width: 1024px){.accordion-body h1,.accordion-body .h1{font-size:1.25rem}}.accordion-body h2,.accordion-body .h2{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media (min-width: 1024px){.accordion-body h2,.accordion-body .h2{font-size:1.25rem}}.accordion-body h3,.accordion-body .h3{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media (min-width: 1024px){.accordion-body h3,.accordion-body .h3{font-size:1.25rem}}.accordion-body h4,.accordion-body .h4{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media (min-width: 1024px){.accordion-body h4,.accordion-body .h4{font-size:1.25rem}}.accordion-body h5,.accordion-body .h5{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media (min-width: 1024px){.accordion-body h5,.accordion-body .h5{font-size:1.25rem}}.accordion-body h6,.accordion-body .h6{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media (min-width: 1024px){.accordion-body h6,.accordion-body .h6{font-size:1.25rem}}.accordion-button>:first-child,.accordion-body>:first-child{margin-block-start:0 !important}.accordion-button>:last-child,.accordion-body>:last-child{margin-block-end:0 !important}/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */.fade{transition:opacity 200ms linear}@media (prefers-reduced-motion: reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{height:0;overflow:hidden;transition:height 250ms cubic-bezier(0.4, 0, 0.2, 1), padding 250ms cubic-bezier(0.4, 0, 0.2, 1)}@media (prefers-reduced-motion: reduce){.collapsing{transition:none}}.collapsing.collapse-horizontal{width:0;height:auto;transition:width 0.35s ease}@media (prefers-reduced-motion: reduce){.collapsing.collapse-horizontal{transition:none}}:host{display:block}:host .accordion-button>::slotted(.text-truncate){display:block}";let l=0;const p=class{constructor(t){o(this,t);this.isLoaded=false;this.collapseClasses=undefined;this.collapseHeight=null;this.collapsibleId=undefined;this.hasHeader=undefined;this.headingTag=undefined;this.isOpen=true;this.onAccordionButtonClick=()=>this.toggle();this.collapsed=false;this.headingLevel=2}validateCollapsed(o=this.collapsed){s(o,"boolean",'The post-collapsible "collapsed" prop should be a boolean.');if(!this.isLoaded){this.isOpen=!o;this.collapseClasses=this.getCollapseClasses()}else{setTimeout((()=>{this.toggle(!o)}))}}validateHeadingLevel(o=this.headingLevel){n(o,[1,2,3,4,5,6],"The post-collapsible element requires a heading level between 1 and 6.");this.headingTag=`h${o}`}componentWillLoad(){this.validateCollapsed();this.validateHeadingLevel();this.hasHeader=this.host.querySelectorAll('[slot="header"]').length>0;if(!this.hasHeader){console.warn("Be sure to bind the post-collapsible to its control using aria-controls and aria-expanded attributes. More information here: https://getbootstrap.com/docs/5.2/components/collapse/#accessibility")}this.collapsibleId=this.host.id||`post-collapsible-${l++}`;this.collapseClasses=this.getCollapseClasses()}componentDidLoad(){this.isLoaded=true;this.collapsibleElement=this.host.shadowRoot.querySelector(`#${this.collapsibleId}--collapse`)}async toggle(o=!this.isOpen){if(o!==this.isOpen){this.isOpen=!this.isOpen;this.startTransition();await c(this.collapsibleElement).then((()=>{this.collapseHeight=null;this.collapseClasses=this.getCollapseClasses()}));return this.isOpen}}startTransition(){const o=r(this.collapsibleElement,"show");this.collapseHeight=`${this.isOpen?0:o}px`;this.collapseClasses="collapsing";setTimeout((()=>{this.collapseHeight=`${this.isOpen?o:0}px`}),50)}getCollapseClasses(){return this.isOpen?"collapse show":"collapse"}render(){if(!this.hasHeader){return t("div",{id:`${this.collapsibleId}--collapse`,class:this.collapseClasses,style:{height:this.collapseHeight}},t("slot",null))}return t(i,{"data-version":a},t("div",{class:"accordion-item"},t(this.headingTag,{class:"accordion-header",id:`${this.collapsibleId}--header`},t("button",{class:`accordion-button ${this.isOpen?"":"collapsed"}`,type:"button","aria-expanded":`${this.isOpen}`,"aria-controls":`${this.collapsibleId}--collapse`,onClick:this.onAccordionButtonClick},t("slot",{name:"header"}))),t("div",{id:`${this.collapsibleId}--collapse`,class:`accordion-collapse ${this.collapseClasses}`,style:{height:this.collapseHeight},"aria-labelledby":`${this.collapsibleId}--header`},t("div",{class:"accordion-body"},t("slot",null)))))}get host(){return e(this)}static get watchers(){return{collapsed:["validateCollapsed"],headingLevel:["validateHeadingLevel"]}}};p.style=h;export{p as post_collapsible};
|
|
2
|
+
//# sourceMappingURL=p-12046db8.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getElementHeight","el","classesWhenShown","Array","isArray","classesToAdd","filter","klass","classList","contains","length","add","scrollHeight","remove","shouldReduceMotion","window","matchMedia","matches","async","onTransitionEnd","Promise","resolve","ontransitionend","postCollapsibleCss","nextId","PostCollapsible","this","isLoaded","toggle","validateCollapsed","newValue","collapsed","checkType","isOpen","collapseClasses","getCollapseClasses","setTimeout","validateHeadingLevel","headingLevel","checkOneOf","headingTag","componentWillLoad","hasHeader","host","querySelectorAll","console","warn","collapsibleId","id","componentDidLoad","collapsibleElement","shadowRoot","querySelector","open","startTransition","then","collapseHeight","expandedHeight","render","h","class","style","height","Host","version","type","onClick","onAccordionButtonClick","name"],"sources":["./src/utils/get-element-height.ts","./src/utils/should-reduce-motion.ts","./src/utils/on-transition-end.ts","./src/components/post-collapsible/post-collapsible.scss?tag=post-collapsible&encapsulation=shadow","./src/components/post-collapsible/post-collapsible.tsx"],"sourcesContent":["export function getElementHeight(el: HTMLElement): number;\nexport function getElementHeight(el: HTMLElement, classWhenShown: string): number;\nexport function getElementHeight(el: HTMLElement, classesWhenShown: string[]): number;\nexport function getElementHeight(el: HTMLElement, classesWhenShown: string | string[] = []): number {\n if (!Array.isArray(classesWhenShown)) classesWhenShown = [classesWhenShown];\n\n const classesToAdd = classesWhenShown.filter(klass => !el.classList.contains(klass));\n if (classesToAdd.length) el.classList.add(...classesToAdd);\n\n const scrollHeight = el.scrollHeight;\n\n if (classesToAdd.length) el.classList.remove(...classesToAdd);\n\n return scrollHeight;\n}\n","export function shouldReduceMotion(): boolean {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n","import { shouldReduceMotion } from './should-reduce-motion';\n\nexport async function onTransitionEnd(el: HTMLElement): Promise<void> {\n return new Promise(resolve => {\n if (shouldReduceMotion()) {\n resolve();\n } else {\n el.ontransitionend = () => {\n resolve();\n el.ontransitionend = null;\n };\n }\n });\n}\n","@use '@swisspost/design-system-styles/components/accordion';\n@use '@swisspost/design-system-styles/components/transitions';\n\n:host {\n display: block;\n\n .accordion-button > ::slotted(.text-truncate) {\n display: block;\n }\n}\n","import { Component, Element, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { checkOneOf, checkType, getElementHeight, onTransitionEnd } from '../../utils';\nimport { version } from '../../../package.json';\n\nlet nextId = 0;\n\n@Component({\n tag: 'post-collapsible',\n styleUrl: 'post-collapsible.scss',\n shadow: true,\n})\nexport class PostCollapsible {\n private collapsibleElement: HTMLElement;\n private isLoaded = false;\n\n @Element() host: HTMLPostCollapsibleElement;\n\n @State() collapseClasses: string;\n @State() collapseHeight: string | null = null;\n @State() collapsibleId: string;\n @State() hasHeader: boolean;\n @State() headingTag: string | undefined;\n @State() isOpen = true;\n @State() onAccordionButtonClick = () => this.toggle();\n\n /**\n * If `true`, the element is initially collapsed otherwise it is displayed.\n */\n @Prop() readonly collapsed?: boolean = false;\n\n @Watch('collapsed')\n validateCollapsed(newValue = this.collapsed) {\n checkType(newValue, 'boolean', 'The post-collapsible \"collapsed\" prop should be a boolean.');\n\n if (!this.isLoaded) {\n this.isOpen = !newValue;\n this.collapseClasses = this.getCollapseClasses();\n } else {\n setTimeout(() => {\n this.toggle(!newValue);\n });\n }\n }\n\n /**\n * Defines the hierarchical level of the collapsible header within the headings structure.\n */\n @Prop() readonly headingLevel?: number = 2;\n\n @Watch('headingLevel')\n validateHeadingLevel(newValue = this.headingLevel) {\n checkOneOf(\n newValue,\n [1, 2, 3, 4, 5, 6],\n 'The post-collapsible element requires a heading level between 1 and 6.',\n );\n\n this.headingTag = `h${newValue}`;\n }\n\n componentWillLoad() {\n this.validateCollapsed();\n this.validateHeadingLevel();\n\n this.hasHeader = this.host.querySelectorAll('[slot=\"header\"]').length > 0;\n if (!this.hasHeader) {\n console.warn(\n 'Be sure to bind the post-collapsible to its control using aria-controls and aria-expanded attributes. More information here: https://getbootstrap.com/docs/5.2/components/collapse/#accessibility',\n );\n }\n\n this.collapsibleId = this.host.id || `post-collapsible-${nextId++}`;\n this.collapseClasses = this.getCollapseClasses();\n }\n\n componentDidLoad() {\n this.isLoaded = true;\n this.collapsibleElement = this.host.shadowRoot.querySelector(\n `#${this.collapsibleId}--collapse`,\n );\n }\n\n /**\n * Triggers the collapse programmatically.\n */\n @Method()\n async toggle(open = !this.isOpen): Promise<boolean> {\n if (open !== this.isOpen) {\n this.isOpen = !this.isOpen;\n\n this.startTransition();\n\n await onTransitionEnd(this.collapsibleElement).then(() => {\n this.collapseHeight = null;\n this.collapseClasses = this.getCollapseClasses();\n });\n\n return this.isOpen;\n }\n }\n\n private startTransition() {\n const expandedHeight = getElementHeight(this.collapsibleElement, 'show');\n\n this.collapseHeight = `${this.isOpen ? 0 : expandedHeight}px`;\n this.collapseClasses = 'collapsing';\n\n setTimeout(() => {\n this.collapseHeight = `${this.isOpen ? expandedHeight : 0}px`;\n }, 50);\n }\n\n private getCollapseClasses() {\n return this.isOpen ? 'collapse show' : 'collapse';\n }\n\n render() {\n if (!this.hasHeader) {\n return (\n <div\n id={`${this.collapsibleId}--collapse`}\n class={this.collapseClasses}\n style={{ height: this.collapseHeight }}\n >\n <slot />\n </div>\n );\n }\n\n return (\n <Host data-version={version}>\n <div class=\"accordion-item\">\n <this.headingTag class=\"accordion-header\" id={`${this.collapsibleId}--header`}>\n <button\n class={`accordion-button ${this.isOpen ? '' : 'collapsed'}`}\n type=\"button\"\n aria-expanded={`${this.isOpen}`}\n aria-controls={`${this.collapsibleId}--collapse`}\n onClick={this.onAccordionButtonClick}\n >\n <slot name=\"header\" />\n </button>\n </this.headingTag>\n <div\n id={`${this.collapsibleId}--collapse`}\n class={`accordion-collapse ${this.collapseClasses}`}\n style={{ height: this.collapseHeight }}\n aria-labelledby={`${this.collapsibleId}--header`}\n >\n <div class=\"accordion-body\">\n <slot />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["getElementHeight","el","classesWhenShown","Array","isArray","classesToAdd","filter","klass","classList","contains","length","add","scrollHeight","remove","shouldReduceMotion","window","matchMedia","matches","async","onTransitionEnd","Promise","resolve","ontransitionend","postCollapsibleCss","nextId","PostCollapsible","this","isLoaded","toggle","validateCollapsed","newValue","collapsed","checkType","isOpen","collapseClasses","getCollapseClasses","setTimeout","validateHeadingLevel","headingLevel","checkOneOf","headingTag","componentWillLoad","hasHeader","host","querySelectorAll","console","warn","collapsibleId","id","componentDidLoad","collapsibleElement","shadowRoot","querySelector","open","startTransition","then","collapseHeight","expandedHeight","render","h","class","style","height","Host","version","type","onClick","onAccordionButtonClick","name"],"sources":["./src/utils/get-element-height.ts","./src/utils/should-reduce-motion.ts","./src/utils/on-transition-end.ts","./src/components/post-collapsible/post-collapsible.scss?tag=post-collapsible&encapsulation=shadow","./src/components/post-collapsible/post-collapsible.tsx"],"sourcesContent":["export function getElementHeight(el: HTMLElement): number;\nexport function getElementHeight(el: HTMLElement, classWhenShown: string): number;\nexport function getElementHeight(el: HTMLElement, classesWhenShown: string[]): number;\nexport function getElementHeight(el: HTMLElement, classesWhenShown: string | string[] = []): number {\n if (!Array.isArray(classesWhenShown)) classesWhenShown = [classesWhenShown];\n\n const classesToAdd = classesWhenShown.filter(klass => !el.classList.contains(klass));\n if (classesToAdd.length) el.classList.add(...classesToAdd);\n\n const scrollHeight = el.scrollHeight;\n\n if (classesToAdd.length) el.classList.remove(...classesToAdd);\n\n return scrollHeight;\n}\n","export function shouldReduceMotion(): boolean {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n","import { shouldReduceMotion } from './should-reduce-motion';\n\nexport async function onTransitionEnd(el: HTMLElement): Promise<void> {\n return new Promise(resolve => {\n if (shouldReduceMotion()) {\n resolve();\n } else {\n el.ontransitionend = () => {\n resolve();\n el.ontransitionend = null;\n };\n }\n });\n}\n","@use '@swisspost/design-system-styles/components/accordion';\n@use '@swisspost/design-system-styles/components/transitions';\n\n:host {\n display: block;\n\n .accordion-button > ::slotted(.text-truncate) {\n display: block;\n }\n}\n","import { Component, Element, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { checkOneOf, checkType, getElementHeight, onTransitionEnd } from '../../utils';\nimport { version } from '../../../package.json';\n\nlet nextId = 0;\n\n@Component({\n tag: 'post-collapsible',\n styleUrl: 'post-collapsible.scss',\n shadow: true,\n})\nexport class PostCollapsible {\n private collapsibleElement: HTMLElement;\n private isLoaded = false;\n\n @Element() host: HTMLPostCollapsibleElement;\n\n @State() collapseClasses: string;\n @State() collapseHeight: string | null = null;\n @State() collapsibleId: string;\n @State() hasHeader: boolean;\n @State() headingTag: string | undefined;\n @State() isOpen = true;\n @State() onAccordionButtonClick = () => this.toggle();\n\n /**\n * If `true`, the element is initially collapsed otherwise it is displayed.\n */\n @Prop() readonly collapsed?: boolean = false;\n\n @Watch('collapsed')\n validateCollapsed(newValue = this.collapsed) {\n checkType(newValue, 'boolean', 'The post-collapsible \"collapsed\" prop should be a boolean.');\n\n if (!this.isLoaded) {\n this.isOpen = !newValue;\n this.collapseClasses = this.getCollapseClasses();\n } else {\n setTimeout(() => {\n this.toggle(!newValue);\n });\n }\n }\n\n /**\n * Defines the hierarchical level of the collapsible header within the headings structure.\n */\n @Prop() readonly headingLevel?: number = 2;\n\n @Watch('headingLevel')\n validateHeadingLevel(newValue = this.headingLevel) {\n checkOneOf(\n newValue,\n [1, 2, 3, 4, 5, 6],\n 'The post-collapsible element requires a heading level between 1 and 6.',\n );\n\n this.headingTag = `h${newValue}`;\n }\n\n componentWillLoad() {\n this.validateCollapsed();\n this.validateHeadingLevel();\n\n this.hasHeader = this.host.querySelectorAll('[slot=\"header\"]').length > 0;\n if (!this.hasHeader) {\n console.warn(\n 'Be sure to bind the post-collapsible to its control using aria-controls and aria-expanded attributes. More information here: https://getbootstrap.com/docs/5.2/components/collapse/#accessibility',\n );\n }\n\n this.collapsibleId = this.host.id || `post-collapsible-${nextId++}`;\n this.collapseClasses = this.getCollapseClasses();\n }\n\n componentDidLoad() {\n this.isLoaded = true;\n this.collapsibleElement = this.host.shadowRoot.querySelector(\n `#${this.collapsibleId}--collapse`,\n );\n }\n\n /**\n * Triggers the collapse programmatically.\n */\n @Method()\n async toggle(open = !this.isOpen): Promise<boolean> {\n if (open !== this.isOpen) {\n this.isOpen = !this.isOpen;\n\n this.startTransition();\n\n await onTransitionEnd(this.collapsibleElement).then(() => {\n this.collapseHeight = null;\n this.collapseClasses = this.getCollapseClasses();\n });\n\n return this.isOpen;\n }\n }\n\n private startTransition() {\n const expandedHeight = getElementHeight(this.collapsibleElement, 'show');\n\n this.collapseHeight = `${this.isOpen ? 0 : expandedHeight}px`;\n this.collapseClasses = 'collapsing';\n\n setTimeout(() => {\n this.collapseHeight = `${this.isOpen ? expandedHeight : 0}px`;\n }, 50);\n }\n\n private getCollapseClasses() {\n return this.isOpen ? 'collapse show' : 'collapse';\n }\n\n render() {\n if (!this.hasHeader) {\n return (\n <div\n id={`${this.collapsibleId}--collapse`}\n class={this.collapseClasses}\n style={{ height: this.collapseHeight }}\n >\n <slot />\n </div>\n );\n }\n\n return (\n <Host data-version={version}>\n <div class=\"accordion-item\">\n <this.headingTag class=\"accordion-header\" id={`${this.collapsibleId}--header`}>\n <button\n class={`accordion-button ${this.isOpen ? '' : 'collapsed'}`}\n type=\"button\"\n aria-expanded={`${this.isOpen}`}\n aria-controls={`${this.collapsibleId}--collapse`}\n onClick={this.onAccordionButtonClick}\n >\n <slot name=\"header\" />\n </button>\n </this.headingTag>\n <div\n id={`${this.collapsibleId}--collapse`}\n class={`accordion-collapse ${this.collapseClasses}`}\n style={{ height: this.collapseHeight }}\n aria-labelledby={`${this.collapsibleId}--header`}\n >\n <div class=\"accordion-body\">\n <slot />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"8KAGgBA,EAAiBC,EAAiBC,EAAsC,IACtF,IAAKC,MAAMC,QAAQF,GAAmBA,EAAmB,CAACA,GAE1D,MAAMG,EAAeH,EAAiBI,QAAOC,IAAUN,EAAGO,UAAUC,SAASF,KAC7E,GAAIF,EAAaK,OAAQT,EAAGO,UAAUG,OAAON,GAE7C,MAAMO,EAAeX,EAAGW,aAExB,GAAIP,EAAaK,OAAQT,EAAGO,UAAUK,UAAUR,GAEhD,OAAOO,CACT,C,SCdgBE,IACd,OAAOC,OAAOC,WAAW,oCAAoCC,OAC/D,CCAOC,eAAeC,EAAgBlB,GACpC,OAAO,IAAImB,SAAQC,IACjB,GAAIP,IAAsB,CACxBO,G,KACK,CACLpB,EAAGqB,gBAAkB,KACnBD,IACApB,EAAGqB,gBAAkB,IAAI,C,IAIjC,CCbA,MAAMC,EAAqB,okKCI3B,IAAIC,EAAS,E,MAOAC,EAAe,M,yBAElBC,KAAAC,SAAW,M,mDAKsB,K,4FAIvB,K,4BACgB,IAAMD,KAAKE,S,eAKN,M,kBAmBE,C,CAhBzCC,kBAAkBC,EAAWJ,KAAKK,WAChCC,EAAUF,EAAU,UAAW,8DAE/B,IAAKJ,KAAKC,SAAU,CAClBD,KAAKO,QAAUH,EACfJ,KAAKQ,gBAAkBR,KAAKS,oB,KACvB,CACLC,YAAW,KACTV,KAAKE,QAAQE,EAAS,G,EAW5BO,qBAAqBP,EAAWJ,KAAKY,cACnCC,EACET,EACA,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAChB,0EAGFJ,KAAKc,WAAa,IAAIV,G,CAGxBW,oBACEf,KAAKG,oBACLH,KAAKW,uBAELX,KAAKgB,UAAYhB,KAAKiB,KAAKC,iBAAiB,mBAAmBlC,OAAS,EACxE,IAAKgB,KAAKgB,UAAW,CACnBG,QAAQC,KACN,oM,CAIJpB,KAAKqB,cAAgBrB,KAAKiB,KAAKK,IAAM,oBAAoBxB,MACzDE,KAAKQ,gBAAkBR,KAAKS,oB,CAG9Bc,mBACEvB,KAAKC,SAAW,KAChBD,KAAKwB,mBAAqBxB,KAAKiB,KAAKQ,WAAWC,cAC7C,IAAI1B,KAAKqB,0B,CAQb7B,aAAamC,GAAQ3B,KAAKO,QACxB,GAAIoB,IAAS3B,KAAKO,OAAQ,CACxBP,KAAKO,QAAUP,KAAKO,OAEpBP,KAAK4B,wBAECnC,EAAgBO,KAAKwB,oBAAoBK,MAAK,KAClD7B,KAAK8B,eAAiB,KACtB9B,KAAKQ,gBAAkBR,KAAKS,oBAAoB,IAGlD,OAAOT,KAAKO,M,EAIRqB,kBACN,MAAMG,EAAiBzD,EAAiB0B,KAAKwB,mBAAoB,QAEjExB,KAAK8B,eAAiB,GAAG9B,KAAKO,OAAS,EAAIwB,MAC3C/B,KAAKQ,gBAAkB,aAEvBE,YAAW,KACTV,KAAK8B,eAAiB,GAAG9B,KAAKO,OAASwB,EAAiB,KAAK,GAC5D,G,CAGGtB,qBACN,OAAOT,KAAKO,OAAS,gBAAkB,U,CAGzCyB,SACE,IAAKhC,KAAKgB,UAAW,CACnB,OACEiB,EAAA,OACEX,GAAI,GAAGtB,KAAKqB,0BACZa,MAAOlC,KAAKQ,gBACZ2B,MAAO,CAAEC,OAAQpC,KAAK8B,iBAEtBG,EAAA,a,CAKN,OACEA,EAACI,EAAI,gBAAeC,GAClBL,EAAA,OAAKC,MAAM,kBACTD,EAACjC,KAAKc,WAAU,CAACoB,MAAM,mBAAmBZ,GAAI,GAAGtB,KAAKqB,yBACpDY,EAAA,UACEC,MAAO,oBAAoBlC,KAAKO,OAAS,GAAK,cAC9CgC,KAAK,SAAQ,gBACE,GAAGvC,KAAKO,SAAQ,gBAChB,GAAGP,KAAKqB,0BACvBmB,QAASxC,KAAKyC,wBAEdR,EAAA,QAAMS,KAAK,aAGfT,EAAA,OACEX,GAAI,GAAGtB,KAAKqB,0BACZa,MAAO,sBAAsBlC,KAAKQ,kBAClC2B,MAAO,CAAEC,OAAQpC,KAAK8B,gBAAgB,kBACrB,GAAG9B,KAAKqB,yBAEzBY,EAAA,OAAKC,MAAM,kBACTD,EAAA,gB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{E as o}from"./p-c8efe0ae.js";import{c as r}from"./p-bcc705f1.js";import{c as s}from"./p-75a7b352.js";function t(r){return(...s)=>{const t=s[0];if(!o.some((o=>o===t)))r(...s)}}function c(o,r,s){if(typeof o!=="string"||!r.test(o))throw new Error(s)}const n=t(r);const f=t(c);const a=t(s);export{n as a,a as b,f as c};
|
|
2
|
+
//# sourceMappingURL=p-15fc087f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["emptyOr","check","args","value","EMPTY_VALUES","some","v","checkPattern","pattern","errorMessage","test","Error","checkEmptyOrOneOf","checkOneOf","checkEmptyOrPattern","checkEmptyOrType","checkType"],"sources":["./src/utils/property-checkers/empty-or.ts","./src/utils/property-checkers/check-pattern.ts","./src/utils/property-checkers/index.ts"],"sourcesContent":["import { EMPTY_VALUES } from './constants';\n\nexport function emptyOr<T extends unknown[]>(check: (...args: T) => void) {\n return (...args: T) => {\n const value = args[0];\n if (!EMPTY_VALUES.some(v => v === value)) check(...args);\n };\n}\n","export function checkPattern(value: unknown, pattern: RegExp, errorMessage: string) {\n if (typeof value !== 'string' || !pattern.test(value)) throw new Error(errorMessage);\n}\n","import { emptyOr } from './empty-or';\nimport { checkOneOf } from './check-one-of';\nimport { checkPattern } from './check-pattern';\nimport { checkType } from './check-type';\n\nexport const checkEmptyOrOneOf = emptyOr(checkOneOf);\nexport const checkEmptyOrPattern = emptyOr(checkPattern);\nexport const checkEmptyOrType = emptyOr(checkType);\n\nexport * from './check-non-empty';\nexport * from './check-one-of';\nexport * from './check-pattern';\nexport * from './check-type';\n"],"mappings":"qHAEgBA,EAA6BC,GAC3C,MAAO,IAAIC,KACT,MAAMC,EAAQD,EAAK,GACnB,IAAKE,EAAaC,MAAKC,GAAKA,IAAMH,IAAQF,KAASC,EAAK,CAE5D,C,SCPgBK,EAAaJ,EAAgBK,EAAiBC,GAC5D,UAAWN,IAAU,WAAaK,EAAQE,KAAKP,GAAQ,MAAM,IAAIQ,MAAMF,EACzE,C,MCGaG,EAAoBZ,EAAQa,G,MAC5BC,EAAsBd,EAAQO,G,MAC9BQ,EAAmBf,EAAQgB,U"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as s,h as t,H as n,g as o}from"./p-d94db268.js";import{v as a}from"./p-24b07f64.js";const e=":host{display:none}";const r=class{constructor(t){s(this,t);this.panelId=undefined;this.name=undefined}componentWillLoad(){this.panelId=`panel-${this.host.id||crypto.randomUUID()}`}render(){return t(n,{"data-version":a},t("div",{class:"tab-pane",id:this.panelId,role:"tabpanel"},t("slot",null)))}get host(){return o(this)}};r.style=e;export{r as post_tab_panel};
|
|
2
|
+
//# sourceMappingURL=p-29535fea.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["postTabPanelCss","PostTabPanel","componentWillLoad","this","panelId","host","id","crypto","randomUUID","render","h","Host","version","class","role"],"sources":["./src/components/post-tab-panel/post-tab-panel.scss?tag=post-tab-panel&encapsulation=shadow","./src/components/post-tab-panel/post-tab-panel.tsx"],"sourcesContent":[":host {\n display: none;\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\nimport { version } from '../../../package.json';\n\n@Component({\n tag: 'post-tab-panel',\n styleUrl: 'post-tab-panel.scss',\n shadow: true,\n})\nexport class PostTabPanel {\n @Element() host: HTMLPostTabPanelElement;\n\n @State() panelId: string;\n\n /**\n * The name of the panel, used to associate it with a tab header.\n */\n @Prop() readonly name: string;\n\n componentWillLoad() {\n // get the id set on the host element or use a random id by default\n this.panelId = `panel-${this.host.id || crypto.randomUUID()}`;\n }\n\n render() {\n return (\n <Host data-version={version}>\n <div\n class=\"tab-pane\"\n id={this.panelId}\n role=\"tabpanel\"\n >\n <slot/>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"6FAAA,MAAMA,EAAkB,sB,MCQXC,EAAY,M,oEAUvBC,oBAEEC,KAAKC,QAAU,SAASD,KAAKE,KAAKC,IAAMC,OAAOC,c,CAGjDC,SACE,OACEC,EAACC,EAAI,gBAAeC,GAClBF,EAAA,OACEG,MAAM,WACNP,GAAIH,KAAKC,QACTU,KAAK,YAELJ,EAAA,c"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as a,h as r,H as o,g as s}from"./p-d94db268.js";import{v as e}from"./p-24b07f64.js";import{f as i,a as b}from"./p-e5306504.js";const c='.tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:#faf9f8}.tabs-wrapper::after{content:"";position:absolute;bottom:0;width:100%;height:1px;background-color:hsl(0, 0%, 80%)}.tabs-wrapper .tabs{background-color:transparent !important}@media (forced-colors: active), (-ms-high-contrast: active), (-ms-high-contrast: white-on-black){.tabs-wrapper::after{background-color:ButtonBorder}}.tabs{margin:0;padding:0;list-style:none;display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap}.tabs::after{content:"";display:block;flex:1 0 auto;width:1rem}.tab-content{padding-top:1rem;padding-bottom:1rem}.bg-yellow .tabs-wrapper{background-color:#fc0}.bg-light .tabs-wrapper{background-color:#faf9f8}.bg-gray .tabs-wrapper{background-color:#f4f3f1}.bg-dark .tabs-wrapper{background-color:hsl(0, 0%, 20%)}.bg-primary .tabs-wrapper{background-color:hsl(0, 0%, 20%)}.bg-white .tabs-wrapper{background-color:#fff}.bg-black .tabs-wrapper{background-color:#000}.bg-success .tabs-wrapper{background-color:#2c911c}.bg-info .tabs-wrapper{background-color:#cce4ee}.bg-warning .tabs-wrapper{background-color:#f49e00}.bg-danger .tabs-wrapper{background-color:#a51728}.bg-nightblue .tabs-wrapper{background-color:#004976}.bg-nightblue-bright .tabs-wrapper{background-color:#0076a8}.bg-petrol .tabs-wrapper{background-color:#006d68}.bg-petrol-bright .tabs-wrapper{background-color:#00968f}.bg-coral .tabs-wrapper{background-color:#9e2a2f}.bg-coral-bright .tabs-wrapper{background-color:#e03c31}.bg-olive .tabs-wrapper{background-color:#716135}.bg-olive-bright .tabs-wrapper{background-color:#aa9d2e}.bg-purple .tabs-wrapper{background-color:#80276c}.bg-purple-bright .tabs-wrapper{background-color:#c5299b}.bg-aubergine .tabs-wrapper{background-color:#523178}.bg-aubergine-bright .tabs-wrapper{background-color:#7566a0}:host{display:block}';const n=class{constructor(r){t(this,r);this.tabChange=a(this,"tabChange",7);this.isLoaded=false;this.activePanel=undefined}get tabs(){return this.host.querySelectorAll("post-tab-header")}componentDidLoad(){this.moveMisplacedTabs();this.enableTabs();const t=this.activePanel||this.tabs.item(0).panel;this.show(t);this.isLoaded=true}async show(t){var a;if(t===((a=this.activeTab)===null||a===void 0?void 0:a.panel)){return}const r=this.activeTab;const o=this.host.querySelector(`post-tab-header[panel=${t}]`);this.activateTab(o);if(this.showing){this.showing.effect["target"].style.display="none";this.showing.finish()}if(r&&!this.showing&&!this.hiding){this.hidePanel(r.panel)}if(this.hiding){await this.hiding.finished}this.showSelectedPanel();if(this.showing){await this.showing.finished}this.tabChange.emit(this.activeTab.panel)}moveMisplacedTabs(){if(!this.tabs)return;this.tabs.forEach((t=>{if(t.getAttribute("slot")==="tabs")return;t.setAttribute("slot","tabs")}))}enableTabs(){if(!this.tabs)return;this.tabs.forEach((async t=>{await t.componentOnReady();const a=t.shadowRoot.querySelector(".tab-title");if(a.getAttribute("aria-controls"))return;const r=this.getPanel(t.panel).shadowRoot.querySelector(".tab-pane");a.setAttribute("aria-controls",r.id);r.setAttribute("aria-labelledby",a.id);t.addEventListener("click",(a=>{a.preventDefault();this.show(t.panel)}))}));if(this.activeTab&&!this.activeTab.isConnected){this.show(this.tabs.item(0).panel)}}activateTab(t){if(this.activeTab){const t=this.activeTab.shadowRoot.querySelector(".tab-title");t.setAttribute("aria-selected","false");t.classList.remove("active")}const a=t.shadowRoot.querySelector(".tab-title");a.setAttribute("aria-selected","true");a.classList.add("active");this.activeTab=t}hidePanel(t){const a=this.getPanel(t);if(!a)return;this.hiding=i(a);this.hiding.onfinish=()=>{a.style.display="none";this.hiding=null}}showSelectedPanel(){const t=this.getPanel(this.activeTab.panel);t.style.display="block";if(!this.isLoaded)return;this.showing=b(t);this.showing.onfinish=()=>{this.showing=null}}getPanel(t){return this.host.querySelector(`post-tab-panel[name=${t}]`)}render(){return r(o,{"data-version":e},r("div",{class:"tabs-wrapper"},r("ul",{class:"tabs nav",role:"tablist"},r("slot",{name:"tabs",onSlotchange:()=>this.enableTabs()}))),r("div",{class:"tab-content"},r("slot",{onSlotchange:()=>this.moveMisplacedTabs()})))}get host(){return s(this)}};n.style=c;export{n as post_tabs};
|
|
2
|
+
//# sourceMappingURL=p-296af738.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["postTabsCss","PostTabs","this","isLoaded","tabs","host","querySelectorAll","componentDidLoad","moveMisplacedTabs","enableTabs","initiallyActivePanel","activePanel","item","panel","show","async","panelName","_a","activeTab","previousTab","newTab","querySelector","activateTab","showing","effect","style","display","finish","hiding","hidePanel","finished","showSelectedPanel","tabChange","emit","forEach","tab","getAttribute","setAttribute","componentOnReady","tabTitle","shadowRoot","tabPanel","getPanel","id","addEventListener","e","preventDefault","isConnected","classList","remove","add","previousPanel","fadeOut","onfinish","fadeIn","name","render","h","Host","version","class","role","onSlotchange"],"sources":["./src/components/post-tabs/post-tabs.scss?tag=post-tabs&encapsulation=shadow","./src/components/post-tabs/post-tabs.tsx"],"sourcesContent":["@use '@swisspost/design-system-styles/components/tabs/tabs-wrapper';\n\n:host {\n display: block;\n}\n","import { Component, Host, h, Element, Method, Event, EventEmitter, Prop } from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { fadeIn, fadeOut } from '../../animations';\n\n@Component({\n tag: 'post-tabs',\n styleUrl: 'post-tabs.scss',\n shadow: true,\n})\nexport class PostTabs {\n private activeTab: HTMLPostTabHeaderElement;\n private showing: Animation;\n private hiding: Animation;\n private isLoaded = false;\n\n private get tabs(): NodeListOf<HTMLPostTabHeaderElement> {\n return this.host.querySelectorAll('post-tab-header');\n }\n\n @Element() host: HTMLPostTabsElement;\n\n /**\n * The name of the panel that is initially shown.\n * If not specified, it defaults to the panel associated with the first tab.\n *\n * **Changing this value after initialization has no effect.**\n */\n @Prop() readonly activePanel: HTMLPostTabPanelElement['name'];\n\n /**\n * An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.\n * The payload is the name of the newly shown panel.\n */\n @Event() tabChange: EventEmitter<HTMLPostTabPanelElement['name']>;\n\n componentDidLoad() {\n this.moveMisplacedTabs();\n this.enableTabs();\n\n const initiallyActivePanel = this.activePanel || this.tabs.item(0).panel;\n this.show(initiallyActivePanel);\n\n this.isLoaded = true;\n }\n\n /**\n * Shows the panel with the given name and selects its associated tab.\n * Any other panel that was previously shown becomes hidden and its associated tab is unselected.\n */\n @Method()\n async show(panelName: string) {\n // do nothing if the tab is already active\n if (panelName === this.activeTab?.panel) {\n return;\n }\n\n const previousTab = this.activeTab;\n const newTab : HTMLPostTabHeaderElement = this.host.querySelector(`post-tab-header[panel=${panelName}]`);\n this.activateTab(newTab);\n\n // if a panel is currently being displayed, remove it from the view and complete the associated animation\n if (this.showing) {\n this.showing.effect['target'].style.display = 'none';\n this.showing.finish();\n }\n\n // hide the currently visible panel only if no other animation is running\n if (previousTab && !this.showing && !this.hiding) {\n this.hidePanel(previousTab.panel);\n }\n\n // wait for any hiding animation to complete before showing the selected tab\n if (this.hiding) {\n await this.hiding.finished;\n }\n\n this.showSelectedPanel();\n\n // wait for any display animation to complete for the returned promise to fully resolve\n if (this.showing) {\n await this.showing.finished;\n }\n\n this.tabChange.emit(this.activeTab.panel);\n }\n private moveMisplacedTabs() {\n if (!this.tabs) return;\n\n this.tabs.forEach(tab => {\n if (tab.getAttribute('slot') === 'tabs') return;\n tab.setAttribute('slot', 'tabs');\n });\n }\n\n private enableTabs() {\n if (!this.tabs) return;\n\n this.tabs.forEach(async tab => {\n await tab.componentOnReady();\n\n const tabTitle = tab.shadowRoot.querySelector('.tab-title');\n\n // if the tab has an \"aria-controls\" attribute it was already linked to its panel: do nothing\n if (tabTitle.getAttribute('aria-controls')) return;\n\n const tabPanel = this.getPanel(tab.panel).shadowRoot.querySelector('.tab-pane');\n tabTitle.setAttribute('aria-controls', tabPanel.id);\n tabPanel.setAttribute('aria-labelledby', tabTitle.id);\n\n tab.addEventListener('click', e => {\n e.preventDefault();\n this.show(tab.panel);\n });\n });\n\n // if the currently active tab was removed from the DOM then select the first one\n if (this.activeTab && !this.activeTab.isConnected) {\n this.show(this.tabs.item(0).panel);\n }\n }\n\n private activateTab(tab: HTMLPostTabHeaderElement) {\n if (this.activeTab) {\n const tabTitle = this.activeTab.shadowRoot.querySelector('.tab-title');\n tabTitle.setAttribute('aria-selected', 'false');\n tabTitle.classList.remove('active');\n }\n\n const tabTitle = tab.shadowRoot.querySelector('.tab-title');\n tabTitle.setAttribute('aria-selected', 'true');\n tabTitle.classList.add('active');\n\n this.activeTab = tab;\n }\n\n private hidePanel(panelName: HTMLPostTabPanelElement['name']) {\n const previousPanel = this.getPanel(panelName);\n\n if (!previousPanel) return;\n\n this.hiding = fadeOut(previousPanel);\n this.hiding.onfinish = () => {\n previousPanel.style.display = 'none';\n this.hiding = null;\n };\n }\n\n private showSelectedPanel() {\n const panel = this.getPanel(this.activeTab.panel);\n panel.style.display = 'block';\n\n // prevent the initially selected panel from fading in\n if (!this.isLoaded) return;\n\n this.showing = fadeIn(panel);\n this.showing.onfinish = () => {\n this.showing = null;\n };\n }\n\n private getPanel(name: string): HTMLPostTabPanelElement {\n return this.host.querySelector(\n `post-tab-panel[name=${name}]`\n );\n }\n\n render() {\n return (\n <Host data-version={version}>\n <div class=\"tabs-wrapper\">\n <ul class=\"tabs nav\" role=\"tablist\">\n <slot name=\"tabs\" onSlotchange={() => this.enableTabs()} />\n </ul>\n </div>\n <div class=\"tab-content\">\n <slot onSlotchange={() => this.moveMisplacedTabs()} />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"+IAAA,MAAMA,EAAc,u1D,MCSPC,EAAQ,M,8DAIXC,KAAAC,SAAW,M,2BAEPC,WACV,OAAOF,KAAKG,KAAKC,iBAAiB,kB,CAmBpCC,mBACEL,KAAKM,oBACLN,KAAKO,aAEL,MAAMC,EAAuBR,KAAKS,aAAeT,KAAKE,KAAKQ,KAAK,GAAGC,MACnEX,KAAKY,KAAKJ,GAEVR,KAAKC,SAAW,I,CAQlBY,WAAWC,G,MAET,GAAIA,MAAcC,EAAAf,KAAKgB,aAAS,MAAAD,SAAA,SAAAA,EAAEJ,OAAO,CACvC,M,CAGF,MAAMM,EAAcjB,KAAKgB,UACzB,MAAME,EAAoClB,KAAKG,KAAKgB,cAAc,yBAAyBL,MAC3Fd,KAAKoB,YAAYF,GAGjB,GAAIlB,KAAKqB,QAAS,CAChBrB,KAAKqB,QAAQC,OAAO,UAAUC,MAAMC,QAAU,OAC9CxB,KAAKqB,QAAQI,Q,CAIf,GAAIR,IAAgBjB,KAAKqB,UAAYrB,KAAK0B,OAAQ,CAChD1B,KAAK2B,UAAUV,EAAYN,M,CAI7B,GAAIX,KAAK0B,OAAQ,OACT1B,KAAK0B,OAAOE,Q,CAGpB5B,KAAK6B,oBAGL,GAAI7B,KAAKqB,QAAS,OACVrB,KAAKqB,QAAQO,Q,CAGrB5B,KAAK8B,UAAUC,KAAK/B,KAAKgB,UAAUL,M,CAE7BL,oBACN,IAAKN,KAAKE,KAAM,OAEhBF,KAAKE,KAAK8B,SAAQC,IAChB,GAAIA,EAAIC,aAAa,UAAY,OAAQ,OACzCD,EAAIE,aAAa,OAAQ,OAAO,G,CAI5B5B,aACN,IAAKP,KAAKE,KAAM,OAEhBF,KAAKE,KAAK8B,SAAQnB,MAAMoB,UAChBA,EAAIG,mBAEV,MAAMC,EAAWJ,EAAIK,WAAWnB,cAAc,cAG9C,GAAIkB,EAASH,aAAa,iBAAkB,OAE5C,MAAMK,EAAWvC,KAAKwC,SAASP,EAAItB,OAAO2B,WAAWnB,cAAc,aACnEkB,EAASF,aAAa,gBAAiBI,EAASE,IAChDF,EAASJ,aAAa,kBAAmBE,EAASI,IAElDR,EAAIS,iBAAiB,SAASC,IAC5BA,EAAEC,iBACF5C,KAAKY,KAAKqB,EAAItB,MAAM,GACpB,IAIJ,GAAIX,KAAKgB,YAAchB,KAAKgB,UAAU6B,YAAa,CACjD7C,KAAKY,KAAKZ,KAAKE,KAAKQ,KAAK,GAAGC,M,EAIxBS,YAAYa,GAClB,GAAIjC,KAAKgB,UAAW,CAClB,MAAMqB,EAAWrC,KAAKgB,UAAUsB,WAAWnB,cAAc,cACzDkB,EAASF,aAAa,gBAAiB,SACvCE,EAASS,UAAUC,OAAO,S,CAG5B,MAAMV,EAAWJ,EAAIK,WAAWnB,cAAc,cAC9CkB,EAASF,aAAa,gBAAiB,QACvCE,EAASS,UAAUE,IAAI,UAEvBhD,KAAKgB,UAAYiB,C,CAGXN,UAAUb,GAChB,MAAMmC,EAAgBjD,KAAKwC,SAAS1B,GAEpC,IAAKmC,EAAe,OAEpBjD,KAAK0B,OAASwB,EAAQD,GACtBjD,KAAK0B,OAAOyB,SAAW,KACrBF,EAAc1B,MAAMC,QAAU,OAC9BxB,KAAK0B,OAAS,IAAI,C,CAIdG,oBACN,MAAMlB,EAAQX,KAAKwC,SAASxC,KAAKgB,UAAUL,OAC3CA,EAAMY,MAAMC,QAAU,QAGtB,IAAKxB,KAAKC,SAAU,OAEpBD,KAAKqB,QAAU+B,EAAOzC,GACtBX,KAAKqB,QAAQ8B,SAAW,KACtBnD,KAAKqB,QAAU,IAAI,C,CAIfmB,SAASa,GACf,OAAOrD,KAAKG,KAAKgB,cACf,uBAAuBkC,K,CAI3BC,SACE,OACEC,EAACC,EAAI,gBAAeC,GAClBF,EAAA,OAAKG,MAAM,gBACTH,EAAA,MAAIG,MAAM,WAAWC,KAAK,WACxBJ,EAAA,QAAMF,KAAK,OAAOO,aAAc,IAAM5D,KAAKO,iBAG/CgD,EAAA,OAAKG,MAAM,eACTH,EAAA,QAAMK,aAAc,IAAM5D,KAAKM,uB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as t,h as e,H as n,g as r}from"./p-d94db268.js";import{v as o}from"./p-24b07f64.js";import{c as i}from"./p-bcc705f1.js";const a=Math.min;const s=Math.max;const l=Math.round;const u=Math.floor;const c=t=>({x:t,y:t});const f={left:"right",right:"left",bottom:"top",top:"bottom"};const d={start:"end",end:"start"};function p(t,e,n){return s(t,a(e,n))}function b(t,e){return typeof t==="function"?t(e):t}function v(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function g(t){return t==="x"?"y":"x"}function h(t){return t==="y"?"height":"width"}function x(t){return["top","bottom"].includes(v(t))?"y":"x"}function y(t){return g(x(t))}function w(t,e,n){if(n===void 0){n=false}const r=m(t);const o=y(t);const i=h(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(e.reference[i]>e.floating[i]){a=E(a)}return[a,E(a)]}function S(t){const e=E(t);return[A(t),e,A(e)]}function A(t){return t.replace(/start|end/g,(t=>d[t]))}function O(t,e,n){const r=["left","right"];const o=["right","left"];const i=["top","bottom"];const a=["bottom","top"];switch(t){case"top":case"bottom":if(n)return e?o:r;return e?r:o;case"left":case"right":return e?i:a;default:return[]}}function k(t,e,n,r){const o=m(t);let i=O(v(t),n==="start",r);if(o){i=i.map((t=>t+"-"+o));if(e){i=i.concat(i.map(A))}}return i}function E(t){return t.replace(/left|right|bottom|top/g,(t=>f[t]))}function M(t){return{top:0,right:0,bottom:0,left:0,...t}}function T(t){return typeof t!=="number"?M(t):{top:t,right:t,bottom:t,left:t}}function P(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function I(t,e,n){let{reference:r,floating:o}=t;const i=x(e);const a=y(e);const s=h(a);const l=v(e);const u=i==="y";const c=r.x+r.width/2-o.width/2;const f=r.y+r.height/2-o.height/2;const d=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(m(e)){case"start":p[a]-=d*(n&&u?-1:1);break;case"end":p[a]+=d*(n&&u?-1:1);break}return p}const B=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n;const s=i.filter(Boolean);const l=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:o});let{x:c,y:f}=I(u,r,l);let d=r;let p={};let b=0;for(let n=0;n<s.length;n++){const{name:i,fn:v}=s[n];const{x:m,y:g,data:h,reset:x}=await v({x:c,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:u,platform:a,elements:{reference:t,floating:e}});c=m!=null?m:c;f=g!=null?g:f;p={...p,[i]:{...p[i],...h}};if(x&&b<=50){b++;if(typeof x==="object"){if(x.placement){d=x.placement}if(x.rects){u=x.rects===true?await a.getElementRects({reference:t,floating:e,strategy:o}):x.rects}({x:c,y:f}=I(u,d,l))}n=-1;continue}}return{x:c,y:f,placement:d,strategy:o,middlewareData:p}};async function C(t,e){var n;if(e===void 0){e={}}const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=t;const{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=false,padding:p=0}=b(e,t);const v=T(p);const m=f==="floating"?"reference":"floating";const g=s[d?m:f];const h=P(await i.getClippingRect({element:((n=await(i.isElement==null?void 0:i.isElement(g)))!=null?n:true)?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l}));const x=f==="floating"?{...a.floating,x:r,y:o}:a.reference;const y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating));const w=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1};const S=P(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:y,strategy:l}):x);return{top:(h.top-S.top+v.top)/w.y,bottom:(S.bottom-h.bottom+v.bottom)/w.y,left:(h.left-S.left+v.left)/w.x,right:(S.right-h.right+v.right)/w.x}}const W=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l}=e;const{element:u,padding:c=0}=b(t,e)||{};if(u==null){return{}}const f=T(c);const d={x:n,y:r};const v=y(o);const g=h(v);const x=await s.getDimensions(u);const w=v==="y";const S=w?"top":"left";const A=w?"bottom":"right";const O=w?"clientHeight":"clientWidth";const k=i.reference[g]+i.reference[v]-d[v]-i.floating[g];const E=d[v]-i.reference[v];const M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=M?M[O]:0;if(!P||!await(s.isElement==null?void 0:s.isElement(M))){P=l.floating[O]||i.floating[g]}const I=k/2-E/2;const B=P/2-x[g]/2-1;const C=a(f[S],B);const W=a(f[A],B);const R=C;const F=P-x[g]-W;const j=P/2-x[g]/2+I;const L=p(R,j,F);const $=m(o)!=null&&j!=L&&i.reference[g]/2-(j<R?C:W)-x[g]/2<0;const D=$?j<R?R-j:F-j:0;return{[v]:d[v]-D,data:{[v]:L,centerOffset:j-L+D}}}});const R=function(t){if(t===void 0){t={}}return{name:"flip",options:t,async fn(e){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=e;const{mainAxis:u=true,crossAxis:c=true,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=true,...g}=b(t,e);const h=v(r);const x=v(a)===a;const y=await(s.isRTL==null?void 0:s.isRTL(l.floating));const A=f||(x||!m?[E(a)]:S(a));if(!f&&p!=="none"){A.push(...k(a,m,p,y))}const O=[a,...A];const M=await C(e,g);const T=[];let P=((n=o.flip)==null?void 0:n.overflows)||[];if(u){T.push(M[h])}if(c){const t=w(r,i,y);T.push(M[t[0]],M[t[1]])}P=[...P,{placement:r,overflows:T}];if(!T.every((t=>t<=0))){var I,B;const t=(((I=o.flip)==null?void 0:I.index)||0)+1;const e=O[t];if(e){return{data:{index:t,overflows:P},reset:{placement:e}}}let n=(B=P.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])==null?void 0:B.placement;if(!n){switch(d){case"bestFit":{var W;const t=(W=P.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])==null?void 0:W[0];if(t){n=t}break}case"initialPlacement":n=a;break}}if(r!==n){return{reset:{placement:n}}}}return{}}}};function F(t){const e=a(...t.map((t=>t.left)));const n=a(...t.map((t=>t.top)));const r=s(...t.map((t=>t.right)));const o=s(...t.map((t=>t.bottom)));return{x:e,y:n,width:r-e,height:o-n}}function j(t){const e=t.slice().sort(((t,e)=>t.y-e.y));const n=[];let r=null;for(let t=0;t<e.length;t++){const o=e[t];if(!r||o.y-r.y>r.height/2){n.push([o])}else{n[n.length-1].push(o)}r=o}return n.map((t=>P(F(t))))}const L=function(t){if(t===void 0){t={}}return{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:o,platform:i,strategy:l}=e;const{padding:u=2,x:c,y:f}=b(t,e);const d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]);const p=j(d);const m=P(F(d));const g=T(u);function h(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&f!=null){return p.find((t=>c>t.left-g.left&&c<t.right+g.right&&f>t.top-g.top&&f<t.bottom+g.bottom))||m}if(p.length>=2){if(x(n)==="y"){const t=p[0];const e=p[p.length-1];const r=v(n)==="top";const o=t.top;const i=e.bottom;const a=r?t.left:e.left;const s=r?t.right:e.right;const l=s-a;const u=i-o;return{top:o,bottom:i,left:a,right:s,width:l,height:u,x:a,y:o}}const t=v(n)==="left";const e=s(...p.map((t=>t.right)));const r=a(...p.map((t=>t.left)));const o=p.filter((n=>t?n.left===r:n.right===e));const i=o[0].top;const l=o[o.length-1].bottom;const u=r;const c=e;const f=c-u;const d=l-i;return{top:i,bottom:l,left:u,right:c,width:f,height:d,x:u,y:i}}return m}const y=await i.getElementRects({reference:{getBoundingClientRect:h},floating:r.floating,strategy:l});if(o.reference.x!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height){return{reset:{rects:y}}}return{}}}};async function $(t,e){const{placement:n,platform:r,elements:o}=t;const i=await(r.isRTL==null?void 0:r.isRTL(o.floating));const a=v(n);const s=m(n);const l=x(n)==="y";const u=["left","top"].includes(a)?-1:1;const c=i&&l?-1:1;const f=b(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:g}=typeof f==="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};if(s&&typeof g==="number"){p=s==="end"?g*-1:g}return l?{x:p*c,y:d*u}:{x:d*u,y:p*c}}const D=function(t){if(t===void 0){t=0}return{name:"offset",options:t,async fn(e){const{x:n,y:r}=e;const o=await $(e,t);return{x:n+o.x,y:r+o.y,data:o}}}};const Z=function(t){if(t===void 0){t={}}return{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e;const{mainAxis:i=true,crossAxis:a=false,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=b(t,e);const u={x:n,y:r};const c=await C(e,l);const f=x(v(o));const d=g(f);let m=u[d];let h=u[f];if(i){const t=d==="y"?"top":"left";const e=d==="y"?"bottom":"right";const n=m+c[t];const r=m-c[e];m=p(n,m,r)}if(a){const t=f==="y"?"top":"left";const e=f==="y"?"bottom":"right";const n=h+c[t];const r=h-c[e];h=p(n,h,r)}const y=s.fn({...e,[d]:m,[f]:h});return{...y,data:{x:y.x-n,y:y.y-r}}}}};function N(t){if(X(t)){return(t.nodeName||"").toLowerCase()}return"#document"}function H(t){var e;return(t==null?void 0:(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function G(t){var e;return(e=(X(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function X(t){return t instanceof Node||t instanceof H(t).Node}function z(t){return t instanceof Element||t instanceof H(t).Element}function K(t){return t instanceof HTMLElement||t instanceof H(t).HTMLElement}function q(t){if(typeof ShadowRoot==="undefined"){return false}return t instanceof ShadowRoot||t instanceof H(t).ShadowRoot}function V(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=tt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function _(t){return["table","td","th"].includes(N(t))}function J(t){const e=Y();const n=tt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":false)||!e&&(n.backdropFilter?n.backdropFilter!=="none":false)||!e&&(n.filter?n.filter!=="none":false)||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function U(t){let e=nt(t);while(K(e)&&!Q(e)){if(J(e)){return e}else{e=nt(e)}}return null}function Y(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}function Q(t){return["html","body","#document"].includes(N(t))}function tt(t){return H(t).getComputedStyle(t)}function et(t){if(z(t)){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function nt(t){if(N(t)==="html"){return t}const e=t.assignedSlot||t.parentNode||q(t)&&t.host||G(t);return q(e)?e.host:e}function rt(t){const e=nt(t);if(Q(e)){return t.ownerDocument?t.ownerDocument.body:t.body}if(K(e)&&V(e)){return e}return rt(e)}function ot(t,e){var n;if(e===void 0){e=[]}const r=rt(t);const o=r===((n=t.ownerDocument)==null?void 0:n.body);const i=H(r);if(o){return e.concat(i,i.visualViewport||[],V(r)?r:[])}return e.concat(r,ot(r))}function it(t){const e=tt(t);let n=parseFloat(e.width)||0;let r=parseFloat(e.height)||0;const o=K(t);const i=o?t.offsetWidth:n;const a=o?t.offsetHeight:r;const s=l(n)!==i||l(r)!==a;if(s){n=i;r=a}return{width:n,height:r,$:s}}function at(t){return!z(t)?t.contextElement:t}function st(t){const e=at(t);if(!K(e)){return c(1)}const n=e.getBoundingClientRect();const{width:r,height:o,$:i}=it(e);let a=(i?l(n.width):n.width)/r;let s=(i?l(n.height):n.height)/o;if(!a||!Number.isFinite(a)){a=1}if(!s||!Number.isFinite(s)){s=1}return{x:a,y:s}}const lt=c(0);function ut(t){const e=H(t);if(!Y()||!e.visualViewport){return lt}return{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ct(t,e,n){if(e===void 0){e=false}if(!n||e&&n!==H(t)){return false}return e}function ft(t,e,n,r){if(e===void 0){e=false}if(n===void 0){n=false}const o=t.getBoundingClientRect();const i=at(t);let a=c(1);if(e){if(r){if(z(r)){a=st(r)}}else{a=st(t)}}const s=ct(i,n,r)?ut(i):c(0);let l=(o.left+s.x)/a.x;let u=(o.top+s.y)/a.y;let f=o.width/a.x;let d=o.height/a.y;if(i){const t=H(i);const e=r&&z(r)?H(r):r;let n=t.frameElement;while(n&&r&&e!==t){const t=st(n);const e=n.getBoundingClientRect();const r=tt(n);const o=e.left+(n.clientLeft+parseFloat(r.paddingLeft))*t.x;const i=e.top+(n.clientTop+parseFloat(r.paddingTop))*t.y;l*=t.x;u*=t.y;f*=t.x;d*=t.y;l+=o;u+=i;n=H(n).frameElement}}return P({width:f,height:d,x:l,y:u})}function dt(t){let{rect:e,offsetParent:n,strategy:r}=t;const o=K(n);const i=G(n);if(n===i){return e}let a={scrollLeft:0,scrollTop:0};let s=c(1);const l=c(0);if(o||!o&&r!=="fixed"){if(N(n)!=="body"||V(i)){a=et(n)}if(K(n)){const t=ft(n);s=st(n);l.x=t.x+n.clientLeft;l.y=t.y+n.clientTop}}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}}function pt(t){return Array.from(t.getClientRects())}function bt(t){return ft(G(t)).left+et(t).scrollLeft}function vt(t){const e=G(t);const n=et(t);const r=t.ownerDocument.body;const o=s(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth);const i=s(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+bt(t);const l=-n.scrollTop;if(tt(r).direction==="rtl"){a+=s(e.clientWidth,r.clientWidth)-o}return{width:o,height:i,x:a,y:l}}function mt(t,e){const n=H(t);const r=G(t);const o=n.visualViewport;let i=r.clientWidth;let a=r.clientHeight;let s=0;let l=0;if(o){i=o.width;a=o.height;const t=Y();if(!t||t&&e==="fixed"){s=o.offsetLeft;l=o.offsetTop}}return{width:i,height:a,x:s,y:l}}function gt(t,e){const n=ft(t,true,e==="fixed");const r=n.top+t.clientTop;const o=n.left+t.clientLeft;const i=K(t)?st(t):c(1);const a=t.clientWidth*i.x;const s=t.clientHeight*i.y;const l=o*i.x;const u=r*i.y;return{width:a,height:s,x:l,y:u}}function ht(t,e,n){let r;if(e==="viewport"){r=mt(t,n)}else if(e==="document"){r=vt(G(t))}else if(z(e)){r=gt(e,n)}else{const n=ut(t);r={...e,x:e.x-n.x,y:e.y-n.y}}return P(r)}function xt(t,e){const n=nt(t);if(n===e||!z(n)||Q(n)){return false}return tt(n).position==="fixed"||xt(n,e)}function yt(t,e){const n=e.get(t);if(n){return n}let r=ot(t).filter((t=>z(t)&&N(t)!=="body"));let o=null;const i=tt(t).position==="fixed";let a=i?nt(t):t;while(z(a)&&!Q(a)){const e=tt(a);const n=J(a);if(!n&&e.position==="fixed"){o=null}const s=i?!n&&!o:!n&&e.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||V(a)&&!n&&xt(t,a);if(s){r=r.filter((t=>t!==a))}else{o=e}a=nt(a)}e.set(t,r);return r}function wt(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=n==="clippingAncestors"?yt(e,this._c):[].concat(n);const l=[...i,r];const u=l[0];const c=l.reduce(((t,n)=>{const r=ht(e,n,o);t.top=s(r.top,t.top);t.right=a(r.right,t.right);t.bottom=a(r.bottom,t.bottom);t.left=s(r.left,t.left);return t}),ht(e,u,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function St(t){return it(t)}function At(t,e,n){const r=K(e);const o=G(e);const i=n==="fixed";const a=ft(t,true,i,e);let s={scrollLeft:0,scrollTop:0};const l=c(0);if(r||!r&&!i){if(N(e)!=="body"||V(o)){s=et(e)}if(r){const t=ft(e,true,i,e);l.x=t.x+e.clientLeft;l.y=t.y+e.clientTop}else if(o){l.x=bt(o)}}return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Ot(t,e){if(!K(t)||tt(t).position==="fixed"){return null}if(e){return e(t)}return t.offsetParent}function kt(t,e){const n=H(t);if(!K(t)){return n}let r=Ot(t,e);while(r&&_(r)&&tt(r).position==="static"){r=Ot(r,e)}if(r&&(N(r)==="html"||N(r)==="body"&&tt(r).position==="static"&&!J(r))){return n}return r||U(t)||n}const Et=async function(t){let{reference:e,floating:n,strategy:r}=t;const o=this.getOffsetParent||kt;const i=this.getDimensions;return{reference:At(e,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function Mt(t){return tt(t).direction==="rtl"}const Tt={convertOffsetParentRelativeRectToViewportRelativeRect:dt,getDocumentElement:G,getClippingRect:wt,getOffsetParent:kt,getElementRects:Et,getClientRects:pt,getDimensions:St,getScale:st,isElement:z,isRTL:Mt};function Pt(t,e){let n=null;let r;const o=G(t);function i(){clearTimeout(r);n&&n.disconnect();n=null}function l(c,f){if(c===void 0){c=false}if(f===void 0){f=1}i();const{left:d,top:p,width:b,height:v}=t.getBoundingClientRect();if(!c){e()}if(!b||!v){return}const m=u(p);const g=u(o.clientWidth-(d+b));const h=u(o.clientHeight-(p+v));const x=u(d);const y=-m+"px "+-g+"px "+-h+"px "+-x+"px";const w={rootMargin:y,threshold:s(0,a(1,f))||1};let S=true;function A(t){const e=t[0].intersectionRatio;if(e!==f){if(!S){return l()}if(!e){r=setTimeout((()=>{l(false,1e-7)}),100)}else{l(false,e)}}S=false}try{n=new IntersectionObserver(A,{...w,root:o.ownerDocument})}catch(t){n=new IntersectionObserver(A,w)}n.observe(t)}l(true);return i}function It(t,e,n,r){if(r===void 0){r={}}const{ancestorScroll:o=true,ancestorResize:i=true,elementResize:a=typeof ResizeObserver==="function",layoutShift:s=typeof IntersectionObserver==="function",animationFrame:l=false}=r;const u=at(t);const c=o||i?[...u?ot(u):[],...ot(e)]:[];c.forEach((t=>{o&&t.addEventListener("scroll",n,{passive:true});i&&t.addEventListener("resize",n)}));const f=u&&s?Pt(u,n):null;let d=-1;let p=null;if(a){p=new ResizeObserver((t=>{let[r]=t;if(r&&r.target===u&&p){p.unobserve(e);cancelAnimationFrame(d);d=requestAnimationFrame((()=>{p&&p.observe(e)}))}n()}));if(u&&!l){p.observe(u)}p.observe(e)}let b;let v=l?ft(t):null;if(l){m()}function m(){const e=ft(t);if(v&&(e.x!==v.x||e.y!==v.y||e.width!==v.width||e.height!==v.height)){n()}v=e;b=requestAnimationFrame(m)}n();return()=>{c.forEach((t=>{o&&t.removeEventListener("scroll",n);i&&t.removeEventListener("resize",n)}));f&&f();p&&p.disconnect();p=null;if(l){cancelAnimationFrame(b)}}}const Bt=(t,e,n)=>{const r=new Map;const o={platform:Tt,...n};const i={...o.platform,_c:r};return B(t,e,{...o,platform:i})};function Ct(t){if(!t){return[]}if(Array.isArray(t)){return t}if(t.nodeType!==undefined){return[t]}if(typeof t==="string"){t=document.querySelectorAll(t)}if(t.length!==undefined){return[].slice.call(t,0)}throw new TypeError("unexpected input "+String(t))}function Wt(t){var e=t.context,n=t.label,r=n===undefined?"context-to-element":n,o=t.resolveDocument,i=t.defaultToDocument;var a=Ct(e)[0];if(o&&a&&a.nodeType===Node.DOCUMENT_NODE){a=a.documentElement}if(!a&&i){return document.documentElement}if(!a){throw new TypeError(r+" requires valid options.context")}if(a.nodeType!==Node.ELEMENT_NODE&&a.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){throw new TypeError(r+" requires options.context to be an Element")}return a}function Rt(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=t.context;var n=[];var r=Wt({label:"get/parents",context:e});while(r){n.push(r);r=r.parentNode;if(r&&r.nodeType!==Node.ELEMENT_NODE){r=null}}return n}var Ft=["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector"];var jt=null;function Lt(t){Ft.some((function(e){if(!t[e]){return false}jt=e;return true}))}function $t(t,e){if(!jt){Lt(t)}return t[jt](e)}var Dt=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function Zt(t,e,n){return n={path:e,exports:{},require:function(t,e){return Nt()}},t(n,n.exports),n.exports}function Nt(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ht=Zt((function(t,e){(function(){var n={function:true,object:true};var r=n[typeof window]&&window||this;var o=r;var i=n["object"]&&e;var a=n["object"]&&t&&!t.nodeType&&t;var s=i&&a&&typeof Dt=="object"&&Dt;if(s&&(s.global===s||s.window===s||s.self===s)){r=s}var l=Math.pow(2,53)-1;var u=/\bOpera/;var c=this;var f=Object.prototype;var d=f.hasOwnProperty;var p=f.toString;function b(t){t=String(t);return t.charAt(0).toUpperCase()+t.slice(1)}function v(t,e,n){var r={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};if(e&&n&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(r=r[/[\d.]+$/.exec(t)])){t="Windows "+r}t=String(t);if(e&&n){t=t.replace(RegExp(e,"i"),n)}t=g(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]);return t}function m(t,e){var n=-1,r=t?t.length:0;if(typeof r=="number"&&r>-1&&r<=l){while(++n<r){e(t[n],n,t)}}else{h(t,e)}}function g(t){t=A(t);return/^(?:webOS|i(?:OS|P))/.test(t)?t:b(t)}function h(t,e){for(var n in t){if(d.call(t,n)){e(t[n],n,t)}}}function x(t){return t==null?b(t):p.call(t).slice(8,-1)}function y(t,e){var n=t!=null?typeof t[e]:"number";return!/^(?:boolean|number|string|undefined)$/.test(n)&&(n=="object"?!!t[e]:true)}function w(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function S(t,e){var n=null;m(t,(function(r,o){n=e(n,r,o,t)}));return n}function A(t){return String(t).replace(/^ +| +$/g,"")}function O(t){var e=r;var n=t&&typeof t=="object"&&x(t)!="String";if(n){e=t;t=null}var i=e.navigator||{};var a=i.userAgent||"";t||(t=a);var s=n||c==o;var l=n?!!i.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(p.toString());var f="Object",d=n?f:"ScriptBridgingProxyObject",b=n?f:"Environment",m=n&&e.java?"JavaPackage":x(e.java),k=n?f:"RuntimeObject";var E=/\bJava/.test(m)&&e.java;var M=E&&x(e.environment)==b;var T=E?"a":"α";var P=E?"b":"β";var I=e.document||{};var B=e.operamini||e.opera;var C=u.test(C=n&&B?B["[[Class]]"]:x(B))?C:B=null;var W;var R=t;var F=[];var j=null;var L=t==a;var $=L&&B&&typeof B.version=="function"&&B.version();var D;var Z=z([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]);var N=q(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt","SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]);var H=_([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation 3","PlayStation 4","PlayStation Vita","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]);var G=K({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{"PlayStation 4":1,"PlayStation 3":1,"PlayStation Vita":1}});var X=V(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function z(e){return S(e,(function(e,n){return e||RegExp("\\b"+(n.pattern||w(n))+"\\b","i").exec(t)&&(n.label||n)}))}function K(e){return S(e,(function(e,n,r){return e||(n[H]||n[/^[a-z]+(?: +[a-z]+\b)*/i.exec(H)]||RegExp("\\b"+w(r)+"(?:\\b|\\w*\\d)","i").exec(t))&&r}))}function q(e){return S(e,(function(e,n){return e||RegExp("\\b"+(n.pattern||w(n))+"\\b","i").exec(t)&&(n.label||n)}))}function V(e){return S(e,(function(e,n){var r=n.pattern||w(n);if(!e&&(e=RegExp("\\b"+r+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))){e=v(e,r,n.label||n)}return e}))}function _(e){return S(e,(function(e,n){var r=n.pattern||w(n);if(!e&&(e=RegExp("\\b"+r+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+r+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))){if((e=String(n.label&&!RegExp(r,"i").test(n.label)?n.label:e).split("/"))[1]&&!/[\d.]+/.test(e[0])){e[0]+=" "+e[1]}n=n.label||n;e=g(e[0].replace(RegExp(r,"i"),n).replace(RegExp("; *(?:"+n+"[_-])?","i")," ").replace(RegExp("("+n+")[-_.]?(\\w)","i"),"$1 $2"))}return e}))}function J(e){return S(e,(function(e,n){return e||(RegExp(n+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}function U(){return this.description||""}Z&&(Z=[Z]);if(G&&!H){H=_([G])}if(W=/\bGoogle TV\b/.exec(H)){H=W[0]}if(/\bSimulator\b/i.test(t)){H=(H?H+" ":"")+"Simulator"}if(N=="Opera Mini"&&/\bOPiOS\b/.test(t)){F.push("running in Turbo/Uncompressed mode")}if(N=="IE"&&/\blike iPhone OS\b/.test(t)){W=O(t.replace(/like iPhone OS/,""));G=W.manufacturer;H=W.product}else if(/^iP/.test(H)){N||(N="Safari");X="iOS"+((W=/ OS ([\d_]+)/i.exec(t))?" "+W[1].replace(/_/g,"."):"")}else if(N=="Konqueror"&&!/buntu/i.test(X)){X="Kubuntu"}else if(G&&G!="Google"&&(/Chrome/.test(N)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(H))||/\bAndroid\b/.test(X)&&/^Chrome/.test(N)&&/\bVersion\//i.test(t)){N="Android Browser";X=/\bAndroid\b/.test(X)?X:"Android"}else if(N=="Silk"){if(!/\bMobi/i.test(t)){X="Android";F.unshift("desktop mode")}if(/Accelerated *= *true/i.test(t)){F.unshift("accelerated")}}else if(N=="PaleMoon"&&(W=/\bFirefox\/([\d.]+)\b/.exec(t))){F.push("identifying as Firefox "+W[1])}else if(N=="Firefox"&&(W=/\b(Mobile|Tablet|TV)\b/i.exec(t))){X||(X="Firefox OS");H||(H=W[1])}else if(!N||(W=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(N))){if(N&&!H&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(W+"/")+8))){N=null}if((W=H||G||X)&&(H||G||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(X))){N=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(X)?X:W)+" Browser"}}if(!$){$=J(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|Silk(?!/[\\d.]+$))","Version",w(N),"(?:Firefox|Minefield|NetFront)"])}if(W=Z=="iCab"&&parseFloat($)>3&&"WebKit"||/\bOpera\b/.test(N)&&(/\bOPR\b/.test(t)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(Z)&&"WebKit"||!Z&&/\bMSIE\b/i.test(t)&&(X=="Mac OS"?"Tasman":"Trident")||Z=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(N)&&"NetFront"){Z=[W]}if(N=="IE"&&(W=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])){N+=" Mobile";X="Windows Phone "+(/\+$/.test(W)?W:W+".x");F.unshift("desktop mode")}else if(/\bWPDesktop\b/i.test(t)){N="IE Mobile";X="Windows Phone 8.x";F.unshift("desktop mode");$||($=(/\brv:([\d.]+)/.exec(t)||0)[1])}else if(N!="IE"&&Z=="Trident"&&(W=/\brv:([\d.]+)/.exec(t))){if(N){F.push("identifying as "+N+($?" "+$:""))}N="IE";$=W[1]}if(L){if(y(e,"global")){if(E){W=E.lang.System;R=W.getProperty("os.arch");X=X||W.getProperty("os.name")+" "+W.getProperty("os.version")}if(s&&y(e,"system")&&(W=[e.system])[0]){X||(X=W[0].os||null);try{W[1]=e.require("ringo/engine").version;$=W[1].join(".");N="RingoJS"}catch(t){if(W[0].global.system==e.system){N="Narwhal"}}}else if(typeof e.process=="object"&&!e.process.browser&&(W=e.process)){N="Node.js";R=W.arch;X=W.platform;$=/[\d.]+/.exec(W.version)[0]}else if(M){N="Rhino"}}else if(x(W=e.runtime)==d){N="Adobe AIR";X=W.flash.system.Capabilities.os}else if(x(W=e.phantom)==k){N="PhantomJS";$=(W=W.version||null)&&W.major+"."+W.minor+"."+W.patch}else if(typeof I.documentMode=="number"&&(W=/\bTrident\/(\d+)/i.exec(t))){$=[$,I.documentMode];if((W=+W[1]+4)!=$[1]){F.push("IE "+$[1]+" mode");Z&&(Z[1]="");$[1]=W}$=N=="IE"?String($[1].toFixed(1)):$[0]}X=X&&g(X)}if($&&(W=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec($)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(L&&i.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")){j=/b/i.test(W)?"beta":"alpha";$=$.replace(RegExp(W+"\\+?$"),"")+(j=="beta"?P:T)+(/\d+\+?/.exec(W)||"")}if(N=="Fennec"||N=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(X)){N="Firefox Mobile"}else if(N=="Maxthon"&&$){$=$.replace(/\.[\d.]+/,".x")}else if(/\bXbox\b/i.test(H)){X=null;if(H=="Xbox 360"&&/\bIEMobile\b/.test(t)){F.unshift("mobile mode")}}else if((/^(?:Chrome|IE|Opera)$/.test(N)||N&&!H&&!/Browser|Mobi/.test(N))&&(X=="Windows CE"||/Mobi/i.test(t))){N+=" Mobile"}else if(N=="IE"&&L&&e.external===null){F.unshift("platform preview")}else if((/\bBlackBerry\b/.test(H)||/\bBB10\b/.test(t))&&(W=(RegExp(H.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||$)){W=[W,/BB10/.test(t)];X=(W[1]?(H=null,G="BlackBerry"):"Device Software")+" "+W[0];$=null}else if(this!=h&&H!="Wii"&&(L&&B||/Opera/.test(N)&&/\b(?:MSIE|Firefox)\b/i.test(t)||N=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(X)||N=="IE"&&(X&&!/^Win/.test(X)&&$>5.5||/\bWindows XP\b/.test(X)&&$>8||$==8&&!/\bTrident\b/.test(t)))&&!u.test(W=O.call(h,t.replace(u,"")+";"))&&W.name){W="ing as "+W.name+((W=W.version)?" "+W:"");if(u.test(N)){if(/\bIE\b/.test(W)&&X=="Mac OS"){X=null}W="identify"+W}else{W="mask"+W;if(C){N=g(C.replace(/([a-z])([A-Z])/g,"$1 $2"))}else{N="Opera"}if(/\bIE\b/.test(W)){X=null}if(!L){$=null}}Z=["Presto"];F.push(W)}if(W=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1]){W=[parseFloat(W.replace(/\.(\d)$/,".0$1")),W];if(N=="Safari"&&W[1].slice(-1)=="+"){N="WebKit Nightly";j="alpha";$=W[1].slice(0,-1)}else if($==W[1]||$==(W[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])){$=null}W[1]=(/\bChrome\/([\d.]+)/i.exec(t)||0)[1];if(W[0]==537.36&&W[2]==537.36&&parseFloat(W[1])>=28&&Z=="WebKit"){Z=["Blink"]}if(!L||!l&&!W[1]){Z&&(Z[1]="like Safari");W=(W=W[0],W<400?1:W<500?2:W<526?3:W<533?4:W<534?"4+":W<535?5:W<537?6:W<538?7:W<601?8:"8")}else{Z&&(Z[1]="like Chrome");W=W[1]||(W=W[0],W<530?1:W<532?2:W<532.05?3:W<533?4:W<534.03?5:W<534.07?6:W<534.1?7:W<534.13?8:W<534.16?9:W<534.24?10:W<534.3?11:W<535.01?12:W<535.02?"13+":W<535.07?15:W<535.11?16:W<535.19?17:W<536.05?18:W<536.1?19:W<537.01?20:W<537.11?"21+":W<537.13?23:W<537.18?24:W<537.24?25:W<537.36?26:Z!="Blink"?"27":"28")}Z&&(Z[1]+=" "+(W+=typeof W=="number"?".x":/[.+]/.test(W)?"":"+"));if(N=="Safari"&&(!$||parseInt($)>45)){$=W}}if(N=="Opera"&&(W=/\bzbov|zvav$/.exec(X))){N+=" ";F.unshift("desktop mode");if(W=="zvav"){N+="Mini";$=null}else{N+="Mobile"}X=X.replace(RegExp(" *"+W+"$"),"")}else if(N=="Safari"&&/\bChrome\b/.exec(Z&&Z[1])){F.unshift("desktop mode");N="Chrome Mobile";$=null;if(/\bOS X\b/.test(X)){G="Apple";X="iOS 4.3+"}else{X=null}}if($&&$.indexOf(W=/[\d.]+$/.exec(X))==0&&t.indexOf("/"+W+"-")>-1){X=A(X.replace(W,""))}if(Z&&!/\b(?:Avant|Nook)\b/.test(N)&&(/Browser|Lunascape|Maxthon/.test(N)||N!="Safari"&&/^iOS/.test(X)&&/\bSafari\b/.test(Z[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(N)&&Z[1])){(W=Z[Z.length-1])&&F.push(W)}if(F.length){F=["("+F.join("; ")+")"]}if(G&&H&&H.indexOf(G)<0){F.push("on "+G)}if(H){F.push((/^on /.test(F[F.length-1])?"":"on ")+H)}if(X){W=/ ([\d.+]+)$/.exec(X);D=W&&X.charAt(X.length-W[0].length-1)=="/";X={architecture:32,family:W&&!D?X.replace(W[0],""):X,version:W?W[1]:null,toString:function(){var t=this.version;return this.family+(t&&!D?" "+t:"")+(this.architecture==64?" 64-bit":"")}}}if((W=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(R))&&!/\bi686\b/i.test(R)){if(X){X.architecture=64;X.family=X.family.replace(RegExp(" *"+W),"")}if(N&&(/\bWOW64\b/i.test(t)||L&&/\w(?:86|32)$/.test(i.cpuClass||i.platform)&&!/\bWin64; x64\b/i.test(t))){F.unshift("32-bit")}}else if(X&&/^OS X/.test(X.family)&&N=="Chrome"&&parseFloat($)>=39){X.architecture=64}t||(t=null);var Y={};Y.description=t;Y.layout=Z&&Z[0];Y.manufacturer=G;Y.name=N;Y.prerelease=j;Y.product=H;Y.ua=t;Y.version=N&&$;Y.os=X||{architecture:null,family:null,version:null,toString:function(){return"null"}};Y.parse=O;Y.toString=U;if(Y.version){F.unshift($)}if(Y.name){F.unshift(N)}if(X&&N&&!(X==String(X).split(" ")[0]&&(X==N.split(" ")[0]||H))){F.push(H?"("+X+")":"on "+X)}if(F.length){Y.description=F.join(" ")}return Y}var k=O();if(i&&a){h(k,(function(t,e){i[e]=t}))}else{r.platform=k}}).call(Dt)}));var Gt=JSON.parse(JSON.stringify(Ht));var Xt=Gt.os.family||"";var zt=Xt==="Android";var Kt=Xt.slice(0,7)==="Windows";var qt=Xt==="OS X";var Vt=Xt==="iOS";var _t=Gt.layout==="Blink";var Jt=Gt.layout==="Gecko";var Ut=Gt.layout==="Trident";var Yt=Gt.layout==="EdgeHTML";var Qt=Gt.layout==="WebKit";var te=parseFloat(Gt.version);var ee=Math.floor(te);Gt.majorVersion=ee;Gt.is={ANDROID:zt,WINDOWS:Kt,OSX:qt,IOS:Vt,BLINK:_t,GECKO:Jt,TRIDENT:Ut,EDGE:Yt,WEBKIT:Qt,IE9:Ut&&ee===9,IE10:Ut&&ee===10,IE11:Ut&&ee===11};function ne(){var t={activeElement:document.activeElement,windowScrollTop:window.scrollTop,windowScrollLeft:window.scrollLeft,bodyScrollTop:document.body.scrollTop,bodyScrollLeft:document.body.scrollLeft};var e=document.createElement("iframe");e.setAttribute("style","position:absolute; position:fixed; top:0; left:-2px; width:1px; height:1px; overflow:hidden;");e.setAttribute("aria-live","off");e.setAttribute("aria-busy","true");e.setAttribute("aria-hidden","true");document.body.appendChild(e);var n=e.contentWindow;var r=n.document;r.open();r.close();var o=r.createElement("div");r.body.appendChild(o);t.iframe=e;t.wrapper=o;t.window=n;t.document=r;return t}function re(t,e){t.wrapper.innerHTML="";var n=typeof e.element==="string"?t.document.createElement(e.element):e.element(t.wrapper,t.document);var r=e.mutate&&e.mutate(n,t.wrapper,t.document);if(!r&&r!==false){r=n}!n.parentNode&&t.wrapper.appendChild(n);r&&r.focus&&r.focus();return e.validate?e.validate(n,r,t.document):t.document.activeElement===r}function oe(t){if(t.activeElement===document.body){document.activeElement&&document.activeElement.blur&&document.activeElement.blur();if(Gt.is.IE10){document.body.focus()}}else{t.activeElement&&t.activeElement.focus&&t.activeElement.focus()}document.body.removeChild(t.iframe);window.scrollTop=t.windowScrollTop;window.scrollLeft=t.windowScrollLeft;document.body.scrollTop=t.bodyScrollTop;document.body.scrollLeft=t.bodyScrollLeft}function ie(t){var e=ne();var n={};Object.keys(t).map((function(r){n[r]=re(e,t[r])}));oe(e);return n}var ae="1.4.1";function se(t){var e=void 0;try{e=window.localStorage&&window.localStorage.getItem(t);e=e?JSON.parse(e):{}}catch(t){e={}}return e}function le(t,e){if(!document.hasFocus()){try{window.localStorage&&window.localStorage.removeItem(t)}catch(t){}return}try{window.localStorage&&window.localStorage.setItem(t,JSON.stringify(e))}catch(t){}}var ue=typeof window!=="undefined"&&window.navigator.userAgent||"";var ce="ally-supports-cache";var fe=se(ce);if(fe.userAgent!==ue||fe.version!==ae){fe={}}fe.userAgent=ue;fe.version=ae;const de={get:function t(){return fe},set:function t(e){Object.keys(e).forEach((function(t){fe[t]=e[t]}));fe.time=(new Date).toISOString();le(ce,fe)}};function pe(){var t=void 0;try{document.querySelector("html >>> :first-child");t=">>>"}catch(e){try{document.querySelector("html /deep/ :first-child");t="/deep/"}catch(e){t=""}}return t}const be="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";const ve={element:"div",mutate:function t(e){e.innerHTML='<map name="image-map-tabindex-test">'+'<area shape="rect" coords="63,19,144,45"></map>'+'<img usemap="#image-map-tabindex-test" tabindex="-1" alt="" src="'+be+'">';return e.querySelector("area")}};const me={element:"div",mutate:function t(e){e.innerHTML='<map name="image-map-tabindex-test">'+'<area href="#void" tabindex="-1" shape="rect" coords="63,19,144,45"></map>'+'<img usemap="#image-map-tabindex-test" alt="" src="'+be+'">';return false},validate:function t(e,n,r){if(Gt.is.GECKO){return true}var o=e.querySelector("area");o.focus();return r.activeElement===o}};const ge={element:"div",mutate:function t(e){e.innerHTML='<map name="image-map-area-href-test">'+'<area shape="rect" coords="63,19,144,45"></map>'+'<img usemap="#image-map-area-href-test" alt="" src="'+be+'">';return e.querySelector("area")},validate:function t(e,n,r){if(Gt.is.GECKO){return true}return r.activeElement===n}};const he={name:"can-focus-audio-without-controls",element:"audio",mutate:function t(e){try{e.setAttribute("src",be)}catch(t){}}};const xe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";const ye={element:"div",mutate:function t(e){e.innerHTML='<map name="broken-image-map-test"><area href="#void" shape="rect" coords="63,19,144,45"></map>'+'<img usemap="#broken-image-map-test" alt="" src="'+xe+'">';return e.querySelector("area")}};const we={element:"div",mutate:function t(e){e.setAttribute("tabindex","-1");e.setAttribute("style","display: -webkit-flex; display: -ms-flexbox; display: flex;");e.innerHTML='<span style="display: block;">hello</span>';return e.querySelector("span")}};const Se={element:"fieldset",mutate:function t(e){e.setAttribute("tabindex",0);e.setAttribute("disabled","disabled")}};const Ae={element:"fieldset",mutate:function t(e){e.innerHTML="<legend>legend</legend><p>content</p>"}};const Oe={element:"span",mutate:function t(e){e.setAttribute("style","display: -webkit-flex; display: -ms-flexbox; display: flex;");e.innerHTML='<span style="display: block;">hello</span>'}};const ke={element:"form",mutate:function t(e){e.setAttribute("tabindex",0);e.setAttribute("disabled","disabled")}};const Ee={element:"a",mutate:function t(e){e.href="#void";e.innerHTML='<img ismap src="'+be+'" alt="">';return e.querySelector("img")}};const Me={element:"div",mutate:function t(e){e.innerHTML='<map name="image-map-tabindex-test"><area href="#void" shape="rect" coords="63,19,144,45"></map>'+'<img usemap="#image-map-tabindex-test" tabindex="-1" alt="" '+'src="'+be+'">';return e.querySelector("img")}};const Te={element:function t(e,n){var r=n.createElement("iframe");e.appendChild(r);var o=r.contentWindow.document;o.open();o.close();return r},mutate:function t(e){e.style.visibility="hidden";var n=e.contentWindow.document;var r=n.createElement("input");n.body.appendChild(r);return r},validate:function t(e){var n=e.contentWindow.document;var r=n.querySelector("input");return n.activeElement===r}};var Pe=!Gt.is.WEBKIT;function Ie(){return Pe}const Be={element:"div",mutate:function t(e){e.setAttribute("tabindex","invalid-value")}};const Ce={element:"label",mutate:function t(e){e.setAttribute("tabindex","-1")},validate:function t(e,n,r){e.focus();return r.activeElement===e}};const We="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtb"+"G5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBpZD0ic3ZnIj48dGV4dCB4PSIxMCIgeT0iMjAiIGlkPSJ"+"zdmctbGluay10ZXh0Ij50ZXh0PC90ZXh0Pjwvc3ZnPg==";const Re={element:"object",mutate:function t(e){e.setAttribute("type","image/svg+xml");e.setAttribute("data",We);e.setAttribute("width","200");e.setAttribute("height","50");e.style.visibility="hidden"}};const Fe={name:"can-focus-object-svg",element:"object",mutate:function t(e){e.setAttribute("type","image/svg+xml");e.setAttribute("data",We);e.setAttribute("width","200");e.setAttribute("height","50")},validate:function t(e,n,r){if(Gt.is.GECKO){return true}return r.activeElement===e}};var je=!Gt.is.IE9;function Le(){return je}const $e={element:"div",mutate:function t(e){e.innerHTML='<map name="focus-redirect-img-usemap"><area href="#void" shape="rect" coords="63,19,144,45"></map>'+'<img usemap="#focus-redirect-img-usemap" alt="" '+'src="'+be+'">';return e.querySelector("img")},validate:function t(e,n,r){var o=e.querySelector("area");return r.activeElement===o}};const De={element:"fieldset",mutate:function t(e){e.innerHTML='<legend>legend</legend><input tabindex="-1"><input tabindex="0">';return false},validate:function t(e,n,r){var o=e.querySelector('input[tabindex="-1"]');var i=e.querySelector('input[tabindex="0"]');e.focus();e.querySelector("legend").focus();return r.activeElement===o&&"focusable"||r.activeElement===i&&"tabbable"||""}};const Ze={element:"div",mutate:function t(e){e.setAttribute("style","width: 100px; height: 50px; overflow: auto;");e.innerHTML='<div style="width: 500px; height: 40px;">scrollable content</div>';return e.querySelector("div")}};const Ne={element:"div",mutate:function t(e){e.setAttribute("style","width: 100px; height: 50px;");e.innerHTML='<div style="width: 500px; height: 40px;">scrollable content</div>'}};const He={element:"div",mutate:function t(e){e.setAttribute("style","width: 100px; height: 50px; overflow: auto;");e.innerHTML='<div style="width: 500px; height: 40px;">scrollable content</div>'}};const Ge={element:"details",mutate:function t(e){e.innerHTML="<summary>foo</summary><p>content</p>";return e.firstElementChild}};function Xe(){var t=document.createElement("div");t.innerHTML='<svg><foreignObject width="30" height="30">\n <input type="text"/>\n </foreignObject></svg>';return t.firstChild.firstChild}function ze(t){var e=t.ownerSVGElement||t.nodeName.toLowerCase()==="svg";if(!e){return false}var n=Xe();t.appendChild(n);var r=n.querySelector("input");r.focus();r.disabled=true;t.removeChild(n);return true}function Ke(t){return'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+t+"</svg>"}function qe(t){if(t.focus){return}try{HTMLElement.prototype.focus.call(t)}catch(e){ze(t)}}function Ve(t,e,n){qe(e);return n.activeElement===e}const _e={element:"div",mutate:function t(e){e.innerHTML=Ke('<text focusable="true">a</text>');return e.querySelector("text")},validate:Ve};const Je={element:"div",mutate:function t(e){e.innerHTML=Ke('<text tabindex="0">a</text>');return e.querySelector("text")},validate:Ve};const Ue={element:"div",mutate:function t(e){e.innerHTML=Ke('<text tabindex="-1">a</text>');return e.querySelector("text")},validate:Ve};const Ye={element:"div",mutate:function t(e){e.innerHTML=Ke(['<g id="ally-test-target"><a xlink:href="#void"><text>link</text></a></g>','<use xlink:href="#ally-test-target" x="0" y="0" tabindex="-1" />'].join(""));return e.querySelector("use")},validate:Ve};const Qe={element:"div",mutate:function t(e){e.innerHTML=Ke('<foreignObject tabindex="-1"><input type="text" /></foreignObject>');return e.querySelector("foreignObject")||e.getElementsByTagName("foreignObject")[0]},validate:Ve};var tn=Boolean(Gt.is.GECKO&&typeof SVGElement!=="undefined"&&SVGElement.prototype.focus);function en(){return tn}const nn={element:"div",mutate:function t(e){e.innerHTML=Ke("");return e.firstChild},validate:Ve};const rn={element:"div",mutate:function t(e){e.setAttribute("tabindex","3x")}};const on={element:"table",mutate:function t(e,n,r){var o=r.createDocumentFragment();o.innerHTML="<tr><td>cell</td></tr>";e.appendChild(o)}};const an={element:"video",mutate:function t(e){try{e.setAttribute("src",be)}catch(t){}}};var sn=Gt.is.GECKO||Gt.is.TRIDENT||Gt.is.EDGE;function ln(){return sn}var un={cssShadowPiercingDeepCombinator:pe,focusInZeroDimensionObject:Ie,focusObjectSwf:Le,focusSvgInIframe:en,tabsequenceAreaAtImgPosition:ln};var cn={focusAreaImgTabindex:ve,focusAreaTabindex:me,focusAreaWithoutHref:ge,focusAudioWithoutControls:he,focusBrokenImageMap:ye,focusChildrenOfFocusableFlexbox:we,focusFieldsetDisabled:Se,focusFieldset:Ae,focusFlexboxContainer:Oe,focusFormDisabled:ke,focusImgIsmap:Ee,focusImgUsemapTabindex:Me,focusInHiddenIframe:Te,focusInvalidTabindex:Be,focusLabelTabindex:Ce,focusObjectSvg:Fe,focusObjectSvgHidden:Re,focusRedirectImgUsemap:$e,focusRedirectLegend:De,focusScrollBody:Ze,focusScrollContainerWithoutOverflow:Ne,focusScrollContainer:He,focusSummary:Ge,focusSvgFocusableAttribute:_e,focusSvgTabindexAttribute:Je,focusSvgNegativeTabindexAttribute:Ue,focusSvgUseTabindex:Ye,focusSvgForeignobjectTabindex:Qe,focusSvg:nn,focusTabindexTrailingCharacters:rn,focusTable:on,focusVideoWithoutControls:an};function fn(){var t=ie(cn);Object.keys(un).forEach((function(e){t[e]=un[e]()}));return t}var dn=null;function pn(){if(dn){return dn}dn=de.get();if(!dn.time){de.set(fn());dn=de.get()}return dn}var bn=void 0;var vn=/^\s*(-|\+)?[0-9]+\s*$/;var mn=/^\s*(-|\+)?[0-9]+.*$/;function gn(t){if(!bn){bn=pn()}var e=bn.focusTabindexTrailingCharacters?mn:vn;var n=Wt({label:"is/valid-tabindex",resolveDocument:true,context:t});var r=n.hasAttribute("tabindex");var o=n.hasAttribute("tabIndex");if(!r&&!o){return false}var i=n.ownerSVGElement||n.nodeName.toLowerCase()==="svg";if(i&&!bn.focusSvgTabindexAttribute){return false}if(bn.focusInvalidTabindex){return true}var a=n.getAttribute(r?"tabindex":"tabIndex");if(a==="-32768"){return false}return Boolean(a&&e.test(a))}function hn(t){if(!gn(t)){return null}var e=t.hasAttribute("tabindex");var n=e?"tabindex":"tabIndex";var r=parseInt(t.getAttribute(n),10);return isNaN(r)?-1:r}function xn(t){var e=t.webkitUserModify||"";return Boolean(e&&e.indexOf("write")!==-1)}function yn(t){return[t.getPropertyValue("overflow"),t.getPropertyValue("overflow-x"),t.getPropertyValue("overflow-y")].some((function(t){return t==="auto"||t==="scroll"}))}function wn(t){return t.display.indexOf("flex")>-1}function Sn(t,e,n,r){if(e!=="div"&&e!=="span"){return false}if(n&&n!=="div"&&n!=="span"&&!yn(r)){return false}return t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth}var An=void 0;function On(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=t.context,n=t.except,r=n===undefined?{flexbox:false,scrollable:false,shadow:false}:n;if(!An){An=pn()}var o=Wt({label:"is/focus-relevant",resolveDocument:true,context:e});if(!r.shadow&&o.shadowRoot){return true}var i=o.nodeName.toLowerCase();if(i==="input"&&o.type==="hidden"){return false}if(i==="input"||i==="select"||i==="button"||i==="textarea"){return true}if(i==="legend"&&An.focusRedirectLegend){return true}if(i==="label"){return true}if(i==="area"){return true}if(i==="a"&&o.hasAttribute("href")){return true}if(i==="object"&&o.hasAttribute("usemap")){return false}if(i==="object"){var a=o.getAttribute("type");if(!An.focusObjectSvg&&a==="image/svg+xml"){return false}else if(!An.focusObjectSwf&&a==="application/x-shockwave-flash"){return false}}if(i==="iframe"||i==="object"){return true}if(i==="embed"||i==="keygen"){return true}if(o.hasAttribute("contenteditable")){return true}if(i==="audio"&&(An.focusAudioWithoutControls||o.hasAttribute("controls"))){return true}if(i==="video"&&(An.focusVideoWithoutControls||o.hasAttribute("controls"))){return true}if(An.focusSummary&&i==="summary"){return true}var s=gn(o);if(i==="img"&&o.hasAttribute("usemap")){return s&&An.focusImgUsemapTabindex||An.focusRedirectImgUsemap}if(An.focusTable&&(i==="table"||i==="td")){return true}if(An.focusFieldset&&i==="fieldset"){return true}var l=i==="svg";var u=o.ownerSVGElement;var c=o.getAttribute("focusable");var f=hn(o);if(i==="use"&&f!==null&&!An.focusSvgUseTabindex){return false}if(i==="foreignobject"){return f!==null&&An.focusSvgForeignobjectTabindex}if($t(o,"svg a")&&o.hasAttribute("xlink:href")){return true}if((l||u)&&o.focus&&!An.focusSvgNegativeTabindexAttribute&&f<0){return false}if(l){return s||An.focusSvg||An.focusSvgInIframe||Boolean(An.focusSvgFocusableAttribute&&c&&c==="true")}if(u){if(An.focusSvgTabindexAttribute&&s){return true}if(An.focusSvgFocusableAttribute){return c==="true"}}if(s){return true}var d=window.getComputedStyle(o,null);if(xn(d)){return true}if(An.focusImgIsmap&&i==="img"&&o.hasAttribute("ismap")){var p=Rt({context:o}).some((function(t){return t.nodeName.toLowerCase()==="a"&&t.hasAttribute("href")}));if(p){return true}}if(!r.scrollable&&An.focusScrollContainer){if(An.focusScrollContainerWithoutOverflow){if(Sn(o,i)){return true}}else if(yn(d)){return true}}if(!r.flexbox&&An.focusFlexboxContainer&&wn(d)){return true}var b=o.parentElement;if(!r.scrollable&&b){var v=b.nodeName.toLowerCase();var m=window.getComputedStyle(b,null);if(An.focusScrollBody&&Sn(b,i,v,m)){return true}if(An.focusChildrenOfFocusableFlexbox){if(wn(m)){return true}}}return false}On.except=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=function e(n){return On({context:n,except:t})};e.rules=On;return e};var kn=On.except({});function En(t,e){if(t.findIndex){return t.findIndex(e)}var n=t.length;if(n===0){return-1}for(var r=0;r<n;r++){if(e(t[r],r,t)){return r}}return-1}function Mn(t){try{return t.contentDocument||t.contentWindow&&t.contentWindow.document||t.getSVGDocument&&t.getSVGDocument()||null}catch(t){return null}}function Tn(t){if(!t){return document}if(t.nodeType===Node.DOCUMENT_NODE){return t}return t.ownerDocument||document}function Pn(t){var e=Tn(t);return e.defaultView||window}var In=void 0;function Bn(t){if(typeof In!=="string"){var e=pe();if(e){In=", html "+e+" "}}if(!In){return t}return t+In+t.replace(/\s*,\s*/g,",").split(",").join(In)}var Cn=void 0;function Wn(t){if(!Cn){Cn=Bn("object, iframe")}if(t._frameElement!==undefined){return t._frameElement}t._frameElement=null;var e=t.parent.document.querySelectorAll(Cn);[].some.call(e,(function(e){var n=Mn(e);if(n!==t.document){return false}t._frameElement=e;return true}));return t._frameElement}function Rn(t){var e=Pn(t);if(!e.parent||e.parent===e){return null}try{return e.frameElement||Wn(e)}catch(t){return null}}var Fn=/^(area)$/;function jn(t,e){return window.getComputedStyle(t,null).getPropertyValue(e)}function Ln(t){return t.some((function(t){return jn(t,"display")==="none"}))}function $n(t){var e=En(t,(function(t){var e=jn(t,"visibility");return e==="hidden"||e==="collapse"}));if(e===-1){return false}var n=En(t,(function(t){return jn(t,"visibility")==="visible"}));if(n===-1){return true}if(e<n){return true}return false}function Dn(t){var e=1;if(t[0].nodeName.toLowerCase()==="summary"){e=2}return t.slice(e).some((function(t){return t.nodeName.toLowerCase()==="details"&&t.open===false}))}function Zn(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=t.context,n=t.except,r=n===undefined?{notRendered:false,cssDisplay:false,cssVisibility:false,detailsElement:false,browsingContext:false}:n;var o=Wt({label:"is/visible",resolveDocument:true,context:e});var i=o.nodeName.toLowerCase();if(!r.notRendered&&Fn.test(i)){return true}var a=Rt({context:o});var s=i==="audio"&&!o.hasAttribute("controls");if(!r.cssDisplay&&Ln(s?a.slice(1):a)){return false}if(!r.cssVisibility&&$n(a)){return false}if(!r.detailsElement&&Dn(a)){return false}if(!r.browsingContext){var l=Rn(o);var u=Zn.except(r);if(l&&!u(l)){return false}}return true}Zn.except=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=function e(n){return Zn({context:n,except:t})};e.rules=Zn;return e};var Nn=Zn.except({});var Hn=Zt((function(t,e){(function(e,n){{t.exports=n(e)}})(typeof Dt!="undefined"?Dt:Dt,(function(t){if(t.CSS&&t.CSS.escape){return t.CSS.escape}var e=function(t){if(arguments.length==0){throw new TypeError("`CSS.escape` requires an argument.")}var e=String(t);var n=e.length;var r=-1;var o;var i="";var a=e.charCodeAt(0);while(++r<n){o=e.charCodeAt(r);if(o==0){i+="�";continue}if(o>=1&&o<=31||o==127||r==0&&o>=48&&o<=57||r==1&&o>=48&&o<=57&&a==45){i+="\\"+o.toString(16)+" ";continue}if(r==0&&n==1&&o==45){i+="\\"+e.charAt(r);continue}if(o>=128||o==45||o==95||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){i+=e.charAt(r);continue}i+="\\"+e.charAt(r)}return i};if(!t.CSS){t.CSS={}}t.CSS.escape=e;return e}))}));function Gn(t){var e=t.parentElement;if(!e.name||e.nodeName.toLowerCase()!=="map"){return null}var n=Tn(t);return n.querySelector('img[usemap="#'+Hn(e.name)+'"]')||null}var Xn=void 0;function zn(t){if(!Xn){Xn=pn()}var e=Wt({label:"is/valid-area",context:t});var n=e.nodeName.toLowerCase();if(n!=="area"){return false}var r=e.hasAttribute("tabindex");if(!Xn.focusAreaTabindex&&r){return false}var o=Gn(e);if(!o||!Nn(o)){return false}if(!Xn.focusBrokenImageMap&&(!o.complete||!o.naturalHeight||o.offsetWidth<=0||o.offsetHeight<=0)){return false}if(!Xn.focusAreaWithoutHref&&!e.href){return Xn.focusAreaTabindex&&r||Xn.focusAreaImgTabindex&&o.hasAttribute("tabindex")}var i=Rt({context:o}).slice(1).some((function(t){var e=t.nodeName.toLowerCase();return e==="button"||e==="a"}));if(i){return false}return true}var Kn=void 0;var qn=void 0;var Vn={input:true,select:true,textarea:true,button:true,fieldset:true,form:true};function _n(t){if(!Kn){Kn=pn();if(Kn.focusFieldsetDisabled){delete Vn.fieldset}if(Kn.focusFormDisabled){delete Vn.form}qn=new RegExp("^("+Object.keys(Vn).join("|")+")$")}var e=Wt({label:"is/native-disabled-supported",context:t});var n=e.nodeName.toLowerCase();return Boolean(qn.test(n))}var Jn=void 0;function Un(t){var e=t.nodeName.toLowerCase();return e==="fieldset"&&t.disabled}function Yn(t){var e=t.nodeName.toLowerCase();return e==="form"&&t.disabled}function Qn(t){if(!Jn){Jn=pn()}var e=Wt({label:"is/disabled",context:t});if(e.hasAttribute("data-ally-disabled")){return true}if(!_n(e)){return false}if(e.disabled){return true}var n=Rt({context:e});if(n.some(Un)){return true}if(!Jn.focusFormDisabled&&n.some(Yn)){return true}return false}function tr(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=t.context,n=t.except,r=n===undefined?{onlyFocusableBrowsingContext:false,visible:false}:n;var o=Wt({label:"is/only-tabbable",resolveDocument:true,context:e});if(!r.visible&&!Nn(o)){return false}if(!r.onlyFocusableBrowsingContext&&(Gt.is.GECKO||Gt.is.TRIDENT||Gt.is.EDGE)){var i=Rn(o);if(i){if(hn(i)<0){return false}}}var a=o.nodeName.toLowerCase();var s=hn(o);if(a==="label"&&Gt.is.GECKO){return s!==null&&s>=0}if(Gt.is.GECKO&&o.ownerSVGElement&&!o.focus){if(a==="a"&&o.hasAttribute("xlink:href")){if(Gt.is.GECKO){return true}}}return false}tr.except=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=function e(n){return tr({context:n,except:t})};e.rules=tr;return e};var er=tr.except({});var nr=void 0;function rr(t){var e=t.nodeName.toLowerCase();if(e==="embed"||e==="keygen"){return true}var n=hn(t);if(t.shadowRoot&&n===null){return true}if(e==="label"){return!nr.focusLabelTabindex||n===null}if(e==="legend"){return n===null}if(nr.focusSvgFocusableAttribute&&(t.ownerSVGElement||e==="svg")){var r=t.getAttribute("focusable");return r&&r==="false"}if(e==="img"&&t.hasAttribute("usemap")){return n===null||!nr.focusImgUsemapTabindex}if(e==="area"){return!zn(t)}return false}function or(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=t.context,n=t.except,r=n===undefined?{disabled:false,visible:false,onlyTabbable:false}:n;if(!nr){nr=pn()}var o=er.rules.except({onlyFocusableBrowsingContext:true,visible:r.visible});var i=Wt({label:"is/focusable",resolveDocument:true,context:e});var a=kn.rules({context:i,except:r});if(!a||rr(i)){return false}if(!r.disabled&&Qn(i)){return false}if(!r.onlyTabbable&&o(i)){return false}if(!r.visible){var s={context:i,except:{}};if(nr.focusInHiddenIframe){s.except.browsingContext=true}if(nr.focusObjectSvgHidden){var l=i.nodeName.toLowerCase();if(l==="object"){s.except.cssVisibility=true}}if(!Nn.rules(s)){return false}}var u=Rn(i);if(u){var c=u.nodeName.toLowerCase();if(c==="object"&&!nr.focusInZeroDimensionObject){if(!u.offsetWidth||!u.offsetHeight){return false}}}var f=i.nodeName.toLowerCase();if(f==="svg"&&nr.focusSvgInIframe&&!u&&i.getAttribute("tabindex")===null){return false}return true}or.except=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=function e(n){return or({context:n,except:t})};e.rules=or;return e};var ir=or.except({});(()=>{var t=class extends Event{constructor(t,{oldState:e="",newState:n="",...r}={}){super(t,r);this.oldState=String(e||""),this.newState=String(n||"")}},e=new WeakMap;function n(n,r,o){e.set(n,setTimeout((()=>{e.has(n)&&n.dispatchEvent(new t("toggle",{cancelable:!1,oldState:r,newState:o}))}),0))}var r=globalThis.ShadowRoot||function(){},o=globalThis.HTMLDialogElement||function(){},i=new WeakMap,a=new WeakMap,s=new WeakMap;function l(t){return s.get(t)||"hidden"}var u=new WeakMap;function c(t){let e=t.popoverTargetElement;if(!e)return;let n=l(e);t.popoverTargetAction==="show"&&n==="showing"||t.popoverTargetAction==="hide"&&n==="hidden"||(n==="showing"?O(e,!0,!0):f(e,!1)&&(u.set(e,t),A(e)))}function f(t,e){return!(t.popover!=="auto"&&t.popover!=="manual"||!t.isConnected||e&&l(t)!=="showing"||!e&&l(t)!=="hidden"||t instanceof o&&t.hasAttribute("open")||document.fullscreenElement===t)}function d(t){return t?Array.from(a.get(t.ownerDocument)||[]).indexOf(t)+1:0}function p(t){let e=m(t),n=g(t);return d(e)>d(n)?e:n}function b(t){let e=a.get(t);for(let t of e||[])if(!t.isConnected)e.delete(t);else return t;return null}function v(t){return typeof t.getRootNode=="function"?t.getRootNode():t.parentNode?v(t.parentNode):t}function m(t){for(;t;){if(t instanceof HTMLElement&&t.popover==="auto"&&s.get(t)==="showing")return t;if(t=t.parentElement||v(t),t instanceof r&&(t=t.host),t instanceof Document)return}}function g(t){for(;t;){let e=t.popoverTargetElement;if(e)return e;if(t=t.parentElement||v(t),t instanceof r&&(t=t.host),t instanceof Document)return}}function h(t){let e=new Map,n=0,r=t.ownerDocument;for(let t of a.get(r)||[])e.set(t,n),n+=1;e.set(t,n),n+=1;let o=null;function i(t){let n=m(t);if(n===null)return null;let r=e.get(n);(o===null||e.get(o)<r)&&(o=n)}return i(t?.parentElement),o}function x(t){return t.hidden||(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)&&t.disabled||t instanceof HTMLInputElement&&t.type==="hidden"||t instanceof HTMLAnchorElement&&t.href===""?!1:t.tabIndex!==-1}function y(t){if(t.shadowRoot&&t.shadowRoot.delegatesFocus!==!0)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let n=e.querySelector("[autofocus]");if(n)return n;let r=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),o=r.currentNode;for(;o;){if(x(o))return o;o=r.nextNode()}}function w(t){y(t)?.focus()}var S=new WeakMap;function A(e){if(!f(e,!1))return;let r=e.ownerDocument;if(!e.dispatchEvent(new t("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!f(e,!1))return;let o=!1;if(e.popover==="auto"){let t=e.getAttribute("popover"),n=h(e)||r;if(E(n,!1,!0),t!==e.getAttribute("popover")||!f(e,!1))return}b(r)||(o=!0),S.delete(e);let l=r.activeElement;e.classList.add(":popover-open"),s.set(e,"showing"),i.has(r)||i.set(r,new Set),i.get(r).add(e),w(e),e.popover==="auto"&&(a.has(r)||a.set(r,new Set),a.get(r).add(e),I(u.get(e),!0)),o&&l&&e.popover==="auto"&&S.set(e,l),n(e,"closed","open")}function O(e,r=!1,o=!1){if(!f(e,!0))return;let l=e.ownerDocument;if(e.popover==="auto"&&(E(e,r,o),!f(e,!0))||(I(u.get(e),!1),u.delete(e),o&&(e.dispatchEvent(new t("beforetoggle",{oldState:"open",newState:"closed"})),!f(e,!0))))return;i.get(l)?.delete(e),a.get(l)?.delete(e),e.classList.remove(":popover-open"),s.set(e,"hidden"),o&&n(e,"open","closed");let c=S.get(e);c&&(S.delete(e),r&&c.focus())}function k(t,e=!1,n=!1){let r=b(t);for(;r;)O(r,e,n),r=b(t)}function E(t,e,n){let r=t.ownerDocument||t;if(t instanceof Document)return k(r,e,n);let o=null,i=!1;for(let e of a.get(r)||[])if(e===t)i=!0;else if(i){o=e;break}if(!i)return k(r,e,n);for(;o&&l(o)==="showing"&&a.get(r)?.size;)O(o,e,n)}var M=new WeakMap;function T(t){if(!t.isTrusted)return;let e=t.composedPath()[0];if(!e)return;let n=e.ownerDocument;if(!b(n))return;let r=p(e);if(r&&t.type==="pointerdown")M.set(n,r);else if(t.type==="pointerup"){let t=M.get(n)===r;M.delete(n),t&&E(r||n,!1,!0)}}var P=new WeakMap;function I(t,e=!1){if(!t)return;P.has(t)||P.set(t,t.getAttribute("aria-expanded"));let n=t.popoverTargetElement;if(n&&n.popover==="auto")t.setAttribute("aria-expanded",String(e));else{let e=P.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var B=globalThis.ShadowRoot||function(){};function C(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function W(t,e,n){let r=t[e];Object.defineProperty(t,e,{value(t){return r.call(this,n(t))}})}var R=/(^|[^\\]):popover-open\b/g;function F(){window.ToggleEvent=window.ToggleEvent||t;function e(t){return t?.includes(":popover-open")&&(t=t.replace(R,"$1.\\:popover-open")),t}W(Document.prototype,"querySelector",e),W(Document.prototype,"querySelectorAll",e),W(Element.prototype,"querySelector",e),W(Element.prototype,"querySelectorAll",e),W(Element.prototype,"matches",e),W(Element.prototype,"closest",e),W(DocumentFragment.prototype,"querySelectorAll",e),W(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let t=(this.getAttribute("popover")||"").toLowerCase();return t===""||t=="auto"?"auto":"manual"},set(t){this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){A(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){O(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){s.get(this)==="showing"&&t===void 0||t===!1?O(this,!0,!0):(t===void 0||t===!0)&&A(this)}}});let n=new WeakMap;function r(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(t===null)this.removeAttribute("popovertarget"),n.delete(this);else if(t instanceof Element)this.setAttribute("popovertarget",""),n.set(this,t);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let t=n.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return n.delete(this),null;let e=v(this),r=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof B)&&r&&e.getElementById(r)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return t==="show"||t==="hide"?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}r(HTMLButtonElement),r(HTMLInputElement);let o=t=>{if(!t.isTrusted)return;let e=t.composedPath()[0];if(!(e instanceof Element)||e?.shadowRoot)return;let n=v(e);if(!(n instanceof B||n instanceof Document))return;let r=e.closest("[popovertargetaction],[popovertarget]");if(r){c(r);return}},i=t=>{let e=t.key,n=t.target;n&&(e==="Escape"||e==="Esc")&&E(n.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",o),t.addEventListener("keydown",i),t.addEventListener("pointerdown",T),t.addEventListener("pointerup",T)})(document)}C()||F()})();
|
|
2
|
+
/*!
|
|
3
|
+
* long-press-event - v@version@
|
|
4
|
+
* Pure JavaScript long-press-event
|
|
5
|
+
* https://github.com/john-doherty/long-press-event
|
|
6
|
+
* @author John Doherty <www.johndoherty.info>
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/(function(t,e){var n=null;var r="PointerEvent"in t||t.navigator&&"msPointerEnabled"in t.navigator;var o="ontouchstart"in t||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0;var i=r?"pointerdown":o?"touchstart":"mousedown";var a=r?"pointerup":o?"touchend":"mouseup";var s=r?"pointermove":o?"touchmove":"mousemove";var l=r?"pointerleave":o?"touchleave":"mouseleave";var u=0;var c=0;var f=10;var d=10;if(typeof t.CustomEvent!=="function"){t.CustomEvent=function(t,n){n=n||{bubbles:false,cancelable:false,detail:undefined};var r=e.createEvent("CustomEvent");r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail);return r};t.CustomEvent.prototype=t.Event.prototype}t.requestAnimFrame=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){t.setTimeout(e,1e3/60)}}();function p(e,n){if(!t.requestAnimationFrame&&!t.webkitRequestAnimationFrame&&!(t.mozRequestAnimationFrame&&t.mozCancelRequestAnimationFrame)&&!t.oRequestAnimationFrame&&!t.msRequestAnimationFrame)return t.setTimeout(e,n);var r=(new Date).getTime();var o={};var i=function(){var t=(new Date).getTime();var a=t-r;if(a>=n){e.call()}else{o.value=requestAnimFrame(i)}};o.value=requestAnimFrame(i);return o}function b(e){if(e){t.cancelAnimationFrame?t.cancelAnimationFrame(e.value):t.webkitCancelAnimationFrame?t.webkitCancelAnimationFrame(e.value):t.webkitCancelRequestAnimationFrame?t.webkitCancelRequestAnimationFrame(e.value):t.mozCancelRequestAnimationFrame?t.mozCancelRequestAnimationFrame(e.value):t.oCancelRequestAnimationFrame?t.oCancelRequestAnimationFrame(e.value):t.msCancelRequestAnimationFrame?t.msCancelRequestAnimationFrame(e.value):clearTimeout(e)}}function v(t){h();t=m(t);var n=this.dispatchEvent(new CustomEvent("long-press",{bubbles:true,cancelable:true,detail:{clientX:t.clientX,clientY:t.clientY,offsetX:t.offsetX,offsetY:t.offsetY,pageX:t.pageX,pageY:t.pageY},clientX:t.clientX,clientY:t.clientY,offsetX:t.offsetX,offsetY:t.offsetY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}));if(!n){e.addEventListener("click",(function t(n){e.removeEventListener("click",t,true);x(n)}),true)}}function m(t){if(t.changedTouches!==undefined){return t.changedTouches[0]}return t}function g(t){h();var e=t.target;var r=parseInt(S(e,"data-long-press-delay","1500"),10);n=p(v.bind(e,t),r)}function h(t){b(n);n=null}function x(t){t.stopImmediatePropagation();t.preventDefault();t.stopPropagation()}function y(t){u=t.clientX;c=t.clientY;g(t)}function w(t){var e=Math.abs(u-t.clientX);var n=Math.abs(c-t.clientY);if(e>=f||n>=d){h()}}function S(t,n,r){while(t&&t!==e.documentElement){var o=t.getAttribute(n);if(o){return o}t=t.parentNode}return r}e.addEventListener(a,h,true);e.addEventListener(l,h,true);e.addEventListener(s,w,true);e.addEventListener("wheel",h,true);e.addEventListener("scroll",h,true);e.addEventListener(i,y,true)})(window,document);const ar=["primary","yellow"];const sr="/**\n * Colors used by the post style guide\n */\n/**\n * Maps. Allow maps to have custom colors from the project\n * by always merging into a default empty map\n */\n:host, .bg-yellow {\n --post-bg-opacity: 1;\n background-color: rgba(var(--post-bg-rgb), var(--post-bg-opacity)) !important;\n color: var(--post-contrast-color) !important;\n}\n\n.bg-yellow {\n --post-contrast-color: #000;\n --post-contrast-color-inverted: #fff;\n --post-gray-10: hsl(0, 0%, 90%);\n --post-gray-20: hsl(0, 0%, 80%);\n --post-gray-40: hsl(0, 0%, 60%);\n --post-gray-60: hsl(0, 0%, 40%);\n --post-gray-80: hsl(0, 0%, 20%);\n --post-yellow: #fc0;\n --post-light: #faf9f8;\n --post-gray: #f4f3f1;\n --post-dark: hsl(0, 0%, 20%);\n --post-primary: hsl(0, 0%, 20%);\n --post-white: #fff;\n --post-black: #000;\n --post-success: #2c911c;\n --post-info: #cce4ee;\n --post-warning: #f49e00;\n --post-danger: #a51728;\n --post-nightblue: #004976;\n --post-nightblue-bright: #0076a8;\n --post-petrol: #006d68;\n --post-petrol-bright: #00968f;\n --post-coral: #9e2a2f;\n --post-coral-bright: #e03c31;\n --post-olive: #716135;\n --post-olive-bright: #aa9d2e;\n --post-purple: #80276c;\n --post-purple-bright: #c5299b;\n --post-aubergine: #523178;\n --post-aubergine-bright: #7566a0;\n --post-contrast-color-rgb: 0, 0, 0;\n --post-contrast-color-inverted-rgb: 255, 255, 255;\n --post-gray-10-rgb: 230, 230, 230;\n --post-gray-20-rgb: 204, 204, 204;\n --post-gray-40-rgb: 153, 153, 153;\n --post-gray-60-rgb: 102, 102, 102;\n --post-gray-80-rgb: 51, 51, 51;\n --post-yellow-rgb: 255, 204, 0;\n --post-light-rgb: 250, 249, 248;\n --post-gray-rgb: 244, 243, 241;\n --post-dark-rgb: 51, 51, 51;\n --post-primary-rgb: 51, 51, 51;\n --post-white-rgb: 255, 255, 255;\n --post-black-rgb: 0, 0, 0;\n --post-success-rgb: 44, 145, 28;\n --post-info-rgb: 204, 228, 238;\n --post-warning-rgb: 244, 158, 0;\n --post-danger-rgb: 165, 23, 40;\n --post-nightblue-rgb: 0, 73, 118;\n --post-nightblue-bright-rgb: 0, 118, 168;\n --post-petrol-rgb: 0, 109, 104;\n --post-petrol-bright-rgb: 0, 150, 143;\n --post-coral-rgb: 158, 42, 47;\n --post-coral-bright-rgb: 224, 60, 49;\n --post-olive-rgb: 113, 97, 53;\n --post-olive-bright-rgb: 170, 157, 46;\n --post-purple-rgb: 128, 39, 108;\n --post-purple-bright-rgb: 197, 41, 155;\n --post-aubergine-rgb: 82, 49, 120;\n --post-aubergine-bright-rgb: 117, 102, 160;\n}\n\n:host {\n --post-contrast-color: #fff;\n --post-contrast-color-inverted: #000;\n --post-dark: #faf9f8;\n --post-light: hsl(0, 0%, 20%);\n --post-gray-80: hsl(0, 0%, 90%);\n --post-gray-60: hsl(0, 0%, 80%);\n --post-gray-40: hsl(0, 0%, 60%);\n --post-gray-20: hsl(0, 0%, 40%);\n --post-gray-10: hsl(0, 0%, 20%);\n --post-contrast-color-rgb: 255, 255, 255;\n --post-contrast-color-inverted-rgb: 0, 0, 0;\n --post-dark-rgb: 250, 249, 248;\n --post-light-rgb: 51, 51, 51;\n --post-gray-80-rgb: 230, 230, 230;\n --post-gray-60-rgb: 204, 204, 204;\n --post-gray-40-rgb: 153, 153, 153;\n --post-gray-20-rgb: 102, 102, 102;\n --post-gray-10-rgb: 51, 51, 51;\n}\n\n@layer polyfill {\n [popover] {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n [popover]:not(.\\:popover-open) {\n display: none;\n }\n [popover]:is(dialog[open]) {\n display: revert;\n }\n [anchor].\\:popover-open {\n inset: auto;\n }\n @supports selector([popover]:open) {\n [popover]:not(.\\:popover-open, dialog[open]) {\n display: revert;\n }\n [anchor]:is(:open) {\n inset: auto;\n }\n }\n @supports selector([popover]:popover-open) {\n [popover]:not(.\\:popover-open, dialog[open]) {\n display: revert;\n }\n [anchor]:is(:popover-open) {\n inset: auto;\n }\n }\n @supports not (background-color: canvas) {\n [popover] {\n background-color: white;\n color: black;\n }\n }\n @supports (width: -moz-fit-content) {\n [popover] {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n @supports not (inset: 0) {\n [popover] {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n}\n:host {\n --post-bg-rgb: 51, 51, 51;\n}\n\ndiv {\n position: absolute;\n z-index: 1070;\n width: max-content;\n max-width: 30ch;\n margin: 0;\n padding: 0.25rem 0.5rem;\n color: inherit;\n background-color: inherit;\n border-color: transparent;\n border-radius: 4px;\n overflow: visible;\n pointer-events: none;\n}\n\n.arrow {\n position: absolute;\n width: 0.7071067812rem;\n aspect-ratio: 1/1;\n background-color: inherit;\n rotate: 45deg;\n pointer-events: none;\n z-index: -1;\n border-right: 2px solid transparent;\n border-bottom: 2px solid transparent;\n}\n\n.bg-yellow {\n --post-bg-rgb: 255, 204, 0;\n}";const lr={top:"bottom",right:"left",bottom:"top",left:"right"};const ur=class{validateBackgroundColor(t=this.backgroundColor){i(t,ar,`The post-tooltip "background-color" prop should contain one of those values: ${ar.join(", ")}`);if(t==="yellow"){this.tooltipClasses="bg-yellow"}else{this.tooltipClasses="bg-primary"}}constructor(e){t(this,e);this.tooltipClasses=undefined;this.backgroundColor="primary";this.placement="top";this.localShowTooltip=t=>this.show(t.target);this.localHideTooltip=this.hide.bind(this);this.localToggleTooltip=this.toggle.bind(this)}componentWillLoad(){this.validateBackgroundColor();document.body.appendChild(this.host)}connectedCallback(){if(!this.host.id){throw new Error("No id set: <post-tooltip> must have an id, linking it to it's target element using the data-tooltip-target attribute.")}if(!this.triggers){throw new Error(`No trigger found for <post-tooltip id="${this.host.id}">, please add the 'data-tooltip-target="${this.host.id}" attribute to the trigger element.`)}this.triggers.forEach((t=>this.patchPopoverTargetActionInterest(t)))}disconnectedCallback(){this.triggers.forEach((t=>{t.removeEventListener("mouseenter",this.localShowTooltip);t.removeEventListener("mouseleave",this.localHideTooltip);t.removeEventListener("focus",this.localShowTooltip);t.removeEventListener("blur",this.localHideTooltip);t.removeEventListener("long-press",this.localShowTooltip)}));if(this.tooltipRef)this.tooltipRef.removeEventListener("beforetoggle",this.localToggleTooltip);if(typeof this.clearAutoUpdate==="function")this.clearAutoUpdate()}componentDidLoad(){if(!this.host.id||!this.triggers)return false;this.tooltipRef.setAttribute("popover","");this.tooltipRef.addEventListener("beforetoggle",this.handleToggle.bind(this))}async show(t){this.eventTarget=t;this.tooltipRef.showPopover()}async hide(){this.eventTarget=null;this.tooltipRef.hidePopover()}async toggle(t,e){this.eventTarget=t;this.tooltipRef.togglePopover(e)}get triggers(){return document.querySelectorAll(`[data-tooltip-target="${this.host.id}"]`)}patchPopoverTargetActionInterest(t){t.addEventListener("mouseenter",this.localShowTooltip);t.addEventListener("mouseleave",this.localHideTooltip);t.addEventListener("focus",this.localShowTooltip);t.addEventListener("blur",this.localHideTooltip);t.addEventListener("long-press",this.localShowTooltip);const e=t.getAttribute("aria-describedby");if(!(e===null||e===void 0?void 0:e.includes(this.host.id))){const n=e?`${e} ${this.host.id}`:this.host.id;t.setAttribute("aria-describedby",n)}if(!ir(t)){t.setAttribute("tabindex","0")}}handleToggle(t){const e=t.newState==="open";if(e){this.startAutoupdates()}else{if(typeof this.clearAutoUpdate==="function")this.clearAutoUpdate()}}startAutoupdates(){this.clearAutoUpdate=It(this.eventTarget,this.tooltipRef,this.positionTooltip.bind(this))}async positionTooltip(){const{x:t,y:e,middlewareData:n,placement:r}=await Bt(this.eventTarget,this.tooltipRef,{placement:this.placement||"top",middleware:[R(),L(),Z({padding:8}),D(12),W({element:this.arrowRef,padding:8})]});this.tooltipRef.style.left=`${t}px`;this.tooltipRef.style.top=`${e}px`;const o=r.split("-")[0];const{x:i,y:a}=n.arrow;const s=lr[o];Object.assign(this.arrowRef.style,{top:a?`${a}px`:"",left:i?`${i}px`:"",[s]:`${-this.arrowRef.offsetWidth/2}px`})}render(){return e(n,{"data-version":o},e("div",{role:"tooltip",tabindex:"-1",class:this.tooltipClasses,ref:t=>this.tooltipRef=t},e("span",{class:"arrow",ref:t=>{this.arrowRef=t}}),e("slot",null)))}get host(){return r(this)}static get watchers(){return{backgroundColor:["validateBackgroundColor"]}}};ur.style=sr;export{ur as post_tooltip};
|
|
9
|
+
//# sourceMappingURL=p-2b6ab354.entry.js.map
|