@pod-os/elements 0.26.1-rc.d6e1fef.0 → 0.26.1-rc.f4329bf.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/dist/cjs/app-globals-97a7ec18.js +23 -0
  2. package/dist/cjs/app-globals-97a7ec18.js.map +1 -0
  3. package/dist/cjs/elements.cjs.js +2 -2
  4. package/dist/cjs/ion-icon_32.cjs.entry.js +9150 -0
  5. package/dist/cjs/ion-icon_32.cjs.entry.js.map +1 -0
  6. package/dist/cjs/ion-searchbar.cjs.entry.js +430 -0
  7. package/dist/cjs/ion-searchbar.cjs.entry.js.map +1 -0
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/collection/apps/pos-app-browser/pos-app-browser.css +8 -15
  10. package/dist/collection/apps/pos-app-browser/pos-app-browser.js +13 -3
  11. package/dist/collection/apps/pos-app-browser/pos-app-browser.js.map +1 -1
  12. package/dist/collection/apps/pos-app-dashboard/pos-app-dashboard.js +1 -1
  13. package/dist/collection/apps/pos-app-dashboard/pos-example-resources/pos-example-resources.js +1 -1
  14. package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.css +12 -0
  15. package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.js +19 -1
  16. package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.js.map +1 -1
  17. package/dist/collection/collection-manifest.json +3 -1
  18. package/dist/collection/components/pos-add-new-thing/pos-add-new-thing.css +2 -2
  19. package/dist/collection/components/pos-login/pos-login.js +33 -2
  20. package/dist/collection/components/pos-login/pos-login.js.map +1 -1
  21. package/dist/collection/components/pos-login-form/pos-login-form.js +1 -1
  22. package/dist/collection/components/pos-make-findable/pos-make-findable.css +8 -58
  23. package/dist/collection/components/pos-make-findable/pos-make-findable.js +15 -26
  24. package/dist/collection/components/pos-make-findable/pos-make-findable.js.map +1 -1
  25. package/dist/collection/components/pos-make-findable/shoelace.js +4 -0
  26. package/dist/collection/components/pos-make-findable/shoelace.js.map +1 -0
  27. package/dist/collection/components/pos-navigation/__test/typeToSearch.js +12 -0
  28. package/dist/collection/components/pos-navigation/__test/typeToSearch.js.map +1 -0
  29. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.css +38 -0
  30. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +105 -0
  31. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js.map +1 -0
  32. package/dist/collection/components/pos-navigation/pos-navigation.css +115 -0
  33. package/dist/collection/components/{pos-navigation-bar/pos-navigation-bar.js → pos-navigation/pos-navigation.js} +75 -18
  34. package/dist/collection/components/pos-navigation/pos-navigation.js.map +1 -0
  35. package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
  36. package/dist/collection/components/pos-picture/pos-picture.js +1 -1
  37. package/dist/collection/components/pos-picture/pos-picture.js.map +1 -1
  38. package/dist/collection/components/pos-rich-link/pos-rich-link.css +1 -1
  39. package/dist/collection/components/pos-rich-link/pos-rich-link.js +2 -2
  40. package/dist/collection/components/pos-router/pos-router.css +1 -1
  41. package/dist/collection/components/pos-router/pos-router.js +1 -1
  42. package/dist/collection/components/pos-select-term/pos-select-term.js +1 -1
  43. package/dist/collection/components/pos-user-menu/pos-user-menu.css +23 -0
  44. package/dist/collection/components/pos-user-menu/pos-user-menu.js +102 -0
  45. package/dist/collection/components/pos-user-menu/pos-user-menu.js.map +1 -0
  46. package/dist/collection/components/pos-user-menu/shoelace.js +6 -0
  47. package/dist/collection/components/pos-user-menu/shoelace.js.map +1 -0
  48. package/dist/collection/global.js +6 -0
  49. package/dist/collection/global.js.map +1 -1
  50. package/dist/components/Subject.js +700 -0
  51. package/dist/components/Subject.js.map +1 -0
  52. package/dist/components/chunk.HVTXQL7M.js +4775 -0
  53. package/dist/components/chunk.HVTXQL7M.js.map +1 -0
  54. package/dist/components/index.js +7 -0
  55. package/dist/components/index.js.map +1 -1
  56. package/dist/components/ion-searchbar.js +475 -1
  57. package/dist/components/ion-searchbar.js.map +1 -1
  58. package/dist/components/pos-add-new-thing2.js +1 -1
  59. package/dist/components/pos-add-new-thing2.js.map +1 -1
  60. package/dist/components/pos-app-browser.js +79 -63
  61. package/dist/components/pos-app-browser.js.map +1 -1
  62. package/dist/components/pos-app-dashboard2.js +1 -1
  63. package/dist/components/pos-app2.js +1 -697
  64. package/dist/components/pos-app2.js.map +1 -1
  65. package/dist/components/pos-example-resources2.js +1 -1
  66. package/dist/components/pos-getting-started2.js +4 -3
  67. package/dist/components/pos-getting-started2.js.map +1 -1
  68. package/dist/components/pos-login-form2.js +1 -1
  69. package/dist/components/pos-login2.js +19 -3
  70. package/dist/components/pos-login2.js.map +1 -1
  71. package/dist/components/pos-make-findable2.js +16 -21
  72. package/dist/components/pos-make-findable2.js.map +1 -1
  73. package/dist/components/pos-navigation-bar2.js +24 -109
  74. package/dist/components/pos-navigation-bar2.js.map +1 -1
  75. package/dist/components/pos-navigation.d.ts +11 -0
  76. package/dist/components/pos-navigation.js +8 -0
  77. package/dist/components/pos-navigation.js.map +1 -0
  78. package/dist/components/pos-navigation2.js +394 -0
  79. package/dist/components/pos-navigation2.js.map +1 -0
  80. package/dist/components/pos-new-thing-form2.js +1 -1
  81. package/dist/components/pos-picture2.js +1 -1
  82. package/dist/components/pos-picture2.js.map +1 -1
  83. package/dist/components/pos-rich-link2.js +3 -3
  84. package/dist/components/pos-rich-link2.js.map +1 -1
  85. package/dist/components/pos-router2.js +2 -2
  86. package/dist/components/pos-router2.js.map +1 -1
  87. package/dist/components/pos-select-term2.js +1 -1
  88. package/dist/components/pos-user-menu.d.ts +11 -0
  89. package/dist/components/pos-user-menu.js +8 -0
  90. package/dist/components/pos-user-menu.js.map +1 -0
  91. package/dist/components/pos-user-menu2.js +293 -0
  92. package/dist/components/pos-user-menu2.js.map +1 -0
  93. package/dist/elements/elements.css +8 -2
  94. package/dist/elements/elements.esm.js +1 -1
  95. package/dist/elements/elements.esm.js.map +1 -1
  96. package/dist/elements/{p-a6c03ce8.js → p-01adc2b7.js} +2 -2
  97. package/dist/elements/{p-7190d53c.entry.js → p-09ff1516.entry.js} +2 -2
  98. package/dist/elements/{p-307d1531.js → p-0a6631d5.js} +2 -2
  99. package/dist/elements/{p-c698ab8e.entry.js → p-0b3d14ec.entry.js} +3 -3
  100. package/dist/elements/p-0d1dd954.entry.js +652 -0
  101. package/dist/elements/p-0d1dd954.entry.js.map +1 -0
  102. package/dist/elements/{p-d8818bb3.entry.js → p-0d4f129d.entry.js} +2 -2
  103. package/dist/elements/p-104fee38.entry.js +2 -0
  104. package/dist/elements/{p-6cc9961e.entry.js → p-11466af2.entry.js} +2 -2
  105. package/dist/elements/{p-3e6ffc13.entry.js → p-11845ff3.entry.js} +2 -2
  106. package/dist/elements/p-13b1d6fe.entry.js +2 -0
  107. package/dist/elements/{p-d358565a.entry.js.map → p-13b1d6fe.entry.js.map} +1 -1
  108. package/dist/elements/p-14bf4c7a.entry.js +2 -0
  109. package/dist/elements/{p-66a58eb0.entry.js.map → p-14bf4c7a.entry.js.map} +1 -1
  110. package/dist/elements/{p-a507d627.entry.js → p-151d1ec8.entry.js} +2 -2
  111. package/dist/elements/{p-89aef852.js → p-1930ffd5.js} +2 -2
  112. package/dist/elements/{p-aa7d93f1.entry.js → p-1a1222a3.entry.js} +2 -2
  113. package/dist/elements/{p-4dd65d40.entry.js → p-1e05efd7.entry.js} +2 -2
  114. package/dist/elements/{p-f50c3045.entry.js → p-1faf2d02.entry.js} +2 -2
  115. package/dist/elements/{p-a421bbe5.entry.js → p-21e90439.entry.js} +2 -2
  116. package/dist/elements/p-220cce23.entry.js +2 -0
  117. package/dist/{components/searchbar.js.map → elements/p-220cce23.entry.js.map} +1 -1
  118. package/dist/elements/{p-552a9992.entry.js → p-22c21319.entry.js} +2 -2
  119. package/dist/elements/{p-66973c59.entry.js → p-24d93ddd.entry.js} +2 -2
  120. package/dist/elements/p-2551eb06.entry.js +2 -0
  121. package/dist/elements/{p-bca341ba.entry.js.map → p-2551eb06.entry.js.map} +1 -1
  122. package/dist/elements/p-258f2385.entry.js +2 -0
  123. package/dist/elements/{p-72a9cbdc.entry.js → p-27bd8113.entry.js} +2 -2
  124. package/dist/elements/{p-c350af00.entry.js → p-2948d57b.entry.js} +2 -2
  125. package/dist/elements/{p-41bb9792.entry.js → p-2cdaf88b.entry.js} +2 -2
  126. package/dist/elements/{p-fa0be1d8.entry.js → p-2e08ee3a.entry.js} +2 -2
  127. package/dist/elements/{p-239442f9.entry.js → p-2e0c20e7.entry.js} +2 -2
  128. package/dist/elements/p-2ec92ff9.entry.js +2 -0
  129. package/dist/elements/p-2f3623f1.entry.js +2 -0
  130. package/dist/elements/{p-c01a4a79.entry.js.map → p-2f3623f1.entry.js.map} +1 -1
  131. package/dist/elements/{p-8e8881a8.entry.js → p-30834f34.entry.js} +2 -2
  132. package/dist/elements/p-30cd90ec.js +6 -0
  133. package/dist/elements/{p-ae984107.entry.js → p-3585f786.entry.js} +2 -2
  134. package/dist/elements/{p-d08312dd.entry.js → p-35f84573.entry.js} +2 -2
  135. package/dist/elements/p-3e130681.entry.js +2 -0
  136. package/dist/elements/{p-bdea20c4.entry.js.map → p-3e130681.entry.js.map} +1 -1
  137. package/dist/elements/{p-ffa8c481.entry.js → p-3f02cc92.entry.js} +2 -2
  138. package/dist/elements/{p-71ee259b.js → p-3f316fc4.js} +2 -2
  139. package/dist/elements/{p-bc675b21.entry.js → p-3f3b74e6.entry.js} +2 -2
  140. package/dist/elements/p-40a2d567.entry.js +2 -0
  141. package/dist/elements/{p-e78cf007.entry.js → p-4dc7c524.entry.js} +2 -2
  142. package/dist/elements/{p-c191e6df.js → p-4e8c31fa.js} +8 -8
  143. package/dist/elements/{p-a45b1964.entry.js → p-5051d2a6.entry.js} +2 -2
  144. package/dist/elements/{p-e0de7c6a.entry.js → p-5a061ddb.entry.js} +2 -2
  145. package/dist/elements/{p-061819d1.js → p-5a8e7149.js} +3 -3
  146. package/dist/elements/p-5bf4c45a.js +5 -0
  147. package/dist/elements/{p-b9dcf3b2.js → p-5e8a3893.js} +2 -2
  148. package/dist/elements/{p-300ec095.entry.js → p-602861f4.entry.js} +3 -3
  149. package/dist/elements/p-61cd1259.js +2 -0
  150. package/dist/elements/p-61cd1259.js.map +1 -0
  151. package/dist/elements/{p-4a370bdc.entry.js → p-627d5e73.entry.js} +2 -2
  152. package/dist/elements/{p-406df11a.entry.js → p-648dac6c.entry.js} +2 -2
  153. package/dist/elements/{p-07d2bd5a.entry.js → p-650db824.entry.js} +2 -2
  154. package/dist/elements/{p-cb550d04.entry.js → p-682dd0f9.entry.js} +2 -2
  155. package/dist/elements/{p-59ec8b76.entry.js → p-689a5c54.entry.js} +3 -3
  156. package/dist/elements/{p-d6394ee4.entry.js → p-6a701de0.entry.js} +2 -2
  157. package/dist/elements/{p-f4035b4a.entry.js → p-6ca9bad7.entry.js} +2 -2
  158. package/dist/elements/{p-25926b66.entry.js → p-6cae9207.entry.js} +2 -2
  159. package/dist/elements/{p-6119b57a.entry.js → p-6e5c902a.entry.js} +2 -2
  160. package/dist/elements/{p-0ddcbecd.entry.js → p-72ba182e.entry.js} +2 -2
  161. package/dist/elements/{p-1b2d32c1.entry.js → p-8619a806.entry.js} +2 -2
  162. package/dist/elements/{p-4383e1bb.entry.js → p-87af433a.entry.js} +2 -2
  163. package/dist/elements/{p-f96384f2.entry.js → p-87eb06bc.entry.js} +2 -2
  164. package/dist/elements/p-8a691722.entry.js +2 -0
  165. package/dist/elements/{p-95161a5d.entry.js.map → p-8a691722.entry.js.map} +1 -1
  166. package/dist/elements/{p-e8268c7a.entry.js → p-8c13ce70.entry.js} +2 -2
  167. package/dist/elements/{p-b64a85bf.entry.js → p-8f6d4374.entry.js} +2 -2
  168. package/dist/elements/{p-949b115f.js → p-91025a2c.js} +3 -3
  169. package/dist/elements/{p-71835d6f.entry.js → p-95036276.entry.js} +2 -2
  170. package/dist/elements/{p-42169e41.js → p-97889672.js} +2 -2
  171. package/dist/elements/p-97fa472f.entry.js +2 -0
  172. package/dist/elements/{p-a06d93c7.entry.js.map → p-97fa472f.entry.js.map} +1 -1
  173. package/dist/elements/{p-8b209e66.entry.js → p-9840f300.entry.js} +2 -2
  174. package/dist/elements/p-98b2844f.js +5 -0
  175. package/dist/elements/{p-fa19a3e9.entry.js → p-9d23baee.entry.js} +2 -2
  176. package/dist/elements/{p-7e8b8df1.entry.js → p-9d6c94d3.entry.js} +2 -2
  177. package/dist/elements/{p-41854c8f.entry.js → p-9d81c061.entry.js} +2 -2
  178. package/dist/elements/{p-dadb557e.entry.js → p-a19fb8fa.entry.js} +4 -4
  179. package/dist/elements/{p-9a4bf79e.entry.js → p-a7c9aa13.entry.js} +2 -2
  180. package/dist/elements/{p-0ee8b7a7.js → p-acfa402f.js} +2 -2
  181. package/dist/elements/{p-facc0ac5.entry.js → p-af03cfbe.entry.js} +2 -2
  182. package/dist/elements/{p-b8bd7745.entry.js → p-af2b9ecb.entry.js} +2 -2
  183. package/dist/elements/{p-cbf050d6.js → p-b110cb49.js} +2 -2
  184. package/dist/elements/{p-09d80405.entry.js → p-b1292dde.entry.js} +2 -2
  185. package/dist/elements/{p-4ccdbcbf.entry.js → p-b1de75a4.entry.js} +2 -2
  186. package/dist/elements/p-b2c94853.entry.js +2 -0
  187. package/dist/elements/{p-250d4bf1.entry.js.map → p-b2c94853.entry.js.map} +1 -1
  188. package/dist/elements/{p-a376351f.entry.js → p-b34203cd.entry.js} +2 -2
  189. package/dist/elements/{p-dc709055.entry.js → p-b954a40f.entry.js} +2 -2
  190. package/dist/elements/{p-1fc8e557.js → p-bde7428a.js} +2 -2
  191. package/dist/elements/{p-734e5a97.js → p-bf5335d4.js} +2 -2
  192. package/dist/elements/p-c1df6af7.js +8 -0
  193. package/dist/elements/{p-cbae963d.js → p-c30eb80f.js} +3 -3
  194. package/dist/elements/{p-4c078751.entry.js → p-c4332c66.entry.js} +2 -2
  195. package/dist/elements/{p-8e1c68eb.entry.js → p-c466d5bf.entry.js} +2 -2
  196. package/dist/elements/{p-36caf749.entry.js → p-c4894c44.entry.js} +2 -2
  197. package/dist/elements/{p-87c81685.entry.js → p-c4e1867e.entry.js} +2 -2
  198. package/dist/elements/{p-645632a8.entry.js → p-c7db2b55.entry.js} +5 -5
  199. package/dist/elements/p-cb3e5072.entry.js +2 -0
  200. package/dist/elements/{p-49fcec88.entry.js → p-d54d552d.entry.js} +6 -6
  201. package/dist/elements/{p-2a548485.entry.js → p-d7b597ed.entry.js} +2 -2
  202. package/dist/elements/p-da0c771e.js +5 -0
  203. package/dist/elements/{p-7183a9ca.entry.js → p-dbb94429.entry.js} +2 -2
  204. package/dist/elements/{p-c9604122.entry.js → p-de6d7967.entry.js} +2 -2
  205. package/dist/elements/p-e05f218c.entry.js +2 -0
  206. package/dist/elements/{p-2f0509be.entry.js.map → p-e05f218c.entry.js.map} +1 -1
  207. package/dist/elements/{p-b5f6b322.entry.js → p-e15ff70c.entry.js} +2 -2
  208. package/dist/elements/p-e43d654c.js +5 -0
  209. package/dist/elements/{p-01981011.entry.js → p-e7fbd427.entry.js} +2 -2
  210. package/dist/elements/{p-d61d280b.js → p-e912617c.js} +3 -3
  211. package/dist/elements/{p-da0d920d.js → p-ebe1c8ca.js} +2 -2
  212. package/dist/elements/{p-d872fe3e.entry.js → p-ec283f66.entry.js} +2 -2
  213. package/dist/elements/{p-f40b3ec6.entry.js → p-ed22dcc0.entry.js} +2 -2
  214. package/dist/elements/{p-05fff093.entry.js → p-eeaffc3b.entry.js} +2 -2
  215. package/dist/elements/p-f2c0c8a9.js +5 -0
  216. package/dist/elements/{p-c186950b.entry.js → p-f3bf8ff7.entry.js} +2 -2
  217. package/dist/elements/{p-5441ae35.entry.js → p-fb740291.entry.js} +2 -2
  218. package/dist/elements/{p-5bf40440.entry.js → p-fbff274c.entry.js} +2 -2
  219. package/dist/elements/{p-266d2934.entry.js → p-fd84af22.entry.js} +2 -2
  220. package/dist/elements/{p-a08f0446.entry.js → p-ff684bff.entry.js} +2 -2
  221. package/dist/esm/{BrokenFile-d387a173.js → BrokenFile-0b9882ef.js} +2 -2
  222. package/dist/esm/{BrokenFile-d387a173.js.map → BrokenFile-0b9882ef.js.map} +1 -1
  223. package/dist/esm/{animation-43b39c85.js → animation-756697b9.js} +2 -2
  224. package/dist/esm/{animation-43b39c85.js.map → animation-756697b9.js.map} +1 -1
  225. package/dist/esm/app-globals-fd9221d0.js +21 -0
  226. package/dist/esm/app-globals-fd9221d0.js.map +1 -0
  227. package/dist/esm/elements.js +5 -5
  228. package/dist/esm/{form-controller-3b50bf52.js → form-controller-8a54002c.js} +2 -2
  229. package/dist/esm/{form-controller-3b50bf52.js.map → form-controller-8a54002c.js.map} +1 -1
  230. package/dist/esm/{framework-delegate-c5179013.js → framework-delegate-65b5c396.js} +2 -2
  231. package/dist/esm/{framework-delegate-c5179013.js.map → framework-delegate-65b5c396.js.map} +1 -1
  232. package/dist/esm/{hardware-back-button-12e771ad.js → hardware-back-button-87b1549b.js} +3 -3
  233. package/dist/esm/{hardware-back-button-12e771ad.js.map → hardware-back-button-87b1549b.js.map} +1 -1
  234. package/dist/esm/{helpers-c51da066.js → helpers-bc137989.js} +2 -2
  235. package/dist/esm/{helpers-c51da066.js.map → helpers-bc137989.js.map} +1 -1
  236. package/dist/esm/{index-9725d917.js → index-46d8987d.js} +2 -2
  237. package/dist/esm/{index-9725d917.js.map → index-46d8987d.js.map} +1 -1
  238. package/dist/esm/{index-12e18dab.js → index-81865f43.js} +2 -2
  239. package/dist/esm/{index-12e18dab.js.map → index-81865f43.js.map} +1 -1
  240. package/dist/esm/{index-9edae53a.js → index-a51d17dd.js} +2 -2
  241. package/dist/esm/{index-9edae53a.js.map → index-a51d17dd.js.map} +1 -1
  242. package/dist/esm/{index-7462d21e.js → index-cbb71797.js} +5 -5
  243. package/dist/esm/{index-7462d21e.js.map → index-cbb71797.js.map} +1 -1
  244. package/dist/esm/{index-842e2941.js → index-e7f761c9.js} +2 -2
  245. package/dist/esm/{index-842e2941.js.map → index-e7f761c9.js.map} +1 -1
  246. package/dist/esm/{index-ccbcf170.js → index-fa9f8152.js} +5 -5
  247. package/dist/esm/{index-ccbcf170.js.map → index-fa9f8152.js.map} +1 -1
  248. package/dist/esm/{input-shims-0cb1bad1.js → input-shims-10923fa6.js} +3 -3
  249. package/dist/esm/{input-shims-0cb1bad1.js.map → input-shims-10923fa6.js.map} +1 -1
  250. package/dist/esm/{input.utils-0e2bf61a.js → input.utils-5fe0312f.js} +2 -2
  251. package/dist/esm/{input.utils-0e2bf61a.js.map → input.utils-5fe0312f.js.map} +1 -1
  252. package/dist/esm/ion-accordion-group.entry.js +2 -2
  253. package/dist/esm/ion-accordion.entry.js +4 -4
  254. package/dist/esm/ion-action-sheet_3.entry.js +7 -7
  255. package/dist/esm/ion-app.entry.js +7 -7
  256. package/dist/esm/ion-avatar.entry.js +2 -2
  257. package/dist/esm/ion-back-button.entry.js +4 -4
  258. package/dist/esm/ion-backdrop.entry.js +2 -2
  259. package/dist/esm/ion-badge_5.entry.js +2 -2
  260. package/dist/esm/ion-breadcrumb.entry.js +4 -4
  261. package/dist/esm/ion-breadcrumbs.entry.js +2 -2
  262. package/dist/esm/ion-button_4.entry.js +3 -3
  263. package/dist/esm/ion-card-content.entry.js +2 -2
  264. package/dist/esm/ion-card-header.entry.js +2 -2
  265. package/dist/esm/ion-card-subtitle.entry.js +2 -2
  266. package/dist/esm/ion-card-title.entry.js +2 -2
  267. package/dist/esm/ion-card.entry.js +3 -3
  268. package/dist/esm/ion-checkbox_7.entry.js +5 -5
  269. package/dist/esm/ion-chip.entry.js +2 -2
  270. package/dist/esm/ion-col.entry.js +2 -2
  271. package/dist/esm/ion-content.entry.js +3 -3
  272. package/dist/esm/ion-datetime-button.entry.js +3 -3
  273. package/dist/esm/ion-datetime.entry.js +4 -4
  274. package/dist/esm/ion-fab-button.entry.js +4 -4
  275. package/dist/esm/ion-fab-list.entry.js +2 -2
  276. package/dist/esm/ion-fab.entry.js +2 -2
  277. package/dist/esm/ion-footer.entry.js +4 -4
  278. package/dist/esm/ion-grid.entry.js +2 -2
  279. package/dist/esm/ion-header.entry.js +4 -4
  280. package/dist/esm/ion-icon_32.entry.js +9115 -0
  281. package/dist/esm/ion-icon_32.entry.js.map +1 -0
  282. package/dist/esm/ion-img.entry.js +3 -3
  283. package/dist/esm/ion-infinite-scroll-content.entry.js +2 -2
  284. package/dist/esm/ion-infinite-scroll.entry.js +4 -4
  285. package/dist/esm/ion-input.entry.js +7 -7
  286. package/dist/esm/ion-item-divider.entry.js +2 -2
  287. package/dist/esm/ion-item-group.entry.js +2 -2
  288. package/dist/esm/ion-item-option.entry.js +2 -2
  289. package/dist/esm/ion-item-options.entry.js +3 -3
  290. package/dist/esm/ion-item-sliding.entry.js +4 -4
  291. package/dist/esm/ion-loading.entry.js +7 -7
  292. package/dist/esm/ion-menu-button.entry.js +8 -8
  293. package/dist/esm/ion-menu-toggle.entry.js +7 -7
  294. package/dist/esm/ion-menu.entry.js +8 -8
  295. package/dist/esm/ion-modal.entry.js +9 -9
  296. package/dist/esm/ion-nav-link.entry.js +1 -1
  297. package/dist/esm/ion-nav.entry.js +6 -6
  298. package/dist/esm/ion-note.entry.js +2 -2
  299. package/dist/esm/ion-picker-column.entry.js +3 -3
  300. package/dist/esm/ion-picker.entry.js +7 -7
  301. package/dist/esm/ion-popover.entry.js +8 -8
  302. package/dist/esm/ion-range.entry.js +5 -5
  303. package/dist/esm/ion-refresher-content.entry.js +6 -6
  304. package/dist/esm/ion-refresher.entry.js +6 -6
  305. package/dist/esm/ion-reorder-group.entry.js +4 -4
  306. package/dist/esm/ion-reorder.entry.js +3 -3
  307. package/dist/esm/ion-route-redirect.entry.js +1 -1
  308. package/dist/esm/ion-route.entry.js +1 -1
  309. package/dist/esm/ion-router-link.entry.js +2 -2
  310. package/dist/esm/ion-router-outlet.entry.js +6 -6
  311. package/dist/esm/ion-router.entry.js +2 -2
  312. package/dist/esm/ion-row.entry.js +2 -2
  313. package/dist/{components/searchbar.js → esm/ion-searchbar.entry.js} +17 -70
  314. package/dist/esm/ion-searchbar.entry.js.map +1 -0
  315. package/dist/esm/ion-segment-button.entry.js +3 -3
  316. package/dist/esm/ion-segment.entry.js +3 -3
  317. package/dist/esm/ion-select-option.entry.js +2 -2
  318. package/dist/esm/ion-select.entry.js +9 -9
  319. package/dist/esm/ion-spinner.entry.js +2 -2
  320. package/dist/esm/ion-split-pane.entry.js +2 -2
  321. package/dist/esm/ion-tab-bar.entry.js +2 -2
  322. package/dist/esm/ion-tab-button.entry.js +3 -3
  323. package/dist/esm/ion-tab.entry.js +3 -3
  324. package/dist/esm/ion-tabs.entry.js +1 -1
  325. package/dist/esm/ion-text.entry.js +2 -2
  326. package/dist/esm/ion-textarea.entry.js +6 -6
  327. package/dist/esm/ion-thumbnail.entry.js +2 -2
  328. package/dist/esm/ion-title.entry.js +2 -2
  329. package/dist/esm/ion-toggle.entry.js +5 -5
  330. package/dist/esm/ion-toolbar.entry.js +2 -2
  331. package/dist/esm/{ionic-global-07f989af.js → ionic-global-dc58df6a.js} +2 -2
  332. package/dist/esm/{ionic-global-07f989af.js.map → ionic-global-dc58df6a.js.map} +1 -1
  333. package/dist/esm/{ios.transition-02b5b74a.js → ios.transition-cd6a57b8.js} +5 -5
  334. package/dist/esm/{ios.transition-02b5b74a.js.map → ios.transition-cd6a57b8.js.map} +1 -1
  335. package/dist/esm/loader.js +5 -5
  336. package/dist/esm/{md.transition-0e6cf607.js → md.transition-a2999731.js} +5 -5
  337. package/dist/esm/{md.transition-0e6cf607.js.map → md.transition-a2999731.js.map} +1 -1
  338. package/dist/esm/{menu-toggle-util-6257f7b5.js → menu-toggle-util-5d79b187.js} +2 -2
  339. package/dist/esm/{menu-toggle-util-6257f7b5.js.map → menu-toggle-util-5d79b187.js.map} +1 -1
  340. package/dist/esm/{notch-controller-79926902.js → notch-controller-ce206c7f.js} +2 -2
  341. package/dist/esm/{notch-controller-79926902.js.map → notch-controller-ce206c7f.js.map} +1 -1
  342. package/dist/esm/{overlays-ef03d5bd.js → overlays-d7fc4ce2.js} +5 -5
  343. package/dist/esm/{overlays-ef03d5bd.js.map → overlays-d7fc4ce2.js.map} +1 -1
  344. package/dist/esm/pos-app-document-viewer.entry.js +1 -1
  345. package/dist/esm/pos-app-generic.entry.js +1 -1
  346. package/dist/esm/pos-app-image-viewer.entry.js +1 -1
  347. package/dist/esm/pos-app-ldp-container.entry.js +1 -1
  348. package/dist/esm/pos-app-rdf-document.entry.js +1 -1
  349. package/dist/esm/pos-container-contents.entry.js +1 -1
  350. package/dist/esm/pos-container-item.entry.js +1 -1
  351. package/dist/esm/pos-document.entry.js +2 -2
  352. package/dist/esm/pos-list.entry.js +1 -1
  353. package/dist/esm/pos-relations_2.entry.js +1 -1
  354. package/dist/esm/pos-subjects.entry.js +1 -1
  355. package/dist/esm/pos-value.entry.js +1 -1
  356. package/dist/esm/{refresher.utils-d191622d.js → refresher.utils-e60a7dd8.js} +4 -4
  357. package/dist/esm/{refresher.utils-d191622d.js.map → refresher.utils-e60a7dd8.js.map} +1 -1
  358. package/dist/esm/{status-tap-cdf580e7.js → status-tap-a4c12279.js} +4 -4
  359. package/dist/esm/{status-tap-cdf580e7.js.map → status-tap-a4c12279.js.map} +1 -1
  360. package/dist/esm/{swipe-back-698e6532.js → swipe-back-c940b28a.js} +2 -2
  361. package/dist/esm/{swipe-back-698e6532.js.map → swipe-back-c940b28a.js.map} +1 -1
  362. package/dist/types/apps/pos-app-browser/pos-app-browser.d.ts +2 -1
  363. package/dist/types/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.d.ts +2 -0
  364. package/dist/types/components/pos-login/pos-login.d.ts +5 -0
  365. package/dist/types/components/pos-make-findable/pos-make-findable.d.ts +6 -3
  366. package/dist/types/components/pos-make-findable/shoelace.d.ts +3 -0
  367. package/dist/types/components/pos-navigation/__test/typeToSearch.d.ts +1 -0
  368. package/dist/types/components/pos-navigation/bar/pos-navigation-bar.d.ts +11 -0
  369. package/dist/types/components/pos-navigation/pos-navigation.d.ts +44 -0
  370. package/dist/types/components/pos-user-menu/pos-user-menu.d.ts +13 -0
  371. package/dist/types/components/pos-user-menu/shoelace.d.ts +5 -0
  372. package/dist/types/components.d.ts +97 -7
  373. package/package.json +2 -1
  374. package/dist/cjs/app-globals-1c06b5ae.js +0 -16
  375. package/dist/cjs/app-globals-1c06b5ae.js.map +0 -1
  376. package/dist/cjs/ion-icon_31.cjs.entry.js +0 -4286
  377. package/dist/cjs/ion-icon_31.cjs.entry.js.map +0 -1
  378. package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.css +0 -51
  379. package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.js.map +0 -1
  380. package/dist/elements/p-07773ed5.entry.js +0 -2
  381. package/dist/elements/p-250d4bf1.entry.js +0 -2
  382. package/dist/elements/p-2f0509be.entry.js +0 -2
  383. package/dist/elements/p-4c78c8c9.js +0 -5
  384. package/dist/elements/p-523432d1.js +0 -2
  385. package/dist/elements/p-523432d1.js.map +0 -1
  386. package/dist/elements/p-627826b0.entry.js +0 -2
  387. package/dist/elements/p-66a58eb0.entry.js +0 -2
  388. package/dist/elements/p-7f53778f.entry.js +0 -2
  389. package/dist/elements/p-8f6d1cbe.entry.js +0 -2
  390. package/dist/elements/p-932de51e.js +0 -8
  391. package/dist/elements/p-95161a5d.entry.js +0 -2
  392. package/dist/elements/p-a06d93c7.entry.js +0 -2
  393. package/dist/elements/p-a13569cf.entry.js +0 -2
  394. package/dist/elements/p-a37a2712.js +0 -5
  395. package/dist/elements/p-b34f1af4.entry.js +0 -20
  396. package/dist/elements/p-b34f1af4.entry.js.map +0 -1
  397. package/dist/elements/p-bca341ba.entry.js +0 -2
  398. package/dist/elements/p-bdea20c4.entry.js +0 -2
  399. package/dist/elements/p-c01a4a79.entry.js +0 -2
  400. package/dist/elements/p-c452a2e9.js +0 -5
  401. package/dist/elements/p-d1e7b393.js +0 -5
  402. package/dist/elements/p-d358565a.entry.js +0 -2
  403. package/dist/elements/p-eba70ed1.js +0 -6
  404. package/dist/elements/p-f67bba50.js +0 -5
  405. package/dist/esm/app-globals-f420d326.js +0 -14
  406. package/dist/esm/app-globals-f420d326.js.map +0 -1
  407. package/dist/esm/ion-icon_31.entry.js +0 -4252
  408. package/dist/esm/ion-icon_31.entry.js.map +0 -1
  409. package/dist/types/components/pos-navigation-bar/pos-navigation-bar.d.ts +0 -25
  410. /package/dist/elements/{p-a6c03ce8.js.map → p-01adc2b7.js.map} +0 -0
  411. /package/dist/elements/{p-7190d53c.entry.js.map → p-09ff1516.entry.js.map} +0 -0
  412. /package/dist/elements/{p-307d1531.js.map → p-0a6631d5.js.map} +0 -0
  413. /package/dist/elements/{p-c698ab8e.entry.js.map → p-0b3d14ec.entry.js.map} +0 -0
  414. /package/dist/elements/{p-d8818bb3.entry.js.map → p-0d4f129d.entry.js.map} +0 -0
  415. /package/dist/elements/{p-07773ed5.entry.js.map → p-104fee38.entry.js.map} +0 -0
  416. /package/dist/elements/{p-6cc9961e.entry.js.map → p-11466af2.entry.js.map} +0 -0
  417. /package/dist/elements/{p-3e6ffc13.entry.js.map → p-11845ff3.entry.js.map} +0 -0
  418. /package/dist/elements/{p-a507d627.entry.js.map → p-151d1ec8.entry.js.map} +0 -0
  419. /package/dist/elements/{p-89aef852.js.map → p-1930ffd5.js.map} +0 -0
  420. /package/dist/elements/{p-aa7d93f1.entry.js.map → p-1a1222a3.entry.js.map} +0 -0
  421. /package/dist/elements/{p-4dd65d40.entry.js.map → p-1e05efd7.entry.js.map} +0 -0
  422. /package/dist/elements/{p-f50c3045.entry.js.map → p-1faf2d02.entry.js.map} +0 -0
  423. /package/dist/elements/{p-a421bbe5.entry.js.map → p-21e90439.entry.js.map} +0 -0
  424. /package/dist/elements/{p-552a9992.entry.js.map → p-22c21319.entry.js.map} +0 -0
  425. /package/dist/elements/{p-66973c59.entry.js.map → p-24d93ddd.entry.js.map} +0 -0
  426. /package/dist/elements/{p-8f6d1cbe.entry.js.map → p-258f2385.entry.js.map} +0 -0
  427. /package/dist/elements/{p-72a9cbdc.entry.js.map → p-27bd8113.entry.js.map} +0 -0
  428. /package/dist/elements/{p-c350af00.entry.js.map → p-2948d57b.entry.js.map} +0 -0
  429. /package/dist/elements/{p-41bb9792.entry.js.map → p-2cdaf88b.entry.js.map} +0 -0
  430. /package/dist/elements/{p-fa0be1d8.entry.js.map → p-2e08ee3a.entry.js.map} +0 -0
  431. /package/dist/elements/{p-239442f9.entry.js.map → p-2e0c20e7.entry.js.map} +0 -0
  432. /package/dist/elements/{p-627826b0.entry.js.map → p-2ec92ff9.entry.js.map} +0 -0
  433. /package/dist/elements/{p-8e8881a8.entry.js.map → p-30834f34.entry.js.map} +0 -0
  434. /package/dist/elements/{p-eba70ed1.js.map → p-30cd90ec.js.map} +0 -0
  435. /package/dist/elements/{p-ae984107.entry.js.map → p-3585f786.entry.js.map} +0 -0
  436. /package/dist/elements/{p-d08312dd.entry.js.map → p-35f84573.entry.js.map} +0 -0
  437. /package/dist/elements/{p-ffa8c481.entry.js.map → p-3f02cc92.entry.js.map} +0 -0
  438. /package/dist/elements/{p-71ee259b.js.map → p-3f316fc4.js.map} +0 -0
  439. /package/dist/elements/{p-bc675b21.entry.js.map → p-3f3b74e6.entry.js.map} +0 -0
  440. /package/dist/elements/{p-7f53778f.entry.js.map → p-40a2d567.entry.js.map} +0 -0
  441. /package/dist/elements/{p-e78cf007.entry.js.map → p-4dc7c524.entry.js.map} +0 -0
  442. /package/dist/elements/{p-c191e6df.js.map → p-4e8c31fa.js.map} +0 -0
  443. /package/dist/elements/{p-a45b1964.entry.js.map → p-5051d2a6.entry.js.map} +0 -0
  444. /package/dist/elements/{p-e0de7c6a.entry.js.map → p-5a061ddb.entry.js.map} +0 -0
  445. /package/dist/elements/{p-061819d1.js.map → p-5a8e7149.js.map} +0 -0
  446. /package/dist/elements/{p-4c78c8c9.js.map → p-5bf4c45a.js.map} +0 -0
  447. /package/dist/elements/{p-b9dcf3b2.js.map → p-5e8a3893.js.map} +0 -0
  448. /package/dist/elements/{p-300ec095.entry.js.map → p-602861f4.entry.js.map} +0 -0
  449. /package/dist/elements/{p-4a370bdc.entry.js.map → p-627d5e73.entry.js.map} +0 -0
  450. /package/dist/elements/{p-406df11a.entry.js.map → p-648dac6c.entry.js.map} +0 -0
  451. /package/dist/elements/{p-07d2bd5a.entry.js.map → p-650db824.entry.js.map} +0 -0
  452. /package/dist/elements/{p-cb550d04.entry.js.map → p-682dd0f9.entry.js.map} +0 -0
  453. /package/dist/elements/{p-59ec8b76.entry.js.map → p-689a5c54.entry.js.map} +0 -0
  454. /package/dist/elements/{p-d6394ee4.entry.js.map → p-6a701de0.entry.js.map} +0 -0
  455. /package/dist/elements/{p-f4035b4a.entry.js.map → p-6ca9bad7.entry.js.map} +0 -0
  456. /package/dist/elements/{p-25926b66.entry.js.map → p-6cae9207.entry.js.map} +0 -0
  457. /package/dist/elements/{p-6119b57a.entry.js.map → p-6e5c902a.entry.js.map} +0 -0
  458. /package/dist/elements/{p-0ddcbecd.entry.js.map → p-72ba182e.entry.js.map} +0 -0
  459. /package/dist/elements/{p-1b2d32c1.entry.js.map → p-8619a806.entry.js.map} +0 -0
  460. /package/dist/elements/{p-4383e1bb.entry.js.map → p-87af433a.entry.js.map} +0 -0
  461. /package/dist/elements/{p-f96384f2.entry.js.map → p-87eb06bc.entry.js.map} +0 -0
  462. /package/dist/elements/{p-e8268c7a.entry.js.map → p-8c13ce70.entry.js.map} +0 -0
  463. /package/dist/elements/{p-b64a85bf.entry.js.map → p-8f6d4374.entry.js.map} +0 -0
  464. /package/dist/elements/{p-949b115f.js.map → p-91025a2c.js.map} +0 -0
  465. /package/dist/elements/{p-71835d6f.entry.js.map → p-95036276.entry.js.map} +0 -0
  466. /package/dist/elements/{p-42169e41.js.map → p-97889672.js.map} +0 -0
  467. /package/dist/elements/{p-8b209e66.entry.js.map → p-9840f300.entry.js.map} +0 -0
  468. /package/dist/elements/{p-a37a2712.js.map → p-98b2844f.js.map} +0 -0
  469. /package/dist/elements/{p-fa19a3e9.entry.js.map → p-9d23baee.entry.js.map} +0 -0
  470. /package/dist/elements/{p-7e8b8df1.entry.js.map → p-9d6c94d3.entry.js.map} +0 -0
  471. /package/dist/elements/{p-41854c8f.entry.js.map → p-9d81c061.entry.js.map} +0 -0
  472. /package/dist/elements/{p-dadb557e.entry.js.map → p-a19fb8fa.entry.js.map} +0 -0
  473. /package/dist/elements/{p-9a4bf79e.entry.js.map → p-a7c9aa13.entry.js.map} +0 -0
  474. /package/dist/elements/{p-0ee8b7a7.js.map → p-acfa402f.js.map} +0 -0
  475. /package/dist/elements/{p-facc0ac5.entry.js.map → p-af03cfbe.entry.js.map} +0 -0
  476. /package/dist/elements/{p-b8bd7745.entry.js.map → p-af2b9ecb.entry.js.map} +0 -0
  477. /package/dist/elements/{p-cbf050d6.js.map → p-b110cb49.js.map} +0 -0
  478. /package/dist/elements/{p-09d80405.entry.js.map → p-b1292dde.entry.js.map} +0 -0
  479. /package/dist/elements/{p-4ccdbcbf.entry.js.map → p-b1de75a4.entry.js.map} +0 -0
  480. /package/dist/elements/{p-a376351f.entry.js.map → p-b34203cd.entry.js.map} +0 -0
  481. /package/dist/elements/{p-dc709055.entry.js.map → p-b954a40f.entry.js.map} +0 -0
  482. /package/dist/elements/{p-1fc8e557.js.map → p-bde7428a.js.map} +0 -0
  483. /package/dist/elements/{p-734e5a97.js.map → p-bf5335d4.js.map} +0 -0
  484. /package/dist/elements/{p-932de51e.js.map → p-c1df6af7.js.map} +0 -0
  485. /package/dist/elements/{p-cbae963d.js.map → p-c30eb80f.js.map} +0 -0
  486. /package/dist/elements/{p-4c078751.entry.js.map → p-c4332c66.entry.js.map} +0 -0
  487. /package/dist/elements/{p-8e1c68eb.entry.js.map → p-c466d5bf.entry.js.map} +0 -0
  488. /package/dist/elements/{p-36caf749.entry.js.map → p-c4894c44.entry.js.map} +0 -0
  489. /package/dist/elements/{p-87c81685.entry.js.map → p-c4e1867e.entry.js.map} +0 -0
  490. /package/dist/elements/{p-645632a8.entry.js.map → p-c7db2b55.entry.js.map} +0 -0
  491. /package/dist/elements/{p-a13569cf.entry.js.map → p-cb3e5072.entry.js.map} +0 -0
  492. /package/dist/elements/{p-49fcec88.entry.js.map → p-d54d552d.entry.js.map} +0 -0
  493. /package/dist/elements/{p-2a548485.entry.js.map → p-d7b597ed.entry.js.map} +0 -0
  494. /package/dist/elements/{p-c452a2e9.js.map → p-da0c771e.js.map} +0 -0
  495. /package/dist/elements/{p-7183a9ca.entry.js.map → p-dbb94429.entry.js.map} +0 -0
  496. /package/dist/elements/{p-c9604122.entry.js.map → p-de6d7967.entry.js.map} +0 -0
  497. /package/dist/elements/{p-b5f6b322.entry.js.map → p-e15ff70c.entry.js.map} +0 -0
  498. /package/dist/elements/{p-f67bba50.js.map → p-e43d654c.js.map} +0 -0
  499. /package/dist/elements/{p-01981011.entry.js.map → p-e7fbd427.entry.js.map} +0 -0
  500. /package/dist/elements/{p-d61d280b.js.map → p-e912617c.js.map} +0 -0
  501. /package/dist/elements/{p-da0d920d.js.map → p-ebe1c8ca.js.map} +0 -0
  502. /package/dist/elements/{p-d872fe3e.entry.js.map → p-ec283f66.entry.js.map} +0 -0
  503. /package/dist/elements/{p-f40b3ec6.entry.js.map → p-ed22dcc0.entry.js.map} +0 -0
  504. /package/dist/elements/{p-05fff093.entry.js.map → p-eeaffc3b.entry.js.map} +0 -0
  505. /package/dist/elements/{p-d1e7b393.js.map → p-f2c0c8a9.js.map} +0 -0
  506. /package/dist/elements/{p-c186950b.entry.js.map → p-f3bf8ff7.entry.js.map} +0 -0
  507. /package/dist/elements/{p-5441ae35.entry.js.map → p-fb740291.entry.js.map} +0 -0
  508. /package/dist/elements/{p-5bf40440.entry.js.map → p-fbff274c.entry.js.map} +0 -0
  509. /package/dist/elements/{p-266d2934.entry.js.map → p-fd84af22.entry.js.map} +0 -0
  510. /package/dist/elements/{p-a08f0446.entry.js.map → p-ff684bff.entry.js.map} +0 -0
@@ -1,4286 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-45dd971c.js');
6
- const helpers = require('./helpers-95c22e6d.js');
7
- const theme = require('./theme-187bbc7d.js');
8
- const ionicGlobal = require('./ionic-global-c7ac1ce0.js');
9
- const dir = require('./dir-e6b438e6.js');
10
- const index$1 = require('./index-3129b55a.js');
11
- const index$5 = require('./index-60f1e8e6.js');
12
- const lockController = require('./lock-controller-63fc03ed.js');
13
- const index$3 = require('./index-5fa17650.js');
14
- const overlays = require('./overlays-b8b12de8.js');
15
- const animation = require('./animation-7c90c75b.js');
16
- const index$2 = require('./index-957a289d.js');
17
- const index$4 = require('./index-f0c9b0af.js');
18
- const BrokenFile = require('./BrokenFile-26f83028.js');
19
- const index$6 = require('./index-f7ca7362.js');
20
- const ResourceAware = require('./ResourceAware-7b6501ae.js');
21
- require('./gesture-controller-85b9b0a5.js');
22
- const PodOsAware = require('./PodOsAware-a16ddb44.js');
23
- require('./hardware-back-button-e71c41f7.js');
24
- require('./framework-delegate-a257df68.js');
25
-
26
- let CACHED_MAP;
27
- const getIconMap = () => {
28
- if (typeof window === 'undefined') {
29
- return new Map();
30
- }
31
- else {
32
- if (!CACHED_MAP) {
33
- const win = window;
34
- win.Ionicons = win.Ionicons || {};
35
- CACHED_MAP = win.Ionicons.map = win.Ionicons.map || new Map();
36
- }
37
- return CACHED_MAP;
38
- }
39
- };
40
- const getUrl = (i) => {
41
- let url = getSrc(i.src);
42
- if (url) {
43
- return url;
44
- }
45
- url = getName(i.name, i.icon, i.mode, i.ios, i.md);
46
- if (url) {
47
- return getNamedUrl(url, i);
48
- }
49
- if (i.icon) {
50
- url = getSrc(i.icon);
51
- if (url) {
52
- return url;
53
- }
54
- url = getSrc(i.icon[i.mode]);
55
- if (url) {
56
- return url;
57
- }
58
- }
59
- return null;
60
- };
61
- const getNamedUrl = (iconName, iconEl) => {
62
- const url = getIconMap().get(iconName);
63
- if (url) {
64
- return url;
65
- }
66
- try {
67
- return index.getAssetPath(`svg/${iconName}.svg`);
68
- }
69
- catch (e) {
70
- /**
71
- * In the custom elements build version of ionicons, referencing an icon
72
- * by name will throw an invalid URL error because the asset path is not defined.
73
- * This catches that error and logs something that is more developer-friendly.
74
- * We also include a reference to the ion-icon element so developers can
75
- * figure out which instance of ion-icon needs to be updated.
76
- */
77
- console.warn(`[Ionicons Warning]: Could not load icon with name "${iconName}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`, iconEl);
78
- }
79
- };
80
- const getName = (iconName, icon, mode, ios, md) => {
81
- // default to "md" if somehow the mode wasn't set
82
- mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
83
- // if an icon was passed in using the ios or md attributes
84
- // set the iconName to whatever was passed in
85
- if (ios && mode === 'ios') {
86
- iconName = toLower(ios);
87
- }
88
- else if (md && mode === 'md') {
89
- iconName = toLower(md);
90
- }
91
- else {
92
- if (!iconName && icon && !isSrc(icon)) {
93
- iconName = icon;
94
- }
95
- if (isStr(iconName)) {
96
- iconName = toLower(iconName);
97
- }
98
- }
99
- if (!isStr(iconName) || iconName.trim() === '') {
100
- return null;
101
- }
102
- // only allow alpha characters and dash
103
- const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
104
- if (invalidChars !== '') {
105
- return null;
106
- }
107
- return iconName;
108
- };
109
- const getSrc = (src) => {
110
- if (isStr(src)) {
111
- src = src.trim();
112
- if (isSrc(src)) {
113
- return src;
114
- }
115
- }
116
- return null;
117
- };
118
- const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
119
- const isStr = (val) => typeof val === 'string';
120
- const toLower = (val) => val.toLowerCase();
121
- /**
122
- * Elements inside of web components sometimes need to inherit global attributes
123
- * set on the host. For example, the inner input in `ion-input` should inherit
124
- * the `title` attribute that developers set directly on `ion-input`. This
125
- * helper function should be called in componentWillLoad and assigned to a variable
126
- * that is later used in the render function.
127
- *
128
- * This does not need to be reactive as changing attributes on the host element
129
- * does not trigger a re-render.
130
- */
131
- const inheritAttributes = (el, attributes = []) => {
132
- const attributeObject = {};
133
- attributes.forEach(attr => {
134
- if (el.hasAttribute(attr)) {
135
- const value = el.getAttribute(attr);
136
- if (value !== null) {
137
- attributeObject[attr] = el.getAttribute(attr);
138
- }
139
- el.removeAttribute(attr);
140
- }
141
- });
142
- return attributeObject;
143
- };
144
- /**
145
- * Returns `true` if the document or host element
146
- * has a `dir` set to `rtl`. The host value will always
147
- * take priority over the root document value.
148
- */
149
- const isRTL = (hostEl) => {
150
- if (hostEl) {
151
- if (hostEl.dir !== '') {
152
- return hostEl.dir.toLowerCase() === 'rtl';
153
- }
154
- }
155
- return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
156
- };
157
-
158
- const validateContent = (svgContent) => {
159
- const div = document.createElement('div');
160
- div.innerHTML = svgContent;
161
- // setup this way to ensure it works on our buddy IE
162
- for (let i = div.childNodes.length - 1; i >= 0; i--) {
163
- if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
164
- div.removeChild(div.childNodes[i]);
165
- }
166
- }
167
- // must only have 1 root element
168
- const svgElm = div.firstElementChild;
169
- if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
170
- const svgClass = svgElm.getAttribute('class') || '';
171
- svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
172
- // root element must be an svg
173
- // lets double check we've got valid elements
174
- // do not allow scripts
175
- if (isValid(svgElm)) {
176
- return div.innerHTML;
177
- }
178
- }
179
- return '';
180
- };
181
- const isValid = (elm) => {
182
- if (elm.nodeType === 1) {
183
- if (elm.nodeName.toLowerCase() === 'script') {
184
- return false;
185
- }
186
- for (let i = 0; i < elm.attributes.length; i++) {
187
- const name = elm.attributes[i].name;
188
- if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {
189
- return false;
190
- }
191
- }
192
- for (let i = 0; i < elm.childNodes.length; i++) {
193
- if (!isValid(elm.childNodes[i])) {
194
- return false;
195
- }
196
- }
197
- }
198
- return true;
199
- };
200
- const isSvgDataUrl = (url) => url.startsWith('data:image/svg+xml');
201
- const isEncodedDataUrl = (url) => url.indexOf(';utf8,') !== -1;
202
-
203
- const ioniconContent = new Map();
204
- const requests = new Map();
205
- let parser;
206
- const getSvgContent = (url, sanitize) => {
207
- // see if we already have a request for this url
208
- let req = requests.get(url);
209
- if (!req) {
210
- if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
211
- /**
212
- * If the url is a data url of an svg, then try to parse it
213
- * with the DOMParser. This works with content security policies enabled.
214
- */
215
- if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {
216
- if (!parser) {
217
- /**
218
- * Create an instance of the DOM parser. This creates a single
219
- * parser instance for the entire app, which is more efficient.
220
- */
221
- parser = new DOMParser();
222
- }
223
- const doc = parser.parseFromString(url, 'text/html');
224
- const svg = doc.querySelector('svg');
225
- if (svg) {
226
- ioniconContent.set(url, svg.outerHTML);
227
- }
228
- return Promise.resolve();
229
- }
230
- else {
231
- // we don't already have a request
232
- req = fetch(url).then((rsp) => {
233
- if (rsp.ok) {
234
- return rsp.text().then((svgContent) => {
235
- if (svgContent && sanitize !== false) {
236
- svgContent = validateContent(svgContent);
237
- }
238
- ioniconContent.set(url, svgContent || '');
239
- });
240
- }
241
- ioniconContent.set(url, '');
242
- });
243
- // cache for the same requests
244
- requests.set(url, req);
245
- }
246
- }
247
- else {
248
- // set to empty for ssr scenarios and resolve promise
249
- ioniconContent.set(url, '');
250
- return Promise.resolve();
251
- }
252
- }
253
- return req;
254
- };
255
-
256
- const iconCss = ":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}@supports (background: -webkit-named-image(i)){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}@supports not selector(:dir(rtl)) and selector(:host-context([dir='rtl'])){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}:host(.flip-rtl):host-context([dir='rtl']) .icon-inner{transform:scaleX(-1)}@supports selector(:dir(rtl)){:host(.flip-rtl:dir(rtl)) .icon-inner{transform:scaleX(-1)}:host(.flip-rtl:dir(ltr)) .icon-inner{transform:scaleX(1)}}:host(.icon-small){font-size:1.125rem !important}:host(.icon-large){font-size:2rem !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}";
257
- const IonIconStyle0 = iconCss;
258
-
259
- const Icon = class {
260
- constructor(hostRef) {
261
- index.registerInstance(this, hostRef);
262
- this.iconName = null;
263
- this.inheritedAttributes = {};
264
- this.didLoadIcon = false;
265
- this.svgContent = undefined;
266
- this.isVisible = false;
267
- this.mode = getIonMode();
268
- this.color = undefined;
269
- this.ios = undefined;
270
- this.md = undefined;
271
- this.flipRtl = undefined;
272
- this.name = undefined;
273
- this.src = undefined;
274
- this.icon = undefined;
275
- this.size = undefined;
276
- this.lazy = false;
277
- this.sanitize = true;
278
- }
279
- componentWillLoad() {
280
- this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
281
- }
282
- connectedCallback() {
283
- // purposely do not return the promise here because loading
284
- // the svg file should not hold up loading the app
285
- // only load the svg if it's visible
286
- this.waitUntilVisible(this.el, '50px', () => {
287
- this.isVisible = true;
288
- this.loadIcon();
289
- });
290
- }
291
- componentDidLoad() {
292
- /**
293
- * Addresses an Angular issue where property values are assigned after the 'connectedCallback' but prior to the registration of watchers.
294
- * This enhancement ensures the loading of an icon when the component has finished rendering and the icon has yet to apply the SVG data.
295
- * This modification pertains to the usage of Angular's binding syntax:
296
- * `<ion-icon [name]="myIconName"></ion-icon>`
297
- */
298
- if (!this.didLoadIcon) {
299
- this.loadIcon();
300
- }
301
- }
302
- disconnectedCallback() {
303
- if (this.io) {
304
- this.io.disconnect();
305
- this.io = undefined;
306
- }
307
- }
308
- waitUntilVisible(el, rootMargin, cb) {
309
- if (this.lazy && typeof window !== 'undefined' && window.IntersectionObserver) {
310
- const io = (this.io = new window.IntersectionObserver((data) => {
311
- if (data[0].isIntersecting) {
312
- io.disconnect();
313
- this.io = undefined;
314
- cb();
315
- }
316
- }, { rootMargin }));
317
- io.observe(el);
318
- }
319
- else {
320
- // browser doesn't support IntersectionObserver
321
- // so just fallback to always show it
322
- cb();
323
- }
324
- }
325
- loadIcon() {
326
- if (this.isVisible) {
327
- const url = getUrl(this);
328
- if (url) {
329
- if (ioniconContent.has(url)) {
330
- // sync if it's already loaded
331
- this.svgContent = ioniconContent.get(url);
332
- }
333
- else {
334
- // async if it hasn't been loaded
335
- getSvgContent(url, this.sanitize).then(() => (this.svgContent = ioniconContent.get(url)));
336
- }
337
- this.didLoadIcon = true;
338
- }
339
- }
340
- this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
341
- }
342
- render() {
343
- const { flipRtl, iconName, inheritedAttributes, el } = this;
344
- const mode = this.mode || 'md';
345
- // we have designated that arrows & chevrons should automatically flip (unless flip-rtl is set to false) because "back" is left in ltr and right in rtl, and "forward" is the opposite
346
- const shouldAutoFlip = iconName
347
- ? (iconName.includes('arrow') || iconName.includes('chevron')) && flipRtl !== false
348
- : false;
349
- // if shouldBeFlippable is true, the icon should change direction when `dir` changes
350
- const shouldBeFlippable = flipRtl || shouldAutoFlip;
351
- return (index.h(index.Host, Object.assign({ role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': shouldBeFlippable, 'icon-rtl': shouldBeFlippable && isRTL(el) }) }, inheritedAttributes), this.svgContent ? (index.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (index.h("div", { class: "icon-inner" }))));
352
- }
353
- static get assetsDirs() { return ["svg"]; }
354
- get el() { return index.getElement(this); }
355
- static get watchers() { return {
356
- "name": ["loadIcon"],
357
- "src": ["loadIcon"],
358
- "icon": ["loadIcon"],
359
- "ios": ["loadIcon"],
360
- "md": ["loadIcon"]
361
- }; }
362
- };
363
- const getIonMode = () => (typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
364
- const createColorClasses = (color) => {
365
- return color
366
- ? {
367
- 'ion-color': true,
368
- [`ion-color-${color}`]: true,
369
- }
370
- : null;
371
- };
372
- Icon.style = IonIconStyle0;
373
-
374
- const progressBarIosCss = ":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:3px}";
375
- const IonProgressBarIosStyle0 = progressBarIosCss;
376
-
377
- const progressBarMdCss = ":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:4px}";
378
- const IonProgressBarMdStyle0 = progressBarMdCss;
379
-
380
- const ProgressBar = class {
381
- constructor(hostRef) {
382
- index.registerInstance(this, hostRef);
383
- this.type = 'determinate';
384
- this.reversed = false;
385
- this.value = 0;
386
- this.buffer = 1;
387
- this.color = undefined;
388
- }
389
- render() {
390
- const { color, type, reversed, value, buffer } = this;
391
- const paused = ionicGlobal.config.getBoolean('_testing');
392
- const mode = ionicGlobal.getIonMode(this);
393
- return (index.h(index.Host, { key: '944b79ed6fce1b2c0ed48681cd8517a5abbddd80', role: "progressbar", "aria-valuenow": type === 'determinate' ? value : null, "aria-valuemin": "0", "aria-valuemax": "1", class: theme.createColorClasses(color, {
394
- [mode]: true,
395
- [`progress-bar-${type}`]: true,
396
- 'progress-paused': paused,
397
- 'progress-bar-reversed': document.dir === 'rtl' ? !reversed : reversed,
398
- }) }, type === 'indeterminate' ? renderIndeterminate() : renderProgress(value, buffer)));
399
- }
400
- };
401
- const renderIndeterminate = () => {
402
- return (index.h("div", { part: "track", class: "progress-buffer-bar" }, index.h("div", { class: "indeterminate-bar-primary" }, index.h("span", { part: "progress", class: "progress-indeterminate" })), index.h("div", { class: "indeterminate-bar-secondary" }, index.h("span", { part: "progress", class: "progress-indeterminate" }))));
403
- };
404
- const renderProgress = (value, buffer) => {
405
- const finalValue = helpers.clamp(0, value, 1);
406
- const finalBuffer = helpers.clamp(0, buffer, 1);
407
- return [
408
- index.h("div", { part: "progress", class: "progress", style: { transform: `scaleX(${finalValue})` } }),
409
- /**
410
- * Buffer circles with two container to move
411
- * the circles behind the buffer progress
412
- * with respecting the animation.
413
- * When finalBuffer === 1, we use display: none
414
- * instead of removing the element to avoid flickering.
415
- */
416
- index.h("div", { class: { 'buffer-circles-container': true, 'ion-hide': finalBuffer === 1 }, style: { transform: `translateX(${finalBuffer * 100}%)` } }, index.h("div", { class: "buffer-circles-container", style: { transform: `translateX(-${finalBuffer * 100}%)` } }, index.h("div", { part: "stream", class: "buffer-circles" }))),
417
- index.h("div", { part: "track", class: "progress-buffer-bar", style: { transform: `scaleX(${finalBuffer})` } }),
418
- ];
419
- };
420
- ProgressBar.style = {
421
- ios: IonProgressBarIosStyle0,
422
- md: IonProgressBarMdStyle0
423
- };
424
-
425
- const rippleEffectCss = ":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{transform:translate(var(--translate-end)) scale(var(--final-scale, 1));animation:150ms fadeOutAnimation forwards}@keyframes rippleAnimation{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(1)}to{transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes fadeInAnimation{from{animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeOutAnimation{from{animation-timing-function:linear;opacity:0.16}to{opacity:0}}";
426
- const IonRippleEffectStyle0 = rippleEffectCss;
427
-
428
- const RippleEffect = class {
429
- constructor(hostRef) {
430
- index.registerInstance(this, hostRef);
431
- this.type = 'bounded';
432
- }
433
- /**
434
- * Adds the ripple effect to the parent element.
435
- *
436
- * @param x The horizontal coordinate of where the ripple should start.
437
- * @param y The vertical coordinate of where the ripple should start.
438
- */
439
- async addRipple(x, y) {
440
- return new Promise((resolve) => {
441
- index.readTask(() => {
442
- const rect = this.el.getBoundingClientRect();
443
- const width = rect.width;
444
- const height = rect.height;
445
- const hypotenuse = Math.sqrt(width * width + height * height);
446
- const maxDim = Math.max(height, width);
447
- const maxRadius = this.unbounded ? maxDim : hypotenuse + PADDING;
448
- const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);
449
- const finalScale = maxRadius / initialSize;
450
- let posX = x - rect.left;
451
- let posY = y - rect.top;
452
- if (this.unbounded) {
453
- posX = width * 0.5;
454
- posY = height * 0.5;
455
- }
456
- const styleX = posX - initialSize * 0.5;
457
- const styleY = posY - initialSize * 0.5;
458
- const moveX = width * 0.5 - posX;
459
- const moveY = height * 0.5 - posY;
460
- index.writeTask(() => {
461
- const div = document.createElement('div');
462
- div.classList.add('ripple-effect');
463
- const style = div.style;
464
- style.top = styleY + 'px';
465
- style.left = styleX + 'px';
466
- style.width = style.height = initialSize + 'px';
467
- style.setProperty('--final-scale', `${finalScale}`);
468
- style.setProperty('--translate-end', `${moveX}px, ${moveY}px`);
469
- const container = this.el.shadowRoot || this.el;
470
- container.appendChild(div);
471
- setTimeout(() => {
472
- resolve(() => {
473
- removeRipple(div);
474
- });
475
- }, 225 + 100);
476
- });
477
- });
478
- });
479
- }
480
- get unbounded() {
481
- return this.type === 'unbounded';
482
- }
483
- render() {
484
- const mode = ionicGlobal.getIonMode(this);
485
- return (index.h(index.Host, { key: 'f1129019a6d556b008c754aeb79618c69baea9f8', role: "presentation", class: {
486
- [mode]: true,
487
- unbounded: this.unbounded,
488
- } }));
489
- }
490
- get el() { return index.getElement(this); }
491
- };
492
- const removeRipple = (ripple) => {
493
- ripple.classList.add('fade-out');
494
- setTimeout(() => {
495
- ripple.remove();
496
- }, 200);
497
- };
498
- const PADDING = 10;
499
- const INITIAL_ORIGIN_SCALE = 0.5;
500
- RippleEffect.style = IonRippleEffectStyle0;
501
-
502
- const searchbarIosCss = ".sc-ion-searchbar-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.6;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-ios-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:inherit}.searchbar-search-icon.sc-ion-searchbar-ios{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-ios{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;min-height:inherit;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-ios::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-ios>div.sc-ion-searchbar-ios{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-clear-button.sc-ion-searchbar-ios:focus{opacity:0.5}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{display:block}.searchbar-disabled.sc-ion-searchbar-ios-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.07);--border-radius:10px;--box-shadow:none;--cancel-button-color:var(--ion-color-primary, #3880ff);--clear-button-color:var(--ion-color-step-600, #666666);--color:var(--ion-text-color, #000);--icon-color:var(--ion-color-step-600, #666666);-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:12px;padding-bottom:12px;min-height:60px;contain:content}.searchbar-input-container.sc-ion-searchbar-ios{min-height:36px}.searchbar-search-icon.sc-ion-searchbar-ios{-webkit-margin-start:calc(50% - 60px);margin-inline-start:calc(50% - 60px);top:0;position:absolute;width:1.375rem;height:100%;contain:strict}@supports (inset-inline-start: 0){.searchbar-search-icon.sc-ion-searchbar-ios{inset-inline-start:5px}}@supports not (inset-inline-start: 0){.searchbar-search-icon.sc-ion-searchbar-ios{left:5px}[dir=rtl].sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{left:unset;right:unset;right:5px}[dir=rtl].sc-ion-searchbar-ios .searchbar-search-icon.sc-ion-searchbar-ios{left:unset;right:unset;right:5px}@supports selector(:dir(rtl)){.searchbar-search-icon.sc-ion-searchbar-ios:dir(rtl){left:unset;right:unset;right:5px}}}.searchbar-input.sc-ion-searchbar-ios{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:6px;padding-bottom:6px;height:100%;font-size:1.0625rem;font-weight:400;contain:strict}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{-webkit-padding-start:1.75rem;padding-inline-start:1.75rem;-webkit-padding-end:1.75rem;padding-inline-end:1.75rem}.searchbar-clear-button.sc-ion-searchbar-ios{top:0;background-position:center;position:absolute;width:1.875rem;height:100%;border:0;background-color:transparent}@supports (inset-inline-start: 0){.searchbar-clear-button.sc-ion-searchbar-ios{inset-inline-end:0}}@supports not (inset-inline-start: 0){.searchbar-clear-button.sc-ion-searchbar-ios{right:0}[dir=rtl].sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{left:unset;right:unset;left:0}[dir=rtl].sc-ion-searchbar-ios .searchbar-clear-button.sc-ion-searchbar-ios{left:unset;right:unset;left:0}@supports selector(:dir(rtl)){.searchbar-clear-button.sc-ion-searchbar-ios:dir(rtl){left:unset;right:unset;left:0}}}.searchbar-clear-icon.sc-ion-searchbar-ios{width:1.125rem;height:100%}.searchbar-cancel-button.sc-ion-searchbar-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;flex-shrink:0;background-color:transparent;font-size:16px}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{-webkit-margin-start:0;margin-inline-start:0}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{-webkit-padding-start:1.875rem;padding-inline-start:1.875rem}.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{display:block}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{transition:all 300ms ease}.searchbar-animated.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{opacity:1;pointer-events:auto}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{-webkit-margin-end:-100%;margin-inline-end:-100%;transform:translate3d(0, 0, 0);transition:all 300ms ease;opacity:0;pointer-events:none}.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{transition-duration:0ms}.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{color:var(--ion-color-base)}@media (any-hover: hover){.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios:hover{color:var(--ion-color-tint)}}ion-toolbar.sc-ion-searchbar-ios-h,ion-toolbar .sc-ion-searchbar-ios-h{padding-top:1px;padding-bottom:15px;min-height:52px}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color),ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color){color:inherit}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios{color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios{background:rgba(var(--ion-color-contrast-rgb), 0.07);color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}";
503
- const IonSearchbarIosStyle0 = searchbarIosCss;
504
-
505
- const searchbarMdCss = ".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.6;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;min-height:inherit;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-md::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md>div.sc-ion-searchbar-md{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-clear-button.sc-ion-searchbar-md:focus{opacity:0.5}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-md-h{--background:var(--ion-background-color, #fff);--border-radius:2px;--box-shadow:0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--cancel-button-color:var(--ion-color-step-900, #1a1a1a);--clear-button-color:initial;--color:var(--ion-color-step-850, #262626);--icon-color:var(--ion-color-step-600, #666666);-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;background:inherit}.searchbar-search-icon.sc-ion-searchbar-md{top:11px;width:1.3125rem;height:1.3125rem}@supports (inset-inline-start: 0){.searchbar-search-icon.sc-ion-searchbar-md{inset-inline-start:16px}}@supports not (inset-inline-start: 0){.searchbar-search-icon.sc-ion-searchbar-md{left:16px}[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}[dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}@supports selector(:dir(rtl)){.searchbar-search-icon.sc-ion-searchbar-md:dir(rtl){left:unset;right:unset;right:16px}}}.searchbar-cancel-button.sc-ion-searchbar-md{top:0;background-color:transparent;font-size:1.5em}@supports (inset-inline-start: 0){.searchbar-cancel-button.sc-ion-searchbar-md{inset-inline-start:9px}}@supports not (inset-inline-start: 0){.searchbar-cancel-button.sc-ion-searchbar-md{left:9px}[dir=rtl].sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:9px}[dir=rtl].sc-ion-searchbar-md .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:9px}@supports selector(:dir(rtl)){.searchbar-cancel-button.sc-ion-searchbar-md:dir(rtl){left:unset;right:unset;right:9px}}}.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-cancel-button.sc-ion-searchbar-md{position:absolute}.searchbar-search-icon.ion-activated.sc-ion-searchbar-md,.searchbar-cancel-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-input.sc-ion-searchbar-md{-webkit-padding-start:3.4375rem;padding-inline-start:3.4375rem;-webkit-padding-end:3.4375rem;padding-inline-end:3.4375rem;padding-top:0.375rem;padding-bottom:0.375rem;background-position:left 8px center;height:auto;font-size:1rem;font-weight:400;line-height:30px}[dir=rtl].sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}[dir=rtl].sc-ion-searchbar-md .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}@supports selector(:dir(rtl)){.searchbar-input.sc-ion-searchbar-md:dir(rtl){background-position:right 8px center}}.searchbar-clear-button.sc-ion-searchbar-md{top:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;position:absolute;height:100%;border:0;background-color:transparent}@supports (inset-inline-start: 0){.searchbar-clear-button.sc-ion-searchbar-md{inset-inline-end:13px}}@supports not (inset-inline-start: 0){.searchbar-clear-button.sc-ion-searchbar-md{right:13px}[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}[dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}@supports selector(:dir(rtl)){.searchbar-clear-button.sc-ion-searchbar-md:dir(rtl){left:unset;right:unset;left:13px}}}.searchbar-clear-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-clear-icon.sc-ion-searchbar-md{width:1.375rem;height:100%}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md{display:none}ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{-webkit-padding-start:7px;padding-inline-start:7px;-webkit-padding-end:7px;padding-inline-end:7px;padding-top:3px;padding-bottom:3px}";
506
- const IonSearchbarMdStyle0 = searchbarMdCss;
507
-
508
- const Searchbar = class {
509
- constructor(hostRef) {
510
- index.registerInstance(this, hostRef);
511
- this.ionInput = index.createEvent(this, "ionInput", 7);
512
- this.ionChange = index.createEvent(this, "ionChange", 7);
513
- this.ionCancel = index.createEvent(this, "ionCancel", 7);
514
- this.ionClear = index.createEvent(this, "ionClear", 7);
515
- this.ionBlur = index.createEvent(this, "ionBlur", 7);
516
- this.ionFocus = index.createEvent(this, "ionFocus", 7);
517
- this.ionStyle = index.createEvent(this, "ionStyle", 7);
518
- this.isCancelVisible = false;
519
- this.shouldAlignLeft = true;
520
- this.inputId = `ion-searchbar-${searchbarIds++}`;
521
- this.inheritedAttributes = {};
522
- /**
523
- * Clears the input field and triggers the control change.
524
- */
525
- this.onClearInput = async (shouldFocus) => {
526
- this.ionClear.emit();
527
- return new Promise((resolve) => {
528
- // setTimeout() fixes https://github.com/ionic-team/ionic/issues/7527
529
- // wait for 4 frames
530
- setTimeout(() => {
531
- const value = this.getValue();
532
- if (value !== '') {
533
- this.value = '';
534
- this.emitInputChange();
535
- /**
536
- * When tapping clear button
537
- * ensure input is focused after
538
- * clearing input so users
539
- * can quickly start typing.
540
- */
541
- if (shouldFocus && !this.focused) {
542
- this.setFocus();
543
- /**
544
- * The setFocus call above will clear focusedValue,
545
- * but ionChange will never have gotten a chance to
546
- * fire. Manually revert focusedValue so onBlur can
547
- * compare against what was in the box before the clear.
548
- */
549
- this.focusedValue = value;
550
- }
551
- }
552
- resolve();
553
- }, 16 * 4);
554
- });
555
- };
556
- /**
557
- * Clears the input field and tells the input to blur since
558
- * the clearInput function doesn't want the input to blur
559
- * then calls the custom cancel function if the user passed one in.
560
- */
561
- this.onCancelSearchbar = async (ev) => {
562
- if (ev) {
563
- ev.preventDefault();
564
- ev.stopPropagation();
565
- }
566
- this.ionCancel.emit();
567
- // get cached values before clearing the input
568
- const value = this.getValue();
569
- const focused = this.focused;
570
- await this.onClearInput();
571
- /**
572
- * If there used to be something in the box, and we weren't focused
573
- * beforehand (meaning no blur fired that would already handle this),
574
- * manually fire ionChange.
575
- */
576
- if (value && !focused) {
577
- this.emitValueChange(ev);
578
- }
579
- if (this.nativeInput) {
580
- this.nativeInput.blur();
581
- }
582
- };
583
- /**
584
- * Update the Searchbar input value when the input changes
585
- */
586
- this.onInput = (ev) => {
587
- const input = ev.target;
588
- if (input) {
589
- this.value = input.value;
590
- }
591
- this.emitInputChange(ev);
592
- };
593
- this.onChange = (ev) => {
594
- this.emitValueChange(ev);
595
- };
596
- /**
597
- * Sets the Searchbar to not focused and checks if it should align left
598
- * based on whether there is a value in the searchbar or not.
599
- */
600
- this.onBlur = (ev) => {
601
- this.focused = false;
602
- this.ionBlur.emit();
603
- this.positionElements();
604
- if (this.focusedValue !== this.value) {
605
- this.emitValueChange(ev);
606
- }
607
- this.focusedValue = undefined;
608
- };
609
- /**
610
- * Sets the Searchbar to focused and active on input focus.
611
- */
612
- this.onFocus = () => {
613
- this.focused = true;
614
- this.focusedValue = this.value;
615
- this.ionFocus.emit();
616
- this.positionElements();
617
- };
618
- this.focused = false;
619
- this.noAnimate = true;
620
- this.color = undefined;
621
- this.animated = false;
622
- this.autocapitalize = 'default';
623
- this.autocomplete = 'off';
624
- this.autocorrect = 'off';
625
- this.cancelButtonIcon = ionicGlobal.config.get('backButtonIcon', index$1.arrowBackSharp);
626
- this.cancelButtonText = 'Cancel';
627
- this.clearIcon = undefined;
628
- this.debounce = undefined;
629
- this.disabled = false;
630
- this.inputmode = undefined;
631
- this.enterkeyhint = undefined;
632
- this.maxlength = undefined;
633
- this.minlength = undefined;
634
- this.name = this.inputId;
635
- this.placeholder = 'Search';
636
- this.searchIcon = undefined;
637
- this.showCancelButton = 'never';
638
- this.showClearButton = 'always';
639
- this.spellcheck = false;
640
- this.type = 'search';
641
- this.value = '';
642
- }
643
- /**
644
- * lang and dir are globally enumerated attributes.
645
- * As a result, creating these as properties
646
- * can have unintended side effects. Instead, we
647
- * listen for attribute changes and inherit them
648
- * to the inner `<input>` element.
649
- */
650
- onLangChanged(newValue) {
651
- this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { lang: newValue });
652
- index.forceUpdate(this);
653
- }
654
- onDirChanged(newValue) {
655
- this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { dir: newValue });
656
- index.forceUpdate(this);
657
- }
658
- debounceChanged() {
659
- const { ionInput, debounce, originalIonInput } = this;
660
- /**
661
- * If debounce is undefined, we have to manually revert the ionInput emitter in case
662
- * debounce used to be set to a number. Otherwise, the event would stay debounced.
663
- */
664
- this.ionInput = debounce === undefined ? originalIonInput !== null && originalIonInput !== void 0 ? originalIonInput : ionInput : helpers.debounceEvent(ionInput, debounce);
665
- }
666
- valueChanged() {
667
- const inputEl = this.nativeInput;
668
- const value = this.getValue();
669
- if (inputEl && inputEl.value !== value) {
670
- inputEl.value = value;
671
- }
672
- }
673
- showCancelButtonChanged() {
674
- requestAnimationFrame(() => {
675
- this.positionElements();
676
- index.forceUpdate(this);
677
- });
678
- }
679
- connectedCallback() {
680
- this.emitStyle();
681
- }
682
- componentWillLoad() {
683
- this.inheritedAttributes = Object.assign({}, helpers.inheritAttributes(this.el, ['lang', 'dir']));
684
- }
685
- componentDidLoad() {
686
- this.originalIonInput = this.ionInput;
687
- this.positionElements();
688
- this.debounceChanged();
689
- setTimeout(() => {
690
- this.noAnimate = false;
691
- }, 300);
692
- }
693
- emitStyle() {
694
- this.ionStyle.emit({
695
- searchbar: true,
696
- });
697
- }
698
- /**
699
- * Sets focus on the native `input` in `ion-searchbar`. Use this method instead of the global
700
- * `input.focus()`.
701
- *
702
- * Developers who wish to focus an input when a page enters
703
- * should call `setFocus()` in the `ionViewDidEnter()` lifecycle method.
704
- *
705
- * Developers who wish to focus an input when an overlay is presented
706
- * should call `setFocus` after `didPresent` has resolved.
707
- *
708
- * See [managing focus](/docs/developing/managing-focus) for more information.
709
- */
710
- async setFocus() {
711
- if (this.nativeInput) {
712
- this.nativeInput.focus();
713
- }
714
- }
715
- /**
716
- * Returns the native `<input>` element used under the hood.
717
- */
718
- async getInputElement() {
719
- /**
720
- * If this gets called in certain early lifecycle hooks (ex: Vue onMounted),
721
- * nativeInput won't be defined yet with the custom elements build, so wait for it to load in.
722
- */
723
- if (!this.nativeInput) {
724
- await new Promise((resolve) => helpers.componentOnReady(this.el, resolve));
725
- }
726
- return Promise.resolve(this.nativeInput);
727
- }
728
- /**
729
- * Emits an `ionChange` event.
730
- *
731
- * This API should be called for user committed changes.
732
- * This API should not be used for external value changes.
733
- */
734
- emitValueChange(event) {
735
- const { value } = this;
736
- // Checks for both null and undefined values
737
- const newValue = value == null ? value : value.toString();
738
- // Emitting a value change should update the internal state for tracking the focused value
739
- this.focusedValue = newValue;
740
- this.ionChange.emit({ value: newValue, event });
741
- }
742
- /**
743
- * Emits an `ionInput` event.
744
- */
745
- emitInputChange(event) {
746
- const { value } = this;
747
- this.ionInput.emit({ value, event });
748
- }
749
- /**
750
- * Positions the input search icon, placeholder, and the cancel button
751
- * based on the input value and if it is focused. (ios only)
752
- */
753
- positionElements() {
754
- const value = this.getValue();
755
- const prevAlignLeft = this.shouldAlignLeft;
756
- const mode = ionicGlobal.getIonMode(this);
757
- const shouldAlignLeft = !this.animated || value.trim() !== '' || !!this.focused;
758
- this.shouldAlignLeft = shouldAlignLeft;
759
- if (mode !== 'ios') {
760
- return;
761
- }
762
- if (prevAlignLeft !== shouldAlignLeft) {
763
- this.positionPlaceholder();
764
- }
765
- if (this.animated) {
766
- this.positionCancelButton();
767
- }
768
- }
769
- /**
770
- * Positions the input placeholder
771
- */
772
- positionPlaceholder() {
773
- const inputEl = this.nativeInput;
774
- if (!inputEl) {
775
- return;
776
- }
777
- const rtl = dir.isRTL(this.el);
778
- const iconEl = (this.el.shadowRoot || this.el).querySelector('.searchbar-search-icon');
779
- if (this.shouldAlignLeft) {
780
- inputEl.removeAttribute('style');
781
- iconEl.removeAttribute('style');
782
- }
783
- else {
784
- // Create a dummy span to get the placeholder width
785
- const doc = document;
786
- const tempSpan = doc.createElement('span');
787
- tempSpan.innerText = this.placeholder || '';
788
- doc.body.appendChild(tempSpan);
789
- // Get the width of the span then remove it
790
- helpers.raf(() => {
791
- const textWidth = tempSpan.offsetWidth;
792
- tempSpan.remove();
793
- // Calculate the input padding
794
- const inputLeft = 'calc(50% - ' + textWidth / 2 + 'px)';
795
- // Calculate the icon margin
796
- /**
797
- * We take the icon width to account
798
- * for any text scales applied to the icon
799
- * such as Dynamic Type on iOS as well as 8px
800
- * of padding.
801
- */
802
- const iconLeft = 'calc(50% - ' + (textWidth / 2 + iconEl.clientWidth + 8) + 'px)';
803
- // Set the input padding start and icon margin start
804
- if (rtl) {
805
- inputEl.style.paddingRight = inputLeft;
806
- iconEl.style.marginRight = iconLeft;
807
- }
808
- else {
809
- inputEl.style.paddingLeft = inputLeft;
810
- iconEl.style.marginLeft = iconLeft;
811
- }
812
- });
813
- }
814
- }
815
- /**
816
- * Show the iOS Cancel button on focus, hide it offscreen otherwise
817
- */
818
- positionCancelButton() {
819
- const rtl = dir.isRTL(this.el);
820
- const cancelButton = (this.el.shadowRoot || this.el).querySelector('.searchbar-cancel-button');
821
- const shouldShowCancel = this.shouldShowCancelButton();
822
- if (cancelButton !== null && shouldShowCancel !== this.isCancelVisible) {
823
- const cancelStyle = cancelButton.style;
824
- this.isCancelVisible = shouldShowCancel;
825
- if (shouldShowCancel) {
826
- if (rtl) {
827
- cancelStyle.marginLeft = '0';
828
- }
829
- else {
830
- cancelStyle.marginRight = '0';
831
- }
832
- }
833
- else {
834
- const offset = cancelButton.offsetWidth;
835
- if (offset > 0) {
836
- if (rtl) {
837
- cancelStyle.marginLeft = -offset + 'px';
838
- }
839
- else {
840
- cancelStyle.marginRight = -offset + 'px';
841
- }
842
- }
843
- }
844
- }
845
- }
846
- getValue() {
847
- return this.value || '';
848
- }
849
- hasValue() {
850
- return this.getValue() !== '';
851
- }
852
- /**
853
- * Determines whether or not the cancel button should be visible onscreen.
854
- * Cancel button should be shown if one of two conditions applies:
855
- * 1. `showCancelButton` is set to `always`.
856
- * 2. `showCancelButton` is set to `focus`, and the searchbar has been focused.
857
- */
858
- shouldShowCancelButton() {
859
- if (this.showCancelButton === 'never' || (this.showCancelButton === 'focus' && !this.focused)) {
860
- return false;
861
- }
862
- return true;
863
- }
864
- /**
865
- * Determines whether or not the clear button should be visible onscreen.
866
- * Clear button should be shown if one of two conditions applies:
867
- * 1. `showClearButton` is set to `always`.
868
- * 2. `showClearButton` is set to `focus`, and the searchbar has been focused.
869
- */
870
- shouldShowClearButton() {
871
- if (this.showClearButton === 'never' || (this.showClearButton === 'focus' && !this.focused)) {
872
- return false;
873
- }
874
- return true;
875
- }
876
- render() {
877
- const { cancelButtonText, autocapitalize } = this;
878
- const animated = this.animated && ionicGlobal.config.getBoolean('animated', true);
879
- const mode = ionicGlobal.getIonMode(this);
880
- const clearIcon = this.clearIcon || (mode === 'ios' ? index$1.closeCircle : index$1.closeSharp);
881
- const searchIcon = this.searchIcon || (mode === 'ios' ? index$1.searchOutline : index$1.searchSharp);
882
- const shouldShowCancelButton = this.shouldShowCancelButton();
883
- const cancelButton = this.showCancelButton !== 'never' && (index.h("button", { key: '9c7b4d2e86d9bcd12e57c9a96723d3da598a3773', "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, index.h("div", { key: '1c25268a776134cccd29eb752898cb8ac0eed30f', "aria-hidden": "true" }, mode === 'md' ? (index.h("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
884
- return (index.h(index.Host, { key: 'feef9fc7e405656e134a76dc037aaaa1a4ce36b4', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: theme.createColorClasses(this.color, {
885
- [mode]: true,
886
- 'searchbar-animated': animated,
887
- 'searchbar-disabled': this.disabled,
888
- 'searchbar-no-animate': animated && this.noAnimate,
889
- 'searchbar-has-value': this.hasValue(),
890
- 'searchbar-left-aligned': this.shouldAlignLeft,
891
- 'searchbar-has-focus': this.focused,
892
- 'searchbar-should-show-clear': this.shouldShowClearButton(),
893
- 'searchbar-should-show-cancel': this.shouldShowCancelButton(),
894
- }) }, index.h("div", { key: '92e3925dc0de468e5665705902153837105dfa57', class: "searchbar-input-container" }, index.h("input", Object.assign({ key: 'fb74faf81b347a62338ccdac981525df1c52b322', "aria-label": "search text", disabled: this.disabled, ref: (el) => (this.nativeInput = el), class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, name: this.name, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoCapitalize: autocapitalize === 'default' ? undefined : autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }, this.inheritedAttributes)), mode === 'md' && cancelButton, index.h("ion-icon", { key: 'd58c3636dac1d2e4135989f4c07dc95c51492e60', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), index.h("button", { key: '1cece7c63ca5ca4b8799e15ee6d2bac100ef0d5e', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
895
- /**
896
- * This prevents mobile browsers from
897
- * blurring the input when the clear
898
- * button is activated.
899
- */
900
- ev.preventDefault();
901
- }, onClick: () => this.onClearInput(true) }, index.h("ion-icon", { key: 'fe3c2b9cac29002f69e95a89b554c7504e2df050', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
902
- }
903
- get el() { return index.getElement(this); }
904
- static get watchers() { return {
905
- "lang": ["onLangChanged"],
906
- "dir": ["onDirChanged"],
907
- "debounce": ["debounceChanged"],
908
- "value": ["valueChanged"],
909
- "showCancelButton": ["showCancelButtonChanged"]
910
- }; }
911
- };
912
- let searchbarIds = 0;
913
- Searchbar.style = {
914
- ios: IonSearchbarIosStyle0,
915
- md: IonSearchbarMdStyle0
916
- };
917
-
918
- const skeletonTextCss = ":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";
919
- const IonSkeletonTextStyle0 = skeletonTextCss;
920
-
921
- const SkeletonText = class {
922
- constructor(hostRef) {
923
- index.registerInstance(this, hostRef);
924
- this.ionStyle = index.createEvent(this, "ionStyle", 7);
925
- this.animated = false;
926
- }
927
- componentWillLoad() {
928
- this.emitStyle();
929
- }
930
- emitStyle() {
931
- // The emitted property is used by item in order
932
- // to add the item-skeleton-text class which applies
933
- // overflow: hidden to its label
934
- const style = {
935
- 'skeleton-text': true,
936
- };
937
- this.ionStyle.emit(style);
938
- }
939
- render() {
940
- const animated = this.animated && ionicGlobal.config.getBoolean('animated', true);
941
- const inMedia = theme.hostContext('ion-avatar', this.el) || theme.hostContext('ion-thumbnail', this.el);
942
- const mode = ionicGlobal.getIonMode(this);
943
- return (index.h(index.Host, { key: '4dab0fd2de666de12ad8f6dc6ed1e1de0be67ddd', class: {
944
- [mode]: true,
945
- 'skeleton-text-animated': animated,
946
- 'in-media': inMedia,
947
- } }, index.h("span", { key: 'f8f908ec24d65e63b14d9a54640a5f18f0fa8fa5' }, "\u00A0")));
948
- }
949
- get el() { return index.getElement(this); }
950
- };
951
- SkeletonText.style = IonSkeletonTextStyle0;
952
-
953
- /*!
954
- * (C) Ionic http://ionicframework.com - MIT License
955
- */
956
- /**
957
- * Calculate the CSS top and bottom position of the toast, to be used
958
- * as starting points for the animation keyframes.
959
- *
960
- * The default animations for both MD and iOS
961
- * use translateY, which calculates from the
962
- * top edge of the screen. This behavior impacts
963
- * how we compute the offset when a toast has
964
- * position='bottom' since we need to calculate from
965
- * the bottom edge of the screen instead.
966
- *
967
- * @param position The value of the toast's position prop.
968
- * @param positionAnchor The element the toast should be anchored to,
969
- * if applicable.
970
- * @param mode The toast component's mode (md, ios, etc).
971
- * @param toast A reference to the toast element itself.
972
- */
973
- function getAnimationPosition(position, positionAnchor, mode, toast) {
974
- /**
975
- * Start with a predefined offset from the edge the toast will be
976
- * positioned relative to, whether on the screen or anchor element.
977
- */
978
- let offset;
979
- if (mode === 'md') {
980
- offset = position === 'top' ? 8 : -8;
981
- }
982
- else {
983
- offset = position === 'top' ? 10 : -10;
984
- }
985
- /**
986
- * If positionAnchor is defined, add in the distance from the target
987
- * screen edge to the target anchor edge. For position="top", the
988
- * bottom anchor edge is targeted. For position="bottom", the top
989
- * anchor edge is targeted.
990
- */
991
- if (positionAnchor && index$2.win) {
992
- warnIfAnchorIsHidden(positionAnchor, toast);
993
- const box = positionAnchor.getBoundingClientRect();
994
- if (position === 'top') {
995
- offset += box.bottom;
996
- }
997
- else if (position === 'bottom') {
998
- /**
999
- * Just box.top is the distance from the top edge of the screen
1000
- * to the top edge of the anchor. We want to calculate from the
1001
- * bottom edge of the screen instead.
1002
- */
1003
- offset -= index$2.win.innerHeight - box.top;
1004
- }
1005
- /**
1006
- * We don't include safe area here because that should already be
1007
- * accounted for when checking the position of the anchor.
1008
- */
1009
- return {
1010
- top: `${offset}px`,
1011
- bottom: `${offset}px`,
1012
- };
1013
- }
1014
- else {
1015
- return {
1016
- top: `calc(${offset}px + var(--ion-safe-area-top, 0px))`,
1017
- bottom: `calc(${offset}px - var(--ion-safe-area-bottom, 0px))`,
1018
- };
1019
- }
1020
- }
1021
- /**
1022
- * If the anchor element is hidden, getBoundingClientRect()
1023
- * will return all 0s for it, which can cause unexpected
1024
- * results in the position calculation when animating.
1025
- */
1026
- function warnIfAnchorIsHidden(positionAnchor, toast) {
1027
- if (positionAnchor.offsetParent === null) {
1028
- index$3.printIonWarning('The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.', toast);
1029
- }
1030
- }
1031
- /**
1032
- * Returns the top offset required to place
1033
- * the toast in the middle of the screen.
1034
- * Only needed when position="toast".
1035
- * @param toastHeight - The height of the ion-toast element
1036
- * @param wrapperHeight - The height of the .toast-wrapper element
1037
- * inside the toast's shadow root.
1038
- */
1039
- const getOffsetForMiddlePosition = (toastHeight, wrapperHeight) => {
1040
- return Math.floor(toastHeight / 2 - wrapperHeight / 2);
1041
- };
1042
-
1043
- /*!
1044
- * (C) Ionic http://ionicframework.com - MIT License
1045
- */
1046
- /**
1047
- * iOS Toast Enter Animation
1048
- */
1049
- const iosEnterAnimation = (baseEl, opts) => {
1050
- const baseAnimation = animation.createAnimation();
1051
- const wrapperAnimation = animation.createAnimation();
1052
- const { position, top, bottom } = opts;
1053
- const root = helpers.getElementRoot(baseEl);
1054
- const wrapperEl = root.querySelector('.toast-wrapper');
1055
- wrapperAnimation.addElement(wrapperEl);
1056
- switch (position) {
1057
- case 'top':
1058
- wrapperAnimation.fromTo('transform', 'translateY(-100%)', `translateY(${top})`);
1059
- break;
1060
- case 'middle':
1061
- const topPosition = getOffsetForMiddlePosition(baseEl.clientHeight, wrapperEl.clientHeight);
1062
- wrapperEl.style.top = `${topPosition}px`;
1063
- wrapperAnimation.fromTo('opacity', 0.01, 1);
1064
- break;
1065
- default:
1066
- wrapperAnimation.fromTo('transform', 'translateY(100%)', `translateY(${bottom})`);
1067
- break;
1068
- }
1069
- return baseAnimation.easing('cubic-bezier(.155,1.105,.295,1.12)').duration(400).addAnimation(wrapperAnimation);
1070
- };
1071
-
1072
- /*!
1073
- * (C) Ionic http://ionicframework.com - MIT License
1074
- */
1075
- /**
1076
- * iOS Toast Leave Animation
1077
- */
1078
- const iosLeaveAnimation = (baseEl, opts) => {
1079
- const baseAnimation = animation.createAnimation();
1080
- const wrapperAnimation = animation.createAnimation();
1081
- const { position, top, bottom } = opts;
1082
- const root = helpers.getElementRoot(baseEl);
1083
- const wrapperEl = root.querySelector('.toast-wrapper');
1084
- wrapperAnimation.addElement(wrapperEl);
1085
- switch (position) {
1086
- case 'top':
1087
- wrapperAnimation.fromTo('transform', `translateY(${top})`, 'translateY(-100%)');
1088
- break;
1089
- case 'middle':
1090
- wrapperAnimation.fromTo('opacity', 0.99, 0);
1091
- break;
1092
- default:
1093
- wrapperAnimation.fromTo('transform', `translateY(${bottom})`, 'translateY(100%)');
1094
- break;
1095
- }
1096
- return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(300).addAnimation(wrapperAnimation);
1097
- };
1098
-
1099
- /*!
1100
- * (C) Ionic http://ionicframework.com - MIT License
1101
- */
1102
- /**
1103
- * MD Toast Enter Animation
1104
- */
1105
- const mdEnterAnimation = (baseEl, opts) => {
1106
- const baseAnimation = animation.createAnimation();
1107
- const wrapperAnimation = animation.createAnimation();
1108
- const { position, top, bottom } = opts;
1109
- const root = helpers.getElementRoot(baseEl);
1110
- const wrapperEl = root.querySelector('.toast-wrapper');
1111
- wrapperAnimation.addElement(wrapperEl);
1112
- switch (position) {
1113
- case 'top':
1114
- wrapperEl.style.setProperty('transform', `translateY(${top})`);
1115
- wrapperAnimation.fromTo('opacity', 0.01, 1);
1116
- break;
1117
- case 'middle':
1118
- const topPosition = getOffsetForMiddlePosition(baseEl.clientHeight, wrapperEl.clientHeight);
1119
- wrapperEl.style.top = `${topPosition}px`;
1120
- wrapperAnimation.fromTo('opacity', 0.01, 1);
1121
- break;
1122
- default:
1123
- wrapperEl.style.setProperty('transform', `translateY(${bottom})`);
1124
- wrapperAnimation.fromTo('opacity', 0.01, 1);
1125
- break;
1126
- }
1127
- return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(400).addAnimation(wrapperAnimation);
1128
- };
1129
-
1130
- /*!
1131
- * (C) Ionic http://ionicframework.com - MIT License
1132
- */
1133
- /**
1134
- * md Toast Leave Animation
1135
- */
1136
- const mdLeaveAnimation = (baseEl) => {
1137
- const baseAnimation = animation.createAnimation();
1138
- const wrapperAnimation = animation.createAnimation();
1139
- const root = helpers.getElementRoot(baseEl);
1140
- const wrapperEl = root.querySelector('.toast-wrapper');
1141
- wrapperAnimation.addElement(wrapperEl).fromTo('opacity', 0.99, 0);
1142
- return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(300).addAnimation(wrapperAnimation);
1143
- };
1144
-
1145
- /*!
1146
- * (C) Ionic http://ionicframework.com - MIT License
1147
- */
1148
- /**
1149
- * Create a gesture that allows the Toast
1150
- * to be swiped to dismiss.
1151
- * @param el - The Toast element
1152
- * @param toastPosition - The last computed position of the Toast. This is computed in the "present" method.
1153
- * @param onDismiss - A callback to fire when the Toast was swiped to dismiss.
1154
- */
1155
- const createSwipeToDismissGesture = (el, toastPosition, onDismiss) => {
1156
- /**
1157
- * Users should swipe on the visible toast wrapper
1158
- * rather than on ion-toast which covers the entire screen.
1159
- * When testing the class instance the inner wrapper will not
1160
- * be defined. As a result, we use a placeholder element in those environments.
1161
- */
1162
- const wrapperEl = helpers.getElementRoot(el).querySelector('.toast-wrapper');
1163
- const hostElHeight = el.clientHeight;
1164
- const wrapperElBox = wrapperEl.getBoundingClientRect();
1165
- /**
1166
- * The maximum amount that
1167
- * the toast can be swiped. This should
1168
- * account for the wrapper element's height
1169
- * too so the toast can be swiped offscreen
1170
- * completely.
1171
- */
1172
- let MAX_SWIPE_DISTANCE = 0;
1173
- /**
1174
- * The step value at which a toast
1175
- * is eligible for dismissing via gesture.
1176
- */
1177
- const DISMISS_THRESHOLD = 0.5;
1178
- /**
1179
- * The middle position Toast starts 50% of the way
1180
- * through the animation, so we need to use this
1181
- * as the starting point for our step values.
1182
- */
1183
- const STEP_OFFSET = el.position === 'middle' ? 0.5 : 0;
1184
- /**
1185
- * When the Toast is at the top users will be
1186
- * swiping up. As a result, the delta values will be
1187
- * negative numbers which will result in negative steps
1188
- * and thresholds. As a result, we need to make those numbers
1189
- * positive.
1190
- */
1191
- const INVERSION_FACTOR = el.position === 'top' ? -1 : 1;
1192
- /**
1193
- * The top offset that places the
1194
- * toast in the middle of the screen.
1195
- * Only needed when position="middle".
1196
- */
1197
- const topPosition = getOffsetForMiddlePosition(hostElHeight, wrapperElBox.height);
1198
- const SWIPE_UP_DOWN_KEYFRAMES = [
1199
- { offset: 0, transform: `translateY(-${topPosition + wrapperElBox.height}px)` },
1200
- { offset: 0.5, transform: `translateY(0px)` },
1201
- { offset: 1, transform: `translateY(${topPosition + wrapperElBox.height}px)` },
1202
- ];
1203
- const swipeAnimation = animation.createAnimation('toast-swipe-to-dismiss-animation')
1204
- .addElement(wrapperEl)
1205
- /**
1206
- * The specific value here does not actually
1207
- * matter. We just need this to be a positive
1208
- * value so the animation does not jump
1209
- * to the end when the user beings to drag.
1210
- */
1211
- .duration(100);
1212
- switch (el.position) {
1213
- case 'middle':
1214
- MAX_SWIPE_DISTANCE = hostElHeight + wrapperElBox.height;
1215
- swipeAnimation.keyframes(SWIPE_UP_DOWN_KEYFRAMES);
1216
- /**
1217
- * Toast can be swiped up or down but
1218
- * should start in the middle of the screen.
1219
- */
1220
- swipeAnimation.progressStart(true, 0.5);
1221
- break;
1222
- case 'top':
1223
- /**
1224
- * The bottom edge of the wrapper
1225
- * includes the distance between the top
1226
- * of the screen and the top of the wrapper
1227
- * as well as the wrapper height so the wrapper
1228
- * can be dragged fully offscreen.
1229
- */
1230
- MAX_SWIPE_DISTANCE = wrapperElBox.bottom;
1231
- swipeAnimation.keyframes([
1232
- { offset: 0, transform: `translateY(${toastPosition.top})` },
1233
- { offset: 1, transform: 'translateY(-100%)' },
1234
- ]);
1235
- swipeAnimation.progressStart(true, 0);
1236
- break;
1237
- case 'bottom':
1238
- default:
1239
- /**
1240
- * This computes the distance between the
1241
- * top of the wrapper and the bottom of the
1242
- * screen including the height of the wrapper
1243
- * element so it can be dragged fully offscreen.
1244
- */
1245
- MAX_SWIPE_DISTANCE = hostElHeight - wrapperElBox.top;
1246
- swipeAnimation.keyframes([
1247
- { offset: 0, transform: `translateY(${toastPosition.bottom})` },
1248
- { offset: 1, transform: 'translateY(100%)' },
1249
- ]);
1250
- swipeAnimation.progressStart(true, 0);
1251
- break;
1252
- }
1253
- const computeStep = (delta) => {
1254
- return (delta * INVERSION_FACTOR) / MAX_SWIPE_DISTANCE;
1255
- };
1256
- const onMove = (detail) => {
1257
- const step = STEP_OFFSET + computeStep(detail.deltaY);
1258
- swipeAnimation.progressStep(step);
1259
- };
1260
- const onEnd = (detail) => {
1261
- const velocity = detail.velocityY;
1262
- const threshold = ((detail.deltaY + velocity * 1000) / MAX_SWIPE_DISTANCE) * INVERSION_FACTOR;
1263
- /**
1264
- * Disable the gesture for the remainder of the animation.
1265
- * It will be re-enabled if the toast animates back to
1266
- * its initial presented position.
1267
- */
1268
- gesture.enable(false);
1269
- let shouldDismiss = true;
1270
- let playTo = 1;
1271
- let step = 0;
1272
- let remainingDistance = 0;
1273
- if (el.position === 'middle') {
1274
- /**
1275
- * A middle positioned Toast appears
1276
- * in the middle of the screen (at animation offset 0.5).
1277
- * As a result, the threshold will be calculated relative
1278
- * to this starting position. In other words at animation offset 0.5
1279
- * the threshold will be 0. We want the middle Toast to be eligible
1280
- * for dismiss when the user has swiped either half way up or down the
1281
- * screen. As a result, we divide DISMISS_THRESHOLD in half. We also
1282
- * consider when the threshold is a negative in the event the
1283
- * user drags up (since the deltaY will also be negative).
1284
- */
1285
- shouldDismiss = threshold >= DISMISS_THRESHOLD / 2 || threshold <= -DISMISS_THRESHOLD / 2;
1286
- /**
1287
- * Since we are replacing the keyframes
1288
- * below the animation always starts from
1289
- * the beginning of the new keyframes.
1290
- * Similarly, we are always playing to
1291
- * the end of the new keyframes.
1292
- */
1293
- playTo = 1;
1294
- step = 0;
1295
- /**
1296
- * The Toast should animate from wherever its
1297
- * current position is to the desired end state.
1298
- *
1299
- * To begin, we get the current position of the
1300
- * Toast for its starting state.
1301
- */
1302
- const wrapperElBox = wrapperEl.getBoundingClientRect();
1303
- const startOffset = wrapperElBox.top - topPosition;
1304
- const startPosition = `${startOffset}px`;
1305
- /**
1306
- * If the deltaY is negative then the user is swiping
1307
- * up, so the Toast should animate to the top of the screen.
1308
- * If the deltaY is positive then the user is swiping
1309
- * down, so the Toast should animate to the bottom of the screen.
1310
- * We also account for when the deltaY is 0, but realistically
1311
- * that should never happen because it means the user did not drag
1312
- * the toast.
1313
- */
1314
- const offsetFactor = detail.deltaY <= 0 ? -1 : 1;
1315
- const endOffset = (topPosition + wrapperElBox.height) * offsetFactor;
1316
- /**
1317
- * If the Toast should dismiss
1318
- * then we need to figure out which edge of
1319
- * the screen it should animate towards.
1320
- * By default, the Toast will come
1321
- * back to its default state in the
1322
- * middle of the screen.
1323
- */
1324
- const endPosition = shouldDismiss ? `${endOffset}px` : '0px';
1325
- const KEYFRAMES = [
1326
- { offset: 0, transform: `translateY(${startPosition})` },
1327
- { offset: 1, transform: `translateY(${endPosition})` },
1328
- ];
1329
- swipeAnimation.keyframes(KEYFRAMES);
1330
- /**
1331
- * Compute the remaining amount of pixels the
1332
- * toast needs to move to be fully dismissed.
1333
- */
1334
- remainingDistance = endOffset - startOffset;
1335
- }
1336
- else {
1337
- shouldDismiss = threshold >= DISMISS_THRESHOLD;
1338
- playTo = shouldDismiss ? 1 : 0;
1339
- step = computeStep(detail.deltaY);
1340
- /**
1341
- * Compute the remaining amount of pixels the
1342
- * toast needs to move to be fully dismissed.
1343
- */
1344
- const remainingStepAmount = shouldDismiss ? 1 - step : step;
1345
- remainingDistance = remainingStepAmount * MAX_SWIPE_DISTANCE;
1346
- }
1347
- /**
1348
- * The animation speed should depend on how quickly
1349
- * the user flicks the toast across the screen. However,
1350
- * it should be no slower than 200ms.
1351
- * We use Math.abs on the remainingDistance because that value
1352
- * can be negative when swiping up on a middle position toast.
1353
- */
1354
- const duration = Math.min(Math.abs(remainingDistance) / Math.abs(velocity), 200);
1355
- swipeAnimation
1356
- .onFinish(() => {
1357
- if (shouldDismiss) {
1358
- onDismiss();
1359
- swipeAnimation.destroy();
1360
- }
1361
- else {
1362
- if (el.position === 'middle') {
1363
- /**
1364
- * If the toast snapped back to
1365
- * the middle of the screen we need
1366
- * to reset the keyframes
1367
- * so the toast can be swiped
1368
- * up or down again.
1369
- */
1370
- swipeAnimation.keyframes(SWIPE_UP_DOWN_KEYFRAMES).progressStart(true, 0.5);
1371
- }
1372
- else {
1373
- swipeAnimation.progressStart(true, 0);
1374
- }
1375
- /**
1376
- * If the toast did not dismiss then
1377
- * the user should be able to swipe again.
1378
- */
1379
- gesture.enable(true);
1380
- }
1381
- /**
1382
- * This must be a one time callback
1383
- * otherwise a new callback will
1384
- * be added every time onEnd runs.
1385
- */
1386
- }, { oneTimeCallback: true })
1387
- .progressEnd(playTo, step, duration);
1388
- };
1389
- const gesture = index$4.createGesture({
1390
- el: wrapperEl,
1391
- gestureName: 'toast-swipe-to-dismiss',
1392
- gesturePriority: overlays.OVERLAY_GESTURE_PRIORITY,
1393
- /**
1394
- * Toast only supports vertical swipes.
1395
- * This needs to be updated if we later
1396
- * support horizontal swipes.
1397
- */
1398
- direction: 'y',
1399
- onMove,
1400
- onEnd,
1401
- });
1402
- return gesture;
1403
- };
1404
-
1405
- const toastIosCss = ":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)){left:unset;right:unset;right:0}}}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){.toast-wrapper{left:var(--start);right:var(--end)}:host-context([dir=rtl]) .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}[dir=rtl] .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}@supports selector(:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}.toast-wrapper.toast-top{transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:flex;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{flex-wrap:wrap}.toast-layout-baseline .toast-content{display:flex;flex:1;flex-direction:column;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{flex:1;white-space:var(--white-space)}.toast-button-group{display:flex}.toast-layout-stacked .toast-button-group{justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:flex;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-50, #f2f2f2);--border-radius:14px;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-850, #262626);--max-width:700px;--max-height:478px;--start:10px;--end:10px;font-size:clamp(14px, 0.875rem, 43.4px)}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports (backdrop-filter: blur(0)){:host(.toast-translucent) .toast-wrapper{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);backdrop-filter:saturate(180%) blur(20px)}:host(.ion-color.toast-translucent) .toast-wrapper{background:rgba(var(--ion-color-base-rgb), 0.8)}}.toast-wrapper.toast-middle{opacity:0.01}.toast-content{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}.toast-header{margin-bottom:2px;font-weight:500}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;min-height:44px;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:clamp(17px, 1.0625rem, 21.998px);font-weight:500;overflow:hidden}.toast-button.ion-activated{opacity:0.4}@media (any-hover: hover){.toast-button:hover{opacity:0.6}}";
1406
- const IonToastIosStyle0 = toastIosCss;
1407
-
1408
- const toastMdCss = ":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)){left:unset;right:unset;right:0}}}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){.toast-wrapper{left:var(--start);right:var(--end)}:host-context([dir=rtl]) .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}[dir=rtl] .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}@supports selector(:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}.toast-wrapper.toast-top{transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:flex;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{flex-wrap:wrap}.toast-layout-baseline .toast-content{display:flex;flex:1;flex-direction:column;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{flex:1;white-space:var(--white-space)}.toast-button-group{display:flex}.toast-layout-stacked .toast-button-group{justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:flex;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-800, #333333);--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-50, #f2f2f2);--max-width:700px;--start:8px;--end:8px;font-size:0.875rem}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}.toast-content{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}.toast-header{margin-bottom:2px;font-weight:500;line-height:1.25rem}.toast-message{line-height:1.25rem}.toast-layout-baseline .toast-button-group-start{-webkit-margin-start:8px;margin-inline-start:8px}.toast-layout-stacked .toast-button-group-start{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}.toast-layout-baseline .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px}.toast-layout-stacked .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:0.875rem;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}.toast-button-cancel{color:var(--ion-color-step-100, #e6e6e6)}.toast-button-icon-only{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){.toast-button:hover{background-color:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08)}.toast-button-cancel:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}";
1409
- const IonToastMdStyle0 = toastMdCss;
1410
-
1411
- const Toast = class {
1412
- constructor(hostRef) {
1413
- index.registerInstance(this, hostRef);
1414
- this.didPresent = index.createEvent(this, "ionToastDidPresent", 7);
1415
- this.willPresent = index.createEvent(this, "ionToastWillPresent", 7);
1416
- this.willDismiss = index.createEvent(this, "ionToastWillDismiss", 7);
1417
- this.didDismiss = index.createEvent(this, "ionToastDidDismiss", 7);
1418
- this.didPresentShorthand = index.createEvent(this, "didPresent", 7);
1419
- this.willPresentShorthand = index.createEvent(this, "willPresent", 7);
1420
- this.willDismissShorthand = index.createEvent(this, "willDismiss", 7);
1421
- this.didDismissShorthand = index.createEvent(this, "didDismiss", 7);
1422
- this.delegateController = overlays.createDelegateController(this);
1423
- this.lockController = lockController.createLockController();
1424
- this.triggerController = overlays.createTriggerController();
1425
- this.customHTMLEnabled = ionicGlobal.config.get('innerHTMLTemplatesEnabled', index$5.ENABLE_HTML_CONTENT_DEFAULT);
1426
- this.presented = false;
1427
- this.dispatchCancelHandler = (ev) => {
1428
- const role = ev.detail.role;
1429
- if (overlays.isCancel(role)) {
1430
- const cancelButton = this.getButtons().find((b) => b.role === 'cancel');
1431
- this.callButtonHandler(cancelButton);
1432
- }
1433
- };
1434
- /**
1435
- * Create a new swipe gesture so Toast
1436
- * can be swiped to dismiss.
1437
- */
1438
- this.createSwipeGesture = (toastPosition) => {
1439
- const gesture = (this.gesture = createSwipeToDismissGesture(this.el, toastPosition, () => {
1440
- /**
1441
- * If the gesture completed then
1442
- * we should dismiss the toast.
1443
- */
1444
- this.dismiss(undefined, overlays.GESTURE);
1445
- }));
1446
- gesture.enable(true);
1447
- };
1448
- /**
1449
- * Destroy an existing swipe gesture
1450
- * so Toast can no longer be swiped to dismiss.
1451
- */
1452
- this.destroySwipeGesture = () => {
1453
- const { gesture } = this;
1454
- if (gesture === undefined) {
1455
- return;
1456
- }
1457
- gesture.destroy();
1458
- this.gesture = undefined;
1459
- };
1460
- /**
1461
- * Returns `true` if swipeGesture
1462
- * is configured to a value that enables the swipe behavior.
1463
- * Returns `false` otherwise.
1464
- */
1465
- this.prefersSwipeGesture = () => {
1466
- const { swipeGesture } = this;
1467
- return swipeGesture === 'vertical';
1468
- };
1469
- this.revealContentToScreenReader = false;
1470
- this.overlayIndex = undefined;
1471
- this.delegate = undefined;
1472
- this.hasController = false;
1473
- this.color = undefined;
1474
- this.enterAnimation = undefined;
1475
- this.leaveAnimation = undefined;
1476
- this.cssClass = undefined;
1477
- this.duration = ionicGlobal.config.getNumber('toastDuration', 0);
1478
- this.header = undefined;
1479
- this.layout = 'baseline';
1480
- this.message = undefined;
1481
- this.keyboardClose = false;
1482
- this.position = 'bottom';
1483
- this.positionAnchor = undefined;
1484
- this.buttons = undefined;
1485
- this.translucent = false;
1486
- this.animated = true;
1487
- this.icon = undefined;
1488
- this.htmlAttributes = undefined;
1489
- this.swipeGesture = undefined;
1490
- this.isOpen = false;
1491
- this.trigger = undefined;
1492
- }
1493
- swipeGestureChanged() {
1494
- /**
1495
- * If the Toast is presented, then we need to destroy
1496
- * any actives gestures before a new gesture is potentially
1497
- * created below.
1498
- *
1499
- * If the Toast is dismissed, then no gesture should be available
1500
- * since the Toast is not visible. This case should never
1501
- * happen since the "dismiss" method handles destroying
1502
- * any active swipe gestures, but we keep this code
1503
- * around to handle the first case.
1504
- */
1505
- this.destroySwipeGesture();
1506
- /**
1507
- * A new swipe gesture should only be created
1508
- * if the Toast is presented. If the Toast is not
1509
- * yet presented then the "present" method will
1510
- * handle calling the swipe gesture setup function.
1511
- */
1512
- if (this.presented && this.prefersSwipeGesture()) {
1513
- /**
1514
- * If the Toast is presented then
1515
- * lastPresentedPosition is defined.
1516
- */
1517
- this.createSwipeGesture(this.lastPresentedPosition);
1518
- }
1519
- }
1520
- onIsOpenChange(newValue, oldValue) {
1521
- if (newValue === true && oldValue === false) {
1522
- this.present();
1523
- }
1524
- else if (newValue === false && oldValue === true) {
1525
- this.dismiss();
1526
- }
1527
- }
1528
- triggerChanged() {
1529
- const { trigger, el, triggerController } = this;
1530
- if (trigger) {
1531
- triggerController.addClickListener(el, trigger);
1532
- }
1533
- }
1534
- connectedCallback() {
1535
- overlays.prepareOverlay(this.el);
1536
- this.triggerChanged();
1537
- }
1538
- disconnectedCallback() {
1539
- this.triggerController.removeClickListener();
1540
- }
1541
- componentWillLoad() {
1542
- overlays.setOverlayId(this.el);
1543
- }
1544
- componentDidLoad() {
1545
- /**
1546
- * If toast was rendered with isOpen="true"
1547
- * then we should open toast immediately.
1548
- */
1549
- if (this.isOpen === true) {
1550
- helpers.raf(() => this.present());
1551
- }
1552
- /**
1553
- * When binding values in frameworks such as Angular
1554
- * it is possible for the value to be set after the Web Component
1555
- * initializes but before the value watcher is set up in Stencil.
1556
- * As a result, the watcher callback may not be fired.
1557
- * We work around this by manually calling the watcher
1558
- * callback when the component has loaded and the watcher
1559
- * is configured.
1560
- */
1561
- this.triggerChanged();
1562
- }
1563
- /**
1564
- * Present the toast overlay after it has been created.
1565
- */
1566
- async present() {
1567
- const unlock = await this.lockController.lock();
1568
- await this.delegateController.attachViewToDom();
1569
- const { el, position } = this;
1570
- const anchor = this.getAnchorElement();
1571
- const animationPosition = getAnimationPosition(position, anchor, ionicGlobal.getIonMode(this), el);
1572
- /**
1573
- * Cache the calculated position of the toast, so we can re-use it
1574
- * in the dismiss animation.
1575
- */
1576
- this.lastPresentedPosition = animationPosition;
1577
- await overlays.present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, {
1578
- position,
1579
- top: animationPosition.top,
1580
- bottom: animationPosition.bottom,
1581
- });
1582
- /**
1583
- * Content is revealed to screen readers after
1584
- * the transition to avoid jank since this
1585
- * state updates will cause a re-render.
1586
- */
1587
- this.revealContentToScreenReader = true;
1588
- if (this.duration > 0) {
1589
- this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
1590
- }
1591
- /**
1592
- * If the Toast has a swipe gesture then we can
1593
- * create the gesture so users can swipe the
1594
- * presented Toast.
1595
- */
1596
- if (this.prefersSwipeGesture()) {
1597
- this.createSwipeGesture(animationPosition);
1598
- }
1599
- unlock();
1600
- }
1601
- /**
1602
- * Dismiss the toast overlay after it has been presented.
1603
- *
1604
- * @param data Any data to emit in the dismiss events.
1605
- * @param role The role of the element that is dismissing the toast.
1606
- * This can be useful in a button handler for determining which button was
1607
- * clicked to dismiss the toast.
1608
- * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
1609
- *
1610
- * This is a no-op if the overlay has not been presented yet. If you want
1611
- * to remove an overlay from the DOM that was never presented, use the
1612
- * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
1613
- */
1614
- async dismiss(data, role) {
1615
- var _a, _b;
1616
- const unlock = await this.lockController.lock();
1617
- const { durationTimeout, position, lastPresentedPosition } = this;
1618
- if (durationTimeout) {
1619
- clearTimeout(durationTimeout);
1620
- }
1621
- const dismissed = await overlays.dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation,
1622
- /**
1623
- * Fetch the cached position that was calculated back in the present
1624
- * animation. We always want to animate the dismiss from the same
1625
- * position the present stopped at, so the animation looks continuous.
1626
- */
1627
- {
1628
- position,
1629
- top: (_a = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.top) !== null && _a !== void 0 ? _a : '',
1630
- bottom: (_b = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.bottom) !== null && _b !== void 0 ? _b : '',
1631
- });
1632
- if (dismissed) {
1633
- this.delegateController.removeViewFromDom();
1634
- this.revealContentToScreenReader = false;
1635
- }
1636
- this.lastPresentedPosition = undefined;
1637
- /**
1638
- * If the Toast has a swipe gesture then we can
1639
- * safely destroy it now that it is dismissed.
1640
- */
1641
- this.destroySwipeGesture();
1642
- unlock();
1643
- return dismissed;
1644
- }
1645
- /**
1646
- * Returns a promise that resolves when the toast did dismiss.
1647
- */
1648
- onDidDismiss() {
1649
- return overlays.eventMethod(this.el, 'ionToastDidDismiss');
1650
- }
1651
- /**
1652
- * Returns a promise that resolves when the toast will dismiss.
1653
- */
1654
- onWillDismiss() {
1655
- return overlays.eventMethod(this.el, 'ionToastWillDismiss');
1656
- }
1657
- getButtons() {
1658
- const buttons = this.buttons
1659
- ? this.buttons.map((b) => {
1660
- return typeof b === 'string' ? { text: b } : b;
1661
- })
1662
- : [];
1663
- return buttons;
1664
- }
1665
- /**
1666
- * Returns the element specified by the positionAnchor prop,
1667
- * or undefined if prop's value is an ID string and the element
1668
- * is not found in the DOM.
1669
- */
1670
- getAnchorElement() {
1671
- const { position, positionAnchor, el } = this;
1672
- /**
1673
- * If positionAnchor is undefined then
1674
- * no anchor should be used when presenting the toast.
1675
- */
1676
- if (positionAnchor === undefined) {
1677
- return;
1678
- }
1679
- if (position === 'middle' && positionAnchor !== undefined) {
1680
- index$3.printIonWarning('The positionAnchor property is ignored when using position="middle".', this.el);
1681
- return undefined;
1682
- }
1683
- if (typeof positionAnchor === 'string') {
1684
- /**
1685
- * If the anchor is defined as an ID, find the element.
1686
- * We do this on every present so the toast doesn't need
1687
- * to account for the surrounding DOM changing since the
1688
- * last time it was presented.
1689
- */
1690
- const foundEl = document.getElementById(positionAnchor);
1691
- if (foundEl === null) {
1692
- index$3.printIonWarning(`An anchor element with an ID of "${positionAnchor}" was not found in the DOM.`, el);
1693
- return undefined;
1694
- }
1695
- return foundEl;
1696
- }
1697
- if (positionAnchor instanceof HTMLElement) {
1698
- return positionAnchor;
1699
- }
1700
- index$3.printIonWarning('Invalid positionAnchor value:', positionAnchor, el);
1701
- return undefined;
1702
- }
1703
- async buttonClick(button) {
1704
- const role = button.role;
1705
- if (overlays.isCancel(role)) {
1706
- return this.dismiss(undefined, role);
1707
- }
1708
- const shouldDismiss = await this.callButtonHandler(button);
1709
- if (shouldDismiss) {
1710
- return this.dismiss(undefined, role);
1711
- }
1712
- return Promise.resolve();
1713
- }
1714
- async callButtonHandler(button) {
1715
- if (button === null || button === void 0 ? void 0 : button.handler) {
1716
- // a handler has been provided, execute it
1717
- // pass the handler the values from the inputs
1718
- try {
1719
- const rtn = await overlays.safeCall(button.handler);
1720
- if (rtn === false) {
1721
- // if the return value of the handler is false then do not dismiss
1722
- return false;
1723
- }
1724
- }
1725
- catch (e) {
1726
- console.error(e);
1727
- }
1728
- }
1729
- return true;
1730
- }
1731
- renderButtons(buttons, side) {
1732
- if (buttons.length === 0) {
1733
- return;
1734
- }
1735
- const mode = ionicGlobal.getIonMode(this);
1736
- const buttonGroupsClasses = {
1737
- 'toast-button-group': true,
1738
- [`toast-button-group-${side}`]: true,
1739
- };
1740
- return (index.h("div", { class: buttonGroupsClasses }, buttons.map((b) => (index.h("button", Object.assign({}, b.htmlAttributes, { type: "button", class: buttonClass(b), tabIndex: 0, onClick: () => this.buttonClick(b), part: buttonPart(b) }), index.h("div", { class: "toast-button-inner" }, b.icon && (index.h("ion-icon", { "aria-hidden": "true", icon: b.icon, slot: b.text === undefined ? 'icon-only' : undefined, class: "toast-button-icon" })), b.text), mode === 'md' && (index.h("ion-ripple-effect", { type: b.icon !== undefined && b.text === undefined ? 'unbounded' : 'bounded' })))))));
1741
- }
1742
- /**
1743
- * Render the `message` property.
1744
- * @param key - A key to give the element a stable identity. This is used to improve compatibility with screen readers.
1745
- * @param ariaHidden - If "true" then content will be hidden from screen readers.
1746
- */
1747
- renderToastMessage(key, ariaHidden = null) {
1748
- const { customHTMLEnabled, message } = this;
1749
- if (customHTMLEnabled) {
1750
- return (index.h("div", { key: key, "aria-hidden": ariaHidden, class: "toast-message", part: "message", innerHTML: index$5.sanitizeDOMString(message) }));
1751
- }
1752
- return (index.h("div", { key: key, "aria-hidden": ariaHidden, class: "toast-message", part: "message" }, message));
1753
- }
1754
- /**
1755
- * Render the `header` property.
1756
- * @param key - A key to give the element a stable identity. This is used to improve compatibility with screen readers.
1757
- * @param ariaHidden - If "true" then content will be hidden from screen readers.
1758
- */
1759
- renderHeader(key, ariaHidden = null) {
1760
- return (index.h("div", { key: key, class: "toast-header", "aria-hidden": ariaHidden, part: "header" }, this.header));
1761
- }
1762
- render() {
1763
- const { layout, el, revealContentToScreenReader, header, message } = this;
1764
- const allButtons = this.getButtons();
1765
- const startButtons = allButtons.filter((b) => b.side === 'start');
1766
- const endButtons = allButtons.filter((b) => b.side !== 'start');
1767
- const mode = ionicGlobal.getIonMode(this);
1768
- const wrapperClass = {
1769
- 'toast-wrapper': true,
1770
- [`toast-${this.position}`]: true,
1771
- [`toast-layout-${layout}`]: true,
1772
- };
1773
- /**
1774
- * Stacked buttons are only meant to be
1775
- * used with one type of button.
1776
- */
1777
- if (layout === 'stacked' && startButtons.length > 0 && endButtons.length > 0) {
1778
- index$3.printIonWarning('This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.', el);
1779
- }
1780
- return (index.h(index.Host, Object.assign({ key: '23803334fb668f6ce7044d3a321cb84bc753bd16', tabindex: "-1" }, this.htmlAttributes, { style: {
1781
- zIndex: `${60000 + this.overlayIndex}`,
1782
- }, class: theme.createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true }, theme.getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent })), onIonToastWillDismiss: this.dispatchCancelHandler }), index.h("div", { key: '7cd7138ba079fccf97f318b91e9986491ab4214d', class: wrapperClass }, index.h("div", { key: '93b78fa64e24435adeb77a04c1d1d53d2f093864', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (index.h("ion-icon", { key: '9a3c71b164ebcfba2540acb7568beffa76b62f47', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), index.h("div", { key: 'feb9268102d844f1314205f7440de7066cf0620e', class: "toast-content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
1783
- }
1784
- get el() { return index.getElement(this); }
1785
- static get watchers() { return {
1786
- "swipeGesture": ["swipeGestureChanged"],
1787
- "isOpen": ["onIsOpenChange"],
1788
- "trigger": ["triggerChanged"]
1789
- }; }
1790
- };
1791
- const buttonClass = (button) => {
1792
- return Object.assign({ 'toast-button': true, 'toast-button-icon-only': button.icon !== undefined && button.text === undefined, [`toast-button-${button.role}`]: button.role !== undefined, 'ion-focusable': true, 'ion-activatable': true }, theme.getClassMap(button.cssClass));
1793
- };
1794
- const buttonPart = (button) => {
1795
- return overlays.isCancel(button.role) ? 'button cancel' : 'button';
1796
- };
1797
- Toast.style = {
1798
- ios: IonToastIosStyle0,
1799
- md: IonToastMdStyle0
1800
- };
1801
-
1802
- const posAddNewThingCss = ":host{font-family:var(--font-sans);display:block}button#new{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;width:var(--scale-5);height:var(--scale-5);background-color:var(--pos-primary-color);color:var(--pos-primary-text-color);font-size:var(--scale-6);border-radius:var(--radius-xs)}button#new:hover,button#new:focus{outline:none;filter:brightness(110%);box-shadow:var(--shadow-sm)}pos-new-thing-form{margin:var(--scale-3)}";
1803
- const PosAddNewThingStyle0 = posAddNewThingCss;
1804
-
1805
- const PosAddNewThing = class {
1806
- constructor(hostRef) {
1807
- index.registerInstance(this, hostRef);
1808
- }
1809
- openDialog() {
1810
- this.dialog.showModal();
1811
- }
1812
- render() {
1813
- return (index.h(index.Host, { key: '6142a141ef03ca93a362a6b00ebe8d515c3a677a' }, index.h("button", { key: '72ecf353cd3a7d2d68f9ef28eb1bbe7fdb88b700', id: "new", title: "Add a new thing", onClick: () => this.openDialog() }, index.h("ion-icon", { key: 'bd05d75c42c10de6df519575787fc66eafb22930', name: "add-circle-outline" })), index.h("pos-dialog", { key: '23cf0118149704dfca16758970e4f4658e87e946', ref: el => (this.dialog = el) }, index.h("span", { key: '5af7b7f618cc20684c39134b5ea295400e651cb6', slot: "title" }, "Add a new thing"), index.h("pos-new-thing-form", { key: '895496c2f6ede3c8677d9d918e0b13582090baed', slot: "content", referenceUri: this.referenceUri }))));
1814
- }
1815
- };
1816
- PosAddNewThing.style = PosAddNewThingStyle0;
1817
-
1818
- const storedSettings = localStorage.getItem('settings');
1819
- const initialSettings = storedSettings
1820
- ? JSON.parse(storedSettings)
1821
- : {
1822
- offlineCache: false,
1823
- };
1824
- const localSettings = BrokenFile.createStore(initialSettings);
1825
- persistChanges();
1826
- syncChangesAcrossTabs();
1827
- function persistChanges() {
1828
- localSettings.on('set', () => {
1829
- const snapshot = JSON.stringify(localSettings.state);
1830
- localStorage.setItem('settings', snapshot);
1831
- });
1832
- }
1833
- function syncChangesAcrossTabs() {
1834
- window.addEventListener('storage', event => {
1835
- if (event.key === 'settings' && event.newValue) {
1836
- const newSettings = JSON.parse(event.newValue);
1837
- localSettings.state.offlineCache = newSettings.offlineCache;
1838
- }
1839
- });
1840
- }
1841
-
1842
- const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);
1843
-
1844
- let idbProxyableTypes;
1845
- let cursorAdvanceMethods;
1846
- // This is a function to prevent it throwing up in node environments.
1847
- function getIdbProxyableTypes() {
1848
- return (idbProxyableTypes ||
1849
- (idbProxyableTypes = [
1850
- IDBDatabase,
1851
- IDBObjectStore,
1852
- IDBIndex,
1853
- IDBCursor,
1854
- IDBTransaction,
1855
- ]));
1856
- }
1857
- // This is a function to prevent it throwing up in node environments.
1858
- function getCursorAdvanceMethods() {
1859
- return (cursorAdvanceMethods ||
1860
- (cursorAdvanceMethods = [
1861
- IDBCursor.prototype.advance,
1862
- IDBCursor.prototype.continue,
1863
- IDBCursor.prototype.continuePrimaryKey,
1864
- ]));
1865
- }
1866
- const transactionDoneMap = new WeakMap();
1867
- const transformCache = new WeakMap();
1868
- const reverseTransformCache = new WeakMap();
1869
- function promisifyRequest(request) {
1870
- const promise = new Promise((resolve, reject) => {
1871
- const unlisten = () => {
1872
- request.removeEventListener('success', success);
1873
- request.removeEventListener('error', error);
1874
- };
1875
- const success = () => {
1876
- resolve(wrap(request.result));
1877
- unlisten();
1878
- };
1879
- const error = () => {
1880
- reject(request.error);
1881
- unlisten();
1882
- };
1883
- request.addEventListener('success', success);
1884
- request.addEventListener('error', error);
1885
- });
1886
- // This mapping exists in reverseTransformCache but doesn't exist in transformCache. This
1887
- // is because we create many promises from a single IDBRequest.
1888
- reverseTransformCache.set(promise, request);
1889
- return promise;
1890
- }
1891
- function cacheDonePromiseForTransaction(tx) {
1892
- // Early bail if we've already created a done promise for this transaction.
1893
- if (transactionDoneMap.has(tx))
1894
- return;
1895
- const done = new Promise((resolve, reject) => {
1896
- const unlisten = () => {
1897
- tx.removeEventListener('complete', complete);
1898
- tx.removeEventListener('error', error);
1899
- tx.removeEventListener('abort', error);
1900
- };
1901
- const complete = () => {
1902
- resolve();
1903
- unlisten();
1904
- };
1905
- const error = () => {
1906
- reject(tx.error || new DOMException('AbortError', 'AbortError'));
1907
- unlisten();
1908
- };
1909
- tx.addEventListener('complete', complete);
1910
- tx.addEventListener('error', error);
1911
- tx.addEventListener('abort', error);
1912
- });
1913
- // Cache it for later retrieval.
1914
- transactionDoneMap.set(tx, done);
1915
- }
1916
- let idbProxyTraps = {
1917
- get(target, prop, receiver) {
1918
- if (target instanceof IDBTransaction) {
1919
- // Special handling for transaction.done.
1920
- if (prop === 'done')
1921
- return transactionDoneMap.get(target);
1922
- // Make tx.store return the only store in the transaction, or undefined if there are many.
1923
- if (prop === 'store') {
1924
- return receiver.objectStoreNames[1]
1925
- ? undefined
1926
- : receiver.objectStore(receiver.objectStoreNames[0]);
1927
- }
1928
- }
1929
- // Else transform whatever we get back.
1930
- return wrap(target[prop]);
1931
- },
1932
- set(target, prop, value) {
1933
- target[prop] = value;
1934
- return true;
1935
- },
1936
- has(target, prop) {
1937
- if (target instanceof IDBTransaction &&
1938
- (prop === 'done' || prop === 'store')) {
1939
- return true;
1940
- }
1941
- return prop in target;
1942
- },
1943
- };
1944
- function replaceTraps(callback) {
1945
- idbProxyTraps = callback(idbProxyTraps);
1946
- }
1947
- function wrapFunction(func) {
1948
- // Due to expected object equality (which is enforced by the caching in `wrap`), we
1949
- // only create one new func per func.
1950
- // Cursor methods are special, as the behaviour is a little more different to standard IDB. In
1951
- // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the
1952
- // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense
1953
- // with real promises, so each advance methods returns a new promise for the cursor object, or
1954
- // undefined if the end of the cursor has been reached.
1955
- if (getCursorAdvanceMethods().includes(func)) {
1956
- return function (...args) {
1957
- // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
1958
- // the original object.
1959
- func.apply(unwrap(this), args);
1960
- return wrap(this.request);
1961
- };
1962
- }
1963
- return function (...args) {
1964
- // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
1965
- // the original object.
1966
- return wrap(func.apply(unwrap(this), args));
1967
- };
1968
- }
1969
- function transformCachableValue(value) {
1970
- if (typeof value === 'function')
1971
- return wrapFunction(value);
1972
- // This doesn't return, it just creates a 'done' promise for the transaction,
1973
- // which is later returned for transaction.done (see idbObjectHandler).
1974
- if (value instanceof IDBTransaction)
1975
- cacheDonePromiseForTransaction(value);
1976
- if (instanceOfAny(value, getIdbProxyableTypes()))
1977
- return new Proxy(value, idbProxyTraps);
1978
- // Return the same value back if we're not going to transform it.
1979
- return value;
1980
- }
1981
- function wrap(value) {
1982
- // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because
1983
- // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.
1984
- if (value instanceof IDBRequest)
1985
- return promisifyRequest(value);
1986
- // If we've already transformed this value before, reuse the transformed value.
1987
- // This is faster, but it also provides object equality.
1988
- if (transformCache.has(value))
1989
- return transformCache.get(value);
1990
- const newValue = transformCachableValue(value);
1991
- // Not all types are transformed.
1992
- // These may be primitive types, so they can't be WeakMap keys.
1993
- if (newValue !== value) {
1994
- transformCache.set(value, newValue);
1995
- reverseTransformCache.set(newValue, value);
1996
- }
1997
- return newValue;
1998
- }
1999
- const unwrap = (value) => reverseTransformCache.get(value);
2000
-
2001
- /**
2002
- * Open a database.
2003
- *
2004
- * @param name Name of the database.
2005
- * @param version Schema version.
2006
- * @param callbacks Additional callbacks.
2007
- */
2008
- function openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {
2009
- const request = indexedDB.open(name, version);
2010
- const openPromise = wrap(request);
2011
- if (upgrade) {
2012
- request.addEventListener('upgradeneeded', (event) => {
2013
- upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);
2014
- });
2015
- }
2016
- if (blocked) {
2017
- request.addEventListener('blocked', (event) => blocked(
2018
- // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
2019
- event.oldVersion, event.newVersion, event));
2020
- }
2021
- openPromise
2022
- .then((db) => {
2023
- if (terminated)
2024
- db.addEventListener('close', () => terminated());
2025
- if (blocking) {
2026
- db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));
2027
- }
2028
- })
2029
- .catch(() => { });
2030
- return openPromise;
2031
- }
2032
-
2033
- const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];
2034
- const writeMethods = ['put', 'add', 'delete', 'clear'];
2035
- const cachedMethods = new Map();
2036
- function getMethod(target, prop) {
2037
- if (!(target instanceof IDBDatabase &&
2038
- !(prop in target) &&
2039
- typeof prop === 'string')) {
2040
- return;
2041
- }
2042
- if (cachedMethods.get(prop))
2043
- return cachedMethods.get(prop);
2044
- const targetFuncName = prop.replace(/FromIndex$/, '');
2045
- const useIndex = prop !== targetFuncName;
2046
- const isWrite = writeMethods.includes(targetFuncName);
2047
- if (
2048
- // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
2049
- !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||
2050
- !(isWrite || readMethods.includes(targetFuncName))) {
2051
- return;
2052
- }
2053
- const method = async function (storeName, ...args) {
2054
- // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(
2055
- const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');
2056
- let target = tx.store;
2057
- if (useIndex)
2058
- target = target.index(args.shift());
2059
- // Must reject if op rejects.
2060
- // If it's a write operation, must reject if tx.done rejects.
2061
- // Must reject with op rejection first.
2062
- // Must resolve with op value.
2063
- // Must handle both promises (no unhandled rejections)
2064
- return (await Promise.all([
2065
- target[targetFuncName](...args),
2066
- isWrite && tx.done,
2067
- ]))[0];
2068
- };
2069
- cachedMethods.set(prop, method);
2070
- return method;
2071
- }
2072
- replaceTraps((oldTraps) => ({
2073
- ...oldTraps,
2074
- get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),
2075
- has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),
2076
- }));
2077
-
2078
- const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];
2079
- const methodMap = {};
2080
- const advanceResults = new WeakMap();
2081
- const ittrProxiedCursorToOriginalProxy = new WeakMap();
2082
- const cursorIteratorTraps = {
2083
- get(target, prop) {
2084
- if (!advanceMethodProps.includes(prop))
2085
- return target[prop];
2086
- let cachedFunc = methodMap[prop];
2087
- if (!cachedFunc) {
2088
- cachedFunc = methodMap[prop] = function (...args) {
2089
- advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));
2090
- };
2091
- }
2092
- return cachedFunc;
2093
- },
2094
- };
2095
- async function* iterate(...args) {
2096
- // tslint:disable-next-line:no-this-assignment
2097
- let cursor = this;
2098
- if (!(cursor instanceof IDBCursor)) {
2099
- cursor = await cursor.openCursor(...args);
2100
- }
2101
- if (!cursor)
2102
- return;
2103
- cursor = cursor;
2104
- const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);
2105
- ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);
2106
- // Map this double-proxy back to the original, so other cursor methods work.
2107
- reverseTransformCache.set(proxiedCursor, unwrap(cursor));
2108
- while (cursor) {
2109
- yield proxiedCursor;
2110
- // If one of the advancing methods was not called, call continue().
2111
- cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());
2112
- advanceResults.delete(proxiedCursor);
2113
- }
2114
- }
2115
- function isIteratorProp(target, prop) {
2116
- return ((prop === Symbol.asyncIterator &&
2117
- instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||
2118
- (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));
2119
- }
2120
- replaceTraps((oldTraps) => ({
2121
- ...oldTraps,
2122
- get(target, prop, receiver) {
2123
- if (isIteratorProp(target, prop))
2124
- return iterate;
2125
- return oldTraps.get(target, prop, receiver);
2126
- },
2127
- has(target, prop) {
2128
- return isIteratorProp(target, prop) || oldTraps.has(target, prop);
2129
- },
2130
- }));
2131
-
2132
- /**
2133
- * An offline cache backed by the browsers IndexedDB storage
2134
- */
2135
- class IndexedDbOfflineCache {
2136
- constructor() {
2137
- this.dbPromise = openDB('OfflineCacheDB', 1, {
2138
- upgrade(db) {
2139
- if (!db.objectStoreNames.contains('documents')) {
2140
- const store = db.createObjectStore('documents', { keyPath: 'url' });
2141
- store.createIndex('url-revision', ['url', 'revision']);
2142
- }
2143
- },
2144
- });
2145
- }
2146
- async clear() {
2147
- const db = await this.dbPromise;
2148
- return db.clear('documents');
2149
- }
2150
- async get(url) {
2151
- const db = await this.dbPromise;
2152
- return await db.get('documents', url);
2153
- }
2154
- async put(document) {
2155
- const db = await this.dbPromise;
2156
- const existing = await db.getFromIndex('documents', 'url-revision', [document.url, document.revision]);
2157
- if (existing) {
2158
- return; // No need to update if the revision is the same
2159
- }
2160
- await db.put('documents', document);
2161
- }
2162
- }
2163
-
2164
- class NavigatorOnlineStatus {
2165
- isOnline() {
2166
- return navigator.onLine;
2167
- }
2168
- }
2169
-
2170
- const createPodOS = (settings) => {
2171
- return new index$6.PodOS({
2172
- offlineCache: settings.offlineCache ? new IndexedDbOfflineCache() : new index$6.NoOfflineCache(),
2173
- onlineStatus: new NavigatorOnlineStatus(),
2174
- });
2175
- };
2176
-
2177
- function isFunction(value) {
2178
- return typeof value === 'function';
2179
- }
2180
-
2181
- function createErrorClass(createImpl) {
2182
- const _super = (instance) => {
2183
- Error.call(instance);
2184
- instance.stack = new Error().stack;
2185
- };
2186
- const ctorFunc = createImpl(_super);
2187
- ctorFunc.prototype = Object.create(Error.prototype);
2188
- ctorFunc.prototype.constructor = ctorFunc;
2189
- return ctorFunc;
2190
- }
2191
-
2192
- const UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {
2193
- _super(this);
2194
- this.message = errors
2195
- ? `${errors.length} errors occurred during unsubscription:
2196
- ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}`
2197
- : '';
2198
- this.name = 'UnsubscriptionError';
2199
- this.errors = errors;
2200
- });
2201
-
2202
- function arrRemove(arr, item) {
2203
- if (arr) {
2204
- const index = arr.indexOf(item);
2205
- 0 <= index && arr.splice(index, 1);
2206
- }
2207
- }
2208
-
2209
- class Subscription {
2210
- constructor(initialTeardown) {
2211
- this.initialTeardown = initialTeardown;
2212
- this.closed = false;
2213
- this._parentage = null;
2214
- this._finalizers = null;
2215
- }
2216
- unsubscribe() {
2217
- let errors;
2218
- if (!this.closed) {
2219
- this.closed = true;
2220
- const { _parentage } = this;
2221
- if (_parentage) {
2222
- this._parentage = null;
2223
- if (Array.isArray(_parentage)) {
2224
- for (const parent of _parentage) {
2225
- parent.remove(this);
2226
- }
2227
- }
2228
- else {
2229
- _parentage.remove(this);
2230
- }
2231
- }
2232
- const { initialTeardown: initialFinalizer } = this;
2233
- if (isFunction(initialFinalizer)) {
2234
- try {
2235
- initialFinalizer();
2236
- }
2237
- catch (e) {
2238
- errors = e instanceof UnsubscriptionError ? e.errors : [e];
2239
- }
2240
- }
2241
- const { _finalizers } = this;
2242
- if (_finalizers) {
2243
- this._finalizers = null;
2244
- for (const finalizer of _finalizers) {
2245
- try {
2246
- execFinalizer(finalizer);
2247
- }
2248
- catch (err) {
2249
- errors = errors !== null && errors !== void 0 ? errors : [];
2250
- if (err instanceof UnsubscriptionError) {
2251
- errors = [...errors, ...err.errors];
2252
- }
2253
- else {
2254
- errors.push(err);
2255
- }
2256
- }
2257
- }
2258
- }
2259
- if (errors) {
2260
- throw new UnsubscriptionError(errors);
2261
- }
2262
- }
2263
- }
2264
- add(teardown) {
2265
- var _a;
2266
- if (teardown && teardown !== this) {
2267
- if (this.closed) {
2268
- execFinalizer(teardown);
2269
- }
2270
- else {
2271
- if (teardown instanceof Subscription) {
2272
- if (teardown.closed || teardown._hasParent(this)) {
2273
- return;
2274
- }
2275
- teardown._addParent(this);
2276
- }
2277
- (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
2278
- }
2279
- }
2280
- }
2281
- _hasParent(parent) {
2282
- const { _parentage } = this;
2283
- return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
2284
- }
2285
- _addParent(parent) {
2286
- const { _parentage } = this;
2287
- this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
2288
- }
2289
- _removeParent(parent) {
2290
- const { _parentage } = this;
2291
- if (_parentage === parent) {
2292
- this._parentage = null;
2293
- }
2294
- else if (Array.isArray(_parentage)) {
2295
- arrRemove(_parentage, parent);
2296
- }
2297
- }
2298
- remove(teardown) {
2299
- const { _finalizers } = this;
2300
- _finalizers && arrRemove(_finalizers, teardown);
2301
- if (teardown instanceof Subscription) {
2302
- teardown._removeParent(this);
2303
- }
2304
- }
2305
- }
2306
- Subscription.EMPTY = (() => {
2307
- const empty = new Subscription();
2308
- empty.closed = true;
2309
- return empty;
2310
- })();
2311
- const EMPTY_SUBSCRIPTION = Subscription.EMPTY;
2312
- function isSubscription(value) {
2313
- return (value instanceof Subscription ||
2314
- (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
2315
- }
2316
- function execFinalizer(finalizer) {
2317
- if (isFunction(finalizer)) {
2318
- finalizer();
2319
- }
2320
- else {
2321
- finalizer.unsubscribe();
2322
- }
2323
- }
2324
-
2325
- const config = {
2326
- onUnhandledError: null,
2327
- onStoppedNotification: null,
2328
- Promise: undefined,
2329
- useDeprecatedSynchronousErrorHandling: false,
2330
- useDeprecatedNextContext: false,
2331
- };
2332
-
2333
- const timeoutProvider = {
2334
- setTimeout(handler, timeout, ...args) {
2335
- const { delegate } = timeoutProvider;
2336
- if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
2337
- return delegate.setTimeout(handler, timeout, ...args);
2338
- }
2339
- return setTimeout(handler, timeout, ...args);
2340
- },
2341
- clearTimeout(handle) {
2342
- const { delegate } = timeoutProvider;
2343
- return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
2344
- },
2345
- delegate: undefined,
2346
- };
2347
-
2348
- function reportUnhandledError(err) {
2349
- timeoutProvider.setTimeout(() => {
2350
- const { onUnhandledError } = config;
2351
- if (onUnhandledError) {
2352
- onUnhandledError(err);
2353
- }
2354
- else {
2355
- throw err;
2356
- }
2357
- });
2358
- }
2359
-
2360
- function noop() { }
2361
-
2362
- const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();
2363
- function errorNotification(error) {
2364
- return createNotification('E', undefined, error);
2365
- }
2366
- function nextNotification(value) {
2367
- return createNotification('N', value, undefined);
2368
- }
2369
- function createNotification(kind, value, error) {
2370
- return {
2371
- kind,
2372
- value,
2373
- error,
2374
- };
2375
- }
2376
-
2377
- let context = null;
2378
- function errorContext(cb) {
2379
- if (config.useDeprecatedSynchronousErrorHandling) {
2380
- const isRoot = !context;
2381
- if (isRoot) {
2382
- context = { errorThrown: false, error: null };
2383
- }
2384
- cb();
2385
- if (isRoot) {
2386
- const { errorThrown, error } = context;
2387
- context = null;
2388
- if (errorThrown) {
2389
- throw error;
2390
- }
2391
- }
2392
- }
2393
- else {
2394
- cb();
2395
- }
2396
- }
2397
-
2398
- class Subscriber extends Subscription {
2399
- constructor(destination) {
2400
- super();
2401
- this.isStopped = false;
2402
- if (destination) {
2403
- this.destination = destination;
2404
- if (isSubscription(destination)) {
2405
- destination.add(this);
2406
- }
2407
- }
2408
- else {
2409
- this.destination = EMPTY_OBSERVER;
2410
- }
2411
- }
2412
- static create(next, error, complete) {
2413
- return new SafeSubscriber(next, error, complete);
2414
- }
2415
- next(value) {
2416
- if (this.isStopped) {
2417
- handleStoppedNotification(nextNotification(value), this);
2418
- }
2419
- else {
2420
- this._next(value);
2421
- }
2422
- }
2423
- error(err) {
2424
- if (this.isStopped) {
2425
- handleStoppedNotification(errorNotification(err), this);
2426
- }
2427
- else {
2428
- this.isStopped = true;
2429
- this._error(err);
2430
- }
2431
- }
2432
- complete() {
2433
- if (this.isStopped) {
2434
- handleStoppedNotification(COMPLETE_NOTIFICATION, this);
2435
- }
2436
- else {
2437
- this.isStopped = true;
2438
- this._complete();
2439
- }
2440
- }
2441
- unsubscribe() {
2442
- if (!this.closed) {
2443
- this.isStopped = true;
2444
- super.unsubscribe();
2445
- this.destination = null;
2446
- }
2447
- }
2448
- _next(value) {
2449
- this.destination.next(value);
2450
- }
2451
- _error(err) {
2452
- try {
2453
- this.destination.error(err);
2454
- }
2455
- finally {
2456
- this.unsubscribe();
2457
- }
2458
- }
2459
- _complete() {
2460
- try {
2461
- this.destination.complete();
2462
- }
2463
- finally {
2464
- this.unsubscribe();
2465
- }
2466
- }
2467
- }
2468
- const _bind = Function.prototype.bind;
2469
- function bind(fn, thisArg) {
2470
- return _bind.call(fn, thisArg);
2471
- }
2472
- class ConsumerObserver {
2473
- constructor(partialObserver) {
2474
- this.partialObserver = partialObserver;
2475
- }
2476
- next(value) {
2477
- const { partialObserver } = this;
2478
- if (partialObserver.next) {
2479
- try {
2480
- partialObserver.next(value);
2481
- }
2482
- catch (error) {
2483
- handleUnhandledError(error);
2484
- }
2485
- }
2486
- }
2487
- error(err) {
2488
- const { partialObserver } = this;
2489
- if (partialObserver.error) {
2490
- try {
2491
- partialObserver.error(err);
2492
- }
2493
- catch (error) {
2494
- handleUnhandledError(error);
2495
- }
2496
- }
2497
- else {
2498
- handleUnhandledError(err);
2499
- }
2500
- }
2501
- complete() {
2502
- const { partialObserver } = this;
2503
- if (partialObserver.complete) {
2504
- try {
2505
- partialObserver.complete();
2506
- }
2507
- catch (error) {
2508
- handleUnhandledError(error);
2509
- }
2510
- }
2511
- }
2512
- }
2513
- class SafeSubscriber extends Subscriber {
2514
- constructor(observerOrNext, error, complete) {
2515
- super();
2516
- let partialObserver;
2517
- if (isFunction(observerOrNext) || !observerOrNext) {
2518
- partialObserver = {
2519
- next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
2520
- error: error !== null && error !== void 0 ? error : undefined,
2521
- complete: complete !== null && complete !== void 0 ? complete : undefined,
2522
- };
2523
- }
2524
- else {
2525
- let context;
2526
- if (this && config.useDeprecatedNextContext) {
2527
- context = Object.create(observerOrNext);
2528
- context.unsubscribe = () => this.unsubscribe();
2529
- partialObserver = {
2530
- next: observerOrNext.next && bind(observerOrNext.next, context),
2531
- error: observerOrNext.error && bind(observerOrNext.error, context),
2532
- complete: observerOrNext.complete && bind(observerOrNext.complete, context),
2533
- };
2534
- }
2535
- else {
2536
- partialObserver = observerOrNext;
2537
- }
2538
- }
2539
- this.destination = new ConsumerObserver(partialObserver);
2540
- }
2541
- }
2542
- function handleUnhandledError(error) {
2543
- {
2544
- reportUnhandledError(error);
2545
- }
2546
- }
2547
- function defaultErrorHandler(err) {
2548
- throw err;
2549
- }
2550
- function handleStoppedNotification(notification, subscriber) {
2551
- const { onStoppedNotification } = config;
2552
- onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
2553
- }
2554
- const EMPTY_OBSERVER = {
2555
- closed: true,
2556
- next: noop,
2557
- error: defaultErrorHandler,
2558
- complete: noop,
2559
- };
2560
-
2561
- const observable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();
2562
-
2563
- function identity(x) {
2564
- return x;
2565
- }
2566
-
2567
- function pipeFromArray(fns) {
2568
- if (fns.length === 0) {
2569
- return identity;
2570
- }
2571
- if (fns.length === 1) {
2572
- return fns[0];
2573
- }
2574
- return function piped(input) {
2575
- return fns.reduce((prev, fn) => fn(prev), input);
2576
- };
2577
- }
2578
-
2579
- class Observable {
2580
- constructor(subscribe) {
2581
- if (subscribe) {
2582
- this._subscribe = subscribe;
2583
- }
2584
- }
2585
- lift(operator) {
2586
- const observable = new Observable();
2587
- observable.source = this;
2588
- observable.operator = operator;
2589
- return observable;
2590
- }
2591
- subscribe(observerOrNext, error, complete) {
2592
- const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
2593
- errorContext(() => {
2594
- const { operator, source } = this;
2595
- subscriber.add(operator
2596
- ?
2597
- operator.call(subscriber, source)
2598
- : source
2599
- ?
2600
- this._subscribe(subscriber)
2601
- :
2602
- this._trySubscribe(subscriber));
2603
- });
2604
- return subscriber;
2605
- }
2606
- _trySubscribe(sink) {
2607
- try {
2608
- return this._subscribe(sink);
2609
- }
2610
- catch (err) {
2611
- sink.error(err);
2612
- }
2613
- }
2614
- forEach(next, promiseCtor) {
2615
- promiseCtor = getPromiseCtor(promiseCtor);
2616
- return new promiseCtor((resolve, reject) => {
2617
- const subscriber = new SafeSubscriber({
2618
- next: (value) => {
2619
- try {
2620
- next(value);
2621
- }
2622
- catch (err) {
2623
- reject(err);
2624
- subscriber.unsubscribe();
2625
- }
2626
- },
2627
- error: reject,
2628
- complete: resolve,
2629
- });
2630
- this.subscribe(subscriber);
2631
- });
2632
- }
2633
- _subscribe(subscriber) {
2634
- var _a;
2635
- return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
2636
- }
2637
- [observable]() {
2638
- return this;
2639
- }
2640
- pipe(...operations) {
2641
- return pipeFromArray(operations)(this);
2642
- }
2643
- toPromise(promiseCtor) {
2644
- promiseCtor = getPromiseCtor(promiseCtor);
2645
- return new promiseCtor((resolve, reject) => {
2646
- let value;
2647
- this.subscribe((x) => (value = x), (err) => reject(err), () => resolve(value));
2648
- });
2649
- }
2650
- }
2651
- Observable.create = (subscribe) => {
2652
- return new Observable(subscribe);
2653
- };
2654
- function getPromiseCtor(promiseCtor) {
2655
- var _a;
2656
- return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
2657
- }
2658
- function isObserver(value) {
2659
- return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
2660
- }
2661
- function isSubscriber(value) {
2662
- return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
2663
- }
2664
-
2665
- function hasLift(source) {
2666
- return isFunction(source === null || source === void 0 ? void 0 : source.lift);
2667
- }
2668
- function operate(init) {
2669
- return (source) => {
2670
- if (hasLift(source)) {
2671
- return source.lift(function (liftedSource) {
2672
- try {
2673
- return init(liftedSource, this);
2674
- }
2675
- catch (err) {
2676
- this.error(err);
2677
- }
2678
- });
2679
- }
2680
- throw new TypeError('Unable to lift unknown Observable type');
2681
- };
2682
- }
2683
-
2684
- function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
2685
- return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
2686
- }
2687
- class OperatorSubscriber extends Subscriber {
2688
- constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
2689
- super(destination);
2690
- this.onFinalize = onFinalize;
2691
- this.shouldUnsubscribe = shouldUnsubscribe;
2692
- this._next = onNext
2693
- ? function (value) {
2694
- try {
2695
- onNext(value);
2696
- }
2697
- catch (err) {
2698
- destination.error(err);
2699
- }
2700
- }
2701
- : super._next;
2702
- this._error = onError
2703
- ? function (err) {
2704
- try {
2705
- onError(err);
2706
- }
2707
- catch (err) {
2708
- destination.error(err);
2709
- }
2710
- finally {
2711
- this.unsubscribe();
2712
- }
2713
- }
2714
- : super._error;
2715
- this._complete = onComplete
2716
- ? function () {
2717
- try {
2718
- onComplete();
2719
- }
2720
- catch (err) {
2721
- destination.error(err);
2722
- }
2723
- finally {
2724
- this.unsubscribe();
2725
- }
2726
- }
2727
- : super._complete;
2728
- }
2729
- unsubscribe() {
2730
- var _a;
2731
- if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
2732
- const { closed } = this;
2733
- super.unsubscribe();
2734
- !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
2735
- }
2736
- }
2737
- }
2738
-
2739
- const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
2740
- _super(this);
2741
- this.name = 'ObjectUnsubscribedError';
2742
- this.message = 'object unsubscribed';
2743
- });
2744
-
2745
- class Subject extends Observable {
2746
- constructor() {
2747
- super();
2748
- this.closed = false;
2749
- this.currentObservers = null;
2750
- this.observers = [];
2751
- this.isStopped = false;
2752
- this.hasError = false;
2753
- this.thrownError = null;
2754
- }
2755
- lift(operator) {
2756
- const subject = new AnonymousSubject(this, this);
2757
- subject.operator = operator;
2758
- return subject;
2759
- }
2760
- _throwIfClosed() {
2761
- if (this.closed) {
2762
- throw new ObjectUnsubscribedError();
2763
- }
2764
- }
2765
- next(value) {
2766
- errorContext(() => {
2767
- this._throwIfClosed();
2768
- if (!this.isStopped) {
2769
- if (!this.currentObservers) {
2770
- this.currentObservers = Array.from(this.observers);
2771
- }
2772
- for (const observer of this.currentObservers) {
2773
- observer.next(value);
2774
- }
2775
- }
2776
- });
2777
- }
2778
- error(err) {
2779
- errorContext(() => {
2780
- this._throwIfClosed();
2781
- if (!this.isStopped) {
2782
- this.hasError = this.isStopped = true;
2783
- this.thrownError = err;
2784
- const { observers } = this;
2785
- while (observers.length) {
2786
- observers.shift().error(err);
2787
- }
2788
- }
2789
- });
2790
- }
2791
- complete() {
2792
- errorContext(() => {
2793
- this._throwIfClosed();
2794
- if (!this.isStopped) {
2795
- this.isStopped = true;
2796
- const { observers } = this;
2797
- while (observers.length) {
2798
- observers.shift().complete();
2799
- }
2800
- }
2801
- });
2802
- }
2803
- unsubscribe() {
2804
- this.isStopped = this.closed = true;
2805
- this.observers = this.currentObservers = null;
2806
- }
2807
- get observed() {
2808
- var _a;
2809
- return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
2810
- }
2811
- _trySubscribe(subscriber) {
2812
- this._throwIfClosed();
2813
- return super._trySubscribe(subscriber);
2814
- }
2815
- _subscribe(subscriber) {
2816
- this._throwIfClosed();
2817
- this._checkFinalizedStatuses(subscriber);
2818
- return this._innerSubscribe(subscriber);
2819
- }
2820
- _innerSubscribe(subscriber) {
2821
- const { hasError, isStopped, observers } = this;
2822
- if (hasError || isStopped) {
2823
- return EMPTY_SUBSCRIPTION;
2824
- }
2825
- this.currentObservers = null;
2826
- observers.push(subscriber);
2827
- return new Subscription(() => {
2828
- this.currentObservers = null;
2829
- arrRemove(observers, subscriber);
2830
- });
2831
- }
2832
- _checkFinalizedStatuses(subscriber) {
2833
- const { hasError, thrownError, isStopped } = this;
2834
- if (hasError) {
2835
- subscriber.error(thrownError);
2836
- }
2837
- else if (isStopped) {
2838
- subscriber.complete();
2839
- }
2840
- }
2841
- asObservable() {
2842
- const observable = new Observable();
2843
- observable.source = this;
2844
- return observable;
2845
- }
2846
- }
2847
- Subject.create = (destination, source) => {
2848
- return new AnonymousSubject(destination, source);
2849
- };
2850
- class AnonymousSubject extends Subject {
2851
- constructor(destination, source) {
2852
- super();
2853
- this.destination = destination;
2854
- this.source = source;
2855
- }
2856
- next(value) {
2857
- var _a, _b;
2858
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
2859
- }
2860
- error(err) {
2861
- var _a, _b;
2862
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
2863
- }
2864
- complete() {
2865
- var _a, _b;
2866
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
2867
- }
2868
- _subscribe(subscriber) {
2869
- var _a, _b;
2870
- return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
2871
- }
2872
- }
2873
-
2874
- /******************************************************************************
2875
- Copyright (c) Microsoft Corporation.
2876
-
2877
- Permission to use, copy, modify, and/or distribute this software for any
2878
- purpose with or without fee is hereby granted.
2879
-
2880
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2881
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2882
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2883
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2884
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2885
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2886
- PERFORMANCE OF THIS SOFTWARE.
2887
- ***************************************************************************** */
2888
-
2889
- function __awaiter(thisArg, _arguments, P, generator) {
2890
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2891
- return new (P || (P = Promise))(function (resolve, reject) {
2892
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2893
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2894
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2895
- step((generator = generator.apply(thisArg, _arguments || [])).next());
2896
- });
2897
- }
2898
-
2899
- function __values(o) {
2900
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2901
- if (m) return m.call(o);
2902
- if (o && typeof o.length === "number") return {
2903
- next: function () {
2904
- if (o && i >= o.length) o = void 0;
2905
- return { value: o && o[i++], done: !o };
2906
- }
2907
- };
2908
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2909
- }
2910
-
2911
- function __await(v) {
2912
- return this instanceof __await ? (this.v = v, this) : new __await(v);
2913
- }
2914
-
2915
- function __asyncGenerator(thisArg, _arguments, generator) {
2916
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2917
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
2918
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
2919
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
2920
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
2921
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
2922
- function fulfill(value) { resume("next", value); }
2923
- function reject(value) { resume("throw", value); }
2924
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
2925
- }
2926
-
2927
- function __asyncValues(o) {
2928
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2929
- var m = o[Symbol.asyncIterator], i;
2930
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
2931
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
2932
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
2933
- }
2934
-
2935
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
2936
- var e = new Error(message);
2937
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2938
- };
2939
-
2940
- const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function');
2941
-
2942
- function isPromise(value) {
2943
- return isFunction(value === null || value === void 0 ? void 0 : value.then);
2944
- }
2945
-
2946
- function isInteropObservable(input) {
2947
- return isFunction(input[observable]);
2948
- }
2949
-
2950
- function isAsyncIterable(obj) {
2951
- return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
2952
- }
2953
-
2954
- function createInvalidObservableTypeError(input) {
2955
- return new TypeError(`You provided ${input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`);
2956
- }
2957
-
2958
- function getSymbolIterator() {
2959
- if (typeof Symbol !== 'function' || !Symbol.iterator) {
2960
- return '@@iterator';
2961
- }
2962
- return Symbol.iterator;
2963
- }
2964
- const iterator = getSymbolIterator();
2965
-
2966
- function isIterable(input) {
2967
- return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
2968
- }
2969
-
2970
- function readableStreamLikeToAsyncGenerator(readableStream) {
2971
- return __asyncGenerator(this, arguments, function* readableStreamLikeToAsyncGenerator_1() {
2972
- const reader = readableStream.getReader();
2973
- try {
2974
- while (true) {
2975
- const { value, done } = yield __await(reader.read());
2976
- if (done) {
2977
- return yield __await(void 0);
2978
- }
2979
- yield yield __await(value);
2980
- }
2981
- }
2982
- finally {
2983
- reader.releaseLock();
2984
- }
2985
- });
2986
- }
2987
- function isReadableStreamLike(obj) {
2988
- return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
2989
- }
2990
-
2991
- function innerFrom(input) {
2992
- if (input instanceof Observable) {
2993
- return input;
2994
- }
2995
- if (input != null) {
2996
- if (isInteropObservable(input)) {
2997
- return fromInteropObservable(input);
2998
- }
2999
- if (isArrayLike(input)) {
3000
- return fromArrayLike(input);
3001
- }
3002
- if (isPromise(input)) {
3003
- return fromPromise(input);
3004
- }
3005
- if (isAsyncIterable(input)) {
3006
- return fromAsyncIterable(input);
3007
- }
3008
- if (isIterable(input)) {
3009
- return fromIterable(input);
3010
- }
3011
- if (isReadableStreamLike(input)) {
3012
- return fromReadableStreamLike(input);
3013
- }
3014
- }
3015
- throw createInvalidObservableTypeError(input);
3016
- }
3017
- function fromInteropObservable(obj) {
3018
- return new Observable((subscriber) => {
3019
- const obs = obj[observable]();
3020
- if (isFunction(obs.subscribe)) {
3021
- return obs.subscribe(subscriber);
3022
- }
3023
- throw new TypeError('Provided object does not correctly implement Symbol.observable');
3024
- });
3025
- }
3026
- function fromArrayLike(array) {
3027
- return new Observable((subscriber) => {
3028
- for (let i = 0; i < array.length && !subscriber.closed; i++) {
3029
- subscriber.next(array[i]);
3030
- }
3031
- subscriber.complete();
3032
- });
3033
- }
3034
- function fromPromise(promise) {
3035
- return new Observable((subscriber) => {
3036
- promise
3037
- .then((value) => {
3038
- if (!subscriber.closed) {
3039
- subscriber.next(value);
3040
- subscriber.complete();
3041
- }
3042
- }, (err) => subscriber.error(err))
3043
- .then(null, reportUnhandledError);
3044
- });
3045
- }
3046
- function fromIterable(iterable) {
3047
- return new Observable((subscriber) => {
3048
- for (const value of iterable) {
3049
- subscriber.next(value);
3050
- if (subscriber.closed) {
3051
- return;
3052
- }
3053
- }
3054
- subscriber.complete();
3055
- });
3056
- }
3057
- function fromAsyncIterable(asyncIterable) {
3058
- return new Observable((subscriber) => {
3059
- process(asyncIterable, subscriber).catch((err) => subscriber.error(err));
3060
- });
3061
- }
3062
- function fromReadableStreamLike(readableStream) {
3063
- return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
3064
- }
3065
- function process(asyncIterable, subscriber) {
3066
- var asyncIterable_1, asyncIterable_1_1;
3067
- var e_1, _a;
3068
- return __awaiter(this, void 0, void 0, function* () {
3069
- try {
3070
- for (asyncIterable_1 = __asyncValues(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) {
3071
- const value = asyncIterable_1_1.value;
3072
- subscriber.next(value);
3073
- if (subscriber.closed) {
3074
- return;
3075
- }
3076
- }
3077
- }
3078
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
3079
- finally {
3080
- try {
3081
- if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1);
3082
- }
3083
- finally { if (e_1) throw e_1.error; }
3084
- }
3085
- subscriber.complete();
3086
- });
3087
- }
3088
-
3089
- function takeUntil(notifier) {
3090
- return operate((source, subscriber) => {
3091
- innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, () => subscriber.complete(), noop));
3092
- !subscriber.closed && source.subscribe(subscriber);
3093
- });
3094
- }
3095
-
3096
- const PosApp = class {
3097
- constructor(hostRef) {
3098
- index.registerInstance(this, hostRef);
3099
- this.sessionRestoredEmitter = index.createEvent(this, "pod-os:session-restored", 7);
3100
- this.restorePreviousSession = false;
3101
- this.disconnected$ = new Subject();
3102
- }
3103
- componentWillLoad() {
3104
- this.unsubscribeSettings = localSettings.on('set', () => {
3105
- this.os = createPodOS(localSettings.state);
3106
- });
3107
- this.os = createPodOS(localSettings.state);
3108
- this.os.onSessionRestore(url => {
3109
- this.sessionRestoredEmitter.emit({ url });
3110
- });
3111
- this.os.handleIncomingRedirect(this.restorePreviousSession);
3112
- this.os
3113
- .observeSession()
3114
- .pipe(takeUntil(this.disconnected$))
3115
- .subscribe(async (sessionInfo) => {
3116
- BrokenFile.store.state.webId = sessionInfo.webId;
3117
- if (sessionInfo.isLoggedIn) {
3118
- const profile = await this.os.fetchProfile(sessionInfo.webId);
3119
- BrokenFile.store.state.profile = profile;
3120
- }
3121
- BrokenFile.store.state.isLoggedIn = sessionInfo.isLoggedIn;
3122
- });
3123
- }
3124
- disconnectedCallback() {
3125
- this.unsubscribeSettings();
3126
- this.disconnected$.next();
3127
- this.disconnected$.unsubscribe();
3128
- }
3129
- async initializeOs(event) {
3130
- event.stopPropagation();
3131
- event.detail(this.os);
3132
- }
3133
- async loadModule(event) {
3134
- event.stopPropagation();
3135
- if (event.detail.module === 'contacts') {
3136
- const module = await this.os.loadContactsModule();
3137
- event.detail.receiver(module);
3138
- }
3139
- else {
3140
- throw Error(`Unknown module "${event.detail.module}"`);
3141
- }
3142
- }
3143
- render() {
3144
- return index.h("slot", { key: '988c393af75e8bd0f4ff2b4c04fe33b1ed686fa7' });
3145
- }
3146
- };
3147
-
3148
- const posAppBrowserCss = "pos-router {\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\npos-navigation-bar {\n max-width: var(--width-lg);\n margin: 0;\n}\n\npos-add-new-thing,\npos-login {\n flex: 0 1 auto; /* Behält die Breite des Inhalts bei */\n}\n\nheader,\nfooter {\n display: flex;\n gap: var(--size-1);\n height: auto;\n justify-content: center;\n align-items: center;\n padding: var(--size-1);\n}\n\nfooter svg {\n width: var(--size-5);\n height: var(--size-5);\n}\n\nfooter {\n font-size: var(--scale-fluid-000);\n\n .settings {\n padding: 0 var(--size-1);\n text-decoration: none;\n background-color: var(--pos-background-color);\n border: 1px solid var(--pos-secondary-border-color);\n color: var(--pos-secondary-border-color);\n border-radius: var(--radius-xs);\n\n &:hover {\n background-color: var(--pos-secondary-border-color);\n color: var(--pos-background-color);\n }\n }\n}\n\nheader {\n flex-wrap: wrap;\n padding: 0 var(--size-8);\n}\n\nmain {\n flex: 1;\n max-height: 100vh;\n overflow: auto;\n}\n\n@media (max-width: 640px) {\n header {\n padding: 0 var(--size-1) var(--size-1);\n justify-content: space-between;\n }\n\n pos-navigation-bar {\n flex-basis: 100%;\n order: 0;\n }\n\n pos-add-new-thing,\n pos-login {\n order: 1;\n }\n}\n";
3149
- const PosAppBrowserStyle0 = posAppBrowserCss;
3150
-
3151
- const PosAppBrowser = class {
3152
- constructor(hostRef) {
3153
- index.registerInstance(this, hostRef);
3154
- this.restorePreviousSession = false;
3155
- /**
3156
- * The mode the app is running in:
3157
- *
3158
- * - standalone: use this when you deploy it as a standalone web application
3159
- * - pod: use this when you host this app as a default interface for you pod
3160
- */
3161
- this.mode = 'standalone';
3162
- this.uri = '';
3163
- }
3164
- render() {
3165
- return (index.h(index.Host, { key: '50b6e91f4e98be29cfa37552eb799883aeb49c9e' }, index.h("pos-app", { key: '652617d5eaf3653caeb58b9e93dff09810a587a3', restorePreviousSession: this.restorePreviousSession }, index.h("pos-error-toast", { key: 'f4a29b30c2a4caece50c0da046426bc50a3b402e' }, index.h("pos-router", { key: 'd3f2307db47406c4d84c9b27ac767d263ae81c32', mode: this.mode, "onPod-os:route-changed": e => (this.uri = e.detail) }, index.h("header", { key: '521c8469dae209a27780d62a5922f8a15d393e07' }, index.h("pos-add-new-thing", { key: '2fdd9716da4b3590fb0983a4b50f8c63eca26dce', referenceUri: this.uri }), index.h("pos-navigation-bar", { key: '6add9651de9ff5ca8496470c0df1341927683001', uri: this.uri === 'pod-os:dashboard' ? '' : this.uri }), index.h("pos-login", { key: '87a60cc03fc63a2ca68b294726e7e44a09bdc835' })), index.h("main", { key: 'dd2b3de09ca7f8957b240b030cafeeac37e76c1b' }, this.uri.startsWith('pod-os:') ? (index.h("pos-internal-router", { uri: this.uri })) : (index.h("pos-resource", { key: this.uri, uri: this.uri }, index.h("pos-type-router", null)))), index.h("footer", { key: 'ea1444713656c8740d81c5ac777b72bb6e287729' }, index.h(Logo, { key: '1bba3eec9e30c30f9132a6524e00ec212169f402' }), index.h("span", { key: '3b38a5e1704559f271075b60a27d8334f41a09dc' }, "PodOS Browser"), index.h("span", { key: '848dd110da12d70ec7798bfcf042638af8f7b121' }, "|"), index.h("a", { key: '8b748b91e4ae5351d0b2081dcb2af09867a00aee', class: "settings", href: "?uri=pod-os%3Asettings" }, "\u2699 Settings")))))));
3166
- }
3167
- };
3168
- const Logo = () => {
3169
- return (index.h("svg", { viewBox: "0 0 400 400", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M50 350 L50 100 L200 50 L350 100 L350 350 Z", style: {
3170
- 'fill': '#008BF8',
3171
- 'stroke': '#008BF8',
3172
- 'stroke-width': '70',
3173
- }, "stroke-linejoin": "round" }), index.h("path", { d: "M100 300 L100 150 L200 120 L300 150 L300 300 L130 300 L130 370 L100 370Z", style: {
3174
- 'fill': 'white',
3175
- 'stroke': 'white',
3176
- 'stroke-width': '45',
3177
- }, "stroke-linejoin": "round" }), index.h("path", { d: "M150 250 L150 200 L200 180 L250 200 L250 250 Z", style: {
3178
- 'fill': '#DC0073',
3179
- 'stroke': '#DC0073',
3180
- 'stroke-width': '20',
3181
- }, "stroke-linejoin": "round" })));
3182
- };
3183
- PosAppBrowser.style = PosAppBrowserStyle0;
3184
-
3185
- const posAppDashboardCss = ":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}";
3186
- const PosAppDashboardStyle0 = posAppDashboardCss;
3187
-
3188
- const PosAppDashboard = class {
3189
- constructor(hostRef) {
3190
- index.registerInstance(this, hostRef);
3191
- }
3192
- render() {
3193
- return (index.h(index.Host, { key: 'c467fa44eac028bc1a1546423ac92a5e1e9a98d2' }, index.h("pos-getting-started", { key: 'f62088d7cc2c199617eecbfd771b2f22db1a7431' }), index.h("pos-example-resources", { key: '6285bd2160042582ee113f81e7e6e02139d67f45' })));
3194
- }
3195
- };
3196
- PosAppDashboard.style = PosAppDashboardStyle0;
3197
-
3198
- const posAppSettingsCss = ":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}";
3199
- const PosAppSettingsStyle0 = posAppSettingsCss;
3200
-
3201
- const PosAppSettings = class {
3202
- constructor(hostRef) {
3203
- index.registerInstance(this, hostRef);
3204
- }
3205
- render() {
3206
- return index.h("pos-setting-offline-cache", { key: 'f065206f6291089773a19045243f04b6ce35eeb9' });
3207
- }
3208
- };
3209
- PosAppSettings.style = PosAppSettingsStyle0;
3210
-
3211
- const PosDescription = class {
3212
- constructor(hostRef) {
3213
- index.registerInstance(this, hostRef);
3214
- this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
3215
- this.receiveResource = (resource) => {
3216
- this.resource = resource;
3217
- };
3218
- }
3219
- componentWillLoad() {
3220
- ResourceAware.subscribeResource(this);
3221
- }
3222
- render() {
3223
- return this.resource ? this.resource.description() : null;
3224
- }
3225
- };
3226
-
3227
- const posDialogCss = "dialog{background-color:var(--pos-background-color);color:var(--pos-normal-text-color);border:none;border-radius:var(--radius-md);box-shadow:var(--shadow-md);max-width:var(--width-xs);animation:slideIn 0.2s ease-out}dialog::backdrop{background:rgba(0, 0, 0, 0.5);backdrop-filter:var(--blur-sm);animation:fadeIn 0.2s ease-out}@media (prefers-color-scheme: dark){dialog::backdrop{background:rgb(100, 100, 100, 0.5)}}dialog header>:first-child{flex-grow:1;font-weight:var(--weight-light);font-size:var(--scale-2);font-family:var(--font-sans);margin:0}dialog header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:var(--scale-0);border-bottom-style:inset;padding:0 0 var(--scale-0) 0}dialog>:last-child{display:block;margin-top:var(--scale-3)}button#close{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;background:none;font-size:var(--scale-3);color:var(--color-grey-500)}button#close:hover{color:var(--pos-secondary-border-color)}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes slideIn{from{opacity:0;transform:translateY(-20px) scale(0.95)}to{opacity:1;transform:translateY(0) scale(1)}}";
3228
- const PosDialogStyle0 = posDialogCss;
3229
-
3230
- const PosDialog = class {
3231
- constructor(hostRef) {
3232
- index.registerInstance(this, hostRef);
3233
- }
3234
- async showModal() {
3235
- this.dialog.showModal();
3236
- }
3237
- async close() {
3238
- this.dialog.close();
3239
- }
3240
- render() {
3241
- return (index.h(index.Host, { key: '168dc7d1cf3feabd5f9b2b3f9add6b04467b36ef' }, index.h("dialog", { key: '8bbfb245d9ff066d111c116c1715be25b0907403', ref: el => (this.dialog = el) }, index.h("header", { key: '94e28eb2b8147cb6b2aedda0d8e6a5158117788e' }, index.h("slot", { key: 'a40c2d397b9f54056d4fd8089fdfcc1e446b6d61', name: "title" }), index.h("button", { key: 'f0f64f5aaafc331f9e3d0fb6201c453600157db1', tabindex: -1, id: "close", title: "Close", onClick: () => this.close() }, index.h("ion-icon", { key: 'd94a0cf3d19d7caa3717690004101e3ff4748760', name: "close-outline" }))), index.h("slot", { key: '3181fafe55869add4a587bf4726226055e98588d', name: "content" }))));
3242
- }
3243
- };
3244
- PosDialog.style = PosDialogStyle0;
3245
-
3246
- const PosErrorToast = class {
3247
- constructor(hostRef) {
3248
- index.registerInstance(this, hostRef);
3249
- }
3250
- async unhandledRejection(event) {
3251
- event.stopPropagation();
3252
- console.error('unhandled promise rejection', event);
3253
- await this.showToast(event.reason.toString());
3254
- }
3255
- async catchError(event) {
3256
- event.stopPropagation();
3257
- console.error(event.detail);
3258
- await this.showToast(event.detail.message);
3259
- }
3260
- async showToast(message) {
3261
- const toast = await overlays.toastController.create({
3262
- message,
3263
- duration: 10000,
3264
- position: 'top',
3265
- color: 'danger',
3266
- buttons: [
3267
- {
3268
- text: 'Dismiss',
3269
- role: 'cancel',
3270
- },
3271
- ],
3272
- });
3273
- await toast.present();
3274
- }
3275
- render() {
3276
- return (index.h(index.Host, { key: 'c1ee5f8a19177c79a3fe377fa27e4a32ffa9db9f' }, index.h("ion-toast", { key: '8759a3436a5caa16a11a2900a5f67d0dd205d097', trigger: "never", message: "Workarround to preload ion-toast and ion-ripple-effect to be able to show errors while offline", duration: 0 }, index.h("ion-ripple-effect", { key: '990aa24f2a18750ec5307498acda539b784c86c4' })), index.h("slot", { key: 'bea0650cc211dc2a161e7c634825adc045647d84' })));
3277
- }
3278
- };
3279
-
3280
- const posExampleResourcesCss = ":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.links{display:flex;flex-direction:column;gap:var(--size-3);max-width:80vw}";
3281
- const PosExampleResourcesStyle0 = posExampleResourcesCss;
3282
-
3283
- const PosExampleResources = class {
3284
- constructor(hostRef) {
3285
- index.registerInstance(this, hostRef);
3286
- }
3287
- render() {
3288
- return (index.h(index.Host, { key: 'b6a491caa9ea624cdba3cca92fcc9444a3c38290' }, index.h("div", { key: '458ceb259d7070d38eb13aea9f3b303f174a5c56' }, index.h("h2", { key: '1d571afb47c256f2ac873840c6fe8bc8408cc9a6' }, "Try these... \uD83D\uDCA1"), index.h("p", { key: '7de1dac7a92becb01ec7aab4cf96c45fa95f7de6' }, "No idea where to start? Try these example resources, and follow your nose \uD83D\uDC43"), index.h("div", { key: 'b94cc5571f5b7af0bcc660fc8812ca08ca2db482', class: "links" }, index.h("pos-rich-link", { key: 'e2c414d51b79e27667a42d04fa66e879a2ecf2a2', uri: "https://pod-os.solidcommunity.net/profile/card#me" }), index.h("pos-rich-link", { key: 'e54479349363d67d027612bbcdb2167f9ab6ec03', uri: "https://angelo.veltens.org/profile/card#me" }), index.h("pos-rich-link", { key: '1c743eafd11d46f6bdd31face3bf1083abd1e045', uri: "https://angelo.veltens.org/public/bookmarks" }), index.h("pos-rich-link", { key: '3e47cd67a0ab44a1921ec4f0e5e9f24404826494', uri: "https://solidos.solidcommunity.net/profile/card#me" })))));
3289
- }
3290
- };
3291
- PosExampleResources.style = PosExampleResourcesStyle0;
3292
-
3293
- const posGettingStartedCss = ":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.question{font-weight:var(--weight-semibold)}a{font-weight:var(--weight-bold);color:var(--pos-primary-color)}";
3294
- const PosGettingStartedStyle0 = posGettingStartedCss;
3295
-
3296
- const PosGettingStarted = class {
3297
- constructor(hostRef) {
3298
- index.registerInstance(this, hostRef);
3299
- }
3300
- render() {
3301
- return (index.h(index.Host, { key: 'a31a64545a5960ce8e34f0c612d2755e465c1131' }, index.h("div", { key: '29ec2c449fd5334e47199dece7c01c2a71ab6d98' }, index.h("h2", { key: 'e680003831826c8cd4615de083f9f9c305513c29' }, "Getting started \uD83D\uDE80"), index.h("p", { key: '8e80305087bee4c8ec05ac7cb16096caf0c61ad0' }, "\uD83D\uDD0E Enter a URL into the above navigation bar to browse through the web of data. "), index.h("p", { key: '4d7ba95047694e636934cb7a03c291adb0678bb6' }, "\uD83D\uDD10 Sign in to access private resources on your Solid Pod or those of your friends or coworkers.")), index.h("div", { key: '167ac903fa88b9be6cf00f2f5bfea23d8dfd14c9' }, index.h("p", { key: 'a0b06f944e534b889502a96c935686a3b7f349d0', class: "question" }, "New to Solid?"), index.h("p", { key: '8c26c4d20d0fcdb075ad4c0ea5ff012d22dee081' }, index.h("a", { key: 'd9bc5b7bfd213012078729e25e42b4ea8b970573', href: "https://solidproject.org/for-developers#hosted-pod-services" }, "Get a Pod \u2192"))), index.h("div", { key: '223f171699e3acf5f1c5c4819621bddc49db41f1' }, index.h("p", { key: 'e83cfd2b01c5abaf30f0053ef261c68ae0919f0a', class: "question" }, "Want to dig deeper into PodOS?"), index.h("p", { key: '8ccdbd60a250850c4105e99545f09755109ced86' }, index.h("a", { key: 'f72a83533b846bd8e8e798b0dd71cfc585a8d104', href: "http://pod-os.org" }, "Learn more \u2192")))));
3302
- }
3303
- };
3304
- PosGettingStarted.style = PosGettingStartedStyle0;
3305
-
3306
- const posImageCss = ":host{display:flex;background-size:cover;background-repeat:no-repeat;background-position:center;border-radius:inherit}img,ion-skeleton-text,div.error{border-radius:var(--border-radius);width:var(--width);height:var(--height);max-width:var(--max-width);max-height:var(--max-height);object-fit:var(--object-fit)}img{backdrop-filter:var(--blur-xl)}.error{display:flex;opacity:0.8;background:repeating-linear-gradient(-45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px);flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a.error{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";
3307
- const PosImageStyle0 = posImageCss;
3308
-
3309
- const PosImage = class {
3310
- constructor(hostRef) {
3311
- index.registerInstance(this, hostRef);
3312
- this.initializeOsEmitter = index.createEvent(this, "pod-os:init", 7);
3313
- this.resourceLoadedEmitter = index.createEvent(this, "pod-os:resource-loaded", 7);
3314
- /**
3315
- * Use a blurred version of the image as its own background, if the image is scaled down to fit into the container.
3316
- */
3317
- this.blurredBackground = false;
3318
- this.loading = true;
3319
- this.setOs = async (os) => {
3320
- this.os = os;
3321
- };
3322
- }
3323
- componentWillLoad() {
3324
- BrokenFile.store.onChange('isLoggedIn', () => this.fetchBlob());
3325
- this.initializeOsEmitter.emit(this.setOs);
3326
- }
3327
- async fetchBlob() {
3328
- try {
3329
- this.loading = true;
3330
- this.imageError = null;
3331
- this.networkError = null;
3332
- this.brokenFile = null;
3333
- const file = await this.os.fetchFile(this.src);
3334
- this.resourceLoadedEmitter.emit(this.src);
3335
- if (file.blob()) {
3336
- this.dataUri = URL.createObjectURL(file.blob());
3337
- }
3338
- else {
3339
- this.brokenFile = file;
3340
- }
3341
- }
3342
- catch (err) {
3343
- this.networkError = err;
3344
- }
3345
- finally {
3346
- this.loading = false;
3347
- }
3348
- }
3349
- onImageError(err) {
3350
- this.networkError = null;
3351
- this.imageError = err;
3352
- }
3353
- render() {
3354
- if (this.loading) {
3355
- return index.h("ion-skeleton-text", { animated: true });
3356
- }
3357
- if (this.networkError) {
3358
- // probably a CORS error
3359
- return index.h("img", { alt: this.alt, src: this.src, onError: err => this.onImageError(err) });
3360
- }
3361
- if (this.brokenFile) {
3362
- // fetching worked, but HTTP response was not ok
3363
- return index.h(BrokenFile.BrokenFile, { file: this.brokenFile });
3364
- }
3365
- if (this.imageError) {
3366
- // if even the loading via classic <img src="..."> failed, render a link
3367
- return (index.h("div", { class: "error" }, index.h("a", { href: this.src }, this.src)));
3368
- }
3369
- return (index.h(index.Host, { style: {
3370
- backgroundImage: this.blurredBackground ? `url('${this.dataUri}')` : null,
3371
- } }, index.h("img", { src: this.dataUri, alt: this.alt })));
3372
- }
3373
- static get watchers() { return {
3374
- "os": ["fetchBlob"],
3375
- "src": ["fetchBlob"]
3376
- }; }
3377
- };
3378
- PosImage.style = PosImageStyle0;
3379
-
3380
- const PosInternalRouter = class {
3381
- constructor(hostRef) {
3382
- index.registerInstance(this, hostRef);
3383
- this.uri = 'pod-os:dashboard';
3384
- }
3385
- render() {
3386
- return this.uri === 'pod-os:settings' ? (index.h("pos-app-settings", null)) : (index.h("pos-app-dashboard", null));
3387
- }
3388
- };
3389
-
3390
- const PosLabel = class {
3391
- constructor(hostRef) {
3392
- index.registerInstance(this, hostRef);
3393
- this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
3394
- this.receiveResource = (resource) => {
3395
- this.resource = resource;
3396
- };
3397
- }
3398
- componentWillLoad() {
3399
- ResourceAware.subscribeResource(this);
3400
- }
3401
- render() {
3402
- return this.resource ? this.resource.label() : null;
3403
- }
3404
- };
3405
-
3406
- const posLoginCss = ".container{display:flex;align-items:center;gap:var(--size-2)}.user-data{align-items:center;display:inline-flex;gap:10px}.user-data pos-picture{--width:40px;--height:40px;--border-radius:50%}pos-login-form{margin:var(--size-2)}dialog{margin-top:var(--size-10)}button#login,button#logout{outline:none;font-weight:var(--weight-bold);letter-spacing:var(--letter-xl);border:none;box-sizing:border-box;border-radius:var(--radius-xs);padding:var(--size-2);box-shadow:var(--shadow-sm);color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}button#login:focus-within,button#logout:focus-within{outline:var(--pos-input-focus-outline)}button#login:focus,button#login:hover,button#logout:focus,button#logout:hover{filter:brightness(110%);box-shadow:var(--shadow-md)}";
3407
- const PosLoginStyle0 = posLoginCss;
3408
-
3409
- const PosLogin = class {
3410
- constructor(hostRef) {
3411
- index.registerInstance(this, hostRef);
3412
- this.initializeOsEmitter = index.createEvent(this, "pod-os:init", 7);
3413
- this.setOs = async (os) => {
3414
- this.os = os;
3415
- };
3416
- }
3417
- componentWillLoad() {
3418
- this.initializeOsEmitter.emit(this.setOs);
3419
- }
3420
- login(event) {
3421
- const idpUrl = event.detail;
3422
- this.os.login(idpUrl);
3423
- }
3424
- logout() {
3425
- this.os.logout();
3426
- }
3427
- openDialog() {
3428
- this.dialog.showModal();
3429
- }
3430
- render() {
3431
- return (index.h(index.Host, { key: '6349e0939fb22cddc9a6e47d424ce2badd518dcd' }, index.h("div", { key: '940d720ae5a7b951fe4a1bf411e463add43d93d0', class: "container" }, BrokenFile.store.state.isLoggedIn ? (index.h("pos-resource", { uri: BrokenFile.store.state.webId }, index.h("span", { class: "user-data" }, index.h("pos-picture", null), index.h("pos-label", null)))) : (''), !BrokenFile.store.state.isLoggedIn && (index.h("button", { key: '40aeea2f9686c9792c3952f8b899f9e819895bae', id: "login", onClick: () => this.openDialog() }, "Login")), BrokenFile.store.state.isLoggedIn && (index.h("button", { key: 'dd8129f4ae6b590231c33d072f4094b7bfc99da5', id: "logout", onClick: () => this.logout() }, "Logout"))), index.h("pos-dialog", { key: '33278d394f830f5c6040c3c22dc720440dd9d75c', ref: el => (this.dialog = el) }, index.h("span", { key: '96d3c645cacb1b38bd9adca8562ae4068eeabe11', slot: "title" }, "Sign in to your Pod"), index.h("pos-login-form", { key: '0c296b68774e4e2c1ed6091c305348b36e80178f', "onPod-os:idp-url-selected": ev => this.login(ev), slot: "content" }))));
3432
- }
3433
- };
3434
- PosLogin.style = PosLoginStyle0;
3435
-
3436
- const posLoginFormCss = ":host{display:block;margin:0}form{display:flex;flex-direction:column;gap:var(--size-4)}input{outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within{outline:var(--pos-input-focus-outline)}input#login{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#login:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#login:hover:not(:disabled),input#login:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";
3437
- const PosLoginFormStyle0 = posLoginFormCss;
3438
-
3439
- const PosLoginForm = class {
3440
- constructor(hostRef) {
3441
- index.registerInstance(this, hostRef);
3442
- this.idpUrlSelected = index.createEvent(this, "pod-os:idp-url-selected", 7);
3443
- this.idpUrl = '';
3444
- this.canSubmit = false;
3445
- }
3446
- validate() {
3447
- this.canSubmit = Boolean(this.idpUrl);
3448
- }
3449
- render() {
3450
- return (index.h("form", { key: '193d3790329d1480fd6b14fd55a0d8cee8ce61dd', method: "dialog", onSubmit: () => this.handleSubmit() }, index.h("label", { key: 'd85ea6b508c9f229e1125f8cc97092335458b94a', htmlFor: "idpUrl" }, "Please enter your Identity Provider"), index.h("input", { key: 'a2f5e9955b27a8c1fab14c8f087fab167a19dc9a', id: "idpUrl", type: "url", value: this.idpUrl, required: true, onInput: e => this.handleChange(e), list: "suggestedIssuers", placeholder: "Type to search..." }), index.h("datalist", { key: 'fa0924b31e1a4fcdc794931dd2073022ab4ce95b', id: "suggestedIssuers" }, index.h("option", { key: 'c3495be7c2a98494ac3ca7fe504edd4b1b232394', value: "https://solidcommunity.net" }, "solidcommunity.net"), index.h("option", { key: '7fd17434388ed31468df8682dcfc2b4263c27ccb', value: "https://solidweb.org" }, "solidweb.org"), index.h("option", { key: '4c2a5854fc2499198b289181136cbd0a2fd9c1e1', value: "https://solidweb.me" }, "solidweb.me"), index.h("option", { key: '02a81104db23c62e0d42b8b45b95eccbd16fc108', value: "https://inrupt.net" }, "inrupt.net"), index.h("option", { key: 'd7c15dca86800cafc5a974920e40bd117fa50194', value: "https://login.inrupt.com" }, "Inrupt PodSpaces"), index.h("option", { key: '93ff71136f1775098fda80db5d437f37b51c496f', value: "https://trinpod.us" }, "trinpod.us"), index.h("option", { key: '481f1630526e324cb24b38c0077b1aeb496b4690', value: "https://use.id" }, "use.id"), index.h("option", { key: 'abd85ffba7532ba488bf0a4c18a2da2f3dc481ee', value: "https://solid.redpencil.io" }, "redpencil.io"), index.h("option", { key: '339562d277c4af2e10344f385d00aa4cc37375fa', value: "https://datapod.grant.io" }, "Data Pod (grant.io)"), index.h("option", { key: '918224ac5af806666a7b77bc8049dcf79800ab8c', value: "https://teamid.live" }, "teamid.live")), index.h("input", { key: '1ad3ef7998237d30c5eaf5bc9eebe55ede09d0a8', id: "login", type: "submit", value: "Login", disabled: !this.canSubmit })));
3451
- }
3452
- handleChange(event) {
3453
- this.validate();
3454
- this.idpUrl = event.target.value;
3455
- }
3456
- async handleSubmit() {
3457
- this.idpUrlSelected.emit(this.idpUrl);
3458
- }
3459
- static get delegatesFocus() { return true; }
3460
- static get watchers() { return {
3461
- "idpUrl": ["validate"]
3462
- }; }
3463
- };
3464
- PosLoginForm.style = PosLoginFormStyle0;
3465
-
3466
- const posMakeFindableCss = "button.main {\n display: flex;\n transition:\n width 200ms,\n background-color 500ms,\n color 500ms,\n border-color 500ms;\n max-width: var(--size-40);\n flex-direction: row;\n overflow: hidden;\n height: var(--size-8);\n width: var(--size-8);\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-xs);\n color: var(--pos-subtle-text-color);\n border: var(--size-px) dashed var(--pos-subtle-text-color);\n background-color: var(--pos-background-color);\n\n p {\n padding: 0;\n margin: 0;\n display: none;\n white-space: nowrap;\n }\n\n &.success {\n color: var(--color-green-700);\n border-color: var(--color-green-700);\n border-style: solid;\n background-color: var(--color-green-100);\n }\n\n &:active {\n transform: scale(0.99);\n filter: brightness(90%);\n }\n}\n\n.options {\n position: absolute;\n animation: fadeIn 300ms;\n padding: 0;\n margin-top: var(--size-1);\n z-index: var(--layer-top);\n\n ol {\n display: flex;\n flex-direction: column;\n box-shadow: var(--shadow-md);\n backdrop-filter: var(--blur-md);\n border-radius: var(--radius-xs);\n overflow: hidden;\n color: var(--color-grey-900);\n background-color: var(--color-grey-200);\n padding: 0;\n margin: 0;\n list-style: none;\n label {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n transition: all 300ms var(--ease-in-out-sine);\n margin: 0;\n border: none;\n outline: none;\n padding: var(--size-2);\n width: var(--size-full);\n\n &:hover,\n &:focus {\n filter: brightness(80%);\n }\n\n &:active {\n filter: brightness(90%);\n }\n }\n }\n label:has(input:checked) {\n background-color: var(--color-green-100);\n }\n}\n\nsvg {\n display: inline-block;\n height: var(--size-6);\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--size-6);\n}\n\nbutton.main:hover,\nbutton.open {\n &.success {\n background: var(--color-green-200);\n }\n width: var(--size-full);\n height: var(--size-8);\n background: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n\n p {\n display: inline-block;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n";
3467
- const PosMakeFindableStyle0 = posMakeFindableCss;
3468
-
3469
- const PosMakeFindable = class {
3470
- constructor(hostRef) {
3471
- index.registerInstance(this, hostRef);
3472
- this.subscribePodOs = index.createEvent(this, "pod-os:init", 7);
3473
- this.errorEmitter = index.createEvent(this, "pod-os:error", 7);
3474
- this.indexUpdatedEmitter = index.createEvent(this, "pod-os:search:index-updated", 7);
3475
- this.indexCreatedEmitter = index.createEvent(this, "pod-os:search:index-created", 7);
3476
- this.indexes = [];
3477
- this.showOptions = false;
3478
- this.isIndexed = false;
3479
- this.receivePodOs = async (os) => {
3480
- this.os = os;
3481
- this.thing = this.os.store.get(this.uri);
3482
- this.getLabelIndexes(BrokenFile.store.state.profile);
3483
- this.unsubscribeSessionChange = BrokenFile.store.onChange('profile', profile => {
3484
- this.getLabelIndexes(profile);
3485
- });
3486
- };
3487
- }
3488
- componentWillLoad() {
3489
- PodOsAware.subscribePodOs(this);
3490
- }
3491
- disconnectedCallback() {
3492
- this.unsubscribeSessionChange && this.unsubscribeSessionChange();
3493
- }
3494
- hideOptions(event) {
3495
- // @ts-ignore
3496
- if (!this.el.contains(event.target)) {
3497
- this.showOptions = false;
3498
- }
3499
- }
3500
- handleKeyDown(ev) {
3501
- if (ev.key === 'Escape') {
3502
- this.showOptions = false;
3503
- }
3504
- }
3505
- updateUri(uri) {
3506
- this.thing = this.os.store.get(uri);
3507
- this.isIndexed = this.checkIfIndexed(uri);
3508
- }
3509
- checkIfIndexed(uri) {
3510
- return this.indexes.some(it => it.contains(uri));
3511
- }
3512
- getLabelIndexes(profile) {
3513
- if (profile) {
3514
- this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(index$6.LabelIndex));
3515
- this.isIndexed = this.checkIfIndexed(this.uri);
3516
- }
3517
- }
3518
- async onClick(e) {
3519
- e.preventDefault();
3520
- if (this.indexes.length === 1) {
3521
- const index = this.indexes[0];
3522
- await this.addToLabelIndex(index);
3523
- this.indexUpdatedEmitter.emit(index);
3524
- }
3525
- else if (this.indexes.length > 1) {
3526
- this.showOptions = !this.showOptions;
3527
- }
3528
- else {
3529
- const index = await this.createDefaultLabelIndex();
3530
- await this.addToLabelIndex(index);
3531
- this.indexCreatedEmitter.emit(index);
3532
- }
3533
- }
3534
- async addToLabelIndex(index) {
3535
- try {
3536
- await this.os.addToLabelIndex(this.thing, index);
3537
- this.isIndexed = true;
3538
- }
3539
- catch (e) {
3540
- this.errorEmitter.emit(e);
3541
- }
3542
- this.showOptions = false;
3543
- }
3544
- async createDefaultLabelIndex() {
3545
- try {
3546
- return await this.os.createDefaultLabelIndex(BrokenFile.store.state.profile);
3547
- }
3548
- catch (e) {
3549
- this.errorEmitter.emit(e);
3550
- }
3551
- }
3552
- render() {
3553
- if (!BrokenFile.store.state.isLoggedIn || !this.uri) {
3554
- return null;
3555
- }
3556
- const label = 'Make this findable';
3557
- return (index.h(index.Host, null, index.h("button", { type: "button", "aria-label": label, class: { main: true, open: this.showOptions, success: this.isIndexed }, onClick: e => this.onClick(e), title: "" }, this.isIndexed ? index.h(IconSuccess, null) : index.h(IconMakeFindable, null), index.h("p", null, label)), this.showOptions && (index.h("div", { class: "options" }, index.h("ol", { role: "listbox" }, this.indexes.map((index$1) => (index.h("li", { role: "option" }, index.h("label", null, index.h("input", { type: "checkbox", checked: index$1.contains(this.uri), onChange: e => this.chooseOption(e, index$1) }), index.h("pos-resource", { uri: index$1.uri, lazy: true }, index.h("pos-label", null)))))))))));
3558
- }
3559
- async chooseOption(e, index) {
3560
- e.preventDefault();
3561
- await this.addToLabelIndex(index);
3562
- this.indexUpdatedEmitter.emit(index);
3563
- }
3564
- get el() { return index.getElement(this); }
3565
- static get watchers() { return {
3566
- "uri": ["updateUri"]
3567
- }; }
3568
- };
3569
- const IconMakeFindable = () => (index.h("svg", { role: "presentation", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z" })));
3570
- const IconSuccess = () => (index.h("svg", { role: "presentation", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12" })));
3571
- PosMakeFindable.style = PosMakeFindableStyle0;
3572
-
3573
- const posNavigationBarCss = ".suggestions ol {\n border: 1px solid var(--pos-border-color);\n display: flex;\n flex-direction: column;\n position: absolute;\n margin: 0;\n padding: 0;\n z-index: var(--layer-top);\n list-style-type: none;\n box-shadow: var(--shadow-xl);\n}\n\n.suggestions {\n position: relative;\n li {\n padding: 1rem;\n background-color: var(--pos-background-color);\n pos-rich-link {\n --background-color: inherit;\n }\n &.selected {\n background-color: var(--pos-primary-color);\n &:hover {\n background-color: var(--pos-primary-color);\n }\n }\n &:hover {\n background-color: var(--pos-border-color);\n }\n }\n}\n\n.suggestions li.selected pos-rich-link {\n --label-color: white;\n --description-color: var(--pos-border-color);\n --uri-color: var(--pos-subtle-text-color);\n}\n\nion-searchbar {\n width: 100%;\n}\n\nform {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.bar {\n flex-grow: 1;\n}\n";
3574
- const PosNavigationBarStyle0 = posNavigationBarCss;
3575
-
3576
- const PosNavigationBar = class {
3577
- constructor(hostRef) {
3578
- index.registerInstance(this, hostRef);
3579
- this.subscribePodOs = index.createEvent(this, "pod-os:init", 7);
3580
- this.linkEmitter = index.createEvent(this, "pod-os:link", 7);
3581
- this.uri = '';
3582
- this.value = this.uri;
3583
- this.searchIndex = undefined;
3584
- this.suggestions = [];
3585
- this.selectedIndex = -1;
3586
- this.receivePodOs = async (os) => {
3587
- this.os = os;
3588
- };
3589
- }
3590
- componentWillLoad() {
3591
- PodOsAware.subscribePodOs(this);
3592
- BrokenFile.store.onChange('isLoggedIn', async (isLoggedIn) => {
3593
- if (isLoggedIn) {
3594
- await this.buildSearchIndex();
3595
- }
3596
- else {
3597
- this.clearSearchIndex();
3598
- }
3599
- });
3600
- }
3601
- async buildSearchIndex() {
3602
- this.searchIndex = await this.os.buildSearchIndex(BrokenFile.store.state.profile);
3603
- }
3604
- rebuildSearchIndex() {
3605
- this.searchIndex.rebuild();
3606
- }
3607
- clearSearchIndex() {
3608
- var _a;
3609
- (_a = this.searchIndex) === null || _a === void 0 ? void 0 : _a.clear();
3610
- }
3611
- onChange(event) {
3612
- this.value = event.detail.value;
3613
- this.search();
3614
- }
3615
- clearSuggestions() {
3616
- this.suggestions = [];
3617
- this.selectedIndex = -1;
3618
- }
3619
- onClickSelf(event) {
3620
- event.stopPropagation();
3621
- }
3622
- handleKeyDown(ev) {
3623
- if (ev.key === 'Escape') {
3624
- this.clearSuggestions();
3625
- }
3626
- else if (ev.key === 'ArrowDown') {
3627
- ev.preventDefault();
3628
- this.selectedIndex = Math.min(this.selectedIndex + 1, this.suggestions.length - 1);
3629
- }
3630
- else if (ev.key === 'ArrowUp') {
3631
- ev.preventDefault();
3632
- this.selectedIndex = Math.max(this.selectedIndex - 1, 0);
3633
- }
3634
- }
3635
- search() {
3636
- if (this.searchIndex) {
3637
- this.suggestions = this.value ? this.searchIndex.search(this.value) : [];
3638
- }
3639
- }
3640
- onSubmit(event) {
3641
- event.preventDefault();
3642
- if (this.suggestions && this.selectedIndex > -1) {
3643
- this.linkEmitter.emit(this.suggestions[this.selectedIndex].ref);
3644
- }
3645
- else {
3646
- this.linkEmitter.emit(this.value);
3647
- }
3648
- }
3649
- render() {
3650
- return (index.h("form", { key: 'e92382c2024642ea5c0b5abb00f1759003f74c78', onSubmit: e => this.onSubmit(e) }, this.searchIndex && this.uri ? index.h("pos-make-findable", { uri: this.uri }) : '', index.h("div", { key: 'c32607860e8aa1fe6d6d182c0e2a056f40b6f1b7', class: "bar" }, index.h("ion-searchbar", { key: '6f281c307640200da6c57a0660e27901f55d375d', enterkeyhint: "search", placeholder: "Search or enter URI", value: this.uri, debounce: 300, onIonChange: e => this.onChange(e), onIonInput: e => this.onChange(e) }), this.suggestions.length > 0 ? (index.h("div", { class: "suggestions" }, index.h("ol", null, this.suggestions.map((it, index$1) => (index.h("li", { class: index$1 === this.selectedIndex ? 'selected' : '' }, index.h("pos-rich-link", { uri: it.ref }))))))) : null)));
3651
- }
3652
- };
3653
- PosNavigationBar.style = PosNavigationBarStyle0;
3654
-
3655
- const posNewThingFormCss = ":host{display:block}form{display:grid;grid-template-columns:var(--size-16) 1fr;grid-gap:var(--scale-0)}label{grid-column:1 / 2;display:flex;align-items:center;justify-content:flex-end}input,pos-select-term,button{grid-column:2 / 3}input,pos-select-term::part(input){outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within,pos-select-term::part(input):focus-within{outline:var(--pos-input-focus-outline)}#new-uri{grid-column:1/3;cursor:default;word-break:break-all;color:var(--pos-normal-text-color);font-weight:var(--weight-light);background:var(--pos-disabled-color);padding:var(--scale-000);border-radius:var(--radius-xs)}input#create{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#create:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#create:hover:not(:disabled),input#create:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";
3656
- const PosNewThingFormStyle0 = posNewThingFormCss;
3657
-
3658
- const PosNewThingForm = class {
3659
- constructor(hostRef) {
3660
- index.registerInstance(this, hostRef);
3661
- this.linkEmitter = index.createEvent(this, "pod-os:link", 7);
3662
- this.errorEmitter = index.createEvent(this, "pod-os:error", 7);
3663
- this.subscribePodOs = index.createEvent(this, "pod-os:init", 7);
3664
- this.canSubmit = false;
3665
- this.receivePodOs = async (os) => {
3666
- this.os = os;
3667
- };
3668
- }
3669
- validate() {
3670
- this.canSubmit = Boolean(this.name && this.selectedTypeUri);
3671
- }
3672
- componentWillLoad() {
3673
- PodOsAware.subscribePodOs(this);
3674
- }
3675
- render() {
3676
- return (index.h("form", { key: '9ee9d0ab4f31bfc55865ef697d410b37977b1051', method: "dialog", onSubmit: e => this.handleSubmit(e) }, index.h("label", { key: 'a6f807d2034d55e5218c01375c4ff36564924bfb', htmlFor: "type" }, "Type"), index.h("pos-select-term", { key: 'f6001d6801bee97c03121d57742a595c8d5d5bd7', id: "type", placeholder: "", value: this.selectedTypeUri, "onPod-os:term-selected": e => this.onTermSelected(e) }), index.h("label", { key: '9365561d47d72e0153bb743f4fdf5ca7a1b5dcc0', htmlFor: "name" }, "Name"), index.h("input", { key: 'c93de873370a1123441a33d27c53c954bcc5f5ce', id: "name", type: "text", value: this.name, onInput: e => this.handleChange(e) }), this.newUri ? (index.h("div", { id: "new-uri", title: "This will be the URI of the new thing" }, this.newUri)) : null, index.h("input", { key: '9fc1fb39f7c582a069876642cc17678303c7d72b', id: "create", type: "submit", value: "Create", disabled: !this.canSubmit })));
3677
- }
3678
- handleChange(event) {
3679
- this.name = event.target.value;
3680
- this.newUri = this.os.proposeUriForNewThing(this.referenceUri, this.name);
3681
- }
3682
- onTermSelected(event) {
3683
- this.selectedTypeUri = event.detail.uri;
3684
- }
3685
- async handleSubmit(event) {
3686
- try {
3687
- await this.os.addNewThing(this.newUri, this.name, this.selectedTypeUri);
3688
- this.linkEmitter.emit(this.newUri);
3689
- this.reset();
3690
- }
3691
- catch (error) {
3692
- event.preventDefault();
3693
- this.errorEmitter.emit(error);
3694
- }
3695
- }
3696
- reset() {
3697
- this.name = '';
3698
- this.newUri = '';
3699
- this.selectedTypeUri = '';
3700
- }
3701
- static get delegatesFocus() { return true; }
3702
- static get watchers() { return {
3703
- "name": ["validate"],
3704
- "selectedTypeUri": ["validate"]
3705
- }; }
3706
- };
3707
- PosNewThingForm.style = PosNewThingFormStyle0;
3708
-
3709
- const posPictureCss = ":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0);--object-fit:var(--object-fit, cover)}";
3710
- const PosPictureStyle0 = posPictureCss;
3711
-
3712
- const PosPicture = class {
3713
- constructor(hostRef) {
3714
- index.registerInstance(this, hostRef);
3715
- this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
3716
- /**
3717
- * Use a blurred version of the image as its own background, if the image is scaled down to fit into the container.
3718
- */
3719
- this.blurredBackground = false;
3720
- this.receiveResource = (resource) => {
3721
- this.resource = resource;
3722
- };
3723
- }
3724
- componentWillLoad() {
3725
- ResourceAware.subscribeResource(this);
3726
- }
3727
- render() {
3728
- const pic = this.resource ? this.resource.picture() : null;
3729
- if (!pic)
3730
- return null;
3731
- return index.h("pos-image", { blurredBackground: this.blurredBackground, src: pic.url, alt: this.resource.label() });
3732
- }
3733
- };
3734
- PosPicture.style = PosPictureStyle0;
3735
-
3736
- const posResourceCss = "details.error {\n margin: var(--size-2);\n background-color: var(--pos-error-background-color);\n border: var(--size-px) solid var(--pos-error-border-color);\n padding: var(--size-2);\n border-radius: var(--radius-md);\n\n a {\n color: var(--pos-normal-text-color);\n }\n}\n";
3737
- const PosResourceStyle0 = posResourceCss;
3738
-
3739
- const PosResource = class {
3740
- constructor(hostRef) {
3741
- index.registerInstance(this, hostRef);
3742
- this.subscribePodOs = index.createEvent(this, "pod-os:init", 7);
3743
- this.resourceLoadedEmitter = index.createEvent(this, "pod-os:resource-loaded", 7);
3744
- this.consumers = [];
3745
- this.lazy = false;
3746
- this.loading = true;
3747
- this.receivePodOs = async (os) => {
3748
- this.os = os;
3749
- };
3750
- }
3751
- componentWillLoad() {
3752
- BrokenFile.store.onChange('isLoggedIn', () => this.loadResource());
3753
- PodOsAware.subscribePodOs(this);
3754
- }
3755
- async provideResource(event) {
3756
- event.stopPropagation();
3757
- if (this.resource) {
3758
- event.detail(this.resource);
3759
- }
3760
- this.consumers.push(event);
3761
- }
3762
- async loadResource() {
3763
- await this.getResource(!this.lazy);
3764
- }
3765
- async fetch() {
3766
- await this.getResource(true);
3767
- }
3768
- async getResource(fetch = false) {
3769
- try {
3770
- if (fetch) {
3771
- this.loading = true;
3772
- await this.os.fetch(this.uri);
3773
- this.resourceLoadedEmitter.emit(this.uri);
3774
- }
3775
- this.resource = this.os.store.get(this.uri);
3776
- this.error = null;
3777
- this.consumers.forEach(consumer => {
3778
- consumer.detail(this.resource);
3779
- });
3780
- }
3781
- catch (err) {
3782
- this.error = err;
3783
- }
3784
- finally {
3785
- this.loading = false;
3786
- }
3787
- }
3788
- render() {
3789
- if (this.loading) {
3790
- return index.h("ion-progress-bar", { type: "indeterminate" });
3791
- }
3792
- if (this.error) {
3793
- return (index.h("details", { class: "error" }, index.h("summary", { title: "Click to expand" }, "\u26A0 Sorry, something went wrong"), index.h("p", null, "Status:",
3794
- // @ts-ignore
3795
- this.error.status), index.h("p", null, this.error.message), index.h("p", null, "You can try to open the link outside PodOS: ", index.h("a", { href: this.uri }, this.uri))));
3796
- }
3797
- return index.h("slot", null);
3798
- }
3799
- static get watchers() { return {
3800
- "os": ["loadResource"],
3801
- "uri": ["loadResource"]
3802
- }; }
3803
- };
3804
- PosResource.style = PosResourceStyle0;
3805
-
3806
- const posRichLinkCss = ":host {\n --background-color: inherit;\n --label-color: var(--pos-normal-text-color);\n --description-color: var(--pos-normal-text-color);\n --uri-color: var(--pos-subtle-text-color);\n --font-family: var(--font-sans);\n}\n\np.content {\n background-color: var(--background-color);\n line-height: var(--line-xs);\n margin: 0;\n display: flex;\n flex-direction: column;\n align-items: baseline;\n gap: var(--size-1);\n\n .url {\n font-size: var(--scale-fluid-1);\n color: var(--pos-subtle-text-color);\n }\n}\n\na {\n color: var(--label-color);\n max-width: var(--prose-lg);\n text-decoration: underline;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-decoration-thickness: var(--size-px);\n}\n\npos-label {\n color: var(--label-color);\n font-size: var(--scale-fluid-2);\n margin-bottom: var(--size-1);\n}\n\npos-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: var(--weight-light);\n color: var(--description-color);\n font-size: var(--scale-fluid-2);\n}\n\n@media (min-width: 640px) {\n pos-label {\n font-size: var(--scale-fluid-0);\n }\n pos-description {\n font-size: var(--scale-fluid-1);\n }\n\n p.content {\n .url {\n font-size: var(--scale-fluid-000);\n }\n }\n}\n";
3807
- const PosRichLinkStyle0 = posRichLinkCss;
3808
-
3809
- const PosRichLink = class {
3810
- constructor(hostRef) {
3811
- index.registerInstance(this, hostRef);
3812
- this.linkEmitter = index.createEvent(this, "pod-os:link", 7);
3813
- }
3814
- render() {
3815
- return (index.h("pos-resource", { key: '0a794cc8287b13f163a813dc6a4f87b2f00e028b', lazy: true, uri: this.uri }, index.h("p", { key: 'b7a44482a82cd69228f144b04e9ec20b84410339', class: "content" }, index.h("a", { key: '0d218d4d5c1991c767b66f0d37c5476038e7a0fb', href: this.uri, onClick: e => {
3816
- e.preventDefault();
3817
- this.linkEmitter.emit(this.uri);
3818
- } }, index.h("pos-label", { key: 'd04048986a7a4da138608f187a2f27e6313d9a6e' })), index.h("span", { key: '53a05023aa2fec4725e1d7e59acee9888476ecac', class: "url" }, new URL(this.uri).host), index.h("pos-description", { key: 'a73de2d208b684a9f555cda312e94df4282afba0' }))));
3819
- }
3820
- };
3821
- PosRichLink.style = PosRichLinkStyle0;
3822
-
3823
- const appendToMap = (map, propName, value) => {
3824
- const items = map.get(propName);
3825
- if (!items) {
3826
- map.set(propName, [value]);
3827
- }
3828
- else if (!items.includes(value)) {
3829
- items.push(value);
3830
- }
3831
- };
3832
- const debounce = (fn, ms) => {
3833
- let timeoutId;
3834
- return (...args) => {
3835
- if (timeoutId) {
3836
- clearTimeout(timeoutId);
3837
- }
3838
- timeoutId = setTimeout(() => {
3839
- timeoutId = 0;
3840
- fn(...args);
3841
- }, ms);
3842
- };
3843
- };
3844
-
3845
- /**
3846
- * Check if a possible element isConnected.
3847
- * The property might not be there, so we check for it.
3848
- *
3849
- * We want it to return true if isConnected is not a property,
3850
- * otherwise we would remove these elements and would not update.
3851
- *
3852
- * Better leak in Edge than to be useless.
3853
- */
3854
- const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
3855
- const cleanupElements = debounce((map) => {
3856
- for (let key of map.keys()) {
3857
- map.set(key, map.get(key).filter(isConnected));
3858
- }
3859
- }, 2000);
3860
- const stencilSubscription = () => {
3861
- if (typeof index.getRenderingRef !== 'function') {
3862
- // If we are not in a stencil project, we do nothing.
3863
- // This function is not really exported by @stencil/core.
3864
- return {};
3865
- }
3866
- const elmsToUpdate = new Map();
3867
- return {
3868
- dispose: () => elmsToUpdate.clear(),
3869
- get: (propName) => {
3870
- const elm = index.getRenderingRef();
3871
- if (elm) {
3872
- appendToMap(elmsToUpdate, propName, elm);
3873
- }
3874
- },
3875
- set: (propName) => {
3876
- const elements = elmsToUpdate.get(propName);
3877
- if (elements) {
3878
- elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
3879
- }
3880
- cleanupElements(elmsToUpdate);
3881
- },
3882
- reset: () => {
3883
- elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
3884
- cleanupElements(elmsToUpdate);
3885
- },
3886
- };
3887
- };
3888
-
3889
- const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
3890
- let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
3891
- const handlers = {
3892
- dispose: [],
3893
- get: [],
3894
- set: [],
3895
- reset: [],
3896
- };
3897
- const reset = () => {
3898
- states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
3899
- handlers.reset.forEach((cb) => cb());
3900
- };
3901
- const dispose = () => {
3902
- // Call first dispose as resetting the state would
3903
- // cause less updates ;)
3904
- handlers.dispose.forEach((cb) => cb());
3905
- reset();
3906
- };
3907
- const get = (propName) => {
3908
- handlers.get.forEach((cb) => cb(propName));
3909
- return states.get(propName);
3910
- };
3911
- const set = (propName, value) => {
3912
- const oldValue = states.get(propName);
3913
- if (shouldUpdate(value, oldValue, propName)) {
3914
- states.set(propName, value);
3915
- handlers.set.forEach((cb) => cb(propName, value, oldValue));
3916
- }
3917
- };
3918
- const state = (typeof Proxy === 'undefined'
3919
- ? {}
3920
- : new Proxy(defaultState, {
3921
- get(_, propName) {
3922
- return get(propName);
3923
- },
3924
- ownKeys(_) {
3925
- return Array.from(states.keys());
3926
- },
3927
- getOwnPropertyDescriptor() {
3928
- return {
3929
- enumerable: true,
3930
- configurable: true,
3931
- };
3932
- },
3933
- has(_, propName) {
3934
- return states.has(propName);
3935
- },
3936
- set(_, propName, value) {
3937
- set(propName, value);
3938
- return true;
3939
- },
3940
- }));
3941
- const on = (eventName, callback) => {
3942
- handlers[eventName].push(callback);
3943
- return () => {
3944
- removeFromArray(handlers[eventName], callback);
3945
- };
3946
- };
3947
- const onChange = (propName, cb) => {
3948
- const unSet = on('set', (key, newValue) => {
3949
- if (key === propName) {
3950
- cb(newValue);
3951
- }
3952
- });
3953
- const unReset = on('reset', () => cb(defaultState[propName]));
3954
- return () => {
3955
- unSet();
3956
- unReset();
3957
- };
3958
- };
3959
- const use = (...subscriptions) => {
3960
- const unsubs = subscriptions.reduce((unsubs, subscription) => {
3961
- if (subscription.set) {
3962
- unsubs.push(on('set', subscription.set));
3963
- }
3964
- if (subscription.get) {
3965
- unsubs.push(on('get', subscription.get));
3966
- }
3967
- if (subscription.reset) {
3968
- unsubs.push(on('reset', subscription.reset));
3969
- }
3970
- if (subscription.dispose) {
3971
- unsubs.push(on('dispose', subscription.dispose));
3972
- }
3973
- return unsubs;
3974
- }, []);
3975
- return () => unsubs.forEach((unsub) => unsub());
3976
- };
3977
- const forceUpdate = (key) => {
3978
- const oldValue = states.get(key);
3979
- handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
3980
- };
3981
- return {
3982
- state,
3983
- get,
3984
- set,
3985
- on,
3986
- onChange,
3987
- use,
3988
- dispose,
3989
- reset,
3990
- forceUpdate,
3991
- };
3992
- };
3993
- const removeFromArray = (array, item) => {
3994
- const index = array.indexOf(item);
3995
- if (index >= 0) {
3996
- array[index] = array[array.length - 1];
3997
- array.length--;
3998
- }
3999
- };
4000
-
4001
- const createStore = (defaultState, shouldUpdate) => {
4002
- const map = createObservableMap(defaultState, shouldUpdate);
4003
- map.use(stencilSubscription());
4004
- return map;
4005
- };
4006
-
4007
- const createRouter = (opts) => {
4008
- var _a;
4009
- const win = window;
4010
- const url = new URL(win.location.href);
4011
- const parseURL = (_a = opts === null || opts === void 0 ? void 0 : opts.parseURL) !== null && _a !== void 0 ? _a : DEFAULT_PARSE_URL;
4012
- const { state, onChange, dispose } = createStore({
4013
- url,
4014
- activePath: parseURL(url)
4015
- }, (newV, oldV, prop) => {
4016
- if (prop === 'url') {
4017
- return newV.href !== oldV.href;
4018
- }
4019
- return newV !== oldV;
4020
- });
4021
- const push = (href) => {
4022
- history.pushState(null, null, href);
4023
- const url = new URL(href, document.baseURI);
4024
- state.url = url;
4025
- state.activePath = parseURL(url);
4026
- };
4027
- const match = (routes) => {
4028
- const { activePath } = state;
4029
- for (let route of routes) {
4030
- const params = matchPath(activePath, route.path);
4031
- if (params) {
4032
- if (route.to != null) {
4033
- const to = (typeof route.to === 'string')
4034
- ? route.to
4035
- : route.to(activePath);
4036
- push(to);
4037
- return match(routes);
4038
- }
4039
- else {
4040
- return { params, route };
4041
- }
4042
- }
4043
- }
4044
- return undefined;
4045
- };
4046
- const navigationChanged = () => {
4047
- const url = new URL(win.location.href);
4048
- state.url = url;
4049
- state.activePath = parseURL(url);
4050
- };
4051
- const Switch = (_, childrenRoutes) => {
4052
- const result = match(childrenRoutes);
4053
- if (result) {
4054
- if (typeof result.route.jsx === 'function') {
4055
- return result.route.jsx(result.params);
4056
- }
4057
- else {
4058
- return result.route.jsx;
4059
- }
4060
- }
4061
- };
4062
- const disposeRouter = () => {
4063
- win.removeEventListener('popstate', navigationChanged);
4064
- dispose();
4065
- };
4066
- const router = {
4067
- Switch,
4068
- get url() {
4069
- return state.url;
4070
- },
4071
- get activePath() {
4072
- return state.activePath;
4073
- },
4074
- push,
4075
- onChange: onChange,
4076
- dispose: disposeRouter,
4077
- };
4078
- // Initial update
4079
- navigationChanged();
4080
- // Listen URL changes
4081
- win.addEventListener('popstate', navigationChanged);
4082
- return router;
4083
- };
4084
- const matchPath = (pathname, path) => {
4085
- if (typeof path === 'string') {
4086
- if (path === pathname) {
4087
- return {};
4088
- }
4089
- }
4090
- else if (typeof path === 'function') {
4091
- const params = path(pathname);
4092
- if (params) {
4093
- return params === true
4094
- ? {}
4095
- : { ...params };
4096
- }
4097
- }
4098
- else {
4099
- const results = path.exec(pathname);
4100
- if (results) {
4101
- path.lastIndex = 0;
4102
- return { ...results };
4103
- }
4104
- }
4105
- return undefined;
4106
- };
4107
- const DEFAULT_PARSE_URL = (url) => {
4108
- return url.pathname.toLowerCase();
4109
- };
4110
-
4111
- const posRouterCss = ".toolbar{display:flex;flex-direction:row;gap:0;align-items:center;margin-left:0.5rem}pos-navigation-bar{flex-grow:1}";
4112
- const PosRouterStyle0 = posRouterCss;
4113
-
4114
- const Router = createRouter();
4115
- const PosRouter = class {
4116
- constructor(hostRef) {
4117
- index.registerInstance(this, hostRef);
4118
- this.routeChanged = index.createEvent(this, "pod-os:route-changed", 7);
4119
- /**
4120
- * The mode defines what default URI will be used, if no URI param is given
4121
- *
4122
- * - standalone: reroute to pod-os:dashboard
4123
- * - pod: reroute to the URI that is shown in the actual browser
4124
- */
4125
- this.mode = 'standalone';
4126
- }
4127
- linkClicked(e) {
4128
- this.navigate(e.detail);
4129
- }
4130
- sessionRestored(e) {
4131
- Router.push(e.detail.url);
4132
- }
4133
- componentWillLoad() {
4134
- this.updateUri();
4135
- Router.onChange('url', () => {
4136
- this.updateUri();
4137
- });
4138
- }
4139
- navigate(uri) {
4140
- Router.push('?uri=' + encodeURIComponent(uri));
4141
- }
4142
- updateUri() {
4143
- this.uri =
4144
- new URLSearchParams(window.location.search).get('uri') ||
4145
- (this.mode === 'standalone' ? 'pod-os:dashboard' : window.location.href);
4146
- this.routeChanged.emit(this.uri);
4147
- }
4148
- render() {
4149
- return index.h("slot", { key: '221db70a52ce7ebc7e9c171142dcf94f252fa985' });
4150
- }
4151
- };
4152
- PosRouter.style = PosRouterStyle0;
4153
-
4154
- const posSelectTermCss = ":host{display:block}input{background-color:transparent;color:var(--pos-normal-text-color);border:none;padding-top:1rem;padding-bottom:1rem}input:focus{outline:none}";
4155
- const PosSelectTermStyle0 = posSelectTermCss;
4156
-
4157
- const PosSelectTerm = class {
4158
- constructor(hostRef) {
4159
- index.registerInstance(this, hostRef);
4160
- this.subscribePodOs = index.createEvent(this, "pod-os:init", 7);
4161
- this.termSelected = index.createEvent(this, "pod-os:term-selected", 7);
4162
- this.placeholder = 'Type to search...';
4163
- this.value = '';
4164
- this.terms = [];
4165
- this.receivePodOs = async (os) => {
4166
- this.os = os;
4167
- };
4168
- }
4169
- componentWillLoad() {
4170
- PodOsAware.subscribePodOs(this);
4171
- }
4172
- setTerms() {
4173
- this.terms = this.os.listKnownTerms();
4174
- }
4175
- handleChange(event) {
4176
- this.termSelected.emit({ uri: event.target.value });
4177
- }
4178
- render() {
4179
- return (index.h(index.Host, { key: '7a548735e2a0478fa1e63e2a880ca61f0f43d91c' }, index.h("input", { key: '9549691026f4bf42a3048f2af3a78bd71536b160', part: "input", list: "terms", placeholder: this.placeholder, value: this.value, onChange: ev => this.handleChange(ev) }), index.h("datalist", { key: 'adfd77a001389d6cc092e3b054ef12e45d562d54', part: "terms", id: "terms" }, this.terms.map(term => (index.h("option", { value: term.uri }, term.shorthand))))));
4180
- }
4181
- static get delegatesFocus() { return true; }
4182
- static get watchers() { return {
4183
- "os": ["setTerms"]
4184
- }; }
4185
- };
4186
- PosSelectTerm.style = PosSelectTermStyle0;
4187
-
4188
- const posSettingOfflineCacheCss = ":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}svg{width:var(--size-8)}h2{display:flex;align-items:center}p{padding:var(--size-2)}.info{color:var(--color-grey-900);background-color:var(--color-blue-200)}.warn{color:var(--color-grey-900);background-color:var(--color-yellow-200)}";
4189
- const PosSettingOfflineCacheStyle0 = posSettingOfflineCacheCss;
4190
-
4191
- const PosSettingOfflineCache = class {
4192
- constructor(hostRef) {
4193
- index.registerInstance(this, hostRef);
4194
- }
4195
- render() {
4196
- return (index.h(index.Host, { key: 'f024e7d542cfc87a4dc0a1f22694b664086ebd60' }, index.h("div", { key: 'e88e694cefa4a2361ca8c67f1bd023fda1b70f2a' }, index.h("h2", { key: 'c4b2e6270f26a2eb7f62e5076b40834903fc10e4' }, index.h("svg", { key: 'd63643c1ed908c6fe9ab4ff6c47b13848c714c32', xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, index.h("path", { key: '78f055556bb175ea17d0db1ccf78c16343d67d3f', "stroke-linecap": "round", "stroke-linejoin": "round", d: "M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125" })), "Cache Settings"), index.h("p", { key: '3045ae3214b9e91feb34857ce45a3db6529f2959', class: "info" }, "\u2139 Enable offline cache to be able to access previously loaded data while offline."), index.h("p", { key: '9987c1cb59b62e1eb06c67a9c646a9a2f125529a', class: "warn" }, "\u26A0 Private data may be stored on this device. Only enable it, if you trust this device."), index.h("label", { key: '55dd3c0fa7ece9a59437e7818d6cfa9b0e9eb5bf' }, index.h("input", { key: '22874f8a39b5016b71818fa1d6226bf66ff969c3', type: "checkbox", checked: localSettings.state.offlineCache, onChange: ev => (localSettings.state.offlineCache = ev.target.checked) }), "Enable offline cache"))));
4197
- }
4198
- };
4199
- PosSettingOfflineCache.style = PosSettingOfflineCacheStyle0;
4200
-
4201
- var AvailableApps;
4202
- (function (AvailableApps) {
4203
- AvailableApps["Generic"] = "pos-app-generic";
4204
- AvailableApps["RdfDocument"] = "pos-app-rdf-document";
4205
- AvailableApps["DocumentViewer"] = "pos-app-document-viewer";
4206
- AvailableApps["ImageViewer"] = "pos-app-image-viewer";
4207
- AvailableApps["LdpContainer"] = "pos-app-ldp-container";
4208
- })(AvailableApps || (AvailableApps = {}));
4209
- // TODO: remove duplication with pos-container-contents/selectIconForTypes
4210
- function containsType(types, typeUri) {
4211
- return types.some(type => type.uri === typeUri);
4212
- }
4213
- function selectAppForTypes(types) {
4214
- if (containsType(types, 'http://www.w3.org/ns/ldp#Container')) {
4215
- return AvailableApps.LdpContainer;
4216
- }
4217
- else if (containsType(types, 'http://www.w3.org/2007/ont/link#RDFDocument')) {
4218
- return AvailableApps.RdfDocument;
4219
- }
4220
- else if (containsType(types, 'http://www.w3.org/ns/iana/media-types/application/pdf#Resource')) {
4221
- return AvailableApps.DocumentViewer;
4222
- }
4223
- else if (containsType(types, 'http://purl.org/dc/terms/Image')) {
4224
- return AvailableApps.ImageViewer;
4225
- }
4226
- else if (containsType(types, 'http://www.w3.org/2007/ont/link#Document')) {
4227
- return AvailableApps.DocumentViewer;
4228
- }
4229
- else {
4230
- return AvailableApps.Generic;
4231
- }
4232
- }
4233
-
4234
- const PosTypeRouter = class {
4235
- constructor(hostRef) {
4236
- index.registerInstance(this, hostRef);
4237
- this.subscribeResource = index.createEvent(this, "pod-os:resource", 7);
4238
- this.receiveResource = (resource) => {
4239
- this.types = resource.types();
4240
- };
4241
- }
4242
- componentWillLoad() {
4243
- ResourceAware.subscribeResource(this);
4244
- }
4245
- render() {
4246
- return this.types ? this.renderApp() : null;
4247
- }
4248
- renderApp() {
4249
- const App = selectAppForTypes(this.types);
4250
- return index.h(App, null);
4251
- }
4252
- };
4253
-
4254
- exports.ion_icon = Icon;
4255
- exports.ion_progress_bar = ProgressBar;
4256
- exports.ion_ripple_effect = RippleEffect;
4257
- exports.ion_searchbar = Searchbar;
4258
- exports.ion_skeleton_text = SkeletonText;
4259
- exports.ion_toast = Toast;
4260
- exports.pos_add_new_thing = PosAddNewThing;
4261
- exports.pos_app = PosApp;
4262
- exports.pos_app_browser = PosAppBrowser;
4263
- exports.pos_app_dashboard = PosAppDashboard;
4264
- exports.pos_app_settings = PosAppSettings;
4265
- exports.pos_description = PosDescription;
4266
- exports.pos_dialog = PosDialog;
4267
- exports.pos_error_toast = PosErrorToast;
4268
- exports.pos_example_resources = PosExampleResources;
4269
- exports.pos_getting_started = PosGettingStarted;
4270
- exports.pos_image = PosImage;
4271
- exports.pos_internal_router = PosInternalRouter;
4272
- exports.pos_label = PosLabel;
4273
- exports.pos_login = PosLogin;
4274
- exports.pos_login_form = PosLoginForm;
4275
- exports.pos_make_findable = PosMakeFindable;
4276
- exports.pos_navigation_bar = PosNavigationBar;
4277
- exports.pos_new_thing_form = PosNewThingForm;
4278
- exports.pos_picture = PosPicture;
4279
- exports.pos_resource = PosResource;
4280
- exports.pos_rich_link = PosRichLink;
4281
- exports.pos_router = PosRouter;
4282
- exports.pos_select_term = PosSelectTerm;
4283
- exports.pos_setting_offline_cache = PosSettingOfflineCache;
4284
- exports.pos_type_router = PosTypeRouter;
4285
-
4286
- //# sourceMappingURL=ion-icon_31.cjs.entry.js.map