@nanoporetech-digital/components 3.8.0 → 3.8.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 (234) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/{algolia-data-f495daf4.js → algolia-data-fb13160a.js} +2 -2
  3. package/dist/cjs/{algolia-data-f495daf4.js.map → algolia-data-fb13160a.js.map} +1 -1
  4. package/dist/cjs/{component-store-d2fdaecf.js → component-store-b80bdb26.js} +2 -2
  5. package/dist/cjs/{component-store-d2fdaecf.js.map → component-store-b80bdb26.js.map} +1 -1
  6. package/dist/cjs/{form-control-c24fbff3.js → form-control-845951ac.js} +2 -2
  7. package/dist/cjs/{form-control-c24fbff3.js.map → form-control-845951ac.js.map} +1 -1
  8. package/dist/cjs/{index-361e5114.js → index-5e11be36.js} +2 -2
  9. package/dist/cjs/{index-361e5114.js.map → index-5e11be36.js.map} +1 -1
  10. package/dist/cjs/{index-5c437a69.js → index-e1b5c3ea.js} +9 -7
  11. package/dist/cjs/index-e1b5c3ea.js.map +1 -0
  12. package/dist/cjs/loader.cjs.js +2 -2
  13. package/dist/cjs/loader.cjs.js.map +1 -1
  14. package/dist/cjs/nano-accordion.cjs.entry.js +1 -1
  15. package/dist/cjs/nano-alert.cjs.entry.js +1 -1
  16. package/dist/cjs/nano-algolia-filter.cjs.entry.js +3 -3
  17. package/dist/cjs/nano-algolia-input.cjs.entry.js +3 -3
  18. package/dist/cjs/nano-algolia-pagination.cjs.entry.js +2 -2
  19. package/dist/cjs/nano-algolia-results.cjs.entry.js +2 -2
  20. package/dist/cjs/nano-algolia.cjs.entry.js +3 -3
  21. package/dist/cjs/nano-aspect-ratio.cjs.entry.js +1 -1
  22. package/dist/cjs/nano-checkbox-group.cjs.entry.js +1 -1
  23. package/dist/cjs/nano-checkbox.cjs.entry.js +1 -1
  24. package/dist/cjs/nano-components.cjs.js +2 -2
  25. package/dist/cjs/nano-components.cjs.js.map +1 -1
  26. package/dist/cjs/nano-datalist_3.cjs.entry.js +1 -1
  27. package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
  28. package/dist/cjs/nano-date-picker.cjs.entry.js +1 -1
  29. package/dist/cjs/nano-demo.cjs.entry.js +1 -1
  30. package/dist/cjs/nano-details.cjs.entry.js +1 -1
  31. package/dist/cjs/nano-dialog.cjs.entry.js +2 -2
  32. package/dist/cjs/nano-drawer.cjs.entry.js +1 -1
  33. package/dist/cjs/nano-dropdown.cjs.entry.js +1 -1
  34. package/dist/cjs/nano-field-validator.cjs.entry.js +2 -2
  35. package/dist/cjs/nano-file-upload.cjs.entry.js +1 -1
  36. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +2 -2
  37. package/dist/cjs/nano-global-nav.cjs.entry.js +2 -2
  38. package/dist/cjs/nano-global-search-results.cjs.entry.js +1 -1
  39. package/dist/cjs/nano-grid_3.cjs.entry.js +1 -1
  40. package/dist/cjs/nano-hero.cjs.entry.js +1 -1
  41. package/dist/cjs/nano-icon-button.cjs.entry.js +1 -1
  42. package/dist/cjs/nano-icon.cjs.entry.js +1 -1
  43. package/dist/cjs/nano-input.cjs.entry.js +2 -2
  44. package/dist/cjs/nano-menu-drawer.cjs.entry.js +1 -1
  45. package/dist/cjs/nano-progress-bar_2.cjs.entry.js +1 -1
  46. package/dist/cjs/nano-range.cjs.entry.js +1 -1
  47. package/dist/cjs/nano-rating.cjs.entry.js +1 -1
  48. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +1 -1
  49. package/dist/cjs/nano-slide.cjs.entry.js +1 -1
  50. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  51. package/dist/cjs/nano-spinner.cjs.entry.js +1 -1
  52. package/dist/cjs/nano-split-pane.cjs.entry.js +1 -1
  53. package/dist/cjs/nano-sticker.cjs.entry.js +1 -1
  54. package/dist/cjs/nano-tab-content.cjs.entry.js +1 -1
  55. package/dist/cjs/nano-tab-group.cjs.entry.js +2 -2
  56. package/dist/cjs/nano-tab.cjs.entry.js +1 -1
  57. package/dist/cjs/{nano-table-860b9714.js → nano-table-e76a8dde.js} +4 -4
  58. package/dist/cjs/{nano-table-860b9714.js.map → nano-table-e76a8dde.js.map} +1 -1
  59. package/dist/cjs/nano-table.cjs.entry.js +3 -3
  60. package/dist/cjs/{table.worker-88f2cb15.js → table.worker-988d87da.js} +4 -4
  61. package/dist/cjs/table.worker-988d87da.js.map +1 -0
  62. package/dist/collection/collection-manifest.json +1 -1
  63. package/dist/esm/{algolia-data-213ed40c.js → algolia-data-c4ed188c.js} +2 -2
  64. package/dist/esm/{algolia-data-213ed40c.js.map → algolia-data-c4ed188c.js.map} +1 -1
  65. package/dist/esm/{component-store-df8af0e6.js → component-store-6eccd724.js} +2 -2
  66. package/dist/esm/{component-store-df8af0e6.js.map → component-store-6eccd724.js.map} +1 -1
  67. package/dist/esm/{form-control-445de741.js → form-control-3284c2c9.js} +2 -2
  68. package/dist/esm/{form-control-445de741.js.map → form-control-3284c2c9.js.map} +1 -1
  69. package/dist/esm/{index-d1b02919.js → index-38484737.js} +2 -2
  70. package/dist/esm/{index-d1b02919.js.map → index-38484737.js.map} +1 -1
  71. package/dist/esm/{index-44c85cc8.js → index-b4e277ad.js} +9 -7
  72. package/dist/esm/index-b4e277ad.js.map +1 -0
  73. package/dist/esm/loader.js +3 -3
  74. package/dist/esm/loader.js.map +1 -1
  75. package/dist/esm/nano-accordion.entry.js +1 -1
  76. package/dist/esm/nano-alert.entry.js +1 -1
  77. package/dist/esm/nano-algolia-filter.entry.js +3 -3
  78. package/dist/esm/nano-algolia-input.entry.js +3 -3
  79. package/dist/esm/nano-algolia-pagination.entry.js +2 -2
  80. package/dist/esm/nano-algolia-results.entry.js +2 -2
  81. package/dist/esm/nano-algolia.entry.js +3 -3
  82. package/dist/esm/nano-aspect-ratio.entry.js +1 -1
  83. package/dist/esm/nano-checkbox-group.entry.js +1 -1
  84. package/dist/esm/nano-checkbox.entry.js +1 -1
  85. package/dist/esm/nano-components.js +3 -3
  86. package/dist/esm/nano-components.js.map +1 -1
  87. package/dist/esm/nano-datalist_3.entry.js +1 -1
  88. package/dist/esm/nano-date-input.entry.js +1 -1
  89. package/dist/esm/nano-date-picker.entry.js +1 -1
  90. package/dist/esm/nano-demo.entry.js +1 -1
  91. package/dist/esm/nano-details.entry.js +1 -1
  92. package/dist/esm/nano-dialog.entry.js +2 -2
  93. package/dist/esm/nano-drawer.entry.js +1 -1
  94. package/dist/esm/nano-dropdown.entry.js +1 -1
  95. package/dist/esm/nano-field-validator.entry.js +2 -2
  96. package/dist/esm/nano-file-upload.entry.js +1 -1
  97. package/dist/esm/nano-global-nav-user-profile_3.entry.js +2 -2
  98. package/dist/esm/nano-global-nav.entry.js +2 -2
  99. package/dist/esm/nano-global-search-results.entry.js +1 -1
  100. package/dist/esm/nano-grid_3.entry.js +1 -1
  101. package/dist/esm/nano-hero.entry.js +1 -1
  102. package/dist/esm/nano-icon-button.entry.js +1 -1
  103. package/dist/esm/nano-icon.entry.js +1 -1
  104. package/dist/esm/nano-input.entry.js +2 -2
  105. package/dist/esm/nano-menu-drawer.entry.js +1 -1
  106. package/dist/esm/nano-progress-bar_2.entry.js +1 -1
  107. package/dist/esm/nano-range.entry.js +1 -1
  108. package/dist/esm/nano-rating.entry.js +1 -1
  109. package/dist/esm/nano-resize-observe_2.entry.js +1 -1
  110. package/dist/esm/nano-slide.entry.js +1 -1
  111. package/dist/esm/nano-slides.entry.js +1 -1
  112. package/dist/esm/nano-spinner.entry.js +1 -1
  113. package/dist/esm/nano-split-pane.entry.js +1 -1
  114. package/dist/esm/nano-sticker.entry.js +1 -1
  115. package/dist/esm/nano-tab-content.entry.js +1 -1
  116. package/dist/esm/nano-tab-group.entry.js +2 -2
  117. package/dist/esm/nano-tab.entry.js +1 -1
  118. package/dist/esm/{nano-table-331a0cad.js → nano-table-5ff91f0f.js} +4 -4
  119. package/dist/esm/{nano-table-331a0cad.js.map → nano-table-5ff91f0f.js.map} +1 -1
  120. package/dist/esm/nano-table.entry.js +3 -3
  121. package/dist/esm/{table.worker-682e581f.js → table.worker-5c1bb1ce.js} +4 -4
  122. package/dist/esm/table.worker-5c1bb1ce.js.map +1 -0
  123. package/dist/nano-components/nano-components.esm.js +1 -1
  124. package/dist/nano-components/nano-components.esm.js.map +1 -1
  125. package/dist/nano-components/{p-362d6a04.entry.js → p-0411f019.entry.js} +2 -2
  126. package/dist/nano-components/{p-362d6a04.entry.js.map → p-0411f019.entry.js.map} +0 -0
  127. package/dist/nano-components/{p-dc785fb7.entry.js → p-13b2d70c.entry.js} +2 -2
  128. package/dist/nano-components/{p-dc785fb7.entry.js.map → p-13b2d70c.entry.js.map} +0 -0
  129. package/dist/nano-components/{p-0eaa9a08.entry.js → p-1d21b2ce.entry.js} +2 -2
  130. package/dist/nano-components/{p-0eaa9a08.entry.js.map → p-1d21b2ce.entry.js.map} +0 -0
  131. package/dist/nano-components/{p-de72a35c.entry.js → p-264903b5.entry.js} +2 -2
  132. package/dist/nano-components/{p-de72a35c.entry.js.map → p-264903b5.entry.js.map} +0 -0
  133. package/dist/nano-components/{p-d49c5b2b.entry.js → p-320366a2.entry.js} +2 -2
  134. package/dist/nano-components/{p-d49c5b2b.entry.js.map → p-320366a2.entry.js.map} +0 -0
  135. package/dist/nano-components/{p-41f33a56.entry.js → p-364434b4.entry.js} +2 -2
  136. package/dist/nano-components/{p-41f33a56.entry.js.map → p-364434b4.entry.js.map} +0 -0
  137. package/dist/nano-components/{p-bd1ff3a4.entry.js → p-36d5a41d.entry.js} +2 -2
  138. package/dist/nano-components/{p-bd1ff3a4.entry.js.map → p-36d5a41d.entry.js.map} +0 -0
  139. package/dist/nano-components/{p-2113cc09.entry.js → p-371fe61d.entry.js} +2 -2
  140. package/dist/nano-components/{p-2113cc09.entry.js.map → p-371fe61d.entry.js.map} +0 -0
  141. package/dist/nano-components/{p-1416c06b.entry.js → p-3d658ce2.entry.js} +2 -2
  142. package/dist/nano-components/{p-1416c06b.entry.js.map → p-3d658ce2.entry.js.map} +0 -0
  143. package/dist/nano-components/p-3e95778d.entry.js +5 -0
  144. package/dist/nano-components/{p-1d0194af.entry.js.map → p-3e95778d.entry.js.map} +0 -0
  145. package/dist/nano-components/{p-0f7c19fc.entry.js → p-400d698f.entry.js} +2 -2
  146. package/dist/nano-components/{p-0f7c19fc.entry.js.map → p-400d698f.entry.js.map} +0 -0
  147. package/dist/nano-components/{p-8a4f6a46.js → p-41811365.js} +2 -2
  148. package/dist/nano-components/{p-8a4f6a46.js.map → p-41811365.js.map} +0 -0
  149. package/dist/nano-components/{p-014872f7.entry.js → p-4b1d73e9.entry.js} +2 -2
  150. package/dist/nano-components/{p-014872f7.entry.js.map → p-4b1d73e9.entry.js.map} +0 -0
  151. package/dist/nano-components/{p-08c3ffaf.entry.js → p-4e104cb1.entry.js} +2 -2
  152. package/dist/nano-components/{p-08c3ffaf.entry.js.map → p-4e104cb1.entry.js.map} +0 -0
  153. package/dist/nano-components/{p-12beee2b.entry.js → p-5a466c9f.entry.js} +2 -2
  154. package/dist/nano-components/{p-12beee2b.entry.js.map → p-5a466c9f.entry.js.map} +0 -0
  155. package/dist/nano-components/{p-01c1f47a.entry.js → p-5f1b94f0.entry.js} +2 -2
  156. package/dist/nano-components/{p-01c1f47a.entry.js.map → p-5f1b94f0.entry.js.map} +0 -0
  157. package/dist/nano-components/{p-6a2c2a7c.entry.js → p-60823325.entry.js} +2 -2
  158. package/dist/nano-components/{p-6a2c2a7c.entry.js.map → p-60823325.entry.js.map} +0 -0
  159. package/dist/nano-components/{p-91f23170.entry.js → p-6760e54a.entry.js} +2 -2
  160. package/dist/nano-components/{p-91f23170.entry.js.map → p-6760e54a.entry.js.map} +0 -0
  161. package/dist/nano-components/{p-73fc0adc.entry.js → p-69774e99.entry.js} +2 -2
  162. package/dist/nano-components/{p-73fc0adc.entry.js.map → p-69774e99.entry.js.map} +0 -0
  163. package/dist/nano-components/{p-ae2ce39b.entry.js → p-6bca2d00.entry.js} +2 -2
  164. package/dist/nano-components/{p-ae2ce39b.entry.js.map → p-6bca2d00.entry.js.map} +0 -0
  165. package/dist/nano-components/{p-71e545fe.entry.js → p-78169835.entry.js} +2 -2
  166. package/dist/nano-components/{p-71e545fe.entry.js.map → p-78169835.entry.js.map} +0 -0
  167. package/dist/nano-components/{p-f6d105c2.entry.js → p-817eda34.entry.js} +2 -2
  168. package/dist/nano-components/{p-f6d105c2.entry.js.map → p-817eda34.entry.js.map} +0 -0
  169. package/dist/nano-components/{p-4db34382.entry.js → p-866c73c0.entry.js} +2 -2
  170. package/dist/nano-components/{p-4db34382.entry.js.map → p-866c73c0.entry.js.map} +0 -0
  171. package/dist/nano-components/{p-e460753c.entry.js → p-87a76a81.entry.js} +2 -2
  172. package/dist/nano-components/{p-e460753c.entry.js.map → p-87a76a81.entry.js.map} +0 -0
  173. package/dist/nano-components/{p-4b12ba50.entry.js → p-8907dd24.entry.js} +2 -2
  174. package/dist/nano-components/{p-4b12ba50.entry.js.map → p-8907dd24.entry.js.map} +0 -0
  175. package/dist/nano-components/{p-9c57b61b.entry.js → p-90365d7b.entry.js} +2 -2
  176. package/dist/nano-components/{p-9c57b61b.entry.js.map → p-90365d7b.entry.js.map} +0 -0
  177. package/dist/nano-components/{p-7c23e950.js → p-909a424c.js} +2 -2
  178. package/dist/nano-components/{p-7c23e950.js.map → p-909a424c.js.map} +0 -0
  179. package/dist/nano-components/{p-a8db13db.entry.js → p-9cf5fda3.entry.js} +2 -2
  180. package/dist/nano-components/{p-a8db13db.entry.js.map → p-9cf5fda3.entry.js.map} +0 -0
  181. package/dist/nano-components/{p-14b7f2c7.entry.js → p-9fcd383f.entry.js} +2 -2
  182. package/dist/nano-components/{p-14b7f2c7.entry.js.map → p-9fcd383f.entry.js.map} +0 -0
  183. package/dist/nano-components/{p-61e22cad.entry.js → p-9fda481b.entry.js} +2 -2
  184. package/dist/nano-components/{p-61e22cad.entry.js.map → p-9fda481b.entry.js.map} +0 -0
  185. package/dist/nano-components/{p-b11c89f6.entry.js → p-abd6b774.entry.js} +2 -2
  186. package/dist/nano-components/{p-b11c89f6.entry.js.map → p-abd6b774.entry.js.map} +0 -0
  187. package/dist/nano-components/{p-67195231.js → p-bb6f7c39.js} +2 -2
  188. package/dist/nano-components/{p-67195231.js.map → p-bb6f7c39.js.map} +0 -0
  189. package/dist/nano-components/p-bf91c50e.js +6 -0
  190. package/dist/nano-components/p-bf91c50e.js.map +1 -0
  191. package/dist/nano-components/{p-34df2f17.entry.js → p-bfbfec85.entry.js} +2 -2
  192. package/dist/nano-components/{p-34df2f17.entry.js.map → p-bfbfec85.entry.js.map} +0 -0
  193. package/dist/nano-components/{p-63811de1.entry.js → p-c0681b2b.entry.js} +2 -2
  194. package/dist/nano-components/{p-63811de1.entry.js.map → p-c0681b2b.entry.js.map} +0 -0
  195. package/dist/nano-components/{p-cf0ce679.entry.js → p-c0ca353b.entry.js} +2 -2
  196. package/dist/nano-components/{p-cf0ce679.entry.js.map → p-c0ca353b.entry.js.map} +0 -0
  197. package/dist/nano-components/{p-578cc92e.entry.js → p-c4e8d584.entry.js} +2 -2
  198. package/dist/nano-components/{p-578cc92e.entry.js.map → p-c4e8d584.entry.js.map} +0 -0
  199. package/dist/nano-components/{p-0c3a5c44.entry.js → p-d753f35a.entry.js} +2 -2
  200. package/dist/nano-components/{p-0c3a5c44.entry.js.map → p-d753f35a.entry.js.map} +0 -0
  201. package/dist/nano-components/{p-8e39d4ee.js → p-d7ff8f12.js} +2 -2
  202. package/dist/nano-components/{p-8e39d4ee.js.map → p-d7ff8f12.js.map} +0 -0
  203. package/dist/nano-components/p-d92b762b.js +5 -0
  204. package/dist/nano-components/{p-b8abd6a1.js.map → p-d92b762b.js.map} +0 -0
  205. package/dist/nano-components/{p-f9d45db1.entry.js → p-de25ba80.entry.js} +2 -2
  206. package/dist/nano-components/{p-f9d45db1.entry.js.map → p-de25ba80.entry.js.map} +0 -0
  207. package/dist/nano-components/{p-70e718fe.entry.js → p-e19d6a92.entry.js} +2 -2
  208. package/dist/nano-components/{p-70e718fe.entry.js.map → p-e19d6a92.entry.js.map} +0 -0
  209. package/dist/nano-components/p-ed2e6f32.js +5 -0
  210. package/dist/nano-components/{p-5ec7263c.js.map → p-ed2e6f32.js.map} +0 -0
  211. package/dist/nano-components/{p-533db8ad.entry.js → p-ed69b27b.entry.js} +2 -2
  212. package/dist/nano-components/{p-533db8ad.entry.js.map → p-ed69b27b.entry.js.map} +0 -0
  213. package/dist/nano-components/{p-c12042c7.entry.js → p-f2875bf0.entry.js} +2 -2
  214. package/dist/nano-components/{p-c12042c7.entry.js.map → p-f2875bf0.entry.js.map} +0 -0
  215. package/dist/nano-components/{p-80e42c89.entry.js → p-f28c802d.entry.js} +2 -2
  216. package/dist/nano-components/{p-80e42c89.entry.js.map → p-f28c802d.entry.js.map} +0 -0
  217. package/dist/nano-components/{p-4971a1f1.entry.js → p-f47776fd.entry.js} +2 -2
  218. package/dist/nano-components/{p-4971a1f1.entry.js.map → p-f47776fd.entry.js.map} +0 -0
  219. package/dist/nano-components/{p-28874fdc.entry.js → p-fccd59e4.entry.js} +2 -2
  220. package/dist/nano-components/{p-28874fdc.entry.js.map → p-fccd59e4.entry.js.map} +0 -0
  221. package/dist/nano-components/{p-38268f3c.entry.js → p-fe1446cd.entry.js} +2 -2
  222. package/dist/nano-components/{p-38268f3c.entry.js.map → p-fe1446cd.entry.js.map} +0 -0
  223. package/docs-json.json +2 -2
  224. package/hydrate/index.js +5 -4
  225. package/package.json +4 -4
  226. package/dist/cjs/index-5c437a69.js.map +0 -1
  227. package/dist/cjs/table.worker-88f2cb15.js.map +0 -1
  228. package/dist/esm/index-44c85cc8.js.map +0 -1
  229. package/dist/esm/table.worker-682e581f.js.map +0 -1
  230. package/dist/nano-components/p-1d0194af.entry.js +0 -5
  231. package/dist/nano-components/p-5ec7263c.js +0 -5
  232. package/dist/nano-components/p-b8abd6a1.js +0 -5
  233. package/dist/nano-components/p-f84612d4.js +0 -6
  234. package/dist/nano-components/p-f84612d4.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{r as t,c as i,h as s,a as n,g as h}from"./p-f84612d4.js";import{c as e,a as r}from"./p-69a3e911.js";var a=e((function(t){(function(i,s){if(t.exports){t.exports=s()}else{i.EvEmitter=s()}})(typeof window!="undefined"?window:r,(function(){function t(){}var i=t.prototype;i.on=function(t,i){if(!t||!i){return}var s=this._events=this._events||{};var n=s[t]=s[t]||[];if(n.indexOf(i)==-1){n.push(i)}return this};i.once=function(t,i){if(!t||!i){return}this.on(t,i);var s=this._onceEvents=this._onceEvents||{};var n=s[t]=s[t]||{};n[i]=true;return this};i.off=function(t,i){var s=this._events&&this._events[t];if(!s||!s.length){return}var n=s.indexOf(i);if(n!=-1){s.splice(n,1)}return this};i.emitEvent=function(t,i){var s=this._events&&this._events[t];if(!s||!s.length){return}s=s.slice(0);i=i||[];var n=this._onceEvents&&this._onceEvents[t];for(var h=0;h<s.length;h++){var e=s[h];var r=n&&n[e];if(r){this.off(t,e);delete n[e]}e.apply(this,i)}return this};i.allOff=function(){delete this._events;delete this._onceEvents};return t}))}));var o=e((function(t){
4
+ import{r as t,c as i,h as s,a as n,g as h}from"./p-bf91c50e.js";import{c as e,a as r}from"./p-69a3e911.js";var a=e((function(t){(function(i,s){if(t.exports){t.exports=s()}else{i.EvEmitter=s()}})(typeof window!="undefined"?window:r,(function(){function t(){}var i=t.prototype;i.on=function(t,i){if(!t||!i){return}var s=this._events=this._events||{};var n=s[t]=s[t]||[];if(n.indexOf(i)==-1){n.push(i)}return this};i.once=function(t,i){if(!t||!i){return}this.on(t,i);var s=this._onceEvents=this._onceEvents||{};var n=s[t]=s[t]||{};n[i]=true;return this};i.off=function(t,i){var s=this._events&&this._events[t];if(!s||!s.length){return}var n=s.indexOf(i);if(n!=-1){s.splice(n,1)}return this};i.emitEvent=function(t,i){var s=this._events&&this._events[t];if(!s||!s.length){return}s=s.slice(0);i=i||[];var n=this._onceEvents&&this._onceEvents[t];for(var h=0;h<s.length;h++){var e=s[h];var r=n&&n[e];if(r){this.off(t,e);delete n[e]}e.apply(this,i)}return this};i.allOff=function(){delete this._events;delete this._onceEvents};return t}))}));var o=e((function(t){
5
5
  /*!
6
6
  * getSize v2.0.3
7
7
  * measure size of elements
@@ -20,4 +20,4 @@ import{r as t,c as i,h as s,a as n,g as h}from"./p-f84612d4.js";import{c as e,a
20
20
  * MIT license
21
21
  */
22
22
  (function(i,s){if(t.exports){t.exports=s(i,M)}else{i.Unidragger=s(i,i.Unipointer)}})(window,(function t(i,s){function n(){}var h=n.prototype=Object.create(s.prototype);h.bindHandles=function(){this._bindHandles(true)};h.unbindHandles=function(){this._bindHandles(false)};h._bindHandles=function(t){t=t===undefined?true:t;var s=t?"addEventListener":"removeEventListener";var n=t?this._touchActionValue:"";for(var h=0;h<this.handles.length;h++){var e=this.handles[h];this._bindStartEvent(e,t);e[s]("click",this);if(i.PointerEvent){e.style.touchAction=n}}};h._touchActionValue="none";h.pointerDown=function(t,i){var s=this.okayPointerDown(t);if(!s){return}this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,i])};var e={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var r={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};h.okayPointerDown=function(t){var i=e[t.target.nodeName];var s=r[t.target.type];var n=!i||s;if(!n){this._pointerReset()}return n};h.pointerDownBlur=function(){var t=document.activeElement;var i=t&&t.blur&&t!=document.body;if(i){t.blur()}};h.pointerMove=function(t,i){var s=this._dragPointerMove(t,i);this.emitEvent("pointerMove",[t,i,s]);this._dragMove(t,i,s)};h._dragPointerMove=function(t,i){var s={x:i.pageX-this.pointerDownPointer.pageX,y:i.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(s)){this._dragStart(t,i)}return s};h.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};h.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i]);this._dragPointerUp(t,i)};h._dragPointerUp=function(t,i){if(this.isDragging){this._dragEnd(t,i)}else{this._staticClick(t,i)}};h._dragStart=function(t,i){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,i)};h.dragStart=function(t,i){this.emitEvent("dragStart",[t,i])};h._dragMove=function(t,i,s){if(!this.isDragging){return}this.dragMove(t,i,s)};h.dragMove=function(t,i,s){t.preventDefault();this.emitEvent("dragMove",[t,i,s])};h._dragEnd=function(t,i){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,i)};h.dragEnd=function(t,i){this.emitEvent("dragEnd",[t,i])};h.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};h._staticClick=function(t,i){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,i);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};h.staticClick=function(t,i){this.emitEvent("staticClick",[t,i])};n.getPointerPoint=s.getPointerPoint;return n}))}));u.extend(m.defaults,{draggable:">1",dragThreshold:3});m.createMethods.push("_createDrag");var S=m.prototype;u.extend(S,C.prototype);S._touchActionValue="pan-y";var L="createTouch"in document;var T=false;S._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable);if(L&&!T){window.addEventListener("touchmove",(function(){}));T=true}};S.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};S.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};S.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};S.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};S.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};S._uiChangeDrag=function(){delete this.isFreeScrolling};S.pointerDown=function(t,i){if(!this.isDraggable){this._pointerDownDefault(t,i);return}var s=this.okayPointerDown(t);if(!s){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=E();window.addEventListener("scroll",this);this._pointerDownDefault(t,i)};S._pointerDownDefault=function(t,i){this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[i])};var P={INPUT:true,TEXTAREA:true,SELECT:true};S.pointerDownFocus=function(t){var i=P[t.target.nodeName];if(!i){this.focus()}};S._pointerDownPreventDefault=function(t){var i=t.type=="touchstart";var s=t.pointerType=="touch";var n=P[t.target.nodeName];if(!i&&!s&&!n){t.preventDefault()}};S.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};S.pointerUp=function(t,i){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[i]);this._dragPointerUp(t,i)};S.pointerDone=function(){window.removeEventListener("scroll",this);delete this.pointerDownScroll};S.dragStart=function(t,i){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();window.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[i])};S.pointerMove=function(t,i){var s=this._dragPointerMove(t,i);this.dispatchEvent("pointerMove",t,[i,s]);this._dragMove(t,i,s)};S.dragMove=function(t,i,s){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){s.x=s.x%this.slideableWidth}var h=this.dragStartPosition+s.x*n;if(!this.options.wrapAround&&this.slides.length){var e=Math.max(-this.slides[0].target,this.dragStartPosition);h=h>e?(h+e)*.5:h;var r=Math.min(-this.getLastSlide().target,this.dragStartPosition);h=h<r?(h+r)*.5:h}this.dragX=h;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[i,s])};S.dragEnd=function(t,i){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var s=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&s==this.selectedIndex){s+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(s);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[i])};S.dragEndRestingSelect=function(){var t=this.getRestingPosition();var i=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var s=this._getClosestResting(t,i,1);var n=this._getClosestResting(t,i,-1);var h=s.distance<n.distance?s.index:n.index;return h};S._getClosestResting=function(t,i,s){var n=this.selectedIndex;var h=Infinity;var e=this.options.contain&&!this.options.wrapAround?function(t,i){return t<=i}:function(t,i){return t<i};while(e(i,h)){n+=s;h=i;i=this.getSlideDistance(-t,n);if(i===null){break}i=Math.abs(i)}return{distance:h,index:n-s}};S.getSlideDistance=function(t,i){var s=this.slides.length;var n=this.options.wrapAround&&s>1;var h=n?u.modulo(i,s):i;var e=this.slides[h];if(!e){return null}var r=n?this.slideableWidth*Math.floor(i/s):0;return t-(e.target+r)};S.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var i=this.previousDragX-this.dragX;if(t>0&&i>0){return 1}else if(t<0&&i<0){return-1}return 0};S.staticClick=function(t,i){var s=this.getParentCell(t.target);var n=s&&s.element;var h=s&&this.cells.indexOf(s);this.dispatchEvent("staticClick",t,[i,n,h])};S.onscroll=function(){var t=E();var i=this.pointerDownScroll.x-t.x;var s=this.pointerDownScroll.y-t.y;if(Math.abs(i)>3||Math.abs(s)>3){this._pointerDone()}};function E(){return{x:window.pageXOffset,y:window.pageYOffset}}var A="http://www.w3.org/2000/svg";function O(t,i){this.direction=t;this.parent=i;this.parentElement=this.parent.element.shadowRoot||this.parent.element;this._create()}O.prototype=Object.create(M.prototype);O.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var i=this.element=document.createElement("button");i.className="flickity-button flickity-prev-next-button";i.className+=this.isPrevious?" previous":" next";i.setAttribute("type","button");this.disable();i.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var s=this.createSVG();i.appendChild(s);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};O.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parentElement.appendChild(this.element)};O.prototype.deactivate=function(){this.parentElement.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};O.prototype.createSVG=function(){var t=document.createElementNS(A,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var i=document.createElementNS(A,"path");var s=D(this.parent.options.arrowShape);i.setAttribute("d",s);i.setAttribute("class","arrow");if(!this.isLeft){i.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(i);return t};function D(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}O.prototype.handleEvent=u.handleEvent;O.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};O.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};O.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};O.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var i=t.length?t.length-1:0;var s=this.isPrevious?0:i;var n=this.parent.selectedIndex==s?"disable":"enable";this[n]()};O.prototype.destroy=function(){this.deactivate();this.allOff()};u.extend(m.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});m.createMethods.push("_createPrevNextButtons");var j=m.prototype;j._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new O(-1,this);this.nextButton=new O(1,this);this.on("activate",this.activatePrevNextButtons)};j.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};j.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};m.PrevNextButton=O;function R(t){this.parent=t;this.parentElement=this.parent.element.shadowRoot||this.parent.element;this._create()}R.prototype=Object.create(M.prototype);R.prototype._create=function(){this.holder=document.createElement("ol");this.holder.className="flickity-page-dots";this.dots=[];this.handleClick=this.onClick.bind(this);this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};R.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parentElement.appendChild(this.holder)};R.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parentElement.removeChild(this.holder)};R.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};R.prototype.addDots=function(t){var i=document.createDocumentFragment();var s=[];var n=this.dots.length;var h=n+t;for(var e=n;e<h;e++){var r=document.createElement("li");r.classList.add("dot");r.setAttribute("aria-label","Page dot "+(e+1));i.appendChild(r);s.push(r)}this.holder.appendChild(i);this.dots=this.dots.concat(s)};R.prototype.removeDots=function(t){var i=this.dots.splice(this.dots.length-t,t);i.forEach((function(t){this.holder.removeChild(t)}),this)};R.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.classList.remove("is-selected");this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.classList.add("is-selected");this.selectedDot.setAttribute("aria-current","step")};R.prototype.onTap=R.prototype.onClick=function(t){var i=t.target;if(i.nodeName!="LI"){return}this.parent.uiChange();var s=this.dots.indexOf(i);this.parent.select(s)};R.prototype.destroy=function(){this.deactivate();this.allOff()};m.PageDots=R;u.extend(m.defaults,{pageDots:true});m.createMethods.push("_createPageDots");var I=m.prototype;I._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new R(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};I.activatePageDots=function(){this.pageDots.activate()};I.updateSelectedPageDots=function(){this.pageDots.updateSelected()};I.updatePageDots=function(){this.pageDots.setDots()};I.deactivatePageDots=function(){this.pageDots.deactivate()};m.PageDots=R;function N(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}N.prototype=Object.create(a.prototype);N.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};N.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var i=this;this.clear();this.timeout=setTimeout((function(){i.parent.next(true);i.tick()}),t)};N.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};N.prototype.clear=function(){clearTimeout(this.timeout)};N.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};N.prototype.unpause=function(){if(this.state=="paused"){this.play()}};N.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};N.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};u.extend(m.defaults,{pauseAutoPlayOnHover:true});m.createMethods.push("_createPlayer");var B=m.prototype;B._createPlayer=function(){this.player=new N(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};B.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};B.playPlayer=function(){this.player.play()};B.stopPlayer=function(){this.player.stop()};B.pausePlayer=function(){this.player.pause()};B.unpausePlayer=function(){this.player.unpause()};B.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};B.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};B.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};m.Player=N;function F(t){var i=document.createDocumentFragment();t.forEach((function(t){i.appendChild(t.element)}));return i}var H=m.prototype;H.insert=function(t,i){var s=this._makeCells(t);if(!s||!s.length){return}var n=this.cells.length;i=i===undefined?n:i;var h=F(s);var e=i==n;if(e){this.slider.appendChild(h)}else{var r=this.cells[i].element;this.slider.insertBefore(h,r)}if(i===0){this.cells=s.concat(this.cells)}else if(e){this.cells=this.cells.concat(s)}else{var a=this.cells.splice(i,n-i);this.cells=this.cells.concat(s).concat(a)}this._sizeCells(s);this.cellChange(i,true)};H.append=function(t){this.insert(t,this.cells.length)};H.prepend=function(t){this.insert(t,0)};H.remove=function(t){var i=this.getCells(t);if(!i||!i.length){return}var s=this.cells.length-1;i.forEach((function(t){t.remove();var i=this.cells.indexOf(t);s=Math.min(i,s);u.removeFrom(this.cells,t)}),this);this.cellChange(s,true)};H.cellSizeChange=function(t){var i=this.getCell(t);if(!i){return}i.getSize();var s=this.cells.indexOf(i);this.cellChange(s)};H.cellChange=function(t,i){var s=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(s);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(i){this.positionSliderAtSelected()}};m.createMethods.push("_createLazyload");var _=m.prototype;_._createLazyload=function(){this.on("select",this.lazyLoad)};_.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var i=typeof t=="number"?t:0;var s=this.getAdjacentCellElements(i);var n=[];s.forEach((function(t){var i=W(t);n=n.concat(i)}));n.forEach((function(t){new V(t,this)}),this)};function W(t){if(t.nodeName=="IMG"){var i=t.getAttribute("data-flickity-lazyload");var s=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(i||s||n){return[t]}}var h="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var e=t.querySelectorAll(h);return u.makeArray(e)}function V(t,i){this.img=t;this.flickity=i;this.load()}V.prototype.handleEvent=u.handleEvent;V.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var i=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(i){this.img.setAttribute("srcset",i)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};V.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};V.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};V.prototype.complete=function(t,i){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var s=this.flickity.getParentCell(this.img);var n=s&&s.element;this.flickity.cellSizeChange(n);this.img.classList.add(i);this.flickity.dispatchEvent("lazyLoad",t,n)};m.LazyLoader=V;m.createMethods.push("_createFullscreen");var X=m.prototype;X._createFullscreen=function(){this.isFullscreen=false;if(!this.options.fullscreen){return}this.viewFullscreenButton=new U("view",this);this.exitFullscreenButton=new U("exit",this);this.on("activate",this._changeFullscreenActive);this.on("deactivate",this._changeFullscreenActive)};X._changeFullscreenActive=function(){var t=this.isActive?"appendChild":"removeChild";this.element[t](this.viewFullscreenButton.element);this.element[t](this.exitFullscreenButton.element);var i=this.isActive?"activate":"deactivate";this.viewFullscreenButton[i]();this.exitFullscreenButton[i]()};X.viewFullscreen=function(){this._changeFullscreen(true);this.focus()};X.exitFullscreen=function(){this._changeFullscreen(false)};X._changeFullscreen=function(t){if(this.isFullscreen==t){return}this.isFullscreen=t;var i=t?"add":"remove";document.documentElement.classList[i]("is-flickity-fullscreen");this.element.classList[i]("is-fullscreen");this.resize();if(this.isFullscreen){this.reposition()}this.dispatchEvent("fullscreenChange",null,[t])};X.toggleFullscreen=function(){this._changeFullscreen(!this.isFullscreen)};var Z=X.setGallerySize;X.setGallerySize=function(){if(!this.options.setGallerySize){return}if(this.isFullscreen){this.viewport.style.height=""}else{Z.call(this)}};m.keyboardHandlers[27]=function(){this.exitFullscreen()};function U(t,i){this.name=t;this.createButton();this.createIcon();this.onClick=function(){i[t+"Fullscreen"]()};this.clickHandler=this.onClick.bind(this)}U.prototype.createButton=function(){var t=this.element=document.createElement("button");t.className="flickity-button flickity-fullscreen-button "+"flickity-fullscreen-button-"+this.name;t.setAttribute("type","button");var i=Y(this.name+" full-screen");t.setAttribute("aria-label",i);t.title=i};function Y(t){return t[0].toUpperCase()+t.slice(1)}var G="http://www.w3.org/2000/svg";var J={view:"M15,20,7,28h5v4H0V20H4v5l8-8Zm5-5,8-8v5h4V0H20V4h5l-8,8Z",exit:"M32,3l-7,7h5v4H18V2h4V7l7-7ZM3,32l7-7v5h4V18H2v4H7L0,29Z"};U.prototype.createIcon=function(){var t=document.createElementNS(G,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 32 32");var i=document.createElementNS(G,"path");var s=J[this.name];i.setAttribute("d",s);t.appendChild(i);this.element.appendChild(t)};U.prototype.activate=function(){this.element.addEventListener("click",this.clickHandler)};U.prototype.deactivate=function(){this.element.removeEventListener("click",this.clickHandler)};m.FullscreenButton=U;var q=m.Slide;var Q=q.prototype.updateTarget;q.prototype.updateTarget=function(){Q.apply(this,arguments);if(!this.parent.options.fade){return}var t=this.target-this.x;var i=this.cells[0].x;this.cells.forEach((function(s){var n=s.x-i-t;s.renderPosition(n)}))};q.prototype.setOpacity=function(t){this.cells.forEach((function(i){i.element.style.opacity=t}))};var $=m.prototype;m.createMethods.push("_createFade");$._createFade=function(){this.fadeIndex=this.selectedIndex;this.prevSelectedIndex=this.selectedIndex;this.on("select",this.onSelectFade);this.on("dragEnd",this.onDragEndFade);this.on("settle",this.onSettleFade);this.on("activate",this.onActivateFade);this.on("deactivate",this.onDeactivateFade)};var K=$.updateSlides;$.updateSlides=function(){K.apply(this,arguments);if(!this.options.fade){return}this.slides.forEach((function(t,i){var s=i==this.selectedIndex?1:0;t.setOpacity(s)}),this)};$.onSelectFade=function(){this.fadeIndex=Math.min(this.prevSelectedIndex,this.slides.length-1);this.prevSelectedIndex=this.selectedIndex};$.onSettleFade=function(){delete this.didDragEnd;if(!this.options.fade){return}this.selectedSlide.setOpacity(1);var t=this.slides[this.fadeIndex];if(t&&this.fadeIndex!=this.selectedIndex){this.slides[this.fadeIndex].setOpacity(0)}};$.onDragEndFade=function(){this.didDragEnd=true};$.onActivateFade=function(){if(this.options.fade){this.element.classList.add("is-fade")}};$.onDeactivateFade=function(){if(!this.options.fade){return}this.element.classList.remove("is-fade");this.slides.forEach((function(t){t.setOpacity("")}))};var tt=$.positionSlider;$.positionSlider=function(){if(!this.options.fade){tt.apply(this,arguments);return}this.fadeSlides();this.dispatchScrollEvent()};var it=$.positionSliderAtSelected;$.positionSliderAtSelected=function(){if(this.options.fade){this.setTranslateX(0)}it.apply(this,arguments)};$.fadeSlides=function(){if(this.slides.length<2){return}var t=this.getFadeIndexes();var i=this.slides[t.a];var s=this.slides[t.b];var n=this.wrapDifference(i.target,s.target);var h=this.wrapDifference(i.target,-this.x);h=h/n;i.setOpacity(1-h);s.setOpacity(h);var e=t.a;if(this.isDragging){e=h>.5?t.a:t.b}var r=this.fadeHideIndex!=undefined&&this.fadeHideIndex!=e&&this.fadeHideIndex!=t.a&&this.fadeHideIndex!=t.b;if(r){this.slides[this.fadeHideIndex].setOpacity(0)}this.fadeHideIndex=e};$.getFadeIndexes=function(){if(!this.isDragging&&!this.didDragEnd){return{a:this.fadeIndex,b:this.selectedIndex}}if(this.options.wrapAround){return this.getFadeDragWrapIndexes()}else{return this.getFadeDragLimitIndexes()}};$.getFadeDragWrapIndexes=function(){var t=this.slides.map((function(t,i){return this.getSlideDistance(-this.x,i)}),this);var i=t.map((function(t){return Math.abs(t)}));var s=Math.min.apply(Math,i);var n=i.indexOf(s);var h=t[n];var e=this.slides.length;var r=h>=0?1:-1;return{a:n,b:u.modulo(n+r,e)}};$.getFadeDragLimitIndexes=function(){var t=0;for(var i=0;i<this.slides.length-1;i++){var s=this.slides[i];if(-this.x<s.target){break}t=i}return{a:t,b:t+1}};$.wrapDifference=function(t,i){var s=i-t;if(!this.options.wrapAround){return s}var n=s+this.slideableWidth;var h=s-this.slideableWidth;if(Math.abs(n)<Math.abs(s)){s=n}if(Math.abs(h)<Math.abs(s)){s=h}return s};var st=$._getWrapShiftCells;$._getWrapShiftCells=function(){if(!this.options.fade){st.apply(this,arguments)}};var nt=$.shiftWrapCells;$.shiftWrapCells=function(){if(!this.options.fade){nt.apply(this,arguments)}};const ht=m;const et=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--dot-color:#ccc;--dot-color-active:var(--nano-color-primary, #007495);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:white;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:white;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:white;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0}:host([ready]){opacity:1}.slideshow{block-size:100%;position:relative}.flickity-container{block-size:0;opacity:0;transition:opacity 0.2s}.flickity-container.slides-ready{block-size:100%}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;block-size:100% !important}.flickity-slider{position:absolute;inline-size:100%;block-size:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:none;box-shadow:0 0 0 5px #19f}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.flickity-button-icon{fill:var(--navbtns-icon-color)}.flickity-button:disabled .flickity-button-icon{fill:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{inset-block-start:50%;inline-size:44px;block-size:44px;border-radius:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{inset-inline-start:10px}.flickity-prev-next-button.next{inset-inline-end:10px}.flickity-rtl .flickity-prev-next-button.previous{inset-inline:auto 10px}.flickity-rtl .flickity-prev-next-button.next{inset-inline:10px auto}.flickity-prev-next-button .flickity-button-icon{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}.flickity-page-dots{position:absolute;inline-size:100%;inset-block-end:10px;padding:0;margin:0;list-style:none;text-align:center;line-height:1;z-index:4}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{display:inline-block;inline-size:10px;block-size:10px;margin-block:0;margin-inline:8px;border-radius:50%;cursor:pointer;background:var(--dot-color)}.flickity-page-dots .dot.is-selected{opacity:1;background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:rgba(0, 0, 0, 0.9);-webkit-padding-after:35px;padding-block-end:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{inset-block-end:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{inset-inline:10px auto}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}";const rt=class{constructor(s){t(this,s);this.nanoSlidesDidLoad=i(this,"nanoSlidesDidLoad",7);this.nanoSlidesReady=i(this,"nanoSlidesReady",7);this.nanoSlidesSelect=i(this,"nanoSlidesSelect",7);this.nanoSlidesChange=i(this,"nanoSlidesChange",7);this.nanoSlidesScroll=i(this,"nanoSlidesScroll",7);this.nanoSlidesTransitionEnd=i(this,"nanoSlidesTransitionEnd",7);this.nanoSlidesDragStart=i(this,"nanoSlidesDragStart",7);this.nanoSlidesDragMove=i(this,"nanoSlidesDragMove",7);this.nanoSlidesDragEnd=i(this,"nanoSlidesDragEnd",7);this.nanoSlidesTap=i(this,"nanoSlidesTap",7);this.nanoSlidesFullscreenChange=i(this,"nanoSlidesFullscreenChange",7);this.flickityReady=false;this.flickity=new Promise((t=>{this.readyflickity=t}));this.parralax=async()=>{const t=await this.flickity;t.slides.forEach(((i,s)=>{const n=this.childrenEles[s];const h=(i.target+t.x)*-1/3;n.style["transform"]="translateX("+h+"px)"}))};this.handleFullscreen=t=>{this.fullscreen=t;this.nanoSlidesFullscreenChange.emit(t)};this.handleSlideSelect=t=>{this.iCurrentSlide=t;this.nanoSlidesSelect.emit(t)};this.iCurrentSlide=undefined;this.slidesReady=undefined;this.didInit=false;this.options={};this.navbtns=false;this.pager=false;this.fullscreenbtn=false;this.fullscreen=false;this.animation="scroll";this.currentSlide=0;this.autoplay=false;this.ready=false}async optionsChanged(){if(this.flickityReady){const t=await this.getflickity();Object.assign(t.options,this.options);await this.update()}}async navbtnsChanged(){Array.from(this._getRoot().querySelectorAll(".flickity-prev-next-button")).forEach((t=>{t.hidden=!this.navbtns}))}async pagerChanged(){const t=this._getRoot().querySelector(".flickity-page-dots");t.hidden=!this.pager}async fullscreenBtnChanged(){const t=this._getRoot().querySelector(".flickity-fullscreen-button");t.hidden=!this.fullscreenbtn}async fullscreenChanged(t,i){const s=await this.getflickity();if(this.fullscreen)s.viewFullscreen();else if(typeof i!=="undefined")s.exitFullscreen()}async animationChange(t,i){const[s,n]=await Promise.all([this.getflickity(),at(this.host)]);n.forEach((t=>{t.style["left"]=undefined}));if(i==="parallax"){s.off("scroll",this.parralax);n.forEach(((t,i)=>{if(this.childrenEles&&this.childrenEles[i])this.childrenEles[i].style["transform"]=undefined}));this.update()}switch(this.animation){case"fade":this.options={fade:true,percentPosition:true};break;case"parallax":this.options={fade:false,percentPosition:false};s.on("scroll",this.parralax);break;default:this.options={fade:false,percentPosition:true};break}}currentSlideChange(){if(this.currentSlide!==this.iCurrentSlide)this.slideTo(this.currentSlide)}internalSlideChange(){this.currentSlide=this.iCurrentSlide}async autoPlayChange(){await this.stopAutoplay();if(this.autoplay){if(typeof this.autoplay==="string")this.autoplay=parseInt(this.autoplay);if(this.autoplay>0)this.startAutoplay(this.autoplay)}}async update(){const[t]=await Promise.all([this.getflickity(),at(this.host)]);this.childrenEles=this.host.querySelectorAll("nano-slide > *");t.reloadCells();t.resize();t.reposition()}async updateAutoHeight(t){const i=document.querySelector(".flickity-viewport");if(i)i.style.transition=t+"ms"}async slideTo(t,i){const s=await this.getflickity();s.select(t,i)}async slideNext(t,i){const s=await this.getflickity();s.next(i,t)}async slidePrev(t,i){const s=await this.getflickity();s.previous(t,i)}async getActiveIndex(){const t=await this.getflickity();return t.selectedIndex}async length(){const t=await this.getflickity();return t.slides.length}async isEnd(){const t=await this.getflickity();return t.selectedIndex===t.slides.length-1}async isBeginning(){const t=await this.getflickity();return t.selectedIndex===0}async startAutoplay(t){const i=await this.getflickity();if(t)this.options={autoPlay:t};setTimeout((()=>i.playPlayer()))}async stopAutoplay(){const t=await this.getflickity();t.stopPlayer()}async lockSwipes(t){const i=await this.getflickity();i.options.draggable=!t;i.updateDraggable()}async getflickity(){return this.flickity}async reload(){this.destroyflickity();setTimeout((()=>this.initflickity()),20)}_getRoot(){return this.host.shadowRoot?this.host.shadowRoot:this.host}destroyflickity(){const t=this.syncflickity;if(t!==undefined){t.destroy();this.flickity=new Promise((t=>{this.readyflickity=t}));this.flickityReady=false;this.syncflickity=undefined;this.ready=false}this.didInit=false}async initflickity(){const t=this.normalizeOptions();await at(this.host);this.slidesReady=true;this.flickityEl=this.flickityEl||this._getRoot().querySelector(".flickity-container");if(this.flickityEl&&this.flickityEl.classList.contains("flickity-enabled"))this.destroyflickity();setTimeout((()=>{const i=new ht(this.flickityEl,t);this.flickityReady=true;this.syncflickity=i;this.animationChange();this.navbtnsChanged();this.pagerChanged();this.fullscreenChanged();this.fullscreenBtnChanged();this.readyflickity(i);this.ready=true;if(!this.host.getBoundingClientRect().height){if(!window["ResizeObserver"])return;const t=this.resizeO=new ResizeObserver((()=>{i.resize();this.resizeO.disconnect()}));t.observe(this.host)}}),100)}normalizeOptions(){const t={cellSelector:"nano-slide",contain:true,prevNextButtons:true,fullscreen:true,accessibility:true,imagesLoaded:true,pageDots:true};if(this.animation==="fade"){t.fade=true}if(this.currentSlide>0){t.initialIndex=this.currentSlide}if(this.autoplay){if(typeof this.autoplay==="string")this.autoplay=parseInt(this.autoplay);if(this.autoplay>0)t.autoPlay=this.autoplay}const i={ready:()=>{setTimeout((()=>{this.nanoSlidesReady.emit()}),20)},select:this.handleSlideSelect,change:this.nanoSlidesChange.emit,scroll:this.nanoSlidesScroll.emit,settle:this.nanoSlidesTransitionEnd.emit,dragStart:this.nanoSlidesDragStart.emit,dragMove:this.nanoSlidesDragMove.emit,dragEnd:this.nanoSlidesDragEnd.emit,staticClick:this.nanoSlidesTap.emit,fullscreenChange:this.handleFullscreen};const s=!!this.options&&!!this.options.on?this.options.on:{};const n={on:Object.assign(Object.assign({},s),i)};return Object.assign(Object.assign(Object.assign({},t),n),this.options)}componentDidLoad(){if(typeof window!=="undefined"&&window.MutationObserver){const t=this.mutationO=new MutationObserver((t=>{if(t[0].addedNodes[0]&&t[0].addedNodes[0].nodeName.toLowerCase()==="nano-slide"&&this.flickityReady){this.update()}}));t.observe(this.host,{childList:true,subtree:true})}}componentWillLoad(){this.nanoSlidesDidLoad.emit();if(!this.didInit){this.didInit=true;this.initflickity()}}disconnectedCallback(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}if(this.resizeO)this.resizeO.disconnect();this.destroyflickity()}render(){return s(n,null,s("div",{class:"slideshow"},s("div",{ref:t=>this.flickityEl=t,class:{"flickity-container":true,"slides-ready":this.slidesReady,"slides-not-ready":!this.slidesReady}},s("slot",null)),s("div",{class:"ui-extras"},s("slot",{name:"ui"}))))}get host(){return h(this)}static get watchers(){return{options:["optionsChanged"],navbtns:["navbtnsChanged"],pager:["pagerChanged"],fullscreenbtn:["fullscreenBtnChanged"],fullscreen:["fullscreenChanged"],animation:["animationChange"],currentSlide:["currentSlideChange"],iCurrentSlide:["internalSlideChange"],autoplay:["autoPlayChange"]}}};const at=t=>{const i=Array.from(t.querySelectorAll("nano-slide"));let s=i.filter((t=>!t.ready));if(!s.length)return Promise.resolve(i);return new Promise((n=>{const h=e=>{s=s.filter((t=>t!==e.target));if(!s.length){n(i);t.removeEventListener("nanoSlideReady",h)}};t.addEventListener("nanoSlideReady",h);t.addEventListener("nano-slide-ready",h)}))};rt.style=et;export{rt as nano_slides};
23
- //# sourceMappingURL=p-c12042c7.entry.js.map
23
+ //# sourceMappingURL=p-f2875bf0.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{g as t,e as i,r as e,c as s,w as n,d as r,h as a,a as h}from"./p-f84612d4.js";import{a as o}from"./p-ed6adde2.js";import{g as l}from"./p-257432ff.js";import{C as u}from"./p-7c23e950.js";import{b as f,c,a as d}from"./p-69a3e911.js";import{d as p}from"./p-9746b0a5.js";import{S as v}from"./p-5ec7263c.js";var m=new Map;var g=function(t,i){var e=t.fields,s=t.updater;e.forEach((function(t){s(t,i[t])}))};var y={create:function(i,e){var s=t(i);var n=new Map;var r={wormholes:n,state:e};m.set(i,r);var a=i.connectedCallback;i.connectedCallback=function(){m.set(i,r);if(a){a.call(i)}};var h=i.disconnectedCallback;i.disconnectedCallback=function(){m.delete(i);if(h){h.call(i)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var i=t.detail,e=i.consumer,s=i.onOpen;if(n.has(e))return;if(typeof e!=="symbol"){var a=e.connectedCallback,h=e.disconnectedCallback;e.connectedCallback=function(){n.set(e,t.detail);if(a){a.call(e)}};e.disconnectedCallback=function(){n.delete(e);if(h){h.call(e)}}}n.set(e,t.detail);g(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(e)}))}));s.addEventListener("closeWormhole",(function(t){var i=t.detail;n.delete(i)}))},Provider:function(t,e){var s=t.state;var n=i();if(m.has(n)){var r=m.get(n);r.state=s;r.wormholes.forEach((function(t){g(t,s)}))}return e}};class w{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((i,e)=>{this.queue.push({promise:t,resolve:i,reject:e});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((i=>{this.workingOnPromise=false;t.resolve(i);this.dequeue()})).catch((i=>{this.workingOnPromise=false;t.reject(i);this.dequeue()}))}catch(i){this.workingOnPromise=false;t.reject(i);this.dequeue()}return true}}w.pendingPromise=false;var b=c((function(t,i){!function(t,e){e(i)}(d,(function(t){function i(t){var e,s,n=new Error(t);return e=n,s=i.prototype,Object.setPrototypeOf?Object.setPrototypeOf(e,s):e.__proto__=s,n}function e(t,e,s){var n=e.slice(0,s).split(/\n/),r=n.length,a=n[r-1].length+1;throw i(t+=" at line "+r+" col "+a+":\n\n "+e.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^")}i.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,n=!1;try{n=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function r(t,i){return Object.prototype.hasOwnProperty.call(t,i)}function a(t,i,e){for(var s in i)r(i,s)&&(null==i[s]||"object"!=typeof i[s]||"storage"!==s&&"prefixes"!==s||e?t[s]=i[s]:t[s]=a({},i[s]));return t}var h=/^async +/,o=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,f=/[.*+\-?^${}()|[\]\\]/g;function c(t){return f.test(t)?t.replace(f,"\\$&"):t}function d(t,s){s.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),o.lastIndex=0,l.lastIndex=0,u.lastIndex=0;var n=s.prefixes,r=[n.h,n.b,n.i,n.r,n.c,n.e].reduce((function(t,i){return t&&i?t+"|"+c(i):i?c(i):t}),""),a=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+c(s.tags[1])+")","g"),f=new RegExp("([^]*?)"+c(s.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),d=0,p=!1;function v(i,n){var r,c={f:[]},v=0,m="c";function g(i){var n=t.slice(d,i),r=n.trim();if("f"===m)"safe"===r?c.raw=!0:s.async&&h.test(r)?(r=r.replace(h,""),c.f.push([r,"",!0])):c.f.push([r,""]);else if("fp"===m)c.f[c.f.length-1][1]+=r;else if("err"===m){if(r){var a=n.search(/\S/);e("invalid syntax",t,d+a)}}else c[m]=r;d=i+1}for("h"===n||"b"===n||"c"===n?m="n":"r"===n&&(c.raw=!0,n="i"),a.lastIndex=d;null!==(r=a.exec(t));){var y=r[1],w=r[2],b=r[3],x=r[4],F=r[5],C=r.index;if(y)"("===y?(0===v&&("n"===m?(g(C),m="p"):"f"===m&&(g(C),m="fp")),v++):")"===y?0===--v&&"c"!==m&&(g(C),m="err"):0===v&&"|"===y?(g(C),m="f"):"=>"===y&&(g(C),d+=1,m="res");else if(w){if("/*"===w){var j=t.indexOf("*/",a.lastIndex);-1===j&&e("unclosed comment",t,r.index),a.lastIndex=j+2}else if("'"===w){l.lastIndex=r.index,l.exec(t)?a.lastIndex=l.lastIndex:e("unclosed string",t,r.index)}else if('"'===w){u.lastIndex=r.index,u.exec(t)?a.lastIndex=u.lastIndex:e("unclosed string",t,r.index)}else if("`"===w){o.lastIndex=r.index,o.exec(t)?a.lastIndex=o.lastIndex:e("unclosed string",t,r.index)}}else if(b)return g(C),d=C+r[0].length,f.lastIndex=d,p=F,x&&"h"===n&&(n="s"),c.t=n,c}return e("unclosed tag",t,i),c}var m=function r(a,o){a.b=[],a.d=[];var l,u=!1,c=[];function m(t,i){t&&(t=function(t,i,e,s){var n,r;return"string"==typeof i.autoTrim?n=r=i.autoTrim:Array.isArray(i.autoTrim)&&(n=i.autoTrim[1],r=i.autoTrim[0]),(e||!1===e)&&(n=e),(s||!1===s)&&(r=s),"slurp"===n&&"slurp"===r?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,s,p,i))&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),c.push(t))}for(;null!==(l=f.exec(t));){var g,y=l[1],w=l[2],b=l[3]||"";for(var x in n)if(n[x]===b){g=x;break}m(y,w),d=l.index+l[0].length,g||e("unrecognized tag type: "+b,t,d);var F=v(l.index,g),C=F.t;if("h"===C){var j=F.n||"";s.async&&h.test(j)&&(F.a=!0,F.n=j.replace(h,"")),F=r(F),c.push(F)}else if("c"===C){if(a.n===F.n)return u?(u.d=c,a.b.push(u)):a.d=c,a;e("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===C){u?(u.d=c,a.b.push(u)):a.d=c;var I=F.n||"";s.async&&h.test(I)&&(F.a=!0,F.n=I.replace(h,"")),u=F,c=[]}else if("s"===C){var S=F.n||"";s.async&&h.test(S)&&(F.a=!0,F.n=S.replace(h,"")),c.push(F)}else c.push(F)}if(!o)throw i('unclosed helper "'+a.n+'"');return m(t.slice(d,t.length),!1),a.d=c,a}({f:[]},!0);if(s.plugins)for(var g=0;g<s.plugins.length;g++){var y=s.plugins[g];y.processAST&&(m.d=y.processAST(m.d,s))}return m.d}function p(t,i){var e=d(t,i),s="var tR='';"+(i.useWith?"with("+i.varName+"||{}){":"")+w(e,i)+"if(cb){cb(null,tR)} return tR"+(i.useWith?"}":"");if(i.plugins)for(var n=0;n<i.plugins.length;n++){var r=i.plugins[n];r.processFnString&&(s=r.processFnString(s,i))}return s}function v(t,i){for(var e=0;e<i.length;e++){var s=i[e][0],n=i[e][1];t=(i[e][2]?"await ":"")+"c.l('F','"+s+"')("+t,n&&(t+=","+n),t+=")"}return t}function m(t,i,e,s,n,r){var a="{exec:"+(n?"async ":"")+y(e,i,t)+",params:["+s+"]";return r&&(a+=",name:'"+r+"'"),n&&(a+=",async:true"),a+="}"}function g(t,i){for(var e="[",s=0;s<t.length;s++){var n=t[s];e+=m(i,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(e+=",")}return e+="]"}function y(t,i,e){return"function("+i+"){var tR='';"+w(t,e)+"return tR}"}function w(t,i){for(var e=0,s=t.length,n="";e<s;e++){var r=t[e];if("string"==typeof r){n+="tR+='"+r+"';"}else{var a=r.t,h=r.c||"",o=r.f,l=r.n||"",u=r.p||"",f=r.res||"",c=r.b,d=!!r.a;if("i"===a){i.defaultFilter&&(h="c.l('F','"+i.defaultFilter+"')("+h+")");var p=v(h,o);!r.raw&&i.autoEscape&&(p="c.l('F','e')("+p+")"),n+="tR+="+p+";"}else if("h"===a)if(i.storage.nativeHelpers.get(l))n+=i.storage.nativeHelpers.get(l)(r,i);else{var y=(d?"await ":"")+"c.l('H','"+l+"')("+m(i,f,r.d,u,d);y+=c?","+g(c,i):",[]",n+="tR+="+v(y+=",c)",o)+";"}else"s"===a?n+="tR+="+v((d?"await ":"")+"c.l('H','"+l+"')({params:["+u+"]},[],c)",o)+";":"e"===a&&(n+=h+"\n")}}return n}var b=function(){function t(t){this.cache=t}return t.prototype.define=function(t,i){this.cache[t]=i},t.prototype.get=function(t){return this.cache[t]},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.reset=function(){this.cache={}},t.prototype.load=function(t){a(this.cache,t,!0)},t}();function x(t,e,s,n){if(e&&e.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(s&&s.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept filters")}var F={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function C(t){return F[t]}var j=new b({}),I=new b({each:function(t,i){var e="",s=t.params[0];if(x("each",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r){s(i[e],e).then((function(a){n+=a,e===i.length-1?r(n):t(i,e+1,s,n,r)}))}(s,0,t.exec,e,i)}));for(var n=0;n<s.length;n++)e+=t.exec(s[n],n);return e},foreach:function(t,i){var e=t.params[0];if(x("foreach",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r,a){n(e[s],i[e[s]]).then((function(h){r+=h,s===e.length-1?a(r):t(i,e,s+1,n,r,a)}))}(e,Object.keys(e),0,t.exec,"",i)}));var s="";for(var n in e)r(e,n)&&(s+=t.exec(n,e[n]));return s},include:function(t,e,s){x("include",e,!1);var n=s.storage.templates.get(t.params[0]);if(!n)throw i('Could not fetch template "'+t.params[0]+'"');return n(t.params[1],s)},extends:function(t,e,s){var n=t.params[1]||{};n.content=t.exec();for(var r=0;r<e.length;r++){var a=e[r];n[a.name]=a.exec()}var h=s.storage.templates.get(t.params[0]);if(!h)throw i('Could not fetch template "'+t.params[0]+'"');return h(n,s)},useScope:function(t,i){return x("useScope",i,!1),t.exec(t.params[0])}}),S=new b({if:function(t,i){x("if",!1,t.f,!0);var e="if("+t.p+"){"+w(t.d,i)+"}";if(t.b)for(var s=0;s<t.b.length;s++){var n=t.b[s];"else"===n.n?e+="else{"+w(n.d,i)+"}":"elif"===n.n&&(e+="else if("+n.p+"){"+w(n.d,i)+"}")}return e},try:function(t,e){if(x("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw i("native helper 'try' only accepts 1 block, 'catch'");var s="try{"+w(t.d,e)+"}",n=t.b[0];return s+="catch"+(n.res?"("+n.res+")":"")+"{"+w(n.d,e)+"}"},block:function(t,i){return x("block",t.b,t.f,!0),"if(!"+i.varName+"["+t.p+"]){tR+=("+y(t.d,"",i)+")()}else{tR+="+i.varName+"["+t.p+"]}"}}),z=new b({e:function(t){var i=String(t);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,C):i}}),O={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){var s=this.storage.helpers.get(e);if(s)return s;throw i("Can't find helper '"+e+"'")}if("F"===t){var n=this.storage.filters.get(e);if(n)return n;throw i("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:I,nativeHelpers:S,filters:z,templates:j},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function R(t,i){var e={};return a(e,O),i&&a(e,i),t&&a(e,t),e.l.bind(e),e}function A(t,e){var s=R(e||{}),r=Function;if(s.async){if(!n)throw i("This environment doesn't support async/await");r=n}try{return new r(s.varName,"c","cb",p(t,s))}catch(e){throw e instanceof SyntaxError?i("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+p(t,s)):e}}function k(t,i){var e;return i.cache&&i.name&&i.storage.templates.get(i.name)?i.storage.templates.get(i.name):(e="function"==typeof t?t:A(t,i),i.cache&&i.name&&i.storage.templates.define(i.name,e),e)}O.l.bind(O),t.compile=A,t.compileScope=w,t.compileScopeIntoFunction=y,t.compileToString=p,t.defaultConfig=O,t.filters=z,t.getConfig=R,t.helpers=I,t.nativeHelpers=S,t.parse=d,t.render=function(t,e,n,r){var a=R(n||{});if(!a.async)return k(t,a)(e,a);if(!r){if("function"==typeof s)return new s((function(i,s){try{i(k(t,a)(e,a))}catch(t){s(t)}}));throw i("Please provide a callback function, this env doesn't support Promises")}try{k(t,a)(e,a,r)}catch(t){return r(t)}},t.templates=j,Object.defineProperty(t,"__esModule",{value:!0})}))}));const x=f(b);const F=Object.freeze(Object.assign(Object.create(null),b,{default:x}));const C=F;C.filters.define("date_long",((t,i={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=e.toLocaleDateString("en-GB",i);return t}));C.filters.define("date_short",((t,i="d/m/y")=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=i.replace(/(d)/,e.getDate().toString());t=t.replace(/(m)/,(e.getMonth()+1).toString());t=t.replace(/(y)/,e.getFullYear().toString());return t}));C.filters.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));C.filters.define("trim_to",((t,i=100)=>{if(!t)return;if(t.length<=i)return t;return t.substr(0,i)+"..."}));C.filters.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));C.filters.define("abs_url",((t,i=null,e)=>{if(!i)return t;if(!t)return;let s=undefined;if(i.domains&&e&&e.origin){const t=i.domains.find((t=>t.origin===e.origin));s=t?t.domain:""}else if(i.domain)s=i.domain;if(!s)return t;return t.match(/^http/)?t:location.protocol+"//"+s+t}));C.filters.define("replace",((t,i,e)=>t.replace(i,e)));C.filters.define("remove_spaces",(t=>t.replace(/ /g,"_")));C.filters.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));C.filters.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));C.filters.define("lowercase",(t=>t=t.toLowerCase()));const j=C;const I=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const S=class{constructor(t){e(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new w;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(v.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit(this.indexResults)}),200)};this.makeAppliedFilters=()=>{const t=[];const i=i=>{Object.values(i).forEach((i=>{if(i.value&&i.value.length){const e=t.find((t=>t.name===i.facetName));if(!e)t.push({name:i.facetName,values:[...i.value]});else e.values=[...e.values,...i.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(v.Init===t)this.clearAllFacetFilters();const i={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0};if(this.searchIndex.filters)i.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)i.hitsPerPage=this.searchIndex.hitsPerPage;let e=await this.algoliaIndex.search(this.query,i);e=this.fixDomain(e);this.changeEvent=t;if(t===v.Init||!this.indexResults){this.indexResults={currentPage:0,totalHits:e.nbHits,hitsPerPage:null,origFilters:e.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index}}this.indexResults.dynFilters=e.facets;this.indexResults.results=e.hits;this.indexResults.totalHitsWithFilters=e.nbHits;this.indexResults.currentPage=e.page;this.indexResults.totalPages=e.nbPages;this.indexResults.hitsPerPage=e.hitsPerPage;this.indexResults.query=e.query;if(this.changeEvent!==v.Page&&this.changeEvent!==v.Replica){this.facets=e.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.resultsEmitterEle=undefined;this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=v.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplEngine=j;this.tplRenderFn=j.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}async removeFilters(t,i){if(!t&&!i)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((e=>{if(t&&this._dynFacetFilters[e].facetName===t){if(!i)this._dynFacetFilters[e].element.value="";else{this._dynFacetFilters[e].element.value=this._dynFacetFilters[e].value.filter((t=>t!==i))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let i=this.resultsPage;if(t){t.stopPropagation();i=t.detail.page}i=Math.min(this.indexResults.totalPages-1,i);i=Math.max(i,0);if(this.indexResults.currentPage===i)return;this.indexResults.currentPage=i;await this.algoliaSearch(v.Page)}async onFilterChange(t){t.stopPropagation();const i={};const e=t.detail;e.element=t.target;if(this.indexResults){if(this.staticFacetFilters[e.filterId])this.staticFacetFilters[e.filterId]=e;else{i[e.filterId]=e;this._dynFacetFilters=Object.assign(Object.assign({},this._dynFacetFilters),i)}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[e.filterId]=e;this.filterChanged=e.value&&e.value.length?e.filterId:"all";this.resetPage();this.algoliaSearch(v.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(v.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=o(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(v.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const i=i=>{let e;let s;Object.keys(i).forEach((n=>{e=i[n];t[n]=t[n]||{name:e.facetName,or:[],and:[],not:[]};s=t[n][e.operator];if(e.value&&e.value.length){t[n][e.operator]=[...s,...e.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);const e=(t,i)=>{if(i.indexOf(" ")>-1)return t+':"'+i+'"';else return t+":"+i};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((i=>{n=t;r=t.name;if(i==="or"||i==="and"){if(n[i].length){s.push("( "+n[i].map((t=>{if(t.length)return e(r,t)})).join(" "+i.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[i].map((t=>{if(t.length)return"NOT "+e(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const i=document.createElement("div");i.innerHTML=this.tpl;const e=[];this.placedAlgoliaEles=[];Array.from(i.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,i)=>{const s=document.createElement("div");s.dataset.placeholderId=i.toString();s.classList.add("nano-ele-placeholder");e.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(i.innerHTML.replace(/&gt;/gm,">").replace(/&lt;/gm,"<").replace(/&amp;/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(e[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(e[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((i=>{const e=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>i("tpl updated")),500);t.removeEventListener("nanoTplUpdated",e)}};t.addEventListener("nanoTplUpdated",e)}))}componentWillLoad(){r((t=>{this.tplSlot=l(this.host,'[slot="template"]')[0];this.outputSlot=l(this.host,'[slot="output"]')[0];this.slottedInput=l(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!l(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();y.create(this,this.wormholeState);if(this.storeId){u.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);u.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=p(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return a(h,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&a("div",{hidden:!this.isLoading},a("slot",{name:"loader"})),!this.hasLoadSlot&&a("div",{class:{loader:true,loading:this.isLoading}},a("nano-spinner",{overlay:true,type:"circle"})),a(y.Provider,{state:t},a("slot",{name:"search-input"}),a("div",{class:"results-container","aria-live":"polite"},a("div",{ref:t=>this.resultsDiv=t,class:"results"},a("slot",{name:"output"})))),a("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},a("slot",null)))}get host(){return t(this)}static get watchers(){return{_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};S.style=I;export{S as nano_algolia};
5
- //# sourceMappingURL=p-80e42c89.entry.js.map
4
+ import{g as t,e as i,r as e,c as s,w as n,d as r,h as a,a as h}from"./p-bf91c50e.js";import{a as o}from"./p-ed6adde2.js";import{g as l}from"./p-257432ff.js";import{C as u}from"./p-909a424c.js";import{b as f,c,a as d}from"./p-69a3e911.js";import{d as p}from"./p-9746b0a5.js";import{S as v}from"./p-ed2e6f32.js";var m=new Map;var g=function(t,i){var e=t.fields,s=t.updater;e.forEach((function(t){s(t,i[t])}))};var y={create:function(i,e){var s=t(i);var n=new Map;var r={wormholes:n,state:e};m.set(i,r);var a=i.connectedCallback;i.connectedCallback=function(){m.set(i,r);if(a){a.call(i)}};var h=i.disconnectedCallback;i.disconnectedCallback=function(){m.delete(i);if(h){h.call(i)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var i=t.detail,e=i.consumer,s=i.onOpen;if(n.has(e))return;if(typeof e!=="symbol"){var a=e.connectedCallback,h=e.disconnectedCallback;e.connectedCallback=function(){n.set(e,t.detail);if(a){a.call(e)}};e.disconnectedCallback=function(){n.delete(e);if(h){h.call(e)}}}n.set(e,t.detail);g(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(e)}))}));s.addEventListener("closeWormhole",(function(t){var i=t.detail;n.delete(i)}))},Provider:function(t,e){var s=t.state;var n=i();if(m.has(n)){var r=m.get(n);r.state=s;r.wormholes.forEach((function(t){g(t,s)}))}return e}};class b{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((i,e)=>{this.queue.push({promise:t,resolve:i,reject:e});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((i=>{this.workingOnPromise=false;t.resolve(i);this.dequeue()})).catch((i=>{this.workingOnPromise=false;t.reject(i);this.dequeue()}))}catch(i){this.workingOnPromise=false;t.reject(i);this.dequeue()}return true}}b.pendingPromise=false;var w=c((function(t,i){!function(t,e){e(i)}(d,(function(t){function i(t){var e,s,n=new Error(t);return e=n,s=i.prototype,Object.setPrototypeOf?Object.setPrototypeOf(e,s):e.__proto__=s,n}function e(t,e,s){var n=e.slice(0,s).split(/\n/),r=n.length,a=n[r-1].length+1;throw i(t+=" at line "+r+" col "+a+":\n\n "+e.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^")}i.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,n=!1;try{n=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function r(t,i){return Object.prototype.hasOwnProperty.call(t,i)}function a(t,i,e){for(var s in i)r(i,s)&&(null==i[s]||"object"!=typeof i[s]||"storage"!==s&&"prefixes"!==s||e?t[s]=i[s]:t[s]=a({},i[s]));return t}var h=/^async +/,o=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,f=/[.*+\-?^${}()|[\]\\]/g;function c(t){return f.test(t)?t.replace(f,"\\$&"):t}function d(t,s){s.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),o.lastIndex=0,l.lastIndex=0,u.lastIndex=0;var n=s.prefixes,r=[n.h,n.b,n.i,n.r,n.c,n.e].reduce((function(t,i){return t&&i?t+"|"+c(i):i?c(i):t}),""),a=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+c(s.tags[1])+")","g"),f=new RegExp("([^]*?)"+c(s.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),d=0,p=!1;function v(i,n){var r,c={f:[]},v=0,m="c";function g(i){var n=t.slice(d,i),r=n.trim();if("f"===m)"safe"===r?c.raw=!0:s.async&&h.test(r)?(r=r.replace(h,""),c.f.push([r,"",!0])):c.f.push([r,""]);else if("fp"===m)c.f[c.f.length-1][1]+=r;else if("err"===m){if(r){var a=n.search(/\S/);e("invalid syntax",t,d+a)}}else c[m]=r;d=i+1}for("h"===n||"b"===n||"c"===n?m="n":"r"===n&&(c.raw=!0,n="i"),a.lastIndex=d;null!==(r=a.exec(t));){var y=r[1],b=r[2],w=r[3],x=r[4],F=r[5],C=r.index;if(y)"("===y?(0===v&&("n"===m?(g(C),m="p"):"f"===m&&(g(C),m="fp")),v++):")"===y?0===--v&&"c"!==m&&(g(C),m="err"):0===v&&"|"===y?(g(C),m="f"):"=>"===y&&(g(C),d+=1,m="res");else if(b){if("/*"===b){var j=t.indexOf("*/",a.lastIndex);-1===j&&e("unclosed comment",t,r.index),a.lastIndex=j+2}else if("'"===b){l.lastIndex=r.index,l.exec(t)?a.lastIndex=l.lastIndex:e("unclosed string",t,r.index)}else if('"'===b){u.lastIndex=r.index,u.exec(t)?a.lastIndex=u.lastIndex:e("unclosed string",t,r.index)}else if("`"===b){o.lastIndex=r.index,o.exec(t)?a.lastIndex=o.lastIndex:e("unclosed string",t,r.index)}}else if(w)return g(C),d=C+r[0].length,f.lastIndex=d,p=F,x&&"h"===n&&(n="s"),c.t=n,c}return e("unclosed tag",t,i),c}var m=function r(a,o){a.b=[],a.d=[];var l,u=!1,c=[];function m(t,i){t&&(t=function(t,i,e,s){var n,r;return"string"==typeof i.autoTrim?n=r=i.autoTrim:Array.isArray(i.autoTrim)&&(n=i.autoTrim[1],r=i.autoTrim[0]),(e||!1===e)&&(n=e),(s||!1===s)&&(r=s),"slurp"===n&&"slurp"===r?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,s,p,i))&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),c.push(t))}for(;null!==(l=f.exec(t));){var g,y=l[1],b=l[2],w=l[3]||"";for(var x in n)if(n[x]===w){g=x;break}m(y,b),d=l.index+l[0].length,g||e("unrecognized tag type: "+w,t,d);var F=v(l.index,g),C=F.t;if("h"===C){var j=F.n||"";s.async&&h.test(j)&&(F.a=!0,F.n=j.replace(h,"")),F=r(F),c.push(F)}else if("c"===C){if(a.n===F.n)return u?(u.d=c,a.b.push(u)):a.d=c,a;e("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===C){u?(u.d=c,a.b.push(u)):a.d=c;var I=F.n||"";s.async&&h.test(I)&&(F.a=!0,F.n=I.replace(h,"")),u=F,c=[]}else if("s"===C){var S=F.n||"";s.async&&h.test(S)&&(F.a=!0,F.n=S.replace(h,"")),c.push(F)}else c.push(F)}if(!o)throw i('unclosed helper "'+a.n+'"');return m(t.slice(d,t.length),!1),a.d=c,a}({f:[]},!0);if(s.plugins)for(var g=0;g<s.plugins.length;g++){var y=s.plugins[g];y.processAST&&(m.d=y.processAST(m.d,s))}return m.d}function p(t,i){var e=d(t,i),s="var tR='';"+(i.useWith?"with("+i.varName+"||{}){":"")+b(e,i)+"if(cb){cb(null,tR)} return tR"+(i.useWith?"}":"");if(i.plugins)for(var n=0;n<i.plugins.length;n++){var r=i.plugins[n];r.processFnString&&(s=r.processFnString(s,i))}return s}function v(t,i){for(var e=0;e<i.length;e++){var s=i[e][0],n=i[e][1];t=(i[e][2]?"await ":"")+"c.l('F','"+s+"')("+t,n&&(t+=","+n),t+=")"}return t}function m(t,i,e,s,n,r){var a="{exec:"+(n?"async ":"")+y(e,i,t)+",params:["+s+"]";return r&&(a+=",name:'"+r+"'"),n&&(a+=",async:true"),a+="}"}function g(t,i){for(var e="[",s=0;s<t.length;s++){var n=t[s];e+=m(i,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(e+=",")}return e+="]"}function y(t,i,e){return"function("+i+"){var tR='';"+b(t,e)+"return tR}"}function b(t,i){for(var e=0,s=t.length,n="";e<s;e++){var r=t[e];if("string"==typeof r){n+="tR+='"+r+"';"}else{var a=r.t,h=r.c||"",o=r.f,l=r.n||"",u=r.p||"",f=r.res||"",c=r.b,d=!!r.a;if("i"===a){i.defaultFilter&&(h="c.l('F','"+i.defaultFilter+"')("+h+")");var p=v(h,o);!r.raw&&i.autoEscape&&(p="c.l('F','e')("+p+")"),n+="tR+="+p+";"}else if("h"===a)if(i.storage.nativeHelpers.get(l))n+=i.storage.nativeHelpers.get(l)(r,i);else{var y=(d?"await ":"")+"c.l('H','"+l+"')("+m(i,f,r.d,u,d);y+=c?","+g(c,i):",[]",n+="tR+="+v(y+=",c)",o)+";"}else"s"===a?n+="tR+="+v((d?"await ":"")+"c.l('H','"+l+"')({params:["+u+"]},[],c)",o)+";":"e"===a&&(n+=h+"\n")}}return n}var w=function(){function t(t){this.cache=t}return t.prototype.define=function(t,i){this.cache[t]=i},t.prototype.get=function(t){return this.cache[t]},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.reset=function(){this.cache={}},t.prototype.load=function(t){a(this.cache,t,!0)},t}();function x(t,e,s,n){if(e&&e.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(s&&s.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept filters")}var F={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function C(t){return F[t]}var j=new w({}),I=new w({each:function(t,i){var e="",s=t.params[0];if(x("each",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r){s(i[e],e).then((function(a){n+=a,e===i.length-1?r(n):t(i,e+1,s,n,r)}))}(s,0,t.exec,e,i)}));for(var n=0;n<s.length;n++)e+=t.exec(s[n],n);return e},foreach:function(t,i){var e=t.params[0];if(x("foreach",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r,a){n(e[s],i[e[s]]).then((function(h){r+=h,s===e.length-1?a(r):t(i,e,s+1,n,r,a)}))}(e,Object.keys(e),0,t.exec,"",i)}));var s="";for(var n in e)r(e,n)&&(s+=t.exec(n,e[n]));return s},include:function(t,e,s){x("include",e,!1);var n=s.storage.templates.get(t.params[0]);if(!n)throw i('Could not fetch template "'+t.params[0]+'"');return n(t.params[1],s)},extends:function(t,e,s){var n=t.params[1]||{};n.content=t.exec();for(var r=0;r<e.length;r++){var a=e[r];n[a.name]=a.exec()}var h=s.storage.templates.get(t.params[0]);if(!h)throw i('Could not fetch template "'+t.params[0]+'"');return h(n,s)},useScope:function(t,i){return x("useScope",i,!1),t.exec(t.params[0])}}),S=new w({if:function(t,i){x("if",!1,t.f,!0);var e="if("+t.p+"){"+b(t.d,i)+"}";if(t.b)for(var s=0;s<t.b.length;s++){var n=t.b[s];"else"===n.n?e+="else{"+b(n.d,i)+"}":"elif"===n.n&&(e+="else if("+n.p+"){"+b(n.d,i)+"}")}return e},try:function(t,e){if(x("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw i("native helper 'try' only accepts 1 block, 'catch'");var s="try{"+b(t.d,e)+"}",n=t.b[0];return s+="catch"+(n.res?"("+n.res+")":"")+"{"+b(n.d,e)+"}"},block:function(t,i){return x("block",t.b,t.f,!0),"if(!"+i.varName+"["+t.p+"]){tR+=("+y(t.d,"",i)+")()}else{tR+="+i.varName+"["+t.p+"]}"}}),z=new w({e:function(t){var i=String(t);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,C):i}}),O={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){var s=this.storage.helpers.get(e);if(s)return s;throw i("Can't find helper '"+e+"'")}if("F"===t){var n=this.storage.filters.get(e);if(n)return n;throw i("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:I,nativeHelpers:S,filters:z,templates:j},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function R(t,i){var e={};return a(e,O),i&&a(e,i),t&&a(e,t),e.l.bind(e),e}function A(t,e){var s=R(e||{}),r=Function;if(s.async){if(!n)throw i("This environment doesn't support async/await");r=n}try{return new r(s.varName,"c","cb",p(t,s))}catch(e){throw e instanceof SyntaxError?i("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+p(t,s)):e}}function k(t,i){var e;return i.cache&&i.name&&i.storage.templates.get(i.name)?i.storage.templates.get(i.name):(e="function"==typeof t?t:A(t,i),i.cache&&i.name&&i.storage.templates.define(i.name,e),e)}O.l.bind(O),t.compile=A,t.compileScope=b,t.compileScopeIntoFunction=y,t.compileToString=p,t.defaultConfig=O,t.filters=z,t.getConfig=R,t.helpers=I,t.nativeHelpers=S,t.parse=d,t.render=function(t,e,n,r){var a=R(n||{});if(!a.async)return k(t,a)(e,a);if(!r){if("function"==typeof s)return new s((function(i,s){try{i(k(t,a)(e,a))}catch(t){s(t)}}));throw i("Please provide a callback function, this env doesn't support Promises")}try{k(t,a)(e,a,r)}catch(t){return r(t)}},t.templates=j,Object.defineProperty(t,"__esModule",{value:!0})}))}));const x=f(w);const F=Object.freeze(Object.assign(Object.create(null),w,{default:x}));const C=F;C.filters.define("date_long",((t,i={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=e.toLocaleDateString("en-GB",i);return t}));C.filters.define("date_short",((t,i="d/m/y")=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=i.replace(/(d)/,e.getDate().toString());t=t.replace(/(m)/,(e.getMonth()+1).toString());t=t.replace(/(y)/,e.getFullYear().toString());return t}));C.filters.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));C.filters.define("trim_to",((t,i=100)=>{if(!t)return;if(t.length<=i)return t;return t.substr(0,i)+"..."}));C.filters.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));C.filters.define("abs_url",((t,i=null,e)=>{if(!i)return t;if(!t)return;let s=undefined;if(i.domains&&e&&e.origin){const t=i.domains.find((t=>t.origin===e.origin));s=t?t.domain:""}else if(i.domain)s=i.domain;if(!s)return t;return t.match(/^http/)?t:location.protocol+"//"+s+t}));C.filters.define("replace",((t,i,e)=>t.replace(i,e)));C.filters.define("remove_spaces",(t=>t.replace(/ /g,"_")));C.filters.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));C.filters.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));C.filters.define("lowercase",(t=>t=t.toLowerCase()));const j=C;const I=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const S=class{constructor(t){e(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new b;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(v.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit(this.indexResults)}),200)};this.makeAppliedFilters=()=>{const t=[];const i=i=>{Object.values(i).forEach((i=>{if(i.value&&i.value.length){const e=t.find((t=>t.name===i.facetName));if(!e)t.push({name:i.facetName,values:[...i.value]});else e.values=[...e.values,...i.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(v.Init===t)this.clearAllFacetFilters();const i={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0};if(this.searchIndex.filters)i.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)i.hitsPerPage=this.searchIndex.hitsPerPage;let e=await this.algoliaIndex.search(this.query,i);e=this.fixDomain(e);this.changeEvent=t;if(t===v.Init||!this.indexResults){this.indexResults={currentPage:0,totalHits:e.nbHits,hitsPerPage:null,origFilters:e.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index}}this.indexResults.dynFilters=e.facets;this.indexResults.results=e.hits;this.indexResults.totalHitsWithFilters=e.nbHits;this.indexResults.currentPage=e.page;this.indexResults.totalPages=e.nbPages;this.indexResults.hitsPerPage=e.hitsPerPage;this.indexResults.query=e.query;if(this.changeEvent!==v.Page&&this.changeEvent!==v.Replica){this.facets=e.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.resultsEmitterEle=undefined;this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=v.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplEngine=j;this.tplRenderFn=j.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}async removeFilters(t,i){if(!t&&!i)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((e=>{if(t&&this._dynFacetFilters[e].facetName===t){if(!i)this._dynFacetFilters[e].element.value="";else{this._dynFacetFilters[e].element.value=this._dynFacetFilters[e].value.filter((t=>t!==i))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let i=this.resultsPage;if(t){t.stopPropagation();i=t.detail.page}i=Math.min(this.indexResults.totalPages-1,i);i=Math.max(i,0);if(this.indexResults.currentPage===i)return;this.indexResults.currentPage=i;await this.algoliaSearch(v.Page)}async onFilterChange(t){t.stopPropagation();const i={};const e=t.detail;e.element=t.target;if(this.indexResults){if(this.staticFacetFilters[e.filterId])this.staticFacetFilters[e.filterId]=e;else{i[e.filterId]=e;this._dynFacetFilters=Object.assign(Object.assign({},this._dynFacetFilters),i)}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[e.filterId]=e;this.filterChanged=e.value&&e.value.length?e.filterId:"all";this.resetPage();this.algoliaSearch(v.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(v.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=o(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(v.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const i=i=>{let e;let s;Object.keys(i).forEach((n=>{e=i[n];t[n]=t[n]||{name:e.facetName,or:[],and:[],not:[]};s=t[n][e.operator];if(e.value&&e.value.length){t[n][e.operator]=[...s,...e.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);const e=(t,i)=>{if(i.indexOf(" ")>-1)return t+':"'+i+'"';else return t+":"+i};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((i=>{n=t;r=t.name;if(i==="or"||i==="and"){if(n[i].length){s.push("( "+n[i].map((t=>{if(t.length)return e(r,t)})).join(" "+i.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[i].map((t=>{if(t.length)return"NOT "+e(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const i=document.createElement("div");i.innerHTML=this.tpl;const e=[];this.placedAlgoliaEles=[];Array.from(i.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,i)=>{const s=document.createElement("div");s.dataset.placeholderId=i.toString();s.classList.add("nano-ele-placeholder");e.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(i.innerHTML.replace(/&gt;/gm,">").replace(/&lt;/gm,"<").replace(/&amp;/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(e[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(e[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((i=>{const e=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>i("tpl updated")),500);t.removeEventListener("nanoTplUpdated",e)}};t.addEventListener("nanoTplUpdated",e)}))}componentWillLoad(){r((t=>{this.tplSlot=l(this.host,'[slot="template"]')[0];this.outputSlot=l(this.host,'[slot="output"]')[0];this.slottedInput=l(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!l(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();y.create(this,this.wormholeState);if(this.storeId){u.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);u.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=p(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return a(h,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&a("div",{hidden:!this.isLoading},a("slot",{name:"loader"})),!this.hasLoadSlot&&a("div",{class:{loader:true,loading:this.isLoading}},a("nano-spinner",{overlay:true,type:"circle"})),a(y.Provider,{state:t},a("slot",{name:"search-input"}),a("div",{class:"results-container","aria-live":"polite"},a("div",{ref:t=>this.resultsDiv=t,class:"results"},a("slot",{name:"output"})))),a("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},a("slot",null)))}get host(){return t(this)}static get watchers(){return{_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};S.style=I;export{S as nano_algolia};
5
+ //# sourceMappingURL=p-f28c802d.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{r as t,c as i,h as s,a as e,g as h}from"./p-f84612d4.js";import{c as r}from"./p-8e39d4ee.js";const a=class{constructor(s){t(this,s);this.nanoPayloadChange=i(this,"nanoPayloadChange",7);this.nanoSubmit=i(this,"nanoSubmit",7);this.nanoInvalid=i(this,"nanoInvalid",7);this.allFields=[];this.nanoFieldSelector=`\n nano-input,\n nano-select,\n nano-file-upload,\n nano-date-input,\n nano-checkbox\n `;this.hasSetStore=false;this.internalValidate=false;this.handleStoreChange=async(t,i)=>{const s=this.allFields.find((i=>this.getName(i)===t));if(s&&(s.tagName==="NANO-CHECKBOX"||["radio","checkbox"].includes(s.type))){this.storeToFields([s])}else if(s&&(s.tagName==="NANO-FILE-UPLOAD"&&!this.fileStateEqual(t,s)||s.tagName!=="NANO-FILE-UPLOAD"&&s.value!==i)){this.storeToFields([s])}if(this.validateOn==="dirty"&&this.dirty){this.internalValidate=true;await this.validateAllFields();this._valid=this.activeForm.checkValidity();this.internalValidate=false}this.nanoPayloadChange.emit(this._store.state)};this.handleFieldChange=t=>{if(!this.nanoFields.includes(t.target))return;this._dirty=true;this.fieldsToStore([t.target])};this.handlePlainFieldChange=t=>{if(!this.plainFields.includes(t.target))return;this.fieldsToStore([t.target])};this.handleFormInvalid=async t=>{if(!this.plainFields.includes(t.target)){t.preventDefault()}this._valid=false;if(this.internalValidate)return;if(this.validateOn==="submitThenDirty")this.validateOn="dirty";this.submitted=true;await this.validateAllFields();this.internalValidate=true;this._valid=this.activeForm.checkValidity();this.internalValidate=false;if(this.validateOn==="submit"){if(this._valid){this.submitForm();return}}this.scrollToFirstInvalid();this.nanoInvalid.emit()};this.handleSubmit=async t=>{t.preventDefault();if(this.validateOn==="submitThenDirty")this.validateOn="dirty";this.submitted=true;await this.validateAllFields();this.internalValidate=true;this._valid=this.activeForm.checkValidity();this.internalValidate=false;if(!this._valid){this.scrollToFirstInvalid();return}this.submitForm()};this.submitted=false;this.userForm=undefined;this.validateOn="submitThenDirty";this.scrollToInvalid=true;this._dirty=false;this._valid=undefined;this._store=undefined;this.extraFieldSelector="input, select, textarea";this.validation=undefined}userFormChange(){if(!!this.userForm)this.activeForm=this.userForm}get activeForm(){return this._activeForm}set activeForm(t){if(!t)return;if(this._activeForm){this._activeForm.removeEventListener("invalid",this.handleFormInvalid,true)}t.addEventListener("invalid",this.handleFormInvalid,true);this._activeForm=t}validateOnChange(){this.nanoFields.forEach((t=>{if(t.tagName==="NANO-CHECKBOX"){const i=t.closest("nano-checkbox-group");if(i)i.validateOn=this.validateOn}else{t.validateOn=this.validateOn}}))}get dirty(){return this._dirty}get valid(){return this._valid}get store(){return this._store}get payload(){return this._store.state}get showValidation(){return this.validateOn==="dirty"&&this.dirty||this.submitted}get validationState(){const t=[];this.allFields.forEach((async i=>{const s=t.find((t=>t.name===this.getName(i)));let e;let h;if(s){if(i.validationMessage){e=i;s.validityMessage=e.validationMessage.length?e.validationMessage:s.validityMessage;this.internalValidate=true;if(s.valid&&!e.checkValidity())s.valid=false;this.internalValidate=false}else if(i.validityMessage){h=i;s.validityMessage=h.validityMessage.length?h.validityMessage:h.validityMessage;if(s.valid&&h.invalid)s.valid=false}if(!s.fields.find((t=>t===i)))s.fields.push(i)}let r;let a;if(i.checkValidity){e=i;this.internalValidate=true;r=e.checkValidity();this.internalValidate=false;a=e.validationMessage}else{h=i;r=!h.invalid;a=h.validityMessage}t.push({fields:[i],name:this.getName(i),value:this._store.state[this.getName(i)],dirty:false,valid:r,validityMessage:a})}));return t}async setStore(t){this.hasSetStore=true;Object.entries(t).forEach((([t,i])=>{this.store.state[t]=i}))}async setCustomValidity(t){return await Promise.all(Object.entries(t).map((async([t,i])=>{const s=this.allFields.find((i=>this.getName(i)===t));if(!!s)await this.setFieldError(s,i)})))}async resetValidity(){return await Promise.all(this.allFields.map((async t=>await this.setFieldError(t,""))))}attachSlotObserver(){if(!!this.mo)return;const t=this.mo=new MutationObserver((t=>{const i=this.host.querySelector("form");if(i&&i!==this.activeForm)this.activeForm=i;this.setupFields()}));t.observe(this.host,{childList:true,attributes:true,attributeFilter:["name"],subtree:true})}getName(t){return t.name||t.getAttribute("name")}setupFields(){let t=Array.from(this.host.querySelectorAll(this.nanoFieldSelector));let i=Array.from(this.host.querySelectorAll(this.extraFieldSelector)).filter((t=>!t.closest(this.nanoFieldSelector)));t=t.filter((t=>!!this.getName(t)&&!!this.getName(t).length));i=i.filter((t=>!!this.getName(t)&&!!this.getName(t).length));if(![...t,...i].filter((t=>!this.allFields.includes(t))).length)return;this.nanoFields=t;this.plainFields=i;this.allFields=[...t,...i];this.storeToFields(this.allFields);this.validateOnChange();this.fieldsToStore(this.allFields,true);this.nanoPayloadChange.emit(this._store.state)}storeToFields(t){t.forEach((t=>{var i;const s=this.getName(t);if(!s.length||typeof this._store.state[s]==="undefined")return;if(t.tagName==="NANO-CHECKBOX"||["radio","checkbox"].includes(t.type)){const i=this.allFields.filter((i=>this.getName(t)===this.getName(i)));if(i[0].type==="radio"||i[0].type==="segment"||i[0].type==="segment-pill"){i.forEach((t=>{if(this._store.state[s]===t.value)t.checked=true;else t.checked=false}))}else if(Array.isArray(this._store.state[s])){i.forEach((t=>{if(this._store.state[s].includes(t.value))t.checked=true;else t.checked=false}))}else{i.forEach((t=>{if(this._store.state[s]===t.value)t.checked=true;else t.checked=false}))}return}if(t.tagName==="NANO-FILE-UPLOAD"){const e=t;if(!((i=e.files)===null||i===void 0?void 0:i.length))e.files=this._store.state[s];return}t.value=this._store.state[s]}))}fieldsToStore(t,i=false){t.forEach((t=>{const s=this.getName(t);if(!s.length)return;if(!!this._store.state[s]&&this.hasSetStore&&i){return}if(t.tagName==="NANO-CHECKBOX"||["radio","checkbox"].includes(t.type)){const i=t;if(i.type==="radio"||i.type==="segment"||i.type==="segment-pill"){if(i.checked)this._store.state[s]=i.value}else if(this.allFields.filter((t=>this.getName(t)===s&&(t.tagName==="NANO-CHECKBOX"||t.type==="checkbox"))).length>1){const t=Array.isArray(this._store.state[s])?this._store.state[s]:[];if(i.checked){if(!this._store.state[s].includes(i.value)){this._store.state[s]=[...t,i.value]}}else{this._store.state[s]=t.filter((t=>t!==i.value))}}else{if(i.checked)this._store.state[s]=i.value;else this._store.state[s]=""}return}if(t.tagName==="NANO-FILE-UPLOAD"){const i=t;if(!this.fileStateEqual(s,i))this._store.state[s]=i.files;return}this._store.state[s]=t.value}))}fileStateEqual(t,i){return JSON.stringify(this._store.state[t])===JSON.stringify(i.files)||this._store.state[t]==i.files}async validate(t,i){if(!this.validation)return;const s=this.validation(t,i,this._store.state);if(!s)return;await Promise.all(Object.entries(s).map((async([t,i])=>i.fields.map((async s=>{const e=this.allFields.find((t=>this.getName(t)===s));let h=e;if(e.tagName==="NANO-CHECKBOX"){const t=e.closest("nano-checkbox-group");h=t||e}if((h.validityMessage||h.validationMessage)===t&&i.valid){await this.setFieldError(h,"")}else if(!i.valid){await this.setFieldError(h,t)}})))))}async validateAllFields(){await Object.entries(this._store.state).reduce((async(t,[i,s])=>{await t;await this.validate(i,s)}),undefined)}async setFieldError(t,i){if(t["showError"]){await t.showError(i)}else if(t["setError"])await t.setError(i);else t.setCustomValidity(i)}scrollToFirstInvalid(){if(!this.scrollToInvalid)return;setTimeout((()=>{const t=this.validationState.find((t=>!t.valid));if(!t)return;t.fields[0].scrollIntoView({behavior:"smooth",block:"nearest"})}),200)}submitForm(){const t=this.nanoSubmit.emit();if(t.defaultPrevented)return;this.activeForm.submit()}connectedCallback(){this.userForm=this.host.querySelector("form");this._store=r({})}componentDidLoad(){requestAnimationFrame((()=>{this.setupFields();this.attachSlotObserver();this.host.addEventListener("nanoChange",this.handleFieldChange);this.host.addEventListener("input",this.handlePlainFieldChange);this.host.addEventListener("change",this.handlePlainFieldChange);this.host.addEventListener("submit",this.handleSubmit);this._store.on("set",this.handleStoreChange)}))}disconnectedCallback(){if(this.mo)this.mo.disconnect();this.host.removeEventListener("nanoChange",this.handleFieldChange);this.host.removeEventListener("input",this.handlePlainFieldChange);this.host.removeEventListener("change",this.handlePlainFieldChange);this.host.removeEventListener("submit",this.handleSubmit);this._store.reset();if(this.activeForm)this.activeForm.removeEventListener("invalid",this.handleFormInvalid,true)}render(){return s(e,null,this.userForm&&s("slot",null),!this.userForm&&s("form",{ref:t=>this.activeForm=t},s("slot",null)))}get host(){return h(this)}static get watchers(){return{userForm:["userFormChange"],validateOn:["validateOnChange"],extraFieldSelector:["attachSlotObserver"]}}};export{a as nano_field_validator};
5
- //# sourceMappingURL=p-4971a1f1.entry.js.map
4
+ import{r as t,c as i,h as s,a as e,g as h}from"./p-bf91c50e.js";import{c as r}from"./p-d7ff8f12.js";const a=class{constructor(s){t(this,s);this.nanoPayloadChange=i(this,"nanoPayloadChange",7);this.nanoSubmit=i(this,"nanoSubmit",7);this.nanoInvalid=i(this,"nanoInvalid",7);this.allFields=[];this.nanoFieldSelector=`\n nano-input,\n nano-select,\n nano-file-upload,\n nano-date-input,\n nano-checkbox\n `;this.hasSetStore=false;this.internalValidate=false;this.handleStoreChange=async(t,i)=>{const s=this.allFields.find((i=>this.getName(i)===t));if(s&&(s.tagName==="NANO-CHECKBOX"||["radio","checkbox"].includes(s.type))){this.storeToFields([s])}else if(s&&(s.tagName==="NANO-FILE-UPLOAD"&&!this.fileStateEqual(t,s)||s.tagName!=="NANO-FILE-UPLOAD"&&s.value!==i)){this.storeToFields([s])}if(this.validateOn==="dirty"&&this.dirty){this.internalValidate=true;await this.validateAllFields();this._valid=this.activeForm.checkValidity();this.internalValidate=false}this.nanoPayloadChange.emit(this._store.state)};this.handleFieldChange=t=>{if(!this.nanoFields.includes(t.target))return;this._dirty=true;this.fieldsToStore([t.target])};this.handlePlainFieldChange=t=>{if(!this.plainFields.includes(t.target))return;this.fieldsToStore([t.target])};this.handleFormInvalid=async t=>{if(!this.plainFields.includes(t.target)){t.preventDefault()}this._valid=false;if(this.internalValidate)return;if(this.validateOn==="submitThenDirty")this.validateOn="dirty";this.submitted=true;await this.validateAllFields();this.internalValidate=true;this._valid=this.activeForm.checkValidity();this.internalValidate=false;if(this.validateOn==="submit"){if(this._valid){this.submitForm();return}}this.scrollToFirstInvalid();this.nanoInvalid.emit()};this.handleSubmit=async t=>{t.preventDefault();if(this.validateOn==="submitThenDirty")this.validateOn="dirty";this.submitted=true;await this.validateAllFields();this.internalValidate=true;this._valid=this.activeForm.checkValidity();this.internalValidate=false;if(!this._valid){this.scrollToFirstInvalid();return}this.submitForm()};this.submitted=false;this.userForm=undefined;this.validateOn="submitThenDirty";this.scrollToInvalid=true;this._dirty=false;this._valid=undefined;this._store=undefined;this.extraFieldSelector="input, select, textarea";this.validation=undefined}userFormChange(){if(!!this.userForm)this.activeForm=this.userForm}get activeForm(){return this._activeForm}set activeForm(t){if(!t)return;if(this._activeForm){this._activeForm.removeEventListener("invalid",this.handleFormInvalid,true)}t.addEventListener("invalid",this.handleFormInvalid,true);this._activeForm=t}validateOnChange(){this.nanoFields.forEach((t=>{if(t.tagName==="NANO-CHECKBOX"){const i=t.closest("nano-checkbox-group");if(i)i.validateOn=this.validateOn}else{t.validateOn=this.validateOn}}))}get dirty(){return this._dirty}get valid(){return this._valid}get store(){return this._store}get payload(){return this._store.state}get showValidation(){return this.validateOn==="dirty"&&this.dirty||this.submitted}get validationState(){const t=[];this.allFields.forEach((async i=>{const s=t.find((t=>t.name===this.getName(i)));let e;let h;if(s){if(i.validationMessage){e=i;s.validityMessage=e.validationMessage.length?e.validationMessage:s.validityMessage;this.internalValidate=true;if(s.valid&&!e.checkValidity())s.valid=false;this.internalValidate=false}else if(i.validityMessage){h=i;s.validityMessage=h.validityMessage.length?h.validityMessage:h.validityMessage;if(s.valid&&h.invalid)s.valid=false}if(!s.fields.find((t=>t===i)))s.fields.push(i)}let r;let a;if(i.checkValidity){e=i;this.internalValidate=true;r=e.checkValidity();this.internalValidate=false;a=e.validationMessage}else{h=i;r=!h.invalid;a=h.validityMessage}t.push({fields:[i],name:this.getName(i),value:this._store.state[this.getName(i)],dirty:false,valid:r,validityMessage:a})}));return t}async setStore(t){this.hasSetStore=true;Object.entries(t).forEach((([t,i])=>{this.store.state[t]=i}))}async setCustomValidity(t){return await Promise.all(Object.entries(t).map((async([t,i])=>{const s=this.allFields.find((i=>this.getName(i)===t));if(!!s)await this.setFieldError(s,i)})))}async resetValidity(){return await Promise.all(this.allFields.map((async t=>await this.setFieldError(t,""))))}attachSlotObserver(){if(!!this.mo)return;const t=this.mo=new MutationObserver((t=>{const i=this.host.querySelector("form");if(i&&i!==this.activeForm)this.activeForm=i;this.setupFields()}));t.observe(this.host,{childList:true,attributes:true,attributeFilter:["name"],subtree:true})}getName(t){return t.name||t.getAttribute("name")}setupFields(){let t=Array.from(this.host.querySelectorAll(this.nanoFieldSelector));let i=Array.from(this.host.querySelectorAll(this.extraFieldSelector)).filter((t=>!t.closest(this.nanoFieldSelector)));t=t.filter((t=>!!this.getName(t)&&!!this.getName(t).length));i=i.filter((t=>!!this.getName(t)&&!!this.getName(t).length));if(![...t,...i].filter((t=>!this.allFields.includes(t))).length)return;this.nanoFields=t;this.plainFields=i;this.allFields=[...t,...i];this.storeToFields(this.allFields);this.validateOnChange();this.fieldsToStore(this.allFields,true);this.nanoPayloadChange.emit(this._store.state)}storeToFields(t){t.forEach((t=>{var i;const s=this.getName(t);if(!s.length||typeof this._store.state[s]==="undefined")return;if(t.tagName==="NANO-CHECKBOX"||["radio","checkbox"].includes(t.type)){const i=this.allFields.filter((i=>this.getName(t)===this.getName(i)));if(i[0].type==="radio"||i[0].type==="segment"||i[0].type==="segment-pill"){i.forEach((t=>{if(this._store.state[s]===t.value)t.checked=true;else t.checked=false}))}else if(Array.isArray(this._store.state[s])){i.forEach((t=>{if(this._store.state[s].includes(t.value))t.checked=true;else t.checked=false}))}else{i.forEach((t=>{if(this._store.state[s]===t.value)t.checked=true;else t.checked=false}))}return}if(t.tagName==="NANO-FILE-UPLOAD"){const e=t;if(!((i=e.files)===null||i===void 0?void 0:i.length))e.files=this._store.state[s];return}t.value=this._store.state[s]}))}fieldsToStore(t,i=false){t.forEach((t=>{const s=this.getName(t);if(!s.length)return;if(!!this._store.state[s]&&this.hasSetStore&&i){return}if(t.tagName==="NANO-CHECKBOX"||["radio","checkbox"].includes(t.type)){const i=t;if(i.type==="radio"||i.type==="segment"||i.type==="segment-pill"){if(i.checked)this._store.state[s]=i.value}else if(this.allFields.filter((t=>this.getName(t)===s&&(t.tagName==="NANO-CHECKBOX"||t.type==="checkbox"))).length>1){const t=Array.isArray(this._store.state[s])?this._store.state[s]:[];if(i.checked){if(!this._store.state[s].includes(i.value)){this._store.state[s]=[...t,i.value]}}else{this._store.state[s]=t.filter((t=>t!==i.value))}}else{if(i.checked)this._store.state[s]=i.value;else this._store.state[s]=""}return}if(t.tagName==="NANO-FILE-UPLOAD"){const i=t;if(!this.fileStateEqual(s,i))this._store.state[s]=i.files;return}this._store.state[s]=t.value}))}fileStateEqual(t,i){return JSON.stringify(this._store.state[t])===JSON.stringify(i.files)||this._store.state[t]==i.files}async validate(t,i){if(!this.validation)return;const s=this.validation(t,i,this._store.state);if(!s)return;await Promise.all(Object.entries(s).map((async([t,i])=>i.fields.map((async s=>{const e=this.allFields.find((t=>this.getName(t)===s));let h=e;if(e.tagName==="NANO-CHECKBOX"){const t=e.closest("nano-checkbox-group");h=t||e}if((h.validityMessage||h.validationMessage)===t&&i.valid){await this.setFieldError(h,"")}else if(!i.valid){await this.setFieldError(h,t)}})))))}async validateAllFields(){await Object.entries(this._store.state).reduce((async(t,[i,s])=>{await t;await this.validate(i,s)}),undefined)}async setFieldError(t,i){if(t["showError"]){await t.showError(i)}else if(t["setError"])await t.setError(i);else t.setCustomValidity(i)}scrollToFirstInvalid(){if(!this.scrollToInvalid)return;setTimeout((()=>{const t=this.validationState.find((t=>!t.valid));if(!t)return;t.fields[0].scrollIntoView({behavior:"smooth",block:"nearest"})}),200)}submitForm(){const t=this.nanoSubmit.emit();if(t.defaultPrevented)return;this.activeForm.submit()}connectedCallback(){this.userForm=this.host.querySelector("form");this._store=r({})}componentDidLoad(){requestAnimationFrame((()=>{this.setupFields();this.attachSlotObserver();this.host.addEventListener("nanoChange",this.handleFieldChange);this.host.addEventListener("input",this.handlePlainFieldChange);this.host.addEventListener("change",this.handlePlainFieldChange);this.host.addEventListener("submit",this.handleSubmit);this._store.on("set",this.handleStoreChange)}))}disconnectedCallback(){if(this.mo)this.mo.disconnect();this.host.removeEventListener("nanoChange",this.handleFieldChange);this.host.removeEventListener("input",this.handlePlainFieldChange);this.host.removeEventListener("change",this.handlePlainFieldChange);this.host.removeEventListener("submit",this.handleSubmit);this._store.reset();if(this.activeForm)this.activeForm.removeEventListener("invalid",this.handleFormInvalid,true)}render(){return s(e,null,this.userForm&&s("slot",null),!this.userForm&&s("form",{ref:t=>this.activeForm=t},s("slot",null)))}get host(){return h(this)}static get watchers(){return{userForm:["userFormChange"],validateOn:["validateOnChange"],extraFieldSelector:["attachSlotObserver"]}}};export{a as nano_field_validator};
5
+ //# sourceMappingURL=p-f47776fd.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{r as i,c as a,h as o,a as t,g as e}from"./p-f84612d4.js";import{M as s}from"./p-e04f2333.js";import{l as n,u as r}from"./p-45b7682a.js";import{h as l}from"./p-b933f3c8.js";import{C as d}from"./p-7c23e950.js";import"./p-45abbbdd.js";import"./p-257432ff.js";import"./p-9746b0a5.js";import"./p-69a3e911.js";const h=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--border-radius:var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));--content-background:#fafafa;--footer-content:#e4e6e8;--scrim-color:var(--nano-layer-overlay-dark, rgb(74 74 74 / 50%));--box-shadow:var(--nano-layer-shadow-large, 0 2px 8px rgba(0, 0, 0, 0.2));--close-button-color:#b5aea7;--width:60rem;--tint-color:#00607b;--body-padding-v:var(--nano-spacing-large, 20px);--body-padding-h:var(--nano-spacing-large, 20px);--header-padding-v:var(--nano-spacing-medium, 16px);--header-padding-h:var(--nano-spacing-large, 20px);--footer-padding-v:var(--nano-spacing-medium, 16px);--footer-padding-h:var(--nano-spacing-large, 20px)}.dialog{display:flex;align-items:center;justify-content:center;position:fixed;inset:0;z-index:var(--nano-layer-index-modal, 700)}.dialog:not(.dialog--visible){position:absolute;inline-size:1px;block-size:1px;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);overflow:hidden;pointer-events:none;visibility:hidden}.dialog__panel{display:flex;flex-direction:column;z-index:2;inline-size:var(--width);max-inline-size:calc(100% - var(--nano-spacing-xlarge, 24px));max-block-size:calc(92% - var(--nano-spacing-xlarge, 24px));background-color:var(--content-background);border-radius:var(--border-radius);box-shadow:var(--box-shadow);opacity:0;transform:scale(0.8);transition:var(--nano-transition-fast, 0.3s) opacity, var(--nano-transition-fast, 0.3s) transform}.dialog__panel:focus{outline:none}.dialog--with-ribbon .dialog__panel{-webkit-border-before:5px solid var(--tint-color);border-block-start:5px solid var(--tint-color)}.dialog--open .dialog__panel{display:flex;opacity:1;transform:none}.dialog--nodismiss .dialog__panel{animation:cannotClose 0.25s ease-in-out 1}@keyframes cannotClose{0%{transform:scale(1)}50%{transform:scale(1.08)}100%{transform:scale(1)}}.dialog__header{flex:0 0 auto;display:flex;min-inline-size:var(--width);inline-size:100%;background-color:var(--content-background);border-radius:var(--border-radius) var(--border-radius) 0 0;transition:var(--nano-transition-fast, 0.1s) box-shadow}.dialog--visible .dialog__header{min-inline-size:auto}[stuck] .dialog__header{box-shadow:var(--nano-layer-shadow-medium, 0 2px 4px rgba(0, 0, 0, 0.2))}.dialog__title{flex:1 1 auto;font-size:var(--nano-fontsize-large, 1.25rem);line-height:1.6;padding-block:var(--header-padding-v);padding-inline:var(--header-padding-h)}.dialog .dialog__close-icon{flex:0 0 auto;display:flex;align-items:center;font-size:var(--nano-fontsize-xlarge, 1.5rem);padding-block:0;padding-inline:var(--header-padding-h);--color:var(--close-button-color)}.dialog__body{padding-block:0 var(--body-padding-v);padding-inline:var(--body-padding-h)}.dialog:not(.dialog--has-header) .dialog__body{-webkit-padding-before:var(--body-padding-v);padding-block-start:var(--body-padding-v)}.dialog__body ::slotted(*){max-inline-size:100%}.dialog__body-wrap{flex:1 1 auto;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:var(--border-radius)}.dialog:not(.dialog--has-header) .dialog__body-wrap{border-radius:0 0 inherit inherit}.dialog:not(.dialog--has-footer) .dialog__body-wrap{border-radius:inherit inherit 0 0}.dialog__footer{inline-size:100%;padding-block:var(--footer-padding-v);padding-inline:var(--footer-padding-h);background:var(--footer-content);border-radius:0 0 var(--border-radius) var(--border-radius);position:relative;inset-block-start:1px}.dialog--visible .dialog__footer{min-inline-size:auto}.dialog__footer ::slotted(button){-webkit-margin-end:var(--nano-spacing-small, 8px) !important;margin-inline-end:var(--nano-spacing-small, 8px) !important}.dialog:not(.dialog--has-footer) .dialog__footer{display:none}.dialog__close-txt{color:var(--tint-color);border:none;text-decoration:underline;margin:0;text-underline-offset:4px;background-color:transparent;font:inherit;-webkit-box-align:center;cursor:pointer;font-size:var(--nano-fontsize-small, 0.875rem);padding:0.5rem;border-radius:var(--nano-border-radius-small, 2px);transition:box-shadow 100ms ease-in-out}.dialog__close-txt:focus{outline:none;box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)))}.dialog__overlay{position:fixed;inset:0;background-color:var(--scrim-color);opacity:0;transition:var(--nano-transition-fast, 0.3s) opacity;-webkit-backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px));backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px))}.dialog--open .dialog__overlay{opacity:1}";let c=0;const p=class{constructor(o){i(this,o);this.nanoShow=a(this,"nanoShow",7);this.nanoAfterShow=a(this,"nanoAfterShow",7);this.nanoHide=a(this,"nanoHide",7);this.nanoAfterHide=a(this,"nanoAfterHide",7);this.nanoInitialFocus=a(this,"nanoInitialFocus",7);this.nanoRequestClose=a(this,"nanoRequestClose",7);this.componentId=`dialog-${++c}`;this.willShow=false;this.willHide=false;this.addedTransEnd=false;this.handleKeyDown=i=>{if(i.key==="Escape"){this.requestClose()}};this.requestClose=()=>{const i=this.nanoRequestClose.emit();if(!i.defaultPrevented&&!this.noUserDismiss){this.hide()}else{this.noDismiss=true;setTimeout((i=>this.noDismiss=false),250)}};this.handleTransitionEnd=i=>{if(i.propertyName==="opacity"&&i.composedPath().find((i=>i===this.panel||i===this.overlay))){this.isVisible=this.open;this.willShow=false;this.willHide=false;this.open?this.nanoAfterShow.emit():this.nanoAfterHide.emit()}};this.handleSlotChange=()=>{this.hasFooter=l(this.host,"footer")};this.isVisible=false;this.noDismiss=false;this.hasFooter=false;this.showRibbon=true;this.open=false;this.label=undefined;this.noHeader=false;this.noFooter=false;this.noUserDismiss=false;this.storeId=undefined;this.storeMethod="url-hash";this.hoist=false}handleOpenChange(){this.open?this.show():this.hide()}handleHoistChange(){if(!this.hoist||document.body.children[0]===this.host)return;document.body.prepend(this.host)}async show(){if(this.willShow){return}const i=this.nanoShow.emit();if(i.defaultPrevented){this.open=false;return}this.originalTrigger=document.activeElement;this.willShow=true;this.isVisible=true;this.open=true;this.modal.activate();n(this.host);if(this.open){this.host.addEventListener("nanoAfterShow",(()=>{const i=this.nanoInitialFocus.emit();if(!i.defaultPrevented){this.panel.focus({preventScroll:true})}}),{once:true})}}async hide(){if(this.willHide){return}const i=this.nanoHide.emit();if(i.defaultPrevented){this.open=true;return}this.willHide=true;this.open=false;this.modal.deactivate();r(this.host);this.stopVideos();const a=this.originalTrigger;if(a&&typeof a.focus==="function"){setTimeout((()=>a.focus()))}}stopVideos(){const i=Array.from(this.host.querySelectorAll("iframe,video"));i.forEach((i=>{if(i.tagName.toLowerCase()==="video")i.pause();else{const a=i.src;i.src=a}}))}connectedCallback(){this.handleHoistChange();this.modal=new s(this.host);if(this.panel){this.addedTransEnd=true;this.panel.addEventListener("transitionend",this.handleTransitionEnd)}}componentWillLoad(){this.handleSlotChange();if(this.open)this.show();if(this.storeId)d.init(this,["open"],this.storeMethod,this.storeId)}componentDidLoad(){if(!this.addedTransEnd){this.panel.addEventListener("transitionend",this.handleTransitionEnd)}}disconnectedCallback(){if(!this.panel)return;r(this.host);this.addedTransEnd=false;this.panel.removeEventListener("transitionend",this.handleTransitionEnd)}render(){return o(t,{showing:this.isVisible?true:undefined},o("div",{part:"base",class:{dialog:true,"dialog--open":this.open,"dialog--visible":this.isVisible,"dialog--has-footer":!this.noFooter,"dialog--has-header":!this.noHeader,"dialog--nodismiss":this.noDismiss,"dialog--with-ribbon":this.showRibbon},onKeyDown:this.handleKeyDown},o("div",{part:"overlay",class:"dialog__overlay",ref:i=>this.overlay=i,onClick:this.requestClose}),o("div",{ref:i=>this.panel=i,part:"panel",class:"dialog__panel",role:"dialog","aria-modal":"true","aria-hidden":this.open?"false":"true","aria-label":this.noHeader?this.label:null,"aria-labelledby":!this.noHeader?`${this.componentId}-title`:null,tabIndex:0},o("div",{class:"dialog__body-wrap"},!this.noHeader&&o("nano-sticker",null,o("header",{part:"header",class:"dialog__header"},o("span",{part:"title",class:"dialog__title",id:`${this.componentId}-title`},o("slot",{name:"label"},this.label||String.fromCharCode(65279))),!this.noUserDismiss&&o("nano-icon-button",{exportparts:"base:close-button",class:"dialog__close-icon",label:"close dialog",onClick:this.requestClose,iconName:"light/times"}))),o("div",{part:"body",class:"dialog__body"},o("slot",null)),!this.noFooter&&(this.hasFooter||!this.noUserDismiss)&&o("nano-sticker",{position:"bottom"},o("footer",{part:"footer",class:"dialog__footer"},o("slot",{name:"footer",onSlotchange:this.handleSlotChange}),!this.noUserDismiss&&o("button",{class:"dialog__close-txt",onClick:this.requestClose},"Close")))))))}get host(){return e(this)}static get watchers(){return{open:["handleOpenChange"],hoist:["handleHoistChange"]}}};p.style=h;export{p as nano_dialog};
5
- //# sourceMappingURL=p-28874fdc.entry.js.map
4
+ import{r as i,c as a,h as o,a as t,g as e}from"./p-bf91c50e.js";import{M as s}from"./p-e04f2333.js";import{l as n,u as r}from"./p-45b7682a.js";import{h as l}from"./p-b933f3c8.js";import{C as d}from"./p-909a424c.js";import"./p-45abbbdd.js";import"./p-257432ff.js";import"./p-9746b0a5.js";import"./p-69a3e911.js";const h=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--border-radius:var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));--content-background:#fafafa;--footer-content:#e4e6e8;--scrim-color:var(--nano-layer-overlay-dark, rgb(74 74 74 / 50%));--box-shadow:var(--nano-layer-shadow-large, 0 2px 8px rgba(0, 0, 0, 0.2));--close-button-color:#b5aea7;--width:60rem;--tint-color:#00607b;--body-padding-v:var(--nano-spacing-large, 20px);--body-padding-h:var(--nano-spacing-large, 20px);--header-padding-v:var(--nano-spacing-medium, 16px);--header-padding-h:var(--nano-spacing-large, 20px);--footer-padding-v:var(--nano-spacing-medium, 16px);--footer-padding-h:var(--nano-spacing-large, 20px)}.dialog{display:flex;align-items:center;justify-content:center;position:fixed;inset:0;z-index:var(--nano-layer-index-modal, 700)}.dialog:not(.dialog--visible){position:absolute;inline-size:1px;block-size:1px;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);overflow:hidden;pointer-events:none;visibility:hidden}.dialog__panel{display:flex;flex-direction:column;z-index:2;inline-size:var(--width);max-inline-size:calc(100% - var(--nano-spacing-xlarge, 24px));max-block-size:calc(92% - var(--nano-spacing-xlarge, 24px));background-color:var(--content-background);border-radius:var(--border-radius);box-shadow:var(--box-shadow);opacity:0;transform:scale(0.8);transition:var(--nano-transition-fast, 0.3s) opacity, var(--nano-transition-fast, 0.3s) transform}.dialog__panel:focus{outline:none}.dialog--with-ribbon .dialog__panel{-webkit-border-before:5px solid var(--tint-color);border-block-start:5px solid var(--tint-color)}.dialog--open .dialog__panel{display:flex;opacity:1;transform:none}.dialog--nodismiss .dialog__panel{animation:cannotClose 0.25s ease-in-out 1}@keyframes cannotClose{0%{transform:scale(1)}50%{transform:scale(1.08)}100%{transform:scale(1)}}.dialog__header{flex:0 0 auto;display:flex;min-inline-size:var(--width);inline-size:100%;background-color:var(--content-background);border-radius:var(--border-radius) var(--border-radius) 0 0;transition:var(--nano-transition-fast, 0.1s) box-shadow}.dialog--visible .dialog__header{min-inline-size:auto}[stuck] .dialog__header{box-shadow:var(--nano-layer-shadow-medium, 0 2px 4px rgba(0, 0, 0, 0.2))}.dialog__title{flex:1 1 auto;font-size:var(--nano-fontsize-large, 1.25rem);line-height:1.6;padding-block:var(--header-padding-v);padding-inline:var(--header-padding-h)}.dialog .dialog__close-icon{flex:0 0 auto;display:flex;align-items:center;font-size:var(--nano-fontsize-xlarge, 1.5rem);padding-block:0;padding-inline:var(--header-padding-h);--color:var(--close-button-color)}.dialog__body{padding-block:0 var(--body-padding-v);padding-inline:var(--body-padding-h)}.dialog:not(.dialog--has-header) .dialog__body{-webkit-padding-before:var(--body-padding-v);padding-block-start:var(--body-padding-v)}.dialog__body ::slotted(*){max-inline-size:100%}.dialog__body-wrap{flex:1 1 auto;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:var(--border-radius)}.dialog:not(.dialog--has-header) .dialog__body-wrap{border-radius:0 0 inherit inherit}.dialog:not(.dialog--has-footer) .dialog__body-wrap{border-radius:inherit inherit 0 0}.dialog__footer{inline-size:100%;padding-block:var(--footer-padding-v);padding-inline:var(--footer-padding-h);background:var(--footer-content);border-radius:0 0 var(--border-radius) var(--border-radius);position:relative;inset-block-start:1px}.dialog--visible .dialog__footer{min-inline-size:auto}.dialog__footer ::slotted(button){-webkit-margin-end:var(--nano-spacing-small, 8px) !important;margin-inline-end:var(--nano-spacing-small, 8px) !important}.dialog:not(.dialog--has-footer) .dialog__footer{display:none}.dialog__close-txt{color:var(--tint-color);border:none;text-decoration:underline;margin:0;text-underline-offset:4px;background-color:transparent;font:inherit;-webkit-box-align:center;cursor:pointer;font-size:var(--nano-fontsize-small, 0.875rem);padding:0.5rem;border-radius:var(--nano-border-radius-small, 2px);transition:box-shadow 100ms ease-in-out}.dialog__close-txt:focus{outline:none;box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)))}.dialog__overlay{position:fixed;inset:0;background-color:var(--scrim-color);opacity:0;transition:var(--nano-transition-fast, 0.3s) opacity;-webkit-backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px));backdrop-filter:blur(var(--nano-layer-overlay-blur, 3px))}.dialog--open .dialog__overlay{opacity:1}";let c=0;const p=class{constructor(o){i(this,o);this.nanoShow=a(this,"nanoShow",7);this.nanoAfterShow=a(this,"nanoAfterShow",7);this.nanoHide=a(this,"nanoHide",7);this.nanoAfterHide=a(this,"nanoAfterHide",7);this.nanoInitialFocus=a(this,"nanoInitialFocus",7);this.nanoRequestClose=a(this,"nanoRequestClose",7);this.componentId=`dialog-${++c}`;this.willShow=false;this.willHide=false;this.addedTransEnd=false;this.handleKeyDown=i=>{if(i.key==="Escape"){this.requestClose()}};this.requestClose=()=>{const i=this.nanoRequestClose.emit();if(!i.defaultPrevented&&!this.noUserDismiss){this.hide()}else{this.noDismiss=true;setTimeout((i=>this.noDismiss=false),250)}};this.handleTransitionEnd=i=>{if(i.propertyName==="opacity"&&i.composedPath().find((i=>i===this.panel||i===this.overlay))){this.isVisible=this.open;this.willShow=false;this.willHide=false;this.open?this.nanoAfterShow.emit():this.nanoAfterHide.emit()}};this.handleSlotChange=()=>{this.hasFooter=l(this.host,"footer")};this.isVisible=false;this.noDismiss=false;this.hasFooter=false;this.showRibbon=true;this.open=false;this.label=undefined;this.noHeader=false;this.noFooter=false;this.noUserDismiss=false;this.storeId=undefined;this.storeMethod="url-hash";this.hoist=false}handleOpenChange(){this.open?this.show():this.hide()}handleHoistChange(){if(!this.hoist||document.body.children[0]===this.host)return;document.body.prepend(this.host)}async show(){if(this.willShow){return}const i=this.nanoShow.emit();if(i.defaultPrevented){this.open=false;return}this.originalTrigger=document.activeElement;this.willShow=true;this.isVisible=true;this.open=true;this.modal.activate();n(this.host);if(this.open){this.host.addEventListener("nanoAfterShow",(()=>{const i=this.nanoInitialFocus.emit();if(!i.defaultPrevented){this.panel.focus({preventScroll:true})}}),{once:true})}}async hide(){if(this.willHide){return}const i=this.nanoHide.emit();if(i.defaultPrevented){this.open=true;return}this.willHide=true;this.open=false;this.modal.deactivate();r(this.host);this.stopVideos();const a=this.originalTrigger;if(a&&typeof a.focus==="function"){setTimeout((()=>a.focus()))}}stopVideos(){const i=Array.from(this.host.querySelectorAll("iframe,video"));i.forEach((i=>{if(i.tagName.toLowerCase()==="video")i.pause();else{const a=i.src;i.src=a}}))}connectedCallback(){this.handleHoistChange();this.modal=new s(this.host);if(this.panel){this.addedTransEnd=true;this.panel.addEventListener("transitionend",this.handleTransitionEnd)}}componentWillLoad(){this.handleSlotChange();if(this.open)this.show();if(this.storeId)d.init(this,["open"],this.storeMethod,this.storeId)}componentDidLoad(){if(!this.addedTransEnd){this.panel.addEventListener("transitionend",this.handleTransitionEnd)}}disconnectedCallback(){if(!this.panel)return;r(this.host);this.addedTransEnd=false;this.panel.removeEventListener("transitionend",this.handleTransitionEnd)}render(){return o(t,{showing:this.isVisible?true:undefined},o("div",{part:"base",class:{dialog:true,"dialog--open":this.open,"dialog--visible":this.isVisible,"dialog--has-footer":!this.noFooter,"dialog--has-header":!this.noHeader,"dialog--nodismiss":this.noDismiss,"dialog--with-ribbon":this.showRibbon},onKeyDown:this.handleKeyDown},o("div",{part:"overlay",class:"dialog__overlay",ref:i=>this.overlay=i,onClick:this.requestClose}),o("div",{ref:i=>this.panel=i,part:"panel",class:"dialog__panel",role:"dialog","aria-modal":"true","aria-hidden":this.open?"false":"true","aria-label":this.noHeader?this.label:null,"aria-labelledby":!this.noHeader?`${this.componentId}-title`:null,tabIndex:0},o("div",{class:"dialog__body-wrap"},!this.noHeader&&o("nano-sticker",null,o("header",{part:"header",class:"dialog__header"},o("span",{part:"title",class:"dialog__title",id:`${this.componentId}-title`},o("slot",{name:"label"},this.label||String.fromCharCode(65279))),!this.noUserDismiss&&o("nano-icon-button",{exportparts:"base:close-button",class:"dialog__close-icon",label:"close dialog",onClick:this.requestClose,iconName:"light/times"}))),o("div",{part:"body",class:"dialog__body"},o("slot",null)),!this.noFooter&&(this.hasFooter||!this.noUserDismiss)&&o("nano-sticker",{position:"bottom"},o("footer",{part:"footer",class:"dialog__footer"},o("slot",{name:"footer",onSlotchange:this.handleSlotChange}),!this.noUserDismiss&&o("button",{class:"dialog__close-txt",onClick:this.requestClose},"Close")))))))}get host(){return e(this)}static get watchers(){return{open:["handleOpenChange"],hoist:["handleHoistChange"]}}};p.style=h;export{p as nano_dialog};
5
+ //# sourceMappingURL=p-fccd59e4.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{r as t,c as i,h as e,a as s,g as n}from"./p-f84612d4.js";import{p as a,a as o,c as h}from"./p-cecb9af1.js";import{c as d}from"./p-411bb8f1.js";const r=".sc-nano-date-input-h{box-sizing:border-box}*.sc-nano-date-input,*.sc-nano-date-input::before,*.sc-nano-date-input::after{box-sizing:border-box}[hidden].sc-nano-date-input{display:none !important}.sc-nano-date-input-h{display:inline-block;inline-size:100%;--focus-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)));--open-btn-color:var(--nano-button-color, #f0efed);--open-btn-border:none;--close-btn-color:var(--nano-button-color, #f0efed);--picker-base-size:16px}.nano-color.sc-nano-date-input-h{--focus-shadow:0 0 0 0.1875rem rgb(var(--nano-color-tint-rgb)/0.56)}nano-icon.sc-nano-date-input{pointer-events:none}.date-field.sc-nano-date-input{display:flex;flex-direction:column;position:relative}.date-field__dropdown.sc-nano-date-input{--padding:0;--overflow:visible;padding:0 !important;inline-size:0 !important;inline-size:100%;z-index:var(--nano-layer-index-dropdown, 300) !important}.date-field__close-bar.sc-nano-date-input{align-items:center;display:flex;justify-content:space-between;text-overflow:ellipsis;white-space:nowrap;border:0;margin:0;overflow:visible;padding:0;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;inline-size:auto;z-index:1}.date-field__open.sc-nano-date-input{background:var(--open-btn-color);border:var(--open-btn-border);margin:0;-webkit-appearance:none;appearance:none}.date-field__open.sc-nano-date-input:focus{box-shadow:var(--focus-shadow);outline:none}.date-field__close.sc-nano-date-input{align-items:center;-webkit-appearance:none;appearance:none;background:var(--close-btn-color);border:0;border-radius:50%;cursor:pointer;display:flex;block-size:24px;justify-content:center;padding:0;inline-size:24px}@media (min-width: 36em){.date-field__close.sc-nano-date-input{opacity:0}}.date-field__close.sc-nano-date-input:focus{box-shadow:var(--focus-shadow);outline:none}@media (min-width: 36em){.date-field__close.sc-nano-date-input:focus{opacity:1}}.date-field__close.sc-nano-date-input nano-icon.sc-nano-date-input{margin-block:0;margin-inline:auto}.date-field.sc-nano-date-input nano-date-picker.sc-nano-date-input{font-size:var(--picker-base-size)}.vhidden.sc-nano-date-input{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}";const l={d:"(\\d{1,2})",m:"(\\d{1,2})",y:"(\\d{4})"};let c=0;const u=class{constructor(e){t(this,e);this.nanoChange=i(this,"nanoChange",7);this.nanoValidate=i(this,"nanoValidate",7);this.directInput=false;this.dateOrderIndeces={d:0,m:1,y:3};this.inputId=`nano-input-${c++}`;this.locale=window.navigator.languages||window.navigator.language||undefined;this._dropDownConfig={};this.onInputChange=t=>{t.stopPropagation();this.setValue(t.target.value)};this.onInputValidate=t=>{t.stopPropagation();this._invalid=!t.detail.isValid;this.nanoValidate.emit({isValid:t.detail.isValid,errorMessage:t.detail.errorMessage,originalEvent:t.detail.originalEvent})};this.onInputKey=()=>{this.directInput=true};this.onDatePicked=t=>{this.directInput=false;this.value=t.detail.value;if(this.closeAfterPicked)this.pickerOpen=false};this.onDropdownHide=()=>{setTimeout((t=>this.pickerOpen=false),200);setTimeout((t=>this.trigger.focus()),50)};this.onDropdownShow=()=>{setTimeout((t=>{this.pickerEle.setFocus(false,this.pickerOpenSource==="key");this.pickerOpenSource=null}),200)};this.onTriggerClick=()=>{if(!this.pickerOpen){this.pickerOpen=true;this.pickerOpenSource="mouse"}};this.onTriggerKey=t=>{if([" ","Enter"].includes(t.key)){if(!this.pickerOpen){this.pickerOpen=true;this.pickerOpenSource="key"}}};this.onCloseClick=()=>{if(this.pickerOpen)this.pickerOpen=false};this.onCloseKeyDown=t=>{if(t.key==="Tab"&&t.shiftKey){this.pickerEle.setFocus(true);t.preventDefault()}if(t.key===" "||t.key==="Enter"){if(this.pickerOpen)this.pickerOpen=false}};this.pattern=undefined;this.inputValue=undefined;this._invalid=false;this.helperText=true;this.helperTextFormat={year:"numeric",month:"long",day:"numeric"};this.floatLabel=false;this.name=this.inputId;this.readonly=false;this.size=undefined;this.form=undefined;this.firstDayOfWeek=undefined;this.localization=undefined;this.disabled=false;this.color=undefined;this.autofocus=false;this.clearInput=false;this.label=undefined;this.placeholder=undefined;this.value="";this.validateOn="submitThenDirty";this.showInlineError=true;this.dateOrder="dmy";this.required=false;this.min=undefined;this.max=undefined;this.hideLabel=false;this.picker=true;this.initialPickerDate=undefined;this.pickerOpen=false;this.closeAfterPicked=true;this.isDateDisabled=()=>false}get invalid(){return this._invalid}get validityMessage(){if(!this.input)return"";return this.input.validityMessage}handleValueChange(){if(!this.directInput)this.inputValue=this.formatIsoDate(this.value);setTimeout((()=>{this.nanoChange.emit({value:this.value,date:a(this.value)})}),20);this.directInput=false}handleDateOrderChange(){this.setDatePattern()}testDateValidity(){const t=a(this.value);let i,e,s="";if(this.value&&t){if(this.min&&(i=a(this.min))&&t<i){s="Date below the minimum: "+i.toLocaleDateString(this.locale,this.helperTextFormat)}if(this.max&&(e=a(this.max))&&t>e){s="Date above the maximum: "+e.toLocaleDateString(this.locale,this.helperTextFormat)}if(this.isDateDisabled(t)){s="Date selected is disabled."}}requestAnimationFrame((async i=>{if(!this.input)return;const e=await this.input.getInputElement();if(this.value.length&&!t)s="Please enter a valid date";e.setCustomValidity(s);if(this.input.validateOn==="dirty"){this.input.showError(s)}}))}handlePickerOpenChange(){this.dropdown.open=this.pickerOpen}get dropDownConfig(){return this._dropDownConfig}set dropDownConfig(t){this._dropDownConfig=Object.assign(Object.assign({},this._dropDownConfig),t)}get dateValue(){return a(this.value)}async reportValidity(t){const i=await this.input.reportValidity(t);if(i.isValid&&t)this.testDateValidity();return await this.input.reportValidity(t)}async setFocus(){if(this.input)this.input.setFocus()}async getInputElement(){return await this.input.getInputElement()}async showError(t){if(!this.input)return;this.input.showError(t)}setDatePattern(){const t=[];const i=[];Array.from(this.dateOrder).map(((e,s)=>{t.push(l[e]);this.dateOrderIndeces[e]=s;i.push(e==="y"?"yyyy":e+e)}));this.pattern=t.join("\\W+");if(!this.placeholder&&this.placeholder!=="false")this.placeholder=i.join(" ")}formatIsoDate(t){const i=[];Array.from("ymd").map((t=>i.push(l[t])));const e=t.match(new RegExp(i.join("\\W+")));if(!e)return"";const s=[];s[this.dateOrderIndeces.d]=e[3];s[this.dateOrderIndeces.m]=e[2];s[this.dateOrderIndeces.y]=e[1];return s.join(" ")}setValue(t){const i=t.match(new RegExp(this.pattern));if(!i){this.value=t;return}let e=h(i[this.dateOrderIndeces.y+1],i[this.dateOrderIndeces.m+1],i[this.dateOrderIndeces.d+1]);if(!e){e=new Date(t);if(!e){this.value=t;return}}const s=o(e);this.value=s;return s}connectedCallback(){this.setDatePattern();this.handleValueChange()}componentDidLoad(){if(!this.pickerCloseBtn||!this.picker)return;this.pickerEle.firstFocusEle=this.pickerCloseBtn;this.dropdown.tetherTo=this.trigger;setTimeout((t=>this.handlePickerOpenChange()),300)}render(){this.locale=navigator.languages||navigator.language||undefined;this.dropDownConfig.placement=this.dropDownConfig.placement||"bottom-end";if(this.host.ownerDocument.dir==="rtl"){this.dropDownConfig.placement.replace("start","end")}if(this.trigger)this.dropDownConfig.tetherTo=this.trigger;const t=a(this.value);const i=!!this.host.querySelector('[slot="helper"]');return e(s,{class:Object.assign({},d(this.color))},e("div",{class:"date-field"},e("nano-input",{class:"date-field__input",slot:"trigger",required:this.required||undefined,showInlineError:this.showInlineError,validateOn:this.validateOn,placeholder:this.placeholder!=="false"?this.placeholder:undefined,pattern:this.pattern,label:this.label,disabled:this.disabled||undefined,color:this.color||undefined,autofocus:this.autofocus||undefined,clearInput:this.clearInput||undefined,onNanoChange:this.onInputChange,onNanoInput:this.onInputKey,onNanoValidate:this.onInputValidate,name:"",form:this.form||undefined,size:this.size||undefined,readonly:this.readonly,value:this.inputValue,ref:t=>this.input=t,floatLabel:this.floatLabel,hideLabel:this.hideLabel,inputmode:"numeric",part:"input"},e("slot",{name:"start",slot:"start"}),e("slot",{name:"label"}),e("slot",{name:"end",slot:"end"}),this.picker&&[e("button",{slot:"end",class:"date-field__open",type:"button",onKeyDown:this.onTriggerKey,onClick:this.onTriggerClick,ref:t=>this.trigger=t,disabled:this.disabled||this.readonly},e("nano-icon",{name:"light/calendar-alt"})),e("nano-dropdown",Object.assign({slot:"end",onNanoHide:this.onDropdownHide,onNanoShow:this.onDropdownShow,dialogTitle:"Choose a date",class:"date-field__dropdown",ref:t=>this.dropdown=t},this.dropDownConfig,{part:"dropdown"}),e("div",null,e("div",{class:"date-field__close-bar"},e("button",{class:"date-field__close",type:"button",onMouseDown:this.onCloseClick,onKeyDown:this.onCloseKeyDown,ref:t=>this.pickerCloseBtn=t},e("nano-icon",{name:"light/times"}),e("span",{class:"vhidden"},"Close window"))),e("nano-date-picker",{isDateDisabled:this.isDateDisabled,onNanoDatePicked:this.onDatePicked,min:this.min||undefined,max:this.max||undefined,"is-modal":true,ref:t=>this.pickerEle=t,localization:this.localization,selectedDate:this.value||this.initialPickerDate,firstDayOfWeek:this.firstDayOfWeek,color:this.color||undefined,part:"date-picker"})))],(i||this.helperText||this.showInlineError)&&e("span",{slot:"helper"},e("span",{class:{vhidden:!!this.value.length}},e("slot",{name:"helper"})),this.helperText&&!!t&&e("span",null,t.toLocaleDateString(this.locale,this.helperTextFormat)))),e("input",{type:"hidden",value:this.value,name:this.name})))}get host(){return n(this)}static get watchers(){return{value:["handleValueChange","testDateValidity"],dateOrder:["handleDateOrderChange"],min:["testDateValidity"],max:["testDateValidity"],pickerOpen:["handlePickerOpenChange"]}}};u.style=r;export{u as nano_date_input};
5
- //# sourceMappingURL=p-38268f3c.entry.js.map
4
+ import{r as t,c as i,h as e,a as s,g as n}from"./p-bf91c50e.js";import{p as a,a as o,c as h}from"./p-cecb9af1.js";import{c as d}from"./p-411bb8f1.js";const r=".sc-nano-date-input-h{box-sizing:border-box}*.sc-nano-date-input,*.sc-nano-date-input::before,*.sc-nano-date-input::after{box-sizing:border-box}[hidden].sc-nano-date-input{display:none !important}.sc-nano-date-input-h{display:inline-block;inline-size:100%;--focus-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)));--open-btn-color:var(--nano-button-color, #f0efed);--open-btn-border:none;--close-btn-color:var(--nano-button-color, #f0efed);--picker-base-size:16px}.nano-color.sc-nano-date-input-h{--focus-shadow:0 0 0 0.1875rem rgb(var(--nano-color-tint-rgb)/0.56)}nano-icon.sc-nano-date-input{pointer-events:none}.date-field.sc-nano-date-input{display:flex;flex-direction:column;position:relative}.date-field__dropdown.sc-nano-date-input{--padding:0;--overflow:visible;padding:0 !important;inline-size:0 !important;inline-size:100%;z-index:var(--nano-layer-index-dropdown, 300) !important}.date-field__close-bar.sc-nano-date-input{align-items:center;display:flex;justify-content:space-between;text-overflow:ellipsis;white-space:nowrap;border:0;margin:0;overflow:visible;padding:0;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;inline-size:auto;z-index:1}.date-field__open.sc-nano-date-input{background:var(--open-btn-color);border:var(--open-btn-border);margin:0;-webkit-appearance:none;appearance:none}.date-field__open.sc-nano-date-input:focus{box-shadow:var(--focus-shadow);outline:none}.date-field__close.sc-nano-date-input{align-items:center;-webkit-appearance:none;appearance:none;background:var(--close-btn-color);border:0;border-radius:50%;cursor:pointer;display:flex;block-size:24px;justify-content:center;padding:0;inline-size:24px}@media (min-width: 36em){.date-field__close.sc-nano-date-input{opacity:0}}.date-field__close.sc-nano-date-input:focus{box-shadow:var(--focus-shadow);outline:none}@media (min-width: 36em){.date-field__close.sc-nano-date-input:focus{opacity:1}}.date-field__close.sc-nano-date-input nano-icon.sc-nano-date-input{margin-block:0;margin-inline:auto}.date-field.sc-nano-date-input nano-date-picker.sc-nano-date-input{font-size:var(--picker-base-size)}.vhidden.sc-nano-date-input{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}";const l={d:"(\\d{1,2})",m:"(\\d{1,2})",y:"(\\d{4})"};let c=0;const u=class{constructor(e){t(this,e);this.nanoChange=i(this,"nanoChange",7);this.nanoValidate=i(this,"nanoValidate",7);this.directInput=false;this.dateOrderIndeces={d:0,m:1,y:3};this.inputId=`nano-input-${c++}`;this.locale=window.navigator.languages||window.navigator.language||undefined;this._dropDownConfig={};this.onInputChange=t=>{t.stopPropagation();this.setValue(t.target.value)};this.onInputValidate=t=>{t.stopPropagation();this._invalid=!t.detail.isValid;this.nanoValidate.emit({isValid:t.detail.isValid,errorMessage:t.detail.errorMessage,originalEvent:t.detail.originalEvent})};this.onInputKey=()=>{this.directInput=true};this.onDatePicked=t=>{this.directInput=false;this.value=t.detail.value;if(this.closeAfterPicked)this.pickerOpen=false};this.onDropdownHide=()=>{setTimeout((t=>this.pickerOpen=false),200);setTimeout((t=>this.trigger.focus()),50)};this.onDropdownShow=()=>{setTimeout((t=>{this.pickerEle.setFocus(false,this.pickerOpenSource==="key");this.pickerOpenSource=null}),200)};this.onTriggerClick=()=>{if(!this.pickerOpen){this.pickerOpen=true;this.pickerOpenSource="mouse"}};this.onTriggerKey=t=>{if([" ","Enter"].includes(t.key)){if(!this.pickerOpen){this.pickerOpen=true;this.pickerOpenSource="key"}}};this.onCloseClick=()=>{if(this.pickerOpen)this.pickerOpen=false};this.onCloseKeyDown=t=>{if(t.key==="Tab"&&t.shiftKey){this.pickerEle.setFocus(true);t.preventDefault()}if(t.key===" "||t.key==="Enter"){if(this.pickerOpen)this.pickerOpen=false}};this.pattern=undefined;this.inputValue=undefined;this._invalid=false;this.helperText=true;this.helperTextFormat={year:"numeric",month:"long",day:"numeric"};this.floatLabel=false;this.name=this.inputId;this.readonly=false;this.size=undefined;this.form=undefined;this.firstDayOfWeek=undefined;this.localization=undefined;this.disabled=false;this.color=undefined;this.autofocus=false;this.clearInput=false;this.label=undefined;this.placeholder=undefined;this.value="";this.validateOn="submitThenDirty";this.showInlineError=true;this.dateOrder="dmy";this.required=false;this.min=undefined;this.max=undefined;this.hideLabel=false;this.picker=true;this.initialPickerDate=undefined;this.pickerOpen=false;this.closeAfterPicked=true;this.isDateDisabled=()=>false}get invalid(){return this._invalid}get validityMessage(){if(!this.input)return"";return this.input.validityMessage}handleValueChange(){if(!this.directInput)this.inputValue=this.formatIsoDate(this.value);setTimeout((()=>{this.nanoChange.emit({value:this.value,date:a(this.value)})}),20);this.directInput=false}handleDateOrderChange(){this.setDatePattern()}testDateValidity(){const t=a(this.value);let i,e,s="";if(this.value&&t){if(this.min&&(i=a(this.min))&&t<i){s="Date below the minimum: "+i.toLocaleDateString(this.locale,this.helperTextFormat)}if(this.max&&(e=a(this.max))&&t>e){s="Date above the maximum: "+e.toLocaleDateString(this.locale,this.helperTextFormat)}if(this.isDateDisabled(t)){s="Date selected is disabled."}}requestAnimationFrame((async i=>{if(!this.input)return;const e=await this.input.getInputElement();if(this.value.length&&!t)s="Please enter a valid date";e.setCustomValidity(s);if(this.input.validateOn==="dirty"){this.input.showError(s)}}))}handlePickerOpenChange(){this.dropdown.open=this.pickerOpen}get dropDownConfig(){return this._dropDownConfig}set dropDownConfig(t){this._dropDownConfig=Object.assign(Object.assign({},this._dropDownConfig),t)}get dateValue(){return a(this.value)}async reportValidity(t){const i=await this.input.reportValidity(t);if(i.isValid&&t)this.testDateValidity();return await this.input.reportValidity(t)}async setFocus(){if(this.input)this.input.setFocus()}async getInputElement(){return await this.input.getInputElement()}async showError(t){if(!this.input)return;this.input.showError(t)}setDatePattern(){const t=[];const i=[];Array.from(this.dateOrder).map(((e,s)=>{t.push(l[e]);this.dateOrderIndeces[e]=s;i.push(e==="y"?"yyyy":e+e)}));this.pattern=t.join("\\W+");if(!this.placeholder&&this.placeholder!=="false")this.placeholder=i.join(" ")}formatIsoDate(t){const i=[];Array.from("ymd").map((t=>i.push(l[t])));const e=t.match(new RegExp(i.join("\\W+")));if(!e)return"";const s=[];s[this.dateOrderIndeces.d]=e[3];s[this.dateOrderIndeces.m]=e[2];s[this.dateOrderIndeces.y]=e[1];return s.join(" ")}setValue(t){const i=t.match(new RegExp(this.pattern));if(!i){this.value=t;return}let e=h(i[this.dateOrderIndeces.y+1],i[this.dateOrderIndeces.m+1],i[this.dateOrderIndeces.d+1]);if(!e){e=new Date(t);if(!e){this.value=t;return}}const s=o(e);this.value=s;return s}connectedCallback(){this.setDatePattern();this.handleValueChange()}componentDidLoad(){if(!this.pickerCloseBtn||!this.picker)return;this.pickerEle.firstFocusEle=this.pickerCloseBtn;this.dropdown.tetherTo=this.trigger;setTimeout((t=>this.handlePickerOpenChange()),300)}render(){this.locale=navigator.languages||navigator.language||undefined;this.dropDownConfig.placement=this.dropDownConfig.placement||"bottom-end";if(this.host.ownerDocument.dir==="rtl"){this.dropDownConfig.placement.replace("start","end")}if(this.trigger)this.dropDownConfig.tetherTo=this.trigger;const t=a(this.value);const i=!!this.host.querySelector('[slot="helper"]');return e(s,{class:Object.assign({},d(this.color))},e("div",{class:"date-field"},e("nano-input",{class:"date-field__input",slot:"trigger",required:this.required||undefined,showInlineError:this.showInlineError,validateOn:this.validateOn,placeholder:this.placeholder!=="false"?this.placeholder:undefined,pattern:this.pattern,label:this.label,disabled:this.disabled||undefined,color:this.color||undefined,autofocus:this.autofocus||undefined,clearInput:this.clearInput||undefined,onNanoChange:this.onInputChange,onNanoInput:this.onInputKey,onNanoValidate:this.onInputValidate,name:"",form:this.form||undefined,size:this.size||undefined,readonly:this.readonly,value:this.inputValue,ref:t=>this.input=t,floatLabel:this.floatLabel,hideLabel:this.hideLabel,inputmode:"numeric",part:"input"},e("slot",{name:"start",slot:"start"}),e("slot",{name:"label"}),e("slot",{name:"end",slot:"end"}),this.picker&&[e("button",{slot:"end",class:"date-field__open",type:"button",onKeyDown:this.onTriggerKey,onClick:this.onTriggerClick,ref:t=>this.trigger=t,disabled:this.disabled||this.readonly},e("nano-icon",{name:"light/calendar-alt"})),e("nano-dropdown",Object.assign({slot:"end",onNanoHide:this.onDropdownHide,onNanoShow:this.onDropdownShow,dialogTitle:"Choose a date",class:"date-field__dropdown",ref:t=>this.dropdown=t},this.dropDownConfig,{part:"dropdown"}),e("div",null,e("div",{class:"date-field__close-bar"},e("button",{class:"date-field__close",type:"button",onMouseDown:this.onCloseClick,onKeyDown:this.onCloseKeyDown,ref:t=>this.pickerCloseBtn=t},e("nano-icon",{name:"light/times"}),e("span",{class:"vhidden"},"Close window"))),e("nano-date-picker",{isDateDisabled:this.isDateDisabled,onNanoDatePicked:this.onDatePicked,min:this.min||undefined,max:this.max||undefined,"is-modal":true,ref:t=>this.pickerEle=t,localization:this.localization,selectedDate:this.value||this.initialPickerDate,firstDayOfWeek:this.firstDayOfWeek,color:this.color||undefined,part:"date-picker"})))],(i||this.helperText||this.showInlineError)&&e("span",{slot:"helper"},e("span",{class:{vhidden:!!this.value.length}},e("slot",{name:"helper"})),this.helperText&&!!t&&e("span",null,t.toLocaleDateString(this.locale,this.helperTextFormat)))),e("input",{type:"hidden",value:this.value,name:this.name})))}get host(){return n(this)}static get watchers(){return{value:["handleValueChange","testDateValidity"],dateOrder:["handleDateOrderChange"],min:["testDateValidity"],max:["testDateValidity"],pickerOpen:["handlePickerOpenChange"]}}};u.style=r;export{u as nano_date_input};
5
+ //# sourceMappingURL=p-fe1446cd.entry.js.map
package/docs-json.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2023-02-15T00:58:11",
2
+ "timestamp": "2023-02-15T02:09:37",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
- "version": "2.22.4",
5
+ "version": "2.22.5",
6
6
  "typescriptVersion": "4.9.4"
7
7
  },
8
8
  "components": [
package/hydrate/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  /*!
9
- Stencil Mock Doc v2.22.4 | MIT Licensed | https://stenciljs.com
9
+ Stencil Mock Doc v2.22.5 | MIT Licensed | https://stenciljs.com
10
10
  */
11
11
  const CONTENT_REF_ID = 'r';
12
12
  const ORG_LOCATION_ID = 'o';
@@ -5308,7 +5308,7 @@ const createTime = (e, t = "") => {
5308
5308
  return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname,
5309
5309
  t;
5310
5310
  }, renderSlotFallbackContent = (e, t) => {
5311
- if (!e["s-hsf"]) return;
5311
+ if (!e["s-hsf"] || !e.parentNode) return;
5312
5312
  let n, o = e.parentNode.__childNodes || e.parentNode.childNodes;
5313
5313
  const s = o.length;
5314
5314
  let r = 0;
@@ -5316,6 +5316,7 @@ const createTime = (e, t = "") => {
5316
5316
  n.style.display = t ? "none" : "") : n["s-sfc"] && (t ? (n["s-sfc"] = n.textContent || void 0,
5317
5317
  n.textContent = "") : n.textContent && "" !== n.textContent.trim() || (n.textContent = n["s-sfc"])));
5318
5318
  }, updateFallbackSlotVisibility = e => {
5319
+ if (!e) return;
5319
5320
  const t = e.__childNodes || e.childNodes;
5320
5321
  let n, o, s, r, l, i;
5321
5322
  for (o = 0, s = t.length; o < s; o++) {
@@ -5598,9 +5599,9 @@ const createElm = (e, t, n, o) => {
5598
5599
  let t = 1 === r.nodeType ? r : o;
5599
5600
  for (;1 !== t.nodeType; ) t = t.parentNode;
5600
5601
  l = createElm(e, s, a, t), l["s-sf"] = r["s-hsf"] = !0, void 0 === l["s-sn"] && (l["s-sn"] = s.$name$ || ""),
5601
- 3 === l.nodeType && (l["s-sfc"] = l.textContent), !l || e && e.$children$[a] || t.appendChild(l);
5602
+ 3 === l.nodeType && (l["s-sfc"] = l.textContent), !l || e && e.$children$ || t.appendChild(l);
5602
5603
  }
5603
- e && patch(e, s);
5604
+ e && e.$children$ && patch(e, s);
5604
5605
  }
5605
5606
  i = e && e.$children$ && e.$children$[n], i && i.$tag$ === s.$tag$ && e.$elm$ && putBackInOriginalLocation(e.$elm$, !1);
5606
5607
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanoporetech-digital/components",
3
- "version": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://git.oxfordnanolabs.local/Digital/nano-components"
@@ -14,7 +14,7 @@
14
14
  "types": "dist/types/interface.d.ts",
15
15
  "collection": "dist/collection/collection-manifest.json",
16
16
  "collection:main": "dist/collection/index.js",
17
- "unpkg": "dist/nano-components/nano-components.js",
17
+ "unpkg": "dist/nano-components/nano-components.esm.js",
18
18
  "files": [
19
19
  "dist/",
20
20
  "loader/",
@@ -56,7 +56,7 @@
56
56
  "dependencies": {
57
57
  "@fortawesome/fontawesome-pro": "^5.12.0",
58
58
  "@popperjs/core": "^2.4.4",
59
- "@stencil/core": "npm:@johnjenkins/stencil-community@2.22.4",
59
+ "@stencil/core": "npm:@johnjenkins/stencil-community@2.22.5",
60
60
  "@stencil/store": "^1.5.0",
61
61
  "@types/flickity": "^2.2.4",
62
62
  "algoliasearch": "^4.1.0",
@@ -128,7 +128,7 @@
128
128
  "nanopore",
129
129
  "digital"
130
130
  ],
131
- "gitHead": "96501cd0a7e0be7e3e285271e3c1a50b486f4814",
131
+ "gitHead": "ecf1c1946d9c64d10c0947147869c3108cba86e1",
132
132
  "volta": {
133
133
  "node": "14.18.1",
134
134
  "npm": "8.6.0"