@baloise/ds-core 16.2.0 → 16.2.1-nightly.20240528

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/components/all.d.ts +2 -0
  2. package/components/all.js +3 -0
  3. package/components/bal-app.js +1 -85
  4. package/components/bal-app2.js +87 -0
  5. package/components/bal-doc-app.d.ts +11 -0
  6. package/components/bal-doc-app.js +260 -0
  7. package/components/bal-number-input.js +5 -2
  8. package/components/bal-select2.js +1 -1
  9. package/components/index.js +5 -289
  10. package/components/initialize.js +288 -0
  11. package/components/tokens.esm.js +1 -1
  12. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  13. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  14. package/dist/baloise-design-system/index.esm.js +1 -1
  15. package/dist/baloise-design-system/{p-14c1efdb08.entry.js → p-02d8e3be64.entry.js} +1 -1
  16. package/dist/baloise-design-system/{p-e7f7fee312.entry.js → p-078ee8c424.entry.js} +1 -1
  17. package/dist/baloise-design-system/{p-2e9f9838d0.entry.js → p-07ffe6c6ec.entry.js} +1 -1
  18. package/dist/baloise-design-system/{p-7e909d3137.system.entry.js → p-09adc6042f.system.entry.js} +1 -1
  19. package/dist/baloise-design-system/{p-f4e7710a45.system.entry.js → p-0da7f708e2.system.entry.js} +1 -1
  20. package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
  21. package/dist/baloise-design-system/{p-3e3240a165.entry.js → p-1b3389464d.entry.js} +1 -1
  22. package/dist/baloise-design-system/{p-42bff14b.system.js → p-21b1aa2d.system.js} +1 -1
  23. package/dist/baloise-design-system/{p-5b9789ea9b.system.entry.js → p-26da6be324.system.entry.js} +1 -1
  24. package/dist/baloise-design-system/{p-4ba5509697.system.entry.js → p-2b3d531d72.system.entry.js} +1 -1
  25. package/dist/baloise-design-system/{p-ae372094d2.entry.js → p-3044420aa8.entry.js} +1 -1
  26. package/dist/baloise-design-system/p-317cee9b56.system.entry.js +1 -0
  27. package/dist/baloise-design-system/{p-594ed43172.entry.js → p-3184663b65.entry.js} +1 -1
  28. package/dist/baloise-design-system/{p-dce3764ee5.system.entry.js → p-330b875d9d.system.entry.js} +1 -1
  29. package/dist/baloise-design-system/{p-4122160f.system.js → p-33c8d310.system.js} +1 -1
  30. package/dist/baloise-design-system/{p-1cae0f6215.entry.js → p-35f13fdb25.entry.js} +1 -1
  31. package/dist/baloise-design-system/p-360068a4.system.js +1 -0
  32. package/dist/baloise-design-system/{p-6cec985f79.system.entry.js → p-3a9900d73b.system.entry.js} +1 -1
  33. package/dist/baloise-design-system/p-54f81c32.js +1 -1
  34. package/dist/baloise-design-system/{p-46962c31.system.js → p-5d62da08.system.js} +1 -1
  35. package/dist/baloise-design-system/p-6648acba05.entry.js +1 -0
  36. package/dist/baloise-design-system/{p-bff4f2e518.system.entry.js → p-67b0ed7e36.system.entry.js} +1 -1
  37. package/dist/baloise-design-system/p-6d1b6215.js +1 -0
  38. package/dist/baloise-design-system/{p-6b62dde878.entry.js → p-6e7c2182ef.entry.js} +1 -1
  39. package/dist/baloise-design-system/p-7291766c.system.js +1 -0
  40. package/dist/baloise-design-system/{p-e3ef34506f.system.entry.js → p-85fa41c16f.system.entry.js} +1 -1
  41. package/dist/baloise-design-system/{p-eb10ad25.js → p-8a4bc0de.js} +1 -1
  42. package/dist/baloise-design-system/{p-53b032957c.entry.js → p-94c433f7d6.entry.js} +1 -1
  43. package/dist/baloise-design-system/{p-f56fb1a197.entry.js → p-976ed5bcf1.entry.js} +1 -1
  44. package/dist/baloise-design-system/p-a52564d27f.system.entry.js +1 -0
  45. package/dist/baloise-design-system/{p-90aa7db300.system.entry.js → p-aa7ad8530b.system.entry.js} +1 -1
  46. package/dist/baloise-design-system/p-ad00d94e7f.entry.js +1 -0
  47. package/dist/baloise-design-system/{p-c907685cee.system.entry.js → p-b1347e2d62.system.entry.js} +1 -1
  48. package/dist/baloise-design-system/{p-35697fd842.entry.js → p-b2815405a1.entry.js} +1 -1
  49. package/dist/baloise-design-system/{p-e7bd7e7c5d.entry.js → p-c2d6e2162d.entry.js} +1 -1
  50. package/dist/baloise-design-system/{p-71109949.js → p-d191284e.js} +1 -1
  51. package/dist/baloise-design-system/{p-e18c0e64a7.system.entry.js → p-d9a4e24f3a.system.entry.js} +1 -1
  52. package/dist/baloise-design-system/{p-d458e5e328.system.entry.js → p-da14d7f144.system.entry.js} +1 -1
  53. package/dist/baloise-design-system/{p-2a0359206a.entry.js → p-e32ac85ac8.entry.js} +1 -1
  54. package/dist/baloise-design-system/{p-542d4ba42e.system.entry.js → p-e55a5cf0b7.system.entry.js} +1 -1
  55. package/dist/baloise-design-system/p-e8ffddeb.js +1 -0
  56. package/dist/baloise-design-system/{p-7dc6846c06.entry.js → p-f916816500.entry.js} +1 -1
  57. package/dist/baloise-design-system/{p-013b4c72.system.js → p-f959646a.system.js} +1 -1
  58. package/dist/baloise-design-system/{p-b1227cb400.system.entry.js → p-ff03644e3a.system.entry.js} +1 -1
  59. package/dist/cjs/app-globals-5fd73c0c.js +7 -0
  60. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  61. package/dist/cjs/bal-datepicker.cjs.entry.js +3 -3
  62. package/dist/cjs/bal-doc-app.cjs.entry.js +231 -0
  63. package/dist/cjs/bal-hint_3.cjs.entry.js +3 -3
  64. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  65. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  66. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  67. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  68. package/dist/cjs/bal-number-input.cjs.entry.js +5 -2
  69. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  70. package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
  71. package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
  72. package/dist/cjs/bal-select_2.cjs.entry.js +1 -1
  73. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  74. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  75. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  76. package/dist/cjs/baloise-design-system.cjs.js +3 -2
  77. package/dist/cjs/{breakpoints.decorator-555e2caf.js → breakpoints.decorator-75d07117.js} +1 -1
  78. package/dist/cjs/{breakpoints.subject-0d00c248.js → breakpoints.subject-f7f1e23a.js} +1 -1
  79. package/dist/cjs/{app-globals-ae3a8623.js → global-2562a984.js} +2 -4
  80. package/dist/cjs/index.cjs.js +2 -2
  81. package/dist/cjs/initialize-2a19d091.js +1 -1
  82. package/dist/cjs/loader.cjs.js +3 -2
  83. package/dist/cjs/{tokens.esm-93d7e2f7.js → tokens.esm-0da503d2.js} +1 -1
  84. package/dist/collection/collection-manifest.json +2 -1
  85. package/dist/collection/components/bal-number-input/bal-number-input.utils.js +5 -2
  86. package/dist/collection/components/bal-select/bal-select.js +1 -1
  87. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +1 -0
  88. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +229 -0
  89. package/dist/collection/utils/constants/version.constant.js +1 -1
  90. package/dist/esm/app-globals-970bab17.js +5 -0
  91. package/dist/esm/bal-carousel_2.entry.js +3 -3
  92. package/dist/esm/bal-datepicker.entry.js +3 -3
  93. package/dist/esm/bal-doc-app.entry.js +227 -0
  94. package/dist/esm/bal-hint_3.entry.js +3 -3
  95. package/dist/esm/bal-list_8.entry.js +3 -3
  96. package/dist/esm/bal-logo.entry.js +3 -3
  97. package/dist/esm/bal-nav_8.entry.js +3 -3
  98. package/dist/esm/bal-navbar_5.entry.js +3 -3
  99. package/dist/esm/bal-number-input.entry.js +5 -2
  100. package/dist/esm/bal-pagination.entry.js +3 -3
  101. package/dist/esm/bal-popover_2.entry.js +3 -3
  102. package/dist/esm/bal-progress-bar.entry.js +3 -3
  103. package/dist/esm/bal-select_2.entry.js +1 -1
  104. package/dist/esm/bal-shape.entry.js +1 -1
  105. package/dist/esm/bal-steps.entry.js +3 -3
  106. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  107. package/dist/esm/baloise-design-system.js +3 -2
  108. package/dist/esm/{breakpoints.decorator-dad33c75.js → breakpoints.decorator-ee33b562.js} +1 -1
  109. package/dist/esm/{breakpoints.subject-ba72fe99.js → breakpoints.subject-90fb8414.js} +1 -1
  110. package/dist/esm/{app-globals-b0dd0fc4.js → global-63f4bcec.js} +2 -4
  111. package/dist/esm/index.js +3 -3
  112. package/dist/esm/initialize-e216cfe4.js +1 -1
  113. package/dist/esm/loader.js +3 -2
  114. package/dist/esm/{tokens.esm-366a5b1e.js → tokens.esm-36cd22a4.js} +1 -1
  115. package/dist/esm-es5/app-globals-970bab17.js +1 -0
  116. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  117. package/dist/esm-es5/bal-datepicker.entry.js +1 -1
  118. package/dist/esm-es5/bal-doc-app.entry.js +1 -0
  119. package/dist/esm-es5/bal-hint_3.entry.js +1 -1
  120. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  121. package/dist/esm-es5/bal-logo.entry.js +1 -1
  122. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  123. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  124. package/dist/esm-es5/bal-number-input.entry.js +1 -1
  125. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  126. package/dist/esm-es5/bal-popover_2.entry.js +1 -1
  127. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  128. package/dist/esm-es5/bal-select_2.entry.js +1 -1
  129. package/dist/esm-es5/bal-shape.entry.js +1 -1
  130. package/dist/esm-es5/bal-steps.entry.js +1 -1
  131. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  132. package/dist/esm-es5/baloise-design-system.js +1 -1
  133. package/dist/esm-es5/breakpoints.decorator-ee33b562.js +1 -0
  134. package/dist/esm-es5/{breakpoints.subject-ba72fe99.js → breakpoints.subject-90fb8414.js} +1 -1
  135. package/dist/esm-es5/global-63f4bcec.js +1 -0
  136. package/dist/esm-es5/index.js +1 -1
  137. package/dist/esm-es5/initialize-e216cfe4.js +1 -1
  138. package/dist/esm-es5/loader.js +1 -1
  139. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +21 -0
  140. package/dist/types/components.d.ts +37 -0
  141. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +81 -0
  142. package/package.json +7 -7
  143. package/dist/baloise-design-system/p-77f5e777e6.entry.js +0 -1
  144. package/dist/baloise-design-system/p-9ecce014c2.system.entry.js +0 -1
  145. package/dist/baloise-design-system/p-bcca1ed3.system.js +0 -1
  146. package/dist/baloise-design-system/p-e78a6409.js +0 -1
  147. package/dist/esm-es5/app-globals-b0dd0fc4.js +0 -1
  148. package/dist/esm-es5/breakpoints.decorator-dad33c75.js +0 -1
  149. /package/dist/baloise-design-system/{p-448185d8.system.js → p-95709c75.system.js} +0 -0
  150. /package/dist/baloise-design-system/{p-5e1cb403.js → p-dc24372e.js} +0 -0
  151. /package/dist/esm-es5/{tokens.esm-366a5b1e.js → tokens.esm-36cd22a4.js} +0 -0
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,g as n}from"./p-d7c752c6.js";import{_ as s,a as o}from"./p-43c9f5e9.js";import{B as a}from"./p-ae86d0a0.js";import{p as l}from"./p-c0c91eb1.js";import{B as r}from"./p-6e0f125e.js";import{b as c}from"./p-71109949.js";import{L as h}from"./p-eb10ad25.js";import{L as b}from"./p-69e7c8d6.js";import"./p-9a3d9e17.js";import"./p-a65354df.js";import"./p-88f18fbc.js";import"./p-2229e98e.js";import"./p-aafb6696.js";import"./p-96216bd1.js";import"./p-acf222fd.js";import"./p-5e1cb403.js";const p=class{constructor(e){t(this,e),this.bodyScrollHandler=new r,this.onPopoverChange=t=>{this.isActive=t.detail,l(t)},this.isActive=!1,this.innerCloseLabel="Close",this.isMobile=c.isMobile,this.closeLabel=void 0,this.small=!1}connectedCallback(){this.bodyScrollHandler.connect()}componentDidRender(){this.updateContent()}disconnectedCallback(){this.bodyScrollHandler.disconnect()}breakpointListener(t){const e=t.mobile;e!==this.isMobile&&(this.isActive=!1),this.isMobile=e}async configChanged(t){if(!this.closeLabel)switch(t.language){case"de":this.innerCloseLabel="Schliessen";break;case"fr":this.innerCloseLabel="Fermer";break;case"it":this.innerCloseLabel="Chiudere";break;case"nl":this.innerCloseLabel="Sluiten";break;default:this.innerCloseLabel="Close"}}async toggle(){this.isActive?this.dismiss():this.present()}async present(){this.popoverElement&&this.popoverElement.present(),this.isMobile&&this.bodyScrollHandler.disable(),this.isActive=!0}async dismiss(){this.popoverElement&&this.popoverElement.dismiss(),this.isMobile&&this.bodyScrollHandler.enable(),this.isActive=!1}updateContent(){this.hintContentEl&&this.slotWrapperEl&&(this.hintContentEl.innerHTML=this.slotWrapperEl.innerHTML)}render(){const t=a.block("hint"),n=t.element("icon"),s=t.element("content"),o=s.element("buttons"),l=this.isMobile?0:8,r=this.isMobile?0:16,c=()=>e("bal-icon",{class:Object.assign({},n.class()),"data-testid":"bal-hint-trigger","bal-popover-trigger":!0,"aria-haspopup":"true",role:"button",name:"info-circle",onClick:()=>this.toggle()}),h=()=>e("div",{class:Object.assign({},s.class()),"data-testid":"bal-hint-content"},e("div",{ref:t=>this.hintContentEl=t}),e("bal-button-group",{class:Object.assign(Object.assign({},o.class()),o.modifier("is-hidden-desktop").class(this.small))},e("bal-button",{"data-testid":"bal-hint-close",color:"info",onClick:()=>this.dismiss()},this.closeLabel?this.closeLabel:this.innerCloseLabel))),b=this.isMobile?()=>{const i=t.element("overlay");return e("div",{class:Object.assign({},i.class())},e(c,null),e("div",{class:Object.assign(Object.assign({},i.element("content").class()),i.element("content").modifier("active").class(this.isActive))},e(h,null)))}:()=>e("div",{class:Object.assign({},t.element("popover").class())},e("bal-popover",{hint:!0,position:"right",offsetX:0,offsetY:r,padding:l,ref:t=>this.popoverElement=t,onBalChange:this.onPopoverChange},e(c,null),e("bal-popover-content",{color:"grey"},e(h,null))));return e(i,{class:Object.assign({},t.class())},e(b,null),e("div",{ref:t=>this.slotWrapperEl=t,style:{display:"none"}},e("slot",null)))}get element(){return n(this)}};s([h(),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],p.prototype,"breakpointListener",null),s([b(),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",Promise)],p.prototype,"configChanged",null),p.style=":root{--bal-hint-content-background:var(--bal-color-grey-2)}.bal-hint{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block}.bal-hint__icon{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}@media (hover: hover)and (pointer: fine){.bal-hint__icon:hover svg,.bal-hint__icon:hover g,.bal-hint__icon:hover path,.bal-hint__icon:hover circle,.bal-hint__icon:focus svg,.bal-hint__icon:focus g,.bal-hint__icon:focus path,.bal-hint__icon:focus circle{fill:var(--bal-color-light-blue-5)}}.bal-hint__content{background:var(--bal-hint-content-background);display:-ms-flexbox;display:flex;gap:1.5rem;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{-ms-flex:1;flex:1}}.bal-hint__content__title{display:block;margin-bottom:1rem}.bal-hint__content__title__heading{font-family:var(--bal-title-font-family);font-weight:var(--bal-title-font-weight);font-size:var(--bal-text-size-x-large);line-height:var(--bal-line-height-x-large)}@media screen and (min-width: 769px),print{.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-tablet);line-height:var(--bal-line-height-tablet-x-large)}}@media screen and (min-width: 1024px){.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-desktop);line-height:var(--bal-line-height-desktop-x-large)}}@media screen and (min-width: 769px),print{.bal-hint__content__buttons--is-hidden-desktop{display:none !important}}.bal-hint__overlay__content{position:fixed;display:none;overflow:auto;top:0;left:0;right:0;bottom:0;z-index:var(--bal-z-index-popup)}.bal-hint__overlay__content--active{display:block}";const d=class{constructor(e){t(this,e)}render(){const t=a.block("hint").element("content").element("text"),n=t.element("field");return e(i,{class:Object.assign({},t.class())},e("p",{class:Object.assign({},n.class())},e("slot",null)))}},_=class{constructor(e){t(this,e)}render(){const t=a.block("hint").element("content").element("title"),n=t.element("heading");return e(i,{class:Object.assign({},t.class())},e("h3",{class:Object.assign({},n.class())},e("span",null,e("slot",null))))}};export{p as bal_hint,d as bal_hint_text,_ as bal_hint_title}
1
+ import{r as t,h as e,H as i,g as n}from"./p-d7c752c6.js";import{_ as s,a as o}from"./p-43c9f5e9.js";import{B as a}from"./p-ae86d0a0.js";import{p as l}from"./p-c0c91eb1.js";import{B as r}from"./p-6e0f125e.js";import{b as c}from"./p-d191284e.js";import{L as h}from"./p-8a4bc0de.js";import{L as b}from"./p-69e7c8d6.js";import"./p-9a3d9e17.js";import"./p-a65354df.js";import"./p-88f18fbc.js";import"./p-2229e98e.js";import"./p-aafb6696.js";import"./p-96216bd1.js";import"./p-acf222fd.js";import"./p-dc24372e.js";const d=class{constructor(e){t(this,e),this.bodyScrollHandler=new r,this.onPopoverChange=t=>{this.isActive=t.detail,l(t)},this.isActive=!1,this.innerCloseLabel="Close",this.isMobile=c.isMobile,this.closeLabel=void 0,this.small=!1}connectedCallback(){this.bodyScrollHandler.connect()}componentDidRender(){this.updateContent()}disconnectedCallback(){this.bodyScrollHandler.disconnect()}breakpointListener(t){const e=t.mobile;e!==this.isMobile&&(this.isActive=!1),this.isMobile=e}async configChanged(t){if(!this.closeLabel)switch(t.language){case"de":this.innerCloseLabel="Schliessen";break;case"fr":this.innerCloseLabel="Fermer";break;case"it":this.innerCloseLabel="Chiudere";break;case"nl":this.innerCloseLabel="Sluiten";break;default:this.innerCloseLabel="Close"}}async toggle(){this.isActive?this.dismiss():this.present()}async present(){this.popoverElement&&this.popoverElement.present(),this.isMobile&&this.bodyScrollHandler.disable(),this.isActive=!0}async dismiss(){this.popoverElement&&this.popoverElement.dismiss(),this.isMobile&&this.bodyScrollHandler.enable(),this.isActive=!1}updateContent(){this.hintContentEl&&this.slotWrapperEl&&(this.hintContentEl.innerHTML=this.slotWrapperEl.innerHTML)}render(){const t=a.block("hint"),n=t.element("icon"),s=t.element("content"),o=s.element("buttons"),l=this.isMobile?0:8,r=this.isMobile?0:16,c=()=>e("bal-icon",{class:Object.assign({},n.class()),"data-testid":"bal-hint-trigger","bal-popover-trigger":!0,"aria-haspopup":"true",role:"button",name:"info-circle",onClick:()=>this.toggle()}),h=()=>e("div",{class:Object.assign({},s.class()),"data-testid":"bal-hint-content"},e("div",{ref:t=>this.hintContentEl=t}),e("bal-button-group",{class:Object.assign(Object.assign({},o.class()),o.modifier("is-hidden-desktop").class(this.small))},e("bal-button",{"data-testid":"bal-hint-close",color:"info",onClick:()=>this.dismiss()},this.closeLabel?this.closeLabel:this.innerCloseLabel))),b=this.isMobile?()=>{const i=t.element("overlay");return e("div",{class:Object.assign({},i.class())},e(c,null),e("div",{class:Object.assign(Object.assign({},i.element("content").class()),i.element("content").modifier("active").class(this.isActive))},e(h,null)))}:()=>e("div",{class:Object.assign({},t.element("popover").class())},e("bal-popover",{hint:!0,position:"right",offsetX:0,offsetY:r,padding:l,ref:t=>this.popoverElement=t,onBalChange:this.onPopoverChange},e(c,null),e("bal-popover-content",{color:"grey"},e(h,null))));return e(i,{class:Object.assign({},t.class())},e(b,null),e("div",{ref:t=>this.slotWrapperEl=t,style:{display:"none"}},e("slot",null)))}get element(){return n(this)}};s([h(),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],d.prototype,"breakpointListener",null),s([b(),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",Promise)],d.prototype,"configChanged",null),d.style=":root{--bal-hint-content-background:var(--bal-color-grey-2)}.bal-hint{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block}.bal-hint__icon{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}@media (hover: hover)and (pointer: fine){.bal-hint__icon:hover svg,.bal-hint__icon:hover g,.bal-hint__icon:hover path,.bal-hint__icon:hover circle,.bal-hint__icon:focus svg,.bal-hint__icon:focus g,.bal-hint__icon:focus path,.bal-hint__icon:focus circle{fill:var(--bal-color-light-blue-5)}}.bal-hint__content{background:var(--bal-hint-content-background);display:-ms-flexbox;display:flex;gap:1.5rem;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{-ms-flex:1;flex:1}}.bal-hint__content__title{display:block;margin-bottom:1rem}.bal-hint__content__title__heading{font-family:var(--bal-title-font-family);font-weight:var(--bal-title-font-weight);font-size:var(--bal-text-size-x-large);line-height:var(--bal-line-height-x-large)}@media screen and (min-width: 769px),print{.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-tablet);line-height:var(--bal-line-height-tablet-x-large)}}@media screen and (min-width: 1024px){.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-desktop);line-height:var(--bal-line-height-desktop-x-large)}}@media screen and (min-width: 769px),print{.bal-hint__content__buttons--is-hidden-desktop{display:none !important}}.bal-hint__overlay__content{position:fixed;display:none;overflow:auto;top:0;left:0;right:0;bottom:0;z-index:var(--bal-z-index-popup)}.bal-hint__overlay__content--active{display:block}";const p=class{constructor(e){t(this,e)}render(){const t=a.block("hint").element("content").element("text"),n=t.element("field");return e(i,{class:Object.assign({},t.class())},e("p",{class:Object.assign({},n.class())},e("slot",null)))}},_=class{constructor(e){t(this,e)}render(){const t=a.block("hint").element("content").element("title"),n=t.element("heading");return e(i,{class:Object.assign({},t.class())},e("h3",{class:Object.assign({},n.class())},e("span",null,e("slot",null))))}};export{d as bal_hint,p as bal_hint_text,_ as bal_hint_title}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,r){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function s(t){try{a(r.next(t))}catch(t){o(t)}}function l(t){try{a(r["throw"](t))}catch(t){o(t)}}function a(t){t.done?i(t.value):n(t.value).then(s,l)}a((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(t){return function(e){return a([t,e])}}function a(l){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(i=0)),i)try{if(r=1,n&&(o=l[0]&2?n["return"]:l[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;if(n=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;n=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(l[0]===6&&i.label<o[1]){i.label=o[1];o=l;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(l);break}if(o[2])i.ops.pop();i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t];n=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var r=0,n=e.length,o;r<n;r++){if(o||!(r in e)){if(!o)o=Array.prototype.slice.call(e,0,r);o[r]=e[r]}}return t.concat(o||Array.prototype.slice.call(e))};System.register(["./p-456fc561.system.js","./p-6dbef894.system.js","./p-6913b916.system.js","./p-8954495d.system.js","./p-8a87b9a8.system.js","./p-b79d8942.system.js","./p-d2ee9b0a.system.js","./p-db0895e2.system.js","./p-23bdd8dc.system.js","./p-6e5745c8.system.js","./p-a1f6e944.system.js","./p-b3f2c626.system.js","./p-145d5c4e.system.js","./p-2880433e.system.js"],(function(t){"use strict";var e,i,r,n,o,s,l,a,c,u,h,f,d,b,v,p,_,m,g,y,k,w,x,j,O,T,A,C,z,M,L,B,P,F;return{setters:[function(t){e=t.r;i=t.c;r=t.h;n=t.H;o=t.g},function(t){s=t._;l=t.a},function(t){a=t.l},function(t){c=t.k;u=t.d;h=t.e;f=t.i;d=t.h},function(t){b=t.e;v=t.o;p=t.q;_=t.s;m=t.h;g=t.u;y=t.y},function(t){k=t.r;w=t.p;x=t.l;j=t.g;O=t.i;T=t.s;A=t.a;C=t.f;z=t.b;M=t.v},function(t){L=t.s},function(t){B=t.B},function(t){P=t.L},function(t){F=t.d},function(){},function(){},function(){},function(){}],execute:function(){var I=function(t,e,i){if(typeof MutationObserver==="undefined"){return}var r=new MutationObserver((function(t){t=t.filter((function(t){return t.target.nodeName===e.toUpperCase()||t.target.nodeName==="bal-select".toUpperCase()}));if(t.length>0){i(undefined)}}));r.observe(t,{childList:true,subtree:true,attributes:true,characterData:true});return r};var E=":root{--bal-select-control-background:var(--bal-color-white);--bal-select-control-background-hover:var(--bal-form-field-control-background-hover);--bal-select-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-select-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-select-control-input-background:var(--bal-color-grey-1);--bal-select-control-native-input-background:transparent;--bal-select-control-native-input-background-hover:transparent;--bal-select-control-input-inverted-footer-background:transparent;--bal-select-control-input-inverted-footer-background-hover:transparent;--bal-select-control-input-multiple-background:transparent;--bal-select-control-input-multiple-background-read-only-selection:transparent;--bal-select-control-input-option-background:transparent;--bal-select-control-input-option-background-selected:var(--bal-color-primary-1);--bal-select-control-input-option-background-focused:var(--bal-color-grey-2);--bal-select-control-input-option-background-hover:var(--bal-color-grey-2);--bal-select-control-border-radius:var(--bal-form-field-control-radius);--bal-select-popover-border-color:var(--bal-color-grey-2);--bal-select-control-border-color:var(--bal-form-field-control-border-color);--bal-select-control-border-color-focused:var(--bal-color-primary);--bal-select-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-select-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-select-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-select-control-border-color-focus-within:var(--bal-color-primary);--bal-select-option-border-top-color:var(--bal-color-grey-2);--bal-select-popover-empty-text-color:var(--bal-form-field-control-color);--bal-select-control-text-color:var(--bal-form-field-control-color);--bal-select-control-text-color-focused:var(--bal-color-primary);--bal-select-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-select-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-select-option-content-label-text-color:var(--bal-form-field-control-color)}bal-select-option{display:none !important}.bal-select{display:block;position:relative;width:100%;-ms-flex:1;flex:1;font-family:var(--bal-font-family-text)}.bal-select__popover{border:.125rem solid var(--bal-select-popover-border-color)}.bal-select__popover__empty{padding:.5rem 1rem;font-family:var(--bal-font-family-text);color:var(--bal-select-popover-empty-text-color)}.bal-select__popover__empty--hidden{display:none}.bal-select__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-select__control{display:-ms-flexbox;display:flex;border-width:.125rem;border-style:solid;border-color:var(--bal-select-control-border-color);border-radius:var(--bal-select-control-border-radius);background:var(--bal-select-control-background);font-size:var(--bal-font-weight-regular);font-family:var(--bal-font-family-text);color:var(--bal-select-control-text-color);outline:none;-webkit-box-shadow:none;box-shadow:none;padding-right:1rem;min-height:3rem}.bal-select__control--focused{border-color:var(--bal-select-control-border-color-focused)}.bal-select__control:not(.bal-select__control--disabled):not(.bal-select__control--invalid):not(.bal-select__control--inverted-footer):hover{border-color:var(--bal-select-control-border-color-hover);background-color:var(--bal-select-control-background-hover)}.bal-select__control:not(.bal-select__control--disabled):not(.bal-select__control--invalid):not(.bal-select__control--inverted-footer):hover .bal-select__control__input{background-color:var(--bal-select-control-input-background)}.bal-select__control--invalid:not(.bal-select__control--disabled){border-color:var(--bal-select-control-border-color-invalid) !important;background:var(--bal-select-control-background-invalid) !important}.bal-select__control:focus-within{border-color:var(--bal-select-control-border-color-focus-within) !important}.bal-select__control--disabled{background-color:var(--bal-select-control-background-disabled) !important;border-color:var(--bal-select-control-border-color-disabled) !important}.bal-select__control--disabled,.bal-select__control--disabled input{cursor:default !important;-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;pointer-events:none !important;color:var(--bal-select-input-text-color-disabled)}.bal-select__control--inverted-footer{border:none;background-color:var(--bal-select-control-input-inverted-footer-background) !important;padding-right:0}.bal-select__control--inverted-footer:hover{background-color:var(--bal-select-control-input-inverted-footer-background-hover) !important}.bal-select__control--inverted-footer .input{color:var(--bal-select-control-inverted-footer-native-input-text-color);background-color:var(--bal-select-control-native-input-background) !important}.bal-select__control--inverted-footer .input:hover{background-color:var(--bal-select-control-native-input-background-hover) !important}.bal-select__control__icon{min-height:100% !important;max-height:100% !important}.bal-select__control__icon--loading{display:none}.bal-select__control__icon--clickable{cursor:pointer}.bal-select__control__selections{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex:1 1;flex:1 1;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:1.125rem;max-width:100%;min-width:0;gap:0;padding-left:.375rem}.bal-select__control__selections .bal-tag{margin-left:.25rem;margin-top:.375rem;margin-bottom:.375rem}.bal-select__control__selections .bal-tag+.input{padding-left:.625rem}.bal-select__control__input{border:none !important;outline:none !important;outline-width:0 !important;height:2.75rem !important;-webkit-box-shadow:none !important;box-shadow:none !important;background:var(--bal-select-control-input-multiple-background);-ms-flex:1;flex:1;min-height:2.75rem !important;padding-left:.25rem !important;padding-right:.625rem !important;text-overflow:ellipsis}.bal-select__control__input:-moz-read-only{-moz-user-select:none !important;user-select:none !important;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bal-select__control__input:read-only{-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bal-select__control__input:read-only::-moz-selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:-moz-read-only::selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:read-only::selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:-moz-read-only::-moz-selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:read-only::-moz-selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__option{visibility:visible;font-family:var(--bal-font-family-text);background:var(--bal-select-control-input-option-background);border:none;cursor:pointer;outline:none;min-height:3rem;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0;margin:0;border-top:.125rem solid var(--bal-select-option-border-top-color);text-align:inherit;white-space:nowrap;width:100%}.bal-select__option:first-child{border-top:none}.bal-select__option::-moz-focus-inner{border:none}.bal-select__option--selected{background:var(--bal-select-control-input-option-background-selected)}.bal-select__option--selected .bal-select__option__content__label{font-weight:var(--bal-font-weight-bold)}.bal-select__option--focused{background:var(--bal-select-control-input-option-background-focused)}.bal-select__option:hover{background:var(--bal-select-control-input-option-background-hover)}.bal-select__option__content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;min-height:3rem;padding:.75rem 1rem;gap:.75rem}.bal-select__option__content__checkbox{margin:0;padding:0}.bal-select__option__content__label{margin:0;padding:0;font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-select-option-content-label-text-color);line-height:1.125rem;word-break:break-word;white-space:normal;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}";var S=E;var D=true;var H=false;var K=t("bal_select",function(){function t(t){var r=this;e(this,t);this.balChange=i(this,"balChange",7);this.balInputClick=i(this,"balInputClick",7);this.balInput=i(this,"balInput",7);this.balBlur=i(this,"balBlur",7);this.balFocus=i(this,"balFocus",7);this.balCancel=i(this,"balCancel",7);this.balKeyPress=i(this,"balKeyPress",7);this.didInit=false;this.inputId="bal-select-".concat(N++);this.initialValue=[];this.removeValue=function(t){if(!r.disabled){r.updateRawValue(k(r.rawValue,t),D);if(r.multiple&&r.typeahead){r.setFocus()}r.fireBlur()}};this.fireBlur=function(t){if(t===void 0){t=new CustomEvent("blur")}if(!r.isPopoverOpen&&!r.hasFocus){c((function(){return r.balBlur.emit(t)}))}};this.handleClick=function(t){if(r.disabled||r.readonly){w(t)}};this.handlePopoverChange=function(t){t.stopPropagation();if(r.isPopoverOpen!==t.detail){r.isPopoverOpen=t.detail;if(r.isPopoverOpen){r.updateFocus()}else{r.focusIndex=-1;if(r.multiple&&r.typeahead){r.updateInputValue("")}r.fireBlur(t)}}};this.handleInputBlur=function(t){w(t);var e=t.relatedTarget;if(e===null||e&&e.nodeName&&(e.nodeName==="BAL-MODAL"||e.nodeName==="INPUT"||e.nodeName==="BUTTON")){r.validateAfterBlur(D)}r.hasFocus=false;r.fireBlur(t)};this.handleInputFocus=function(t){r.balFocus.emit(t);r.hasFocus=true};this.handleInputClick=function(t,e){if(e===void 0){e=false}return __awaiter(r,void 0,void 0,(function(){var i,r,n,o;return __generator(this,(function(s){switch(s.label){case 0:L(t);if(this.isChipClicked(t)){return[2]}if(!(this.disabled||this.readonly))return[3,1];w(t);return[3,10];case 1:this.focusIndex=-1;this.balInputClick.emit(t);if(!this.typeahead)return[3,6];if(!(this.isPopoverOpen&&e))return[3,3];return[4,(i=this.popoverElement)===null||i===void 0?void 0:i.dismiss()];case 2:s.sent();return[3,5];case 3:return[4,(r=this.popoverElement)===null||r===void 0?void 0:r.present()];case 4:s.sent();s.label=5;case 5:return[3,10];case 6:if(!this.isPopoverOpen)return[3,8];return[4,(n=this.popoverElement)===null||n===void 0?void 0:n.dismiss()];case 7:s.sent();return[3,10];case 8:return[4,(o=this.popoverElement)===null||o===void 0?void 0:o.present()];case 9:s.sent();s.label=10;case 10:return[2]}}))}))};this.handleKeyPress=function(t){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!(!this.isPopoverOpen&&b(t)))return[3,2];w(t);return[4,this.open()];case 1:e.sent();e.label=2;case 2:this.balKeyPress.emit(t);return[2]}}))}))};this.handleInputChange=function(t){if(!r.disabled&&!r.readonly){r.inputValue=t.target.value}};this.handleInput=function(t){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.disabled&&!this.readonly){this.inputValue=t.target.value;if(!this.isPopoverOpen){this.popoverElement.present()}this.focusIndex=-1;this.updateFocus();w(t);this.balInput.emit(this.inputValue)}return[2]}))}))};this.handleOptionMouseEnter=function(t){r.focusIndex=t};this.hasFocus=false;this.inputValue="";this.focusIndex=-1;this.isPopoverOpen=false;this.options=new Map;this.labelToScrollTo="";this.labelToSelectTo="";this.ariaForm=F;this.name=this.inputId;this.invalid=false;this.filter="includes";this.balTabindex=0;this.freeSolo=false;this.multiple=false;this.maxLength=undefined;this.noDataLabel=undefined;this.autocomplete="off";this.typeahead=false;this.selectionOptional=false;this.disabled=false;this.readonly=false;this.required=false;this.inverted=false;this.placeholder=undefined;this.scrollable=250;this.loading=false;this.remote=false;this.autoInvalidOff=false;this.value=[];this.rawValue=[]}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueWatcher=function(){this.syncRawValue(false)};t.prototype.updateRawValue=function(t,e){if(e===void 0){e=true}if(!v(t,this.rawValue||[])){this.rawValue=__spreadArray([],t,true);this.syncNativeInput();if(this.didInit&&e===true){if(this.multiple){if(a(this.rawValue)){this.emitChangeEvent([])}else{this.emitChangeEvent(__spreadArray([],this.rawValue,true))}}else{if(a(this.rawValue)||x(this.rawValue)===0){this.emitChangeEvent(undefined)}else{this.emitChangeEvent(this.rawValue[0])}}}}};t.prototype.emitChangeEvent=function(t){this.balChange.emit(t)};t.prototype.connectedCallback=function(){var t=this;var e=d((function(){return t.updateOptions()}),0);this.initialValue=this.value;e();this.mutationO=I(this.el,"bal-select-option",(function(){e()}))};t.prototype.componentWillLoad=function(){this.waitForOptionsAndThenUpdateRawValues();this.isInsideOfFooter();if(!a(this.rawValue)&&this.options.size>0&&x(this.rawValue)===1){var t=this.options.get(this.rawValue[0]);if(!a(t)){this.inputValue=t.label}}};t.prototype.componentDidLoad=function(){this.syncRawValue(false);if(!this.multiple){this.inputElement.value=this.inputValue}this.didInit=true};t.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}};t.prototype.listenOnClick=function(t){if(this.disabled&&t.target&&t.target===this.el){w(t)}};t.prototype.resetHandler=function(t){var e=this;var i=t.target;if(i===null||i===void 0?void 0:i.contains(this.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){e.value=e.initialValue;e.syncRawValue(false);e.syncNativeInput();if(e.nativeSelectEl){var t=Array.from(e.nativeSelectEl.options);t.forEach((function(t){return t.selected=true}))}}),0)}};t.prototype.handleKeyDown=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:if(!this.isPopoverOpen)return[3,1];if(p(t)||_(t)){w(t);this.navigateWithArrowKey(t);this.updateFocus()}if(m(t)){w(t);this.selectedFocusedOption()}if(g(t)){this.cancel()}if(y(t)&&this.typeahead&&this.multiple){if(this.inputElement.value===""&&x(this.rawValue)>0){e=j(this.rawValue);this.removeValue(e[x(this.rawValue)-1])}}if(!this.typeahead&&t.key.length===1){this.focusOptionByLabel(t.key)}if(b(t)&&!this.typeahead){w(t)}return[3,4];case 1:if(!this.hasFocus)return[3,4];if(!(p(t)||_(t)))return[3,3];w(t);return[4,this.open()];case 2:i.sent();i.label=3;case 3:if(!this.typeahead&&t.key.length===1){this.selectOptionByLabel(t.key)}i.label=4;case 4:return[2]}}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputElement&&!this.disabled))return[3,2];return[4,u()];case 1:t.sent();this.inputElement.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.getValue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.rawValue]}))}))};t.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.focusIndex=-1;if(this.inputElement){this.updateInputValue("");this.updateRawValue([],D);this.value=this.multiple?[]:""}return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(!this.disabled&&!this.readonly&&!a(this.popoverElement)))return[3,2];return[4,this.popoverElement.present()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.disabled&&!this.readonly&&!a(this.popoverElement)){this.blurSelect()}return[2]}))}))};t.prototype.cancel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.labelToScrollTo="";this.close();this.scrollTo(0);this.balCancel.emit();return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=this.options.get(t);if(!a(e)){this.optionSelected(e)}return[2]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.waitForOptionsAndThenUpdateRawValues=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:clearTimeout(this.waitForOptionsAndThenUpdateRawValuesTimer);return[4,h(this.el)];case 1:i.sent();t=this.options.size>0;if(t){if(!this.remote){this.syncRawValue(H)}}else{this.waitForOptionsAndThenUpdateRawValuesTimer=setTimeout((function(){return e.waitForOptionsAndThenUpdateRawValues()}),10)}return[2]}}))}))};t.prototype.updateOptions=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:t=this.getChildOpts();e=new Map;for(i=0;i<t.length;i++){r=t[i];e.set(r.value,{value:r.value,label:r.label,disabled:r.disabled,id:r.for,textContent:r.textContent,innerHTML:r.innerHTML})}if(!this.selectionOptional&&Array.isArray(this.rawValue)){for(i=0;i<this.rawValue.length;i++){n=this.rawValue[i];if(!e.has(n)){o=k(this.rawValue,n);this.updateRawValue(o,H)}}}this.options=new Map(e);if(!!this.typeahead)return[3,2];return[4,this.syncNativeInput()];case 1:s.sent();s.label=2;case 2:if(this.didInit&&!this.remote){this.validateAfterBlur()}return[2]}}))}))};Object.defineProperty(t.prototype,"optionArray",{get:function(){var t=this;var e=Array.from(this.options,(function(t){var e=t[0],i=t[1];return i}));if(!this.typeahead||this.remote){return e}return e.filter((function(e){return t.filter==="includes"?O(e.textContent,t.inputValue):T(e.textContent,t.inputValue)}))},enumerable:false,configurable:true});t.prototype.hasOptions=function(){return this.optionArray.length>0};Object.defineProperty(t.prototype,"inputPlaceholder",{get:function(){if(this.multiple){if(x(this.rawValue)<1){return this.placeholder}return undefined}else{if(!a(this.rawValue)&&x(this.rawValue)>0){return undefined}}return this.placeholder},enumerable:false,configurable:true});t.prototype.getChildOpts=function(){return Array.from(this.el.querySelectorAll("bal-select-option"))};t.prototype.getPopoverContent=function(){return this.popoverElement.querySelector(".bal-popover__content__inner")};t.prototype.updateFocus=function(){var t=this;if(this.focusIndex<-1){this.focusIndex=-1}var e=this.optionArray;if(e.length>0){if(e.length<=this.focusIndex){this.focusIndex=e.length-1}var i=e[this.focusIndex];if(i&&i.id){var r=this.el.querySelector("button#".concat(i.id));if(r){clearTimeout(this.updateFocusTimer);this.updateFocusTimer=setTimeout((function(){t.scrollToFocusedOption(r)}),0)}}}else{this.focusIndex=-1}};t.prototype.scrollToFocusedOption=function(t){if(t&&this.popoverElement){var e=this.getPopoverContent();if(e){var i=t.offsetTop;var r=e.scrollTop;if(i<r){e.scrollTop=i}var n=t.offsetTop+t.clientHeight;var o=e.scrollTop+e.clientHeight;if(n>o){e.scrollTop=e.scrollTop+t.clientHeight}}}};t.prototype.scrollTo=function(t){var e=this.getPopoverContent();if(e){e.scrollTop=t}};t.prototype.selectedFocusedOption=function(){var t=this.optionArray;if(t.length>this.focusIndex){var e=t[this.focusIndex];if(e){this.optionSelected(e)}}};t.prototype.navigateWithArrowKey=function(t){if(p(t)){this.focusIndex=this.focusIndex+1}else{if(_(t)){this.focusIndex=this.focusIndex-1}}};t.prototype.focusOptionByLabel=function(t){var e=this;this.labelToScrollTo=this.labelToScrollTo+t;clearTimeout(this.clearScrollToValue);this.clearScrollToValue=setTimeout((function(){e.scrollToLabel(e.labelToScrollTo)}),600)};t.prototype.selectOptionByLabel=function(t){var e=this;this.labelToSelectTo=this.labelToSelectTo+t;clearTimeout(this.clearSelectValue);this.clearSelectValue=setTimeout((function(){e.selectLabel(e.labelToSelectTo);e.labelToSelectTo=""}),600)};t.prototype.selectLabel=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){if(t!==" "){e=this.optionArray.find((function(e){return T(e.label||"",t)}));if(!a(e)&&e.id){i=this.el.querySelector("button#".concat(e.id));if(!a(i)){r=this.optionArray.indexOf(e);this.focusIndex=r;this.select(e.value)}}this.labelToScrollTo=""}return[2]}))}))};t.prototype.scrollToLabel=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){if(t!==" "){e=this.optionArray.find((function(e){return T(e.label||"",t)}));if(!a(e)&&e.id){i=this.el.querySelector("button#".concat(e.id));if(!a(i)){r=this.optionArray.indexOf(e);this.focusIndex=r;this.scrollTo(i.offsetTop)}}this.labelToScrollTo=""}return[2]}))}))};t.prototype.syncRawValue=function(t){if(t===void 0){t=true}var e=[];if(!a(this.value)&&this.value!==""){if(Array.isArray(this.value)){e=__spreadArray([],this.value.filter((function(t){return!a(t)})),true)}else{if(this.value.split("").includes(",")){e=__spreadArray([],this.value.split(",").filter((function(t){return t})).map((function(t){return t.trim()})),true)}else{e=[this.value]}}}this.updateRawValue(e,t)};t.prototype.blurSelect=function(){this.popoverElement.dismiss()};t.prototype.optionSelected=function(t){var e=j(this.rawValue);var i=e.some((function(e){return e===t.value}));this.updateValue(t.value,!i);if(!this.multiple){this.blurSelect()}else{if(this.typeahead){this.setFocus()}}};t.prototype.updateValue=function(t,e){if(e===void 0){e=true}if(this.multiple){if(e){this.updateRawValue(A(this.rawValue,t,this.multiple),D)}else{this.updateRawValue(k(this.rawValue,t),D)}}else{this.updateRawValue(A(this.rawValue,t,this.multiple),D);if(this.rawValue&&this.rawValue.length>0){this.updateInputValue(C(this.options,this.rawValue[0]))}}};t.prototype.validateAfterBlur=function(t){if(t===void 0){t=H}var e=this.rawValue;if(this.didInit&&!this.multiple){if(this.typeahead&&(this.selectionOptional||this.remote)){var i=z(this.options,this.inputElement.value);if(i){e=[i.value]}else{e=[this.inputElement.value]}}else{e=M(this.rawValue,this.options,this.inputElement.value)}this.updateRawValue(e,t)}};t.prototype.syncNativeInput=function(){if(!this.multiple){if(x(this.rawValue)>0){var t=j(this.rawValue);var e=C(this.options,t[0]);if(!this.multiple&&this.typeahead&&this.selectionOptional&&e===""){e=t.join(", ")}return this.updateInputValue(e)}}return Promise.resolve()};t.prototype.updateInputValue=function(t){var e=this;return new Promise((function(i){if(e.updateInputValueTimer){clearTimeout(e.updateInputValueTimer)}e.updateInputValueTimer=setTimeout((function(){if(!a(e.inputElement)){e.inputElement.value=t;e.inputValue=t;i()}}),0)}))};t.prototype.isChipClicked=function(t){var e=false;if(this.multiple){var i=this.selectionEl.querySelectorAll("bal-tag");var r=t.target;i.forEach((function(t){var i=f(t,r)||t===r;if(i){e=i}}))}return e};t.prototype.isInsideOfFooter=function(){this.inverted=this.el.closest("bal-footer")!==null};t.prototype.render=function(){var t=this;var e;var i=function(e){return r("bal-tag",{size:"",closable:!t.disabled,disabled:t.disabled,invalid:t.invalid,tabindex:-1,onBalCloseClick:function(i){return t.removeValue(e.value)},"data-testid":"bal-select-chip"},C(t.options,e.value)||e.value)};var o=j(this.rawValue);var s=B.block("select");var l=s.element("native");var a=s.element("control");var c=a.element("icon");var u=a.element("selections");var h=a.element("input");var f=s.element("popover");var d=f.element("empty");var b=s.element("option");var v=b.element("content");var p=v.element("checkbox");var _=v.element("label");return r(n,{role:"listbox",onClick:this.handleClick,"aria-disabled":this.disabled?"true":null,"data-value":(e=this.rawValue)===null||e===void 0?void 0:e.map((function(e){return C(t.options,e)})).join(","),class:Object.assign(Object.assign(Object.assign(Object.assign({},s.class()),s.modifier("disabled").class(this.disabled||this.readonly)),s.modifier("inverted").class(this.inverted)),s.modifier("inverted-footer").class(this.inverted))},r("select",{class:Object.assign({},l.class()),name:this.name,multiple:this.multiple,required:this.required,tabindex:-1,ref:function(e){return t.nativeSelectEl=e}},o.map((function(t){return r("option",{key:t,value:t,selected:true},t)}))),r("bal-popover",{onBalChange:this.handlePopoverChange,ref:function(e){return t.popoverElement=e}},r("div",{"bal-popover-trigger":true,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a.class()),a.modifier("invalid").class(this.invalid)),a.modifier("disabled").class(this.disabled||this.readonly)),a.modifier("focused").class(this.isPopoverOpen)),a.modifier("inverted-footer").class(this.inverted))},r("div",{class:Object.assign(Object.assign({},u.class()),u.modifier("clickable").class(!this.isPopoverOpen&&!this.disabled&&!this.readonly)),onClick:this.handleInputClick,ref:function(e){return t.selectionEl=e}},o.filter((function(e){return t.multiple})).map((function(t){return r(i,{value:t})})),r("input",{type:"text",class:Object.assign(Object.assign({},h.class()),{input:true,"is-inverted":this.inverted,"is-danger":this.invalid,"is-disabled":this.disabled||this.readonly,"is-clickable":!this.isPopoverOpen&&!this.disabled&&!this.readonly,"data-test-select-input":true}),id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":this.disabled?"true":null,"data-testid":"bal-select-input",autocomplete:this.autocomplete,placeholder:this.inputPlaceholder,readonly:!this.typeahead||this.disabled||this.readonly,contentEditable:this.typeahead,disabled:this.disabled,maxLength:this.maxLength,tabindex:this.balTabindex,onInput:this.handleInput,onClick:this.handleInputClick,onChange:this.handleInputChange,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onKeyPress:this.handleKeyPress,ref:function(e){return t.inputElement=e}})),!this.freeSolo&&!this.loading?r("bal-icon",{class:Object.assign(Object.assign(Object.assign({},c.class()),c.modifier("loading").class(this.loading)),c.modifier("clickable").class(!this.disabled&&!this.readonly)),name:!this.inverted?"caret-down":"caret-up",color:this.disabled||this.readonly?"grey-light":this.inverted?"white":this.invalid?"danger":"primary",turn:this.isPopoverOpen,onClick:function(e){return t.handleInputClick(e,true)},size:!this.inverted?"":"x-small"}):""),r("bal-popover-content",{class:Object.assign({},f.class()),scrollable:this.scrollable,spaceless:true,expanded:true},this.optionArray.map((function(e,i){return r("button",{key:e.value,type:"button",role:"option",id:e.id,"data-value":e.value,"data-label":e.label,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},b.class()),b.modifier("selected").class(o.includes(e.value)&&!(t.typeahead&&!t.multiple))),b.modifier("focused").class(t.focusIndex===i)),b.modifier("checkbox").class(t.multiple)),b.modifier("disabled").class(e.disabled===true)),"data-testid":"bal-select-option",disabled:e.disabled,tabIndex:-1,onMouseEnter:function(){return t.handleOptionMouseEnter(i)},onClick:function(){return t.optionSelected(e)}},r("div",{class:Object.assign({},v.class())},r("span",{class:Object.assign({},p.class()),style:{display:t.multiple?"flex":"none"}},r("bal-checkbox",{checked:o.includes(e.value),tabindex:-1,nonSubmit:true,flat:true,onBalChange:w})),r("span",{class:Object.assign({},_.class()),innerHTML:e.innerHTML})))})),r("div",{class:Object.assign(Object.assign({},d.class()),d.modifier("hidden").class(this.noDataLabel===undefined||this.hasOptions()||!this.typeahead||this.selectionOptional))},this.noDataLabel))))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueWatcher"]}},enumerable:false,configurable:true});return t}());s([P("bal-select"),l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],K.prototype,"createLogger",null);var N=0;K.style=S;var U=t("bal_select_option",function(){function t(t){e(this,t);this.label=undefined;this.disabled=false;this.value=undefined;this.for="bal-selopt-".concat(q++)}t.prototype.createLogger=function(t){this.log=t};t.prototype.render=function(){return r(n,{style:{display:"none"}},r("slot",null))};return t}());s([P("bal-select-option"),l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],U.prototype,"createLogger",null);var q=0}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,r){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function s(t){try{a(r.next(t))}catch(t){o(t)}}function l(t){try{a(r["throw"](t))}catch(t){o(t)}}function a(t){t.done?i(t.value):n(t.value).then(s,l)}a((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(t){return function(e){return a([t,e])}}function a(l){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(i=0)),i)try{if(r=1,n&&(o=l[0]&2?n["return"]:l[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;if(n=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;n=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(l[0]===6&&i.label<o[1]){i.label=o[1];o=l;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(l);break}if(o[2])i.ops.pop();i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t];n=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var r=0,n=e.length,o;r<n;r++){if(o||!(r in e)){if(!o)o=Array.prototype.slice.call(e,0,r);o[r]=e[r]}}return t.concat(o||Array.prototype.slice.call(e))};System.register(["./p-456fc561.system.js","./p-6dbef894.system.js","./p-6913b916.system.js","./p-8954495d.system.js","./p-8a87b9a8.system.js","./p-b79d8942.system.js","./p-d2ee9b0a.system.js","./p-db0895e2.system.js","./p-23bdd8dc.system.js","./p-6e5745c8.system.js","./p-a1f6e944.system.js","./p-b3f2c626.system.js","./p-145d5c4e.system.js","./p-2880433e.system.js"],(function(t){"use strict";var e,i,r,n,o,s,l,a,c,u,h,f,d,b,v,p,_,m,g,y,k,w,x,j,O,T,A,C,z,M,L,B,P,F;return{setters:[function(t){e=t.r;i=t.c;r=t.h;n=t.H;o=t.g},function(t){s=t._;l=t.a},function(t){a=t.l},function(t){c=t.k;u=t.d;h=t.e;f=t.i;d=t.h},function(t){b=t.e;v=t.o;p=t.q;_=t.s;m=t.h;g=t.u;y=t.y},function(t){k=t.r;w=t.p;x=t.l;j=t.g;O=t.i;T=t.s;A=t.a;C=t.f;z=t.b;M=t.v},function(t){L=t.s},function(t){B=t.B},function(t){P=t.L},function(t){F=t.d},function(){},function(){},function(){},function(){}],execute:function(){var I=function(t,e,i){if(typeof MutationObserver==="undefined"){return}var r=new MutationObserver((function(t){t=t.filter((function(t){return t.target.nodeName===e.toUpperCase()||t.target.nodeName==="bal-select".toUpperCase()}));if(t.length>0){i(undefined)}}));r.observe(t,{childList:true,subtree:true,attributes:true,characterData:true});return r};var E=":root{--bal-select-control-background:var(--bal-color-white);--bal-select-control-background-hover:var(--bal-form-field-control-background-hover);--bal-select-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-select-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-select-control-input-background:var(--bal-color-grey-1);--bal-select-control-native-input-background:transparent;--bal-select-control-native-input-background-hover:transparent;--bal-select-control-input-inverted-footer-background:transparent;--bal-select-control-input-inverted-footer-background-hover:transparent;--bal-select-control-input-multiple-background:transparent;--bal-select-control-input-multiple-background-read-only-selection:transparent;--bal-select-control-input-option-background:transparent;--bal-select-control-input-option-background-selected:var(--bal-color-primary-1);--bal-select-control-input-option-background-focused:var(--bal-color-grey-2);--bal-select-control-input-option-background-hover:var(--bal-color-grey-2);--bal-select-control-border-radius:var(--bal-form-field-control-radius);--bal-select-popover-border-color:var(--bal-color-grey-2);--bal-select-control-border-color:var(--bal-form-field-control-border-color);--bal-select-control-border-color-focused:var(--bal-color-primary);--bal-select-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-select-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-select-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-select-control-border-color-focus-within:var(--bal-color-primary);--bal-select-option-border-top-color:var(--bal-color-grey-2);--bal-select-popover-empty-text-color:var(--bal-form-field-control-color);--bal-select-control-text-color:var(--bal-form-field-control-color);--bal-select-control-text-color-focused:var(--bal-color-primary);--bal-select-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-select-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-select-option-content-label-text-color:var(--bal-form-field-control-color)}bal-select-option{display:none !important}.bal-select{display:block;position:relative;width:100%;-ms-flex:1;flex:1;font-family:var(--bal-font-family-text)}.bal-select__popover{border:.125rem solid var(--bal-select-popover-border-color)}.bal-select__popover__empty{padding:.5rem 1rem;font-family:var(--bal-font-family-text);color:var(--bal-select-popover-empty-text-color)}.bal-select__popover__empty--hidden{display:none}.bal-select__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-select__control{display:-ms-flexbox;display:flex;border-width:.125rem;border-style:solid;border-color:var(--bal-select-control-border-color);border-radius:var(--bal-select-control-border-radius);background:var(--bal-select-control-background);font-size:var(--bal-font-weight-regular);font-family:var(--bal-font-family-text);color:var(--bal-select-control-text-color);outline:none;-webkit-box-shadow:none;box-shadow:none;padding-right:1rem;min-height:3rem}.bal-select__control--focused{border-color:var(--bal-select-control-border-color-focused)}.bal-select__control:not(.bal-select__control--disabled):not(.bal-select__control--invalid):not(.bal-select__control--inverted-footer):hover{border-color:var(--bal-select-control-border-color-hover);background-color:var(--bal-select-control-background-hover)}.bal-select__control:not(.bal-select__control--disabled):not(.bal-select__control--invalid):not(.bal-select__control--inverted-footer):hover .bal-select__control__input{background-color:var(--bal-select-control-input-background)}.bal-select__control--invalid:not(.bal-select__control--disabled){border-color:var(--bal-select-control-border-color-invalid) !important;background:var(--bal-select-control-background-invalid) !important}.bal-select__control:focus-within{border-color:var(--bal-select-control-border-color-focus-within) !important}.bal-select__control--disabled{background-color:var(--bal-select-control-background-disabled) !important;border-color:var(--bal-select-control-border-color-disabled) !important}.bal-select__control--disabled,.bal-select__control--disabled input{cursor:default !important;-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;pointer-events:none !important;color:var(--bal-select-input-text-color-disabled)}.bal-select__control--inverted-footer{border:none;background-color:var(--bal-select-control-input-inverted-footer-background) !important;padding-right:0}.bal-select__control--inverted-footer:hover{background-color:var(--bal-select-control-input-inverted-footer-background-hover) !important}.bal-select__control--inverted-footer .input{color:var(--bal-select-control-inverted-footer-native-input-text-color);background-color:var(--bal-select-control-native-input-background) !important}.bal-select__control--inverted-footer .input:hover{background-color:var(--bal-select-control-native-input-background-hover) !important}.bal-select__control__icon{min-height:100% !important;max-height:100% !important}.bal-select__control__icon--loading{display:none}.bal-select__control__icon--clickable{cursor:pointer}.bal-select__control__selections{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex:1 1;flex:1 1;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:1.125rem;max-width:100%;min-width:0;gap:0;padding-left:.375rem}.bal-select__control__selections .bal-tag{margin-left:.25rem;margin-top:.375rem;margin-bottom:.375rem}.bal-select__control__selections .bal-tag+.input{padding-left:.625rem}.bal-select__control__input{border:none !important;outline:none !important;outline-width:0 !important;height:2.75rem !important;-webkit-box-shadow:none !important;box-shadow:none !important;background:var(--bal-select-control-input-multiple-background);-ms-flex:1;flex:1;min-height:2.75rem !important;padding-left:.25rem !important;padding-right:.625rem !important;text-overflow:ellipsis}.bal-select__control__input:-moz-read-only{-moz-user-select:none !important;user-select:none !important;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bal-select__control__input:read-only{-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bal-select__control__input:read-only::-moz-selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:-moz-read-only::selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:read-only::selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:-moz-read-only::-moz-selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__control__input:read-only::-moz-selection{background:var(--bal-select-control-input-multiple-background-read-only-selection)}.bal-select__option{visibility:visible;font-family:var(--bal-font-family-text);background:var(--bal-select-control-input-option-background);border:none;cursor:pointer;outline:none;min-height:3rem;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0;margin:0;border-top:.125rem solid var(--bal-select-option-border-top-color);text-align:inherit;white-space:nowrap;width:100%}.bal-select__option:first-child{border-top:none}.bal-select__option::-moz-focus-inner{border:none}.bal-select__option--selected{background:var(--bal-select-control-input-option-background-selected)}.bal-select__option--selected .bal-select__option__content__label{font-weight:var(--bal-font-weight-bold)}.bal-select__option--focused{background:var(--bal-select-control-input-option-background-focused)}.bal-select__option:hover{background:var(--bal-select-control-input-option-background-hover)}.bal-select__option__content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;min-height:3rem;padding:.75rem 1rem;gap:.75rem}.bal-select__option__content__checkbox{margin:0;padding:0}.bal-select__option__content__label{margin:0;padding:0;font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-select-option-content-label-text-color);line-height:1.125rem;word-break:break-word;white-space:normal;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}";var S=E;var D=true;var H=false;var K=t("bal_select",function(){function t(t){var r=this;e(this,t);this.balChange=i(this,"balChange",7);this.balInputClick=i(this,"balInputClick",7);this.balInput=i(this,"balInput",7);this.balBlur=i(this,"balBlur",7);this.balFocus=i(this,"balFocus",7);this.balCancel=i(this,"balCancel",7);this.balKeyPress=i(this,"balKeyPress",7);this.didInit=false;this.inputId="bal-select-".concat(N++);this.initialValue=[];this.removeValue=function(t){if(!r.disabled){r.updateRawValue(k(r.rawValue,t),D);if(r.multiple&&r.typeahead){r.setFocus()}r.fireBlur()}};this.fireBlur=function(t){if(t===void 0){t=new CustomEvent("blur")}if(!r.isPopoverOpen&&!r.hasFocus){c((function(){return r.balBlur.emit(t)}))}};this.handleClick=function(t){if(r.disabled||r.readonly){w(t)}};this.handlePopoverChange=function(t){t.stopPropagation();if(r.isPopoverOpen!==t.detail){r.isPopoverOpen=t.detail;if(r.isPopoverOpen){r.updateFocus()}else{r.focusIndex=-1;if(r.multiple&&r.typeahead){r.updateInputValue("")}r.fireBlur(t)}}};this.handleInputBlur=function(t){w(t);var e=t.relatedTarget;if(e===null||e&&e.nodeName&&(e.nodeName==="BAL-MODAL"||e.nodeName==="INPUT"||e.nodeName==="BUTTON")){r.validateAfterBlur(D)}r.hasFocus=false;r.fireBlur(t)};this.handleInputFocus=function(t){r.balFocus.emit(t);r.hasFocus=true};this.handleInputClick=function(t,e){if(e===void 0){e=false}return __awaiter(r,void 0,void 0,(function(){var i,r,n,o;return __generator(this,(function(s){switch(s.label){case 0:L(t);if(this.isChipClicked(t)){return[2]}if(!(this.disabled||this.readonly))return[3,1];w(t);return[3,10];case 1:this.focusIndex=-1;this.balInputClick.emit(t);if(!this.typeahead)return[3,6];if(!(this.isPopoverOpen&&e))return[3,3];return[4,(i=this.popoverElement)===null||i===void 0?void 0:i.dismiss()];case 2:s.sent();return[3,5];case 3:return[4,(r=this.popoverElement)===null||r===void 0?void 0:r.present()];case 4:s.sent();s.label=5;case 5:return[3,10];case 6:if(!this.isPopoverOpen)return[3,8];return[4,(n=this.popoverElement)===null||n===void 0?void 0:n.dismiss()];case 7:s.sent();return[3,10];case 8:return[4,(o=this.popoverElement)===null||o===void 0?void 0:o.present()];case 9:s.sent();s.label=10;case 10:return[2]}}))}))};this.handleKeyPress=function(t){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!(!this.isPopoverOpen&&b(t)))return[3,2];w(t);return[4,this.open()];case 1:e.sent();e.label=2;case 2:this.balKeyPress.emit(t);return[2]}}))}))};this.handleInputChange=function(t){if(!r.disabled&&!r.readonly){r.inputValue=t.target.value}};this.handleInput=function(t){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.disabled&&!this.readonly){this.inputValue=t.target.value;if(!this.isPopoverOpen){this.popoverElement.present()}this.focusIndex=-1;this.updateFocus();w(t);this.balInput.emit(this.inputValue)}return[2]}))}))};this.handleOptionMouseEnter=function(t){r.focusIndex=t};this.hasFocus=false;this.inputValue="";this.focusIndex=-1;this.isPopoverOpen=false;this.options=new Map;this.labelToScrollTo="";this.labelToSelectTo="";this.ariaForm=F;this.name=this.inputId;this.invalid=false;this.filter="includes";this.balTabindex=0;this.freeSolo=false;this.multiple=false;this.maxLength=undefined;this.noDataLabel=undefined;this.autocomplete="off";this.typeahead=false;this.selectionOptional=false;this.disabled=false;this.readonly=false;this.required=false;this.inverted=false;this.placeholder=undefined;this.scrollable=250;this.loading=false;this.remote=false;this.autoInvalidOff=false;this.value=[];this.rawValue=[]}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueWatcher=function(){this.syncRawValue(false)};t.prototype.updateRawValue=function(t,e){if(e===void 0){e=true}if(!v(t,this.rawValue||[])){this.rawValue=__spreadArray([],t,true);this.syncNativeInput();if(this.didInit&&e===true){if(this.multiple){if(a(this.rawValue)){this.emitChangeEvent([])}else{this.emitChangeEvent(__spreadArray([],this.rawValue,true))}}else{if(a(this.rawValue)||x(this.rawValue)===0){this.emitChangeEvent(undefined)}else{this.emitChangeEvent(this.rawValue[0])}}}}};t.prototype.emitChangeEvent=function(t){this.balChange.emit(t)};t.prototype.connectedCallback=function(){var t=this;var e=d((function(){return t.updateOptions()}),0);this.initialValue=this.value;e();this.mutationO=I(this.el,"bal-select-option",(function(){e()}))};t.prototype.componentWillLoad=function(){this.waitForOptionsAndThenUpdateRawValues();this.isInsideOfFooter();if(!a(this.rawValue)&&this.options.size>0&&x(this.rawValue)===1){var t=this.options.get(this.rawValue[0]);if(!a(t)){this.inputValue=t.label}}};t.prototype.componentDidLoad=function(){this.syncRawValue(false);if(!this.multiple){this.inputElement.value=this.inputValue}this.didInit=true};t.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}};t.prototype.listenOnClick=function(t){if(this.disabled&&t.target&&t.target===this.el){w(t)}};t.prototype.resetHandler=function(t){var e=this;var i=t.target;if(i===null||i===void 0?void 0:i.contains(this.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){e.value=e.initialValue;e.syncRawValue(false);e.syncNativeInput();if(e.nativeSelectEl){var t=Array.from(e.nativeSelectEl.options);t.forEach((function(t){return t.selected=true}))}}),0)}};t.prototype.handleKeyDown=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:if(!this.isPopoverOpen)return[3,1];if(p(t)||_(t)){w(t);this.navigateWithArrowKey(t);this.updateFocus()}if(m(t)){w(t);this.selectedFocusedOption()}if(g(t)){this.cancel()}if(y(t)&&this.typeahead&&this.multiple){if(this.inputElement.value===""&&x(this.rawValue)>0){e=j(this.rawValue);this.removeValue(e[x(this.rawValue)-1])}}if(!this.typeahead&&t.key.length===1){this.focusOptionByLabel(t.key)}if(b(t)&&!this.typeahead){w(t)}return[3,4];case 1:if(!this.hasFocus)return[3,4];if(!(p(t)||_(t)))return[3,3];w(t);return[4,this.open()];case 2:i.sent();i.label=3;case 3:if(!this.typeahead&&t.key.length===1){this.selectOptionByLabel(t.key)}i.label=4;case 4:return[2]}}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputElement&&!this.disabled))return[3,2];return[4,u()];case 1:t.sent();this.inputElement.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.getValue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.rawValue]}))}))};t.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.focusIndex=-1;if(this.inputElement){this.updateInputValue("");this.updateRawValue([],D);this.value=this.multiple?[]:""}return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(!this.disabled&&!this.readonly&&!a(this.popoverElement)))return[3,2];return[4,this.popoverElement.present()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.disabled&&!this.readonly&&!a(this.popoverElement)){this.blurSelect()}return[2]}))}))};t.prototype.cancel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.labelToScrollTo="";this.close();this.scrollTo(0);this.balCancel.emit();return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=this.options.get(t);if(!a(e)){this.optionSelected(e)}return[2]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.waitForOptionsAndThenUpdateRawValues=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:clearTimeout(this.waitForOptionsAndThenUpdateRawValuesTimer);return[4,h(this.el)];case 1:i.sent();t=this.options.size>0;if(t){if(!this.remote){this.syncRawValue(H)}}else{this.waitForOptionsAndThenUpdateRawValuesTimer=setTimeout((function(){return e.waitForOptionsAndThenUpdateRawValues()}),10)}return[2]}}))}))};t.prototype.updateOptions=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:t=this.getChildOpts();e=new Map;for(i=0;i<t.length;i++){r=t[i];e.set(r.value,{value:r.value,label:r.label,disabled:r.disabled,id:r.for,textContent:r.textContent,innerHTML:r.innerHTML})}if(!this.selectionOptional&&Array.isArray(this.rawValue)){for(i=0;i<this.rawValue.length;i++){n=this.rawValue[i];if(!e.has(n)){o=k(this.rawValue,n);this.updateRawValue(o,H)}}}this.options=new Map(e);if(!!this.typeahead)return[3,2];return[4,this.syncNativeInput()];case 1:s.sent();s.label=2;case 2:if(this.didInit&&!this.remote){this.validateAfterBlur()}return[2]}}))}))};Object.defineProperty(t.prototype,"optionArray",{get:function(){var t=this;var e=Array.from(this.options,(function(t){var e=t[0],i=t[1];return i}));if(!this.typeahead||this.remote){return e}return e.filter((function(e){return t.filter==="includes"?O(e.textContent,t.inputValue):T(e.textContent,t.inputValue)}))},enumerable:false,configurable:true});t.prototype.hasOptions=function(){return this.optionArray.length>0};Object.defineProperty(t.prototype,"inputPlaceholder",{get:function(){if(this.multiple){if(x(this.rawValue)<1){return this.placeholder}return undefined}else{if(!a(this.rawValue)&&x(this.rawValue)>0){return undefined}}return this.placeholder},enumerable:false,configurable:true});t.prototype.getChildOpts=function(){return Array.from(this.el.querySelectorAll("bal-select-option"))};t.prototype.getPopoverContent=function(){return this.popoverElement.querySelector(".bal-popover__content__inner")};t.prototype.updateFocus=function(){var t=this;if(this.focusIndex<-1){this.focusIndex=-1}var e=this.optionArray;if(e.length>0){if(e.length<=this.focusIndex){this.focusIndex=e.length-1}var i=e[this.focusIndex];if(i&&i.id){var r=this.el.querySelector("button#".concat(i.id));if(r){clearTimeout(this.updateFocusTimer);this.updateFocusTimer=setTimeout((function(){t.scrollToFocusedOption(r)}),0)}}}else{this.focusIndex=-1}};t.prototype.scrollToFocusedOption=function(t){if(t&&this.popoverElement){var e=this.getPopoverContent();if(e){var i=t.offsetTop;var r=e.scrollTop;if(i<r){e.scrollTop=i}var n=t.offsetTop+t.clientHeight;var o=e.scrollTop+e.clientHeight;if(n>o){e.scrollTop=e.scrollTop+t.clientHeight}}}};t.prototype.scrollTo=function(t){var e=this.getPopoverContent();if(e){e.scrollTop=t}};t.prototype.selectedFocusedOption=function(){var t=this.optionArray;if(t.length>this.focusIndex){var e=t[this.focusIndex];if(e){this.optionSelected(e)}}};t.prototype.navigateWithArrowKey=function(t){if(p(t)){this.focusIndex=this.focusIndex+1}else{if(_(t)){this.focusIndex=this.focusIndex-1}}};t.prototype.focusOptionByLabel=function(t){var e=this;this.labelToScrollTo=this.labelToScrollTo+t;clearTimeout(this.clearScrollToValue);this.clearScrollToValue=setTimeout((function(){e.scrollToLabel(e.labelToScrollTo)}),600)};t.prototype.selectOptionByLabel=function(t){var e=this;this.labelToSelectTo=this.labelToSelectTo+t;clearTimeout(this.clearSelectValue);this.clearSelectValue=setTimeout((function(){e.selectLabel(e.labelToSelectTo);e.labelToSelectTo=""}),600)};t.prototype.selectLabel=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){if(t!==" "){e=this.optionArray.find((function(e){return T(e.label||"",t)}));if(!a(e)&&e.id){i=this.el.querySelector("button#".concat(e.id));if(!a(i)){r=this.optionArray.indexOf(e);this.focusIndex=r;this.select(e.value)}}this.labelToScrollTo=""}return[2]}))}))};t.prototype.scrollToLabel=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){if(t!==" "){e=this.optionArray.find((function(e){return T(e.label||"",t)}));if(!a(e)&&e.id){i=this.el.querySelector("button#".concat(e.id));if(!a(i)){r=this.optionArray.indexOf(e);this.focusIndex=r;this.scrollTo(i.offsetTop)}}this.labelToScrollTo=""}return[2]}))}))};t.prototype.syncRawValue=function(t){if(t===void 0){t=true}var e=[];if(!a(this.value)&&this.value!==""){if(Array.isArray(this.value)){e=__spreadArray([],this.value.filter((function(t){return!a(t)})),true)}else{if(this.value.split("").includes(",")){e=__spreadArray([],this.value.split(",").filter((function(t){return t})).map((function(t){return t.trim()})),true)}else{e=[this.value]}}}this.updateRawValue(e,t)};t.prototype.blurSelect=function(){this.popoverElement.dismiss()};t.prototype.optionSelected=function(t){var e=j(this.rawValue);var i=e.some((function(e){return e===t.value}));this.updateValue(t.value,!i);if(!this.multiple){this.blurSelect()}else{if(this.typeahead){this.setFocus()}}};t.prototype.updateValue=function(t,e){if(e===void 0){e=true}if(this.multiple){if(e){this.updateRawValue(A(this.rawValue,t,this.multiple),D)}else{this.updateRawValue(k(this.rawValue,t),D)}}else{this.updateRawValue(A(this.rawValue,t,this.multiple),D);if(this.rawValue&&this.rawValue.length>0){this.updateInputValue(C(this.options,this.rawValue[0]))}}};t.prototype.validateAfterBlur=function(t){if(t===void 0){t=H}var e=this.rawValue;if(this.didInit&&!this.multiple){if(this.typeahead&&(this.selectionOptional||this.remote)){var i=z(this.options,this.inputElement.value);if(i){e=[i.value]}else{e=[this.inputElement.value]}}else{e=M(this.rawValue,this.options,this.inputElement.value)}this.updateRawValue(e,t)}};t.prototype.syncNativeInput=function(){if(!this.multiple){if(x(this.rawValue)>0){var t=j(this.rawValue);var e=C(this.options,t[0]);if(!this.multiple&&this.typeahead&&this.selectionOptional&&e===""){e=t.join(", ")}return this.updateInputValue(e)}}return Promise.resolve()};t.prototype.updateInputValue=function(t){var e=this;return new Promise((function(i){if(e.updateInputValueTimer){clearTimeout(e.updateInputValueTimer)}e.updateInputValueTimer=setTimeout((function(){if(!a(e.inputElement)){e.inputElement.value=t;e.inputValue=t;i()}}),0)}))};t.prototype.isChipClicked=function(t){var e=false;if(this.multiple){var i=this.selectionEl.querySelectorAll("bal-tag");var r=t.target;i.forEach((function(t){var i=f(t,r)||t===r;if(i){e=i}}))}return e};t.prototype.isInsideOfFooter=function(){this.inverted=this.el.closest("bal-footer")!==null};t.prototype.render=function(){var t=this;var e;var i=function(e){return r("bal-tag",{size:"",closable:!t.disabled,disabled:t.disabled,invalid:t.invalid,tabindex:-1,onBalCloseClick:function(i){return t.removeValue(e.value)},"data-testid":"bal-select-chip"},C(t.options,e.value)||e.value)};var o=j(this.rawValue);var s=B.block("select");var l=s.element("native");var a=s.element("control");var c=a.element("icon");var u=a.element("selections");var h=a.element("input");var f=s.element("popover");var d=f.element("empty");var b=s.element("option");var v=b.element("content");var p=v.element("checkbox");var _=v.element("label");return r(n,{role:"listbox",onClick:this.handleClick,"aria-disabled":this.disabled?"true":null,"data-value":(e=this.rawValue)===null||e===void 0?void 0:e.map((function(e){return C(t.options,e)})).join(","),class:Object.assign(Object.assign(Object.assign(Object.assign({},s.class()),s.modifier("disabled").class(this.disabled||this.readonly)),s.modifier("inverted").class(this.inverted)),s.modifier("inverted-footer").class(this.inverted))},r("select",{class:Object.assign({},l.class()),name:this.name,multiple:this.multiple,required:this.required,tabindex:-1,ref:function(e){return t.nativeSelectEl=e}},o.map((function(t){return r("option",{key:t,value:t,selected:true},t)}))),r("bal-popover",{onBalChange:this.handlePopoverChange,ref:function(e){return t.popoverElement=e}},r("div",{"bal-popover-trigger":true,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a.class()),a.modifier("invalid").class(this.invalid)),a.modifier("disabled").class(this.disabled||this.readonly)),a.modifier("focused").class(this.isPopoverOpen)),a.modifier("inverted-footer").class(this.inverted))},r("div",{class:Object.assign(Object.assign({},u.class()),u.modifier("clickable").class(!this.isPopoverOpen&&!this.disabled&&!this.readonly)),onClick:this.handleInputClick,ref:function(e){return t.selectionEl=e}},o.filter((function(e){return t.multiple})).map((function(t){return r(i,{value:t})})),r("input",{type:"text",class:Object.assign(Object.assign({},h.class()),{input:true,"is-inverted":this.inverted,"is-danger":this.invalid,"is-disabled":this.disabled||this.readonly,"is-clickable":!this.isPopoverOpen&&!this.disabled&&!this.readonly,"data-test-select-input":true}),id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":this.disabled?"true":null,"data-testid":"bal-select-input",autocomplete:this.autocomplete,"aria-autocomplete":this.autocomplete==="off"?"none":null,placeholder:this.inputPlaceholder,readonly:!this.typeahead||this.disabled||this.readonly,contentEditable:this.typeahead,disabled:this.disabled,maxLength:this.maxLength,tabindex:this.balTabindex,onInput:this.handleInput,onClick:this.handleInputClick,onChange:this.handleInputChange,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onKeyPress:this.handleKeyPress,ref:function(e){return t.inputElement=e}})),!this.freeSolo&&!this.loading?r("bal-icon",{class:Object.assign(Object.assign(Object.assign({},c.class()),c.modifier("loading").class(this.loading)),c.modifier("clickable").class(!this.disabled&&!this.readonly)),name:!this.inverted?"caret-down":"caret-up",color:this.disabled||this.readonly?"grey-light":this.inverted?"white":this.invalid?"danger":"primary",turn:this.isPopoverOpen,onClick:function(e){return t.handleInputClick(e,true)},size:!this.inverted?"":"x-small"}):""),r("bal-popover-content",{class:Object.assign({},f.class()),scrollable:this.scrollable,spaceless:true,expanded:true},this.optionArray.map((function(e,i){return r("button",{key:e.value,type:"button",role:"option",id:e.id,"data-value":e.value,"data-label":e.label,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},b.class()),b.modifier("selected").class(o.includes(e.value)&&!(t.typeahead&&!t.multiple))),b.modifier("focused").class(t.focusIndex===i)),b.modifier("checkbox").class(t.multiple)),b.modifier("disabled").class(e.disabled===true)),"data-testid":"bal-select-option",disabled:e.disabled,tabIndex:-1,onMouseEnter:function(){return t.handleOptionMouseEnter(i)},onClick:function(){return t.optionSelected(e)}},r("div",{class:Object.assign({},v.class())},r("span",{class:Object.assign({},p.class()),style:{display:t.multiple?"flex":"none"}},r("bal-checkbox",{checked:o.includes(e.value),tabindex:-1,nonSubmit:true,flat:true,onBalChange:w})),r("span",{class:Object.assign({},_.class()),innerHTML:e.innerHTML})))})),r("div",{class:Object.assign(Object.assign({},d.class()),d.modifier("hidden").class(this.noDataLabel===undefined||this.hasOptions()||!this.typeahead||this.selectionOptional))},this.noDataLabel))))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueWatcher"]}},enumerable:false,configurable:true});return t}());s([P("bal-select"),l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],K.prototype,"createLogger",null);var N=0;K.style=S;var U=t("bal_select_option",function(){function t(t){e(this,t);this.label=undefined;this.disabled=false;this.value=undefined;this.for="bal-selopt-".concat(q++)}t.prototype.createLogger=function(t){this.log=t};t.prototype.render=function(){return r(n,{style:{display:"none"}},r("slot",null))};return t}());s([P("bal-select-option"),l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],U.prototype,"createLogger",null);var q=0}}}));
@@ -1 +1 @@
1
- System.register(["./p-46962c31.system.js"],(function(t){"use strict";var n;return{setters:[function(t){n=t.a}],execute:function(){t("L",u);function u(){return function(t,u,e){var i=t.connectedCallback,r=t.disconnectedCallback;t.connectedCallback=function(){n.attach(this);return i&&i.call(this)};t.disconnectedCallback=function(){n.detach(this);return r&&r.call(this)}}}}}}));
1
+ System.register(["./p-5d62da08.system.js"],(function(t){"use strict";var n;return{setters:[function(t){n=t.a}],execute:function(){t("L",u);function u(){return function(t,u,e){var i=t.connectedCallback,r=t.disconnectedCallback;t.connectedCallback=function(){n.attach(this);return i&&i.call(this)};t.disconnectedCallback=function(){n.detach(this);return r&&r.call(this)}}}}}}));
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as s,g as a}from"./p-d7c752c6.js";import{_ as r,a as n}from"./p-43c9f5e9.js";import{k as h,m as l}from"./p-88f18fbc.js";import{i as o}from"./p-dd5e13d1.js";import{r as d,t as c,b as p,g as b,p as u,f as m,i as g,c as f,e as k,h as v,d as y,j as _,n as j,k as w,m as x}from"./p-94efe2aa.js";import{l as O}from"./p-9a3d9e17.js";import{N as D,A as C,i as I}from"./p-ec1efe3d.js";import{i as N}from"./p-ce37dba1.js";import{s as L,g as F,i as M,a as B,b as P,c as S,d as z}from"./p-ad9a7657.js";import{p as A}from"./p-c0c91eb1.js";import{B as H}from"./p-ae86d0a0.js";import{L as T}from"./p-b77e3348.js";import{d as q}from"./p-f385e205.js";import{d as E,a as R}from"./p-a19d1e1d.js";import{b as W}from"./p-71109949.js";import{g as G}from"./p-aafb6696.js";import{L as K}from"./p-eb10ad25.js";import{L as Y}from"./p-69e7c8d6.js";import"./p-a65354df.js";import"./p-2229e98e.js";import"./p-4573c419.js";import"./p-96216bd1.js";import"./p-acf222fd.js";import"./p-5e1cb403.js";function U(t,i){d(2,arguments);var e=c(t),s=p(i);return isNaN(s)?new Date(NaN):s?(e.setDate(e.getDate()+s),e):e}function V(t,i){var e,s,a,r,n,h,l,o;d(1,arguments);var u=b(),m=p(null!==(e=null!==(s=null!==(a=null!==(r=null==i?void 0:i.weekStartsOn)&&void 0!==r?r:null==i||null===(n=i.locale)||void 0===n||null===(h=n.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==a?a:u.weekStartsOn)&&void 0!==s?s:null===(l=u.locale)||void 0===l||null===(o=l.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==e?e:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=c(t),f=g.getDay(),k=(f<m?7:0)+f-m;return g.setDate(g.getDate()-k),g.setHours(0,0,0,0),g}function J(t){d(1,arguments);var i=c(t);return i.setHours(0,0,0,0),i}function Q(t,i){return d(2,arguments),function(t,i){d(2,arguments);var e=c(t),s=p(i);if(isNaN(s))return new Date(NaN);if(!s)return e;var a=e.getDate(),r=new Date(e.getTime());return r.setMonth(e.getMonth()+s+1,0),a>=r.getDate()?r:(e.setFullYear(r.getFullYear(),r.getMonth(),a),e)}(t,12*p(i))}function X(t,i){d(2,arguments);var e=J(t),s=J(i);return e.getTime()===s.getTime()}function Z(t,i){d(2,arguments);var e=c(t),s=c(i);return e.getTime()>s.getTime()}function $(t,i){d(2,arguments);var e=c(t),s=c(i);return e.getTime()<s.getTime()}function tt(t,i,e){d(2,arguments);var s=V(t,e),a=V(i,e);return s.getTime()===a.getTime()}function it(t,i){d(2,arguments);var e=c(t),s=c(i);return e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()}const et=class{constructor(e){t(this,e),this.balChange=i(this,"balChange",7),this.balInput=i(this,"balInput",7),this.balBlur=i(this,"balBlur",7),this.balFocus=i(this,"balFocus",7),this.balInputClick=i(this,"balInputClick",7),this.balIconClick=i(this,"balIconClick",7),this.inputId="bal-dp-"+st++,this.inheritedAttributes={},this.inputValue=this.value,this.onIconClick=t=>{this.disabled||this.readonly||this.popoverElement.toggle(),L(t),this.balIconClick.emit(t)},this.onInputClick=t=>{this.triggerIcon||this.disabled||this.readonly||this.popoverElement.toggle(),L(t),this.triggerIcon||this.balInputClick.emit(t)},this.onPopoverChange=t=>{L(t),this.isPopoverOpen!==t.detail&&(this.isPopoverOpen=t.detail,this.fireBlur(t))},this.onInput=t=>{const i=F(t);if(i&&(this.inputValue=i.value,i.value&&(this.nativeInput.value=this.formatDate(this.inputValue)),this.inputValue&&this.inputValue.length>=6)){const t=u(this.inputValue,this.getLocale()),i=m(t);g(i)&&(this.selectedDate=i,this.updatePointerDates())}this.balInput.emit(this.inputValue)},this.onInputChange=t=>{const i=u(t.target.value,this.getLocale()),e=m(i),s=f(this.getLocale(),i);this.nativeInput.value=s,this.updateValue(e),this.updatePointerDates()},this.onClickDateCell=t=>{t.isDisabled||this.select(t.dateString)},this.onInputKeyUp=t=>{if(k(t)&&!this.triggerIcon&&(this.isPopoverOpen?this.close():this.open()),v(t)&&!this.triggerIcon){const t=u(this.nativeInput.value,this.getLocale()),i=m(t);this.isPopoverOpen&&this.value===i&&this.close()}},this.onInputKeyDown=t=>{const i=y(this.getLocale()),e=[...D,i,...C];!I(t)&&e.indexOf(t.key)<0&&(t.preventDefault(),t.stopPropagation()),"Tab"===t.key&&this.close()},this.onMonthSelect=t=>{const i=t.target.value;this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{day:1,month:parseInt(i,10)})},this.onYearSelect=t=>{const i=parseInt(t.target.value,10);let e;if(this.defaultDate){const t=u(this.defaultDate);if(this.max){const i=u(this.max);t.getMonth()>i.getMonth()&&(e=i.getMonth())}if(this.min){const i=u(this.min);t.getMonth()<i.getMonth()&&(e=i.getMonth())}}this.pointerDate={day:1,year:i,month:void 0!==e?e:this.pointerDate.month}},this.onInputFocus=t=>M(this,t),this.onInputBlur=t=>{A(t),this.focused=!1,this.fireBlur(t)},this.fireBlur=t=>{this.isPopoverOpen||this.focused||h((()=>this.balBlur.emit(t)))},this.handleClick=t=>B(this,t),this.language=E.language,this.region=E.region,this.isMobile=W.isMobile,this.focused=!1,this.isPopoverOpen=!1,this.selectedDate="",this.pointerDate={year:_(j()),month:w(j()),day:x(j())},this.ariaForm=q,this.name=this.inputId,this.invalid=!1,this.required=!1,this.disabled=!1,this.readonly=!1,this.loading=!1,this.placeholder=void 0,this.min=void 0,this.max=void 0,this.closeOnSelect=!0,this.triggerIcon=!1,this.minYearProp=void 0,this.maxYearProp=void 0,this.debounce=0,this.defaultDate=void 0,this.value=void 0,this.allowedDates=void 0,this.autoInvalidOff=!1}createLogger(t){this.log=t}debounceChanged(){this.balChange=l(this.balChange,this.debounce)}valueChanged(){this.selectedDate=this.value,this.updatePointerDates()}listenOnClick(t){P(this,t)}resetHandler(t){const i=t.target;(null==i?void 0:i.contains(this.el))&&(this.resetHandlerTimer&&clearTimeout(this.resetHandlerTimer),this.resetHandlerTimer=setTimeout((()=>{this.nativeInput.value=this.initialValue?f(this.getLocale(),u(this.initialValue)):"",this.selectedDate=this.initialValue,this.updateValue(this.initialValue,!1),this.updatePointerDates()}),0))}breakpointListener(t){this.isMobile=t.mobile}connectedCallback(){this.debounceChanged(),this.initialValue=this.value}componentDidLoad(){this.inputValue=this.value}componentWillLoad(){this.inheritedAttributes=o(this.el,["aria-label","tabindex","title"]),this.selectedDate=this.value,this.updatePointerDates(),this.updateValue(this.value,!1)}async configChanged(t){this.language=t.language,this.region=t.region}async open(){!this.disabled&&this.popoverElement&&this.popoverElement.present()}async close(){!this.disabled&&this.popoverElement&&this.popoverElement.dismiss()}async select(t){var i;this.nativeInput.value=f(this.getLocale(),u(t)),this.updateValue(t),this.updatePointerDates(),this.closeOnSelect&&await(null===(i=this.popoverElement)||void 0===i?void 0:i.toggle())}async setFocus(){S(this)}async setBlur(){z(this)}getInputElement(){return Promise.resolve(this.nativeInput)}async setAriaForm(t){this.ariaForm=Object.assign({},t)}updatePointerDates(){let t=j();if(t.setDate(1),this.selectedDate?t=u(this.selectedDate):this.defaultDate&&(t=u(this.defaultDate)),this.min){const i=u(this.min);i&&t<i&&(t=i)}if(this.max){const i=u(this.max);i&&t>i&&(t=i)}this.pointerDate={year:_(t),month:w(t),day:x(t)}}updateValue(t,i=!0){g(t)||(this.selectedDate=void 0,this.value=void 0,this.nativeInput&&(this.nativeInput.value="")),this.value!==t&&(this.value=t,i&&(this.isDateInRange(u(this.value))||""===this.value)&&this.balChange.emit(this.value))}get minYear(){return this.min?parseInt(this.min.substring(0,4),10):this.minYearProp?this.minYearProp:_(function(t,i){return d(2,arguments),Q(t,-p(i))}(j(),100))}get maxYear(){return this.max?parseInt(this.max.substring(0,4),10):this.maxYearProp?this.maxYearProp:_(Q(j(),100))}get years(){let t=Array.from({length:this.maxYear-this.minYear+1},((t,i)=>this.minYear+i));if(this.min&&this.pointerDate.month===w(u(this.min))){const i=_(u(this.min));t=t.filter((t=>t>=i))}if(this.max&&this.pointerDate.month===w(u(this.max))){const i=_(u(this.max));t=t.filter((t=>t<=i))}return t}get months(){let t=N[this.language].monthsShort.map(((t,i)=>({name:t,index:i})));if(this.min&&this.pointerDate.year===_(u(this.min))){const i=parseInt(this.min.substring(5,7),10)-1;t=t.filter((t=>t.index>=i))}if(this.max&&this.pointerDate.year===_(u(this.max))){const i=parseInt(this.max.substring(5,7),10)-1;t=t.filter((t=>t.index<=i))}return t}get weekDays(){const t=[...N[this.language].weekdaysMin];return t.push(t.shift()||""),t}get firstDateOfBox(){return V(new Date(this.pointerDate.year,this.pointerDate.month,1),{weekStartsOn:1})}getLocale(){const t=G();return t&&t.locale||R}get calendarGrid(){const t=this.firstDateOfBox,i=this.firstDateOfBox;let e=[];do{let s=[];do{s=[...s,{date:new Date(i),display:f(this.getLocale(),i),dateString:m(i),label:x(i).toString(),isToday:X(i,j()),isSelected:void 0!==u(this.selectedDate)&&X(i,u(this.selectedDate)),isDisabled:!this.getAllowedDates(i)||!this.isDateInRange(i),isOutdated:this.pointerDate.month!==i.getMonth()||!this.isDateInRange(i)}],i.setDate(i.getDate()+1)}while(tt(i,t,{weekStartsOn:1}));e=[...e,s],t.setDate(t.getDate()+7)}while(it(new Date(this.pointerDate.year,this.pointerDate.month,this.pointerDate.day),i));return e}getAllowedDates(t){return!!O(this.allowedDates)||this.allowedDates(m(t))}formatDate(t){const i=y(this.getLocale()),e=t.length,s=t.charAt(e-1),a=t.charAt(e-2);return s===i&&(1===e||a===i||t.split(i).filter((t=>t.length>0)).length>=3)?t.substring(0,e-1):5===e&&1===t.split(i)[0].split("").length&&a!==i&&s!==i||(3===e||6===e)&&s!==i&&a!==i&&t.split(i).length<=2?t.substring(0,e-1)+i+t.substring(e-1,e):t}render(){const t=H.block("datepicker"),i=t.element("native"),a=t.element("popup"),r=a.element("body"),n=a.element("footer");return e(s,{onClick:this.handleClick,"aria-disabled":this.disabled?"true":null,class:Object.assign(Object.assign({},t.class()),t.modifier("disabled").class(this.disabled||this.readonly))},e("input",{type:"date",class:Object.assign({},i.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}),e("bal-popover",{onBalChange:this.onPopoverChange,ref:t=>this.popoverElement=t},this.renderInput(),e("bal-popover-content",{spaceless:!0,contentMinWidth:392},e("div",{class:Object.assign({},a.class())},this.renderHeader(),e("div",{class:Object.assign({},r.class())},this.renderGrid()),e("div",{class:Object.assign({},n.class())},e("slot",null))))))}renderInput(){return e("div",{"bal-popover-trigger":!0,class:"control"},e("bal-input-group",{disabled:this.disabled||this.readonly,invalid:this.invalid},e("input",Object.assign({class:{input:!0,"data-test-input":!0,"is-clickable":!this.disabled&&!this.triggerIcon&&!this.readonly,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid},"data-testid":"bal-datepicker-input",ref:t=>this.nativeInput=t,id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":!0===this.invalid?"true":"false","aria-disabled":this.disabled?"true":null,type:"text",maxlength:"10",autoComplete:"off",value:f(this.getLocale(),u(this.value||"")),required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,onKeyDown:t=>this.onInputKeyDown(t),onKeyUp:t=>this.onInputKeyUp(t),onInput:this.onInput,onClick:this.onInputClick,onChange:this.onInputChange,onBlur:this.onInputBlur,onFocus:this.onInputFocus},this.inheritedAttributes)),this.loading?"":e("bal-icon",{class:{"datepicker-trigger-icon":!0,"is-clickable":!this.disabled&&!this.readonly},"is-right":!0,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",name:"date",onClick:this.onIconClick})))}renderGrid(){const t=H.block("datepicker-grid"),i=t.element("row"),s=t.element("cell");return e("div",null,this.renderWeekDayHeader(),e("div",{class:Object.assign({},t.class())},this.calendarGrid.map(((t,a)=>e("div",{key:a,class:Object.assign({},i.class())},t.map((t=>e("button",{key:t.dateString,type:"button","data-date":t.dateString,onClick:()=>this.onClickDateCell(t),disabled:t.isDisabled,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s.class()),{button:!0,"is-text":!t.isDisabled&&!t.isSelected,"is-primary":t.isSelected&&t.isSelected,"is-disabled":t.isDisabled||t.isOutdated}),s.modifier("today").class(t.isToday)),s.modifier("selectable").class(!t.isDisabled&&!t.isOutdated)),s.modifier("disabled").class(t.isDisabled||t.isOutdated)),s.modifier("outdated").class(t.isOutdated)),s.modifier("selected").class(t.isSelected))},e("span",null,t.label)))))))))}renderWeekDayHeader(){const t=H.block("datepicker-grid"),i=t.element("header"),s=t.element("cell");return e("header",{class:Object.assign({},i.class())},this.weekDays.map((t=>e("div",{key:t,class:Object.assign(Object.assign({},s.class()),s.modifier("header").class())},e("span",null,t)))))}renderHeader(){const t=H.block("datepicker-pagination"),i=t.element("inner"),s=t.element("month-and-year"),a=s.element("select");return e("header",{class:Object.assign({},t.class())},e("div",{class:Object.assign({},i.class())},e("bal-button",{square:!0,size:this.isMobile?"small":"",color:"info",icon:"nav-go-left",disabled:this.isPreviousMonthDisabled,onClick:()=>this.previousMonth()}),e("div",{class:Object.assign({},s.class())},e("div",{class:Object.assign(Object.assign({},a.class()),a.modifier("month").class())},e("div",{class:"select"},e("select",{onInput:this.onMonthSelect},this.months.map((t=>e("option",{key:t.index,value:t.index,selected:this.pointerDate.month===t.index},t.name)))))),e("div",{class:Object.assign(Object.assign({},a.class()),a.modifier("year").class())},e("div",{class:"select"},e("select",{onInput:this.onYearSelect},this.years.map((t=>e("option",{key:t,value:t,selected:this.pointerDate.year===t},t))))))),e("bal-button",{square:!0,size:this.isMobile?"small":"",color:"info",icon:"nav-go-right",disabled:this.isNextMonthDisabled,onClick:()=>this.nextMonth()})))}previousMonth(){if(!this.isPreviousMonthDisabled){if(this.pointerDate.year===this.minYear&&0===this.pointerDate.month)return;this.pointerDate=this.calcPreviousMonth()}}nextMonth(){if(!this.isNextMonthDisabled){if(this.pointerDate.year===this.maxYear&&11===this.pointerDate.month)return;this.pointerDate=this.calcNextMonth()}}calcPreviousMonth(){return Object.assign(Object.assign({},this.pointerDate),0===this.pointerDate.month?{year:this.pointerDate.year-1,month:11,day:1}:{month:this.pointerDate.month-1,day:1})}calcNextMonth(){return Object.assign(Object.assign({},this.pointerDate),11===this.pointerDate.month?{year:this.pointerDate.year+1,month:0,day:1}:{month:this.pointerDate.month+1,day:1})}lastDayOfMonth(t,i){const e=new Date(t,i+1,0);return x(e)}get isPreviousMonthDisabled(){if(this.min){const t=u(this.min),i=this.lastDayOfMonth(this.calcPreviousMonth().year,this.calcPreviousMonth().month);return $(new Date(this.calcPreviousMonth().year,this.calcPreviousMonth().month,i),function(t,i){return d(2,arguments),U(t,-p(i))}(t,1))}return!1}get isNextMonthDisabled(){if(this.max){const t=u(this.max);return Z(new Date(this.calcNextMonth().year,this.calcNextMonth().month,1),function(t){d(1,arguments);var i=c(t),e=i.getMonth();return i.setFullYear(i.getFullYear(),e+1,0),i.setHours(0,0,0,0),i}(t)?t:U(t,1))}return!1}isDateInRange(t){const i=u(m(t));return this.min&&this.max&&this.max>this.min?function(t,i){d(2,arguments);var e=c(t).getTime(),s=c(i.start).getTime(),a=c(i.end).getTime();if(!(s<=a))throw new RangeError("Invalid interval");return e>=s&&e<=a}(i,{start:u(this.min),end:u(this.max)}):this.min?Z(i,u(this.min))||X(i,u(this.min)):!this.max||$(i,U(u(this.max),1))||X(i,u(this.max))}get el(){return a(this)}static get watchers(){return{debounce:["debounceChanged"],value:["valueChanged"]}}};r([T("bal-datepicker"),n("design:type",Function),n("design:paramtypes",[Function]),n("design:returntype",void 0)],et.prototype,"createLogger",null),r([K(),n("design:type",Function),n("design:paramtypes",[Object]),n("design:returntype",void 0)],et.prototype,"breakpointListener",null),r([Y(),n("design:type",Function),n("design:paramtypes",[Object]),n("design:returntype",Promise)],et.prototype,"configChanged",null);let st=0;et.style=':root{--bal-datepicker-popover-background:var(--bal-color-grey-2);--bal-datepicker-cell-background:var(--bal-color-white);--bal-datepicker-cell-selected-background:var(--bal-color-primary);--bal-datepicker-cell-selected-today-background:var(--bal-color-white);--bal-datepicker-cell-today-background:var(--bal-color-primary);--bal-datepicker-cell-today-radius:var(--bal-radius-rounded)}.bal-datepicker{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-datepicker__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-datepicker__popup{padding:1rem;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--bal-datepicker-popover-background)}@media screen and (min-width: 769px),print{.bal-datepicker__popup{max-width:24.5rem}}.bal-datepicker__popup__body{max-width:22.5rem;margin:0 auto 0 auto;margin-top:.75rem}.bal-datepicker-pagination{max-width:22.5rem;margin:0 auto 0 auto}.bal-datepicker-pagination__inner{display:-ms-flexbox;display:flex;gap:.5rem}.bal-datepicker-pagination__month-and-year{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;gap:.5rem}.bal-datepicker-pagination__month-and-year__select{-ms-flex:1;flex:1}.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{padding-top:0 !important;padding-bottom:0 !important;text-align:center !important;min-height:2rem !important;height:2rem !important}@media screen and (min-width: 769px),print{.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{min-height:3rem !important;height:3rem !important}}.bal-datepicker-grid{display:table;border-collapse:collapse;width:100%;table-layout:fixed}.bal-datepicker-grid__body{display:table-row-group}.bal-datepicker-grid__row{display:table-row}.bal-datepicker-grid__row .bal-datepicker-grid__cell{margin-bottom:.25rem;margin-right:.25rem}.bal-datepicker-grid__row:last-child .bal-datepicker-grid__cell{margin-bottom:0}.bal-datepicker-grid__header{display:-ms-flexbox;display:flex;max-width:22.5rem;margin:0 auto 0 auto;gap:.25rem}.bal-datepicker-grid__header .bal-datepicker-grid__cell{background:rgba(0,0,0,0)}.bal-datepicker-grid__header .bal-datepicker-grid__cell span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:100%;width:100%}.bal-datepicker-grid__cell{position:relative;text-align:center;vertical-align:middle;display:table-cell;width:13%;padding:0 !important;height:3rem;min-height:3rem;min-width:2.25rem;-webkit-appearance:auto !important;-moz-appearance:auto !important;appearance:auto !important;background:var(--bal-datepicker-cell-background)}.bal-datepicker-grid__cell--selected{background:var(--bal-datepicker-cell-selected-background) !important}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)>span{font-weight:var(--bal-font-weight-bold)}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)::after{content:"";position:absolute;display:block;width:.25rem;height:.25rem;background:var(--bal-datepicker-cell-today-background);border-radius:var(--bal-datepicker-cell-today-radius);margin-left:-2px;left:50%;bottom:.375rem}.bal-datepicker-grid__cell--today.bal-datepicker-grid__cell--selected:not(.bal-datepicker-grid__cell--outdated)::after{background:var(--bal-datepicker-cell-selected-today-background)}.bal-datepicker-grid__cell:last-child{margin-right:0}.bal-datepicker-grid__cell>span{font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular)}@media screen and (min-width: 769px),print{.bal-datepicker-grid__cell{min-width:3rem !important}}.bal-datepicker-grid__cell--disabled{border-color:rgba(0,0,0,0) !important;background:rgba(0,0,0,0) !important}.bal-datepicker-grid__cell--header>span{border:none;background:rgba(0,0,0,0);color:var(--bal-color-text-primary);font-weight:var(--bal-font-weight-bold);cursor:default}';export{et as bal_datepicker}
1
+ import{r as t,c as i,h as e,H as s,g as a}from"./p-d7c752c6.js";import{_ as r,a as n}from"./p-43c9f5e9.js";import{k as h,m as l}from"./p-88f18fbc.js";import{i as o}from"./p-dd5e13d1.js";import{r as d,t as c,b as p,g as b,p as u,f as m,i as g,c as f,e as k,h as v,d as y,j as _,n as j,k as w,m as x}from"./p-94efe2aa.js";import{l as O}from"./p-9a3d9e17.js";import{N as D,A as C,i as I}from"./p-ec1efe3d.js";import{i as N}from"./p-ce37dba1.js";import{s as L,g as F,i as M,a as B,b as P,c as S,d as z}from"./p-ad9a7657.js";import{p as A}from"./p-c0c91eb1.js";import{B as H}from"./p-ae86d0a0.js";import{L as T}from"./p-b77e3348.js";import{d as q}from"./p-f385e205.js";import{d as E,a as R}from"./p-a19d1e1d.js";import{b as W}from"./p-d191284e.js";import{g as G}from"./p-aafb6696.js";import{L as K}from"./p-8a4bc0de.js";import{L as Y}from"./p-69e7c8d6.js";import"./p-a65354df.js";import"./p-2229e98e.js";import"./p-4573c419.js";import"./p-96216bd1.js";import"./p-acf222fd.js";import"./p-dc24372e.js";function U(t,i){d(2,arguments);var e=c(t),s=p(i);return isNaN(s)?new Date(NaN):s?(e.setDate(e.getDate()+s),e):e}function V(t,i){var e,s,a,r,n,h,l,o;d(1,arguments);var u=b(),m=p(null!==(e=null!==(s=null!==(a=null!==(r=null==i?void 0:i.weekStartsOn)&&void 0!==r?r:null==i||null===(n=i.locale)||void 0===n||null===(h=n.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==a?a:u.weekStartsOn)&&void 0!==s?s:null===(l=u.locale)||void 0===l||null===(o=l.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==e?e:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=c(t),f=g.getDay(),k=(f<m?7:0)+f-m;return g.setDate(g.getDate()-k),g.setHours(0,0,0,0),g}function J(t){d(1,arguments);var i=c(t);return i.setHours(0,0,0,0),i}function Q(t,i){return d(2,arguments),function(t,i){d(2,arguments);var e=c(t),s=p(i);if(isNaN(s))return new Date(NaN);if(!s)return e;var a=e.getDate(),r=new Date(e.getTime());return r.setMonth(e.getMonth()+s+1,0),a>=r.getDate()?r:(e.setFullYear(r.getFullYear(),r.getMonth(),a),e)}(t,12*p(i))}function X(t,i){d(2,arguments);var e=J(t),s=J(i);return e.getTime()===s.getTime()}function Z(t,i){d(2,arguments);var e=c(t),s=c(i);return e.getTime()>s.getTime()}function $(t,i){d(2,arguments);var e=c(t),s=c(i);return e.getTime()<s.getTime()}function tt(t,i,e){d(2,arguments);var s=V(t,e),a=V(i,e);return s.getTime()===a.getTime()}function it(t,i){d(2,arguments);var e=c(t),s=c(i);return e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()}const et=class{constructor(e){t(this,e),this.balChange=i(this,"balChange",7),this.balInput=i(this,"balInput",7),this.balBlur=i(this,"balBlur",7),this.balFocus=i(this,"balFocus",7),this.balInputClick=i(this,"balInputClick",7),this.balIconClick=i(this,"balIconClick",7),this.inputId="bal-dp-"+st++,this.inheritedAttributes={},this.inputValue=this.value,this.onIconClick=t=>{this.disabled||this.readonly||this.popoverElement.toggle(),L(t),this.balIconClick.emit(t)},this.onInputClick=t=>{this.triggerIcon||this.disabled||this.readonly||this.popoverElement.toggle(),L(t),this.triggerIcon||this.balInputClick.emit(t)},this.onPopoverChange=t=>{L(t),this.isPopoverOpen!==t.detail&&(this.isPopoverOpen=t.detail,this.fireBlur(t))},this.onInput=t=>{const i=F(t);if(i&&(this.inputValue=i.value,i.value&&(this.nativeInput.value=this.formatDate(this.inputValue)),this.inputValue&&this.inputValue.length>=6)){const t=u(this.inputValue,this.getLocale()),i=m(t);g(i)&&(this.selectedDate=i,this.updatePointerDates())}this.balInput.emit(this.inputValue)},this.onInputChange=t=>{const i=u(t.target.value,this.getLocale()),e=m(i),s=f(this.getLocale(),i);this.nativeInput.value=s,this.updateValue(e),this.updatePointerDates()},this.onClickDateCell=t=>{t.isDisabled||this.select(t.dateString)},this.onInputKeyUp=t=>{if(k(t)&&!this.triggerIcon&&(this.isPopoverOpen?this.close():this.open()),v(t)&&!this.triggerIcon){const t=u(this.nativeInput.value,this.getLocale()),i=m(t);this.isPopoverOpen&&this.value===i&&this.close()}},this.onInputKeyDown=t=>{const i=y(this.getLocale()),e=[...D,i,...C];!I(t)&&e.indexOf(t.key)<0&&(t.preventDefault(),t.stopPropagation()),"Tab"===t.key&&this.close()},this.onMonthSelect=t=>{const i=t.target.value;this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{day:1,month:parseInt(i,10)})},this.onYearSelect=t=>{const i=parseInt(t.target.value,10);let e;if(this.defaultDate){const t=u(this.defaultDate);if(this.max){const i=u(this.max);t.getMonth()>i.getMonth()&&(e=i.getMonth())}if(this.min){const i=u(this.min);t.getMonth()<i.getMonth()&&(e=i.getMonth())}}this.pointerDate={day:1,year:i,month:void 0!==e?e:this.pointerDate.month}},this.onInputFocus=t=>M(this,t),this.onInputBlur=t=>{A(t),this.focused=!1,this.fireBlur(t)},this.fireBlur=t=>{this.isPopoverOpen||this.focused||h((()=>this.balBlur.emit(t)))},this.handleClick=t=>B(this,t),this.language=E.language,this.region=E.region,this.isMobile=W.isMobile,this.focused=!1,this.isPopoverOpen=!1,this.selectedDate="",this.pointerDate={year:_(j()),month:w(j()),day:x(j())},this.ariaForm=q,this.name=this.inputId,this.invalid=!1,this.required=!1,this.disabled=!1,this.readonly=!1,this.loading=!1,this.placeholder=void 0,this.min=void 0,this.max=void 0,this.closeOnSelect=!0,this.triggerIcon=!1,this.minYearProp=void 0,this.maxYearProp=void 0,this.debounce=0,this.defaultDate=void 0,this.value=void 0,this.allowedDates=void 0,this.autoInvalidOff=!1}createLogger(t){this.log=t}debounceChanged(){this.balChange=l(this.balChange,this.debounce)}valueChanged(){this.selectedDate=this.value,this.updatePointerDates()}listenOnClick(t){P(this,t)}resetHandler(t){const i=t.target;(null==i?void 0:i.contains(this.el))&&(this.resetHandlerTimer&&clearTimeout(this.resetHandlerTimer),this.resetHandlerTimer=setTimeout((()=>{this.nativeInput.value=this.initialValue?f(this.getLocale(),u(this.initialValue)):"",this.selectedDate=this.initialValue,this.updateValue(this.initialValue,!1),this.updatePointerDates()}),0))}breakpointListener(t){this.isMobile=t.mobile}connectedCallback(){this.debounceChanged(),this.initialValue=this.value}componentDidLoad(){this.inputValue=this.value}componentWillLoad(){this.inheritedAttributes=o(this.el,["aria-label","tabindex","title"]),this.selectedDate=this.value,this.updatePointerDates(),this.updateValue(this.value,!1)}async configChanged(t){this.language=t.language,this.region=t.region}async open(){!this.disabled&&this.popoverElement&&this.popoverElement.present()}async close(){!this.disabled&&this.popoverElement&&this.popoverElement.dismiss()}async select(t){var i;this.nativeInput.value=f(this.getLocale(),u(t)),this.updateValue(t),this.updatePointerDates(),this.closeOnSelect&&await(null===(i=this.popoverElement)||void 0===i?void 0:i.toggle())}async setFocus(){S(this)}async setBlur(){z(this)}getInputElement(){return Promise.resolve(this.nativeInput)}async setAriaForm(t){this.ariaForm=Object.assign({},t)}updatePointerDates(){let t=j();if(t.setDate(1),this.selectedDate?t=u(this.selectedDate):this.defaultDate&&(t=u(this.defaultDate)),this.min){const i=u(this.min);i&&t<i&&(t=i)}if(this.max){const i=u(this.max);i&&t>i&&(t=i)}this.pointerDate={year:_(t),month:w(t),day:x(t)}}updateValue(t,i=!0){g(t)||(this.selectedDate=void 0,this.value=void 0,this.nativeInput&&(this.nativeInput.value="")),this.value!==t&&(this.value=t,i&&(this.isDateInRange(u(this.value))||""===this.value)&&this.balChange.emit(this.value))}get minYear(){return this.min?parseInt(this.min.substring(0,4),10):this.minYearProp?this.minYearProp:_(function(t,i){return d(2,arguments),Q(t,-p(i))}(j(),100))}get maxYear(){return this.max?parseInt(this.max.substring(0,4),10):this.maxYearProp?this.maxYearProp:_(Q(j(),100))}get years(){let t=Array.from({length:this.maxYear-this.minYear+1},((t,i)=>this.minYear+i));if(this.min&&this.pointerDate.month===w(u(this.min))){const i=_(u(this.min));t=t.filter((t=>t>=i))}if(this.max&&this.pointerDate.month===w(u(this.max))){const i=_(u(this.max));t=t.filter((t=>t<=i))}return t}get months(){let t=N[this.language].monthsShort.map(((t,i)=>({name:t,index:i})));if(this.min&&this.pointerDate.year===_(u(this.min))){const i=parseInt(this.min.substring(5,7),10)-1;t=t.filter((t=>t.index>=i))}if(this.max&&this.pointerDate.year===_(u(this.max))){const i=parseInt(this.max.substring(5,7),10)-1;t=t.filter((t=>t.index<=i))}return t}get weekDays(){const t=[...N[this.language].weekdaysMin];return t.push(t.shift()||""),t}get firstDateOfBox(){return V(new Date(this.pointerDate.year,this.pointerDate.month,1),{weekStartsOn:1})}getLocale(){const t=G();return t&&t.locale||R}get calendarGrid(){const t=this.firstDateOfBox,i=this.firstDateOfBox;let e=[];do{let s=[];do{s=[...s,{date:new Date(i),display:f(this.getLocale(),i),dateString:m(i),label:x(i).toString(),isToday:X(i,j()),isSelected:void 0!==u(this.selectedDate)&&X(i,u(this.selectedDate)),isDisabled:!this.getAllowedDates(i)||!this.isDateInRange(i),isOutdated:this.pointerDate.month!==i.getMonth()||!this.isDateInRange(i)}],i.setDate(i.getDate()+1)}while(tt(i,t,{weekStartsOn:1}));e=[...e,s],t.setDate(t.getDate()+7)}while(it(new Date(this.pointerDate.year,this.pointerDate.month,this.pointerDate.day),i));return e}getAllowedDates(t){return!!O(this.allowedDates)||this.allowedDates(m(t))}formatDate(t){const i=y(this.getLocale()),e=t.length,s=t.charAt(e-1),a=t.charAt(e-2);return s===i&&(1===e||a===i||t.split(i).filter((t=>t.length>0)).length>=3)?t.substring(0,e-1):5===e&&1===t.split(i)[0].split("").length&&a!==i&&s!==i||(3===e||6===e)&&s!==i&&a!==i&&t.split(i).length<=2?t.substring(0,e-1)+i+t.substring(e-1,e):t}render(){const t=H.block("datepicker"),i=t.element("native"),a=t.element("popup"),r=a.element("body"),n=a.element("footer");return e(s,{onClick:this.handleClick,"aria-disabled":this.disabled?"true":null,class:Object.assign(Object.assign({},t.class()),t.modifier("disabled").class(this.disabled||this.readonly))},e("input",{type:"date",class:Object.assign({},i.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}),e("bal-popover",{onBalChange:this.onPopoverChange,ref:t=>this.popoverElement=t},this.renderInput(),e("bal-popover-content",{spaceless:!0,contentMinWidth:392},e("div",{class:Object.assign({},a.class())},this.renderHeader(),e("div",{class:Object.assign({},r.class())},this.renderGrid()),e("div",{class:Object.assign({},n.class())},e("slot",null))))))}renderInput(){return e("div",{"bal-popover-trigger":!0,class:"control"},e("bal-input-group",{disabled:this.disabled||this.readonly,invalid:this.invalid},e("input",Object.assign({class:{input:!0,"data-test-input":!0,"is-clickable":!this.disabled&&!this.triggerIcon&&!this.readonly,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid},"data-testid":"bal-datepicker-input",ref:t=>this.nativeInput=t,id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":!0===this.invalid?"true":"false","aria-disabled":this.disabled?"true":null,type:"text",maxlength:"10",autoComplete:"off",value:f(this.getLocale(),u(this.value||"")),required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,onKeyDown:t=>this.onInputKeyDown(t),onKeyUp:t=>this.onInputKeyUp(t),onInput:this.onInput,onClick:this.onInputClick,onChange:this.onInputChange,onBlur:this.onInputBlur,onFocus:this.onInputFocus},this.inheritedAttributes)),this.loading?"":e("bal-icon",{class:{"datepicker-trigger-icon":!0,"is-clickable":!this.disabled&&!this.readonly},"is-right":!0,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",name:"date",onClick:this.onIconClick})))}renderGrid(){const t=H.block("datepicker-grid"),i=t.element("row"),s=t.element("cell");return e("div",null,this.renderWeekDayHeader(),e("div",{class:Object.assign({},t.class())},this.calendarGrid.map(((t,a)=>e("div",{key:a,class:Object.assign({},i.class())},t.map((t=>e("button",{key:t.dateString,type:"button","data-date":t.dateString,onClick:()=>this.onClickDateCell(t),disabled:t.isDisabled,class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s.class()),{button:!0,"is-text":!t.isDisabled&&!t.isSelected,"is-primary":t.isSelected&&t.isSelected,"is-disabled":t.isDisabled||t.isOutdated}),s.modifier("today").class(t.isToday)),s.modifier("selectable").class(!t.isDisabled&&!t.isOutdated)),s.modifier("disabled").class(t.isDisabled||t.isOutdated)),s.modifier("outdated").class(t.isOutdated)),s.modifier("selected").class(t.isSelected))},e("span",null,t.label)))))))))}renderWeekDayHeader(){const t=H.block("datepicker-grid"),i=t.element("header"),s=t.element("cell");return e("header",{class:Object.assign({},i.class())},this.weekDays.map((t=>e("div",{key:t,class:Object.assign(Object.assign({},s.class()),s.modifier("header").class())},e("span",null,t)))))}renderHeader(){const t=H.block("datepicker-pagination"),i=t.element("inner"),s=t.element("month-and-year"),a=s.element("select");return e("header",{class:Object.assign({},t.class())},e("div",{class:Object.assign({},i.class())},e("bal-button",{square:!0,size:this.isMobile?"small":"",color:"info",icon:"nav-go-left",disabled:this.isPreviousMonthDisabled,onClick:()=>this.previousMonth()}),e("div",{class:Object.assign({},s.class())},e("div",{class:Object.assign(Object.assign({},a.class()),a.modifier("month").class())},e("div",{class:"select"},e("select",{onInput:this.onMonthSelect},this.months.map((t=>e("option",{key:t.index,value:t.index,selected:this.pointerDate.month===t.index},t.name)))))),e("div",{class:Object.assign(Object.assign({},a.class()),a.modifier("year").class())},e("div",{class:"select"},e("select",{onInput:this.onYearSelect},this.years.map((t=>e("option",{key:t,value:t,selected:this.pointerDate.year===t},t))))))),e("bal-button",{square:!0,size:this.isMobile?"small":"",color:"info",icon:"nav-go-right",disabled:this.isNextMonthDisabled,onClick:()=>this.nextMonth()})))}previousMonth(){if(!this.isPreviousMonthDisabled){if(this.pointerDate.year===this.minYear&&0===this.pointerDate.month)return;this.pointerDate=this.calcPreviousMonth()}}nextMonth(){if(!this.isNextMonthDisabled){if(this.pointerDate.year===this.maxYear&&11===this.pointerDate.month)return;this.pointerDate=this.calcNextMonth()}}calcPreviousMonth(){return Object.assign(Object.assign({},this.pointerDate),0===this.pointerDate.month?{year:this.pointerDate.year-1,month:11,day:1}:{month:this.pointerDate.month-1,day:1})}calcNextMonth(){return Object.assign(Object.assign({},this.pointerDate),11===this.pointerDate.month?{year:this.pointerDate.year+1,month:0,day:1}:{month:this.pointerDate.month+1,day:1})}lastDayOfMonth(t,i){const e=new Date(t,i+1,0);return x(e)}get isPreviousMonthDisabled(){if(this.min){const t=u(this.min),i=this.lastDayOfMonth(this.calcPreviousMonth().year,this.calcPreviousMonth().month);return $(new Date(this.calcPreviousMonth().year,this.calcPreviousMonth().month,i),function(t,i){return d(2,arguments),U(t,-p(i))}(t,1))}return!1}get isNextMonthDisabled(){if(this.max){const t=u(this.max);return Z(new Date(this.calcNextMonth().year,this.calcNextMonth().month,1),function(t){d(1,arguments);var i=c(t),e=i.getMonth();return i.setFullYear(i.getFullYear(),e+1,0),i.setHours(0,0,0,0),i}(t)?t:U(t,1))}return!1}isDateInRange(t){const i=u(m(t));return this.min&&this.max&&this.max>this.min?function(t,i){d(2,arguments);var e=c(t).getTime(),s=c(i.start).getTime(),a=c(i.end).getTime();if(!(s<=a))throw new RangeError("Invalid interval");return e>=s&&e<=a}(i,{start:u(this.min),end:u(this.max)}):this.min?Z(i,u(this.min))||X(i,u(this.min)):!this.max||$(i,U(u(this.max),1))||X(i,u(this.max))}get el(){return a(this)}static get watchers(){return{debounce:["debounceChanged"],value:["valueChanged"]}}};r([T("bal-datepicker"),n("design:type",Function),n("design:paramtypes",[Function]),n("design:returntype",void 0)],et.prototype,"createLogger",null),r([K(),n("design:type",Function),n("design:paramtypes",[Object]),n("design:returntype",void 0)],et.prototype,"breakpointListener",null),r([Y(),n("design:type",Function),n("design:paramtypes",[Object]),n("design:returntype",Promise)],et.prototype,"configChanged",null);let st=0;et.style=':root{--bal-datepicker-popover-background:var(--bal-color-grey-2);--bal-datepicker-cell-background:var(--bal-color-white);--bal-datepicker-cell-selected-background:var(--bal-color-primary);--bal-datepicker-cell-selected-today-background:var(--bal-color-white);--bal-datepicker-cell-today-background:var(--bal-color-primary);--bal-datepicker-cell-today-radius:var(--bal-radius-rounded)}.bal-datepicker{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-datepicker__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-datepicker__popup{padding:1rem;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--bal-datepicker-popover-background)}@media screen and (min-width: 769px),print{.bal-datepicker__popup{max-width:24.5rem}}.bal-datepicker__popup__body{max-width:22.5rem;margin:0 auto 0 auto;margin-top:.75rem}.bal-datepicker-pagination{max-width:22.5rem;margin:0 auto 0 auto}.bal-datepicker-pagination__inner{display:-ms-flexbox;display:flex;gap:.5rem}.bal-datepicker-pagination__month-and-year{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;gap:.5rem}.bal-datepicker-pagination__month-and-year__select{-ms-flex:1;flex:1}.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{padding-top:0 !important;padding-bottom:0 !important;text-align:center !important;min-height:2rem !important;height:2rem !important}@media screen and (min-width: 769px),print{.bal-datepicker-pagination__month-and-year__select .select,.bal-datepicker-pagination__month-and-year__select .select select{min-height:3rem !important;height:3rem !important}}.bal-datepicker-grid{display:table;border-collapse:collapse;width:100%;table-layout:fixed}.bal-datepicker-grid__body{display:table-row-group}.bal-datepicker-grid__row{display:table-row}.bal-datepicker-grid__row .bal-datepicker-grid__cell{margin-bottom:.25rem;margin-right:.25rem}.bal-datepicker-grid__row:last-child .bal-datepicker-grid__cell{margin-bottom:0}.bal-datepicker-grid__header{display:-ms-flexbox;display:flex;max-width:22.5rem;margin:0 auto 0 auto;gap:.25rem}.bal-datepicker-grid__header .bal-datepicker-grid__cell{background:rgba(0,0,0,0)}.bal-datepicker-grid__header .bal-datepicker-grid__cell span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:100%;width:100%}.bal-datepicker-grid__cell{position:relative;text-align:center;vertical-align:middle;display:table-cell;width:13%;padding:0 !important;height:3rem;min-height:3rem;min-width:2.25rem;-webkit-appearance:auto !important;-moz-appearance:auto !important;appearance:auto !important;background:var(--bal-datepicker-cell-background)}.bal-datepicker-grid__cell--selected{background:var(--bal-datepicker-cell-selected-background) !important}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)>span{font-weight:var(--bal-font-weight-bold)}.bal-datepicker-grid__cell--today:not(.bal-datepicker-grid__cell--outdated)::after{content:"";position:absolute;display:block;width:.25rem;height:.25rem;background:var(--bal-datepicker-cell-today-background);border-radius:var(--bal-datepicker-cell-today-radius);margin-left:-2px;left:50%;bottom:.375rem}.bal-datepicker-grid__cell--today.bal-datepicker-grid__cell--selected:not(.bal-datepicker-grid__cell--outdated)::after{background:var(--bal-datepicker-cell-selected-today-background)}.bal-datepicker-grid__cell:last-child{margin-right:0}.bal-datepicker-grid__cell>span{font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular)}@media screen and (min-width: 769px),print{.bal-datepicker-grid__cell{min-width:3rem !important}}.bal-datepicker-grid__cell--disabled{border-color:rgba(0,0,0,0) !important;background:rgba(0,0,0,0) !important}.bal-datepicker-grid__cell--header>span{border:none;background:rgba(0,0,0,0);color:var(--bal-color-text-primary);font-weight:var(--bal-font-weight-bold);cursor:default}';export{et as bal_datepicker}
@@ -0,0 +1 @@
1
+ System.register(["./p-f959646a.system.js"],(function(t){"use strict";var e;return{setters:[function(t){e=t.g}],execute:function(){var s=t("g",e)}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,n,e,i){function r(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i["throw"](t))}catch(t){o(t)}}function c(t){t.done?e(t.value):r(t.value).then(s,a)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(n){return c([t,n])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(e=0)),e)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;r=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1];o=a;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(a);break}if(o[2])e.ops.pop();e.trys.pop();continue}a=n.call(t,e)}catch(t){a=[6,t];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-456fc561.system.js","./p-6dbef894.system.js","./p-db0895e2.system.js","./p-b79d8942.system.js","./p-1d351673.system.js","./p-46962c31.system.js","./p-4122160f.system.js","./p-0177e3a0.system.js","./p-6913b916.system.js","./p-a1f6e944.system.js","./p-8954495d.system.js","./p-b3f2c626.system.js","./p-145d5c4e.system.js","./p-ec9a7cf5.system.js","./p-eecefb0a.system.js","./p-448185d8.system.js"],(function(t){"use strict";var n,e,i,r,o,s,a,c,l,u,h,f;return{setters:[function(t){n=t.r;e=t.h;i=t.H;r=t.g},function(t){o=t._;s=t.a},function(t){a=t.B},function(t){c=t.p},function(t){l=t.B},function(t){u=t.b},function(t){h=t.L},function(t){f=t.L},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var b=":root{--bal-hint-content-background:var(--bal-color-grey-2)}.bal-hint{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block}.bal-hint__icon{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}@media (hover: hover)and (pointer: fine){.bal-hint__icon:hover svg,.bal-hint__icon:hover g,.bal-hint__icon:hover path,.bal-hint__icon:hover circle,.bal-hint__icon:focus svg,.bal-hint__icon:focus g,.bal-hint__icon:focus path,.bal-hint__icon:focus circle{fill:var(--bal-color-light-blue-5)}}.bal-hint__content{background:var(--bal-hint-content-background);display:-ms-flexbox;display:flex;gap:1.5rem;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{-ms-flex:1;flex:1}}.bal-hint__content__title{display:block;margin-bottom:1rem}.bal-hint__content__title__heading{font-family:var(--bal-title-font-family);font-weight:var(--bal-title-font-weight);font-size:var(--bal-text-size-x-large);line-height:var(--bal-line-height-x-large)}@media screen and (min-width: 769px),print{.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-tablet);line-height:var(--bal-line-height-tablet-x-large)}}@media screen and (min-width: 1024px){.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-desktop);line-height:var(--bal-line-height-desktop-x-large)}}@media screen and (min-width: 769px),print{.bal-hint__content__buttons--is-hidden-desktop{display:none !important}}.bal-hint__overlay__content{position:fixed;display:none;overflow:auto;top:0;left:0;right:0;bottom:0;z-index:var(--bal-z-index-popup)}.bal-hint__overlay__content--active{display:block}";var d=b;var _=t("bal_hint",function(){function t(t){var e=this;n(this,t);this.bodyScrollHandler=new l;this.onPopoverChange=function(t){e.isActive=t.detail;c(t)};this.isActive=false;this.innerCloseLabel="Close";this.isMobile=u.isMobile;this.closeLabel=undefined;this.small=false}t.prototype.connectedCallback=function(){this.bodyScrollHandler.connect()};t.prototype.componentDidRender=function(){this.updateContent()};t.prototype.disconnectedCallback=function(){this.bodyScrollHandler.disconnect()};t.prototype.breakpointListener=function(t){var n=t.mobile;if(n!==this.isMobile){this.isActive=false}this.isMobile=n};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!this.closeLabel){switch(t.language){case"de":this.innerCloseLabel="Schliessen";break;case"fr":this.innerCloseLabel="Fermer";break;case"it":this.innerCloseLabel="Chiudere";break;case"nl":this.innerCloseLabel="Sluiten";break;default:this.innerCloseLabel="Close";break}}return[2]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isActive){this.dismiss()}else{this.present()}return[2]}))}))};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.popoverElement){this.popoverElement.present()}if(this.isMobile){this.bodyScrollHandler.disable()}this.isActive=true;return[2]}))}))};t.prototype.dismiss=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.popoverElement){this.popoverElement.dismiss()}if(this.isMobile){this.bodyScrollHandler.enable()}this.isActive=false;return[2]}))}))};t.prototype.updateContent=function(){if(this.hintContentEl&&this.slotWrapperEl){this.hintContentEl.innerHTML=this.slotWrapperEl.innerHTML}};t.prototype.render=function(){var t=this;var n=a.block("hint");var r=n.element("icon");var o=n.element("content");var s=o.element("buttons");var c=this.isMobile?0:8;var l=this.isMobile?0:16;var u=function(){return e("bal-icon",{class:Object.assign({},r.class()),"data-testid":"bal-hint-trigger","bal-popover-trigger":true,"aria-haspopup":"true",role:"button",name:"info-circle",onClick:function(){return t.toggle()}})};var h=function(){return e("div",{class:Object.assign({},o.class()),"data-testid":"bal-hint-content"},e("div",{ref:function(n){return t.hintContentEl=n}}),e("bal-button-group",{class:Object.assign(Object.assign({},s.class()),s.modifier("is-hidden-desktop").class(t.small))},e("bal-button",{"data-testid":"bal-hint-close",color:"info",onClick:function(){return t.dismiss()}},t.closeLabel?t.closeLabel:t.innerCloseLabel)))};var f=function(){var i=n.element("overlay");return e("div",{class:Object.assign({},i.class())},e(u,null),e("div",{class:Object.assign(Object.assign({},i.element("content").class()),i.element("content").modifier("active").class(t.isActive))},e(h,null)))};var b=function(){return e("div",{class:Object.assign({},n.element("popover").class())},e("bal-popover",{hint:true,position:"right",offsetX:0,offsetY:l,padding:c,ref:function(n){return t.popoverElement=n},onBalChange:t.onPopoverChange},e(u,null),e("bal-popover-content",{color:"grey"},e(h,null))))};var d=this.isMobile?f:b;return e(i,{class:Object.assign({},n.class())},e(d,null),e("div",{ref:function(n){return t.slotWrapperEl=n},style:{display:"none"}},e("slot",null)))};Object.defineProperty(t.prototype,"element",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());o([h(),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype",void 0)],_.prototype,"breakpointListener",null);o([f(),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype",Promise)],_.prototype,"configChanged",null);_.style=d;var v=t("bal_hint_text",function(){function t(t){n(this,t)}t.prototype.render=function(){var t=a.block("hint");var n=t.element("content");var r=n.element("text");var o=r.element("field");return e(i,{class:Object.assign({},r.class())},e("p",{class:Object.assign({},o.class())},e("slot",null)))};return t}());var p=t("bal_hint_title",function(){function t(t){n(this,t)}t.prototype.render=function(){var t=a.block("hint");var n=t.element("content");var r=n.element("title");var o=r.element("heading");return e(i,{class:Object.assign({},r.class())},e("h3",{class:Object.assign({},o.class())},e("span",null,e("slot",null))))};return t}())}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,n,e,i){function r(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i["throw"](t))}catch(t){o(t)}}function c(t){t.done?e(t.value):r(t.value).then(s,a)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(n){return c([t,n])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(e=0)),e)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;r=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1];o=a;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(a);break}if(o[2])e.ops.pop();e.trys.pop();continue}a=n.call(t,e)}catch(t){a=[6,t];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-456fc561.system.js","./p-6dbef894.system.js","./p-db0895e2.system.js","./p-b79d8942.system.js","./p-1d351673.system.js","./p-5d62da08.system.js","./p-33c8d310.system.js","./p-0177e3a0.system.js","./p-6913b916.system.js","./p-a1f6e944.system.js","./p-8954495d.system.js","./p-b3f2c626.system.js","./p-145d5c4e.system.js","./p-ec9a7cf5.system.js","./p-eecefb0a.system.js","./p-95709c75.system.js"],(function(t){"use strict";var n,e,i,r,o,s,a,c,l,u,h,f;return{setters:[function(t){n=t.r;e=t.h;i=t.H;r=t.g},function(t){o=t._;s=t.a},function(t){a=t.B},function(t){c=t.p},function(t){l=t.B},function(t){u=t.b},function(t){h=t.L},function(t){f=t.L},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var b=":root{--bal-hint-content-background:var(--bal-color-grey-2)}.bal-hint{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block}.bal-hint__icon{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}@media (hover: hover)and (pointer: fine){.bal-hint__icon:hover svg,.bal-hint__icon:hover g,.bal-hint__icon:hover path,.bal-hint__icon:hover circle,.bal-hint__icon:focus svg,.bal-hint__icon:focus g,.bal-hint__icon:focus path,.bal-hint__icon:focus circle{fill:var(--bal-color-light-blue-5)}}.bal-hint__content{background:var(--bal-hint-content-background);display:-ms-flexbox;display:flex;gap:1.5rem;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{-ms-flex:1;flex:1}}.bal-hint__content__title{display:block;margin-bottom:1rem}.bal-hint__content__title__heading{font-family:var(--bal-title-font-family);font-weight:var(--bal-title-font-weight);font-size:var(--bal-text-size-x-large);line-height:var(--bal-line-height-x-large)}@media screen and (min-width: 769px),print{.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-tablet);line-height:var(--bal-line-height-tablet-x-large)}}@media screen and (min-width: 1024px){.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-desktop);line-height:var(--bal-line-height-desktop-x-large)}}@media screen and (min-width: 769px),print{.bal-hint__content__buttons--is-hidden-desktop{display:none !important}}.bal-hint__overlay__content{position:fixed;display:none;overflow:auto;top:0;left:0;right:0;bottom:0;z-index:var(--bal-z-index-popup)}.bal-hint__overlay__content--active{display:block}";var d=b;var _=t("bal_hint",function(){function t(t){var e=this;n(this,t);this.bodyScrollHandler=new l;this.onPopoverChange=function(t){e.isActive=t.detail;c(t)};this.isActive=false;this.innerCloseLabel="Close";this.isMobile=u.isMobile;this.closeLabel=undefined;this.small=false}t.prototype.connectedCallback=function(){this.bodyScrollHandler.connect()};t.prototype.componentDidRender=function(){this.updateContent()};t.prototype.disconnectedCallback=function(){this.bodyScrollHandler.disconnect()};t.prototype.breakpointListener=function(t){var n=t.mobile;if(n!==this.isMobile){this.isActive=false}this.isMobile=n};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!this.closeLabel){switch(t.language){case"de":this.innerCloseLabel="Schliessen";break;case"fr":this.innerCloseLabel="Fermer";break;case"it":this.innerCloseLabel="Chiudere";break;case"nl":this.innerCloseLabel="Sluiten";break;default:this.innerCloseLabel="Close";break}}return[2]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isActive){this.dismiss()}else{this.present()}return[2]}))}))};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.popoverElement){this.popoverElement.present()}if(this.isMobile){this.bodyScrollHandler.disable()}this.isActive=true;return[2]}))}))};t.prototype.dismiss=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.popoverElement){this.popoverElement.dismiss()}if(this.isMobile){this.bodyScrollHandler.enable()}this.isActive=false;return[2]}))}))};t.prototype.updateContent=function(){if(this.hintContentEl&&this.slotWrapperEl){this.hintContentEl.innerHTML=this.slotWrapperEl.innerHTML}};t.prototype.render=function(){var t=this;var n=a.block("hint");var r=n.element("icon");var o=n.element("content");var s=o.element("buttons");var c=this.isMobile?0:8;var l=this.isMobile?0:16;var u=function(){return e("bal-icon",{class:Object.assign({},r.class()),"data-testid":"bal-hint-trigger","bal-popover-trigger":true,"aria-haspopup":"true",role:"button",name:"info-circle",onClick:function(){return t.toggle()}})};var h=function(){return e("div",{class:Object.assign({},o.class()),"data-testid":"bal-hint-content"},e("div",{ref:function(n){return t.hintContentEl=n}}),e("bal-button-group",{class:Object.assign(Object.assign({},s.class()),s.modifier("is-hidden-desktop").class(t.small))},e("bal-button",{"data-testid":"bal-hint-close",color:"info",onClick:function(){return t.dismiss()}},t.closeLabel?t.closeLabel:t.innerCloseLabel)))};var f=function(){var i=n.element("overlay");return e("div",{class:Object.assign({},i.class())},e(u,null),e("div",{class:Object.assign(Object.assign({},i.element("content").class()),i.element("content").modifier("active").class(t.isActive))},e(h,null)))};var b=function(){return e("div",{class:Object.assign({},n.element("popover").class())},e("bal-popover",{hint:true,position:"right",offsetX:0,offsetY:l,padding:c,ref:function(n){return t.popoverElement=n},onBalChange:t.onPopoverChange},e(u,null),e("bal-popover-content",{color:"grey"},e(h,null))))};var d=this.isMobile?f:b;return e(i,{class:Object.assign({},n.class())},e(d,null),e("div",{ref:function(n){return t.slotWrapperEl=n},style:{display:"none"}},e("slot",null)))};Object.defineProperty(t.prototype,"element",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());o([h(),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype",void 0)],_.prototype,"breakpointListener",null);o([f(),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype",Promise)],_.prototype,"configChanged",null);_.style=d;var v=t("bal_hint_text",function(){function t(t){n(this,t)}t.prototype.render=function(){var t=a.block("hint");var n=t.element("content");var r=n.element("text");var o=r.element("field");return e(i,{class:Object.assign({},r.class())},e("p",{class:Object.assign({},o.class())},e("slot",null)))};return t}());var p=t("bal_hint_title",function(){function t(t){n(this,t)}t.prototype.render=function(){var t=a.block("hint");var n=t.element("content");var r=n.element("title");var o=r.element("heading");return e(i,{class:Object.assign({},r.class())},e("h3",{class:Object.assign({},o.class())},e("span",null,e("slot",null))))};return t}())}}}));
@@ -1 +1 @@
1
- import{a as t}from"./p-d7c752c6.js";import{b as s}from"./p-a65354df.js";import{d as e}from"./p-a19d1e1d.js";class i{constructor(t){this.options=t,this.container=null,this.queue=[],this.preQueue=[],this.queueLimit=5}create(t){if(s.hasDocument){this.setupContainer();const s=this.findClone(t);if(void 0===s){const s=document.createElement(this.options.tag);return Object.assign(s,t),s.addEventListener("balClose",(t=>{this.removeFromQueue(t.detail)})),this.preQueue.push(s),this.updateQueue(),s}return s}}setQueue(t){this.queueLimit=t}async dismissAll(){var t;const s=null===(t=this.container)||void 0===t?void 0:t.querySelectorAll(this.options.tag);if(s){const t=[];for(let e=0;e<s.length;e++){const i=s[e];i.close&&t.push(i.close())}await Promise.all(t)}}async clearAll(){return console.warn("[DEPRECATED] - use dismissAll() instead"),this.dismissAll()}findClone(t){for(let s=0;s<this.queue.length;s++){const e=this.queue[s];if(e.message===t.message&&e.color===t.color)return e}}setupContainer(){if(s.hasDocument){const t=`${this.options.tag}-container`;if(this.container=document.getElementById(t),this.container)return;this.container||(this.container=document.createElement("bal-notices"),this.container.setAttribute("interface",this.options.tag.replace("bal-","")),this.container.id=t),document.body.appendChild(this.container)}}updateQueue(){var t;if(this.queue.length<this.queueLimit){const t=this.preQueue.shift();t&&this.container&&(this.queue.push(t),this.container.insertAdjacentElement("beforeend",t))}0===this.queue.length&&(null===(t=this.container)||void 0===t||t.remove())}removeFromQueue(t){this.queue=this.queue.filter((s=>s.id!==t)),setTimeout((()=>this.updateQueue()),0)}}class r extends i{constructor(){super({tag:"bal-toast"})}create(t){return super.create(t)}}const n=new r;class h extends i{constructor(){super({tag:"bal-snackbar"})}create(t){return super.create(t)}}const o=new h,c="baloise-persist-config";class a{constructor(){this._componentObservers=[],this._observers=[],this._config=e}get locale(){return`${this._config.language}-${this._config.region}`}get region(){return this._config.region}set region(t){t!==this._config.region&&(this._config.region=t,this._notify())}get language(){return this._config.language}set language(t){t!==this._config.language&&(this._config.language=this._config.allowedLanguages.includes(t)?t:this._config.fallbackLanguage,this._notify())}get allowedLanguages(){return this._config.allowedLanguages}set allowedLanguages(t){t!==this._config.allowedLanguages&&(this._config.allowedLanguages=t,this._notify())}get icons(){return this._config.icons}set icons(t){this._config.icons=Object.assign(Object.assign({},this._config.icons),t),this._notify()}get logger(){return this._config.logger}set logger(t){this._config.logger=Object.assign({},t),this._notify()}get animated(){return this._config.animated}set animated(t){this._config.animated=t,this._notify()}get httpFormSubmit(){return this._config.httpFormSubmit}set httpFormSubmit(t){this._config.httpFormSubmit=t,this._notify()}attach(t){if(this._observers.includes(t))return console.log("Subject: Observer has been attached already.");this._observers.push(t),t.configChanged(this._config)}detach(t){const s=this._observers.indexOf(t);if(-1===s)return console.log("Subject: Nonexistent observer.");this._observers.splice(s,1)}attachComponent(t){if(this._componentObservers.includes(t))return console.log("Subject: Observer has been attached already.");this._componentObservers.push(t),t.configChanged(this._config)}detachComponent(t){const s=this._componentObservers.indexOf(t);if(-1===s)return console.log("Subject: Nonexistent observer.");this._componentObservers.splice(s,1)}toString(){return JSON.stringify(this._config)}reset(t){this._config=Object.assign(Object.assign(Object.assign({},this._config),t),{icons:Object.assign(Object.assign({},this._config.icons),t.icons)}),this._notify(!1)}_notify(t=!0){for(const t of this._componentObservers)t.configChanged(this._config);if(t)for(const t of this._observers)t.configChanged(this._config);s.hasWindow&&b(window,this._config)}}const u=new a,l=t=>{try{const s=t.sessionStorage.getItem(c);return null!==s?JSON.parse(s):{}}catch(t){return{}}},b=(t,s)=>{try{t.sessionStorage.setItem(c,JSON.stringify(s))}catch(t){return}},d=(t={},e={})=>{0===Object.keys(e).length&&s.hasWindow&&(e=window),e.BaloiseDesignSystem=e.BaloiseDesignSystem||{},u.reset(Object.assign(Object.assign(Object.assign({},l(e)),t),{icons:Object.assign(Object.assign({},l(e).icons),t.icons)})),e.BaloiseDesignSystem.config=u},f=(e={},i,r={})=>{0===Object.keys(r).length&&s.hasWindow&&(r=window),r.BaloiseDesignSystem=r.BaloiseDesignSystem||{},i&&t(i),d(Object.assign(Object.assign({},e),i),r),r.BaloiseDesignSystem.toastController=n,r.BaloiseDesignSystem.snackbarController=o,r.BaloiseDesignSystem.initialize=()=>d(r.BaloiseDesignSystem.config,r),r.BaloiseDesignSystem.version="16.2.0"};export{r as B,h as a,n as b,o as c,f as i,d as s}
1
+ import{a as t}from"./p-d7c752c6.js";import{b as s}from"./p-a65354df.js";import{d as e}from"./p-a19d1e1d.js";class i{constructor(t){this.options=t,this.container=null,this.queue=[],this.preQueue=[],this.queueLimit=5}create(t){if(s.hasDocument){this.setupContainer();const s=this.findClone(t);if(void 0===s){const s=document.createElement(this.options.tag);return Object.assign(s,t),s.addEventListener("balClose",(t=>{this.removeFromQueue(t.detail)})),this.preQueue.push(s),this.updateQueue(),s}return s}}setQueue(t){this.queueLimit=t}async dismissAll(){var t;const s=null===(t=this.container)||void 0===t?void 0:t.querySelectorAll(this.options.tag);if(s){const t=[];for(let e=0;e<s.length;e++){const i=s[e];i.close&&t.push(i.close())}await Promise.all(t)}}async clearAll(){return console.warn("[DEPRECATED] - use dismissAll() instead"),this.dismissAll()}findClone(t){for(let s=0;s<this.queue.length;s++){const e=this.queue[s];if(e.message===t.message&&e.color===t.color)return e}}setupContainer(){if(s.hasDocument){const t=`${this.options.tag}-container`;if(this.container=document.getElementById(t),this.container)return;this.container||(this.container=document.createElement("bal-notices"),this.container.setAttribute("interface",this.options.tag.replace("bal-","")),this.container.id=t),document.body.appendChild(this.container)}}updateQueue(){var t;if(this.queue.length<this.queueLimit){const t=this.preQueue.shift();t&&this.container&&(this.queue.push(t),this.container.insertAdjacentElement("beforeend",t))}0===this.queue.length&&(null===(t=this.container)||void 0===t||t.remove())}removeFromQueue(t){this.queue=this.queue.filter((s=>s.id!==t)),setTimeout((()=>this.updateQueue()),0)}}class r extends i{constructor(){super({tag:"bal-toast"})}create(t){return super.create(t)}}const n=new r;class h extends i{constructor(){super({tag:"bal-snackbar"})}create(t){return super.create(t)}}const o=new h,c="baloise-persist-config";class a{constructor(){this._componentObservers=[],this._observers=[],this._config=e}get locale(){return`${this._config.language}-${this._config.region}`}get region(){return this._config.region}set region(t){t!==this._config.region&&(this._config.region=t,this._notify())}get language(){return this._config.language}set language(t){t!==this._config.language&&(this._config.language=this._config.allowedLanguages.includes(t)?t:this._config.fallbackLanguage,this._notify())}get allowedLanguages(){return this._config.allowedLanguages}set allowedLanguages(t){t!==this._config.allowedLanguages&&(this._config.allowedLanguages=t,this._notify())}get icons(){return this._config.icons}set icons(t){this._config.icons=Object.assign(Object.assign({},this._config.icons),t),this._notify()}get logger(){return this._config.logger}set logger(t){this._config.logger=Object.assign({},t),this._notify()}get animated(){return this._config.animated}set animated(t){this._config.animated=t,this._notify()}get httpFormSubmit(){return this._config.httpFormSubmit}set httpFormSubmit(t){this._config.httpFormSubmit=t,this._notify()}attach(t){if(this._observers.includes(t))return console.log("Subject: Observer has been attached already.");this._observers.push(t),t.configChanged(this._config)}detach(t){const s=this._observers.indexOf(t);if(-1===s)return console.log("Subject: Nonexistent observer.");this._observers.splice(s,1)}attachComponent(t){if(this._componentObservers.includes(t))return console.log("Subject: Observer has been attached already.");this._componentObservers.push(t),t.configChanged(this._config)}detachComponent(t){const s=this._componentObservers.indexOf(t);if(-1===s)return console.log("Subject: Nonexistent observer.");this._componentObservers.splice(s,1)}toString(){return JSON.stringify(this._config)}reset(t){this._config=Object.assign(Object.assign(Object.assign({},this._config),t),{icons:Object.assign(Object.assign({},this._config.icons),t.icons)}),this._notify(!1)}_notify(t=!0){for(const t of this._componentObservers)t.configChanged(this._config);if(t)for(const t of this._observers)t.configChanged(this._config);s.hasWindow&&b(window,this._config)}}const u=new a,l=t=>{try{const s=t.sessionStorage.getItem(c);return null!==s?JSON.parse(s):{}}catch(t){return{}}},b=(t,s)=>{try{t.sessionStorage.setItem(c,JSON.stringify(s))}catch(t){return}},d=(t={},e={})=>{0===Object.keys(e).length&&s.hasWindow&&(e=window),e.BaloiseDesignSystem=e.BaloiseDesignSystem||{},u.reset(Object.assign(Object.assign(Object.assign({},l(e)),t),{icons:Object.assign(Object.assign({},l(e).icons),t.icons)})),e.BaloiseDesignSystem.config=u},f=(e={},i,r={})=>{0===Object.keys(r).length&&s.hasWindow&&(r=window),r.BaloiseDesignSystem=r.BaloiseDesignSystem||{},i&&t(i),d(Object.assign(Object.assign({},e),i),r),r.BaloiseDesignSystem.toastController=n,r.BaloiseDesignSystem.snackbarController=o,r.BaloiseDesignSystem.initialize=()=>d(r.BaloiseDesignSystem.config,r),r.BaloiseDesignSystem.version="16.2.1-nightly.20240528"};export{r as B,h as a,n as b,o as c,f as i,d as s}
@@ -1 +1 @@
1
- var __extends=this&&this.__extends||function(){var t=function(e,n){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]};return t(e,n)};return function(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function i(){this.constructor=e}e.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,u){function s(t){try{f(i.next(t))}catch(t){u(t)}}function o(t){try{f(i["throw"](t))}catch(t){u(t)}}function f(t){t.done?n(t.value):r(t.value).then(s,o)}f((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},i,r,u,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return f([t,e])}}function f(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(n=0)),n)try{if(i=1,r&&(u=o[0]&2?r["return"]:o[0]?r["throw"]||((u=r["return"])&&u.call(r),0):r.next)&&!(u=u.call(r,o[1])).done)return u;if(r=0,u)o=[o[0]&2,u.value];switch(o[0]){case 0:case 1:u=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(u=n.trys,u=u.length>0&&u[u.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!u||o[1]>u[0]&&o[1]<u[3])){n.label=o[1];break}if(o[0]===6&&n.label<u[1]){n.label=u[1];u=o;break}if(u&&n.label<u[2]){n.label=u[2];n.ops.push(o);break}if(u[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t];r=0}finally{i=u=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-8954495d.system.js","./p-a1f6e944.system.js","./p-ec9a7cf5.system.js","./p-eecefb0a.system.js","./p-448185d8.system.js"],(function(t){"use strict";var e,n,i,r,u,s,o,f,c,a,h,l;return{setters:[function(t){e=t.h;n=t.j;i=t.r},function(t){r=t.b},function(t){u=t.b},function(t){s=t.L;o=t.S},function(t){f=t.b;c=t.a;a=t.c;h=t.d;l=t.e}],execute:function(){var b=function(){function t(t){if(t===void 0){t={}}this.previousWidth=r.window.width;this.previousHeight=r.window.height;this.previousIsLandscape=this.isLandscape;this.options={onlyListenToWidthChanges:false};this.options=Object.assign(Object.assign({},this.options),t)}t.prototype.hasResized=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(u.hasTouchScreen){if(!this.sameWidth||this.previousIsLandscape!==this.isLandscape){this.resetPreviousValues();return[2,true]}}else{if(this.options.onlyListenToWidthChanges){if(!this.sameWidth){this.resetPreviousValues();return[2,true]}}else{if(!this.sameWidth||!this.sameHeight){this.resetPreviousValues();return[2,true]}}}return[2,false]}))}))};Object.defineProperty(t.prototype,"isLandscape",{get:function(){return r.window.width>r.window.height},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"sameWidth",{get:function(){return this.previousWidth===r.window.width},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"sameHeight",{get:function(){return this.previousHeight===r.window.height},enumerable:false,configurable:true});t.prototype.resetPreviousValues=function(){this.previousWidth=r.window.width;this.previousHeight=r.window.height;this.previousIsLandscape=this.isLandscape};return t}();var v=function(t){__extends(r,t);function r(){var n=t.apply(this,arguments)||this;n.resizeHandler=new b({onlyListenToWidthChanges:true});n.debouncedNotify=e((function(){return n.notify()}),10);n.notify=function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.resizeHandler.hasResized()];case 1:if(e.sent()){t.prototype.notify.call(this,undefined)}return[2]}}))}))};return n}r.prototype.connect=function(){t.prototype.connect.call(this);if(this.el){n(this.el,"resize",this.debouncedNotify,{passive:true})}};r.prototype.disconnect=function(){t.prototype.disconnect.call(this);if(this.el){i(this.el,"resize",this.debouncedNotify)}};return r}(s);t("B",v);var d=function(t){return parseInt(t.slice(0,-2),10)};var g=d(l);var w=d(f);var m=d(c);var _=d(a);var j=d(h);var y=function(t){var e=t.innerWidth;return e<g};var p=function(t){var e=t.innerWidth;return e>=g&&e<w};var O=function(t){return y(t)||p(t)};var k=function(t){return!O(t)};var D=function(t){var e=t.innerWidth;return e>=m&&e<_};var x=function(t){var e=t.innerWidth;return e>=_&&e<j};var S=function(t){var e=t.innerWidth;return e>=j};var T={mobile:y,tablet:p,touch:O,desktop:k,highDefinition:D,widescreen:x,fullhd:S};var W=function(){function t(){this.breakpoints=[];if(r.hasWindow){this.win=window;this.win.BaloiseDesignSystem=this.win.BaloiseDesignSystem||{};this.detect()}}Object.defineProperty(t.prototype,"isMobile",{get:function(){return this.includes("mobile")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isTablet",{get:function(){return this.includes("tablet")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isTouch",{get:function(){return this.includes("touch")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDesktop",{get:function(){return this.includes("desktop")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isHighDefinition",{get:function(){return this.includes("highDefinition")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isWidescreen",{get:function(){return this.includes("widescreen")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFullHD",{get:function(){return this.includes("fullhd")},enumerable:false,configurable:true});t.prototype.includes=function(t){var e;this.detect();return!!((e=this.breakpoints)===null||e===void 0?void 0:e.includes(t))};t.prototype.detect=function(){var t=this;if(this.win){this.breakpoints=Object.keys(T).filter((function(e){return T[e](t.win)}));this.win.BaloiseDesignSystem.breakpoints=this.breakpoints;this.win.BaloiseDesignSystem.platforms=this.breakpoints}return this.breakpoints};t.prototype.toObject=function(){return{mobile:this.breakpoints.includes("mobile"),tablet:this.breakpoints.includes("tablet"),touch:this.breakpoints.includes("touch"),desktop:this.breakpoints.includes("desktop"),highDefinition:this.breakpoints.includes("highDefinition"),widescreen:this.breakpoints.includes("widescreen"),fullhd:this.breakpoints.includes("fullhd")}};return t}();t("d",W);var C=t("b",new W);var H={mobile:false,tablet:false,touch:false,desktop:false,highDefinition:false,widescreen:false,fullhd:false};var L=function(t){__extends(n,t);function n(){var n=t.call(this,(function(t){return t.breakpointListener(n.state)}))||this;n.state=H;n.listener=new v;n.debouncedNotify=e((function(){return n.notify()}),50);n.listener.connect();n.listener.add((function(){C.detect();var t=C.toObject();if(!n.isEqual(t)){n.state=t;n.debouncedNotify()}}));return n}n.prototype.attach=function(e){t.prototype.attach.call(this,e);C.detect();var n=C.toObject();if(!this.isEqual(n)){this.state=n;this.debouncedNotify()}};n.prototype.isEqual=function(t){return JSON.stringify(this.state)===JSON.stringify(t)};return n}(o);t("c",L);var z=t("a",new L)}}}));
1
+ var __extends=this&&this.__extends||function(){var t=function(e,n){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]};return t(e,n)};return function(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function i(){this.constructor=e}e.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,u){function s(t){try{f(i.next(t))}catch(t){u(t)}}function o(t){try{f(i["throw"](t))}catch(t){u(t)}}function f(t){t.done?n(t.value):r(t.value).then(s,o)}f((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},i,r,u,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return f([t,e])}}function f(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(n=0)),n)try{if(i=1,r&&(u=o[0]&2?r["return"]:o[0]?r["throw"]||((u=r["return"])&&u.call(r),0):r.next)&&!(u=u.call(r,o[1])).done)return u;if(r=0,u)o=[o[0]&2,u.value];switch(o[0]){case 0:case 1:u=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(u=n.trys,u=u.length>0&&u[u.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!u||o[1]>u[0]&&o[1]<u[3])){n.label=o[1];break}if(o[0]===6&&n.label<u[1]){n.label=u[1];u=o;break}if(u&&n.label<u[2]){n.label=u[2];n.ops.push(o);break}if(u[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t];r=0}finally{i=u=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-8954495d.system.js","./p-a1f6e944.system.js","./p-ec9a7cf5.system.js","./p-eecefb0a.system.js","./p-95709c75.system.js"],(function(t){"use strict";var e,n,i,r,u,s,o,f,c,a,h,l;return{setters:[function(t){e=t.h;n=t.j;i=t.r},function(t){r=t.b},function(t){u=t.b},function(t){s=t.L;o=t.S},function(t){f=t.b;c=t.a;a=t.c;h=t.d;l=t.e}],execute:function(){var b=function(){function t(t){if(t===void 0){t={}}this.previousWidth=r.window.width;this.previousHeight=r.window.height;this.previousIsLandscape=this.isLandscape;this.options={onlyListenToWidthChanges:false};this.options=Object.assign(Object.assign({},this.options),t)}t.prototype.hasResized=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(u.hasTouchScreen){if(!this.sameWidth||this.previousIsLandscape!==this.isLandscape){this.resetPreviousValues();return[2,true]}}else{if(this.options.onlyListenToWidthChanges){if(!this.sameWidth){this.resetPreviousValues();return[2,true]}}else{if(!this.sameWidth||!this.sameHeight){this.resetPreviousValues();return[2,true]}}}return[2,false]}))}))};Object.defineProperty(t.prototype,"isLandscape",{get:function(){return r.window.width>r.window.height},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"sameWidth",{get:function(){return this.previousWidth===r.window.width},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"sameHeight",{get:function(){return this.previousHeight===r.window.height},enumerable:false,configurable:true});t.prototype.resetPreviousValues=function(){this.previousWidth=r.window.width;this.previousHeight=r.window.height;this.previousIsLandscape=this.isLandscape};return t}();var v=function(t){__extends(r,t);function r(){var n=t.apply(this,arguments)||this;n.resizeHandler=new b({onlyListenToWidthChanges:true});n.debouncedNotify=e((function(){return n.notify()}),10);n.notify=function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.resizeHandler.hasResized()];case 1:if(e.sent()){t.prototype.notify.call(this,undefined)}return[2]}}))}))};return n}r.prototype.connect=function(){t.prototype.connect.call(this);if(this.el){n(this.el,"resize",this.debouncedNotify,{passive:true})}};r.prototype.disconnect=function(){t.prototype.disconnect.call(this);if(this.el){i(this.el,"resize",this.debouncedNotify)}};return r}(s);t("B",v);var d=function(t){return parseInt(t.slice(0,-2),10)};var g=d(l);var w=d(f);var m=d(c);var _=d(a);var j=d(h);var y=function(t){var e=t.innerWidth;return e<g};var p=function(t){var e=t.innerWidth;return e>=g&&e<w};var O=function(t){return y(t)||p(t)};var k=function(t){return!O(t)};var D=function(t){var e=t.innerWidth;return e>=m&&e<_};var x=function(t){var e=t.innerWidth;return e>=_&&e<j};var S=function(t){var e=t.innerWidth;return e>=j};var T={mobile:y,tablet:p,touch:O,desktop:k,highDefinition:D,widescreen:x,fullhd:S};var W=function(){function t(){this.breakpoints=[];if(r.hasWindow){this.win=window;this.win.BaloiseDesignSystem=this.win.BaloiseDesignSystem||{};this.detect()}}Object.defineProperty(t.prototype,"isMobile",{get:function(){return this.includes("mobile")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isTablet",{get:function(){return this.includes("tablet")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isTouch",{get:function(){return this.includes("touch")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDesktop",{get:function(){return this.includes("desktop")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isHighDefinition",{get:function(){return this.includes("highDefinition")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isWidescreen",{get:function(){return this.includes("widescreen")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFullHD",{get:function(){return this.includes("fullhd")},enumerable:false,configurable:true});t.prototype.includes=function(t){var e;this.detect();return!!((e=this.breakpoints)===null||e===void 0?void 0:e.includes(t))};t.prototype.detect=function(){var t=this;if(this.win){this.breakpoints=Object.keys(T).filter((function(e){return T[e](t.win)}));this.win.BaloiseDesignSystem.breakpoints=this.breakpoints;this.win.BaloiseDesignSystem.platforms=this.breakpoints}return this.breakpoints};t.prototype.toObject=function(){return{mobile:this.breakpoints.includes("mobile"),tablet:this.breakpoints.includes("tablet"),touch:this.breakpoints.includes("touch"),desktop:this.breakpoints.includes("desktop"),highDefinition:this.breakpoints.includes("highDefinition"),widescreen:this.breakpoints.includes("widescreen"),fullhd:this.breakpoints.includes("fullhd")}};return t}();t("d",W);var C=t("b",new W);var H={mobile:false,tablet:false,touch:false,desktop:false,highDefinition:false,widescreen:false,fullhd:false};var L=function(t){__extends(n,t);function n(){var n=t.call(this,(function(t){return t.breakpointListener(n.state)}))||this;n.state=H;n.listener=new v;n.debouncedNotify=e((function(){return n.notify()}),50);n.listener.connect();n.listener.add((function(){C.detect();var t=C.toObject();if(!n.isEqual(t)){n.state=t;n.debouncedNotify()}}));return n}n.prototype.attach=function(e){t.prototype.attach.call(this,e);C.detect();var n=C.toObject();if(!this.isEqual(n)){this.state=n;this.debouncedNotify()}};n.prototype.isEqual=function(t){return JSON.stringify(this.state)===JSON.stringify(t)};return n}(o);t("c",L);var z=t("a",new L)}}}));