@swisspost/internet-header 1.12.0 → 1.12.1

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 (226) hide show
  1. package/dist/cjs/index.cjs.js +0 -36
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/cjs/post-klp-login-widget.cjs.entry.js +56 -6
  4. package/dist/cjs/post-klp-login-widget.cjs.entry.js.map +1 -1
  5. package/dist/cjs/post-language-switch.cjs.entry.js +99 -8
  6. package/dist/cjs/post-language-switch.cjs.entry.js.map +1 -1
  7. package/dist/cjs/post-logo.cjs.entry.js +18 -4
  8. package/dist/cjs/post-logo.cjs.entry.js.map +1 -1
  9. package/dist/cjs/post-main-navigation.cjs.entry.js +233 -9
  10. package/dist/cjs/post-main-navigation.cjs.entry.js.map +1 -1
  11. package/dist/cjs/post-meta-navigation.cjs.entry.js +19 -4
  12. package/dist/cjs/post-meta-navigation.cjs.entry.js.map +1 -1
  13. package/dist/cjs/post-search.cjs.entry.js +590 -11
  14. package/dist/cjs/post-search.cjs.entry.js.map +1 -1
  15. package/dist/cjs/post-skiplinks.cjs.entry.js +45 -6
  16. package/dist/cjs/post-skiplinks.cjs.entry.js.map +1 -1
  17. package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js +3609 -11
  18. package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js.map +1 -1
  19. package/dist/cjs/swisspost-internet-footer.cjs.entry.js +154 -6
  20. package/dist/cjs/swisspost-internet-footer.cjs.entry.js.map +1 -1
  21. package/dist/cjs/swisspost-internet-header.cjs.entry.js +824 -10
  22. package/dist/cjs/swisspost-internet-header.cjs.entry.js.map +1 -1
  23. package/dist/collection/collection-manifest.json +4 -4
  24. package/dist/collection/index.js +1 -11
  25. package/dist/collection/index.js.map +1 -1
  26. package/dist/components/index.js +0 -10
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/components/swisspost-internet-breadcrumbs.js +1 -1
  29. package/dist/components/swisspost-internet-footer.js +1 -1
  30. package/dist/components/swisspost-internet-header.js +10 -7
  31. package/dist/components/swisspost-internet-header.js.map +1 -1
  32. package/dist/docs.json +11 -11
  33. package/dist/esm/index.js +1 -21
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/post-klp-login-widget.entry.js +59 -5
  36. package/dist/esm/post-klp-login-widget.entry.js.map +1 -1
  37. package/dist/esm/post-language-switch.entry.js +102 -7
  38. package/dist/esm/post-language-switch.entry.js.map +1 -1
  39. package/dist/esm/post-logo.entry.js +21 -3
  40. package/dist/esm/post-logo.entry.js.map +1 -1
  41. package/dist/esm/post-main-navigation.entry.js +236 -8
  42. package/dist/esm/post-main-navigation.entry.js.map +1 -1
  43. package/dist/esm/post-meta-navigation.entry.js +22 -3
  44. package/dist/esm/post-meta-navigation.entry.js.map +1 -1
  45. package/dist/esm/post-search.entry.js +593 -10
  46. package/dist/esm/post-search.entry.js.map +1 -1
  47. package/dist/esm/post-skiplinks.entry.js +48 -5
  48. package/dist/esm/post-skiplinks.entry.js.map +1 -1
  49. package/dist/esm/swisspost-internet-breadcrumbs.entry.js +3612 -10
  50. package/dist/esm/swisspost-internet-breadcrumbs.entry.js.map +1 -1
  51. package/dist/esm/swisspost-internet-footer.entry.js +157 -5
  52. package/dist/esm/swisspost-internet-footer.entry.js.map +1 -1
  53. package/dist/esm/swisspost-internet-header.entry.js +827 -9
  54. package/dist/esm/swisspost-internet-header.entry.js.map +1 -1
  55. package/dist/esm-es5/index.js +1 -1
  56. package/dist/esm-es5/post-klp-login-widget.entry.js +1 -1
  57. package/dist/esm-es5/post-klp-login-widget.entry.js.map +1 -1
  58. package/dist/esm-es5/post-language-switch.entry.js +1 -1
  59. package/dist/esm-es5/post-language-switch.entry.js.map +1 -1
  60. package/dist/esm-es5/post-logo.entry.js +1 -1
  61. package/dist/esm-es5/post-logo.entry.js.map +1 -1
  62. package/dist/esm-es5/post-main-navigation.entry.js +1 -1
  63. package/dist/esm-es5/post-main-navigation.entry.js.map +1 -1
  64. package/dist/esm-es5/post-meta-navigation.entry.js +1 -1
  65. package/dist/esm-es5/post-meta-navigation.entry.js.map +1 -1
  66. package/dist/esm-es5/post-search.entry.js +1 -1
  67. package/dist/esm-es5/post-search.entry.js.map +1 -1
  68. package/dist/esm-es5/post-skiplinks.entry.js +1 -1
  69. package/dist/esm-es5/post-skiplinks.entry.js.map +1 -1
  70. package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js +6 -1
  71. package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js.map +1 -1
  72. package/dist/esm-es5/swisspost-internet-footer.entry.js +1 -1
  73. package/dist/esm-es5/swisspost-internet-footer.entry.js.map +1 -1
  74. package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
  75. package/dist/esm-es5/swisspost-internet-header.entry.js.map +1 -1
  76. package/dist/swisspost-internet-header/index.esm.js +1 -1
  77. package/dist/swisspost-internet-header/{p-05eea2be.js → p-04b1cab7.entry.js} +2 -2
  78. package/dist/swisspost-internet-header/{p-c8d9cc8c.js → p-069dbe32.entry.js} +2 -2
  79. package/dist/swisspost-internet-header/{p-61528220.js → p-21d8e5bc.entry.js} +2 -2
  80. package/dist/swisspost-internet-header/{p-aab6679b.js → p-2e334cfc.entry.js} +2 -2
  81. package/dist/swisspost-internet-header/{p-c7945779.system.js → p-50da051d.system.entry.js} +2 -2
  82. package/dist/swisspost-internet-header/{p-c7945779.system.js.map → p-50da051d.system.entry.js.map} +1 -1
  83. package/dist/swisspost-internet-header/p-50ea2036.system.js +2 -0
  84. package/dist/swisspost-internet-header/p-5adcdd91.system.js +1 -1
  85. package/dist/swisspost-internet-header/{p-96618f42.system.js → p-5ec6e2de.system.entry.js} +2 -2
  86. package/dist/swisspost-internet-header/{p-96618f42.system.js.map → p-5ec6e2de.system.entry.js.map} +1 -1
  87. package/dist/swisspost-internet-header/{p-78e8a405.js → p-61074cb4.entry.js} +2 -2
  88. package/dist/swisspost-internet-header/{p-2fb1a3ce.system.js → p-62ae68ad.system.entry.js} +2 -2
  89. package/dist/swisspost-internet-header/{p-2fb1a3ce.system.js.map → p-62ae68ad.system.entry.js.map} +1 -1
  90. package/dist/swisspost-internet-header/{p-fc2417e7.system.js → p-64b3fabe.system.entry.js} +2 -2
  91. package/dist/swisspost-internet-header/{p-fc2417e7.system.js.map → p-64b3fabe.system.entry.js.map} +1 -1
  92. package/dist/swisspost-internet-header/p-65cd41a6.system.entry.js +2 -0
  93. package/dist/swisspost-internet-header/{p-771114f0.system.js.map → p-65cd41a6.system.entry.js.map} +1 -1
  94. package/dist/swisspost-internet-header/{p-f2f69ff4.system.js → p-6b18b251.system.entry.js} +2 -2
  95. package/dist/swisspost-internet-header/{p-f2f69ff4.system.js.map → p-6b18b251.system.entry.js.map} +1 -1
  96. package/dist/swisspost-internet-header/{p-e187ba33.js → p-76e3cd9c.entry.js} +2 -2
  97. package/dist/swisspost-internet-header/{p-ee5e0cc6.system.js → p-9acc06ba.system.entry.js} +2 -2
  98. package/dist/swisspost-internet-header/{p-ee5e0cc6.system.js.map → p-9acc06ba.system.entry.js.map} +1 -1
  99. package/dist/swisspost-internet-header/{p-7a94a2d7.system.js → p-9d827167.system.entry.js} +2 -2
  100. package/dist/swisspost-internet-header/{p-7a94a2d7.system.js.map → p-9d827167.system.entry.js.map} +1 -1
  101. package/dist/swisspost-internet-header/{p-56764f7d.system.js → p-a097e677.system.entry.js} +2 -2
  102. package/dist/swisspost-internet-header/{p-56764f7d.system.js.map → p-a097e677.system.entry.js.map} +1 -1
  103. package/dist/swisspost-internet-header/p-b3ad4f8a.entry.js +2 -0
  104. package/dist/swisspost-internet-header/{p-f5876cc8.js.map → p-b3ad4f8a.entry.js.map} +1 -1
  105. package/dist/swisspost-internet-header/{p-70df9137.js → p-b8368eca.entry.js} +2 -2
  106. package/dist/swisspost-internet-header/p-c201f1b3.system.entry.js +2 -0
  107. package/dist/swisspost-internet-header/{p-18e9ce89.system.js.map → p-c201f1b3.system.entry.js.map} +1 -1
  108. package/dist/swisspost-internet-header/{p-dee824b8.js → p-d2fd2ff6.entry.js} +2 -2
  109. package/dist/swisspost-internet-header/{p-0096509c.js → p-f5a1e4a6.entry.js} +2 -2
  110. package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
  111. package/dist/types/index.d.ts +0 -10
  112. package/package.json +8 -6
  113. package/dist/cjs/post-internet-breadcrumbs-09754c05.js +0 -3616
  114. package/dist/cjs/post-internet-breadcrumbs-09754c05.js.map +0 -1
  115. package/dist/cjs/post-internet-footer-b51276d8.js +0 -161
  116. package/dist/cjs/post-internet-footer-b51276d8.js.map +0 -1
  117. package/dist/cjs/post-internet-header-5962d752.js +0 -828
  118. package/dist/cjs/post-internet-header-5962d752.js.map +0 -1
  119. package/dist/cjs/post-klp-login-widget-d03de512.js +0 -63
  120. package/dist/cjs/post-klp-login-widget-d03de512.js.map +0 -1
  121. package/dist/cjs/post-language-switch-9cd31034.js +0 -106
  122. package/dist/cjs/post-language-switch-9cd31034.js.map +0 -1
  123. package/dist/cjs/post-logo-5867ad55.js +0 -25
  124. package/dist/cjs/post-logo-5867ad55.js.map +0 -1
  125. package/dist/cjs/post-main-navigation-ab81aac6.js +0 -240
  126. package/dist/cjs/post-main-navigation-ab81aac6.js.map +0 -1
  127. package/dist/cjs/post-meta-navigation-0b73779f.js +0 -26
  128. package/dist/cjs/post-meta-navigation-0b73779f.js.map +0 -1
  129. package/dist/cjs/post-search-2232c291.js +0 -597
  130. package/dist/cjs/post-search-2232c291.js.map +0 -1
  131. package/dist/cjs/post-skiplinks-3db1d214.js +0 -52
  132. package/dist/cjs/post-skiplinks-3db1d214.js.map +0 -1
  133. package/dist/esm/post-internet-breadcrumbs-474f625e.js +0 -3614
  134. package/dist/esm/post-internet-breadcrumbs-474f625e.js.map +0 -1
  135. package/dist/esm/post-internet-footer-273b0d8d.js +0 -159
  136. package/dist/esm/post-internet-footer-273b0d8d.js.map +0 -1
  137. package/dist/esm/post-internet-header-a825bfd6.js +0 -826
  138. package/dist/esm/post-internet-header-a825bfd6.js.map +0 -1
  139. package/dist/esm/post-klp-login-widget-b1306336.js +0 -61
  140. package/dist/esm/post-klp-login-widget-b1306336.js.map +0 -1
  141. package/dist/esm/post-language-switch-fd570b9d.js +0 -104
  142. package/dist/esm/post-language-switch-fd570b9d.js.map +0 -1
  143. package/dist/esm/post-logo-cde3c44d.js +0 -23
  144. package/dist/esm/post-logo-cde3c44d.js.map +0 -1
  145. package/dist/esm/post-main-navigation-12eaef9f.js +0 -238
  146. package/dist/esm/post-main-navigation-12eaef9f.js.map +0 -1
  147. package/dist/esm/post-meta-navigation-09e9bdc8.js +0 -24
  148. package/dist/esm/post-meta-navigation-09e9bdc8.js.map +0 -1
  149. package/dist/esm/post-search-5c3a10ac.js +0 -595
  150. package/dist/esm/post-search-5c3a10ac.js.map +0 -1
  151. package/dist/esm/post-skiplinks-b3c32a77.js +0 -50
  152. package/dist/esm/post-skiplinks-b3c32a77.js.map +0 -1
  153. package/dist/esm-es5/post-internet-breadcrumbs-474f625e.js +0 -7
  154. package/dist/esm-es5/post-internet-breadcrumbs-474f625e.js.map +0 -1
  155. package/dist/esm-es5/post-internet-footer-273b0d8d.js +0 -2
  156. package/dist/esm-es5/post-internet-footer-273b0d8d.js.map +0 -1
  157. package/dist/esm-es5/post-internet-header-a825bfd6.js +0 -2
  158. package/dist/esm-es5/post-internet-header-a825bfd6.js.map +0 -1
  159. package/dist/esm-es5/post-klp-login-widget-b1306336.js +0 -2
  160. package/dist/esm-es5/post-klp-login-widget-b1306336.js.map +0 -1
  161. package/dist/esm-es5/post-language-switch-fd570b9d.js +0 -2
  162. package/dist/esm-es5/post-language-switch-fd570b9d.js.map +0 -1
  163. package/dist/esm-es5/post-logo-cde3c44d.js +0 -2
  164. package/dist/esm-es5/post-logo-cde3c44d.js.map +0 -1
  165. package/dist/esm-es5/post-main-navigation-12eaef9f.js +0 -2
  166. package/dist/esm-es5/post-main-navigation-12eaef9f.js.map +0 -1
  167. package/dist/esm-es5/post-meta-navigation-09e9bdc8.js +0 -2
  168. package/dist/esm-es5/post-meta-navigation-09e9bdc8.js.map +0 -1
  169. package/dist/esm-es5/post-search-5c3a10ac.js +0 -2
  170. package/dist/esm-es5/post-search-5c3a10ac.js.map +0 -1
  171. package/dist/esm-es5/post-skiplinks-b3c32a77.js +0 -2
  172. package/dist/esm-es5/post-skiplinks-b3c32a77.js.map +0 -1
  173. package/dist/swisspost-internet-header/p-0d61ca4e.system.entry.js +0 -2
  174. package/dist/swisspost-internet-header/p-18e9ce89.system.js +0 -2
  175. package/dist/swisspost-internet-header/p-1a9fcba5.entry.js +0 -2
  176. package/dist/swisspost-internet-header/p-1a9fcba5.entry.js.map +0 -1
  177. package/dist/swisspost-internet-header/p-237a408c.entry.js +0 -2
  178. package/dist/swisspost-internet-header/p-237a408c.entry.js.map +0 -1
  179. package/dist/swisspost-internet-header/p-2eb179a7.entry.js +0 -2
  180. package/dist/swisspost-internet-header/p-2eb179a7.entry.js.map +0 -1
  181. package/dist/swisspost-internet-header/p-3672587a.entry.js +0 -2
  182. package/dist/swisspost-internet-header/p-3672587a.entry.js.map +0 -1
  183. package/dist/swisspost-internet-header/p-39785e3d.system.entry.js +0 -2
  184. package/dist/swisspost-internet-header/p-39785e3d.system.entry.js.map +0 -1
  185. package/dist/swisspost-internet-header/p-4248f499.system.entry.js +0 -2
  186. package/dist/swisspost-internet-header/p-4248f499.system.entry.js.map +0 -1
  187. package/dist/swisspost-internet-header/p-6145b5f1.system.js +0 -2
  188. package/dist/swisspost-internet-header/p-6145b5f1.system.js.map +0 -1
  189. package/dist/swisspost-internet-header/p-65ce36ba.entry.js +0 -2
  190. package/dist/swisspost-internet-header/p-65ce36ba.entry.js.map +0 -1
  191. package/dist/swisspost-internet-header/p-771114f0.system.js +0 -2
  192. package/dist/swisspost-internet-header/p-7e78b029.system.entry.js +0 -2
  193. package/dist/swisspost-internet-header/p-7e78b029.system.entry.js.map +0 -1
  194. package/dist/swisspost-internet-header/p-8ddbca59.system.entry.js +0 -2
  195. package/dist/swisspost-internet-header/p-8ddbca59.system.entry.js.map +0 -1
  196. package/dist/swisspost-internet-header/p-a0f5c014.system.entry.js +0 -2
  197. package/dist/swisspost-internet-header/p-a0f5c014.system.entry.js.map +0 -1
  198. package/dist/swisspost-internet-header/p-a290e3e2.system.entry.js +0 -2
  199. package/dist/swisspost-internet-header/p-a290e3e2.system.entry.js.map +0 -1
  200. package/dist/swisspost-internet-header/p-a58fc500.system.entry.js +0 -2
  201. package/dist/swisspost-internet-header/p-a58fc500.system.entry.js.map +0 -1
  202. package/dist/swisspost-internet-header/p-aeaa2c26.entry.js +0 -2
  203. package/dist/swisspost-internet-header/p-aeaa2c26.entry.js.map +0 -1
  204. package/dist/swisspost-internet-header/p-c4011fc6.system.entry.js +0 -2
  205. package/dist/swisspost-internet-header/p-c4011fc6.system.entry.js.map +0 -1
  206. package/dist/swisspost-internet-header/p-c99a43b0.entry.js +0 -2
  207. package/dist/swisspost-internet-header/p-c99a43b0.entry.js.map +0 -1
  208. package/dist/swisspost-internet-header/p-d9f67b45.entry.js +0 -2
  209. package/dist/swisspost-internet-header/p-d9f67b45.entry.js.map +0 -1
  210. package/dist/swisspost-internet-header/p-de27fab4.entry.js +0 -2
  211. package/dist/swisspost-internet-header/p-de27fab4.entry.js.map +0 -1
  212. package/dist/swisspost-internet-header/p-f25c234f.entry.js +0 -2
  213. package/dist/swisspost-internet-header/p-f25c234f.entry.js.map +0 -1
  214. package/dist/swisspost-internet-header/p-f5876cc8.js +0 -2
  215. package/dist/swisspost-internet-header/p-fef30370.system.entry.js +0 -2
  216. package/dist/swisspost-internet-header/p-fef30370.system.entry.js.map +0 -1
  217. /package/dist/swisspost-internet-header/{p-05eea2be.js.map → p-04b1cab7.entry.js.map} +0 -0
  218. /package/dist/swisspost-internet-header/{p-c8d9cc8c.js.map → p-069dbe32.entry.js.map} +0 -0
  219. /package/dist/swisspost-internet-header/{p-61528220.js.map → p-21d8e5bc.entry.js.map} +0 -0
  220. /package/dist/swisspost-internet-header/{p-aab6679b.js.map → p-2e334cfc.entry.js.map} +0 -0
  221. /package/dist/swisspost-internet-header/{p-0d61ca4e.system.entry.js.map → p-50ea2036.system.js.map} +0 -0
  222. /package/dist/swisspost-internet-header/{p-78e8a405.js.map → p-61074cb4.entry.js.map} +0 -0
  223. /package/dist/swisspost-internet-header/{p-e187ba33.js.map → p-76e3cd9c.entry.js.map} +0 -0
  224. /package/dist/swisspost-internet-header/{p-70df9137.js.map → p-b8368eca.entry.js.map} +0 -0
  225. /package/dist/swisspost-internet-header/{p-dee824b8.js.map → p-d2fd2ff6.entry.js.map} +0 -0
  226. /package/dist/swisspost-internet-header/{p-0096509c.js.map → p-f5a1e4a6.entry.js.map} +0 -0
@@ -2,19 +2,3617 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const postInternetBreadcrumbs = require('./post-internet-breadcrumbs-09754c05.js');
6
- require('./index-4bd0adf1.js');
7
- require('./index-3216e4c8.js');
8
- require('./bodyScrollLock.esm-59f17217.js');
9
- require('./svg-icon.component-5965f301.js');
10
- require('./store-77668e50.js');
11
- require('./_commonjsHelpers-537d719a.js');
12
- require('./svg-sprite.component-4b5677ef.js');
13
- require('./language.service-dbe2a435.js');
14
- require('./utils-717975e0.js');
5
+ const index = require('./index-4bd0adf1.js');
6
+ const index$1 = require('./index-3216e4c8.js');
7
+ const bodyScrollLock_esm = require('./bodyScrollLock.esm-59f17217.js');
8
+ const svgIcon_component = require('./svg-icon.component-5965f301.js');
9
+ const store = require('./store-77668e50.js');
10
+ const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
11
+ const svgSprite_component = require('./svg-sprite.component-4b5677ef.js');
12
+ const language_service = require('./language.service-dbe2a435.js');
13
+ const utils = require('./utils-717975e0.js');
15
14
 
15
+ /*!
16
+ * tabbable 6.2.0
17
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
18
+ */
19
+ // NOTE: separate `:not()` selectors has broader browser support than the newer
20
+ // `:not([inert], [inert] *)` (Feb 2023)
21
+ // CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes
22
+ // the entire query to fail, resulting in no nodes found, which will break a lot
23
+ // of things... so we have to rely on JS to identify nodes inside an inert container
24
+ var candidateSelectors = ['input:not([inert])', 'select:not([inert])', 'textarea:not([inert])', 'a[href]:not([inert])', 'button:not([inert])', '[tabindex]:not(slot):not([inert])', 'audio[controls]:not([inert])', 'video[controls]:not([inert])', '[contenteditable]:not([contenteditable="false"]):not([inert])', 'details>summary:first-of-type:not([inert])', 'details:not([inert])'];
25
+ var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
26
+ var NoElement = typeof Element === 'undefined';
27
+ var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
28
+ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
29
+ var _element$getRootNode;
30
+ return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
31
+ } : function (element) {
32
+ return element === null || element === void 0 ? void 0 : element.ownerDocument;
33
+ };
16
34
 
35
+ /**
36
+ * Determines if a node is inert or in an inert ancestor.
37
+ * @param {Element} [node]
38
+ * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to
39
+ * see if any of them are inert. If false, only `node` itself is considered.
40
+ * @returns {boolean} True if inert itself or by way of being in an inert ancestor.
41
+ * False if `node` is falsy.
42
+ */
43
+ var isInert = function isInert(node, lookUp) {
44
+ var _node$getAttribute;
45
+ if (lookUp === void 0) {
46
+ lookUp = true;
47
+ }
48
+ // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`
49
+ // JS API property; we have to check the attribute, which can either be empty or 'true';
50
+ // if it's `null` (not specified) or 'false', it's an active element
51
+ var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');
52
+ var inert = inertAtt === '' || inertAtt === 'true';
17
53
 
18
- exports.swisspost_internet_breadcrumbs = postInternetBreadcrumbs.PostInternetBreadcrumbs;
54
+ // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`
55
+ // if it weren't for `matches()` not being a function on shadow roots; the following
56
+ // code works for any kind of node
57
+ // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`
58
+ // so it likely would not support `:is([inert] *)` either...
59
+ var result = inert || lookUp && node && isInert(node.parentNode); // recursive
60
+
61
+ return result;
62
+ };
63
+
64
+ /**
65
+ * Determines if a node's content is editable.
66
+ * @param {Element} [node]
67
+ * @returns True if it's content-editable; false if it's not or `node` is falsy.
68
+ */
69
+ var isContentEditable = function isContentEditable(node) {
70
+ var _node$getAttribute2;
71
+ // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have
72
+ // to use the attribute directly to check for this, which can either be empty or 'true';
73
+ // if it's `null` (not specified) or 'false', it's a non-editable element
74
+ var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');
75
+ return attValue === '' || attValue === 'true';
76
+ };
77
+
78
+ /**
79
+ * @param {Element} el container to check in
80
+ * @param {boolean} includeContainer add container to check
81
+ * @param {(node: Element) => boolean} filter filter candidates
82
+ * @returns {Element[]}
83
+ */
84
+ var getCandidates = function getCandidates(el, includeContainer, filter) {
85
+ // even if `includeContainer=false`, we still have to check it for inertness because
86
+ // if it's inert, all its children are inert
87
+ if (isInert(el)) {
88
+ return [];
89
+ }
90
+ var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
91
+ if (includeContainer && matches.call(el, candidateSelector)) {
92
+ candidates.unshift(el);
93
+ }
94
+ candidates = candidates.filter(filter);
95
+ return candidates;
96
+ };
97
+
98
+ /**
99
+ * @callback GetShadowRoot
100
+ * @param {Element} element to check for shadow root
101
+ * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
102
+ */
103
+
104
+ /**
105
+ * @callback ShadowRootFilter
106
+ * @param {Element} shadowHostNode the element which contains shadow content
107
+ * @returns {boolean} true if a shadow root could potentially contain valid candidates.
108
+ */
109
+
110
+ /**
111
+ * @typedef {Object} CandidateScope
112
+ * @property {Element} scopeParent contains inner candidates
113
+ * @property {Element[]} candidates list of candidates found in the scope parent
114
+ */
115
+
116
+ /**
117
+ * @typedef {Object} IterativeOptions
118
+ * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
119
+ * if a function, implies shadow support is enabled and either returns the shadow root of an element
120
+ * or a boolean stating if it has an undisclosed shadow root
121
+ * @property {(node: Element) => boolean} filter filter candidates
122
+ * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
123
+ * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
124
+ */
125
+
126
+ /**
127
+ * @param {Element[]} elements list of element containers to match candidates from
128
+ * @param {boolean} includeContainer add container list to check
129
+ * @param {IterativeOptions} options
130
+ * @returns {Array.<Element|CandidateScope>}
131
+ */
132
+ var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
133
+ var candidates = [];
134
+ var elementsToCheck = Array.from(elements);
135
+ while (elementsToCheck.length) {
136
+ var element = elementsToCheck.shift();
137
+ if (isInert(element, false)) {
138
+ // no need to look up since we're drilling down
139
+ // anything inside this container will also be inert
140
+ continue;
141
+ }
142
+ if (element.tagName === 'SLOT') {
143
+ // add shadow dom slot scope (slot itself cannot be focusable)
144
+ var assigned = element.assignedElements();
145
+ var content = assigned.length ? assigned : element.children;
146
+ var nestedCandidates = getCandidatesIteratively(content, true, options);
147
+ if (options.flatten) {
148
+ candidates.push.apply(candidates, nestedCandidates);
149
+ } else {
150
+ candidates.push({
151
+ scopeParent: element,
152
+ candidates: nestedCandidates
153
+ });
154
+ }
155
+ } else {
156
+ // check candidate element
157
+ var validCandidate = matches.call(element, candidateSelector);
158
+ if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
159
+ candidates.push(element);
160
+ }
161
+
162
+ // iterate over shadow content if possible
163
+ var shadowRoot = element.shadowRoot ||
164
+ // check for an undisclosed shadow
165
+ typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
166
+
167
+ // no inert look up because we're already drilling down and checking for inertness
168
+ // on the way down, so all containers to this root node should have already been
169
+ // vetted as non-inert
170
+ var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
171
+ if (shadowRoot && validShadowRoot) {
172
+ // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
173
+ // shadow exists, so look at light dom children as fallback BUT create a scope for any
174
+ // child candidates found because they're likely slotted elements (elements that are
175
+ // children of the web component element (which has the shadow), in the light dom, but
176
+ // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
177
+ // _after_ we return from this recursive call
178
+ var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
179
+ if (options.flatten) {
180
+ candidates.push.apply(candidates, _nestedCandidates);
181
+ } else {
182
+ candidates.push({
183
+ scopeParent: element,
184
+ candidates: _nestedCandidates
185
+ });
186
+ }
187
+ } else {
188
+ // there's not shadow so just dig into the element's (light dom) children
189
+ // __without__ giving the element special scope treatment
190
+ elementsToCheck.unshift.apply(elementsToCheck, element.children);
191
+ }
192
+ }
193
+ }
194
+ return candidates;
195
+ };
196
+
197
+ /**
198
+ * @private
199
+ * Determines if the node has an explicitly specified `tabindex` attribute.
200
+ * @param {HTMLElement} node
201
+ * @returns {boolean} True if so; false if not.
202
+ */
203
+ var hasTabIndex = function hasTabIndex(node) {
204
+ return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
205
+ };
206
+
207
+ /**
208
+ * Determine the tab index of a given node.
209
+ * @param {HTMLElement} node
210
+ * @returns {number} Tab order (negative, 0, or positive number).
211
+ * @throws {Error} If `node` is falsy.
212
+ */
213
+ var getTabIndex = function getTabIndex(node) {
214
+ if (!node) {
215
+ throw new Error('No node provided');
216
+ }
217
+ if (node.tabIndex < 0) {
218
+ // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
219
+ // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
220
+ // yet they are still part of the regular tab order; in FF, they get a default
221
+ // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
222
+ // order, consider their tab index to be 0.
223
+ // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
224
+ // so if they don't have a tabindex attribute specifically set, assume it's 0.
225
+ if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
226
+ return 0;
227
+ }
228
+ }
229
+ return node.tabIndex;
230
+ };
231
+
232
+ /**
233
+ * Determine the tab index of a given node __for sort order purposes__.
234
+ * @param {HTMLElement} node
235
+ * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
236
+ * has tabIndex -1, but needs to be sorted by document order in order for its content to be
237
+ * inserted into the correct sort position.
238
+ * @returns {number} Tab order (negative, 0, or positive number).
239
+ */
240
+ var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
241
+ var tabIndex = getTabIndex(node);
242
+ if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
243
+ return 0;
244
+ }
245
+ return tabIndex;
246
+ };
247
+ var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
248
+ return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
249
+ };
250
+ var isInput = function isInput(node) {
251
+ return node.tagName === 'INPUT';
252
+ };
253
+ var isHiddenInput = function isHiddenInput(node) {
254
+ return isInput(node) && node.type === 'hidden';
255
+ };
256
+ var isDetailsWithSummary = function isDetailsWithSummary(node) {
257
+ var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
258
+ return child.tagName === 'SUMMARY';
259
+ });
260
+ return r;
261
+ };
262
+ var getCheckedRadio = function getCheckedRadio(nodes, form) {
263
+ for (var i = 0; i < nodes.length; i++) {
264
+ if (nodes[i].checked && nodes[i].form === form) {
265
+ return nodes[i];
266
+ }
267
+ }
268
+ };
269
+ var isTabbableRadio = function isTabbableRadio(node) {
270
+ if (!node.name) {
271
+ return true;
272
+ }
273
+ var radioScope = node.form || getRootNode(node);
274
+ var queryRadios = function queryRadios(name) {
275
+ return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
276
+ };
277
+ var radioSet;
278
+ if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
279
+ radioSet = queryRadios(window.CSS.escape(node.name));
280
+ } else {
281
+ try {
282
+ radioSet = queryRadios(node.name);
283
+ } catch (err) {
284
+ // eslint-disable-next-line no-console
285
+ console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
286
+ return false;
287
+ }
288
+ }
289
+ var checked = getCheckedRadio(radioSet, node.form);
290
+ return !checked || checked === node;
291
+ };
292
+ var isRadio = function isRadio(node) {
293
+ return isInput(node) && node.type === 'radio';
294
+ };
295
+ var isNonTabbableRadio = function isNonTabbableRadio(node) {
296
+ return isRadio(node) && !isTabbableRadio(node);
297
+ };
298
+
299
+ // determines if a node is ultimately attached to the window's document
300
+ var isNodeAttached = function isNodeAttached(node) {
301
+ var _nodeRoot;
302
+ // The root node is the shadow root if the node is in a shadow DOM; some document otherwise
303
+ // (but NOT _the_ document; see second 'If' comment below for more).
304
+ // If rootNode is shadow root, it'll have a host, which is the element to which the shadow
305
+ // is attached, and the one we need to check if it's in the document or not (because the
306
+ // shadow, and all nodes it contains, is never considered in the document since shadows
307
+ // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
308
+ // is hidden, or is not in the document itself but is detached, it will affect the shadow's
309
+ // visibility, including all the nodes it contains). The host could be any normal node,
310
+ // or a custom element (i.e. web component). Either way, that's the one that is considered
311
+ // part of the document, not the shadow root, nor any of its children (i.e. the node being
312
+ // tested).
313
+ // To further complicate things, we have to look all the way up until we find a shadow HOST
314
+ // that is attached (or find none) because the node might be in nested shadows...
315
+ // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
316
+ // document (per the docs) and while it's a Document-type object, that document does not
317
+ // appear to be the same as the node's `ownerDocument` for some reason, so it's safer
318
+ // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
319
+ // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
320
+ // node is actually detached.
321
+ // NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible
322
+ // if a tabbable/focusable node was quickly added to the DOM, focused, and then removed
323
+ // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then
324
+ // `ownerDocument` will be `null`, hence the optional chaining on it.
325
+ var nodeRoot = node && getRootNode(node);
326
+ var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
327
+
328
+ // in some cases, a detached node will return itself as the root instead of a document or
329
+ // shadow root object, in which case, we shouldn't try to look further up the host chain
330
+ var attached = false;
331
+ if (nodeRoot && nodeRoot !== node) {
332
+ var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
333
+ attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
334
+ while (!attached && nodeRootHost) {
335
+ var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
336
+ // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
337
+ // which means we need to get the host's host and check if that parent host is contained
338
+ // in (i.e. attached to) the document
339
+ nodeRoot = getRootNode(nodeRootHost);
340
+ nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
341
+ attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
342
+ }
343
+ }
344
+ return attached;
345
+ };
346
+ var isZeroArea = function isZeroArea(node) {
347
+ var _node$getBoundingClie = node.getBoundingClientRect(),
348
+ width = _node$getBoundingClie.width,
349
+ height = _node$getBoundingClie.height;
350
+ return width === 0 && height === 0;
351
+ };
352
+ var isHidden = function isHidden(node, _ref) {
353
+ var displayCheck = _ref.displayCheck,
354
+ getShadowRoot = _ref.getShadowRoot;
355
+ // NOTE: visibility will be `undefined` if node is detached from the document
356
+ // (see notes about this further down), which means we will consider it visible
357
+ // (this is legacy behavior from a very long way back)
358
+ // NOTE: we check this regardless of `displayCheck="none"` because this is a
359
+ // _visibility_ check, not a _display_ check
360
+ if (getComputedStyle(node).visibility === 'hidden') {
361
+ return true;
362
+ }
363
+ var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
364
+ var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
365
+ if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
366
+ return true;
367
+ }
368
+ if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
369
+ if (typeof getShadowRoot === 'function') {
370
+ // figure out if we should consider the node to be in an undisclosed shadow and use the
371
+ // 'non-zero-area' fallback
372
+ var originalNode = node;
373
+ while (node) {
374
+ var parentElement = node.parentElement;
375
+ var rootNode = getRootNode(node);
376
+ if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
377
+ ) {
378
+ // node has an undisclosed shadow which means we can only treat it as a black box, so we
379
+ // fall back to a non-zero-area test
380
+ return isZeroArea(node);
381
+ } else if (node.assignedSlot) {
382
+ // iterate up slot
383
+ node = node.assignedSlot;
384
+ } else if (!parentElement && rootNode !== node.ownerDocument) {
385
+ // cross shadow boundary
386
+ node = rootNode.host;
387
+ } else {
388
+ // iterate up normal dom
389
+ node = parentElement;
390
+ }
391
+ }
392
+ node = originalNode;
393
+ }
394
+ // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
395
+ // (i.e. it does not also presume that all nodes might have undisclosed shadows); or
396
+ // it might be a falsy value, which means shadow DOM support is disabled
397
+
398
+ // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
399
+ // now we can just test to see if it would normally be visible or not, provided it's
400
+ // attached to the main document.
401
+ // NOTE: We must consider case where node is inside a shadow DOM and given directly to
402
+ // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
403
+
404
+ if (isNodeAttached(node)) {
405
+ // this works wherever the node is: if there's at least one client rect, it's
406
+ // somehow displayed; it also covers the CSS 'display: contents' case where the
407
+ // node itself is hidden in place of its contents; and there's no need to search
408
+ // up the hierarchy either
409
+ return !node.getClientRects().length;
410
+ }
411
+
412
+ // Else, the node isn't attached to the document, which means the `getClientRects()`
413
+ // API will __always__ return zero rects (this can happen, for example, if React
414
+ // is used to render nodes onto a detached tree, as confirmed in this thread:
415
+ // https://github.com/facebook/react/issues/9117#issuecomment-284228870)
416
+ //
417
+ // It also means that even window.getComputedStyle(node).display will return `undefined`
418
+ // because styles are only computed for nodes that are in the document.
419
+ //
420
+ // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
421
+ // somehow. Though it was never stated officially, anyone who has ever used tabbable
422
+ // APIs on nodes in detached containers has actually implicitly used tabbable in what
423
+ // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
424
+ // considering __everything__ to be visible because of the innability to determine styles.
425
+ //
426
+ // v6.0.0: As of this major release, the default 'full' option __no longer treats detached
427
+ // nodes as visible with the 'none' fallback.__
428
+ if (displayCheck !== 'legacy-full') {
429
+ return true; // hidden
430
+ }
431
+ // else, fallback to 'none' mode and consider the node visible
432
+ } else if (displayCheck === 'non-zero-area') {
433
+ // NOTE: Even though this tests that the node's client rect is non-zero to determine
434
+ // whether it's displayed, and that a detached node will __always__ have a zero-area
435
+ // client rect, we don't special-case for whether the node is attached or not. In
436
+ // this mode, we do want to consider nodes that have a zero area to be hidden at all
437
+ // times, and that includes attached or not.
438
+ return isZeroArea(node);
439
+ }
440
+
441
+ // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
442
+ // it's visible
443
+ return false;
444
+ };
445
+
446
+ // form fields (nested) inside a disabled fieldset are not focusable/tabbable
447
+ // unless they are in the _first_ <legend> element of the top-most disabled
448
+ // fieldset
449
+ var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
450
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
451
+ var parentNode = node.parentElement;
452
+ // check if `node` is contained in a disabled <fieldset>
453
+ while (parentNode) {
454
+ if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
455
+ // look for the first <legend> among the children of the disabled <fieldset>
456
+ for (var i = 0; i < parentNode.children.length; i++) {
457
+ var child = parentNode.children.item(i);
458
+ // when the first <legend> (in document order) is found
459
+ if (child.tagName === 'LEGEND') {
460
+ // if its parent <fieldset> is not nested in another disabled <fieldset>,
461
+ // return whether `node` is a descendant of its first <legend>
462
+ return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
463
+ }
464
+ }
465
+ // the disabled <fieldset> containing `node` has no <legend>
466
+ return true;
467
+ }
468
+ parentNode = parentNode.parentElement;
469
+ }
470
+ }
471
+
472
+ // else, node's tabbable/focusable state should not be affected by a fieldset's
473
+ // enabled/disabled state
474
+ return false;
475
+ };
476
+ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
477
+ if (node.disabled ||
478
+ // we must do an inert look up to filter out any elements inside an inert ancestor
479
+ // because we're limited in the type of selectors we can use in JSDom (see related
480
+ // note related to `candidateSelectors`)
481
+ isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
482
+ // For a details element with a summary, the summary element gets the focus
483
+ isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
484
+ return false;
485
+ }
486
+ return true;
487
+ };
488
+ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
489
+ if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
490
+ return false;
491
+ }
492
+ return true;
493
+ };
494
+ var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
495
+ var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
496
+ if (isNaN(tabIndex) || tabIndex >= 0) {
497
+ return true;
498
+ }
499
+ // If a custom element has an explicit negative tabindex,
500
+ // browsers will not allow tab targeting said element's children.
501
+ return false;
502
+ };
503
+
504
+ /**
505
+ * @param {Array.<Element|CandidateScope>} candidates
506
+ * @returns Element[]
507
+ */
508
+ var sortByOrder = function sortByOrder(candidates) {
509
+ var regularTabbables = [];
510
+ var orderedTabbables = [];
511
+ candidates.forEach(function (item, i) {
512
+ var isScope = !!item.scopeParent;
513
+ var element = isScope ? item.scopeParent : item;
514
+ var candidateTabindex = getSortOrderTabIndex(element, isScope);
515
+ var elements = isScope ? sortByOrder(item.candidates) : element;
516
+ if (candidateTabindex === 0) {
517
+ isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
518
+ } else {
519
+ orderedTabbables.push({
520
+ documentOrder: i,
521
+ tabIndex: candidateTabindex,
522
+ item: item,
523
+ isScope: isScope,
524
+ content: elements
525
+ });
526
+ }
527
+ });
528
+ return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
529
+ sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
530
+ return acc;
531
+ }, []).concat(regularTabbables);
532
+ };
533
+ var tabbable = function tabbable(container, options) {
534
+ options = options || {};
535
+ var candidates;
536
+ if (options.getShadowRoot) {
537
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
538
+ filter: isNodeMatchingSelectorTabbable.bind(null, options),
539
+ flatten: false,
540
+ getShadowRoot: options.getShadowRoot,
541
+ shadowRootFilter: isValidShadowRootTabbable
542
+ });
543
+ } else {
544
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
545
+ }
546
+ return sortByOrder(candidates);
547
+ };
548
+
549
+ let key = 0;
550
+ /**
551
+ * Trap the focus inside a specific container by prepending/appending two focus trap
552
+ * input boxes who return the focus into the container.
553
+ *
554
+ * @param props active: activate or deactivate the focus trap
555
+ * @param children Child nodes
556
+ * @returns
557
+ */
558
+ const FocusTrap = (props, children) => {
559
+ var _a;
560
+ // Default value for active is true
561
+ const active = (_a = props.active) !== null && _a !== void 0 ? _a : false;
562
+ const handleFocusIn = (event, mode) => {
563
+ if (!children.length) {
564
+ return;
565
+ }
566
+ // Try to get a list of tabbable elements
567
+ const containerIndex = mode === 'first' ? 0 : children.length - 1;
568
+ const container = children[containerIndex].$elm$;
569
+ const focusable = tabbable(container);
570
+ if (!focusable.length) {
571
+ return;
572
+ }
573
+ // We can trap the focus, cancel the event
574
+ event.preventDefault();
575
+ event.stopPropagation();
576
+ // Select the appropriate element from the list
577
+ const focusIndex = mode === 'first' ? 0 : focusable.length - 1;
578
+ let focusElement = focusable[focusIndex];
579
+ focusElement.focus();
580
+ };
581
+ key++;
582
+ return [
583
+ index.h("input", { type: "text", "aria-hidden": "true", class: "visually-hidden", key: `focus-trap-before-${key}`, onFocusin: e => active && handleFocusIn(e, 'last') }),
584
+ children,
585
+ index.h("input", { type: "text", "aria-hidden": "true", class: "visually-hidden", key: `focus-trap-after-${key}`, onFocusin: e => active && handleFocusIn(e, 'first') }),
586
+ ];
587
+ };
588
+
589
+ /**
590
+ * Overlay implementation with focus trap according to
591
+ * https://www.accessibility-developer-guide.com/examples/widgets/dialog/#modal-dialog
592
+ *
593
+ * @param props
594
+ * @returns
595
+ */
596
+ const OverlayComponent = (props) => (index.h("div", { class: "overlay", onClick: () => props.onClick(), onKeyDown: e => props.onKeyDown !== undefined && props.onKeyDown(e), ref: e => e !== undefined && props.overlayRef(e) },
597
+ index.h("div", { class: "container", role: "dialog" },
598
+ index.h(FocusTrap, null,
599
+ index.h("div", { class: "overlay-container", tabindex: "-1" /* For initial focus */, role: "document", onClick: e => e.stopPropagation() },
600
+ index.h("button", { class: `overlay-close btn-blank d-inline-flex align-items-center nav-link ${props.overlay.id}`, onClick: () => props.onClick() },
601
+ index.h("span", { class: "visually-hidden" }, props.closeButtonText),
602
+ index.h(svgIcon_component.SvgIcon, { name: "pi-close" })),
603
+ index.h("iframe", { src: props.overlay.target, frameborder: "0", class: "frame", ref: e => e !== undefined && props.iFrameRef(e) }))),
604
+ index.h("div", { class: "loader-wrapper" },
605
+ index.h("div", { class: "loader" })))));
606
+
607
+ var iframeResizer$1 = _commonjsHelpers.createCommonjsModule(function (module) {
608
+ (function (undefined$1) {
609
+ if (typeof window === 'undefined') return // don't run for server side render
610
+
611
+ var count = 0,
612
+ logEnabled = false,
613
+ hiddenCheckEnabled = false,
614
+ msgHeader = 'message',
615
+ msgHeaderLen = msgHeader.length,
616
+ msgId = '[iFrameSizer]', // Must match iframe msg ID
617
+ msgIdLen = msgId.length,
618
+ pagePosition = null,
619
+ requestAnimationFrame = window.requestAnimationFrame,
620
+ resetRequiredMethods = Object.freeze({
621
+ max: 1,
622
+ scroll: 1,
623
+ bodyScroll: 1,
624
+ documentElementScroll: 1
625
+ }),
626
+ settings = {},
627
+ timer = null,
628
+ defaults = Object.freeze({
629
+ autoResize: true,
630
+ bodyBackground: null,
631
+ bodyMargin: null,
632
+ bodyMarginV1: 8,
633
+ bodyPadding: null,
634
+ checkOrigin: true,
635
+ inPageLinks: false,
636
+ enablePublicMethods: true,
637
+ heightCalculationMethod: 'bodyOffset',
638
+ id: 'iFrameResizer',
639
+ interval: 32,
640
+ log: false,
641
+ maxHeight: Infinity,
642
+ maxWidth: Infinity,
643
+ minHeight: 0,
644
+ minWidth: 0,
645
+ mouseEvents: true,
646
+ resizeFrom: 'parent',
647
+ scrolling: false,
648
+ sizeHeight: true,
649
+ sizeWidth: false,
650
+ warningTimeout: 5000,
651
+ tolerance: 0,
652
+ widthCalculationMethod: 'scroll',
653
+ onClose: function () {
654
+ return true
655
+ },
656
+ onClosed: function () {},
657
+ onInit: function () {},
658
+ onMessage: function () {
659
+ warn('onMessage function not defined');
660
+ },
661
+ onMouseEnter: function () {},
662
+ onMouseLeave: function () {},
663
+ onResized: function () {},
664
+ onScroll: function () {
665
+ return true
666
+ }
667
+ });
668
+
669
+ function getMutationObserver() {
670
+ return (
671
+ window.MutationObserver ||
672
+ window.WebKitMutationObserver ||
673
+ window.MozMutationObserver
674
+ )
675
+ }
676
+
677
+ function addEventListener(el, evt, func) {
678
+ el.addEventListener(evt, func, false);
679
+ }
680
+
681
+ function removeEventListener(el, evt, func) {
682
+ el.removeEventListener(evt, func, false);
683
+ }
684
+
685
+ function setupRequestAnimationFrame() {
686
+ var vendors = ['moz', 'webkit', 'o', 'ms'];
687
+ var x;
688
+
689
+ // Remove vendor prefixing if prefixed and break early if not
690
+ for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
691
+ requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
692
+ }
693
+
694
+ if (requestAnimationFrame) {
695
+ // Firefox extension content-scripts have a globalThis object that is not the same as window.
696
+ // Binding `requestAnimationFrame` to window allows the function to work and prevents errors
697
+ // being thrown when run in that context, and should be a no-op in every other context.
698
+ requestAnimationFrame = requestAnimationFrame.bind(window);
699
+ } else {
700
+ log('setup', 'RequestAnimationFrame not supported');
701
+ }
702
+ }
703
+
704
+ function getMyID(iframeId) {
705
+ var retStr = 'Host page: ' + iframeId;
706
+
707
+ if (window.top !== window.self) {
708
+ retStr =
709
+ window.parentIFrame && window.parentIFrame.getId
710
+ ? window.parentIFrame.getId() + ': ' + iframeId
711
+ : 'Nested host page: ' + iframeId;
712
+ }
713
+
714
+ return retStr
715
+ }
716
+
717
+ function formatLogHeader(iframeId) {
718
+ return msgId + '[' + getMyID(iframeId) + ']'
719
+ }
720
+
721
+ function isLogEnabled(iframeId) {
722
+ return settings[iframeId] ? settings[iframeId].log : logEnabled
723
+ }
724
+
725
+ function log(iframeId, msg) {
726
+ output('log', iframeId, msg, isLogEnabled(iframeId));
727
+ }
728
+
729
+ function info(iframeId, msg) {
730
+ output('info', iframeId, msg, isLogEnabled(iframeId));
731
+ }
732
+
733
+ function warn(iframeId, msg) {
734
+ output('warn', iframeId, msg, true);
735
+ }
736
+
737
+ function output(type, iframeId, msg, enabled) {
738
+ if (true === enabled && 'object' === typeof window.console) {
739
+ // eslint-disable-next-line no-console
740
+ console[type](formatLogHeader(iframeId), msg);
741
+ }
742
+ }
743
+
744
+ function iFrameListener(event) {
745
+ function resizeIFrame() {
746
+ function resize() {
747
+ setSize(messageData);
748
+ setPagePosition(iframeId);
749
+ on('onResized', messageData);
750
+ }
751
+
752
+ ensureInRange('Height');
753
+ ensureInRange('Width');
754
+
755
+ syncResize(resize, messageData, 'init');
756
+ }
757
+
758
+ function processMsg() {
759
+ var data = msg.slice(msgIdLen).split(':');
760
+ var height = data[1] ? parseInt(data[1], 10) : 0;
761
+ var iframe = settings[data[0]] && settings[data[0]].iframe;
762
+ var compStyle = getComputedStyle(iframe);
763
+
764
+ return {
765
+ iframe: iframe,
766
+ id: data[0],
767
+ height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
768
+ width: data[2],
769
+ type: data[3]
770
+ }
771
+ }
772
+
773
+ function getPaddingEnds(compStyle) {
774
+ if (compStyle.boxSizing !== 'border-box') {
775
+ return 0
776
+ }
777
+ var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
778
+ var bot = compStyle.paddingBottom
779
+ ? parseInt(compStyle.paddingBottom, 10)
780
+ : 0;
781
+ return top + bot
782
+ }
783
+
784
+ function getBorderEnds(compStyle) {
785
+ if (compStyle.boxSizing !== 'border-box') {
786
+ return 0
787
+ }
788
+ var top = compStyle.borderTopWidth
789
+ ? parseInt(compStyle.borderTopWidth, 10)
790
+ : 0;
791
+ var bot = compStyle.borderBottomWidth
792
+ ? parseInt(compStyle.borderBottomWidth, 10)
793
+ : 0;
794
+ return top + bot
795
+ }
796
+
797
+ function ensureInRange(Dimension) {
798
+ var max = Number(settings[iframeId]['max' + Dimension]),
799
+ min = Number(settings[iframeId]['min' + Dimension]),
800
+ dimension = Dimension.toLowerCase(),
801
+ size = Number(messageData[dimension]);
802
+
803
+ log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
804
+
805
+ if (size < min) {
806
+ size = min;
807
+ log(iframeId, 'Set ' + dimension + ' to min value');
808
+ }
809
+
810
+ if (size > max) {
811
+ size = max;
812
+ log(iframeId, 'Set ' + dimension + ' to max value');
813
+ }
814
+
815
+ messageData[dimension] = '' + size;
816
+ }
817
+
818
+ function isMessageFromIFrame() {
819
+ function checkAllowedOrigin() {
820
+ function checkList() {
821
+ var i = 0,
822
+ retCode = false;
823
+
824
+ log(
825
+ iframeId,
826
+ 'Checking connection is from allowed list of origins: ' +
827
+ checkOrigin
828
+ );
829
+
830
+ for (; i < checkOrigin.length; i++) {
831
+ if (checkOrigin[i] === origin) {
832
+ retCode = true;
833
+ break
834
+ }
835
+ }
836
+ return retCode
837
+ }
838
+
839
+ function checkSingle() {
840
+ var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
841
+ log(iframeId, 'Checking connection is from: ' + remoteHost);
842
+ return origin === remoteHost
843
+ }
844
+
845
+ return checkOrigin.constructor === Array ? checkList() : checkSingle()
846
+ }
847
+
848
+ var origin = event.origin,
849
+ checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
850
+
851
+ if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {
852
+ throw new Error(
853
+ 'Unexpected message received from: ' +
854
+ origin +
855
+ ' for ' +
856
+ messageData.iframe.id +
857
+ '. Message was: ' +
858
+ event.data +
859
+ '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
860
+ )
861
+ }
862
+
863
+ return true
864
+ }
865
+
866
+ function isMessageForUs() {
867
+ return (
868
+ msgId === ('' + msg).slice(0, msgIdLen) &&
869
+ msg.slice(msgIdLen).split(':')[0] in settings
870
+ ) // ''+Protects against non-string msg
871
+ }
872
+
873
+ function isMessageFromMetaParent() {
874
+ // Test if this message is from a parent above us. This is an ugly test, however, updating
875
+ // the message format would break backwards compatibility.
876
+ var retCode = messageData.type in { true: 1, false: 1, undefined: 1 };
877
+
878
+ if (retCode) {
879
+ log(iframeId, 'Ignoring init message from meta parent page');
880
+ }
881
+
882
+ return retCode
883
+ }
884
+
885
+ function getMsgBody(offset) {
886
+ return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
887
+ }
888
+
889
+ function forwardMsgFromIFrame(msgBody) {
890
+ log(
891
+ iframeId,
892
+ 'onMessage passed: {iframe: ' +
893
+ messageData.iframe.id +
894
+ ', message: ' +
895
+ msgBody +
896
+ '}'
897
+ );
898
+
899
+ on('onMessage', {
900
+ iframe: messageData.iframe,
901
+ message: JSON.parse(msgBody)
902
+ });
903
+
904
+ log(iframeId, '--');
905
+ }
906
+
907
+ function getPageInfo() {
908
+ var bodyPosition = document.body.getBoundingClientRect(),
909
+ iFramePosition = messageData.iframe.getBoundingClientRect();
910
+
911
+ return JSON.stringify({
912
+ iframeHeight: iFramePosition.height,
913
+ iframeWidth: iFramePosition.width,
914
+ clientHeight: Math.max(
915
+ document.documentElement.clientHeight,
916
+ window.innerHeight || 0
917
+ ),
918
+ clientWidth: Math.max(
919
+ document.documentElement.clientWidth,
920
+ window.innerWidth || 0
921
+ ),
922
+ offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
923
+ offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
924
+ scrollTop: window.pageYOffset,
925
+ scrollLeft: window.pageXOffset,
926
+ documentHeight: document.documentElement.clientHeight,
927
+ documentWidth: document.documentElement.clientWidth,
928
+ windowHeight: window.innerHeight,
929
+ windowWidth: window.innerWidth
930
+ })
931
+ }
932
+
933
+ function sendPageInfoToIframe(iframe, iframeId) {
934
+ function debouncedTrigger() {
935
+ trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
936
+ }
937
+ debounceFrameEvents(debouncedTrigger, 32, iframeId);
938
+ }
939
+
940
+ function startPageInfoMonitor() {
941
+ function setListener(type, func) {
942
+ function sendPageInfo() {
943
+ if (settings[id]) {
944
+ sendPageInfoToIframe(settings[id].iframe, id);
945
+ } else {
946
+ stop();
947
+ }
948
+ }
949
+ ['scroll', 'resize'].forEach(function (evt) {
950
+ log(id, type + evt + ' listener for sendPageInfo');
951
+ func(window, evt, sendPageInfo);
952
+ });
953
+ }
954
+
955
+ function stop() {
956
+ setListener('Remove ', removeEventListener);
957
+ }
958
+
959
+ function start() {
960
+ setListener('Add ', addEventListener);
961
+ }
962
+
963
+ var id = iframeId; // Create locally scoped copy of iFrame ID
964
+
965
+ start();
966
+
967
+ if (settings[id]) {
968
+ settings[id].stopPageInfo = stop;
969
+ }
970
+ }
971
+
972
+ function stopPageInfoMonitor() {
973
+ if (settings[iframeId] && settings[iframeId].stopPageInfo) {
974
+ settings[iframeId].stopPageInfo();
975
+ delete settings[iframeId].stopPageInfo;
976
+ }
977
+ }
978
+
979
+ function checkIFrameExists() {
980
+ var retBool = true;
981
+
982
+ if (null === messageData.iframe) {
983
+ warn(iframeId, 'IFrame (' + messageData.id + ') not found');
984
+ retBool = false;
985
+ }
986
+ return retBool
987
+ }
988
+
989
+ function getElementPosition(target) {
990
+ var iFramePosition = target.getBoundingClientRect();
991
+
992
+ getPagePosition(iframeId);
993
+
994
+ return {
995
+ x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
996
+ y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
997
+ }
998
+ }
999
+
1000
+ function scrollRequestFromChild(addOffset) {
1001
+ /* istanbul ignore next */ // Not testable in Karma
1002
+ function reposition() {
1003
+ pagePosition = newPosition;
1004
+ scrollTo();
1005
+ log(iframeId, '--');
1006
+ }
1007
+
1008
+ function calcOffset() {
1009
+ return {
1010
+ x: Number(messageData.width) + offset.x,
1011
+ y: Number(messageData.height) + offset.y
1012
+ }
1013
+ }
1014
+
1015
+ function scrollParent() {
1016
+ if (window.parentIFrame) {
1017
+ window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](
1018
+ newPosition.x,
1019
+ newPosition.y
1020
+ );
1021
+ } else {
1022
+ warn(
1023
+ iframeId,
1024
+ 'Unable to scroll to requested position, window.parentIFrame not found'
1025
+ );
1026
+ }
1027
+ }
1028
+
1029
+ var offset = addOffset
1030
+ ? getElementPosition(messageData.iframe)
1031
+ : { x: 0, y: 0 },
1032
+ newPosition = calcOffset();
1033
+
1034
+ log(
1035
+ iframeId,
1036
+ 'Reposition requested from iFrame (offset x:' +
1037
+ offset.x +
1038
+ ' y:' +
1039
+ offset.y +
1040
+ ')'
1041
+ );
1042
+
1043
+ if (window.top === window.self) {
1044
+ reposition();
1045
+ } else {
1046
+ scrollParent();
1047
+ }
1048
+ }
1049
+
1050
+ function scrollTo() {
1051
+ if (false === on('onScroll', pagePosition)) {
1052
+ unsetPagePosition();
1053
+ } else {
1054
+ setPagePosition(iframeId);
1055
+ }
1056
+ }
1057
+
1058
+ function findTarget(location) {
1059
+ function jumpToTarget() {
1060
+ var jumpPosition = getElementPosition(target);
1061
+
1062
+ log(
1063
+ iframeId,
1064
+ 'Moving to in page link (#' +
1065
+ hash +
1066
+ ') at x: ' +
1067
+ jumpPosition.x +
1068
+ ' y: ' +
1069
+ jumpPosition.y
1070
+ );
1071
+ pagePosition = {
1072
+ x: jumpPosition.x,
1073
+ y: jumpPosition.y
1074
+ };
1075
+
1076
+ scrollTo();
1077
+ log(iframeId, '--');
1078
+ }
1079
+
1080
+ function jumpToParent() {
1081
+ if (window.parentIFrame) {
1082
+ window.parentIFrame.moveToAnchor(hash);
1083
+ } else {
1084
+ log(
1085
+ iframeId,
1086
+ 'In page link #' +
1087
+ hash +
1088
+ ' not found and window.parentIFrame not found'
1089
+ );
1090
+ }
1091
+ }
1092
+
1093
+ var hash = location.split('#')[1] || '',
1094
+ hashData = decodeURIComponent(hash),
1095
+ target =
1096
+ document.getElementById(hashData) ||
1097
+ document.getElementsByName(hashData)[0];
1098
+
1099
+ if (target) {
1100
+ jumpToTarget();
1101
+ } else if (window.top === window.self) {
1102
+ log(iframeId, 'In page link #' + hash + ' not found');
1103
+ } else {
1104
+ jumpToParent();
1105
+ }
1106
+ }
1107
+
1108
+ function onMouse(event) {
1109
+ var mousePos = {};
1110
+
1111
+ if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
1112
+ var data = getMsgBody(9).split(':');
1113
+ mousePos = {
1114
+ x: data[1],
1115
+ y: data[0]
1116
+ };
1117
+ } else {
1118
+ mousePos = {
1119
+ x: messageData.width,
1120
+ y: messageData.height
1121
+ };
1122
+ }
1123
+
1124
+ on(event, {
1125
+ iframe: messageData.iframe,
1126
+ screenX: Number(mousePos.x),
1127
+ screenY: Number(mousePos.y),
1128
+ type: messageData.type
1129
+ });
1130
+ }
1131
+
1132
+ function on(funcName, val) {
1133
+ return chkEvent(iframeId, funcName, val)
1134
+ }
1135
+
1136
+ function actionMsg() {
1137
+ if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
1138
+
1139
+ switch (messageData.type) {
1140
+ case 'close': {
1141
+ closeIFrame(messageData.iframe);
1142
+ break
1143
+ }
1144
+
1145
+ case 'message': {
1146
+ forwardMsgFromIFrame(getMsgBody(6));
1147
+ break
1148
+ }
1149
+
1150
+ case 'mouseenter': {
1151
+ onMouse('onMouseEnter');
1152
+ break
1153
+ }
1154
+
1155
+ case 'mouseleave': {
1156
+ onMouse('onMouseLeave');
1157
+ break
1158
+ }
1159
+
1160
+ case 'autoResize': {
1161
+ settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
1162
+ break
1163
+ }
1164
+
1165
+ case 'scrollTo': {
1166
+ scrollRequestFromChild(false);
1167
+ break
1168
+ }
1169
+
1170
+ case 'scrollToOffset': {
1171
+ scrollRequestFromChild(true);
1172
+ break
1173
+ }
1174
+
1175
+ case 'pageInfo': {
1176
+ sendPageInfoToIframe(
1177
+ settings[iframeId] && settings[iframeId].iframe,
1178
+ iframeId
1179
+ );
1180
+ startPageInfoMonitor();
1181
+ break
1182
+ }
1183
+
1184
+ case 'pageInfoStop': {
1185
+ stopPageInfoMonitor();
1186
+ break
1187
+ }
1188
+
1189
+ case 'inPageLink': {
1190
+ findTarget(getMsgBody(9));
1191
+ break
1192
+ }
1193
+
1194
+ case 'reset': {
1195
+ resetIFrame(messageData);
1196
+ break
1197
+ }
1198
+
1199
+ case 'init': {
1200
+ resizeIFrame();
1201
+ on('onInit', messageData.iframe);
1202
+ break
1203
+ }
1204
+
1205
+ default: {
1206
+ if (
1207
+ Number(messageData.width) === 0 &&
1208
+ Number(messageData.height) === 0
1209
+ ) {
1210
+ warn(
1211
+ 'Unsupported message received (' +
1212
+ messageData.type +
1213
+ '), this is likely due to the iframe containing a later ' +
1214
+ 'version of iframe-resizer than the parent page'
1215
+ );
1216
+ } else {
1217
+ resizeIFrame();
1218
+ }
1219
+ }
1220
+ }
1221
+ }
1222
+
1223
+ function hasSettings(iframeId) {
1224
+ var retBool = true;
1225
+
1226
+ if (!settings[iframeId]) {
1227
+ retBool = false;
1228
+ warn(
1229
+ messageData.type +
1230
+ ' No settings for ' +
1231
+ iframeId +
1232
+ '. Message was: ' +
1233
+ msg
1234
+ );
1235
+ }
1236
+
1237
+ return retBool
1238
+ }
1239
+
1240
+ function iFrameReadyMsgReceived() {
1241
+ // eslint-disable-next-line no-restricted-syntax, guard-for-in
1242
+ for (var iframeId in settings) {
1243
+ trigger(
1244
+ 'iFrame requested init',
1245
+ createOutgoingMsg(iframeId),
1246
+ settings[iframeId].iframe,
1247
+ iframeId
1248
+ );
1249
+ }
1250
+ }
1251
+
1252
+ function firstRun() {
1253
+ if (settings[iframeId]) {
1254
+ settings[iframeId].firstRun = false;
1255
+ }
1256
+ }
1257
+
1258
+ var msg = event.data,
1259
+ messageData = {},
1260
+ iframeId = null;
1261
+
1262
+ if ('[iFrameResizerChild]Ready' === msg) {
1263
+ iFrameReadyMsgReceived();
1264
+ } else if (isMessageForUs()) {
1265
+ messageData = processMsg();
1266
+ iframeId = messageData.id;
1267
+ if (settings[iframeId]) {
1268
+ settings[iframeId].loaded = true;
1269
+ }
1270
+
1271
+ if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
1272
+ log(iframeId, 'Received: ' + msg);
1273
+
1274
+ if (checkIFrameExists() && isMessageFromIFrame()) {
1275
+ actionMsg();
1276
+ }
1277
+ }
1278
+ } else {
1279
+ info(iframeId, 'Ignored: ' + msg);
1280
+ }
1281
+ }
1282
+
1283
+ function chkEvent(iframeId, funcName, val) {
1284
+ var func = null,
1285
+ retVal = null;
1286
+
1287
+ if (settings[iframeId]) {
1288
+ func = settings[iframeId][funcName];
1289
+
1290
+ if ('function' === typeof func) {
1291
+ retVal = func(val);
1292
+ } else {
1293
+ throw new TypeError(
1294
+ funcName + ' on iFrame[' + iframeId + '] is not a function'
1295
+ )
1296
+ }
1297
+ }
1298
+
1299
+ return retVal
1300
+ }
1301
+
1302
+ function removeIframeListeners(iframe) {
1303
+ var iframeId = iframe.id;
1304
+ delete settings[iframeId];
1305
+ }
1306
+
1307
+ function closeIFrame(iframe) {
1308
+ var iframeId = iframe.id;
1309
+ if (chkEvent(iframeId, 'onClose', iframeId) === false) {
1310
+ log(iframeId, 'Close iframe cancelled by onClose event');
1311
+ return
1312
+ }
1313
+ log(iframeId, 'Removing iFrame: ' + iframeId);
1314
+
1315
+ try {
1316
+ // Catch race condition error with React
1317
+ if (iframe.parentNode) {
1318
+ iframe.parentNode.removeChild(iframe);
1319
+ }
1320
+ } catch (error) {
1321
+ warn(error);
1322
+ }
1323
+
1324
+ chkEvent(iframeId, 'onClosed', iframeId);
1325
+ log(iframeId, '--');
1326
+ removeIframeListeners(iframe);
1327
+ }
1328
+
1329
+ function getPagePosition(iframeId) {
1330
+ if (null === pagePosition) {
1331
+ pagePosition = {
1332
+ x:
1333
+ window.pageXOffset === undefined$1
1334
+ ? document.documentElement.scrollLeft
1335
+ : window.pageXOffset,
1336
+ y:
1337
+ window.pageYOffset === undefined$1
1338
+ ? document.documentElement.scrollTop
1339
+ : window.pageYOffset
1340
+ };
1341
+ log(
1342
+ iframeId,
1343
+ 'Get page position: ' + pagePosition.x + ',' + pagePosition.y
1344
+ );
1345
+ }
1346
+ }
1347
+
1348
+ function setPagePosition(iframeId) {
1349
+ if (null !== pagePosition) {
1350
+ window.scrollTo(pagePosition.x, pagePosition.y);
1351
+ log(
1352
+ iframeId,
1353
+ 'Set page position: ' + pagePosition.x + ',' + pagePosition.y
1354
+ );
1355
+ unsetPagePosition();
1356
+ }
1357
+ }
1358
+
1359
+ function unsetPagePosition() {
1360
+ pagePosition = null;
1361
+ }
1362
+
1363
+ function resetIFrame(messageData) {
1364
+ function reset() {
1365
+ setSize(messageData);
1366
+ trigger('reset', 'reset', messageData.iframe, messageData.id);
1367
+ }
1368
+
1369
+ log(
1370
+ messageData.id,
1371
+ 'Size reset requested by ' +
1372
+ ('init' === messageData.type ? 'host page' : 'iFrame')
1373
+ );
1374
+ getPagePosition(messageData.id);
1375
+ syncResize(reset, messageData, 'reset');
1376
+ }
1377
+
1378
+ function setSize(messageData) {
1379
+ function setDimension(dimension) {
1380
+ if (!messageData.id) {
1381
+ log('undefined', 'messageData id not set');
1382
+ return
1383
+ }
1384
+ messageData.iframe.style[dimension] = messageData[dimension] + 'px';
1385
+ log(
1386
+ messageData.id,
1387
+ 'IFrame (' +
1388
+ iframeId +
1389
+ ') ' +
1390
+ dimension +
1391
+ ' set to ' +
1392
+ messageData[dimension] +
1393
+ 'px'
1394
+ );
1395
+ }
1396
+
1397
+ function chkZero(dimension) {
1398
+ // FireFox sets dimension of hidden iFrames to zero.
1399
+ // So if we detect that set up an event to check for
1400
+ // when iFrame becomes visible.
1401
+
1402
+ /* istanbul ignore next */ // Not testable in PhantomJS
1403
+ if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
1404
+ hiddenCheckEnabled = true;
1405
+ log(iframeId, 'Hidden iFrame detected, creating visibility listener');
1406
+ fixHiddenIFrames();
1407
+ }
1408
+ }
1409
+
1410
+ function processDimension(dimension) {
1411
+ setDimension(dimension);
1412
+ chkZero(dimension);
1413
+ }
1414
+
1415
+ var iframeId = messageData.iframe.id;
1416
+
1417
+ if (settings[iframeId]) {
1418
+ if (settings[iframeId].sizeHeight) {
1419
+ processDimension('height');
1420
+ }
1421
+ if (settings[iframeId].sizeWidth) {
1422
+ processDimension('width');
1423
+ }
1424
+ }
1425
+ }
1426
+
1427
+ function syncResize(func, messageData, doNotSync) {
1428
+ /* istanbul ignore if */ // Not testable in PhantomJS
1429
+ if (
1430
+ doNotSync !== messageData.type &&
1431
+ requestAnimationFrame &&
1432
+ // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
1433
+ !window.jasmine
1434
+ ) {
1435
+ log(messageData.id, 'Requesting animation frame');
1436
+ requestAnimationFrame(func);
1437
+ } else {
1438
+ func();
1439
+ }
1440
+ }
1441
+
1442
+ function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
1443
+ function postMessageToIFrame() {
1444
+ var target = settings[id] && settings[id].targetOrigin;
1445
+ log(
1446
+ id,
1447
+ '[' +
1448
+ calleeMsg +
1449
+ '] Sending msg to iframe[' +
1450
+ id +
1451
+ '] (' +
1452
+ msg +
1453
+ ') targetOrigin: ' +
1454
+ target
1455
+ );
1456
+ iframe.contentWindow.postMessage(msgId + msg, target);
1457
+ }
1458
+
1459
+ function iFrameNotFound() {
1460
+ warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
1461
+ }
1462
+
1463
+ function chkAndSend() {
1464
+ if (
1465
+ iframe &&
1466
+ 'contentWindow' in iframe &&
1467
+ null !== iframe.contentWindow
1468
+ ) {
1469
+ // Null test for PhantomJS
1470
+ postMessageToIFrame();
1471
+ } else {
1472
+ iFrameNotFound();
1473
+ }
1474
+ }
1475
+
1476
+ function warnOnNoResponse() {
1477
+ function warning() {
1478
+ if (settings[id] && !settings[id].loaded && !errorShown) {
1479
+ errorShown = true;
1480
+ warn(
1481
+ id,
1482
+ 'IFrame has not responded within ' +
1483
+ settings[id].warningTimeout / 1000 +
1484
+ ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'
1485
+ );
1486
+ }
1487
+ }
1488
+
1489
+ if (
1490
+ !!noResponseWarning &&
1491
+ settings[id] &&
1492
+ !!settings[id].warningTimeout
1493
+ ) {
1494
+ settings[id].msgTimeout = setTimeout(
1495
+ warning,
1496
+ settings[id].warningTimeout
1497
+ );
1498
+ }
1499
+ }
1500
+
1501
+ var errorShown = false;
1502
+
1503
+ id = id || iframe.id;
1504
+
1505
+ if (settings[id]) {
1506
+ chkAndSend();
1507
+ warnOnNoResponse();
1508
+ }
1509
+ }
1510
+
1511
+ function createOutgoingMsg(iframeId) {
1512
+ return (
1513
+ iframeId +
1514
+ ':' +
1515
+ settings[iframeId].bodyMarginV1 +
1516
+ ':' +
1517
+ settings[iframeId].sizeWidth +
1518
+ ':' +
1519
+ settings[iframeId].log +
1520
+ ':' +
1521
+ settings[iframeId].interval +
1522
+ ':' +
1523
+ settings[iframeId].enablePublicMethods +
1524
+ ':' +
1525
+ settings[iframeId].autoResize +
1526
+ ':' +
1527
+ settings[iframeId].bodyMargin +
1528
+ ':' +
1529
+ settings[iframeId].heightCalculationMethod +
1530
+ ':' +
1531
+ settings[iframeId].bodyBackground +
1532
+ ':' +
1533
+ settings[iframeId].bodyPadding +
1534
+ ':' +
1535
+ settings[iframeId].tolerance +
1536
+ ':' +
1537
+ settings[iframeId].inPageLinks +
1538
+ ':' +
1539
+ settings[iframeId].resizeFrom +
1540
+ ':' +
1541
+ settings[iframeId].widthCalculationMethod +
1542
+ ':' +
1543
+ settings[iframeId].mouseEvents
1544
+ )
1545
+ }
1546
+
1547
+ function isNumber(value) {
1548
+ return typeof value === 'number'
1549
+ }
1550
+
1551
+ function setupIFrame(iframe, options) {
1552
+ function setLimits() {
1553
+ function addStyle(style) {
1554
+ var styleValue = settings[iframeId][style];
1555
+ if (Infinity !== styleValue && 0 !== styleValue) {
1556
+ iframe.style[style] = isNumber(styleValue)
1557
+ ? styleValue + 'px'
1558
+ : styleValue;
1559
+ log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
1560
+ }
1561
+ }
1562
+
1563
+ function chkMinMax(dimension) {
1564
+ if (
1565
+ settings[iframeId]['min' + dimension] >
1566
+ settings[iframeId]['max' + dimension]
1567
+ ) {
1568
+ throw new Error(
1569
+ 'Value for min' +
1570
+ dimension +
1571
+ ' can not be greater than max' +
1572
+ dimension
1573
+ )
1574
+ }
1575
+ }
1576
+
1577
+ chkMinMax('Height');
1578
+ chkMinMax('Width');
1579
+
1580
+ addStyle('maxHeight');
1581
+ addStyle('minHeight');
1582
+ addStyle('maxWidth');
1583
+ addStyle('minWidth');
1584
+ }
1585
+
1586
+ function newId() {
1587
+ var id = (options && options.id) || defaults.id + count++;
1588
+ if (null !== document.getElementById(id)) {
1589
+ id += count++;
1590
+ }
1591
+ return id
1592
+ }
1593
+
1594
+ function ensureHasId(iframeId) {
1595
+ if (typeof iframeId !== 'string') {
1596
+ throw new TypeError('Invaild id for iFrame. Expected String')
1597
+ }
1598
+
1599
+ if ('' === iframeId) {
1600
+ // eslint-disable-next-line no-multi-assign
1601
+ iframe.id = iframeId = newId();
1602
+ logEnabled = (options || {}).log;
1603
+ log(
1604
+ iframeId,
1605
+ 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'
1606
+ );
1607
+ }
1608
+
1609
+ return iframeId
1610
+ }
1611
+
1612
+ function setScrolling() {
1613
+ log(
1614
+ iframeId,
1615
+ 'IFrame scrolling ' +
1616
+ (settings[iframeId] && settings[iframeId].scrolling
1617
+ ? 'enabled'
1618
+ : 'disabled') +
1619
+ ' for ' +
1620
+ iframeId
1621
+ );
1622
+ iframe.style.overflow =
1623
+ false === (settings[iframeId] && settings[iframeId].scrolling)
1624
+ ? 'hidden'
1625
+ : 'auto';
1626
+ switch (settings[iframeId] && settings[iframeId].scrolling) {
1627
+ case 'omit': {
1628
+ break
1629
+ }
1630
+
1631
+ case true: {
1632
+ iframe.scrolling = 'yes';
1633
+ break
1634
+ }
1635
+
1636
+ case false: {
1637
+ iframe.scrolling = 'no';
1638
+ break
1639
+ }
1640
+
1641
+ default: {
1642
+ iframe.scrolling = settings[iframeId]
1643
+ ? settings[iframeId].scrolling
1644
+ : 'no';
1645
+ }
1646
+ }
1647
+ }
1648
+
1649
+ // The V1 iFrame script expects an int, where as in V2 expects a CSS
1650
+ // string value such as '1px 3em', so if we have an int for V2, set V1=V2
1651
+ // and then convert V2 to a string PX value.
1652
+ function setupBodyMarginValues() {
1653
+ if (
1654
+ 'number' ===
1655
+ typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||
1656
+ '0' === (settings[iframeId] && settings[iframeId].bodyMargin)
1657
+ ) {
1658
+ settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
1659
+ settings[iframeId].bodyMargin =
1660
+ '' + settings[iframeId].bodyMargin + 'px';
1661
+ }
1662
+ }
1663
+
1664
+ function checkReset() {
1665
+ // Reduce scope of firstRun to function, because IE8's JS execution
1666
+ // context stack is borked and this value gets externally
1667
+ // changed midway through running this function!!!
1668
+ var firstRun = settings[iframeId] && settings[iframeId].firstRun,
1669
+ resetRequertMethod =
1670
+ settings[iframeId] &&
1671
+ settings[iframeId].heightCalculationMethod in resetRequiredMethods;
1672
+
1673
+ if (!firstRun && resetRequertMethod) {
1674
+ resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' });
1675
+ }
1676
+ }
1677
+
1678
+ function setupIFrameObject() {
1679
+ if (settings[iframeId]) {
1680
+ settings[iframeId].iframe.iFrameResizer = {
1681
+ close: closeIFrame.bind(null, settings[iframeId].iframe),
1682
+
1683
+ removeListeners: removeIframeListeners.bind(
1684
+ null,
1685
+ settings[iframeId].iframe
1686
+ ),
1687
+
1688
+ resize: trigger.bind(
1689
+ null,
1690
+ 'Window resize',
1691
+ 'resize',
1692
+ settings[iframeId].iframe
1693
+ ),
1694
+
1695
+ moveToAnchor: function (anchor) {
1696
+ trigger(
1697
+ 'Move to anchor',
1698
+ 'moveToAnchor:' + anchor,
1699
+ settings[iframeId].iframe,
1700
+ iframeId
1701
+ );
1702
+ },
1703
+
1704
+ sendMessage: function (message) {
1705
+ message = JSON.stringify(message);
1706
+ trigger(
1707
+ 'Send Message',
1708
+ 'message:' + message,
1709
+ settings[iframeId].iframe,
1710
+ iframeId
1711
+ );
1712
+ }
1713
+ };
1714
+ }
1715
+ }
1716
+
1717
+ // We have to call trigger twice, as we can not be sure if all
1718
+ // iframes have completed loading when this code runs. The
1719
+ // event listener also catches the page changing in the iFrame.
1720
+ function init(msg) {
1721
+ function iFrameLoaded() {
1722
+ trigger('iFrame.onload', msg, iframe, undefined$1, true);
1723
+ checkReset();
1724
+ }
1725
+
1726
+ function createDestroyObserver(MutationObserver) {
1727
+ if (!iframe.parentNode) {
1728
+ return
1729
+ }
1730
+
1731
+ var destroyObserver = new MutationObserver(function (mutations) {
1732
+ mutations.forEach(function (mutation) {
1733
+ var removedNodes = Array.prototype.slice.call(mutation.removedNodes); // Transform NodeList into an Array
1734
+ removedNodes.forEach(function (removedNode) {
1735
+ if (removedNode === iframe) {
1736
+ closeIFrame(iframe);
1737
+ }
1738
+ });
1739
+ });
1740
+ });
1741
+ destroyObserver.observe(iframe.parentNode, {
1742
+ childList: true
1743
+ });
1744
+ }
1745
+
1746
+ var MutationObserver = getMutationObserver();
1747
+ if (MutationObserver) {
1748
+ createDestroyObserver(MutationObserver);
1749
+ }
1750
+
1751
+ addEventListener(iframe, 'load', iFrameLoaded);
1752
+ trigger('init', msg, iframe, undefined$1, true);
1753
+ }
1754
+
1755
+ function checkOptions(options) {
1756
+ if ('object' !== typeof options) {
1757
+ throw new TypeError('Options is not an object')
1758
+ }
1759
+ }
1760
+
1761
+ function copyOptions(options) {
1762
+ // eslint-disable-next-line no-restricted-syntax
1763
+ for (var option in defaults) {
1764
+ if (Object.prototype.hasOwnProperty.call(defaults, option)) {
1765
+ settings[iframeId][option] = Object.prototype.hasOwnProperty.call(
1766
+ options,
1767
+ option
1768
+ )
1769
+ ? options[option]
1770
+ : defaults[option];
1771
+ }
1772
+ }
1773
+ }
1774
+
1775
+ function getTargetOrigin(remoteHost) {
1776
+ return '' === remoteHost ||
1777
+ null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/)
1778
+ ? '*'
1779
+ : remoteHost
1780
+ }
1781
+
1782
+ function depricate(key) {
1783
+ var splitName = key.split('Callback');
1784
+
1785
+ if (splitName.length === 2) {
1786
+ var name =
1787
+ 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
1788
+ this[name] = this[key];
1789
+ delete this[key];
1790
+ warn(
1791
+ iframeId,
1792
+ "Deprecated: '" +
1793
+ key +
1794
+ "' has been renamed '" +
1795
+ name +
1796
+ "'. The old method will be removed in the next major version."
1797
+ );
1798
+ }
1799
+ }
1800
+
1801
+ function processOptions(options) {
1802
+ options = options || {};
1803
+
1804
+ settings[iframeId] = Object.create(null); // Protect against prototype attacks
1805
+ settings[iframeId].iframe = iframe;
1806
+ settings[iframeId].firstRun = true;
1807
+ settings[iframeId].remoteHost =
1808
+ iframe.src && iframe.src.split('/').slice(0, 3).join('/');
1809
+
1810
+ checkOptions(options);
1811
+ Object.keys(options).forEach(depricate, options);
1812
+ copyOptions(options);
1813
+
1814
+ if (settings[iframeId]) {
1815
+ settings[iframeId].targetOrigin =
1816
+ true === settings[iframeId].checkOrigin
1817
+ ? getTargetOrigin(settings[iframeId].remoteHost)
1818
+ : '*';
1819
+ }
1820
+ }
1821
+
1822
+ function beenHere() {
1823
+ return iframeId in settings && 'iFrameResizer' in iframe
1824
+ }
1825
+
1826
+ var iframeId = ensureHasId(iframe.id);
1827
+
1828
+ if (beenHere()) {
1829
+ warn(iframeId, 'Ignored iFrame, already setup.');
1830
+ } else {
1831
+ processOptions(options);
1832
+ setScrolling();
1833
+ setLimits();
1834
+ setupBodyMarginValues();
1835
+ init(createOutgoingMsg(iframeId));
1836
+ setupIFrameObject();
1837
+ }
1838
+ }
1839
+
1840
+ function debouce(fn, time) {
1841
+ if (null === timer) {
1842
+ timer = setTimeout(function () {
1843
+ timer = null;
1844
+ fn();
1845
+ }, time);
1846
+ }
1847
+ }
1848
+
1849
+ var frameTimer = {};
1850
+ function debounceFrameEvents(fn, time, frameId) {
1851
+ if (!frameTimer[frameId]) {
1852
+ frameTimer[frameId] = setTimeout(function () {
1853
+ frameTimer[frameId] = null;
1854
+ fn();
1855
+ }, time);
1856
+ }
1857
+ }
1858
+
1859
+ // Not testable in PhantomJS
1860
+ /* istanbul ignore next */
1861
+
1862
+ function fixHiddenIFrames() {
1863
+ function checkIFrames() {
1864
+ function checkIFrame(settingId) {
1865
+ function chkDimension(dimension) {
1866
+ return (
1867
+ '0px' ===
1868
+ (settings[settingId] && settings[settingId].iframe.style[dimension])
1869
+ )
1870
+ }
1871
+
1872
+ function isVisible(el) {
1873
+ return null !== el.offsetParent
1874
+ }
1875
+
1876
+ if (
1877
+ settings[settingId] &&
1878
+ isVisible(settings[settingId].iframe) &&
1879
+ (chkDimension('height') || chkDimension('width'))
1880
+ ) {
1881
+ trigger(
1882
+ 'Visibility change',
1883
+ 'resize',
1884
+ settings[settingId].iframe,
1885
+ settingId
1886
+ );
1887
+ }
1888
+ }
1889
+
1890
+ Object.keys(settings).forEach(function (key) {
1891
+ checkIFrame(key);
1892
+ });
1893
+ }
1894
+
1895
+ function mutationObserved(mutations) {
1896
+ log(
1897
+ 'window',
1898
+ 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type
1899
+ );
1900
+ debouce(checkIFrames, 16);
1901
+ }
1902
+
1903
+ function createMutationObserver() {
1904
+ var target = document.querySelector('body'),
1905
+ config = {
1906
+ attributes: true,
1907
+ attributeOldValue: false,
1908
+ characterData: true,
1909
+ characterDataOldValue: false,
1910
+ childList: true,
1911
+ subtree: true
1912
+ },
1913
+ observer = new MutationObserver(mutationObserved);
1914
+
1915
+ observer.observe(target, config);
1916
+ }
1917
+
1918
+ var MutationObserver = getMutationObserver();
1919
+ if (MutationObserver) {
1920
+ createMutationObserver();
1921
+ }
1922
+ }
1923
+
1924
+ function resizeIFrames(event) {
1925
+ function resize() {
1926
+ sendTriggerMsg('Window ' + event, 'resize');
1927
+ }
1928
+
1929
+ log('window', 'Trigger event: ' + event);
1930
+ debouce(resize, 16);
1931
+ }
1932
+
1933
+ // Not testable in PhantomJS
1934
+ /* istanbul ignore next */
1935
+ function tabVisible() {
1936
+ function resize() {
1937
+ sendTriggerMsg('Tab Visible', 'resize');
1938
+ }
1939
+
1940
+ if ('hidden' !== document.visibilityState) {
1941
+ log('document', 'Trigger event: Visibility change');
1942
+ debouce(resize, 16);
1943
+ }
1944
+ }
1945
+
1946
+ function sendTriggerMsg(eventName, event) {
1947
+ function isIFrameResizeEnabled(iframeId) {
1948
+ return (
1949
+ settings[iframeId] &&
1950
+ 'parent' === settings[iframeId].resizeFrom &&
1951
+ settings[iframeId].autoResize &&
1952
+ !settings[iframeId].firstRun
1953
+ )
1954
+ }
1955
+
1956
+ Object.keys(settings).forEach(function (iframeId) {
1957
+ if (isIFrameResizeEnabled(iframeId)) {
1958
+ trigger(eventName, event, settings[iframeId].iframe, iframeId);
1959
+ }
1960
+ });
1961
+ }
1962
+
1963
+ function setupEventListeners() {
1964
+ addEventListener(window, 'message', iFrameListener);
1965
+
1966
+ addEventListener(window, 'resize', function () {
1967
+ resizeIFrames('resize');
1968
+ });
1969
+
1970
+ addEventListener(document, 'visibilitychange', tabVisible);
1971
+
1972
+ addEventListener(document, '-webkit-visibilitychange', tabVisible);
1973
+ }
1974
+
1975
+ function factory() {
1976
+ function init(options, element) {
1977
+ function chkType() {
1978
+ if (!element.tagName) {
1979
+ throw new TypeError('Object is not a valid DOM element')
1980
+ } else if ('IFRAME' !== element.tagName.toUpperCase()) {
1981
+ throw new TypeError(
1982
+ 'Expected <IFRAME> tag, found <' + element.tagName + '>'
1983
+ )
1984
+ }
1985
+ }
1986
+
1987
+ if (element) {
1988
+ chkType();
1989
+ setupIFrame(element, options);
1990
+ iFrames.push(element);
1991
+ }
1992
+ }
1993
+
1994
+ function warnDeprecatedOptions(options) {
1995
+ if (options && options.enablePublicMethods) {
1996
+ warn(
1997
+ 'enablePublicMethods option has been removed, public methods are now always available in the iFrame'
1998
+ );
1999
+ }
2000
+ }
2001
+
2002
+ var iFrames;
2003
+
2004
+ setupRequestAnimationFrame();
2005
+ setupEventListeners();
2006
+
2007
+ return function iFrameResizeF(options, target) {
2008
+ iFrames = []; // Only return iFrames past in on this call
2009
+
2010
+ warnDeprecatedOptions(options);
2011
+
2012
+ switch (typeof target) {
2013
+ case 'undefined':
2014
+ case 'string': {
2015
+ Array.prototype.forEach.call(
2016
+ document.querySelectorAll(target || 'iframe'),
2017
+ init.bind(undefined$1, options)
2018
+ );
2019
+ break
2020
+ }
2021
+
2022
+ case 'object': {
2023
+ init(options, target);
2024
+ break
2025
+ }
2026
+
2027
+ default: {
2028
+ throw new TypeError('Unexpected data type (' + typeof target + ')')
2029
+ }
2030
+ }
2031
+
2032
+ return iFrames
2033
+ }
2034
+ }
2035
+
2036
+ function createJQueryPublicMethod($) {
2037
+ if (!$.fn) {
2038
+ info('', 'Unable to bind to jQuery, it is not fully loaded.');
2039
+ } else if (!$.fn.iFrameResize) {
2040
+ $.fn.iFrameResize = function $iFrameResizeF(options) {
2041
+ function init(index, element) {
2042
+ setupIFrame(element, options);
2043
+ }
2044
+
2045
+ return this.filter('iframe').each(init).end()
2046
+ };
2047
+ }
2048
+ }
2049
+
2050
+ if (window.jQuery !== undefined$1) {
2051
+ createJQueryPublicMethod(window.jQuery);
2052
+ }
2053
+
2054
+ if (typeof undefined$1 === 'function' && undefined$1.amd) {
2055
+ undefined$1([], factory);
2056
+ } else {
2057
+ // Node for browserfy
2058
+ module.exports = factory();
2059
+ }
2060
+ window.iFrameResize = window.iFrameResize || factory();
2061
+ })();
2062
+ });
2063
+
2064
+ var iframeResizer_contentWindow = _commonjsHelpers.createCommonjsModule(function (module) {
2065
+ (function (undefined$1) {
2066
+ if (typeof window === 'undefined') return // don't run for server side render
2067
+
2068
+ var autoResize = true,
2069
+ base = 10,
2070
+ bodyBackground = '',
2071
+ bodyMargin = 0,
2072
+ bodyMarginStr = '',
2073
+ bodyObserver = null,
2074
+ bodyPadding = '',
2075
+ calculateWidth = false,
2076
+ doubleEventList = { resize: 1, click: 1 },
2077
+ eventCancelTimer = 128,
2078
+ firstRun = true,
2079
+ height = 1,
2080
+ heightCalcModeDefault = 'bodyOffset',
2081
+ heightCalcMode = heightCalcModeDefault,
2082
+ initLock = true,
2083
+ initMsg = '',
2084
+ inPageLinks = {},
2085
+ interval = 32,
2086
+ intervalTimer = null,
2087
+ logging = false,
2088
+ mouseEvents = false,
2089
+ msgID = '[iFrameSizer]', // Must match host page msg ID
2090
+ msgIdLen = msgID.length,
2091
+ myID = '',
2092
+ resetRequiredMethods = {
2093
+ max: 1,
2094
+ min: 1,
2095
+ bodyScroll: 1,
2096
+ documentElementScroll: 1
2097
+ },
2098
+ resizeFrom = 'child',
2099
+ target = window.parent,
2100
+ targetOriginDefault = '*',
2101
+ tolerance = 0,
2102
+ triggerLocked = false,
2103
+ triggerLockedTimer = null,
2104
+ throttledTimer = 16,
2105
+ width = 1,
2106
+ widthCalcModeDefault = 'scroll',
2107
+ widthCalcMode = widthCalcModeDefault,
2108
+ win = window,
2109
+ onMessage = function () {
2110
+ warn('onMessage function not defined');
2111
+ },
2112
+ onReady = function () {},
2113
+ onPageInfo = function () {},
2114
+ customCalcMethods = {
2115
+ height: function () {
2116
+ warn('Custom height calculation function not defined');
2117
+ return document.documentElement.offsetHeight
2118
+ },
2119
+ width: function () {
2120
+ warn('Custom width calculation function not defined');
2121
+ return document.body.scrollWidth
2122
+ }
2123
+ },
2124
+ eventHandlersByName = {},
2125
+ passiveSupported = false;
2126
+
2127
+ function noop() {}
2128
+
2129
+ try {
2130
+ var options = Object.create(
2131
+ {},
2132
+ {
2133
+ passive: {
2134
+ // eslint-disable-next-line getter-return
2135
+ get: function () {
2136
+ passiveSupported = true;
2137
+ }
2138
+ }
2139
+ }
2140
+ );
2141
+ window.addEventListener('test', noop, options);
2142
+ window.removeEventListener('test', noop, options);
2143
+ } catch (error) {
2144
+ /* */
2145
+ }
2146
+
2147
+ function addEventListener(el, evt, func, options) {
2148
+ el.addEventListener(evt, func, passiveSupported ? options || {} : false);
2149
+ }
2150
+
2151
+ function removeEventListener(el, evt, func) {
2152
+ el.removeEventListener(evt, func, false);
2153
+ }
2154
+
2155
+ function capitalizeFirstLetter(string) {
2156
+ return string.charAt(0).toUpperCase() + string.slice(1)
2157
+ }
2158
+
2159
+ // Based on underscore.js
2160
+ function throttle(func) {
2161
+ var context,
2162
+ args,
2163
+ result,
2164
+ timeout = null,
2165
+ previous = 0,
2166
+ later = function () {
2167
+ previous = Date.now();
2168
+ timeout = null;
2169
+ result = func.apply(context, args);
2170
+ if (!timeout) {
2171
+ // eslint-disable-next-line no-multi-assign
2172
+ context = args = null;
2173
+ }
2174
+ };
2175
+
2176
+ return function () {
2177
+ var now = Date.now();
2178
+
2179
+ if (!previous) {
2180
+ previous = now;
2181
+ }
2182
+
2183
+ var remaining = throttledTimer - (now - previous);
2184
+
2185
+ context = this;
2186
+ args = arguments;
2187
+
2188
+ if (remaining <= 0 || remaining > throttledTimer) {
2189
+ if (timeout) {
2190
+ clearTimeout(timeout);
2191
+ timeout = null;
2192
+ }
2193
+
2194
+ previous = now;
2195
+ result = func.apply(context, args);
2196
+
2197
+ if (!timeout) {
2198
+ // eslint-disable-next-line no-multi-assign
2199
+ context = args = null;
2200
+ }
2201
+ } else if (!timeout) {
2202
+ timeout = setTimeout(later, remaining);
2203
+ }
2204
+
2205
+ return result
2206
+ }
2207
+ }
2208
+
2209
+ function formatLogMsg(msg) {
2210
+ return msgID + '[' + myID + '] ' + msg
2211
+ }
2212
+
2213
+ function log(msg) {
2214
+ if (logging && 'object' === typeof window.console) {
2215
+ // eslint-disable-next-line no-console
2216
+ console.log(formatLogMsg(msg));
2217
+ }
2218
+ }
2219
+
2220
+ function warn(msg) {
2221
+ if ('object' === typeof window.console) {
2222
+ // eslint-disable-next-line no-console
2223
+ console.warn(formatLogMsg(msg));
2224
+ }
2225
+ }
2226
+
2227
+ function init() {
2228
+ readDataFromParent();
2229
+ log('Initialising iFrame (' + window.location.href + ')');
2230
+ readDataFromPage();
2231
+ setMargin();
2232
+ setBodyStyle('background', bodyBackground);
2233
+ setBodyStyle('padding', bodyPadding);
2234
+ injectClearFixIntoBodyElement();
2235
+ checkHeightMode();
2236
+ checkWidthMode();
2237
+ stopInfiniteResizingOfIFrame();
2238
+ setupPublicMethods();
2239
+ setupMouseEvents();
2240
+ startEventListeners();
2241
+ inPageLinks = setupInPageLinks();
2242
+ sendSize('init', 'Init message from host page');
2243
+ onReady();
2244
+ }
2245
+
2246
+ function readDataFromParent() {
2247
+ function strBool(str) {
2248
+ return 'true' === str
2249
+ }
2250
+
2251
+ var data = initMsg.slice(msgIdLen).split(':');
2252
+
2253
+ myID = data[0];
2254
+ bodyMargin = undefined$1 === data[1] ? bodyMargin : Number(data[1]); // For V1 compatibility
2255
+ calculateWidth = undefined$1 === data[2] ? calculateWidth : strBool(data[2]);
2256
+ logging = undefined$1 === data[3] ? logging : strBool(data[3]);
2257
+ interval = undefined$1 === data[4] ? interval : Number(data[4]);
2258
+ autoResize = undefined$1 === data[6] ? autoResize : strBool(data[6]);
2259
+ bodyMarginStr = data[7];
2260
+ heightCalcMode = undefined$1 === data[8] ? heightCalcMode : data[8];
2261
+ bodyBackground = data[9];
2262
+ bodyPadding = data[10];
2263
+ tolerance = undefined$1 === data[11] ? tolerance : Number(data[11]);
2264
+ inPageLinks.enable = undefined$1 === data[12] ? false : strBool(data[12]);
2265
+ resizeFrom = undefined$1 === data[13] ? resizeFrom : data[13];
2266
+ widthCalcMode = undefined$1 === data[14] ? widthCalcMode : data[14];
2267
+ mouseEvents = undefined$1 === data[15] ? mouseEvents : strBool(data[15]);
2268
+ }
2269
+
2270
+ function depricate(key) {
2271
+ var splitName = key.split('Callback');
2272
+
2273
+ if (splitName.length === 2) {
2274
+ var name =
2275
+ 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
2276
+ this[name] = this[key];
2277
+ delete this[key];
2278
+ warn(
2279
+ "Deprecated: '" +
2280
+ key +
2281
+ "' has been renamed '" +
2282
+ name +
2283
+ "'. The old method will be removed in the next major version."
2284
+ );
2285
+ }
2286
+ }
2287
+
2288
+ function readDataFromPage() {
2289
+ function readData() {
2290
+ var data = window.iFrameResizer;
2291
+
2292
+ log('Reading data from page: ' + JSON.stringify(data));
2293
+ Object.keys(data).forEach(depricate, data);
2294
+
2295
+ onMessage = 'onMessage' in data ? data.onMessage : onMessage;
2296
+ onReady = 'onReady' in data ? data.onReady : onReady;
2297
+ targetOriginDefault =
2298
+ 'targetOrigin' in data ? data.targetOrigin : targetOriginDefault;
2299
+ heightCalcMode =
2300
+ 'heightCalculationMethod' in data
2301
+ ? data.heightCalculationMethod
2302
+ : heightCalcMode;
2303
+ widthCalcMode =
2304
+ 'widthCalculationMethod' in data
2305
+ ? data.widthCalculationMethod
2306
+ : widthCalcMode;
2307
+ }
2308
+
2309
+ function setupCustomCalcMethods(calcMode, calcFunc) {
2310
+ if ('function' === typeof calcMode) {
2311
+ log('Setup custom ' + calcFunc + 'CalcMethod');
2312
+ customCalcMethods[calcFunc] = calcMode;
2313
+ calcMode = 'custom';
2314
+ }
2315
+
2316
+ return calcMode
2317
+ }
2318
+
2319
+ if (
2320
+ 'iFrameResizer' in window &&
2321
+ Object === window.iFrameResizer.constructor
2322
+ ) {
2323
+ readData();
2324
+ heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height');
2325
+ widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width');
2326
+ }
2327
+
2328
+ log('TargetOrigin for parent set to: ' + targetOriginDefault);
2329
+ }
2330
+
2331
+ function chkCSS(attr, value) {
2332
+ if (-1 !== value.indexOf('-')) {
2333
+ warn('Negative CSS value ignored for ' + attr);
2334
+ value = '';
2335
+ }
2336
+ return value
2337
+ }
2338
+
2339
+ function setBodyStyle(attr, value) {
2340
+ if (undefined$1 !== value && '' !== value && 'null' !== value) {
2341
+ document.body.style[attr] = value;
2342
+ log('Body ' + attr + ' set to "' + value + '"');
2343
+ }
2344
+ }
2345
+
2346
+ function setMargin() {
2347
+ // If called via V1 script, convert bodyMargin from int to str
2348
+ if (undefined$1 === bodyMarginStr) {
2349
+ bodyMarginStr = bodyMargin + 'px';
2350
+ }
2351
+
2352
+ setBodyStyle('margin', chkCSS('margin', bodyMarginStr));
2353
+ }
2354
+
2355
+ function stopInfiniteResizingOfIFrame() {
2356
+ document.documentElement.style.height = '';
2357
+ document.body.style.height = '';
2358
+ log('HTML & body height set to "auto"');
2359
+ }
2360
+
2361
+ function manageTriggerEvent(options) {
2362
+ var listener = {
2363
+ add: function (eventName) {
2364
+ function handleEvent() {
2365
+ sendSize(options.eventName, options.eventType);
2366
+ }
2367
+
2368
+ eventHandlersByName[eventName] = handleEvent;
2369
+
2370
+ addEventListener(window, eventName, handleEvent, { passive: true });
2371
+ },
2372
+ remove: function (eventName) {
2373
+ var handleEvent = eventHandlersByName[eventName];
2374
+ delete eventHandlersByName[eventName];
2375
+
2376
+ removeEventListener(window, eventName, handleEvent);
2377
+ }
2378
+ };
2379
+
2380
+ if (options.eventNames && Array.prototype.map) {
2381
+ options.eventName = options.eventNames[0];
2382
+ options.eventNames.map(listener[options.method]);
2383
+ } else {
2384
+ listener[options.method](options.eventName);
2385
+ }
2386
+
2387
+ log(
2388
+ capitalizeFirstLetter(options.method) +
2389
+ ' event listener: ' +
2390
+ options.eventType
2391
+ );
2392
+ }
2393
+
2394
+ function manageEventListeners(method) {
2395
+ manageTriggerEvent({
2396
+ method: method,
2397
+ eventType: 'Animation Start',
2398
+ eventNames: ['animationstart', 'webkitAnimationStart']
2399
+ });
2400
+ manageTriggerEvent({
2401
+ method: method,
2402
+ eventType: 'Animation Iteration',
2403
+ eventNames: ['animationiteration', 'webkitAnimationIteration']
2404
+ });
2405
+ manageTriggerEvent({
2406
+ method: method,
2407
+ eventType: 'Animation End',
2408
+ eventNames: ['animationend', 'webkitAnimationEnd']
2409
+ });
2410
+ manageTriggerEvent({
2411
+ method: method,
2412
+ eventType: 'Input',
2413
+ eventName: 'input'
2414
+ });
2415
+ manageTriggerEvent({
2416
+ method: method,
2417
+ eventType: 'Mouse Up',
2418
+ eventName: 'mouseup'
2419
+ });
2420
+ manageTriggerEvent({
2421
+ method: method,
2422
+ eventType: 'Mouse Down',
2423
+ eventName: 'mousedown'
2424
+ });
2425
+ manageTriggerEvent({
2426
+ method: method,
2427
+ eventType: 'Orientation Change',
2428
+ eventName: 'orientationchange'
2429
+ });
2430
+ manageTriggerEvent({
2431
+ method: method,
2432
+ eventType: 'Print',
2433
+ eventNames: ['afterprint', 'beforeprint']
2434
+ });
2435
+ manageTriggerEvent({
2436
+ method: method,
2437
+ eventType: 'Ready State Change',
2438
+ eventName: 'readystatechange'
2439
+ });
2440
+ manageTriggerEvent({
2441
+ method: method,
2442
+ eventType: 'Touch Start',
2443
+ eventName: 'touchstart'
2444
+ });
2445
+ manageTriggerEvent({
2446
+ method: method,
2447
+ eventType: 'Touch End',
2448
+ eventName: 'touchend'
2449
+ });
2450
+ manageTriggerEvent({
2451
+ method: method,
2452
+ eventType: 'Touch Cancel',
2453
+ eventName: 'touchcancel'
2454
+ });
2455
+ manageTriggerEvent({
2456
+ method: method,
2457
+ eventType: 'Transition Start',
2458
+ eventNames: [
2459
+ 'transitionstart',
2460
+ 'webkitTransitionStart',
2461
+ 'MSTransitionStart',
2462
+ 'oTransitionStart',
2463
+ 'otransitionstart'
2464
+ ]
2465
+ });
2466
+ manageTriggerEvent({
2467
+ method: method,
2468
+ eventType: 'Transition Iteration',
2469
+ eventNames: [
2470
+ 'transitioniteration',
2471
+ 'webkitTransitionIteration',
2472
+ 'MSTransitionIteration',
2473
+ 'oTransitionIteration',
2474
+ 'otransitioniteration'
2475
+ ]
2476
+ });
2477
+ manageTriggerEvent({
2478
+ method: method,
2479
+ eventType: 'Transition End',
2480
+ eventNames: [
2481
+ 'transitionend',
2482
+ 'webkitTransitionEnd',
2483
+ 'MSTransitionEnd',
2484
+ 'oTransitionEnd',
2485
+ 'otransitionend'
2486
+ ]
2487
+ });
2488
+ if ('child' === resizeFrom) {
2489
+ manageTriggerEvent({
2490
+ method: method,
2491
+ eventType: 'IFrame Resized',
2492
+ eventName: 'resize'
2493
+ });
2494
+ }
2495
+ }
2496
+
2497
+ function checkCalcMode(calcMode, calcModeDefault, modes, type) {
2498
+ if (calcModeDefault !== calcMode) {
2499
+ if (!(calcMode in modes)) {
2500
+ warn(
2501
+ calcMode + ' is not a valid option for ' + type + 'CalculationMethod.'
2502
+ );
2503
+ calcMode = calcModeDefault;
2504
+ }
2505
+ log(type + ' calculation method set to "' + calcMode + '"');
2506
+ }
2507
+
2508
+ return calcMode
2509
+ }
2510
+
2511
+ function checkHeightMode() {
2512
+ heightCalcMode = checkCalcMode(
2513
+ heightCalcMode,
2514
+ heightCalcModeDefault,
2515
+ getHeight,
2516
+ 'height'
2517
+ );
2518
+ }
2519
+
2520
+ function checkWidthMode() {
2521
+ widthCalcMode = checkCalcMode(
2522
+ widthCalcMode,
2523
+ widthCalcModeDefault,
2524
+ getWidth,
2525
+ 'width'
2526
+ );
2527
+ }
2528
+
2529
+ function startEventListeners() {
2530
+ if (true === autoResize) {
2531
+ manageEventListeners('add');
2532
+ setupMutationObserver();
2533
+ } else {
2534
+ log('Auto Resize disabled');
2535
+ }
2536
+ }
2537
+
2538
+ // function stopMsgsToParent() {
2539
+ // log('Disable outgoing messages')
2540
+ // sendPermit = false
2541
+ // }
2542
+
2543
+ // function removeMsgListener() {
2544
+ // log('Remove event listener: Message')
2545
+ // removeEventListener(window, 'message', receiver)
2546
+ // }
2547
+
2548
+ function disconnectMutationObserver() {
2549
+ if (null !== bodyObserver) {
2550
+ /* istanbul ignore next */ // Not testable in PhantonJS
2551
+ bodyObserver.disconnect();
2552
+ }
2553
+ }
2554
+
2555
+ function stopEventListeners() {
2556
+ manageEventListeners('remove');
2557
+ disconnectMutationObserver();
2558
+ clearInterval(intervalTimer);
2559
+ }
2560
+
2561
+ // function teardown() {
2562
+ // stopMsgsToParent()
2563
+ // removeMsgListener()
2564
+ // if (true === autoResize) stopEventListeners()
2565
+ // }
2566
+
2567
+ function injectClearFixIntoBodyElement() {
2568
+ var clearFix = document.createElement('div');
2569
+ clearFix.style.clear = 'both';
2570
+ // Guard against the following having been globally redefined in CSS.
2571
+ clearFix.style.display = 'block';
2572
+ clearFix.style.height = '0';
2573
+ document.body.appendChild(clearFix);
2574
+ }
2575
+
2576
+ function setupInPageLinks() {
2577
+ function getPagePosition() {
2578
+ return {
2579
+ x:
2580
+ window.pageXOffset === undefined$1
2581
+ ? document.documentElement.scrollLeft
2582
+ : window.pageXOffset,
2583
+ y:
2584
+ window.pageYOffset === undefined$1
2585
+ ? document.documentElement.scrollTop
2586
+ : window.pageYOffset
2587
+ }
2588
+ }
2589
+
2590
+ function getElementPosition(el) {
2591
+ var elPosition = el.getBoundingClientRect(),
2592
+ pagePosition = getPagePosition();
2593
+
2594
+ return {
2595
+ x: parseInt(elPosition.left, 10) + parseInt(pagePosition.x, 10),
2596
+ y: parseInt(elPosition.top, 10) + parseInt(pagePosition.y, 10)
2597
+ }
2598
+ }
2599
+
2600
+ function findTarget(location) {
2601
+ function jumpToTarget(target) {
2602
+ var jumpPosition = getElementPosition(target);
2603
+
2604
+ log(
2605
+ 'Moving to in page link (#' +
2606
+ hash +
2607
+ ') at x: ' +
2608
+ jumpPosition.x +
2609
+ ' y: ' +
2610
+ jumpPosition.y
2611
+ );
2612
+ sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset'); // X&Y reversed at sendMsg uses height/width
2613
+ }
2614
+
2615
+ var hash = location.split('#')[1] || location, // Remove # if present
2616
+ hashData = decodeURIComponent(hash),
2617
+ target =
2618
+ document.getElementById(hashData) ||
2619
+ document.getElementsByName(hashData)[0];
2620
+
2621
+ if (undefined$1 === target) {
2622
+ log(
2623
+ 'In page link (#' +
2624
+ hash +
2625
+ ') not found in iFrame, so sending to parent'
2626
+ );
2627
+ sendMsg(0, 0, 'inPageLink', '#' + hash);
2628
+ } else {
2629
+ jumpToTarget(target);
2630
+ }
2631
+ }
2632
+
2633
+ function checkLocationHash() {
2634
+ var hash = window.location.hash;
2635
+ var href = window.location.href;
2636
+
2637
+ if ('' !== hash && '#' !== hash) {
2638
+ findTarget(href);
2639
+ }
2640
+ }
2641
+
2642
+ function bindAnchors() {
2643
+ function setupLink(el) {
2644
+ function linkClicked(e) {
2645
+ e.preventDefault();
2646
+
2647
+ /* jshint validthis:true */
2648
+ findTarget(this.getAttribute('href'));
2649
+ }
2650
+
2651
+ if ('#' !== el.getAttribute('href')) {
2652
+ addEventListener(el, 'click', linkClicked);
2653
+ }
2654
+ }
2655
+
2656
+ Array.prototype.forEach.call(
2657
+ document.querySelectorAll('a[href^="#"]'),
2658
+ setupLink
2659
+ );
2660
+ }
2661
+
2662
+ function bindLocationHash() {
2663
+ addEventListener(window, 'hashchange', checkLocationHash);
2664
+ }
2665
+
2666
+ function initCheck() {
2667
+ // Check if page loaded with location hash after init resize
2668
+ setTimeout(checkLocationHash, eventCancelTimer);
2669
+ }
2670
+
2671
+ function enableInPageLinks() {
2672
+ /* istanbul ignore else */ // Not testable in phantonJS
2673
+ if (Array.prototype.forEach && document.querySelectorAll) {
2674
+ log('Setting up location.hash handlers');
2675
+ bindAnchors();
2676
+ bindLocationHash();
2677
+ initCheck();
2678
+ } else {
2679
+ warn(
2680
+ 'In page linking not fully supported in this browser! (See README.md for IE8 workaround)'
2681
+ );
2682
+ }
2683
+ }
2684
+
2685
+ if (inPageLinks.enable) {
2686
+ enableInPageLinks();
2687
+ } else {
2688
+ log('In page linking not enabled');
2689
+ }
2690
+
2691
+ return {
2692
+ findTarget: findTarget
2693
+ }
2694
+ }
2695
+
2696
+ function setupMouseEvents() {
2697
+ if (mouseEvents !== true) return
2698
+
2699
+ function sendMouse(e) {
2700
+ sendMsg(0, 0, e.type, e.screenY + ':' + e.screenX);
2701
+ }
2702
+
2703
+ function addMouseListener(evt, name) {
2704
+ log('Add event listener: ' + name);
2705
+ addEventListener(window.document, evt, sendMouse);
2706
+ }
2707
+
2708
+ addMouseListener('mouseenter', 'Mouse Enter');
2709
+ addMouseListener('mouseleave', 'Mouse Leave');
2710
+ }
2711
+
2712
+ function setupPublicMethods() {
2713
+ log('Enable public methods');
2714
+
2715
+ win.parentIFrame = {
2716
+ autoResize: function autoResizeF(resize) {
2717
+ if (true === resize && false === autoResize) {
2718
+ autoResize = true;
2719
+ startEventListeners();
2720
+ } else if (false === resize && true === autoResize) {
2721
+ autoResize = false;
2722
+ stopEventListeners();
2723
+ }
2724
+ sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize));
2725
+ return autoResize
2726
+ },
2727
+
2728
+ close: function closeF() {
2729
+ sendMsg(0, 0, 'close');
2730
+ // teardown()
2731
+ },
2732
+
2733
+ getId: function getIdF() {
2734
+ return myID
2735
+ },
2736
+
2737
+ getPageInfo: function getPageInfoF(callback) {
2738
+ if ('function' === typeof callback) {
2739
+ onPageInfo = callback;
2740
+ sendMsg(0, 0, 'pageInfo');
2741
+ } else {
2742
+ onPageInfo = function () {};
2743
+ sendMsg(0, 0, 'pageInfoStop');
2744
+ }
2745
+ },
2746
+
2747
+ moveToAnchor: function moveToAnchorF(hash) {
2748
+ inPageLinks.findTarget(hash);
2749
+ },
2750
+
2751
+ reset: function resetF() {
2752
+ resetIFrame('parentIFrame.reset');
2753
+ },
2754
+
2755
+ scrollTo: function scrollToF(x, y) {
2756
+ sendMsg(y, x, 'scrollTo'); // X&Y reversed at sendMsg uses height/width
2757
+ },
2758
+
2759
+ scrollToOffset: function scrollToF(x, y) {
2760
+ sendMsg(y, x, 'scrollToOffset'); // X&Y reversed at sendMsg uses height/width
2761
+ },
2762
+
2763
+ sendMessage: function sendMessageF(msg, targetOrigin) {
2764
+ sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin);
2765
+ },
2766
+
2767
+ setHeightCalculationMethod: function setHeightCalculationMethodF(
2768
+ heightCalculationMethod
2769
+ ) {
2770
+ heightCalcMode = heightCalculationMethod;
2771
+ checkHeightMode();
2772
+ },
2773
+
2774
+ setWidthCalculationMethod: function setWidthCalculationMethodF(
2775
+ widthCalculationMethod
2776
+ ) {
2777
+ widthCalcMode = widthCalculationMethod;
2778
+ checkWidthMode();
2779
+ },
2780
+
2781
+ setTargetOrigin: function setTargetOriginF(targetOrigin) {
2782
+ log('Set targetOrigin: ' + targetOrigin);
2783
+ targetOriginDefault = targetOrigin;
2784
+ },
2785
+
2786
+ size: function sizeF(customHeight, customWidth) {
2787
+ var valString =
2788
+ '' + (customHeight || '') + (customWidth ? ',' + customWidth : '');
2789
+ sendSize(
2790
+ 'size',
2791
+ 'parentIFrame.size(' + valString + ')',
2792
+ customHeight,
2793
+ customWidth
2794
+ );
2795
+ }
2796
+ };
2797
+ }
2798
+
2799
+ function initInterval() {
2800
+ if (0 !== interval) {
2801
+ log('setInterval: ' + interval + 'ms');
2802
+ intervalTimer = setInterval(function () {
2803
+ sendSize('interval', 'setInterval: ' + interval);
2804
+ }, Math.abs(interval));
2805
+ }
2806
+ }
2807
+
2808
+ // Not testable in PhantomJS
2809
+ /* istanbul ignore next */
2810
+ function setupBodyMutationObserver() {
2811
+ function addImageLoadListners(mutation) {
2812
+ function addImageLoadListener(element) {
2813
+ if (false === element.complete) {
2814
+ log('Attach listeners to ' + element.src);
2815
+ element.addEventListener('load', imageLoaded, false);
2816
+ element.addEventListener('error', imageError, false);
2817
+ elements.push(element);
2818
+ }
2819
+ }
2820
+
2821
+ if (mutation.type === 'attributes' && mutation.attributeName === 'src') {
2822
+ addImageLoadListener(mutation.target);
2823
+ } else if (mutation.type === 'childList') {
2824
+ Array.prototype.forEach.call(
2825
+ mutation.target.querySelectorAll('img'),
2826
+ addImageLoadListener
2827
+ );
2828
+ }
2829
+ }
2830
+
2831
+ function removeFromArray(element) {
2832
+ elements.splice(elements.indexOf(element), 1);
2833
+ }
2834
+
2835
+ function removeImageLoadListener(element) {
2836
+ log('Remove listeners from ' + element.src);
2837
+ element.removeEventListener('load', imageLoaded, false);
2838
+ element.removeEventListener('error', imageError, false);
2839
+ removeFromArray(element);
2840
+ }
2841
+
2842
+ function imageEventTriggered(event, type, typeDesc) {
2843
+ removeImageLoadListener(event.target);
2844
+ sendSize(type, typeDesc + ': ' + event.target.src);
2845
+ }
2846
+
2847
+ function imageLoaded(event) {
2848
+ imageEventTriggered(event, 'imageLoad', 'Image loaded');
2849
+ }
2850
+
2851
+ function imageError(event) {
2852
+ imageEventTriggered(event, 'imageLoadFailed', 'Image load failed');
2853
+ }
2854
+
2855
+ function mutationObserved(mutations) {
2856
+ sendSize(
2857
+ 'mutationObserver',
2858
+ 'mutationObserver: ' + mutations[0].target + ' ' + mutations[0].type
2859
+ );
2860
+
2861
+ // Deal with WebKit / Blink asyncing image loading when tags are injected into the page
2862
+ mutations.forEach(addImageLoadListners);
2863
+ }
2864
+
2865
+ function createMutationObserver() {
2866
+ var target = document.querySelector('body'),
2867
+ config = {
2868
+ attributes: true,
2869
+ attributeOldValue: false,
2870
+ characterData: true,
2871
+ characterDataOldValue: false,
2872
+ childList: true,
2873
+ subtree: true
2874
+ };
2875
+
2876
+ observer = new MutationObserver(mutationObserved);
2877
+
2878
+ log('Create body MutationObserver');
2879
+ observer.observe(target, config);
2880
+
2881
+ return observer
2882
+ }
2883
+
2884
+ var elements = [],
2885
+ MutationObserver =
2886
+ window.MutationObserver || window.WebKitMutationObserver,
2887
+ observer = createMutationObserver();
2888
+
2889
+ return {
2890
+ disconnect: function () {
2891
+ if ('disconnect' in observer) {
2892
+ log('Disconnect body MutationObserver');
2893
+ observer.disconnect();
2894
+ elements.forEach(removeImageLoadListener);
2895
+ }
2896
+ }
2897
+ }
2898
+ }
2899
+
2900
+ function setupMutationObserver() {
2901
+ var forceIntervalTimer = 0 > interval;
2902
+
2903
+ // Not testable in PhantomJS
2904
+ /* istanbul ignore if */ if (
2905
+ window.MutationObserver ||
2906
+ window.WebKitMutationObserver
2907
+ ) {
2908
+ if (forceIntervalTimer) {
2909
+ initInterval();
2910
+ } else {
2911
+ bodyObserver = setupBodyMutationObserver();
2912
+ }
2913
+ } else {
2914
+ log('MutationObserver not supported in this browser!');
2915
+ initInterval();
2916
+ }
2917
+ }
2918
+
2919
+ // document.documentElement.offsetHeight is not reliable, so
2920
+ // we have to jump through hoops to get a better value.
2921
+ function getComputedStyle(prop, el) {
2922
+ var retVal = 0;
2923
+ el = el || document.body; // Not testable in phantonJS
2924
+
2925
+ retVal = document.defaultView.getComputedStyle(el, null);
2926
+ retVal = null === retVal ? 0 : retVal[prop];
2927
+
2928
+ return parseInt(retVal, base)
2929
+ }
2930
+
2931
+ function chkEventThottle(timer) {
2932
+ if (timer > throttledTimer / 2) {
2933
+ throttledTimer = 2 * timer;
2934
+ log('Event throttle increased to ' + throttledTimer + 'ms');
2935
+ }
2936
+ }
2937
+
2938
+ // Idea from https://github.com/guardian/iframe-messenger
2939
+ function getMaxElement(side, elements) {
2940
+ var elementsLength = elements.length,
2941
+ elVal = 0,
2942
+ maxVal = 0,
2943
+ Side = capitalizeFirstLetter(side),
2944
+ timer = Date.now();
2945
+
2946
+ for (var i = 0; i < elementsLength; i++) {
2947
+ elVal =
2948
+ elements[i].getBoundingClientRect()[side] +
2949
+ getComputedStyle('margin' + Side, elements[i]);
2950
+ if (elVal > maxVal) {
2951
+ maxVal = elVal;
2952
+ }
2953
+ }
2954
+
2955
+ timer = Date.now() - timer;
2956
+
2957
+ log('Parsed ' + elementsLength + ' HTML elements');
2958
+ log('Element position calculated in ' + timer + 'ms');
2959
+
2960
+ chkEventThottle(timer);
2961
+
2962
+ return maxVal
2963
+ }
2964
+
2965
+ function getAllMeasurements(dimensions) {
2966
+ return [
2967
+ dimensions.bodyOffset(),
2968
+ dimensions.bodyScroll(),
2969
+ dimensions.documentElementOffset(),
2970
+ dimensions.documentElementScroll()
2971
+ ]
2972
+ }
2973
+
2974
+ function getTaggedElements(side, tag) {
2975
+ function noTaggedElementsFound() {
2976
+ warn('No tagged elements (' + tag + ') found on page');
2977
+ return document.querySelectorAll('body *')
2978
+ }
2979
+
2980
+ var elements = document.querySelectorAll('[' + tag + ']');
2981
+
2982
+ if (elements.length === 0) noTaggedElementsFound();
2983
+
2984
+ return getMaxElement(side, elements)
2985
+ }
2986
+
2987
+ function getAllElements() {
2988
+ return document.querySelectorAll('body *')
2989
+ }
2990
+
2991
+ var getHeight = {
2992
+ bodyOffset: function getBodyOffsetHeight() {
2993
+ return (
2994
+ document.body.offsetHeight +
2995
+ getComputedStyle('marginTop') +
2996
+ getComputedStyle('marginBottom')
2997
+ )
2998
+ },
2999
+
3000
+ offset: function () {
3001
+ return getHeight.bodyOffset() // Backwards compatibility
3002
+ },
3003
+
3004
+ bodyScroll: function getBodyScrollHeight() {
3005
+ return document.body.scrollHeight
3006
+ },
3007
+
3008
+ custom: function getCustomWidth() {
3009
+ return customCalcMethods.height()
3010
+ },
3011
+
3012
+ documentElementOffset: function getDEOffsetHeight() {
3013
+ return document.documentElement.offsetHeight
3014
+ },
3015
+
3016
+ documentElementScroll: function getDEScrollHeight() {
3017
+ return document.documentElement.scrollHeight
3018
+ },
3019
+
3020
+ max: function getMaxHeight() {
3021
+ return Math.max.apply(null, getAllMeasurements(getHeight))
3022
+ },
3023
+
3024
+ min: function getMinHeight() {
3025
+ return Math.min.apply(null, getAllMeasurements(getHeight))
3026
+ },
3027
+
3028
+ grow: function growHeight() {
3029
+ return getHeight.max() // Run max without the forced downsizing
3030
+ },
3031
+
3032
+ lowestElement: function getBestHeight() {
3033
+ return Math.max(
3034
+ getHeight.bodyOffset() || getHeight.documentElementOffset(),
3035
+ getMaxElement('bottom', getAllElements())
3036
+ )
3037
+ },
3038
+
3039
+ taggedElement: function getTaggedElementsHeight() {
3040
+ return getTaggedElements('bottom', 'data-iframe-height')
3041
+ }
3042
+ },
3043
+ getWidth = {
3044
+ bodyScroll: function getBodyScrollWidth() {
3045
+ return document.body.scrollWidth
3046
+ },
3047
+
3048
+ bodyOffset: function getBodyOffsetWidth() {
3049
+ return document.body.offsetWidth
3050
+ },
3051
+
3052
+ custom: function getCustomWidth() {
3053
+ return customCalcMethods.width()
3054
+ },
3055
+
3056
+ documentElementScroll: function getDEScrollWidth() {
3057
+ return document.documentElement.scrollWidth
3058
+ },
3059
+
3060
+ documentElementOffset: function getDEOffsetWidth() {
3061
+ return document.documentElement.offsetWidth
3062
+ },
3063
+
3064
+ scroll: function getMaxWidth() {
3065
+ return Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll())
3066
+ },
3067
+
3068
+ max: function getMaxWidth() {
3069
+ return Math.max.apply(null, getAllMeasurements(getWidth))
3070
+ },
3071
+
3072
+ min: function getMinWidth() {
3073
+ return Math.min.apply(null, getAllMeasurements(getWidth))
3074
+ },
3075
+
3076
+ rightMostElement: function rightMostElement() {
3077
+ return getMaxElement('right', getAllElements())
3078
+ },
3079
+
3080
+ taggedElement: function getTaggedElementsWidth() {
3081
+ return getTaggedElements('right', 'data-iframe-width')
3082
+ }
3083
+ };
3084
+
3085
+ function sizeIFrame(
3086
+ triggerEvent,
3087
+ triggerEventDesc,
3088
+ customHeight,
3089
+ customWidth
3090
+ ) {
3091
+ function resizeIFrame() {
3092
+ height = currentHeight;
3093
+ width = currentWidth;
3094
+
3095
+ sendMsg(height, width, triggerEvent);
3096
+ }
3097
+
3098
+ function isSizeChangeDetected() {
3099
+ function checkTolarance(a, b) {
3100
+ var retVal = Math.abs(a - b) <= tolerance;
3101
+ return !retVal
3102
+ }
3103
+
3104
+ currentHeight =
3105
+ undefined$1 === customHeight ? getHeight[heightCalcMode]() : customHeight;
3106
+ currentWidth =
3107
+ undefined$1 === customWidth ? getWidth[widthCalcMode]() : customWidth;
3108
+
3109
+ return (
3110
+ checkTolarance(height, currentHeight) ||
3111
+ (calculateWidth && checkTolarance(width, currentWidth))
3112
+ )
3113
+ }
3114
+
3115
+ function isForceResizableEvent() {
3116
+ return !(triggerEvent in { init: 1, interval: 1, size: 1 })
3117
+ }
3118
+
3119
+ function isForceResizableCalcMode() {
3120
+ return (
3121
+ heightCalcMode in resetRequiredMethods ||
3122
+ (calculateWidth && widthCalcMode in resetRequiredMethods)
3123
+ )
3124
+ }
3125
+
3126
+ function logIgnored() {
3127
+ log('No change in size detected');
3128
+ }
3129
+
3130
+ function checkDownSizing() {
3131
+ if (isForceResizableEvent() && isForceResizableCalcMode()) {
3132
+ resetIFrame(triggerEventDesc);
3133
+ } else if (!(triggerEvent in { interval: 1 })) {
3134
+ logIgnored();
3135
+ }
3136
+ }
3137
+
3138
+ var currentHeight, currentWidth;
3139
+
3140
+ if (isSizeChangeDetected() || 'init' === triggerEvent) {
3141
+ lockTrigger();
3142
+ resizeIFrame();
3143
+ } else {
3144
+ checkDownSizing();
3145
+ }
3146
+ }
3147
+
3148
+ var sizeIFrameThrottled = throttle(sizeIFrame);
3149
+
3150
+ function sendSize(triggerEvent, triggerEventDesc, customHeight, customWidth) {
3151
+ function recordTrigger() {
3152
+ if (!(triggerEvent in { reset: 1, resetPage: 1, init: 1 })) {
3153
+ log('Trigger event: ' + triggerEventDesc);
3154
+ }
3155
+ }
3156
+
3157
+ function isDoubleFiredEvent() {
3158
+ return triggerLocked && triggerEvent in doubleEventList
3159
+ }
3160
+
3161
+ if (isDoubleFiredEvent()) {
3162
+ log('Trigger event cancelled: ' + triggerEvent);
3163
+ } else {
3164
+ recordTrigger();
3165
+ if (triggerEvent === 'init') {
3166
+ sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth);
3167
+ } else {
3168
+ sizeIFrameThrottled(
3169
+ triggerEvent,
3170
+ triggerEventDesc,
3171
+ customHeight,
3172
+ customWidth
3173
+ );
3174
+ }
3175
+ }
3176
+ }
3177
+
3178
+ function lockTrigger() {
3179
+ if (!triggerLocked) {
3180
+ triggerLocked = true;
3181
+ log('Trigger event lock on');
3182
+ }
3183
+ clearTimeout(triggerLockedTimer);
3184
+ triggerLockedTimer = setTimeout(function () {
3185
+ triggerLocked = false;
3186
+ log('Trigger event lock off');
3187
+ log('--');
3188
+ }, eventCancelTimer);
3189
+ }
3190
+
3191
+ function triggerReset(triggerEvent) {
3192
+ height = getHeight[heightCalcMode]();
3193
+ width = getWidth[widthCalcMode]();
3194
+
3195
+ sendMsg(height, width, triggerEvent);
3196
+ }
3197
+
3198
+ function resetIFrame(triggerEventDesc) {
3199
+ var hcm = heightCalcMode;
3200
+ heightCalcMode = heightCalcModeDefault;
3201
+
3202
+ log('Reset trigger event: ' + triggerEventDesc);
3203
+ lockTrigger();
3204
+ triggerReset('reset');
3205
+
3206
+ heightCalcMode = hcm;
3207
+ }
3208
+
3209
+ function sendMsg(height, width, triggerEvent, msg, targetOrigin) {
3210
+ function setTargetOrigin() {
3211
+ if (undefined$1 === targetOrigin) {
3212
+ targetOrigin = targetOriginDefault;
3213
+ } else {
3214
+ log('Message targetOrigin: ' + targetOrigin);
3215
+ }
3216
+ }
3217
+
3218
+ function sendToParent() {
3219
+ var size = height + ':' + width,
3220
+ message =
3221
+ myID +
3222
+ ':' +
3223
+ size +
3224
+ ':' +
3225
+ triggerEvent +
3226
+ (undefined$1 === msg ? '' : ':' + msg);
3227
+
3228
+ log('Sending message to host page (' + message + ')');
3229
+ target.postMessage(msgID + message, targetOrigin);
3230
+ }
3231
+
3232
+ {
3233
+ setTargetOrigin();
3234
+ sendToParent();
3235
+ }
3236
+ }
3237
+
3238
+ function receiver(event) {
3239
+ var processRequestFromParent = {
3240
+ init: function initFromParent() {
3241
+ initMsg = event.data;
3242
+ target = event.source;
3243
+
3244
+ init();
3245
+ firstRun = false;
3246
+ setTimeout(function () {
3247
+ initLock = false;
3248
+ }, eventCancelTimer);
3249
+ },
3250
+
3251
+ reset: function resetFromParent() {
3252
+ if (initLock) {
3253
+ log('Page reset ignored by init');
3254
+ } else {
3255
+ log('Page size reset by host page');
3256
+ triggerReset('resetPage');
3257
+ }
3258
+ },
3259
+
3260
+ resize: function resizeFromParent() {
3261
+ sendSize('resizeParent', 'Parent window requested size check');
3262
+ },
3263
+
3264
+ moveToAnchor: function moveToAnchorF() {
3265
+ inPageLinks.findTarget(getData());
3266
+ },
3267
+ inPageLink: function inPageLinkF() {
3268
+ this.moveToAnchor();
3269
+ }, // Backward compatibility
3270
+
3271
+ pageInfo: function pageInfoFromParent() {
3272
+ var msgBody = getData();
3273
+ log('PageInfoFromParent called from parent: ' + msgBody);
3274
+ onPageInfo(JSON.parse(msgBody));
3275
+ log(' --');
3276
+ },
3277
+
3278
+ message: function messageFromParent() {
3279
+ var msgBody = getData();
3280
+
3281
+ log('onMessage called from parent: ' + msgBody);
3282
+ // eslint-disable-next-line sonarjs/no-extra-arguments
3283
+ onMessage(JSON.parse(msgBody));
3284
+ log(' --');
3285
+ }
3286
+ };
3287
+
3288
+ function isMessageForUs() {
3289
+ return msgID === ('' + event.data).slice(0, msgIdLen) // ''+ Protects against non-string messages
3290
+ }
3291
+
3292
+ function getMessageType() {
3293
+ return event.data.split(']')[1].split(':')[0]
3294
+ }
3295
+
3296
+ function getData() {
3297
+ return event.data.slice(event.data.indexOf(':') + 1)
3298
+ }
3299
+
3300
+ function isMiddleTier() {
3301
+ return (
3302
+ (!(module.exports) &&
3303
+ 'iFrameResize' in window) ||
3304
+ (window.jQuery !== undefined$1 &&
3305
+ 'iFrameResize' in window.jQuery.prototype)
3306
+ )
3307
+ }
3308
+
3309
+ function isInitMsg() {
3310
+ // Test if this message is from a child below us. This is an ugly test, however, updating
3311
+ // the message format would break backwards compatibility.
3312
+ return event.data.split(':')[2] in { true: 1, false: 1 }
3313
+ }
3314
+
3315
+ function callFromParent() {
3316
+ var messageType = getMessageType();
3317
+
3318
+ if (messageType in processRequestFromParent) {
3319
+ processRequestFromParent[messageType]();
3320
+ } else if (!isMiddleTier() && !isInitMsg()) {
3321
+ warn('Unexpected message (' + event.data + ')');
3322
+ }
3323
+ }
3324
+
3325
+ function processMessage() {
3326
+ if (false === firstRun) {
3327
+ callFromParent();
3328
+ } else if (isInitMsg()) {
3329
+ processRequestFromParent.init();
3330
+ } else {
3331
+ log(
3332
+ 'Ignored message of type "' +
3333
+ getMessageType() +
3334
+ '". Received before initialization.'
3335
+ );
3336
+ }
3337
+ }
3338
+
3339
+ if (isMessageForUs()) {
3340
+ processMessage();
3341
+ }
3342
+ }
3343
+
3344
+ // Normally the parent kicks things off when it detects the iFrame has loaded.
3345
+ // If this script is async-loaded, then tell parent page to retry init.
3346
+ function chkLateLoaded() {
3347
+ if ('loading' !== document.readyState) {
3348
+ window.parent.postMessage('[iFrameResizerChild]Ready', '*');
3349
+ }
3350
+ }
3351
+
3352
+ addEventListener(window, 'message', receiver);
3353
+ addEventListener(window, 'readystatechange', chkLateLoaded);
3354
+ chkLateLoaded();
3355
+
3356
+
3357
+ })();
3358
+ });
3359
+
3360
+ var iframeResizer = {
3361
+ iframeResize: iframeResizer$1,
3362
+ iframeResizer: iframeResizer$1, // Backwards compatibility
3363
+ contentWindow: iframeResizer_contentWindow
3364
+ };
3365
+
3366
+ const MiddleLinks = (props) => {
3367
+ return props.items.slice(1, -1).map(item => (index.h("li", { key: item.url },
3368
+ index.h("a", { href: item.url, class: "nav-link", tabindex: props.focusable === false ? '-1' : undefined },
3369
+ index.h("span", null, item.text)),
3370
+ props.icons ? index.h(svgIcon_component.SvgIcon, { name: "pi-arrow-down", classNames: "rotate-270" }) : null)));
3371
+ };
3372
+
3373
+ const MiddleDropdown = (props) => {
3374
+ return (index.h("div", { class: "middle-dropdown-container" },
3375
+ index.h("button", { class: "middle-dropdown-button btn btn-blank", type: "button", onClick: event => props.clickHandler(event), tabindex: props.focusable === false ? '-1' : undefined },
3376
+ index.h("span", { class: "visually-hidden" }, language_service.translate('Open menu')),
3377
+ index.h("span", { "aria-hidden": "true" }, "...")),
3378
+ index.h(svgIcon_component.SvgIcon, { name: "pi-arrow-down", classNames: "rotate-270" }),
3379
+ props.dropdownOpen ? (index.h("nav", { "aria-label": language_service.translate('Intermediary links'), class: "middle-dropdown" },
3380
+ index.h("ul", { class: "no-list" },
3381
+ index.h(MiddleLinks, { items: props.items, icons: false, focusable: props.focusable })))) : null));
3382
+ };
3383
+
3384
+ const BreadcrumbList = (props) => {
3385
+ var _a;
3386
+ const homeItem = props.items[0];
3387
+ const lastItem = props.items[props.items.length - 1];
3388
+ return (index.h("ol", { class: "no-list breadcrumbs-list" },
3389
+ index.h("li", null,
3390
+ index.h("a", { class: "home-link nav-link", href: homeItem.url, tabindex: props.focusable === false ? '-1' : undefined },
3391
+ index.h("span", { class: "visually-hidden" }, homeItem.text),
3392
+ index.h(svgIcon_component.SvgIcon, { name: "pi-home" })),
3393
+ index.h(svgIcon_component.SvgIcon, { name: "pi-arrow-down", classNames: "rotate-270" })),
3394
+ props.isConcatenated ? (index.h("li", null,
3395
+ index.h(MiddleDropdown, { items: props.items, dropdownOpen: (_a = props.dropdownOpen) !== null && _a !== void 0 ? _a : false, clickHandler: e => props.clickHandler(e), focusable: props.focusable }))) : (index.h(MiddleLinks, { items: props.items, icons: true, focusable: props.focusable })),
3396
+ index.h("li", null,
3397
+ index.h("a", { class: "last-link nav-link", href: lastItem.url, tabindex: props.focusable === false ? '-1' : undefined, ref: el => (props.lastItemRef !== undefined ? props.lastItemRef(el) : null) }, lastItem.text))));
3398
+ };
3399
+
3400
+ const postInternetBreadcrumbsCss = ".btn-default,.btn-secondary{border:2px solid var(--post-gray-60)}.btn-default:focus,.btn-secondary:focus,.btn-default:not(:disabled):hover,.btn-secondary:not(:disabled):hover,.pretend-hover.btn-default,.pretend-hover.btn-secondary{border-color:var(--post-contrast-color)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-default,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-secondary{border-color:var(--post-contrast-color)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-default:focus,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-secondary:focus,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-default:not(:disabled):hover,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-secondary:not(:disabled):hover,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .pretend-hover.btn-default,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .pretend-hover.btn-secondary{border-color:var(--post-gray-40)}.btn-default:disabled,.btn-secondary:disabled{border-color:var(--post-gray-40);color:var(--post-gray-60)}.btn-default:focus,.btn-secondary:focus,.btn-link:focus,.btn-tertiary:focus,.btn-default:not(:disabled):hover,.btn-secondary:not(:disabled):hover,.btn-link:not(:disabled):hover,.btn-tertiary:not(:disabled):hover,.pretend-hover.btn-default,.pretend-hover.btn-secondary,.pretend-hover.btn-link,.pretend-hover.btn-tertiary{color:var(--post-contrast-color)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-default .pi,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-secondary .pi,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-link .pi,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-tertiary .pi{-webkit-filter:invert(1);filter:invert(1)}.btn{min-height:3rem;font-size:1rem;gap:.625rem;outline:none;outline-offset:2px;display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;max-width:100%;overflow:hidden;-webkit-transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:2px;border-style:solid;border-radius:4px;background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;color:var(--post-gray-80);font-family:inherit;font-weight:400;text-decoration:none !important;white-space:nowrap}.btn:where(:not(.btn-link,.btn-tertiary)){padding:0 1rem}.btn>.pi,.btn>post-icon{width:1.25rem;height:1.25rem}.btn:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.btn-primary{border-color:rgba(0,0,0,0);background-color:var(--post-gray-80);color:var(--post-contrast-color-inverted)}.btn-primary:focus,.btn-primary:not(:disabled):hover,.btn-primary.pretend-hover{background-color:var(--post-contrast-color);color:var(--post-contrast-color-inverted)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-primary{background-color:var(--post-contrast-color);color:var(--post-gray-10)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-primary:focus,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-primary:not(:disabled):hover,:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-primary.pretend-hover{background-color:var(--post-gray-80)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-primary:disabled{color:var(--post-gray-80)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright) .btn-primary .pi{-webkit-filter:invert(0);filter:invert(0)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-primary{border-color:var(--post-contrast-color);background-color:ButtonFace}.btn-primary:not(:disabled,.disabled):hover,.btn-primary:not(:disabled,.disabled):focus-visible{border-color:highlight}.btn-primary .pi{-webkit-filter:invert(1) !important;filter:invert(1) !important}}.btn-primary:disabled{background-color:var(--post-gray-40)}.btn-primary .pi{-webkit-filter:invert(1);filter:invert(1);forced-color-adjust:none}.btn-link,.btn-tertiary{border:0;padding-inline:.25rem}.btn-link:disabled,.btn-tertiary:disabled{color:var(--post-gray-60)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-link,.btn-tertiary{color:linktext;text-decoration:underline !important}}.btn-icon{min-width:3rem;padding-right:.75rem;padding-left:.75rem}.btn-icon.btn-sm{min-width:2rem;padding-right:.375rem;padding-left:.375rem}.btn-icon.btn-rg{min-width:2.5rem;padding-right:.5625rem;padding-left:.5625rem}.btn-icon.btn-lg{min-width:3.5rem;padding-right:.9375rem;padding-left:.9375rem}.btn-animated:not(.btn-link,.btn-tertiary)::after{content:\"\";position:absolute;right:.5rem;width:.625em;height:.625em;-webkit-transform:rotateZ(315deg) translate(-2px, -2px);transform:rotateZ(315deg) translate(-2px, -2px);-webkit-transform-origin:center center;transform-origin:center center;-webkit-transition:opacity 250ms,-webkit-transform 250ms;transition:opacity 250ms,-webkit-transform 250ms;transition:opacity 250ms,transform 250ms;transition:opacity 250ms,transform 250ms,-webkit-transform 250ms;border-right:2px solid currentColor;border-bottom:2px solid currentColor;opacity:0}.btn-animated:not(.btn-link,.btn-tertiary).btn-sm::after{right:.25rem}.btn-animated:not(.btn-link,.btn-tertiary).btn-rg::after{right:.375rem}.btn-animated:not(.btn-link,.btn-tertiary).btn-lg::after{right:.625rem}.btn-animated:not(.btn-link,.btn-tertiary)>span{-webkit-transition:-webkit-transform 250ms;transition:-webkit-transform 250ms;transition:transform 250ms;transition:transform 250ms, -webkit-transform 250ms}@media (prefers-reduced-motion: no-preference){.btn-animated:not(.btn-link,.btn-tertiary):focus>span,.btn-animated:not(.btn-link,.btn-tertiary):not(:disabled):hover>span,.btn-animated:not(.btn-link,.btn-tertiary).pretend-hover>span{-webkit-transform:translateX(-0.5rem);transform:translateX(-0.5rem)}.btn-animated:not(.btn-link,.btn-tertiary):focus.btn-sm>span,.btn-animated:not(.btn-link,.btn-tertiary):not(:disabled):hover.btn-sm>span,.btn-animated:not(.btn-link,.btn-tertiary).pretend-hover.btn-sm>span{-webkit-transform:translateX(-0.5rem);transform:translateX(-0.5rem)}.btn-animated:not(.btn-link,.btn-tertiary):focus.btn-rg>span,.btn-animated:not(.btn-link,.btn-tertiary):not(:disabled):hover.btn-rg>span,.btn-animated:not(.btn-link,.btn-tertiary).pretend-hover.btn-rg>span{-webkit-transform:translateX(-0.5rem);transform:translateX(-0.5rem)}.btn-animated:not(.btn-link,.btn-tertiary):focus.btn-lg>span,.btn-animated:not(.btn-link,.btn-tertiary):not(:disabled):hover.btn-lg>span,.btn-animated:not(.btn-link,.btn-tertiary).pretend-hover.btn-lg>span{-webkit-transform:translateX(-0.5rem);transform:translateX(-0.5rem)}.btn-animated:not(.btn-link,.btn-tertiary):focus::after,.btn-animated:not(.btn-link,.btn-tertiary):not(:disabled):hover::after,.btn-animated:not(.btn-link,.btn-tertiary).pretend-hover::after{-webkit-transform:rotateZ(315deg) translate(0, 0);transform:rotateZ(315deg) translate(0, 0);opacity:1}.btn-animated:not(.btn-link,.btn-tertiary)>span{-webkit-transform:translateX(0);transform:translateX(0)}}.btn-sm{min-height:2rem;font-size:.75rem;gap:.375rem}.btn-sm:where(:not(.btn-link,.btn-tertiary)){padding:0 .75rem}.btn-sm>.pi,.btn-sm>post-icon{width:1rem;height:1rem}.btn-rg{min-height:2.5rem;font-size:.875rem;gap:.5rem}.btn-rg:where(:not(.btn-link,.btn-tertiary)){padding:0 .875rem}.btn-rg>.pi,.btn-rg>post-icon{width:1.125rem;height:1.125rem}.btn-lg{min-height:3.5rem;font-size:1.125rem;gap:.75rem}.btn-lg:where(:not(.btn-link,.btn-tertiary)){padding:0 1.125rem}.btn-lg>.pi,.btn-lg>post-icon{width:1.375rem;height:1.375rem}.btn-nightblue{border-color:rgba(0,0,0,0);background-color:#004976;color:#fff}.btn-nightblue:focus,.btn-nightblue:not(:disabled):hover,.btn-nightblue.pretend-hover{background-color:#002943;color:#fff}.btn-nightblue-bright{border-color:rgba(0,0,0,0);background-color:#0076a8;color:#fff}.btn-nightblue-bright:focus,.btn-nightblue-bright:not(:disabled):hover,.btn-nightblue-bright.pretend-hover{background-color:#005275;color:#fff}.btn-petrol{border-color:rgba(0,0,0,0);background-color:#006d68;color:#fff}.btn-petrol:focus,.btn-petrol:not(:disabled):hover,.btn-petrol.pretend-hover{background-color:#003a37;color:#fff}.btn-petrol-bright{border-color:rgba(0,0,0,0);background-color:#00968f;color:#000}.btn-petrol-bright:focus,.btn-petrol-bright:not(:disabled):hover,.btn-petrol-bright.pretend-hover{background-color:#00635e;color:#fff}.btn-coral{border-color:rgba(0,0,0,0);background-color:#9e2a2f;color:#fff}.btn-coral:focus,.btn-coral:not(:disabled):hover,.btn-coral.pretend-hover{background-color:#761f23;color:#fff}.btn-coral-bright{border-color:rgba(0,0,0,0);background-color:#e03c31;color:#000}.btn-coral-bright:focus,.btn-coral-bright:not(:disabled):hover,.btn-coral-bright.pretend-hover{background-color:#c1271d;color:#fff}.btn-olive{border-color:rgba(0,0,0,0);background-color:#716135;color:#fff}.btn-olive:focus,.btn-olive:not(:disabled):hover,.btn-olive.pretend-hover{background-color:#4e4325;color:#fff}.btn-olive-bright{border-color:rgba(0,0,0,0);background-color:#aa9d2e;color:#000}.btn-olive-bright:focus,.btn-olive-bright:not(:disabled):hover,.btn-olive-bright.pretend-hover{background-color:#827823;color:#000}.btn-purple{border-color:rgba(0,0,0,0);background-color:#80276c;color:#fff}.btn-purple:focus,.btn-purple:not(:disabled):hover,.btn-purple.pretend-hover{background-color:#591b4b;color:#fff}.btn-purple-bright{border-color:rgba(0,0,0,0);background-color:#c5299b;color:#fff}.btn-purple-bright:focus,.btn-purple-bright:not(:disabled):hover,.btn-purple-bright.pretend-hover{background-color:#9b207a;color:#fff}.btn-aubergine{border-color:rgba(0,0,0,0);background-color:#523178;color:#fff}.btn-aubergine:focus,.btn-aubergine:not(:disabled):hover,.btn-aubergine.pretend-hover{background-color:#392254;color:#fff}.btn-aubergine-bright{border-color:rgba(0,0,0,0);background-color:#7566a0;color:#fff}.btn-aubergine-bright:focus,.btn-aubergine-bright:not(:disabled):hover,.btn-aubergine-bright.pretend-hover{background-color:#5e5182;color:#fff}.btn-success{border-color:rgba(0,0,0,0);background-color:#2c911c;color:#000}.btn-success:focus,.btn-success:not(:disabled):hover,.btn-success.pretend-hover{background-color:#1f6614;color:#fff}.btn-info{border-color:rgba(0,0,0,0);background-color:#cce4ee;color:#000}.btn-info:focus,.btn-info:not(:disabled):hover,.btn-info.pretend-hover{background-color:#a6d0e1;color:#000}.btn-warning{border-color:rgba(0,0,0,0);background-color:#f49e00;color:#000}.btn-warning:focus,.btn-warning:not(:disabled):hover,.btn-warning.pretend-hover{background-color:#c17d00;color:#000}.btn-danger{border-color:rgba(0,0,0,0);background-color:#a51728;color:#fff}.btn-danger:focus,.btn-danger:not(:disabled):hover,.btn-danger.pretend-hover{background-color:#78111d;color:#fff}/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */:root{--bs-breakpoint-xs:0;--bs-breakpoint-sm:400px;--bs-breakpoint-rg:600px;--bs-breakpoint-md:780px;--bs-breakpoint-lg:1024px;--bs-breakpoint-xl:1280px;--bs-breakpoint-xxl:1441px}.row{--bs-gutter-x:30px;--bs-gutter-y:0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(-1*var(--bs-gutter-y));margin-right:calc(-0.5*var(--bs-gutter-x));margin-left:calc(-0.5*var(--bs-gutter-x))}.row>*{-ms-flex-negative:0;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x)*.5);padding-left:calc(var(--bs-gutter-x)*.5);margin-top:var(--bs-gutter-y)}.col{-ms-flex:1 0 0%;flex:1 0 0%}.row-cols-auto>*{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.row-cols-1>*{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.row-cols-2>*{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.row-cols-3>*{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.row-cols-4>*{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.row-cols-5>*{-ms-flex:0 0 auto;flex:0 0 auto;width:20%}.row-cols-6>*{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.33333333%}.col-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.col-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.col-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.66666667%}.col-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.col-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.33333333%}.col-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.66666667%}.col-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.col-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.33333333%}.col-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.66666667%}.col-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}.g-0,.gx-0{--bs-gutter-x:0}.g-0,.gy-0{--bs-gutter-y:0}.g-1,.gx-1{--bs-gutter-x:0.25rem}.g-1,.gy-1{--bs-gutter-y:0.25rem}.g-2,.gx-2{--bs-gutter-x:0.5rem}.g-2,.gy-2{--bs-gutter-y:0.5rem}.g-3,.gx-3{--bs-gutter-x:1rem}.g-3,.gy-3{--bs-gutter-y:1rem}.g-4,.gx-4{--bs-gutter-x:1.5rem}.g-4,.gy-4{--bs-gutter-y:1.5rem}.g-5,.gx-5{--bs-gutter-x:3rem}.g-5,.gy-5{--bs-gutter-y:3rem}@media (min-width: 400px){.col-sm{-ms-flex:1 0 0%;flex:1 0 0%}.row-cols-sm-auto>*{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.row-cols-sm-1>*{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.row-cols-sm-2>*{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.row-cols-sm-3>*{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.row-cols-sm-4>*{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.row-cols-sm-5>*{-ms-flex:0 0 auto;flex:0 0 auto;width:20%}.row-cols-sm-6>*{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.33333333%}.col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.66666667%}.col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.33333333%}.col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.66666667%}.col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.33333333%}.col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.66666667%}.col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x:0}.g-sm-0,.gy-sm-0{--bs-gutter-y:0}.g-sm-1,.gx-sm-1{--bs-gutter-x:0.25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y:0.25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x:0.5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y:0.5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x:1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y:1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x:1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y:1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x:3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y:3rem}}@media (min-width: 600px){.col-rg{-ms-flex:1 0 0%;flex:1 0 0%}.row-cols-rg-auto>*{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.row-cols-rg-1>*{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.row-cols-rg-2>*{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.row-cols-rg-3>*{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.row-cols-rg-4>*{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.row-cols-rg-5>*{-ms-flex:0 0 auto;flex:0 0 auto;width:20%}.row-cols-rg-6>*{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-rg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-rg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.33333333%}.col-rg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-rg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.col-rg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.col-rg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.66666667%}.col-rg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.col-rg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.33333333%}.col-rg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.66666667%}.col-rg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.col-rg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.33333333%}.col-rg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.66666667%}.col-rg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.offset-rg-0{margin-left:0}.offset-rg-1{margin-left:8.33333333%}.offset-rg-2{margin-left:16.66666667%}.offset-rg-3{margin-left:25%}.offset-rg-4{margin-left:33.33333333%}.offset-rg-5{margin-left:41.66666667%}.offset-rg-6{margin-left:50%}.offset-rg-7{margin-left:58.33333333%}.offset-rg-8{margin-left:66.66666667%}.offset-rg-9{margin-left:75%}.offset-rg-10{margin-left:83.33333333%}.offset-rg-11{margin-left:91.66666667%}.g-rg-0,.gx-rg-0{--bs-gutter-x:0}.g-rg-0,.gy-rg-0{--bs-gutter-y:0}.g-rg-1,.gx-rg-1{--bs-gutter-x:0.25rem}.g-rg-1,.gy-rg-1{--bs-gutter-y:0.25rem}.g-rg-2,.gx-rg-2{--bs-gutter-x:0.5rem}.g-rg-2,.gy-rg-2{--bs-gutter-y:0.5rem}.g-rg-3,.gx-rg-3{--bs-gutter-x:1rem}.g-rg-3,.gy-rg-3{--bs-gutter-y:1rem}.g-rg-4,.gx-rg-4{--bs-gutter-x:1.5rem}.g-rg-4,.gy-rg-4{--bs-gutter-y:1.5rem}.g-rg-5,.gx-rg-5{--bs-gutter-x:3rem}.g-rg-5,.gy-rg-5{--bs-gutter-y:3rem}}@media (min-width: 780px){.col-md{-ms-flex:1 0 0%;flex:1 0 0%}.row-cols-md-auto>*{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.row-cols-md-1>*{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.row-cols-md-2>*{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.row-cols-md-3>*{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.row-cols-md-4>*{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.row-cols-md-5>*{-ms-flex:0 0 auto;flex:0 0 auto;width:20%}.row-cols-md-6>*{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.33333333%}.col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.66666667%}.col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.33333333%}.col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.66666667%}.col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.33333333%}.col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.66666667%}.col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}.g-md-0,.gx-md-0{--bs-gutter-x:0}.g-md-0,.gy-md-0{--bs-gutter-y:0}.g-md-1,.gx-md-1{--bs-gutter-x:0.25rem}.g-md-1,.gy-md-1{--bs-gutter-y:0.25rem}.g-md-2,.gx-md-2{--bs-gutter-x:0.5rem}.g-md-2,.gy-md-2{--bs-gutter-y:0.5rem}.g-md-3,.gx-md-3{--bs-gutter-x:1rem}.g-md-3,.gy-md-3{--bs-gutter-y:1rem}.g-md-4,.gx-md-4{--bs-gutter-x:1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y:1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x:3rem}.g-md-5,.gy-md-5{--bs-gutter-y:3rem}}@media (min-width: 1024px){.col-lg{-ms-flex:1 0 0%;flex:1 0 0%}.row-cols-lg-auto>*{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.row-cols-lg-1>*{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.row-cols-lg-2>*{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.row-cols-lg-3>*{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.row-cols-lg-4>*{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.row-cols-lg-5>*{-ms-flex:0 0 auto;flex:0 0 auto;width:20%}.row-cols-lg-6>*{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.33333333%}.col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.66666667%}.col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.33333333%}.col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.66666667%}.col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.33333333%}.col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.66666667%}.col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x:0}.g-lg-0,.gy-lg-0{--bs-gutter-y:0}.g-lg-1,.gx-lg-1{--bs-gutter-x:0.25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y:0.25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x:0.5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y:0.5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x:1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y:1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x:1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y:1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x:3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y:3rem}}@media (min-width: 1280px){.col-xl{-ms-flex:1 0 0%;flex:1 0 0%}.row-cols-xl-auto>*{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.row-cols-xl-1>*{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.row-cols-xl-2>*{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.row-cols-xl-3>*{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.row-cols-xl-4>*{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.row-cols-xl-5>*{-ms-flex:0 0 auto;flex:0 0 auto;width:20%}.row-cols-xl-6>*{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.33333333%}.col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.66666667%}.col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.33333333%}.col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.66666667%}.col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.33333333%}.col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.66666667%}.col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x:0}.g-xl-0,.gy-xl-0{--bs-gutter-y:0}.g-xl-1,.gx-xl-1{--bs-gutter-x:0.25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y:0.25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x:0.5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y:0.5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x:1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y:1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x:1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y:1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x:3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y:3rem}}@media (min-width: 1441px){.col-xxl{-ms-flex:1 0 0%;flex:1 0 0%}.row-cols-xxl-auto>*{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.row-cols-xxl-1>*{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.row-cols-xxl-2>*{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.row-cols-xxl-3>*{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.row-cols-xxl-4>*{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.row-cols-xxl-5>*{-ms-flex:0 0 auto;flex:0 0 auto;width:20%}.row-cols-xxl-6>*{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-xxl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-xxl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.33333333%}.col-xxl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.66666667%}.col-xxl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.col-xxl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.33333333%}.col-xxl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.66666667%}.col-xxl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.col-xxl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.33333333%}.col-xxl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.66666667%}.col-xxl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.col-xxl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.33333333%}.col-xxl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.66666667%}.col-xxl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.33333333%}.offset-xxl-2{margin-left:16.66666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.33333333%}.offset-xxl-5{margin-left:41.66666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.33333333%}.offset-xxl-8{margin-left:66.66666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.33333333%}.offset-xxl-11{margin-left:91.66666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x:0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y:0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x:0.25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y:0.25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x:0.5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y:0.5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x:1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y:1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x:1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y:1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x:3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y:3rem}}.container,.container-fluid,.container-xxl,.container-xl{--bs-gutter-x:30px;--bs-gutter-y:0;width:100%;padding-right:calc(var(--bs-gutter-x)*.5);padding-left:calc(var(--bs-gutter-x)*.5);margin-right:auto;margin-left:auto}@media (min-width: 1280px){.container-xl,.container-lg,.container-md,.container-rg,.container-sm,.container{max-width:1280px}}@media (min-width: 1441px){.container-xxl,.container-xl,.container-lg,.container-md,.container-rg,.container-sm,.container{max-width:1440px}}.container{padding-inline:var(--post-container-padding-x)}.container-fluid{padding-inline:var(--post-container-fluid-padding-x)}.container{--post-container-padding-x:12px}.container-fluid{--post-container-fluid-padding-x:12px}.row{--bs-gutter-x:12px}@media (min-width: 400px){.container{--post-container-padding-x:16px}}@media (min-width: 400px){.container-fluid{--post-container-fluid-padding-x:16px}}@media (min-width: 400px){.row{--bs-gutter-x:16px}}@media (min-width: 780px){.container{--post-container-padding-x:32px}}@media (min-width: 780px){.container-fluid{--post-container-fluid-padding-x:32px}}@media (min-width: 1280px){.container{--post-container-padding-x:40px}}@media (min-width: 1441px){.container{--post-container-padding-x:120px}}.g-0,.gx-0{--bs-gutter-x:0}.g-1,.gx-1{--bs-gutter-x:0.25rem}.g-2,.gx-2{--bs-gutter-x:0.5rem}.g-3,.gx-3{--bs-gutter-x:1rem}.g-4,.gx-4{--bs-gutter-x:1.5rem}.g-5,.gx-5{--bs-gutter-x:3rem}@media (min-width: 400px){.g-sm-0,.gx-sm-0{--bs-gutter-x:0}}@media (min-width: 400px){.g-sm-1,.gx-sm-1{--bs-gutter-x:0.25rem}}@media (min-width: 400px){.g-sm-2,.gx-sm-2{--bs-gutter-x:0.5rem}}@media (min-width: 400px){.g-sm-3,.gx-sm-3{--bs-gutter-x:1rem}}@media (min-width: 400px){.g-sm-4,.gx-sm-4{--bs-gutter-x:1.5rem}}@media (min-width: 400px){.g-sm-5,.gx-sm-5{--bs-gutter-x:3rem}}@media (min-width: 600px){.g-rg-0,.gx-rg-0{--bs-gutter-x:0}}@media (min-width: 600px){.g-rg-1,.gx-rg-1{--bs-gutter-x:0.25rem}}@media (min-width: 600px){.g-rg-2,.gx-rg-2{--bs-gutter-x:0.5rem}}@media (min-width: 600px){.g-rg-3,.gx-rg-3{--bs-gutter-x:1rem}}@media (min-width: 600px){.g-rg-4,.gx-rg-4{--bs-gutter-x:1.5rem}}@media (min-width: 600px){.g-rg-5,.gx-rg-5{--bs-gutter-x:3rem}}@media (min-width: 780px){.g-md-0,.gx-md-0{--bs-gutter-x:0}}@media (min-width: 780px){.g-md-1,.gx-md-1{--bs-gutter-x:0.25rem}}@media (min-width: 780px){.g-md-2,.gx-md-2{--bs-gutter-x:0.5rem}}@media (min-width: 780px){.g-md-3,.gx-md-3{--bs-gutter-x:1rem}}@media (min-width: 780px){.g-md-4,.gx-md-4{--bs-gutter-x:1.5rem}}@media (min-width: 780px){.g-md-5,.gx-md-5{--bs-gutter-x:3rem}}@media (min-width: 1024px){.g-lg-0,.gx-lg-0{--bs-gutter-x:0}}@media (min-width: 1024px){.g-lg-1,.gx-lg-1{--bs-gutter-x:0.25rem}}@media (min-width: 1024px){.g-lg-2,.gx-lg-2{--bs-gutter-x:0.5rem}}@media (min-width: 1024px){.g-lg-3,.gx-lg-3{--bs-gutter-x:1rem}}@media (min-width: 1024px){.g-lg-4,.gx-lg-4{--bs-gutter-x:1.5rem}}@media (min-width: 1024px){.g-lg-5,.gx-lg-5{--bs-gutter-x:3rem}}@media (min-width: 1280px){.g-xl-0,.gx-xl-0{--bs-gutter-x:0}}@media (min-width: 1280px){.g-xl-1,.gx-xl-1{--bs-gutter-x:0.25rem}}@media (min-width: 1280px){.g-xl-2,.gx-xl-2{--bs-gutter-x:0.5rem}}@media (min-width: 1280px){.g-xl-3,.gx-xl-3{--bs-gutter-x:1rem}}@media (min-width: 1280px){.g-xl-4,.gx-xl-4{--bs-gutter-x:1.5rem}}@media (min-width: 1280px){.g-xl-5,.gx-xl-5{--bs-gutter-x:3rem}}@media (min-width: 1441px){.g-xxl-0,.gx-xxl-0{--bs-gutter-x:0}}@media (min-width: 1441px){.g-xxl-1,.gx-xxl-1{--bs-gutter-x:0.25rem}}@media (min-width: 1441px){.g-xxl-2,.gx-xxl-2{--bs-gutter-x:0.5rem}}@media (min-width: 1441px){.g-xxl-3,.gx-xxl-3{--bs-gutter-x:1rem}}@media (min-width: 1441px){.g-xxl-4,.gx-xxl-4{--bs-gutter-x:1.5rem}}@media (min-width: 1441px){.g-xxl-5,.gx-xxl-5{--bs-gutter-x:3rem}}.vertical-gutters{margin-bottom:-30px}.vertical-gutters>.col,.vertical-gutters>[class*=col-]{padding-bottom:30px}.row.border-gutters{margin-right:-1px;margin-bottom:-1px;margin-left:0}.row.border-gutters>.col,.row.border-gutters>[class*=col-]{padding-right:1px;padding-bottom:1px;padding-left:0}.container-reset{margin-right:-12px;margin-left:-12px}.container-reset-left{margin-left:-12px}.container-reset-right{margin-right:-12px}@media (max-width: 399.98px){.container-fluid-xs{padding-right:1rem;padding-left:1rem}}@media (min-width: 400px){.container-reset{margin-right:-16px;margin-left:-16px}}@media (min-width: 400px){.container-reset-left{margin-left:-16px}}@media (min-width: 400px){.container-reset-right{margin-right:-16px}}@media (min-width: 400px)and (max-width: 599.98px){.container-fluid-sm{padding-right:1rem;padding-left:1rem}}@media (min-width: 600px)and (max-width: 779.98px){.container-fluid-rg{padding-right:1rem;padding-left:1rem}}@media (min-width: 780px){.container-reset{margin-right:-32px;margin-left:-32px}}@media (min-width: 780px){.container-reset-left{margin-left:-32px}}@media (min-width: 780px){.container-reset-right{margin-right:-32px}}@media (min-width: 780px)and (max-width: 1023.98px){.container-fluid-md{padding-right:1rem;padding-left:1rem}}@media (min-width: 1024px)and (max-width: 1279.98px){.container-fluid-lg{padding-right:1rem;padding-left:1rem}}@media (min-width: 1280px){.container-reset{margin-right:-40px;margin-left:-40px}}@media (min-width: 1280px){.container-reset-left{margin-left:-40px}}@media (min-width: 1280px){.container-reset-right{margin-right:-40px}}@media (min-width: 1280px)and (max-width: 1440.98px){.container-fluid-xl{padding-right:1rem;padding-left:1rem}}@media (min-width: 1441px){.container-reset{margin-right:-120px;margin-left:-120px}}@media (min-width: 1441px){.container-reset-left{margin-left:-120px}}@media (min-width: 1441px){.container-reset-right{margin-right:-120px}}@media (min-width: 1441px){.container-fluid-xxl{padding-right:1rem;padding-left:1rem}}@-webkit-keyframes progress-bar-stripes{0%{background-position-x:1rem}}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress,.progress-stacked{--bs-progress-height:1rem;--bs-progress-font-size:0.75rem;--bs-progress-bg:hsl(0, 0%, 80%);--bs-progress-border-radius:4px;--bs-progress-box-shadow:inset 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1);--bs-progress-bar-color:#fff;--bs-progress-bar-bg:hsl(0, 0%, 20%);--bs-progress-bar-transition:width 0.6s ease;display:-ms-flexbox;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);-webkit-transition:var(--bs-progress-bar-transition);transition:var(--bs-progress-bar-transition)}@media (prefers-reduced-motion: reduce){.progress-bar{-webkit-transition:none;transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}.progress-stacked>.progress{overflow:visible}.progress-stacked>.progress>.progress-bar{width:100%}.progress-bar-animated{-webkit-animation:1s linear infinite progress-bar-stripes;animation:1s linear infinite progress-bar-stripes}@media (prefers-reduced-motion: reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-bg{position:absolute;z-index:990;top:0;left:0;width:100%;height:100%}.loading-modal{display:-ms-inline-flexbox;display:inline-flex;position:absolute;z-index:990;top:0;right:0;bottom:0;left:0}.loader{width:3.5rem;height:3.5rem;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;border:6px solid #fc0;border-radius:50%;border-right-color:rgba(0,0,0,0);border-bottom-color:#e6e6e6}.loader.loader-sm{width:2rem;height:2rem;border-width:.25rem}.loader.loader-xs{width:.75rem;height:.75rem;border-width:2px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.loader{border-color:Highlight;border-bottom-color:CanvasText;border-right-color:Canvas}@supports (forced-color-adjust: none){.loader{forced-color-adjust:none;border-right-color:rgba(0,0,0,0)}}}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:700;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:700;font-style:italic;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:400;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:400;font-style:italic;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:300;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:300;font-style:italic;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff\") format(\"woff\")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:rgba(0,0,0,0);border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0,0,0,.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:#000}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:\"Frutiger Neue For Post\",system-ui,sans-serif}button{font:inherit;padding:0}a,button{border-radius:4px;outline:none;outline-offset:2px}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:4px}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active){svg{color:#fff}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px)and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1440.98px){.hidden-xxl{display:none}}:host{display:block;position:relative}.breadcrumbs{font-size:1rem;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;gap:1rem;min-height:3rem}@media (max-width: 599.98px){.breadcrumbs{font-size:.875rem}}.breadcrumbs-nav{white-space:nowrap;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;min-width:0}.breadcrumbs-list,.nav-link{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.breadcrumbs-list li{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}.breadcrumbs-list li:last-child{-ms-flex-negative:2;flex-shrink:2;min-width:0;overflow:hidden;text-overflow:ellipsis;padding:4px}.breadcrumbs-list svg{margin-left:0 !important;width:1.5em;height:1.5em;color:rgba(0,0,0,.6)}.breadcrumb-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;gap:1rem;-ms-flex-negative:0;flex-shrink:0}.breadcrumb-buttons .btn{cursor:pointer;gap:.5rem;font-size:inherit}.breadcrumb-buttons .btn.btn-secondary>svg{width:1.5rem;height:1.5rem;margin:0}@media (min-width: 1024px){.breadcrumb-buttons .btn span{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible}}.nav-link{gap:0;color:rgba(0,0,0,.6);font-weight:400}.middle-dropdown-container{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.middle-dropdown{position:absolute;top:100%;left:0;background:#fff;border:1px solid #e6e6e6;padding:.5rem 0;z-index:1}.middle-dropdown .nav-link{padding:.5rem 1rem;-webkit-transition:color 200ms;transition:color 200ms}.middle-dropdown .nav-link:hover{background-color:#e6e6e6}.middle-dropdown-button{cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.25rem;width:1.5em;height:1.5em;min-height:0;font-size:inherit;color:inherit}.middle-dropdown-button span{margin:0}.middle-dropdown-button svg{margin:0;-ms-flex-negative:0;flex-shrink:0;width:1.4em;height:1.4em}.overlay{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.6);z-index:calc(var(--header-z-index, 10) + 1);opacity:0;visibility:hidden;-webkit-transition:opacity 500ms,visibility 0s 500ms;transition:opacity 500ms,visibility 0s 500ms}.overlay.open{visibility:visible;opacity:1;-webkit-transition:opacity 500ms,visibility 0s 0s;transition:opacity 500ms,visibility 0s 0s}.overlay-container{position:relative;background:#fff;-webkit-box-shadow:0 0 40px rgba(0,0,0,.6);box-shadow:0 0 40px rgba(0,0,0,.6);visibility:hidden;-webkit-transform:translateY(3rem);transform:translateY(3rem);opacity:0;-webkit-transition:opacity 500ms,-webkit-transform 500ms;transition:opacity 500ms,-webkit-transform 500ms;transition:transform 500ms,opacity 500ms;transition:transform 500ms,opacity 500ms,-webkit-transform 500ms}iframe{display:block;width:1px;min-width:100%;overflow:auto;max-height:80vh}.overlay-close{position:absolute;top:1rem;right:1rem;cursor:pointer;padding:.5rem;color:rgba(0,0,0,.8)}.overlay-close:hover,.overlay-close:focus{color:#000}.overlay-close.phone{color:#fff}.overlay-close.phone:hover,.overlay-close.phone:focus{color:rgba(255,255,255,.8)}@media (min-width: 600px){.overlay-close span{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible}}.loader-wrapper{position:absolute;display:grid;place-items:center;width:100%;height:100%;top:0;left:0}.loaded~.loader-wrapper{display:none}.hidden-control-breadcrumbs{position:absolute;top:100%;width:0;overflow:hidden;display:-ms-flexbox;display:flex;pointer-events:none}.hidden-control-breadcrumbs .breadcrumbs-nav{-ms-flex-negative:0;flex-shrink:0}.hidden-control-breadcrumbs .breadcrumbs-list li{-ms-flex-negative:0;flex-shrink:0}";
3401
+
3402
+ const PostInternetBreadcrumbs = class {
3403
+ constructor(hostRef) {
3404
+ index.registerInstance(this, hostRef);
3405
+ this.customItems = undefined;
3406
+ this.hideButtons = false;
3407
+ this.customBreadcrumbItems = undefined;
3408
+ this.overlayVisible = undefined;
3409
+ this.isConcatenated = undefined;
3410
+ this.dropdownOpen = false;
3411
+ this.refsReady = false;
3412
+ }
3413
+ /**
3414
+ * Toggle an overlay associated with a button.
3415
+ * @param {IBreadcrumbOverlay['id']} overlayId
3416
+ */
3417
+ async toggleOverlayById(overlayId) {
3418
+ var _a, _b;
3419
+ const buttons = (_a = store.state.localizedConfig) === null || _a === void 0 ? void 0 : _a.breadcrumb.buttons;
3420
+ const overlay = (_b = buttons === null || buttons === void 0 ? void 0 : buttons.find(button => button.overlay.id === overlayId)) === null || _b === void 0 ? void 0 : _b.overlay;
3421
+ if (!overlay) {
3422
+ console.warn(`Internet Header: Failed to toggle overlay with id #${overlayId} as it was not found in the breadcrumb buttons config.`);
3423
+ return;
3424
+ }
3425
+ this.toggleOverlay(overlay);
3426
+ }
3427
+ connectedCallback() {
3428
+ this.debouncedResize = index$1.debounce(200, this.handleResize.bind(this));
3429
+ window.addEventListener('resize', this.debouncedResize, { passive: true });
3430
+ }
3431
+ disconnectedCallback() {
3432
+ window.removeEventListener('resize', this.debouncedResize);
3433
+ window.removeEventListener('click', this.handleWindowClick);
3434
+ bodyScrollLock_esm.clearAllBodyScrollLocks();
3435
+ }
3436
+ async componentWillLoad() {
3437
+ // Wait for the config to arrive, then render the header
3438
+ try {
3439
+ this.customBreadcrumbItems =
3440
+ typeof this.customItems === 'string' ? JSON.parse(this.customItems) : this.customItems;
3441
+ }
3442
+ catch (error) {
3443
+ console.error(error);
3444
+ }
3445
+ }
3446
+ componentDidLoad() {
3447
+ // Initially check if breadcrumb items are concatenated
3448
+ window.requestAnimationFrame(() => {
3449
+ this.handleResize();
3450
+ });
3451
+ }
3452
+ handleCustomConfigChange(newValue) {
3453
+ try {
3454
+ this.customBreadcrumbItems = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
3455
+ }
3456
+ catch (error) {
3457
+ console.error(error);
3458
+ }
3459
+ }
3460
+ handleResize() {
3461
+ // Catch and exclude vertical resize events, e.g. scrolling in iPhone
3462
+ if (window.innerWidth === this.lastWindowWidth) {
3463
+ return;
3464
+ }
3465
+ this.lastWindowWidth = window.innerWidth;
3466
+ this.checkConcatenation();
3467
+ }
3468
+ checkConcatenation() {
3469
+ if (this.controlNavRef && this.visibleNavRef) {
3470
+ this.refsReady = true;
3471
+ // Delay the check
3472
+ window.requestAnimationFrame(() => {
3473
+ if (this.controlNavRef && this.visibleNavRef) {
3474
+ this.isConcatenated = this.controlNavRef.clientWidth > this.visibleNavRef.clientWidth;
3475
+ }
3476
+ });
3477
+ }
3478
+ }
3479
+ toggleOverlay(overlay, force) {
3480
+ var _a;
3481
+ const newVisibility = force !== null && force !== void 0 ? force : !this.overlayVisible;
3482
+ if (newVisibility) {
3483
+ // Will trigger overlayRef() once the HTML is rendered
3484
+ this.overlayVisible = newVisibility;
3485
+ this.currentOverlay = overlay;
3486
+ this.setBodyScroll(overlay);
3487
+ }
3488
+ else {
3489
+ const activeToggler = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.breadcrumb-buttons [aria-expanded="true"]');
3490
+ if (this.openAnimation && this.loadedAnimation) {
3491
+ this.openAnimation.reverse();
3492
+ this.loadedAnimation.reverse();
3493
+ // Delay hiding overlay until after the animation finishes
3494
+ Promise.all([this.openAnimation.finished, this.loadedAnimation.finished]).then(() => {
3495
+ if (activeToggler) {
3496
+ activeToggler.focus();
3497
+ }
3498
+ this.overlayVisible = newVisibility;
3499
+ this.setBodyScroll(overlay);
3500
+ });
3501
+ }
3502
+ }
3503
+ }
3504
+ /**
3505
+ * Disable or re-enable body scrolling, depending on whether overlay is visible or not
3506
+ */
3507
+ setBodyScroll(overlay) {
3508
+ if (this.overlayVisible) {
3509
+ // @ts-ignore
3510
+ bodyScrollLock_esm.disableBodyScroll(overlay, { reserveScrollBarGap: true });
3511
+ }
3512
+ else {
3513
+ // @ts-ignore
3514
+ bodyScrollLock_esm.enableBodyScroll(overlay);
3515
+ }
3516
+ }
3517
+ toggleDropdown(force) {
3518
+ this.dropdownOpen = force !== null && force !== void 0 ? force : !this.dropdownOpen;
3519
+ if (this.dropdownOpen) {
3520
+ requestAnimationFrame(() => {
3521
+ document.addEventListener('click', this.handleWindowClick.bind(this), { once: true });
3522
+ });
3523
+ }
3524
+ }
3525
+ handleWindowClick() {
3526
+ this.toggleDropdown(false);
3527
+ }
3528
+ registerIFrameResizer(iFrame) {
3529
+ if (!iFrame) {
3530
+ return;
3531
+ }
3532
+ iFrame.addEventListener('load', () => {
3533
+ var _a, _b, _c;
3534
+ iframeResizer.iframeResizer({
3535
+ heightCalculationMethod: 'taggedElement',
3536
+ scrolling: true,
3537
+ checkOrigin: false,
3538
+ }, iFrame);
3539
+ const duration = utils.prefersReducedMotion ? 0 : 300;
3540
+ this.loadedAnimation = (_a = iFrame.parentElement) === null || _a === void 0 ? void 0 : _a.animate([{ opacity: 1, visibility: 'visible', transform: 'translateY(0px)' }], { duration, fill: 'forwards' });
3541
+ (_b = iFrame.parentElement) === null || _b === void 0 ? void 0 : _b.classList.add('loaded');
3542
+ (_c = this.loadedAnimation) === null || _c === void 0 ? void 0 : _c.finished.then(() => {
3543
+ var _a;
3544
+ (_a = iFrame.parentElement) === null || _a === void 0 ? void 0 : _a.focus();
3545
+ });
3546
+ });
3547
+ }
3548
+ /**
3549
+ * Reference function for the overlay element got called. It is either null (overlay closed)
3550
+ * or contains the overlay element as parameter.
3551
+ * @param e Overlay element or null
3552
+ * @returns void
3553
+ */
3554
+ overlayRef(e) {
3555
+ if (!e) {
3556
+ return;
3557
+ }
3558
+ const duration = utils.prefersReducedMotion ? 0 : 500;
3559
+ this.openAnimation = e.animate([{ opacity: 1, visibility: 'visible' }], {
3560
+ duration,
3561
+ fill: 'forwards',
3562
+ });
3563
+ }
3564
+ handleKeyDown(event) {
3565
+ if (event.key.toLowerCase() === 'escape') {
3566
+ this.toggleOverlay(this.currentOverlay, false);
3567
+ }
3568
+ }
3569
+ handleToggleDropdown() {
3570
+ this.toggleDropdown();
3571
+ }
3572
+ handleToggleOverlay() {
3573
+ this.toggleOverlay(this.currentOverlay, false);
3574
+ }
3575
+ handleControlNavRef(element) {
3576
+ this.controlNavRef = element;
3577
+ this.checkConcatenation();
3578
+ }
3579
+ handleVisibleNavRef(element) {
3580
+ this.visibleNavRef = element;
3581
+ this.checkConcatenation();
3582
+ }
3583
+ render() {
3584
+ // There is something wrong entirely
3585
+ // eslint-disable-next-line @stencil-community/strict-boolean-conditions
3586
+ if (!store.state) {
3587
+ console.warn(`Internet Breadcrumbs: Could not load config. Please make sure that you included the <swisspost-internet-header></swisspost-internet-header> component.`);
3588
+ return null;
3589
+ }
3590
+ // Config is not loaded yet
3591
+ if (!store.state.localizedConfig) {
3592
+ return null;
3593
+ }
3594
+ // Config has loaded but there is no breadcrumbs config
3595
+ // eslint-disable-next-line @stencil-community/strict-boolean-conditions
3596
+ if (!store.state.localizedConfig.breadcrumb) {
3597
+ console.warn(`Internet Header: Current project "${store.state.projectId}" does not include a breadcrumb config. The breadcrumbs will not be rendered. Remove `, document.querySelector('swisspost-internet-breadcrumbs'), `from your markup or configure the breadcrumbs in your portal config to stop seeing this warning.`);
3598
+ return null;
3599
+ }
3600
+ const breadcrumbConfig = store.state.localizedConfig.breadcrumb;
3601
+ const items = this.customBreadcrumbItems !== undefined
3602
+ ? [...breadcrumbConfig.items, ...this.customBreadcrumbItems]
3603
+ : breadcrumbConfig.items;
3604
+ return (index.h(index.Host, null, index.h(svgSprite_component.SvgSprite, null), index.h("div", { class: "breadcrumbs" }, index.h("div", { class: "hidden-control-breadcrumbs", "aria-hidden": "true", tabindex: "-1" }, index.h("nav", { class: "breadcrumbs-nav", ref: e => e !== undefined && this.handleControlNavRef(e) }, index.h(BreadcrumbList, { items: items, focusable: false, clickHandler: () => { } }))), index.h("nav", { "aria-label": breadcrumbConfig.a11yLabel, ref: e => e !== undefined && this.handleVisibleNavRef(e), class: {
3605
+ 'breadcrumbs-nav': true,
3606
+ 'visually-hidden': !this.refsReady,
3607
+ } }, index.h(BreadcrumbList, { items: items, dropdownOpen: this.dropdownOpen, isConcatenated: this.isConcatenated, clickHandler: () => this.handleToggleDropdown() })), !this.hideButtons && (index.h("div", { class: "breadcrumb-buttons" }, breadcrumbConfig.buttons.map(button => (index.h("button", { class: "btn btn-secondary btn-icon", key: button.text, "aria-expanded": `${Boolean(this.overlayVisible && this.currentOverlay === button.overlay)}`, onClick: () => this.toggleOverlay(button.overlay, true) }, index.h(svgIcon_component.SvgIcon, { name: button.svgIcon.name }), index.h("span", { class: "visually-hidden" }, button.text)))))), this.overlayVisible && (index.h(OverlayComponent, { overlayRef: e => e !== undefined && this.overlayRef(e), iFrameRef: e => e !== undefined && this.registerIFrameResizer(e), overlay: this.currentOverlay, onClick: () => this.handleToggleOverlay(), onKeyDown: (e) => this.handleKeyDown(e), closeButtonText: store.state.localizedConfig.header.translations.closeButtonText }))), index.h("slot", null)));
3608
+ }
3609
+ get host() { return index.getElement(this); }
3610
+ static get watchers() { return {
3611
+ "customItems": ["handleCustomConfigChange"]
3612
+ }; }
3613
+ };
3614
+ PostInternetBreadcrumbs.style = postInternetBreadcrumbsCss;
3615
+
3616
+ exports.swisspost_internet_breadcrumbs = PostInternetBreadcrumbs;
19
3617
 
20
3618
  //# sourceMappingURL=swisspost-internet-breadcrumbs.cjs.entry.js.map