@swisspost/design-system-components 1.6.2 → 1.6.3

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.
Files changed (151) hide show
  1. package/dist/cjs/{index-e7618bb3.js → index-b619e205.js} +6 -16
  2. package/dist/cjs/index-b619e205.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +9 -9
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/package-4e9ab85c.js +7 -0
  6. package/dist/cjs/package-4e9ab85c.js.map +1 -0
  7. package/dist/cjs/post-accordion.cjs.entry.js +2 -2
  8. package/dist/cjs/post-alert-b46943e0.js +101 -0
  9. package/dist/cjs/{post-alert-1fb90f2d.js.map → post-alert-b46943e0.js.map} +1 -1
  10. package/dist/cjs/post-alert.cjs.entry.js +3 -3
  11. package/dist/cjs/post-collapsible-04364cda.js +93 -0
  12. package/dist/cjs/post-collapsible-04364cda.js.map +1 -0
  13. package/dist/cjs/post-collapsible.cjs.entry.js +3 -3
  14. package/dist/cjs/post-components.cjs.js +2 -2
  15. package/dist/cjs/post-components.cjs.js.map +1 -1
  16. package/dist/cjs/{post-icon-91f6603a.js → post-icon-5b36814e.js} +3 -3
  17. package/dist/cjs/{post-icon-91f6603a.js.map → post-icon-5b36814e.js.map} +1 -1
  18. package/dist/cjs/post-icon.cjs.entry.js +3 -3
  19. package/dist/cjs/post-tab-header-805c0a52.js +33 -0
  20. package/dist/cjs/{post-tab-header-a3845fe5.js.map → post-tab-header-805c0a52.js.map} +1 -1
  21. package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
  22. package/dist/cjs/{post-tab-panel-b7326ff8.js → post-tab-panel-caa44a77.js} +3 -3
  23. package/dist/cjs/{post-tab-panel-b7326ff8.js.map → post-tab-panel-caa44a77.js.map} +1 -1
  24. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  25. package/dist/cjs/{post-tabs-384a1fab.js → post-tabs-29d4dc70.js} +4 -4
  26. package/dist/cjs/{post-tabs-384a1fab.js.map → post-tabs-29d4dc70.js.map} +1 -1
  27. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  28. package/dist/cjs/{post-tooltip-2becc97a.js → post-tooltip-32a9c549.js} +14 -14
  29. package/dist/cjs/post-tooltip-32a9c549.js.map +1 -0
  30. package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
  31. package/dist/collection/collection-manifest.json +1 -1
  32. package/dist/collection/components/post-alert/post-alert.css +2 -2
  33. package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
  34. package/dist/collection/components/post-collapsible/post-collapsible.js +3 -3
  35. package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
  36. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  37. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  38. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  39. package/dist/components/package.js +1 -1
  40. package/dist/components/post-alert2.js +1 -1
  41. package/dist/components/post-alert2.js.map +1 -1
  42. package/dist/components/post-collapsible2.js +3 -3
  43. package/dist/components/post-collapsible2.js.map +1 -1
  44. package/dist/components/post-tab-header2.js +1 -1
  45. package/dist/components/post-tab-header2.js.map +1 -1
  46. package/dist/components/post-tabs2.js +1 -1
  47. package/dist/components/post-tabs2.js.map +1 -1
  48. package/dist/components/post-tooltip2.js +11 -11
  49. package/dist/components/post-tooltip2.js.map +1 -1
  50. package/dist/docs.json +8 -3
  51. package/dist/esm/{index-08d62a75.js → index-4eff5fc5.js} +6 -16
  52. package/dist/esm/index-4eff5fc5.js.map +1 -0
  53. package/dist/esm/index.js +9 -9
  54. package/dist/esm/loader.js +2 -2
  55. package/dist/esm/package-b9b10dd3.js +5 -0
  56. package/dist/esm/package-b9b10dd3.js.map +1 -0
  57. package/dist/esm/post-accordion.entry.js +2 -2
  58. package/dist/esm/post-alert-e457e249.js +99 -0
  59. package/dist/esm/{post-alert-46926902.js.map → post-alert-e457e249.js.map} +1 -1
  60. package/dist/esm/post-alert.entry.js +3 -3
  61. package/dist/esm/post-collapsible-c0a826b2.js +91 -0
  62. package/dist/esm/post-collapsible-c0a826b2.js.map +1 -0
  63. package/dist/esm/post-collapsible.entry.js +3 -3
  64. package/dist/esm/post-components.js +3 -3
  65. package/dist/esm/post-components.js.map +1 -1
  66. package/dist/esm/{post-icon-fb627697.js → post-icon-b34da686.js} +3 -3
  67. package/dist/esm/{post-icon-fb627697.js.map → post-icon-b34da686.js.map} +1 -1
  68. package/dist/esm/post-icon.entry.js +3 -3
  69. package/dist/esm/post-tab-header-f0c355d6.js +31 -0
  70. package/dist/esm/{post-tab-header-84b12382.js.map → post-tab-header-f0c355d6.js.map} +1 -1
  71. package/dist/esm/post-tab-header.entry.js +3 -3
  72. package/dist/esm/{post-tab-panel-216c0b6e.js → post-tab-panel-46f02247.js} +3 -3
  73. package/dist/esm/{post-tab-panel-216c0b6e.js.map → post-tab-panel-46f02247.js.map} +1 -1
  74. package/dist/esm/post-tab-panel.entry.js +3 -3
  75. package/dist/esm/{post-tabs-e235d663.js → post-tabs-5dd55290.js} +4 -4
  76. package/dist/esm/{post-tabs-e235d663.js.map → post-tabs-5dd55290.js.map} +1 -1
  77. package/dist/esm/post-tabs.entry.js +3 -3
  78. package/dist/esm/{post-tooltip-47f2146d.js → post-tooltip-fa7b4a0a.js} +14 -14
  79. package/dist/esm/post-tooltip-fa7b4a0a.js.map +1 -0
  80. package/dist/esm/post-tooltip.entry.js +3 -3
  81. package/dist/post-components/index.esm.js +1 -1
  82. package/dist/post-components/p-195b8c88.entry.js +2 -0
  83. package/dist/post-components/p-3225e008.entry.js +2 -0
  84. package/dist/post-components/p-3604be27.js +2 -0
  85. package/dist/post-components/p-3604be27.js.map +1 -0
  86. package/dist/post-components/p-61ffffa9.entry.js +2 -0
  87. package/dist/post-components/{p-ce907090.entry.js → p-7b8797c6.entry.js} +2 -2
  88. package/dist/post-components/p-88262544.js +2 -0
  89. package/dist/post-components/p-8b6fe20d.js +2 -0
  90. package/dist/post-components/{p-57fdeeab.js.map → p-8b6fe20d.js.map} +1 -1
  91. package/dist/post-components/p-9f71d450.js +2 -0
  92. package/dist/post-components/p-a7649277.js +3 -0
  93. package/dist/post-components/p-a7649277.js.map +1 -0
  94. package/dist/post-components/p-a7c78dea.entry.js +2 -0
  95. package/dist/post-components/p-b2c3ed97.entry.js +2 -0
  96. package/dist/post-components/p-ba9aba3a.entry.js +2 -0
  97. package/dist/post-components/p-bd293ff3.entry.js +2 -0
  98. package/dist/post-components/p-ca1e407c.js +2 -0
  99. package/dist/post-components/{p-21549a50.js.map → p-ca1e407c.js.map} +1 -1
  100. package/dist/post-components/{p-b5e1fd89.js → p-d407b1c3.js} +2 -2
  101. package/dist/post-components/{p-4cb18ddf.js → p-fd7015ae.js} +3 -3
  102. package/dist/post-components/p-fd7015ae.js.map +1 -0
  103. package/dist/post-components/p-fffce1d7.js +2 -0
  104. package/dist/post-components/{p-57b48dff.js.map → p-fffce1d7.js.map} +1 -1
  105. package/dist/post-components/post-components.esm.js +1 -1
  106. package/dist/post-components/post-components.esm.js.map +1 -1
  107. package/package.json +7 -7
  108. package/dist/cjs/index-e7618bb3.js.map +0 -1
  109. package/dist/cjs/package-041a8597.js +0 -7
  110. package/dist/cjs/package-041a8597.js.map +0 -1
  111. package/dist/cjs/post-alert-1fb90f2d.js +0 -101
  112. package/dist/cjs/post-collapsible-e46002bb.js +0 -93
  113. package/dist/cjs/post-collapsible-e46002bb.js.map +0 -1
  114. package/dist/cjs/post-tab-header-a3845fe5.js +0 -33
  115. package/dist/cjs/post-tooltip-2becc97a.js.map +0 -1
  116. package/dist/esm/index-08d62a75.js.map +0 -1
  117. package/dist/esm/package-a962a93d.js +0 -5
  118. package/dist/esm/package-a962a93d.js.map +0 -1
  119. package/dist/esm/post-alert-46926902.js +0 -99
  120. package/dist/esm/post-collapsible-f1b6592d.js +0 -91
  121. package/dist/esm/post-collapsible-f1b6592d.js.map +0 -1
  122. package/dist/esm/post-tab-header-84b12382.js +0 -31
  123. package/dist/esm/post-tooltip-47f2146d.js.map +0 -1
  124. package/dist/post-components/p-03fe58da.js +0 -2
  125. package/dist/post-components/p-03fe58da.js.map +0 -1
  126. package/dist/post-components/p-151b55c0.entry.js +0 -2
  127. package/dist/post-components/p-21549a50.js +0 -2
  128. package/dist/post-components/p-4cb18ddf.js.map +0 -1
  129. package/dist/post-components/p-4e24f13b.entry.js +0 -2
  130. package/dist/post-components/p-57b48dff.js +0 -2
  131. package/dist/post-components/p-57fdeeab.js +0 -2
  132. package/dist/post-components/p-58cc7b5a.entry.js +0 -2
  133. package/dist/post-components/p-6cafa644.entry.js +0 -2
  134. package/dist/post-components/p-7f370d77.entry.js +0 -2
  135. package/dist/post-components/p-7f4eba57.js +0 -2
  136. package/dist/post-components/p-8c006e7d.js +0 -3
  137. package/dist/post-components/p-8c006e7d.js.map +0 -1
  138. package/dist/post-components/p-aee47e1a.entry.js +0 -2
  139. package/dist/post-components/p-d13111f2.js +0 -2
  140. package/dist/post-components/p-f35c2075.entry.js +0 -2
  141. /package/dist/post-components/{p-151b55c0.entry.js.map → p-195b8c88.entry.js.map} +0 -0
  142. /package/dist/post-components/{p-4e24f13b.entry.js.map → p-3225e008.entry.js.map} +0 -0
  143. /package/dist/post-components/{p-58cc7b5a.entry.js.map → p-61ffffa9.entry.js.map} +0 -0
  144. /package/dist/post-components/{p-ce907090.entry.js.map → p-7b8797c6.entry.js.map} +0 -0
  145. /package/dist/post-components/{p-6cafa644.entry.js.map → p-88262544.js.map} +0 -0
  146. /package/dist/post-components/{p-7f4eba57.js.map → p-9f71d450.js.map} +0 -0
  147. /package/dist/post-components/{p-7f370d77.entry.js.map → p-a7c78dea.entry.js.map} +0 -0
  148. /package/dist/post-components/{p-aee47e1a.entry.js.map → p-b2c3ed97.entry.js.map} +0 -0
  149. /package/dist/post-components/{p-d13111f2.js.map → p-ba9aba3a.entry.js.map} +0 -0
  150. /package/dist/post-components/{p-f35c2075.entry.js.map → p-bd293ff3.entry.js.map} +0 -0
  151. /package/dist/post-components/{p-b5e1fd89.js.map → p-d407b1c3.js.map} +0 -0
@@ -1,6 +1,6 @@
1
- export { P as post_tooltip } from './post-tooltip-47f2146d.js';
2
- import './index-08d62a75.js';
3
- import './package-a962a93d.js';
1
+ export { P as post_tooltip } from './post-tooltip-fa7b4a0a.js';
2
+ import './index-4eff5fc5.js';
3
+ import './package-b9b10dd3.js';
4
4
  import './check-one-of-74750af9.js';
5
5
 
6
6
  //# sourceMappingURL=post-tooltip.entry.js.map
@@ -1,2 +1,2 @@
1
- export{P as PostAlert}from"./p-57fdeeab.js";export{P as PostCollapsible}from"./p-03fe58da.js";export{P as PostIcon}from"./p-b5e1fd89.js";export{P as PostTabs}from"./p-57b48dff.js";export{P as PostTabHeader}from"./p-21549a50.js";export{P as PostTabPanel}from"./p-7f4eba57.js";export{P as PostTooltip}from"./p-4cb18ddf.js";import"./p-8c006e7d.js";import"./p-d13111f2.js";import"./p-2737eaf5.js";import"./p-dfe29f7f.js";import"./p-440193f4.js";import"./p-1339f8cd.js";import"./p-b531475e.js";
1
+ export{P as PostAlert}from"./p-8b6fe20d.js";export{P as PostCollapsible}from"./p-3604be27.js";export{P as PostIcon}from"./p-d407b1c3.js";export{P as PostTabs}from"./p-fffce1d7.js";export{P as PostTabHeader}from"./p-ca1e407c.js";export{P as PostTabPanel}from"./p-9f71d450.js";export{P as PostTooltip}from"./p-fd7015ae.js";import"./p-a7649277.js";import"./p-88262544.js";import"./p-2737eaf5.js";import"./p-dfe29f7f.js";import"./p-440193f4.js";import"./p-1339f8cd.js";import"./p-b531475e.js";
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1,2 @@
1
+ export{P as post_tab_panel}from"./p-9f71d450.js";import"./p-a7649277.js";import"./p-88262544.js";
2
+ //# sourceMappingURL=p-195b8c88.entry.js.map
@@ -0,0 +1,2 @@
1
+ export{P as post_alert}from"./p-8b6fe20d.js";import"./p-a7649277.js";import"./p-88262544.js";import"./p-2737eaf5.js";import"./p-dfe29f7f.js";import"./p-440193f4.js";import"./p-1339f8cd.js";import"./p-b531475e.js";
2
+ //# sourceMappingURL=p-3225e008.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as o,c as t,h as r,H as s,g as e}from"./p-a7649277.js";import{v as i}from"./p-88262544.js";import{d as a,b as n}from"./p-dfe29f7f.js";function c(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const l=350;const d="ease";const p={height:"0",overflow:"hidden"};const g=o=>{const{height:t}=window.getComputedStyle(o);const r={height:t};return o.animate([r,p],{duration:l,easing:d,fill:"forwards"})};const b=o=>{const t={height:`${o.scrollHeight}px`};return o.animate([p,t],{duration:l,easing:d,fill:"forwards"})};const h=[1,2,3,4,5,6];const u=".accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item{--post-bg-opacity:1;background-color:rgba(var(--post-bg-rgb), var(--post-bg-opacity)) !important;color:var(--post-contrast-color) !important}.accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item{--post-contrast-color:#000;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-primary:hsl(0, 0%, 20%);--post-white:#fff;--post-black:#000;--post-info:#cce4ee;--post-success:#2c911c;--post-warning:#f49e00;--post-danger:#a51728;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-success-green:#2c871d;--post-error-red:#a51728;--post-warning-orange:#f49e00;--post-success-background:#c0debb;--post-error-background:#ffdade;--post-warning-background:#fce2b2;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-yellow-rgb:255, 204, 0;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-primary-rgb:51, 51, 51;--post-white-rgb:255, 255, 255;--post-black-rgb:0, 0, 0;--post-info-rgb:204, 228, 238;--post-success-rgb:44, 145, 28;--post-warning-rgb:244, 158, 0;--post-danger-rgb:165, 23, 40;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160;--post-success-green-rgb:44, 135, 29;--post-error-red-rgb:165, 23, 40;--post-warning-orange-rgb:244, 158, 0;--post-success-background-rgb:192, 222, 187;--post-error-background-rgb:255, 218, 222;--post-warning-background-rgb:252, 226, 178}.accordion-item{border-block:2px solid #666;--post-bg-rgb:244, 243, 241}.accordion-item+.accordion-item{border-block-start:0}.bg-light .accordion-item{--post-bg-rgb:255, 255, 255}.bg-gray .accordion-item{--post-bg-rgb:255, 255, 255}.accordion-header{color:#333;font-size:1rem;font-weight:700;line-height:1.5;margin:0}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;width:100%;position:relative;padding-block:1rem;padding-inline-start:1rem;padding-inline-end:3rem;text-align:start;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms}.accordion-button:focus-visible{outline:2px solid #1976c8}.accordion-button:hover{color:#000;background-color:#e6e6e6}.accordion-button:disabled{opacity:.4;pointer-events:none}.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.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.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)}.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:.5rem 1rem 1rem;font-weight:300}.accordion-button>*,.accordion-body>:first-child{margin-block-start:0 !important}.accordion-button>*,.accordion-body>:last-child{margin-block-end:0 !important}:host{display:block}.accordion-button{cursor:pointer}.accordion-button>::slotted(.text-truncate){display:block}post-collapsible+post-collapsible::part(accordion-item){border-block-start:0 !important}";const m=class{constructor(r){o(this,r);this.collapseChange=t(this,"collapseChange",7);this.isLoaded=false;this.id=undefined;this.isOpen=true;this.hasHeader=undefined;this.headingTag=undefined;this.collapsed=false;this.headingLevel=2}validateCollapsed(o=this.collapsed){a(o,"boolean","The `collapsed` property of the `post-collapsible` must be a boolean.")}validateHeadingLevel(o=this.headingLevel){n(o,h,"The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.")}connectedCallback(){this.validateCollapsed();this.validateHeadingLevel()}componentWillRender(){var o;this.id=this.host.id||`c${crypto.randomUUID()}`;this.hasHeader=this.host.querySelectorAll('[slot="header"]').length>0;this.headingTag=`h${(o=this.headingLevel)!==null&&o!==void 0?o:2}`}componentDidLoad(){if(this.collapsed)void this.toggle(false);this.isLoaded=true}async toggle(o=!this.isOpen){if(o===this.isOpen)return o;this.isOpen=!this.isOpen;if(this.isLoaded)this.collapseChange.emit();const t=o?b(this.collapsible):g(this.collapsible);if(!this.isLoaded||c())t.finish();await t.finished;t.commitStyles();return this.isOpen}render(){const o=r("div",{"aria-labelledby":this.hasHeader?`${this.id}--header`:undefined,class:`collapse${this.hasHeader?" accordion-collapse":""}`,id:`${this.id}--collapse`,ref:o=>this.collapsible=o},this.hasHeader?r("div",{class:"accordion-body"},r("slot",null)):r("slot",null));return r(s,{id:this.id,"data-version":i},this.hasHeader?r("div",{part:"accordion-item",class:"accordion-item"},r(this.headingTag,{class:"accordion-header",id:`${this.id}--header`},r("button",{"aria-controls":`${this.id}--collapse`,"aria-expanded":`${this.isOpen}`,class:`accordion-button${this.isOpen?"":" collapsed"}`,onClick:()=>this.toggle(),type:"button"},r("slot",{name:"header"}))),o):o)}get host(){return e(this)}static get watchers(){return{collapsed:["validateCollapsed"],headingLevel:["validateHeadingLevel"]}}};m.style=u;export{m as P};
2
+ //# sourceMappingURL=p-3604be27.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isMotionReduced","window","matchMedia","matches","collapseDuration","collapseEasing","collapsedKeyframe","height","overflow","collapse","el","getComputedStyle","expandedKeyframe","animate","duration","easing","fill","expand","scrollHeight","HEADING_LEVELS","postCollapsibleCss","PostCollapsible","this","isLoaded","validateCollapsed","newValue","collapsed","checkEmptyOrType","validateHeadingLevel","headingLevel","checkEmptyOrOneOf","connectedCallback","componentWillRender","id","host","crypto","randomUUID","hasHeader","querySelectorAll","length","headingTag","_a","componentDidLoad","toggle","open","isOpen","collapseChange","emit","animation","collapsible","finish","finished","commitStyles","render","h","undefined","class","ref","Host","version","part","onClick","type","name"],"sources":["src/utils/is-motion-reduced.ts","src/animations/collapse.ts","src/components/post-collapsible/heading-levels.ts","src/components/post-collapsible/post-collapsible.scss?tag=post-collapsible&encapsulation=shadow","src/components/post-collapsible/post-collapsible.tsx"],"sourcesContent":["export function isMotionReduced(): boolean {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n","const collapseDuration = 350;\nconst collapseEasing = 'ease';\nconst collapsedKeyframe: Keyframe = { height: '0', overflow: 'hidden' };\n\nexport const collapse = (el: HTMLElement): Animation => {\n const { height } = window.getComputedStyle(el);\n const expandedKeyframe: Keyframe = { height };\n\n return el.animate(\n [expandedKeyframe, collapsedKeyframe],\n { duration: collapseDuration, easing: collapseEasing, fill: 'forwards' },\n );\n};\n\nexport const expand = (el: HTMLElement): Animation => {\n const expandedKeyframe: Keyframe = { height: `${el.scrollHeight}px` };\n\n return el.animate(\n [collapsedKeyframe, expandedKeyframe],\n { duration: collapseDuration, easing: collapseEasing, fill: 'forwards' },\n );\n};\n","export const HEADING_LEVELS = [1, 2, 3, 4, 5, 6] as const;\n\nexport type HeadingLevel = typeof HEADING_LEVELS[number];\n","@use '@swisspost/design-system-styles/components/accordion';\n\n:host {\n display: block;\n}\n\n.accordion-button {\n cursor: pointer;\n\n > ::slotted(.text-truncate) {\n display: block;\n }\n}\n\npost-collapsible + post-collapsible::part(accordion-item) {\n border-block-start: 0!important;\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { collapse, expand } from '../../animations/collapse';\nimport { checkEmptyOrOneOf, checkEmptyOrType, isMotionReduced } from '../../utils';\nimport { HEADING_LEVELS, HeadingLevel } from './heading-levels';\n\n@Component({\n tag: 'post-collapsible',\n styleUrl: 'post-collapsible.scss',\n shadow: true,\n})\nexport class PostCollapsible {\n private isLoaded = false;\n private collapsible: HTMLElement;\n\n @Element() host: HTMLPostCollapsibleElement;\n\n @State() id: string;\n @State() isOpen = true;\n @State() hasHeader: boolean;\n @State() headingTag: string;\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 checkEmptyOrType(\n newValue,\n 'boolean',\n 'The `collapsed` property of the `post-collapsible` must be a boolean.',\n );\n }\n\n /**\n * Defines the hierarchical level of the collapsible header within the headings structure.\n */\n @Prop() readonly headingLevel?: HeadingLevel = 2;\n\n @Watch('headingLevel')\n validateHeadingLevel(newValue = this.headingLevel) {\n checkEmptyOrOneOf(\n newValue,\n HEADING_LEVELS,\n 'The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.',\n );\n }\n\n /**\n * An event emitted when the collapse element is shown or hidden, before the transition. It has no payload.\n */\n @Event() collapseChange: EventEmitter<void>;\n\n connectedCallback() {\n this.validateCollapsed();\n this.validateHeadingLevel();\n }\n\n componentWillRender() {\n this.id = this.host.id || `c${crypto.randomUUID()}`;\n this.hasHeader = this.host.querySelectorAll('[slot=\"header\"]').length > 0;\n this.headingTag = `h${this.headingLevel ?? 2}`;\n }\n\n componentDidLoad() {\n if (this.collapsed) void this.toggle(false);\n this.isLoaded = true;\n }\n\n /**\n * Triggers the collapse programmatically.\n *\n * If there is a collapsing transition running already, it will be reversed.\n */\n @Method()\n async toggle(open = !this.isOpen): Promise<boolean> {\n if (open === this.isOpen) return open;\n\n this.isOpen = !this.isOpen;\n if (this.isLoaded) this.collapseChange.emit();\n\n const animation = open ? expand(this.collapsible) : collapse(this.collapsible);\n\n if (!this.isLoaded || isMotionReduced()) animation.finish();\n\n await animation.finished;\n\n animation.commitStyles();\n\n return this.isOpen;\n }\n\n render() {\n const collapse = (\n <div\n aria-labelledby={this.hasHeader ? `${this.id}--header` : undefined}\n class={`collapse${this.hasHeader ? ' accordion-collapse' : ''}`}\n id={`${this.id}--collapse`}\n ref={el => (this.collapsible = el)}\n >\n {this.hasHeader ? (\n <div class=\"accordion-body\">\n <slot />\n </div>\n ) : (\n <slot />\n )}\n </div>\n );\n\n return (\n <Host id={this.id} data-version={version}>\n {this.hasHeader ? (\n <div part=\"accordion-item\" class=\"accordion-item\">\n <this.headingTag class=\"accordion-header\" id={`${this.id}--header`}>\n <button\n aria-controls={`${this.id}--collapse`}\n aria-expanded={`${this.isOpen}`}\n class={`accordion-button${this.isOpen ? '' : ' collapsed'}`}\n onClick={() => this.toggle()}\n type=\"button\"\n >\n <slot name=\"header\" />\n </button>\n </this.headingTag>\n\n {collapse}\n </div>\n ) : (\n collapse\n )}\n </Host>\n );\n }\n}\n"],"mappings":"wJAAgBA,IACd,OAAOC,OAAOC,WAAW,oCAAoCC,OAC/D,CCFA,MAAMC,EAAmB,IACzB,MAAMC,EAAiB,OACvB,MAAMC,EAA8B,CAAEC,OAAQ,IAAKC,SAAU,UAEtD,MAAMC,EAAYC,IACvB,MAAMH,OAAEA,GAAWN,OAAOU,iBAAiBD,GAC3C,MAAME,EAA6B,CAAEL,UAErC,OAAOG,EAAGG,QACR,CAACD,EAAkBN,GACnB,CAAEQ,SAAUV,EAAkBW,OAAQV,EAAgBW,KAAM,YAC7D,EAGI,MAAMC,EAAUP,IACrB,MAAME,EAA6B,CAAEL,OAAQ,GAAGG,EAAGQ,kBAEnD,OAAOR,EAAGG,QACR,CAACP,EAAmBM,GACpB,CAAEE,SAAUV,EAAkBW,OAAQV,EAAgBW,KAAM,YAC7D,ECpBI,MAAMG,EAAiB,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GCA9C,MAAMC,EAAqB,8uJ,MCsBdC,EAAe,M,wEAClBC,KAAAC,SAAW,M,8BAMD,K,kEAOqB,M,kBAcQ,C,CAX/C,iBAAAC,CAAkBC,EAAWH,KAAKI,WAChCC,EACEF,EACA,UACA,wE,CAUJ,oBAAAG,CAAqBH,EAAWH,KAAKO,cACnCC,EACEL,EACAN,EACA,0F,CASJ,iBAAAY,GACET,KAAKE,oBACLF,KAAKM,sB,CAGP,mBAAAI,G,MACEV,KAAKW,GAAKX,KAAKY,KAAKD,IAAM,IAAIE,OAAOC,eACrCd,KAAKe,UAAYf,KAAKY,KAAKI,iBAAiB,mBAAmBC,OAAS,EACxEjB,KAAKkB,WAAa,KAAIC,EAAAnB,KAAKO,gBAAY,MAAAY,SAAA,EAAAA,EAAI,G,CAG7C,gBAAAC,GACE,GAAIpB,KAAKI,eAAgBJ,KAAKqB,OAAO,OACrCrB,KAAKC,SAAW,I,CASlB,YAAMoB,CAAOC,GAAQtB,KAAKuB,QACxB,GAAID,IAAStB,KAAKuB,OAAQ,OAAOD,EAEjCtB,KAAKuB,QAAUvB,KAAKuB,OACpB,GAAIvB,KAAKC,SAAUD,KAAKwB,eAAeC,OAEvC,MAAMC,EAAYJ,EAAO3B,EAAOK,KAAK2B,aAAexC,EAASa,KAAK2B,aAElE,IAAK3B,KAAKC,UAAYvB,IAAmBgD,EAAUE,eAE7CF,EAAUG,SAEhBH,EAAUI,eAEV,OAAO9B,KAAKuB,M,CAGd,MAAAQ,GACE,MAAM5C,EACJ6C,EAAA,yBACmBhC,KAAKe,UAAY,GAAGf,KAAKW,aAAesB,UACzDC,MAAO,WAAWlC,KAAKe,UAAY,sBAAwB,KAC3DJ,GAAI,GAAGX,KAAKW,eACZwB,IAAK/C,GAAOY,KAAK2B,YAAcvC,GAE9BY,KAAKe,UACJiB,EAAA,OAAKE,MAAM,kBACTF,EAAA,cAGFA,EAAA,cAKN,OACEA,EAACI,EAAI,CAACzB,GAAIX,KAAKW,GAAE,eAAgB0B,GAC9BrC,KAAKe,UACJiB,EAAA,OAAKM,KAAK,iBAAiBJ,MAAM,kBAC/BF,EAAChC,KAAKkB,WAAU,CAACgB,MAAM,mBAAmBvB,GAAI,GAAGX,KAAKW,cACpDqB,EAAA,0BACiB,GAAGhC,KAAKW,eAAc,gBACtB,GAAGX,KAAKuB,SACvBW,MAAO,mBAAmBlC,KAAKuB,OAAS,GAAK,eAC7CgB,QAAS,IAAMvC,KAAKqB,SACpBmB,KAAK,UAELR,EAAA,QAAMS,KAAK,aAIdtD,GACG,E"}
@@ -0,0 +1,2 @@
1
+ export{P as post_tabs}from"./p-fffce1d7.js";import"./p-a7649277.js";import"./p-88262544.js";import"./p-2737eaf5.js";
2
+ //# sourceMappingURL=p-61ffffa9.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as s,h as t,H as i,g as o}from"./p-8c006e7d.js";import{v as a}from"./p-d13111f2.js";const e=":host{display:block}";const r=class{constructor(t){s(this,t);this.expandedCollapsibles=new Set;this.multiple=false}componentWillLoad(){this.registerCollapsibles()}async toggle(s){const t=this.collapsibles.find((t=>t.id===s));if(!t)throw new Error(`No post-collapsible found with id #${s}.`);await t.toggle()}collapseChangeHandler(s){const t=s.target;const i=this.expandedCollapsibles.has(t);if(i){this.expandedCollapsibles.delete(t)}else{this.expandedCollapsibles.add(t)}if(this.multiple||i)return;Array.from(this.expandedCollapsibles.values()).filter((s=>s!==t)).forEach((s=>{void s.toggle(false)}))}async expandAll(){if(this.multiple){await Promise.all(this.collapsibles.map((s=>s.toggle(true))))}else if(!this.expandedCollapsibles.size){await this.collapsibles[0].toggle(true)}}async collapseAll(){await Promise.all(this.collapsibles.map((s=>s.toggle(false))))}registerCollapsibles(){this.collapsibles=Array.from(this.host.querySelectorAll("post-collapsible"));this.collapsibles.filter((s=>!s.collapsed||this.expandedCollapsibles.has(s))).forEach(((s,t)=>{if(!this.multiple&&t!==0){s.setAttribute("collapsed","");return}this.expandedCollapsibles.add(s)}))}render(){return t(i,{"data-version":a},t("div",{class:"accordion"},t("slot",{onSlotchange:()=>this.registerCollapsibles()})))}get host(){return o(this)}};r.style=e;export{r as post_accordion};
2
- //# sourceMappingURL=p-ce907090.entry.js.map
1
+ import{r as s,h as t,H as i,g as o}from"./p-a7649277.js";import{v as a}from"./p-88262544.js";const e=":host{display:block}";const r=class{constructor(t){s(this,t);this.expandedCollapsibles=new Set;this.multiple=false}componentWillLoad(){this.registerCollapsibles()}async toggle(s){const t=this.collapsibles.find((t=>t.id===s));if(!t)throw new Error(`No post-collapsible found with id #${s}.`);await t.toggle()}collapseChangeHandler(s){const t=s.target;const i=this.expandedCollapsibles.has(t);if(i){this.expandedCollapsibles.delete(t)}else{this.expandedCollapsibles.add(t)}if(this.multiple||i)return;Array.from(this.expandedCollapsibles.values()).filter((s=>s!==t)).forEach((s=>{void s.toggle(false)}))}async expandAll(){if(this.multiple){await Promise.all(this.collapsibles.map((s=>s.toggle(true))))}else if(!this.expandedCollapsibles.size){await this.collapsibles[0].toggle(true)}}async collapseAll(){await Promise.all(this.collapsibles.map((s=>s.toggle(false))))}registerCollapsibles(){this.collapsibles=Array.from(this.host.querySelectorAll("post-collapsible"));this.collapsibles.filter((s=>!s.collapsed||this.expandedCollapsibles.has(s))).forEach(((s,t)=>{if(!this.multiple&&t!==0){s.setAttribute("collapsed","");return}this.expandedCollapsibles.add(s)}))}render(){return t(i,{"data-version":a},t("div",{class:"accordion"},t("slot",{onSlotchange:()=>this.registerCollapsibles()})))}get host(){return o(this)}};r.style=e;export{r as post_accordion};
2
+ //# sourceMappingURL=p-7b8797c6.entry.js.map
@@ -0,0 +1,2 @@
1
+ const o="1.6.3";export{o as v};
2
+ //# sourceMappingURL=p-88262544.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,c as o,h as e,H as i,g as r}from"./p-a7649277.js";import{v as a}from"./p-88262544.js";import{f as s}from"./p-2737eaf5.js";import{c as n,a as l,b as c}from"./p-dfe29f7f.js";import{c as g}from"./p-b531475e.js";const p=["primary","success","danger","warning","info","gray"];const h="/*!\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 */.alert-primary,.alert-success,.alert-danger,.alert-warning,.alert-info,.alert-gray,.alert-notification,.alert-error{background-color:rgb(var(--post-bg-rgb)) !important;color:var(--post-contrast-color) !important}.alert-success,.alert-warning,.alert-info,.alert-gray{--post-contrast-color:#000;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-primary:hsl(0, 0%, 20%);--post-white:#fff;--post-black:#000;--post-info:#cce4ee;--post-success:#2c911c;--post-warning:#f49e00;--post-danger:#a51728;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-success-green:#2c871d;--post-error-red:#a51728;--post-warning-orange:#f49e00;--post-success-background:#c0debb;--post-error-background:#ffdade;--post-warning-background:#fce2b2;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-yellow-rgb:255, 204, 0;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-primary-rgb:51, 51, 51;--post-white-rgb:255, 255, 255;--post-black-rgb:0, 0, 0;--post-info-rgb:204, 228, 238;--post-success-rgb:44, 145, 28;--post-warning-rgb:244, 158, 0;--post-danger-rgb:165, 23, 40;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160;--post-success-green-rgb:44, 135, 29;--post-error-red-rgb:165, 23, 40;--post-warning-orange-rgb:244, 158, 0;--post-success-background-rgb:192, 222, 187;--post-error-background-rgb:255, 218, 222;--post-warning-background-rgb:252, 226, 178}.alert-primary,.alert-danger,.alert-notification,.alert-error{--post-contrast-color:#fff;--post-contrast-color-inverted:#000;--post-dark:#faf9f8;--post-light:hsl(0, 0%, 20%);--post-gray-80:hsl(0, 0%, 90%);--post-gray-60:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-20:hsl(0, 0%, 40%);--post-gray-10:hsl(0, 0%, 20%);--post-contrast-color-rgb:255, 255, 255;--post-contrast-color-inverted-rgb:0, 0, 0;--post-dark-rgb:250, 249, 248;--post-light-rgb:51, 51, 51;--post-gray-80-rgb:230, 230, 230;--post-gray-60-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-20-rgb:102, 102, 102;--post-gray-10-rgb:51, 51, 51}.alert{position:relative;box-sizing:border-box;min-height:5rem;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);border-radius:4px;padding:1rem 1.25rem;padding-inline-start:5.5rem;margin-block-end:1rem;font-size:1rem;font-weight:300}.alert.no-icon{min-height:3.5rem;padding-inline-start:1.25rem}.alert[class^=pi-],.alert[class*=\" pi-\"]{background-size:3rem;background-position:1.25rem 1rem;background-repeat:no-repeat}.alert[class^=pi-].no-icon,.alert[class*=\" pi-\"].no-icon{background-image:none}.alert::before{content:\"\";display:block}.alert::before,.alert>post-icon{position:absolute;height:3rem;width:3rem;left:1.25rem;top:1rem}.alert.no-icon::before,.alert[class^=pi-]::before,.alert[class*=\" pi-\"]::before{content:unset}.alert.no-icon>post-icon,.alert[class^=pi-]>post-icon,.alert[class*=\" pi-\"]>post-icon{display:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.alert{filter:none !important;background-color:rgba(0,0,0,0) !important;border:2px solid WindowText}}.alert:not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert:not(.alert-action) a{font-weight:400}.alert:not(.alert-action) hr{margin-block:.5rem .75rem !important}.alert:not(.alert-action)>:only-child,.alert:not(.alert-action)>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert:not(.alert-action)>*{margin:0}.alert-heading{font-size:1.0625rem;font-weight:700}.alert-dismissible{pointer-events:auto;position:relative;padding-inline-end:4rem}.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:1.25rem}.alert-dismissible>.btn-close:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action{display:flex;flex-direction:row;align-items:center;gap:1.25rem}.alert-action>.alert-content{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert-action>.alert-content a{font-weight:400}.alert-action>.alert-content hr{margin-block:.5rem .75rem !important}.alert-action>.alert-content>:only-child,.alert-action>.alert-content>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action>.alert-content>*{margin:0}.alert-action>.alert-buttons{flex:0 0 auto;display:flex;align-items:center;gap:.5rem}@media (min-width: 780px){.alert-action.alert-dismissible>.btn-close{inset-block-start:calc(50% - 0.75rem)}}@media (max-width: 779.98px){.alert-action{flex-direction:column;align-items:stretch;padding-inline:1.25rem}.alert-action>.alert-content{padding-inline-start:4.25rem;padding-inline-end:2.75rem}.alert-action>.alert-buttons{display:flex}.alert-action>.alert-buttons>.btn{flex:1 0 0;width:100%}.alert-action>.alert-buttons>.btn:first-child{margin-inline-start:0}}.alert-fixed-bottom{position:fixed;inset-block-end:0;inset-inline-start:0;inset-inline-end:0;margin-bottom:0;border-radius:0;z-index:1030}@media (min-width: 1441px){.alert-fixed-bottom{padding-inline-end:calc((100% - 1440px) / 2 + 120px + 1.25rem);padding-inline-start:calc(\n (100% - 1440px) / 2 + 120px + 1.25rem + 3rem + 1.25rem\n );background-position-x:calc((100% - 1440px) / 2 + 120px + 1.25rem + 1.5rem)}.alert-fixed-bottom::before{left:calc((100% - 1440px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.no-icon{padding-inline-start:calc((100% - 1440px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.alert-dismissible{padding-inline-end:calc(\n (100% - 1440px) / 2 + 120px + 1.25rem + 1.25rem + 1.5rem\n )}.alert-fixed-bottom.alert-dismissible>.btn-close{inset-inline-end:calc((100% - 1440px) / 2 + 120px + 1.25rem)}}.alert-primary{--post-bg-rgb:51, 51, 51}.alert-primary:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18H3.2z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18H3.2z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-primary:has(>post-icon)::before{content:none}.alert-primary>post-icon{background-color:#333}.alert-success{--post-bg-rgb:44, 145, 28}.alert-success:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-success:has(>post-icon)::before{content:none}.alert-success>post-icon{background-color:#2c911c}.alert-danger{--post-bg-rgb:165, 23, 40}.alert-danger:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-danger:has(>post-icon)::before{content:none}.alert-danger>post-icon{background-color:#a51728}.alert-warning{--post-bg-rgb:244, 158, 0}.alert-warning:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-warning:has(>post-icon)::before{content:none}.alert-warning>post-icon{background-color:#f49e00}.alert-info{--post-bg-rgb:204, 228, 238}.alert-info:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-info:has(>post-icon)::before{content:none}.alert-info>post-icon{background-color:#cce4ee}.alert-gray{--post-bg-rgb:244, 243, 241}.alert-gray:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-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='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.241 5.241 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.241 5.241 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.325 6.325 0 0 0-.325 1.997 6.598 6.598 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.19 13.19 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.647 11.647 0 0 0 2.359-.888.668.668 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.798 11.798 0 0 0 4 15.92z'/%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='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.241 5.241 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.241 5.241 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.325 6.325 0 0 0-.325 1.997 6.598 6.598 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.19 13.19 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.647 11.647 0 0 0 2.359-.888.668.668 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.798 11.798 0 0 0 4 15.92z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-gray:has(>post-icon)::before{content:none}.alert-gray>post-icon{background-color:#f4f3f1}.alert-notification{--post-bg-rgb:51, 51, 51}.alert-notification:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18H3.2z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18H3.2z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-notification:has(>post-icon)::before{content:none}.alert-notification>post-icon{background-color:#333}.alert-error{--post-bg-rgb:165, 23, 40}.alert-error:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor}.alert-error:has(>post-icon)::before{content:none}.alert-error>post-icon{background-color:#a51728}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.btn-close::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;content:\"\";display:block;height:1.5rem;width:1.5rem}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}:host ::slotted(*){margin:0 !important}.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption){position:absolute !important}.alert-heading>::slotted(h1){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h2){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h3){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h4){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h5){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h6){font-size:inherit !important;font-weight:inherit !important}";const d=class{constructor(e){t(this,e);this.dismissed=o(this,"dismissed",7);this.alertId=crypto.randomUUID();this.classes=undefined;this.hasActions=undefined;this.hasHeading=undefined;this.onDismissButtonClick=()=>this.dismiss();this.dismissible=false;this.dismissLabel=undefined;this.fixed=false;this.icon=undefined;this.type="primary"}validateDismissible(t=this.dismissible){n(t,"boolean",'The post-alert "dismissible" prop should be a boolean.');setTimeout((()=>this.validateDismissLabel()))}validateDismissLabel(t=this.dismissLabel){if(this.dismissible){g(t,'Dismissible post-alert\'s require a "dismiss-label" prop.')}}validateFixed(t=this.fixed){n(t,"boolean",'The post-alert "fixed" prop should be a boolean.')}validateIcon(t=this.icon){l(t,/\d{4}|none/,'The post-alert "icon" prop should be a 4-digits string.')}validateType(t=this.type){c(t,p,`The post-alert requires a type form: ${p.join(", ")}`)}connectedCallback(){this.validateDismissible();this.validateFixed();this.validateIcon();this.validateType()}componentWillRender(){var t;this.hasHeading=this.host.querySelectorAll("[slot=heading]").length>0;this.hasActions=this.host.querySelectorAll("[slot=actions]").length>0;this.classes=`alert alert-${(t=this.type)!==null&&t!==void 0?t:"primary"}`;if(this.dismissible)this.classes+=" alert-dismissible";if(this.hasActions)this.classes+=" alert-action";if(this.fixed)this.classes+=" alert-fixed-bottom";if(this.icon==="none")this.classes+=" no-icon"}async dismiss(){const t=s(this.host);await t.finished;this.host.remove();this.dismissed.emit()}render(){const t=[this.hasHeading&&e("div",{key:`${this.alertId}-heading`,class:"alert-heading"},e("slot",{name:"heading"})),e("slot",{key:`${this.alertId}-message`})];const o=[e("div",{key:`${this.alertId}-content`,class:"alert-content"},t),e("div",{key:`${this.alertId}-buttons`,class:"alert-buttons"},e("slot",{name:"actions"}))];return e(i,{"data-version":a},e("div",{role:"alert",class:this.classes},this.dismissible&&e("button",{class:"btn-close",onClick:this.onDismissButtonClick},e("span",{class:"visually-hidden"},this.dismissLabel)),this.icon&&this.icon!=="none"&&e("post-icon",{key:`${this.alertId}-icon`,name:this.icon}),this.hasActions?o:t))}get host(){return r(this)}static get watchers(){return{dismissible:["validateDismissible"],dismissLabel:["validateDismissLabel"],fixed:["validateFixed"],icon:["validateIcon"],type:["validateType"]}}};d.style=h;export{d as P};
2
+ //# sourceMappingURL=p-8b6fe20d.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ALERT_TYPES","postAlertCss","PostAlert","crypto","randomUUID","this","dismiss","validateDismissible","isDismissible","dismissible","checkType","setTimeout","validateDismissLabel","dismissLabel","checkNonEmpty","validateFixed","isFixed","fixed","validateIcon","icon","checkEmptyOrPattern","validateType","type","checkEmptyOrOneOf","join","connectedCallback","componentWillRender","hasHeading","host","querySelectorAll","length","hasActions","classes","_a","dismissal","fadeOut","finished","remove","dismissed","emit","render","defaultAlertContent","h","key","alertId","class","name","actionAlertContent","Host","version","role","onClick","onDismissButtonClick"],"sources":["src/components/post-alert/alert-types.ts","src/components/post-alert/post-alert.scss?tag=post-alert&encapsulation=shadow","src/components/post-alert/post-alert.tsx"],"sourcesContent":["export const ALERT_TYPES = ['primary', 'success', 'danger', 'warning', 'info', 'gray'] as const;\n\nexport type AlertType = typeof ALERT_TYPES[number];\n","@use '@swisspost/design-system-styles/components/alert';\n@use '@swisspost/design-system-styles/components/close';\n@use '@swisspost/design-system-styles/core' as post;\n\n:host {\n display: block;\n\n ::slotted(*) {\n margin: 0 !important;\n }\n}\n\n.visually-hidden {\n @include post.visually-hidden();\n}\n\n@for $i from 1 through 6 {\n .alert-heading > ::slotted(h#{$i}) {\n font-size: inherit !important;\n font-weight: inherit !important;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { fadeOut } from '../../animations';\nimport { checkEmptyOrOneOf, checkEmptyOrPattern, checkNonEmpty, checkType } from '../../utils';\nimport { ALERT_TYPES, AlertType } from './alert-types';\n\n@Component({\n tag: 'post-alert',\n styleUrl: 'post-alert.scss',\n shadow: true,\n})\nexport class PostAlert {\n @Element() host: HTMLPostAlertElement;\n\n @State() alertId = crypto.randomUUID();\n @State() classes: string;\n @State() hasActions: boolean;\n @State() hasHeading: boolean;\n @State() onDismissButtonClick = () => this.dismiss();\n\n /**\n * If `true`, a close button (×) is displayed and the alert can be dismissed by the user.\n */\n @Prop() readonly dismissible: boolean = false;\n\n @Watch('dismissible')\n validateDismissible(isDismissible = this.dismissible) {\n checkType(isDismissible, 'boolean', 'The post-alert \"dismissible\" prop should be a boolean.');\n setTimeout(() => this.validateDismissLabel());\n }\n\n /**\n * The label to use for the close button of a dismissible alert.\n */\n @Prop() readonly dismissLabel: string;\n\n @Watch('dismissLabel')\n validateDismissLabel(dismissLabel = this.dismissLabel) {\n if (this.dismissible) {\n checkNonEmpty(dismissLabel, 'Dismissible post-alert\\'s require a \"dismiss-label\" prop.');\n }\n }\n\n /**\n * If `true`, the alert is positioned at the bottom of the window, from edge to edge.\n */\n @Prop() readonly fixed: boolean = false;\n\n @Watch('fixed')\n validateFixed(isFixed = this.fixed) {\n checkType(isFixed, 'boolean', 'The post-alert \"fixed\" prop should be a boolean.');\n }\n\n /**\n * The icon to display in the alert. By default, the icon depends on the alert type.\n *\n * If `none`, no icon is displayed.\n */\n @Prop() readonly icon: string;\n\n @Watch('icon')\n validateIcon(icon = this.icon) {\n checkEmptyOrPattern(icon, /\\d{4}|none/, 'The post-alert \"icon\" prop should be a 4-digits string.');\n }\n\n /**\n * The type of the alert.\n */\n @Prop() readonly type: AlertType = 'primary';\n\n @Watch('type')\n validateType(type = this.type) {\n checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);\n }\n\n /**\n * An event emitted when the alert element is dismissed, after the transition.\n * It has no payload and only relevant for dismissible alerts.\n */\n @Event() dismissed: EventEmitter<void>;\n\n connectedCallback() {\n this.validateDismissible();\n this.validateFixed();\n this.validateIcon();\n this.validateType();\n }\n\n componentWillRender() {\n this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;\n this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;\n\n this.classes = `alert alert-${this.type ?? 'primary'}`;\n if (this.dismissible) this.classes += ' alert-dismissible';\n if (this.hasActions) this.classes += ' alert-action';\n if (this.fixed) this.classes += ' alert-fixed-bottom';\n if (this.icon === 'none') this.classes += ' no-icon';\n }\n\n /**\n * Triggers alert dismissal programmatically (same as clicking on the close button (×)).\n */\n @Method()\n async dismiss() {\n const dismissal = fadeOut(this.host);\n\n await dismissal.finished;\n\n this.host.remove();\n this.dismissed.emit();\n }\n\n render() {\n const defaultAlertContent = [\n this.hasHeading && (\n <div key={`${this.alertId}-heading`} class=\"alert-heading\">\n <slot name=\"heading\"/>\n </div>\n ),\n <slot key={`${this.alertId}-message`}/>\n ];\n\n const actionAlertContent = [\n <div key={`${this.alertId}-content`} class=\"alert-content\">\n {defaultAlertContent}\n </div>,\n <div key={`${this.alertId}-buttons`} class=\"alert-buttons\">\n <slot name=\"actions\"/>\n </div>,\n ];\n\n return (\n <Host data-version={version}>\n <div role=\"alert\" class={this.classes}>\n {this.dismissible && (\n <button class=\"btn-close\" onClick={this.onDismissButtonClick}>\n <span class=\"visually-hidden\">{this.dismissLabel}</span>\n </button>\n )}\n\n {this.icon && this.icon !== 'none' && (\n <post-icon key={`${this.alertId}-icon`} name={this.icon} />\n )}\n\n {this.hasActions\n ? actionAlertContent\n : defaultAlertContent\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":"8NAAO,MAAMA,EAAc,CAAC,UAAW,UAAW,SAAU,UAAW,OAAQ,QCA/E,MAAMC,EAAe,w5mB,MCWRC,EAAS,M,2EAGDC,OAAOC,a,qGAIM,IAAMC,KAAKC,U,iBAKH,M,uCAuBN,M,8BAsBC,S,CA1CnC,mBAAAC,CAAoBC,EAAgBH,KAAKI,aACvCC,EAAUF,EAAe,UAAW,0DACpCG,YAAW,IAAMN,KAAKO,wB,CASxB,oBAAAA,CAAqBC,EAAeR,KAAKQ,cACvC,GAAIR,KAAKI,YAAa,CACpBK,EAAcD,EAAc,4D,EAUhC,aAAAE,CAAcC,EAAUX,KAAKY,OAC3BP,EAAUM,EAAS,UAAW,mD,CAWhC,YAAAE,CAAaC,EAAOd,KAAKc,MACvBC,EAAoBD,EAAM,aAAc,0D,CAS1C,YAAAE,CAAaC,EAAOjB,KAAKiB,MACvBC,EAAkBD,EAAMtB,EAAa,wCAAwCA,EAAYwB,KAAK,Q,CAShG,iBAAAC,GACEpB,KAAKE,sBACLF,KAAKU,gBACLV,KAAKa,eACLb,KAAKgB,c,CAGP,mBAAAK,G,MACErB,KAAKsB,WAAatB,KAAKuB,KAAKC,iBAAiB,kBAAkBC,OAAS,EACxEzB,KAAK0B,WAAa1B,KAAKuB,KAAKC,iBAAiB,kBAAkBC,OAAS,EAExEzB,KAAK2B,QAAU,gBAAeC,EAAA5B,KAAKiB,QAAI,MAAAW,SAAA,EAAAA,EAAI,YAC3C,GAAI5B,KAAKI,YAAaJ,KAAK2B,SAAW,qBACtC,GAAI3B,KAAK0B,WAAY1B,KAAK2B,SAAW,gBACrC,GAAI3B,KAAKY,MAAOZ,KAAK2B,SAAW,sBAChC,GAAI3B,KAAKc,OAAS,OAAQd,KAAK2B,SAAW,U,CAO5C,aAAM1B,GACJ,MAAM4B,EAAYC,EAAQ9B,KAAKuB,YAEzBM,EAAUE,SAEhB/B,KAAKuB,KAAKS,SACVhC,KAAKiC,UAAUC,M,CAGjB,MAAAC,GACE,MAAMC,EAAsB,CAC1BpC,KAAKsB,YACHe,EAAA,OAAKC,IAAK,GAAGtC,KAAKuC,kBAAmBC,MAAM,iBACzCH,EAAA,QAAMI,KAAK,aAGfJ,EAAA,QAAMC,IAAK,GAAGtC,KAAKuC,qBAGrB,MAAMG,EAAqB,CACzBL,EAAA,OAAKC,IAAK,GAAGtC,KAAKuC,kBAAmBC,MAAM,iBACxCJ,GAEHC,EAAA,OAAKC,IAAK,GAAGtC,KAAKuC,kBAAmBC,MAAM,iBACzCH,EAAA,QAAMI,KAAK,cAIf,OACEJ,EAACM,EAAI,gBAAeC,GAClBP,EAAA,OAAKQ,KAAK,QAAQL,MAAOxC,KAAK2B,SAC3B3B,KAAKI,aACJiC,EAAA,UAAQG,MAAM,YAAYM,QAAS9C,KAAK+C,sBACtCV,EAAA,QAAMG,MAAM,mBAAmBxC,KAAKQ,eAIvCR,KAAKc,MAAQd,KAAKc,OAAS,QAC1BuB,EAAA,aAAWC,IAAK,GAAGtC,KAAKuC,eAAgBE,KAAMzC,KAAKc,OAGpDd,KAAK0B,WACFgB,EACAN,G"}
1
+ {"version":3,"names":["ALERT_TYPES","postAlertCss","PostAlert","crypto","randomUUID","this","dismiss","validateDismissible","isDismissible","dismissible","checkType","setTimeout","validateDismissLabel","dismissLabel","checkNonEmpty","validateFixed","isFixed","fixed","validateIcon","icon","checkEmptyOrPattern","validateType","type","checkEmptyOrOneOf","join","connectedCallback","componentWillRender","hasHeading","host","querySelectorAll","length","hasActions","classes","_a","dismissal","fadeOut","finished","remove","dismissed","emit","render","defaultAlertContent","h","key","alertId","class","name","actionAlertContent","Host","version","role","onClick","onDismissButtonClick"],"sources":["src/components/post-alert/alert-types.ts","src/components/post-alert/post-alert.scss?tag=post-alert&encapsulation=shadow","src/components/post-alert/post-alert.tsx"],"sourcesContent":["export const ALERT_TYPES = ['primary', 'success', 'danger', 'warning', 'info', 'gray'] as const;\n\nexport type AlertType = typeof ALERT_TYPES[number];\n","@use '@swisspost/design-system-styles/components/alert';\n@use '@swisspost/design-system-styles/components/close';\n@use '@swisspost/design-system-styles/core' as post;\n\n:host {\n display: block;\n\n ::slotted(*) {\n margin: 0 !important;\n }\n}\n\n.visually-hidden {\n @include post.visually-hidden();\n}\n\n@for $i from 1 through 6 {\n .alert-heading > ::slotted(h#{$i}) {\n font-size: inherit !important;\n font-weight: inherit !important;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { fadeOut } from '../../animations';\nimport { checkEmptyOrOneOf, checkEmptyOrPattern, checkNonEmpty, checkType } from '../../utils';\nimport { ALERT_TYPES, AlertType } from './alert-types';\n\n@Component({\n tag: 'post-alert',\n styleUrl: 'post-alert.scss',\n shadow: true,\n})\nexport class PostAlert {\n @Element() host: HTMLPostAlertElement;\n\n @State() alertId = crypto.randomUUID();\n @State() classes: string;\n @State() hasActions: boolean;\n @State() hasHeading: boolean;\n @State() onDismissButtonClick = () => this.dismiss();\n\n /**\n * If `true`, a close button (×) is displayed and the alert can be dismissed by the user.\n */\n @Prop() readonly dismissible: boolean = false;\n\n @Watch('dismissible')\n validateDismissible(isDismissible = this.dismissible) {\n checkType(isDismissible, 'boolean', 'The post-alert \"dismissible\" prop should be a boolean.');\n setTimeout(() => this.validateDismissLabel());\n }\n\n /**\n * The label to use for the close button of a dismissible alert.\n */\n @Prop() readonly dismissLabel: string;\n\n @Watch('dismissLabel')\n validateDismissLabel(dismissLabel = this.dismissLabel) {\n if (this.dismissible) {\n checkNonEmpty(dismissLabel, 'Dismissible post-alert\\'s require a \"dismiss-label\" prop.');\n }\n }\n\n /**\n * If `true`, the alert is positioned at the bottom of the window, from edge to edge.\n */\n @Prop() readonly fixed: boolean = false;\n\n @Watch('fixed')\n validateFixed(isFixed = this.fixed) {\n checkType(isFixed, 'boolean', 'The post-alert \"fixed\" prop should be a boolean.');\n }\n\n /**\n * The icon to display in the alert. By default, the icon depends on the alert type.\n *\n * If `none`, no icon is displayed.\n */\n @Prop() readonly icon: string;\n\n @Watch('icon')\n validateIcon(icon = this.icon) {\n checkEmptyOrPattern(icon, /\\d{4}|none/, 'The post-alert \"icon\" prop should be a 4-digits string.');\n }\n\n /**\n * The type of the alert.\n */\n @Prop() readonly type: AlertType = 'primary';\n\n @Watch('type')\n validateType(type = this.type) {\n checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);\n }\n\n /**\n * An event emitted when the alert element is dismissed, after the transition.\n * It has no payload and only relevant for dismissible alerts.\n */\n @Event() dismissed: EventEmitter<void>;\n\n connectedCallback() {\n this.validateDismissible();\n this.validateFixed();\n this.validateIcon();\n this.validateType();\n }\n\n componentWillRender() {\n this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;\n this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;\n\n this.classes = `alert alert-${this.type ?? 'primary'}`;\n if (this.dismissible) this.classes += ' alert-dismissible';\n if (this.hasActions) this.classes += ' alert-action';\n if (this.fixed) this.classes += ' alert-fixed-bottom';\n if (this.icon === 'none') this.classes += ' no-icon';\n }\n\n /**\n * Triggers alert dismissal programmatically (same as clicking on the close button (×)).\n */\n @Method()\n async dismiss() {\n const dismissal = fadeOut(this.host);\n\n await dismissal.finished;\n\n this.host.remove();\n this.dismissed.emit();\n }\n\n render() {\n const defaultAlertContent = [\n this.hasHeading && (\n <div key={`${this.alertId}-heading`} class=\"alert-heading\">\n <slot name=\"heading\"/>\n </div>\n ),\n <slot key={`${this.alertId}-message`}/>\n ];\n\n const actionAlertContent = [\n <div key={`${this.alertId}-content`} class=\"alert-content\">\n {defaultAlertContent}\n </div>,\n <div key={`${this.alertId}-buttons`} class=\"alert-buttons\">\n <slot name=\"actions\"/>\n </div>,\n ];\n\n return (\n <Host data-version={version}>\n <div role=\"alert\" class={this.classes}>\n {this.dismissible && (\n <button class=\"btn-close\" onClick={this.onDismissButtonClick}>\n <span class=\"visually-hidden\">{this.dismissLabel}</span>\n </button>\n )}\n\n {this.icon && this.icon !== 'none' && (\n <post-icon key={`${this.alertId}-icon`} name={this.icon} />\n )}\n\n {this.hasActions\n ? actionAlertContent\n : defaultAlertContent\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":"8NAAO,MAAMA,EAAc,CAAC,UAAW,UAAW,SAAU,UAAW,OAAQ,QCA/E,MAAMC,EAAe,ktnB,MCWRC,EAAS,M,2EAGDC,OAAOC,a,qGAIM,IAAMC,KAAKC,U,iBAKH,M,uCAuBN,M,8BAsBC,S,CA1CnC,mBAAAC,CAAoBC,EAAgBH,KAAKI,aACvCC,EAAUF,EAAe,UAAW,0DACpCG,YAAW,IAAMN,KAAKO,wB,CASxB,oBAAAA,CAAqBC,EAAeR,KAAKQ,cACvC,GAAIR,KAAKI,YAAa,CACpBK,EAAcD,EAAc,4D,EAUhC,aAAAE,CAAcC,EAAUX,KAAKY,OAC3BP,EAAUM,EAAS,UAAW,mD,CAWhC,YAAAE,CAAaC,EAAOd,KAAKc,MACvBC,EAAoBD,EAAM,aAAc,0D,CAS1C,YAAAE,CAAaC,EAAOjB,KAAKiB,MACvBC,EAAkBD,EAAMtB,EAAa,wCAAwCA,EAAYwB,KAAK,Q,CAShG,iBAAAC,GACEpB,KAAKE,sBACLF,KAAKU,gBACLV,KAAKa,eACLb,KAAKgB,c,CAGP,mBAAAK,G,MACErB,KAAKsB,WAAatB,KAAKuB,KAAKC,iBAAiB,kBAAkBC,OAAS,EACxEzB,KAAK0B,WAAa1B,KAAKuB,KAAKC,iBAAiB,kBAAkBC,OAAS,EAExEzB,KAAK2B,QAAU,gBAAeC,EAAA5B,KAAKiB,QAAI,MAAAW,SAAA,EAAAA,EAAI,YAC3C,GAAI5B,KAAKI,YAAaJ,KAAK2B,SAAW,qBACtC,GAAI3B,KAAK0B,WAAY1B,KAAK2B,SAAW,gBACrC,GAAI3B,KAAKY,MAAOZ,KAAK2B,SAAW,sBAChC,GAAI3B,KAAKc,OAAS,OAAQd,KAAK2B,SAAW,U,CAO5C,aAAM1B,GACJ,MAAM4B,EAAYC,EAAQ9B,KAAKuB,YAEzBM,EAAUE,SAEhB/B,KAAKuB,KAAKS,SACVhC,KAAKiC,UAAUC,M,CAGjB,MAAAC,GACE,MAAMC,EAAsB,CAC1BpC,KAAKsB,YACHe,EAAA,OAAKC,IAAK,GAAGtC,KAAKuC,kBAAmBC,MAAM,iBACzCH,EAAA,QAAMI,KAAK,aAGfJ,EAAA,QAAMC,IAAK,GAAGtC,KAAKuC,qBAGrB,MAAMG,EAAqB,CACzBL,EAAA,OAAKC,IAAK,GAAGtC,KAAKuC,kBAAmBC,MAAM,iBACxCJ,GAEHC,EAAA,OAAKC,IAAK,GAAGtC,KAAKuC,kBAAmBC,MAAM,iBACzCH,EAAA,QAAMI,KAAK,cAIf,OACEJ,EAACM,EAAI,gBAAeC,GAClBP,EAAA,OAAKQ,KAAK,QAAQL,MAAOxC,KAAK2B,SAC3B3B,KAAKI,aACJiC,EAAA,UAAQG,MAAM,YAAYM,QAAS9C,KAAK+C,sBACtCV,EAAA,QAAMG,MAAM,mBAAmBxC,KAAKQ,eAIvCR,KAAKc,MAAQd,KAAKc,OAAS,QAC1BuB,EAAA,aAAWC,IAAK,GAAGtC,KAAKuC,eAAgBE,KAAMzC,KAAKc,OAGpDd,KAAK0B,WACFgB,EACAN,G"}
@@ -0,0 +1,2 @@
1
+ import{r as s,h as t,H as n,g as o}from"./p-a7649277.js";import{v as a}from"./p-88262544.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 P};
2
+ //# sourceMappingURL=p-9f71d450.js.map
@@ -0,0 +1,3 @@
1
+ const t="post-components";let e;let n;let s=false;let o=false;const l=(t,e="")=>{{return()=>{}}};const c=(t,e)=>{{return()=>{}}};const i="{visibility:hidden}.hydrated{visibility:inherit}";const f={};const r="http://www.w3.org/2000/svg";const u="http://www.w3.org/1999/xhtml";const a=t=>t!=null;const d=t=>{t=typeof t;return t==="object"||t==="function"};function p(t){var e,n,s;return(s=(n=(e=t.head)===null||e===void 0?void 0:e.querySelector('meta[name="csp-nonce"]'))===null||n===void 0?void 0:n.getAttribute("content"))!==null&&s!==void 0?s:undefined}const h=(t,e,...n)=>{let s=null;let o=null;let l=false;let c=false;const i=[];const f=e=>{for(let n=0;n<e.length;n++){s=e[n];if(Array.isArray(s)){f(s)}else if(s!=null&&typeof s!=="boolean"){if(l=typeof t!=="function"&&!d(s)){s=String(s)}if(l&&c){i[i.length-1].t+=s}else{i.push(l?y(null,s):s)}c=l}}};f(n);if(e){if(e.key){o=e.key}{const t=e.className||e.class;if(t){e.class=typeof t!=="object"?t:Object.keys(t).filter((e=>t[e])).join(" ")}}}if(typeof t==="function"){return t(e===null?{}:e,i,b)}const r=y(t,null);r.o=e;if(i.length>0){r.l=i}{r.i=o}return r};const y=(t,e)=>{const n={u:0,p:t,t:e,h:null,l:null};{n.o=null}{n.i=null}return n};const v={};const m=t=>t&&t.p===v;const b={forEach:(t,e)=>t.map(w).forEach(e),map:(t,e)=>t.map(w).map(e).map($)};const w=t=>({vattrs:t.o,vchildren:t.l,vkey:t.i,vname:t.v,vtag:t.p,vtext:t.t});const $=t=>{if(typeof t.vtag==="function"){const e=Object.assign({},t.vattrs);if(t.vkey){e.key=t.vkey}if(t.vname){e.name=t.vname}return h(t.vtag,e,...t.vchildren||[])}const e=y(t.vtag,t.vtext);e.o=t.vattrs;e.l=t.vchildren;e.i=t.vkey;e.v=t.vname;return e};const g=(t,e)=>{if(t!=null&&!d(t)){if(e&4){return t==="false"?false:t===""||!!t}if(e&2){return parseFloat(t)}if(e&1){return String(t)}return t}return t};const S=t=>pt(t).$hostElement$;const j=(t,e,n)=>{const s=S(t);return{emit:t=>k(s,e,{bubbles:!!(n&4),composed:!!(n&2),cancelable:!!(n&1),detail:t})}};const k=(t,e,n)=>{const s=jt.ce(e,n);t.dispatchEvent(s);return s};const O=new WeakMap;const C=(t,e,n)=>{let s=$t.get(t);if(Ot&&n){s=s||new CSSStyleSheet;if(typeof s==="string"){s=e}else{s.replaceSync(e)}}else{s=e}$t.set(t,s)};const M=(t,e,n)=>{var s;const o=x(e);const l=$t.get(o);t=t.nodeType===11?t:St;if(l){if(typeof l==="string"){t=t.head||t;let e=O.get(t);let n;if(!e){O.set(t,e=new Set)}if(!e.has(o)){{n=St.createElement("style");n.innerHTML=l;const e=(s=jt.m)!==null&&s!==void 0?s:p(St);if(e!=null){n.setAttribute("nonce",e)}t.insertBefore(n,t.querySelector("link"))}if(e){e.add(o)}}}else if(!t.adoptedStyleSheets.includes(l)){t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]}}return o};const P=t=>{const e=t.$;const n=t.$hostElement$;const s=e.u;const o=l("attachStyles",e.S);const c=M(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);if(s&10){n["s-sc"]=c;n.classList.add(c+"-h")}o()};const x=(t,e)=>"sc-"+t.S;const E=(t,e,n,s,o,l)=>{if(n!==s){let c=vt(t,e);let i=e.toLowerCase();if(e==="class"){const e=t.classList;const o=U(n);const l=U(s);e.remove(...o.filter((t=>t&&!l.includes(t))));e.add(...l.filter((t=>t&&!o.includes(t))))}else if(e==="style"){{for(const e in n){if(!s||s[e]==null){if(e.includes("-")){t.style.removeProperty(e)}else{t.style[e]=""}}}}for(const e in s){if(!n||s[e]!==n[e]){if(e.includes("-")){t.style.setProperty(e,s[e])}else{t.style[e]=s[e]}}}}else if(e==="key");else if(e==="ref"){if(s){s(t)}}else if(!c&&e[0]==="o"&&e[1]==="n"){if(e[2]==="-"){e=e.slice(3)}else if(vt(gt,i)){e=i.slice(2)}else{e=i[2]+e.slice(3)}if(n){jt.rel(t,e,n,false)}if(s){jt.ael(t,e,s,false)}}else{const i=d(s);if((c||i&&s!==null)&&!o){try{if(!t.tagName.includes("-")){const o=s==null?"":s;if(e==="list"){c=false}else if(n==null||t[e]!=o){t[e]=o}}else{t[e]=s}}catch(t){}}if(s==null||s===false){if(s!==false||t.getAttribute(e)===""){{t.removeAttribute(e)}}}else if((!c||l&4||o)&&!i){s=s===true?"":s;{t.setAttribute(e,s)}}}}};const L=/\s/;const U=t=>!t?[]:t.split(L);const W=(t,e,n,s)=>{const o=e.h.nodeType===11&&e.h.host?e.h.host:e.h;const l=t&&t.o||f;const c=e.o||f;{for(s in l){if(!(s in c)){E(o,s,l[s],undefined,n,e.u)}}}for(s in c){E(o,s,l[s],c[s],n,e.u)}};const A=(t,n,o,l)=>{const c=n.l[o];let i=0;let f;let d;if(c.t!==null){f=c.h=St.createTextNode(c.t)}else{if(!s){s=c.p==="svg"}f=c.h=St.createElementNS(s?r:u,c.p);if(s&&c.p==="foreignObject"){s=false}{W(null,c,s)}if(a(e)&&f["s-si"]!==e){f.classList.add(f["s-si"]=e)}if(c.l){for(i=0;i<c.l.length;++i){d=A(t,c,i);if(d){f.appendChild(d)}}}{if(c.p==="svg"){s=false}else if(f.tagName==="foreignObject"){s=true}}}return f};const N=(t,e,s,o,l,c)=>{let i=t;let f;if(i.shadowRoot&&i.tagName===n){i=i.shadowRoot}for(;l<=c;++l){if(o[l]){f=A(null,s,l);if(f){o[l].h=f;i.insertBefore(f,e)}}}};const R=(t,e,n)=>{for(let s=e;s<=n;++s){const e=t[s];if(e){const t=e.h;q(e);if(t){t.remove()}}}};const T=(t,e,n,s)=>{let o=0;let l=0;let c=0;let i=0;let f=e.length-1;let r=e[0];let u=e[f];let a=s.length-1;let d=s[0];let p=s[a];let h;let y;while(o<=f&&l<=a){if(r==null){r=e[++o]}else if(u==null){u=e[--f]}else if(d==null){d=s[++l]}else if(p==null){p=s[--a]}else if(F(r,d)){H(r,d);r=e[++o];d=s[++l]}else if(F(u,p)){H(u,p);u=e[--f];p=s[--a]}else if(F(r,p)){H(r,p);t.insertBefore(r.h,u.h.nextSibling);r=e[++o];p=s[--a]}else if(F(u,d)){H(u,d);t.insertBefore(u.h,r.h);u=e[--f];d=s[++l]}else{c=-1;{for(i=o;i<=f;++i){if(e[i]&&e[i].i!==null&&e[i].i===d.i){c=i;break}}}if(c>=0){y=e[c];if(y.p!==d.p){h=A(e&&e[l],n,c)}else{H(y,d);e[c]=undefined;h=y.h}d=s[++l]}else{h=A(e&&e[l],n,l);d=s[++l]}if(h){{r.h.parentNode.insertBefore(h,r.h)}}}}if(o>f){N(t,s[a+1]==null?null:s[a+1].h,n,s,l,a)}else if(l>a){R(e,o,f)}};const F=(t,e)=>{if(t.p===e.p){{return t.i===e.i}}return false};const H=(t,e)=>{const n=e.h=t.h;const o=t.l;const l=e.l;const c=e.p;const i=e.t;if(i===null){{s=c==="svg"?true:c==="foreignObject"?false:s}{if(c==="slot");else{W(t,e,s)}}if(o!==null&&l!==null){T(n,o,e,l)}else if(l!==null){if(t.t!==null){n.textContent=""}N(n,null,e,l,0,l.length-1)}else if(o!==null){R(o,0,o.length-1)}if(s&&c==="svg"){s=false}}else if(t.t!==i){n.data=i}};const q=t=>{{t.o&&t.o.ref&&t.o.ref(null);t.l&&t.l.map(q)}};const D=(t,s,o=false)=>{const l=t.$hostElement$;const c=t.j||y(null,null);const i=m(s)?s:h(null,null,s);n=l.tagName;if(o&&i.o){for(const t of Object.keys(i.o)){if(l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)){i.o[t]=l[t]}}}i.p=null;i.u|=4;t.j=i;i.h=c.h=l.shadowRoot||l;{e=l["s-sc"]}H(c,i)};const I=(t,e)=>{if(e&&!t.k&&e["s-p"]){e["s-p"].push(new Promise((e=>t.k=e)))}};const V=(t,e)=>{{t.u|=16}if(t.u&4){t.u|=512;return}I(t,t.O);const n=()=>_(t,e);return Ut(n)};const _=(t,e)=>{const n=l("scheduleUpdate",t.$.S);const s=t.C;let o;if(e){{t.u|=256;if(t.M){t.M.map((([t,e])=>X(s,t,e)));t.M=undefined}}{o=X(s,"componentWillLoad")}}{o=z(o,(()=>X(s,"componentWillRender")))}n();return z(o,(()=>G(t,s,e)))};const z=(t,e)=>B(t)?t.then(e):e();const B=t=>t instanceof Promise||t&&t.then&&typeof t.then==="function";const G=async(t,e,n)=>{var s;const o=t.$hostElement$;const c=l("update",t.$.S);const i=o["s-rc"];if(n){P(t)}const f=l("render",t.$.S);{J(t,e,o,n)}if(i){i.map((t=>t()));o["s-rc"]=undefined}f();c();{const e=(s=o["s-p"])!==null&&s!==void 0?s:[];const n=()=>K(t);if(e.length===0){n()}else{Promise.all(e).then(n);t.u|=4;e.length=0}}};const J=(t,e,n,s)=>{try{e=e.render();{t.u&=~16}{t.u|=2}{{{D(t,e,s)}}}}catch(e){mt(e,t.$hostElement$)}return null};const K=t=>{const e=t.$.S;const n=t.$hostElement$;const s=l("postUpdate",e);const o=t.C;const c=t.O;if(!(t.u&64)){t.u|=64;{Y(n)}{X(o,"componentDidLoad")}s();{t.P(n);if(!c){Q()}}}else{s()}{t.L(n)}{if(t.k){t.k();t.k=undefined}if(t.u&512){Lt((()=>V(t,false)))}t.u&=~(4|512)}};const Q=e=>{{Y(St.documentElement)}Lt((()=>k(gt,"appload",{detail:{namespace:t}})))};const X=(t,e,n)=>{if(t&&t[e]){try{return t[e](n)}catch(t){mt(t)}}return undefined};const Y=t=>t.classList.add("hydrated");const Z=(t,e)=>pt(t).U.get(e);const tt=(t,e,n,s)=>{const o=pt(t);const l=o.$hostElement$;const c=o.U.get(e);const i=o.u;const f=o.C;n=g(n,s.W[e][0]);const r=Number.isNaN(c)&&Number.isNaN(n);const u=n!==c&&!r;if((!(i&8)||c===undefined)&&u){o.U.set(e,n);if(f){if(s.A&&i&128){const t=s.A[e];if(t){t.map((t=>{try{f[t](n,c,e)}catch(t){mt(t,l)}}))}}if((i&(2|16))===2){V(o,false)}}}};const et=(t,e,n)=>{var s;if(e.W){if(t.watchers){e.A=t.watchers}const o=Object.entries(e.W);const l=t.prototype;o.map((([t,[s]])=>{if(s&31||n&2&&s&32){Object.defineProperty(l,t,{get(){return Z(this,t)},set(n){tt(this,t,n,e)},configurable:true,enumerable:true})}else if(n&1&&s&64){Object.defineProperty(l,t,{value(...e){const n=pt(this);return n.N.then((()=>n.C[t](...e)))}})}}));if(n&1){const n=new Map;l.attributeChangedCallback=function(t,s,o){jt.jmp((()=>{const c=n.get(t);if(this.hasOwnProperty(c)){o=this[c];delete this[c]}else if(l.hasOwnProperty(c)&&typeof this[c]==="number"&&this[c]==o){return}else if(c==null){const n=pt(this);const l=n===null||n===void 0?void 0:n.u;if(!(l&8)&&l&128&&o!==s){const l=n.C;const c=e.A[t];c===null||c===void 0?void 0:c.forEach((e=>{if(l[e]!=null){l[e].call(l,o,s,t)}}))}return}this[c]=o===null&&typeof this[c]==="boolean"?false:o}))};t.observedAttributes=Array.from(new Set([...Object.keys((s=e.A)!==null&&s!==void 0?s:{}),...o.filter((([t,e])=>e[0]&15)).map((([t,e])=>{const s=e[1]||t;n.set(s,t);return s}))]))}}return t};const nt=async(t,e,n,s)=>{let o;if((e.u&32)===0){e.u|=32;{o=wt(n);if(o.then){const t=c();o=await o;t()}if(!o.isProxied){{n.A=o.watchers}et(o,n,2);o.isProxied=true}const t=l("createInstance",n.S);{e.u|=8}try{new o(e)}catch(t){mt(t)}{e.u&=~8}{e.u|=128}t();st(e.C)}if(o.style){let t=o.style;const e=x(n);if(!$t.has(e)){const s=l("registerStyles",n.S);C(e,t,!!(n.u&1));s()}}}const i=e.O;const f=()=>V(e,true);if(i&&i["s-rc"]){i["s-rc"].push(f)}else{f()}};const st=t=>{{X(t,"connectedCallback")}};const ot=t=>{if((jt.u&1)===0){const e=pt(t);const n=e.$;const s=l("connectedCallback",n.S);if(!(e.u&1)){e.u|=1;{let n=t;while(n=n.parentNode||n.host){if(n["s-p"]){I(e,e.O=n);break}}}if(n.W){Object.entries(n.W).map((([e,[n]])=>{if(n&31&&t.hasOwnProperty(e)){const n=t[e];delete t[e];t[e]=n}}))}{nt(t,e,n)}}else{ft(t,e,n.R);if(e===null||e===void 0?void 0:e.C){st(e.C)}else if(e===null||e===void 0?void 0:e.T){e.T.then((()=>st(e.C)))}}s()}};const lt=t=>{{X(t,"disconnectedCallback")}};const ct=async t=>{if((jt.u&1)===0){const e=pt(t);{if(e.F){e.F.map((t=>t()));e.F=undefined}}if(e===null||e===void 0?void 0:e.C){lt(e.C)}else if(e===null||e===void 0?void 0:e.T){e.T.then((()=>lt(e.C)))}}};const it=(t,e={})=>{var n;const s=l();const o=[];const c=e.exclude||[];const f=gt.customElements;const r=St.head;const u=r.querySelector("meta[charset]");const a=St.createElement("style");const d=[];let h;let y=true;Object.assign(jt,e);jt.H=new URL(e.resourcesUrl||"./",St.baseURI).href;t.map((t=>{t[1].map((e=>{var n;const s={u:e[0],S:e[1],W:e[2],R:e[3]};{s.W=e[2]}{s.R=e[3]}{s.A=(n=e[4])!==null&&n!==void 0?n:{}}const l=s.S;const i=class extends HTMLElement{constructor(t){super(t);t=this;yt(t,s);if(s.u&1){{{t.attachShadow({mode:"open"})}}}}connectedCallback(){if(h){clearTimeout(h);h=null}if(y){d.push(this)}else{jt.jmp((()=>ot(this)))}}disconnectedCallback(){jt.jmp((()=>ct(this)))}componentOnReady(){return pt(this).T}};s.q=t[0];if(!c.includes(l)&&!f.get(l)){o.push(l);f.define(l,et(i,s,1))}}))}));{a.innerHTML=o+i;a.setAttribute("data-styles","");const t=(n=jt.m)!==null&&n!==void 0?n:p(St);if(t!=null){a.setAttribute("nonce",t)}r.insertBefore(a,u?u.nextSibling:r.firstChild)}y=false;if(d.length){d.map((t=>t.connectedCallback()))}else{{jt.jmp((()=>h=setTimeout(Q,30)))}}s()};const ft=(t,e,n,s)=>{if(n){n.map((([n,s,o])=>{const l=t;const c=rt(e,o);const i=ut(n);jt.ael(l,s,c,i);(e.F=e.F||[]).push((()=>jt.rel(l,s,c,i)))}))}};const rt=(t,e)=>n=>{try{{if(t.u&256){t.C[e](n)}else{(t.M=t.M||[]).push([e,n])}}}catch(t){mt(t)}};const ut=t=>(t&2)!==0;const at=t=>jt.m=t;const dt=new WeakMap;const pt=t=>dt.get(t);const ht=(t,e)=>dt.set(e.C=t,e);const yt=(t,e)=>{const n={u:0,$hostElement$:t,$:e,U:new Map};{n.N=new Promise((t=>n.L=t))}{n.T=new Promise((t=>n.P=t));t["s-p"]=[];t["s-rc"]=[]}ft(t,n,e.R);return dt.set(t,n)};const vt=(t,e)=>e in t;const mt=(t,e)=>(0,console.error)(t,e);const bt=new Map;const wt=(t,e,n)=>{const s=t.S.replace(/-/g,"_");const o=t.q;const l=bt.get(o);if(l){return l[s]}
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${o}.entry.js${""}`).then((t=>{{bt.set(o,t)}return t[s]}),mt)};const $t=new Map;const gt=typeof window!=="undefined"?window:{};const St=gt.document||{head:{}};const jt={u:0,H:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,s)=>t.addEventListener(e,n,s),rel:(t,e,n,s)=>t.removeEventListener(e,n,s),ce:(t,e)=>new CustomEvent(t,e)};const kt=t=>Promise.resolve(t);const Ot=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(t){}return false})();const Ct=[];const Mt=[];const Pt=(t,e)=>n=>{t.push(n);if(!o){o=true;if(e&&jt.u&4){Lt(Et)}else{jt.raf(Et)}}};const xt=t=>{for(let e=0;e<t.length;e++){try{t[e](performance.now())}catch(t){mt(t)}}t.length=0};const Et=()=>{xt(Ct);{xt(Mt);if(o=Ct.length>0){jt.raf(Et)}}};const Lt=t=>kt().then(t);const Ut=Pt(Mt,true);export{v as H,it as b,j as c,S as g,h,kt as p,ht as r,at as s};
3
+ //# sourceMappingURL=p-a7649277.js.map