proto-ikon-loader-wc 0.0.377 → 0.0.379

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 (388) hide show
  1. package/dist/cjs/acura-ikon.cjs.entry.js +1 -1
  2. package/dist/cjs/alfa-romeo-alt-ikon.cjs.entry.js +1 -1
  3. package/dist/cjs/alfa-romeo-ikon.cjs.entry.js +1 -1
  4. package/dist/cjs/alien-icon.cjs.entry.js +1 -1
  5. package/dist/cjs/am-general-ikon.cjs.entry.js +1 -1
  6. package/dist/cjs/asterisk-icon.cjs.entry.js +1 -1
  7. package/dist/cjs/aston-martin-alt-ikon.cjs.entry.js +1 -1
  8. package/dist/cjs/aston-martin-ikon.cjs.entry.js +1 -1
  9. package/dist/cjs/audi-ikon.cjs.entry.js +1 -1
  10. package/dist/cjs/barcode-icon.cjs.entry.js +1 -1
  11. package/dist/cjs/barcode-scan-icon.cjs.entry.js +1 -1
  12. package/dist/cjs/bash-icon.cjs.entry.js +1 -1
  13. package/dist/cjs/beaker-icon.cjs.entry.js +1 -1
  14. package/dist/cjs/bently-ikon.cjs.entry.js +1 -1
  15. package/dist/cjs/bmw-ikon.cjs.entry.js +1 -1
  16. package/dist/cjs/bugatti-ikon.cjs.entry.js +1 -1
  17. package/dist/cjs/buick-ikon.cjs.entry.js +1 -1
  18. package/dist/cjs/cadillac-ikon.cjs.entry.js +1 -1
  19. package/dist/cjs/chart-bar-icon.cjs.entry.js +1 -1
  20. package/dist/cjs/chart-bubble-icon.cjs.entry.js +1 -1
  21. package/dist/cjs/chart-donut-icon.cjs.entry.js +1 -1
  22. package/dist/cjs/chart-donuts-icon.cjs.entry.js +1 -1
  23. package/dist/cjs/check-icon.cjs.entry.js +1 -1
  24. package/dist/cjs/chevrolet-ikon.cjs.entry.js +1 -1
  25. package/dist/cjs/chevron-double-left-icon.cjs.entry.js +1 -1
  26. package/dist/cjs/chrysler-ikon.cjs.entry.js +1 -1
  27. package/dist/cjs/circular-saw-icon.cjs.entry.js +1 -1
  28. package/dist/cjs/citroen-ikon.cjs.entry.js +1 -1
  29. package/dist/cjs/close-icon.cjs.entry.js +1 -1
  30. package/dist/cjs/daewoo-ikon.cjs.entry.js +1 -1
  31. package/dist/cjs/dodge-ikon.cjs.entry.js +1 -1
  32. package/dist/cjs/eagle-ikon.cjs.entry.js +1 -1
  33. package/dist/cjs/ferrari-ikon.cjs.entry.js +1 -1
  34. package/dist/cjs/fiat-alt-ikon.cjs.entry.js +1 -1
  35. package/dist/cjs/fiat-ikon.cjs.entry.js +1 -1
  36. package/dist/cjs/fingerprint-icon.cjs.entry.js +1 -1
  37. package/dist/cjs/fire-icon.cjs.entry.js +1 -1
  38. package/dist/cjs/fisker-ikon.cjs.entry.js +1 -1
  39. package/dist/cjs/flask-icon.cjs.entry.js +1 -1
  40. package/dist/cjs/ford-ikon.cjs.entry.js +1 -1
  41. package/dist/cjs/genesis-ikon.cjs.entry.js +1 -1
  42. package/dist/cjs/geo-ikon.cjs.entry.js +1 -1
  43. package/dist/cjs/git-icon.cjs.entry.js +1 -1
  44. package/dist/cjs/gmc-ikon.cjs.entry.js +1 -1
  45. package/dist/cjs/honda-ikon.cjs.entry.js +1 -1
  46. package/dist/cjs/hummer-ikon.cjs.entry.js +1 -1
  47. package/dist/cjs/hyundai-ikon.cjs.entry.js +1 -1
  48. package/dist/cjs/index-90ebe2be.js +1122 -0
  49. package/dist/cjs/infiniti-ikon.cjs.entry.js +1 -1
  50. package/dist/cjs/isuzu-ikon.cjs.entry.js +1 -1
  51. package/dist/cjs/jaguar-alt-ikon.cjs.entry.js +1 -1
  52. package/dist/cjs/jaguar-ikon.cjs.entry.js +1 -1
  53. package/dist/cjs/java-script-icon.cjs.entry.js +1 -1
  54. package/dist/cjs/jeep-alt-ikon.cjs.entry.js +1 -1
  55. package/dist/cjs/jeep-ikon.cjs.entry.js +1 -1
  56. package/dist/cjs/kia-ikon.cjs.entry.js +1 -1
  57. package/dist/cjs/lamborghini-alt-ikon.cjs.entry.js +1 -1
  58. package/dist/cjs/lamborghini-ikon.cjs.entry.js +1 -1
  59. package/dist/cjs/land-rover-ikon.cjs.entry.js +1 -1
  60. package/dist/cjs/lexus-ikon.cjs.entry.js +1 -1
  61. package/dist/cjs/lincoln-ikon.cjs.entry.js +1 -1
  62. package/dist/cjs/loader.cjs.js +1 -1
  63. package/dist/cjs/lotus-alt-ikon.cjs.entry.js +1 -1
  64. package/dist/cjs/lotus-ikon.cjs.entry.js +1 -1
  65. package/dist/cjs/maserati-ikon.cjs.entry.js +1 -1
  66. package/dist/cjs/maybach-ikon.cjs.entry.js +1 -1
  67. package/dist/cjs/mazda-alt-ikon.cjs.entry.js +1 -1
  68. package/dist/cjs/mazda-ikon.cjs.entry.js +1 -1
  69. package/dist/cjs/mclaren-alt-ikon.cjs.entry.js +1 -1
  70. package/dist/cjs/mclaren-ikon.cjs.entry.js +1 -1
  71. package/dist/cjs/mercedes-benz-alt-ikon.cjs.entry.js +1 -1
  72. package/dist/cjs/mercedes-benz-ikon.cjs.entry.js +1 -1
  73. package/dist/cjs/mercury-ikon.cjs.entry.js +1 -1
  74. package/dist/cjs/mini-alt-ikon.cjs.entry.js +1 -1
  75. package/dist/cjs/mini-ikon.cjs.entry.js +1 -1
  76. package/dist/cjs/mitsubishi-ikon.cjs.entry.js +1 -1
  77. package/dist/cjs/nissan-ikon.cjs.entry.js +1 -1
  78. package/dist/cjs/oldsmobile-ikon.cjs.entry.js +1 -1
  79. package/dist/cjs/one-password-icon.cjs.entry.js +1 -1
  80. package/dist/cjs/opel-ikon.cjs.entry.js +1 -1
  81. package/dist/cjs/panoz-ikon.cjs.entry.js +1 -1
  82. package/dist/cjs/paw-icon.cjs.entry.js +1 -1
  83. package/dist/cjs/peugeot-alt-ikon.cjs.entry.js +1 -1
  84. package/dist/cjs/peugeot-ikon.cjs.entry.js +1 -1
  85. package/dist/cjs/plymouth-ikon.cjs.entry.js +1 -1
  86. package/dist/cjs/pontiac-ikon.cjs.entry.js +1 -1
  87. package/dist/cjs/porsche-ikon.cjs.entry.js +1 -1
  88. package/dist/cjs/proto-ikon-loader-wc.cjs.js +9 -9
  89. package/dist/cjs/proto-ikon-loader_2.cjs.entry.js +1 -1
  90. package/dist/cjs/protocol-icon.cjs.entry.js +1 -1
  91. package/dist/cjs/pulse-icon.cjs.entry.js +1 -1
  92. package/dist/cjs/puzzle-icon.cjs.entry.js +1 -1
  93. package/dist/cjs/qr-code-icon.cjs.entry.js +1 -1
  94. package/dist/cjs/radio-2-icon.cjs.entry.js +1 -1
  95. package/dist/cjs/radio-icon.cjs.entry.js +1 -1
  96. package/dist/cjs/ram-alt-ikon.cjs.entry.js +1 -1
  97. package/dist/cjs/ram-ikon.cjs.entry.js +1 -1
  98. package/dist/cjs/refresh-icon.cjs.entry.js +1 -1
  99. package/dist/cjs/renault-alt-ikon.cjs.entry.js +1 -1
  100. package/dist/cjs/renault-ikon.cjs.entry.js +1 -1
  101. package/dist/cjs/rolls-royce-ikon.cjs.entry.js +1 -1
  102. package/dist/cjs/saab-alt-ikon.cjs.entry.js +1 -1
  103. package/dist/cjs/saab-ikon.cjs.entry.js +1 -1
  104. package/dist/cjs/saturn-ikon.cjs.entry.js +1 -1
  105. package/dist/cjs/scion-ikon.cjs.entry.js +1 -1
  106. package/dist/cjs/seat-ikon.cjs.entry.js +1 -1
  107. package/dist/cjs/skoda-ikon.cjs.entry.js +1 -1
  108. package/dist/cjs/slug-icon.cjs.entry.js +1 -1
  109. package/dist/cjs/smart-ikon.cjs.entry.js +1 -1
  110. package/dist/cjs/spider-icon.cjs.entry.js +1 -1
  111. package/dist/cjs/spyker-alt-ikon.cjs.entry.js +1 -1
  112. package/dist/cjs/spyker-ikon.cjs.entry.js +1 -1
  113. package/dist/cjs/subaru-alt-ikon.cjs.entry.js +1 -1
  114. package/dist/cjs/subaru-ikon.cjs.entry.js +1 -1
  115. package/dist/cjs/suzuki-ikon.cjs.entry.js +1 -1
  116. package/dist/cjs/svg-icon.cjs.entry.js +1 -1
  117. package/dist/cjs/tesla-ikon.cjs.entry.js +1 -1
  118. package/dist/cjs/toyota-ikon.cjs.entry.js +1 -1
  119. package/dist/cjs/vector-curve-icon.cjs.entry.js +1 -1
  120. package/dist/cjs/volkswagen-ikon.cjs.entry.js +1 -1
  121. package/dist/cjs/volvo-alt-ikon.cjs.entry.js +1 -1
  122. package/dist/cjs/volvo-ikon.cjs.entry.js +1 -1
  123. package/dist/cjs/webhook-icon.cjs.entry.js +1 -1
  124. package/dist/collection/collection-manifest.json +1 -1
  125. package/dist/esm/acura-ikon.entry.js +1 -1
  126. package/dist/esm/alfa-romeo-alt-ikon.entry.js +1 -1
  127. package/dist/esm/alfa-romeo-ikon.entry.js +1 -1
  128. package/dist/esm/alien-icon.entry.js +1 -1
  129. package/dist/esm/am-general-ikon.entry.js +1 -1
  130. package/dist/esm/asterisk-icon.entry.js +1 -1
  131. package/dist/esm/aston-martin-alt-ikon.entry.js +1 -1
  132. package/dist/esm/aston-martin-ikon.entry.js +1 -1
  133. package/dist/esm/audi-ikon.entry.js +1 -1
  134. package/dist/esm/barcode-icon.entry.js +1 -1
  135. package/dist/esm/barcode-scan-icon.entry.js +1 -1
  136. package/dist/esm/bash-icon.entry.js +1 -1
  137. package/dist/esm/beaker-icon.entry.js +1 -1
  138. package/dist/esm/bently-ikon.entry.js +1 -1
  139. package/dist/esm/bmw-ikon.entry.js +1 -1
  140. package/dist/esm/bugatti-ikon.entry.js +1 -1
  141. package/dist/esm/buick-ikon.entry.js +1 -1
  142. package/dist/esm/cadillac-ikon.entry.js +1 -1
  143. package/dist/esm/chart-bar-icon.entry.js +1 -1
  144. package/dist/esm/chart-bubble-icon.entry.js +1 -1
  145. package/dist/esm/chart-donut-icon.entry.js +1 -1
  146. package/dist/esm/chart-donuts-icon.entry.js +1 -1
  147. package/dist/esm/check-icon.entry.js +1 -1
  148. package/dist/esm/chevrolet-ikon.entry.js +1 -1
  149. package/dist/esm/chevron-double-left-icon.entry.js +1 -1
  150. package/dist/esm/chrysler-ikon.entry.js +1 -1
  151. package/dist/esm/circular-saw-icon.entry.js +1 -1
  152. package/dist/esm/citroen-ikon.entry.js +1 -1
  153. package/dist/esm/close-icon.entry.js +1 -1
  154. package/dist/esm/daewoo-ikon.entry.js +1 -1
  155. package/dist/esm/dodge-ikon.entry.js +1 -1
  156. package/dist/esm/eagle-ikon.entry.js +1 -1
  157. package/dist/esm/ferrari-ikon.entry.js +1 -1
  158. package/dist/esm/fiat-alt-ikon.entry.js +1 -1
  159. package/dist/esm/fiat-ikon.entry.js +1 -1
  160. package/dist/esm/fingerprint-icon.entry.js +1 -1
  161. package/dist/esm/fire-icon.entry.js +1 -1
  162. package/dist/esm/fisker-ikon.entry.js +1 -1
  163. package/dist/esm/flask-icon.entry.js +1 -1
  164. package/dist/esm/ford-ikon.entry.js +1 -1
  165. package/dist/esm/genesis-ikon.entry.js +1 -1
  166. package/dist/esm/geo-ikon.entry.js +1 -1
  167. package/dist/esm/git-icon.entry.js +1 -1
  168. package/dist/esm/gmc-ikon.entry.js +1 -1
  169. package/dist/esm/honda-ikon.entry.js +1 -1
  170. package/dist/esm/hummer-ikon.entry.js +1 -1
  171. package/dist/esm/hyundai-ikon.entry.js +1 -1
  172. package/dist/esm/index-e013e909.js +1095 -0
  173. package/dist/esm/infiniti-ikon.entry.js +1 -1
  174. package/dist/esm/isuzu-ikon.entry.js +1 -1
  175. package/dist/esm/jaguar-alt-ikon.entry.js +1 -1
  176. package/dist/esm/jaguar-ikon.entry.js +1 -1
  177. package/dist/esm/java-script-icon.entry.js +1 -1
  178. package/dist/esm/jeep-alt-ikon.entry.js +1 -1
  179. package/dist/esm/jeep-ikon.entry.js +1 -1
  180. package/dist/esm/kia-ikon.entry.js +1 -1
  181. package/dist/esm/lamborghini-alt-ikon.entry.js +1 -1
  182. package/dist/esm/lamborghini-ikon.entry.js +1 -1
  183. package/dist/esm/land-rover-ikon.entry.js +1 -1
  184. package/dist/esm/lexus-ikon.entry.js +1 -1
  185. package/dist/esm/lincoln-ikon.entry.js +1 -1
  186. package/dist/esm/loader.js +2 -2
  187. package/dist/esm/lotus-alt-ikon.entry.js +1 -1
  188. package/dist/esm/lotus-ikon.entry.js +1 -1
  189. package/dist/esm/maserati-ikon.entry.js +1 -1
  190. package/dist/esm/maybach-ikon.entry.js +1 -1
  191. package/dist/esm/mazda-alt-ikon.entry.js +1 -1
  192. package/dist/esm/mazda-ikon.entry.js +1 -1
  193. package/dist/esm/mclaren-alt-ikon.entry.js +1 -1
  194. package/dist/esm/mclaren-ikon.entry.js +1 -1
  195. package/dist/esm/mercedes-benz-alt-ikon.entry.js +1 -1
  196. package/dist/esm/mercedes-benz-ikon.entry.js +1 -1
  197. package/dist/esm/mercury-ikon.entry.js +1 -1
  198. package/dist/esm/mini-alt-ikon.entry.js +1 -1
  199. package/dist/esm/mini-ikon.entry.js +1 -1
  200. package/dist/esm/mitsubishi-ikon.entry.js +1 -1
  201. package/dist/esm/nissan-ikon.entry.js +1 -1
  202. package/dist/esm/oldsmobile-ikon.entry.js +1 -1
  203. package/dist/esm/one-password-icon.entry.js +1 -1
  204. package/dist/esm/opel-ikon.entry.js +1 -1
  205. package/dist/esm/panoz-ikon.entry.js +1 -1
  206. package/dist/esm/paw-icon.entry.js +1 -1
  207. package/dist/esm/peugeot-alt-ikon.entry.js +1 -1
  208. package/dist/esm/peugeot-ikon.entry.js +1 -1
  209. package/dist/esm/plymouth-ikon.entry.js +1 -1
  210. package/dist/esm/pontiac-ikon.entry.js +1 -1
  211. package/dist/esm/porsche-ikon.entry.js +1 -1
  212. package/dist/esm/proto-ikon-loader-wc.js +10 -10
  213. package/dist/esm/proto-ikon-loader_2.entry.js +1 -1
  214. package/dist/esm/protocol-icon.entry.js +1 -1
  215. package/dist/esm/pulse-icon.entry.js +1 -1
  216. package/dist/esm/puzzle-icon.entry.js +1 -1
  217. package/dist/esm/qr-code-icon.entry.js +1 -1
  218. package/dist/esm/radio-2-icon.entry.js +1 -1
  219. package/dist/esm/radio-icon.entry.js +1 -1
  220. package/dist/esm/ram-alt-ikon.entry.js +1 -1
  221. package/dist/esm/ram-ikon.entry.js +1 -1
  222. package/dist/esm/refresh-icon.entry.js +1 -1
  223. package/dist/esm/renault-alt-ikon.entry.js +1 -1
  224. package/dist/esm/renault-ikon.entry.js +1 -1
  225. package/dist/esm/rolls-royce-ikon.entry.js +1 -1
  226. package/dist/esm/saab-alt-ikon.entry.js +1 -1
  227. package/dist/esm/saab-ikon.entry.js +1 -1
  228. package/dist/esm/saturn-ikon.entry.js +1 -1
  229. package/dist/esm/scion-ikon.entry.js +1 -1
  230. package/dist/esm/seat-ikon.entry.js +1 -1
  231. package/dist/esm/skoda-ikon.entry.js +1 -1
  232. package/dist/esm/slug-icon.entry.js +1 -1
  233. package/dist/esm/smart-ikon.entry.js +1 -1
  234. package/dist/esm/spider-icon.entry.js +1 -1
  235. package/dist/esm/spyker-alt-ikon.entry.js +1 -1
  236. package/dist/esm/spyker-ikon.entry.js +1 -1
  237. package/dist/esm/subaru-alt-ikon.entry.js +1 -1
  238. package/dist/esm/subaru-ikon.entry.js +1 -1
  239. package/dist/esm/suzuki-ikon.entry.js +1 -1
  240. package/dist/esm/svg-icon.entry.js +1 -1
  241. package/dist/esm/tesla-ikon.entry.js +1 -1
  242. package/dist/esm/toyota-ikon.entry.js +1 -1
  243. package/dist/esm/vector-curve-icon.entry.js +1 -1
  244. package/dist/esm/volkswagen-ikon.entry.js +1 -1
  245. package/dist/esm/volvo-alt-ikon.entry.js +1 -1
  246. package/dist/esm/volvo-ikon.entry.js +1 -1
  247. package/dist/esm/webhook-icon.entry.js +1 -1
  248. package/dist/proto-ikon-loader-wc/{p-95554342.entry.js → p-04119531.entry.js} +1 -1
  249. package/dist/proto-ikon-loader-wc/p-06908bcf.entry.js +1 -0
  250. package/dist/proto-ikon-loader-wc/{p-de05bdf9.entry.js → p-07d7505d.entry.js} +1 -1
  251. package/dist/proto-ikon-loader-wc/{p-bb253baf.entry.js → p-08986ced.entry.js} +1 -1
  252. package/dist/proto-ikon-loader-wc/{p-c4f6be25.entry.js → p-096f7987.entry.js} +1 -1
  253. package/dist/proto-ikon-loader-wc/{p-ff3708e2.entry.js → p-0a282dc8.entry.js} +1 -1
  254. package/dist/proto-ikon-loader-wc/{p-554468af.entry.js → p-0b78f6d9.entry.js} +1 -1
  255. package/dist/proto-ikon-loader-wc/{p-d8091138.entry.js → p-0bdd94c0.entry.js} +1 -1
  256. package/dist/proto-ikon-loader-wc/{p-13d3b575.entry.js → p-0ddf38f7.entry.js} +1 -1
  257. package/dist/proto-ikon-loader-wc/{p-78aaf08e.entry.js → p-1005240e.entry.js} +1 -1
  258. package/dist/proto-ikon-loader-wc/{p-b2b039e3.entry.js → p-1499395a.entry.js} +1 -1
  259. package/dist/proto-ikon-loader-wc/{p-a9862236.entry.js → p-174e261d.entry.js} +1 -1
  260. package/dist/proto-ikon-loader-wc/p-1d4398e1.entry.js +1 -0
  261. package/dist/proto-ikon-loader-wc/{p-9917d073.entry.js → p-1efbf7ed.entry.js} +1 -1
  262. package/dist/proto-ikon-loader-wc/{p-800569b4.entry.js → p-2032ac8a.entry.js} +1 -1
  263. package/dist/proto-ikon-loader-wc/{p-7a7c97f7.entry.js → p-2140cd08.entry.js} +1 -1
  264. package/dist/proto-ikon-loader-wc/{p-daebea62.entry.js → p-23437958.entry.js} +1 -1
  265. package/dist/proto-ikon-loader-wc/{p-517a0df1.entry.js → p-248e0fcf.entry.js} +1 -1
  266. package/dist/proto-ikon-loader-wc/{p-99b9b098.entry.js → p-2569e350.entry.js} +1 -1
  267. package/dist/proto-ikon-loader-wc/{p-460ef3ce.entry.js → p-258d3047.entry.js} +1 -1
  268. package/dist/proto-ikon-loader-wc/{p-36245eae.entry.js → p-287233ca.entry.js} +1 -1
  269. package/dist/proto-ikon-loader-wc/{p-824fc583.entry.js → p-2b1b4317.entry.js} +1 -1
  270. package/dist/proto-ikon-loader-wc/{p-fd6dd93c.entry.js → p-2fdc7b23.entry.js} +1 -1
  271. package/dist/proto-ikon-loader-wc/{p-a34c0ed5.entry.js → p-34e6289d.entry.js} +1 -1
  272. package/dist/proto-ikon-loader-wc/{p-c2a508ba.entry.js → p-35854ff7.entry.js} +1 -1
  273. package/dist/proto-ikon-loader-wc/{p-5c14da69.entry.js → p-35ad247c.entry.js} +1 -1
  274. package/dist/proto-ikon-loader-wc/{p-f17dda42.entry.js → p-37e8ad8e.entry.js} +1 -1
  275. package/dist/proto-ikon-loader-wc/p-395d02c0.js +2 -0
  276. package/dist/proto-ikon-loader-wc/{p-671789fe.entry.js → p-398d98a9.entry.js} +1 -1
  277. package/dist/proto-ikon-loader-wc/{p-faac751f.entry.js → p-3a1cce3e.entry.js} +1 -1
  278. package/dist/proto-ikon-loader-wc/{p-bd62f201.entry.js → p-3d80e3ec.entry.js} +1 -1
  279. package/dist/proto-ikon-loader-wc/p-3f81b9bf.entry.js +1 -0
  280. package/dist/proto-ikon-loader-wc/{p-7d0f7b50.entry.js → p-45eb686e.entry.js} +1 -1
  281. package/dist/proto-ikon-loader-wc/{p-d477210b.entry.js → p-464f5585.entry.js} +1 -1
  282. package/dist/proto-ikon-loader-wc/{p-f7914b8d.entry.js → p-4823a2e1.entry.js} +1 -1
  283. package/dist/proto-ikon-loader-wc/{p-160561cf.entry.js → p-4ff4e3ab.entry.js} +1 -1
  284. package/dist/proto-ikon-loader-wc/{p-98df3c83.entry.js → p-5041db2f.entry.js} +1 -1
  285. package/dist/proto-ikon-loader-wc/{p-2914c301.entry.js → p-505a9b71.entry.js} +1 -1
  286. package/dist/proto-ikon-loader-wc/{p-323c4db4.entry.js → p-51070a1b.entry.js} +1 -1
  287. package/dist/proto-ikon-loader-wc/p-5277c7bd.entry.js +1 -0
  288. package/dist/proto-ikon-loader-wc/{p-18745421.entry.js → p-57617294.entry.js} +1 -1
  289. package/dist/proto-ikon-loader-wc/p-59a7d8b3.entry.js +1 -0
  290. package/dist/proto-ikon-loader-wc/{p-8b79385a.entry.js → p-5a08f556.entry.js} +1 -1
  291. package/dist/proto-ikon-loader-wc/{p-2af63405.entry.js → p-5a21986e.entry.js} +1 -1
  292. package/dist/proto-ikon-loader-wc/p-5a69f422.entry.js +1 -0
  293. package/dist/proto-ikon-loader-wc/p-5cc6e964.entry.js +1 -0
  294. package/dist/proto-ikon-loader-wc/{p-68b2dfd7.entry.js → p-5d43de32.entry.js} +1 -1
  295. package/dist/proto-ikon-loader-wc/p-5dd8dec7.entry.js +1 -0
  296. package/dist/proto-ikon-loader-wc/{p-154bef32.entry.js → p-5fed790b.entry.js} +1 -1
  297. package/dist/proto-ikon-loader-wc/{p-ac7d8850.entry.js → p-63cf8555.entry.js} +1 -1
  298. package/dist/proto-ikon-loader-wc/{p-9a964a21.entry.js → p-6721843a.entry.js} +1 -1
  299. package/dist/proto-ikon-loader-wc/{p-d105ab28.entry.js → p-677118ca.entry.js} +1 -1
  300. package/dist/proto-ikon-loader-wc/{p-299c0966.entry.js → p-69335160.entry.js} +1 -1
  301. package/dist/proto-ikon-loader-wc/{p-4a80b67b.entry.js → p-6b4c253e.entry.js} +1 -1
  302. package/dist/proto-ikon-loader-wc/{p-76b400ba.entry.js → p-6e8ff59a.entry.js} +1 -1
  303. package/dist/proto-ikon-loader-wc/{p-9445c000.entry.js → p-730ebb2b.entry.js} +1 -1
  304. package/dist/proto-ikon-loader-wc/{p-f4bbb5cf.entry.js → p-7481affd.entry.js} +1 -1
  305. package/dist/proto-ikon-loader-wc/{p-a6d8d3de.entry.js → p-78565458.entry.js} +1 -1
  306. package/dist/proto-ikon-loader-wc/p-78659d77.entry.js +1 -0
  307. package/dist/proto-ikon-loader-wc/{p-f5f05d96.entry.js → p-7b5d6ef9.entry.js} +1 -1
  308. package/dist/proto-ikon-loader-wc/p-7ce6c5df.entry.js +1 -0
  309. package/dist/proto-ikon-loader-wc/{p-9e8ae6dc.entry.js → p-7ec583ea.entry.js} +1 -1
  310. package/dist/proto-ikon-loader-wc/{p-040940f2.entry.js → p-7fdbc5ec.entry.js} +1 -1
  311. package/dist/proto-ikon-loader-wc/{p-16cbfbac.entry.js → p-82567114.entry.js} +1 -1
  312. package/dist/proto-ikon-loader-wc/p-83d2b676.entry.js +1 -0
  313. package/dist/proto-ikon-loader-wc/{p-5e8c0c97.entry.js → p-857fe9a4.entry.js} +1 -1
  314. package/dist/proto-ikon-loader-wc/{p-173d4e6a.entry.js → p-860fdd43.entry.js} +1 -1
  315. package/dist/proto-ikon-loader-wc/{p-bf8c6c53.entry.js → p-86be9c82.entry.js} +1 -1
  316. package/dist/proto-ikon-loader-wc/{p-953d12df.entry.js → p-8a9c65c3.entry.js} +1 -1
  317. package/dist/proto-ikon-loader-wc/{p-e10a36c5.entry.js → p-8d4ebb7d.entry.js} +1 -1
  318. package/dist/proto-ikon-loader-wc/{p-500e070f.entry.js → p-8f5c5d07.entry.js} +1 -1
  319. package/dist/proto-ikon-loader-wc/{p-54a5e17e.entry.js → p-94130391.entry.js} +1 -1
  320. package/dist/proto-ikon-loader-wc/{p-8ad2a01b.entry.js → p-98ba0a4f.entry.js} +1 -1
  321. package/dist/proto-ikon-loader-wc/{p-2ee32d60.entry.js → p-99184353.entry.js} +1 -1
  322. package/dist/proto-ikon-loader-wc/{p-4b5bb1bd.entry.js → p-999e279d.entry.js} +1 -1
  323. package/dist/proto-ikon-loader-wc/{p-fb8808cd.entry.js → p-9bc7767b.entry.js} +1 -1
  324. package/dist/proto-ikon-loader-wc/{p-f919809e.entry.js → p-9e07e522.entry.js} +1 -1
  325. package/dist/proto-ikon-loader-wc/p-a08a5cc6.entry.js +1 -0
  326. package/dist/proto-ikon-loader-wc/{p-3c63062e.entry.js → p-a259db26.entry.js} +1 -1
  327. package/dist/proto-ikon-loader-wc/{p-09820ca7.entry.js → p-a2f3bb55.entry.js} +1 -1
  328. package/dist/proto-ikon-loader-wc/{p-c571bca2.entry.js → p-a61d0bba.entry.js} +1 -1
  329. package/dist/proto-ikon-loader-wc/{p-2706395d.entry.js → p-a9d1aad5.entry.js} +1 -1
  330. package/dist/proto-ikon-loader-wc/{p-f8cec354.entry.js → p-adb331c2.entry.js} +1 -1
  331. package/dist/proto-ikon-loader-wc/{p-e6935e21.entry.js → p-ae949b55.entry.js} +1 -1
  332. package/dist/proto-ikon-loader-wc/{p-8a8fa06c.entry.js → p-afacbc50.entry.js} +1 -1
  333. package/dist/proto-ikon-loader-wc/{p-1a041550.entry.js → p-b17cc550.entry.js} +1 -1
  334. package/dist/proto-ikon-loader-wc/p-b182984d.entry.js +1 -0
  335. package/dist/proto-ikon-loader-wc/{p-d9e50cc5.entry.js → p-b2cc87df.entry.js} +1 -1
  336. package/dist/proto-ikon-loader-wc/{p-97edd14b.entry.js → p-b5f7af1d.entry.js} +1 -1
  337. package/dist/proto-ikon-loader-wc/{p-20735224.entry.js → p-b6d6d2b9.entry.js} +1 -1
  338. package/dist/proto-ikon-loader-wc/{p-0eeb6909.entry.js → p-b813bd89.entry.js} +1 -1
  339. package/dist/proto-ikon-loader-wc/{p-61ddad0e.entry.js → p-bb2022a9.entry.js} +1 -1
  340. package/dist/proto-ikon-loader-wc/{p-af4476ff.entry.js → p-bdb27e4a.entry.js} +1 -1
  341. package/dist/proto-ikon-loader-wc/{p-224ba975.entry.js → p-bdb51f4d.entry.js} +1 -1
  342. package/dist/proto-ikon-loader-wc/{p-283b0a97.entry.js → p-bf996321.entry.js} +1 -1
  343. package/dist/proto-ikon-loader-wc/{p-f9699ff2.entry.js → p-c0c8e109.entry.js} +1 -1
  344. package/dist/proto-ikon-loader-wc/{p-7c675180.entry.js → p-c4db4671.entry.js} +1 -1
  345. package/dist/proto-ikon-loader-wc/{p-14220473.entry.js → p-c5f1b466.entry.js} +1 -1
  346. package/dist/proto-ikon-loader-wc/{p-85bc9cd6.entry.js → p-ce81fc79.entry.js} +1 -1
  347. package/dist/proto-ikon-loader-wc/{p-148c2ce0.entry.js → p-cf381347.entry.js} +1 -1
  348. package/dist/proto-ikon-loader-wc/{p-594f2b83.entry.js → p-d013c219.entry.js} +1 -1
  349. package/dist/proto-ikon-loader-wc/{p-6eba0b3c.entry.js → p-d949b324.entry.js} +1 -1
  350. package/dist/proto-ikon-loader-wc/{p-9c7d8783.entry.js → p-dd0b0aea.entry.js} +1 -1
  351. package/dist/proto-ikon-loader-wc/{p-345a41ca.entry.js → p-dfd7cb0f.entry.js} +1 -1
  352. package/dist/proto-ikon-loader-wc/{p-ccd7a640.entry.js → p-e04356cb.entry.js} +1 -1
  353. package/dist/proto-ikon-loader-wc/p-e1318615.entry.js +1 -0
  354. package/dist/proto-ikon-loader-wc/{p-ef4b73a1.entry.js → p-e170d62b.entry.js} +1 -1
  355. package/dist/proto-ikon-loader-wc/{p-aff3d5c6.entry.js → p-e1b45603.entry.js} +1 -1
  356. package/dist/proto-ikon-loader-wc/{p-53c59694.entry.js → p-e4f05c9c.entry.js} +1 -1
  357. package/dist/proto-ikon-loader-wc/{p-a59f9df5.entry.js → p-e5750eb2.entry.js} +1 -1
  358. package/dist/proto-ikon-loader-wc/p-e91ba2c1.entry.js +1 -0
  359. package/dist/proto-ikon-loader-wc/{p-6ccc3166.entry.js → p-e934850f.entry.js} +1 -1
  360. package/dist/proto-ikon-loader-wc/{p-420bf5c2.entry.js → p-ec07a8b4.entry.js} +1 -1
  361. package/dist/proto-ikon-loader-wc/{p-79078266.entry.js → p-f3aa7b5b.entry.js} +1 -1
  362. package/dist/proto-ikon-loader-wc/{p-3d33ebb6.entry.js → p-f471bb15.entry.js} +1 -1
  363. package/dist/proto-ikon-loader-wc/{p-7689afbf.entry.js → p-f5481b74.entry.js} +1 -1
  364. package/dist/proto-ikon-loader-wc/{p-2ca039fc.entry.js → p-f5dd0c9e.entry.js} +1 -1
  365. package/dist/proto-ikon-loader-wc/{p-4a463835.entry.js → p-f6a9a9f8.entry.js} +1 -1
  366. package/dist/proto-ikon-loader-wc/{p-8204c064.entry.js → p-f7dc67fa.entry.js} +1 -1
  367. package/dist/proto-ikon-loader-wc/{p-251f0ff4.entry.js → p-faa3b473.entry.js} +1 -1
  368. package/dist/proto-ikon-loader-wc/{p-497eff06.entry.js → p-ffc01f18.entry.js} +1 -1
  369. package/dist/proto-ikon-loader-wc/proto-ikon-loader-wc.esm.js +1 -1
  370. package/package.json +5 -5
  371. package/dist/cjs/index-2e5a65bc.js +0 -1799
  372. package/dist/esm/index-57e7b648.js +0 -1772
  373. package/dist/proto-ikon-loader-wc/p-16fb3512.entry.js +0 -1
  374. package/dist/proto-ikon-loader-wc/p-191f6a75.entry.js +0 -1
  375. package/dist/proto-ikon-loader-wc/p-2c56dce7.entry.js +0 -1
  376. package/dist/proto-ikon-loader-wc/p-2d982ba9.entry.js +0 -1
  377. package/dist/proto-ikon-loader-wc/p-2dadf5d0.entry.js +0 -1
  378. package/dist/proto-ikon-loader-wc/p-3e161105.entry.js +0 -1
  379. package/dist/proto-ikon-loader-wc/p-53e62cb7.entry.js +0 -1
  380. package/dist/proto-ikon-loader-wc/p-70911102.entry.js +0 -1
  381. package/dist/proto-ikon-loader-wc/p-7dca5080.entry.js +0 -1
  382. package/dist/proto-ikon-loader-wc/p-aae39bb1.js +0 -2
  383. package/dist/proto-ikon-loader-wc/p-ab5ed2bc.entry.js +0 -1
  384. package/dist/proto-ikon-loader-wc/p-b2c46033.entry.js +0 -1
  385. package/dist/proto-ikon-loader-wc/p-c450c404.entry.js +0 -1
  386. package/dist/proto-ikon-loader-wc/p-c96f5287.entry.js +0 -1
  387. package/dist/proto-ikon-loader-wc/p-d0671485.entry.js +0 -1
  388. package/dist/proto-ikon-loader-wc/p-eadd1252.entry.js +0 -1
@@ -1,1772 +0,0 @@
1
- const NAMESPACE = 'proto-ikon-loader-wc';
2
-
3
- /**
4
- * Virtual DOM patching algorithm based on Snabbdom by
5
- * Simon Friis Vindum (@paldepind)
6
- * Licensed under the MIT License
7
- * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
- *
9
- * Modified for Stencil's renderer and slot projection
10
- */
11
- let scopeId;
12
- let hostTagName;
13
- let isSvgMode = false;
14
- let queuePending = false;
15
- const createTime = (fnName, tagName = '') => {
16
- {
17
- return () => {
18
- return;
19
- };
20
- }
21
- };
22
- const uniqueTime = (key, measureText) => {
23
- {
24
- return () => {
25
- return;
26
- };
27
- }
28
- };
29
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
30
- /**
31
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
32
- *
33
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
34
- * support as of Stencil v4.
35
- */
36
- const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
37
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
38
- /**
39
- * Default style mode id
40
- */
41
- /**
42
- * Reusable empty obj/array
43
- * Don't add values to these!!
44
- */
45
- const EMPTY_OBJ = {};
46
- /**
47
- * Namespaces
48
- */
49
- const SVG_NS = 'http://www.w3.org/2000/svg';
50
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
51
- const isDef = (v) => v != null;
52
- /**
53
- * Check whether a value is a 'complex type', defined here as an object or a
54
- * function.
55
- *
56
- * @param o the value to check
57
- * @returns whether it's a complex type or not
58
- */
59
- const isComplexType = (o) => {
60
- // https://jsperf.com/typeof-fn-object/5
61
- o = typeof o;
62
- return o === 'object' || o === 'function';
63
- };
64
- /**
65
- * Helper method for querying a `meta` tag that contains a nonce value
66
- * out of a DOM's head.
67
- *
68
- * @param doc The DOM containing the `head` to query against
69
- * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
70
- * exists or the tag has no content.
71
- */
72
- function queryNonceMetaTagContent(doc) {
73
- var _a, _b, _c;
74
- return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
75
- }
76
- /**
77
- * Production h() function based on Preact by
78
- * Jason Miller (@developit)
79
- * Licensed under the MIT License
80
- * https://github.com/developit/preact/blob/master/LICENSE
81
- *
82
- * Modified for Stencil's compiler and vdom
83
- */
84
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
85
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
86
- const h = (nodeName, vnodeData, ...children) => {
87
- let child = null;
88
- let key = null;
89
- let simple = false;
90
- let lastSimple = false;
91
- const vNodeChildren = [];
92
- const walk = (c) => {
93
- for (let i = 0; i < c.length; i++) {
94
- child = c[i];
95
- if (Array.isArray(child)) {
96
- walk(child);
97
- }
98
- else if (child != null && typeof child !== 'boolean') {
99
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
100
- child = String(child);
101
- }
102
- if (simple && lastSimple) {
103
- // If the previous child was simple (string), we merge both
104
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
105
- }
106
- else {
107
- // Append a new vNode, if it's text, we create a text vNode
108
- vNodeChildren.push(simple ? newVNode(null, child) : child);
109
- }
110
- lastSimple = simple;
111
- }
112
- }
113
- };
114
- walk(children);
115
- if (vnodeData) {
116
- if (vnodeData.key) {
117
- key = vnodeData.key;
118
- }
119
- // normalize class / className attributes
120
- {
121
- const classData = vnodeData.className || vnodeData.class;
122
- if (classData) {
123
- vnodeData.class =
124
- typeof classData !== 'object'
125
- ? classData
126
- : Object.keys(classData)
127
- .filter((k) => classData[k])
128
- .join(' ');
129
- }
130
- }
131
- }
132
- if (typeof nodeName === 'function') {
133
- // nodeName is a functional component
134
- return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
135
- }
136
- const vnode = newVNode(nodeName, null);
137
- vnode.$attrs$ = vnodeData;
138
- if (vNodeChildren.length > 0) {
139
- vnode.$children$ = vNodeChildren;
140
- }
141
- {
142
- vnode.$key$ = key;
143
- }
144
- return vnode;
145
- };
146
- /**
147
- * A utility function for creating a virtual DOM node from a tag and some
148
- * possible text content.
149
- *
150
- * @param tag the tag for this element
151
- * @param text possible text content for the node
152
- * @returns a newly-minted virtual DOM node
153
- */
154
- const newVNode = (tag, text) => {
155
- const vnode = {
156
- $flags$: 0,
157
- $tag$: tag,
158
- $text$: text,
159
- $elm$: null,
160
- $children$: null,
161
- };
162
- {
163
- vnode.$attrs$ = null;
164
- }
165
- {
166
- vnode.$key$ = null;
167
- }
168
- return vnode;
169
- };
170
- const Host = {};
171
- /**
172
- * Check whether a given node is a Host node or not
173
- *
174
- * @param node the virtual DOM node to check
175
- * @returns whether it's a Host node or not
176
- */
177
- const isHost = (node) => node && node.$tag$ === Host;
178
- /**
179
- * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
180
- *
181
- * Note that these functions convert from {@link d.VNode} to
182
- * {@link d.ChildNode} to give functional component developers a friendly
183
- * interface.
184
- */
185
- const vdomFnUtils = {
186
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
187
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
188
- };
189
- /**
190
- * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
191
- * friendlier public interface (hence, 'convertToPublic').
192
- *
193
- * @param node the virtual DOM node to convert
194
- * @returns a converted child node
195
- */
196
- const convertToPublic = (node) => ({
197
- vattrs: node.$attrs$,
198
- vchildren: node.$children$,
199
- vkey: node.$key$,
200
- vname: node.$name$,
201
- vtag: node.$tag$,
202
- vtext: node.$text$,
203
- });
204
- /**
205
- * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
206
- * order to use the resulting object in the virtual DOM. The initial object was
207
- * likely created as part of presenting a public API, so converting it back
208
- * involved making it 'private' again (hence, `convertToPrivate`).
209
- *
210
- * @param node the child node to convert
211
- * @returns a converted virtual DOM node
212
- */
213
- const convertToPrivate = (node) => {
214
- if (typeof node.vtag === 'function') {
215
- const vnodeData = Object.assign({}, node.vattrs);
216
- if (node.vkey) {
217
- vnodeData.key = node.vkey;
218
- }
219
- if (node.vname) {
220
- vnodeData.name = node.vname;
221
- }
222
- return h(node.vtag, vnodeData, ...(node.vchildren || []));
223
- }
224
- const vnode = newVNode(node.vtag, node.vtext);
225
- vnode.$attrs$ = node.vattrs;
226
- vnode.$children$ = node.vchildren;
227
- vnode.$key$ = node.vkey;
228
- vnode.$name$ = node.vname;
229
- return vnode;
230
- };
231
- /**
232
- * Parse a new property value for a given property type.
233
- *
234
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
235
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
236
- * 1. `any`, the type given to `propValue` in the function signature
237
- * 2. the type stored from `propType`.
238
- *
239
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
240
- *
241
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
242
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
243
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
244
- * ```tsx
245
- * <my-cmp prop-val={0}></my-cmp>
246
- * ```
247
- *
248
- * HTML prop values on the other hand, will always a string
249
- *
250
- * @param propValue the new value to coerce to some type
251
- * @param propType the type of the prop, expressed as a binary number
252
- * @returns the parsed/coerced value
253
- */
254
- const parsePropertyValue = (propValue, propType) => {
255
- // ensure this value is of the correct prop type
256
- if (propValue != null && !isComplexType(propValue)) {
257
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
258
- // per the HTML spec, any string value means it is a boolean true value
259
- // but we'll cheat here and say that the string "false" is the boolean false
260
- return propValue === 'false' ? false : propValue === '' || !!propValue;
261
- }
262
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
263
- // force it to be a number
264
- return parseFloat(propValue);
265
- }
266
- if (propType & 1 /* MEMBER_FLAGS.String */) {
267
- // could have been passed as a number or boolean
268
- // but we still want it as a string
269
- return String(propValue);
270
- }
271
- // redundant return here for better minification
272
- return propValue;
273
- }
274
- // not sure exactly what type we want
275
- // so no need to change to a different type
276
- return propValue;
277
- };
278
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
279
- /**
280
- * Helper function to create & dispatch a custom Event on a provided target
281
- * @param elm the target of the Event
282
- * @param name the name to give the custom Event
283
- * @param opts options for configuring a custom Event
284
- * @returns the custom Event
285
- */
286
- const emitEvent = (elm, name, opts) => {
287
- const ev = plt.ce(name, opts);
288
- elm.dispatchEvent(ev);
289
- return ev;
290
- };
291
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
292
- const registerStyle = (scopeId, cssText, allowCS) => {
293
- let style = styles.get(scopeId);
294
- if (supportsConstructableStylesheets && allowCS) {
295
- style = (style || new CSSStyleSheet());
296
- if (typeof style === 'string') {
297
- style = cssText;
298
- }
299
- else {
300
- style.replaceSync(cssText);
301
- }
302
- }
303
- else {
304
- style = cssText;
305
- }
306
- styles.set(scopeId, style);
307
- };
308
- const addStyle = (styleContainerNode, cmpMeta, mode) => {
309
- var _a;
310
- const scopeId = getScopeId(cmpMeta);
311
- const style = styles.get(scopeId);
312
- // if an element is NOT connected then getRootNode() will return the wrong root node
313
- // so the fallback is to always use the document for the root node in those cases
314
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
315
- if (style) {
316
- if (typeof style === 'string') {
317
- styleContainerNode = styleContainerNode.head || styleContainerNode;
318
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
319
- let styleElm;
320
- if (!appliedStyles) {
321
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
322
- }
323
- if (!appliedStyles.has(scopeId)) {
324
- {
325
- styleElm = doc.createElement('style');
326
- styleElm.innerHTML = style;
327
- // Apply CSP nonce to the style tag if it exists
328
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
329
- if (nonce != null) {
330
- styleElm.setAttribute('nonce', nonce);
331
- }
332
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
333
- }
334
- // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
335
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
336
- styleElm.innerHTML += SLOT_FB_CSS;
337
- }
338
- if (appliedStyles) {
339
- appliedStyles.add(scopeId);
340
- }
341
- }
342
- }
343
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
344
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
345
- }
346
- }
347
- return scopeId;
348
- };
349
- const attachStyles = (hostRef) => {
350
- const cmpMeta = hostRef.$cmpMeta$;
351
- const elm = hostRef.$hostElement$;
352
- const flags = cmpMeta.$flags$;
353
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
354
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
355
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
356
- // only required when we're NOT using native shadow dom (slot)
357
- // or this browser doesn't support native shadow dom
358
- // and this host element was NOT created with SSR
359
- // let's pick out the inner content for slot projection
360
- // create a node to represent where the original
361
- // content was first placed, which is useful later on
362
- // DOM WRITE!!
363
- elm['s-sc'] = scopeId;
364
- elm.classList.add(scopeId + '-h');
365
- }
366
- endAttachStyles();
367
- };
368
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
369
- /**
370
- * Production setAccessor() function based on Preact by
371
- * Jason Miller (@developit)
372
- * Licensed under the MIT License
373
- * https://github.com/developit/preact/blob/master/LICENSE
374
- *
375
- * Modified for Stencil's compiler and vdom
376
- */
377
- /**
378
- * When running a VDom render set properties present on a VDom node onto the
379
- * corresponding HTML element.
380
- *
381
- * Note that this function has special functionality for the `class`,
382
- * `style`, `key`, and `ref` attributes, as well as event handlers (like
383
- * `onClick`, etc). All others are just passed through as-is.
384
- *
385
- * @param elm the HTMLElement onto which attributes should be set
386
- * @param memberName the name of the attribute to set
387
- * @param oldValue the old value for the attribute
388
- * @param newValue the new value for the attribute
389
- * @param isSvg whether we're in an svg context or not
390
- * @param flags bitflags for Vdom variables
391
- */
392
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
393
- if (oldValue !== newValue) {
394
- let isProp = isMemberInElement(elm, memberName);
395
- let ln = memberName.toLowerCase();
396
- if (memberName === 'class') {
397
- const classList = elm.classList;
398
- const oldClasses = parseClassList(oldValue);
399
- const newClasses = parseClassList(newValue);
400
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
401
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
402
- }
403
- else if (memberName === 'key')
404
- ;
405
- else {
406
- // Set property if it exists and it's not a SVG
407
- const isComplex = isComplexType(newValue);
408
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
409
- try {
410
- if (!elm.tagName.includes('-')) {
411
- const n = newValue == null ? '' : newValue;
412
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
413
- if (memberName === 'list') {
414
- isProp = false;
415
- }
416
- else if (oldValue == null || elm[memberName] != n) {
417
- elm[memberName] = n;
418
- }
419
- }
420
- else {
421
- elm[memberName] = newValue;
422
- }
423
- }
424
- catch (e) {
425
- /**
426
- * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
427
- */
428
- }
429
- }
430
- /**
431
- * Need to manually update attribute if:
432
- * - memberName is not an attribute
433
- * - if we are rendering the host element in order to reflect attribute
434
- * - if it's a SVG, since properties might not work in <svg>
435
- * - if the newValue is null/undefined or 'false'.
436
- */
437
- let xlink = false;
438
- {
439
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
440
- memberName = ln;
441
- xlink = true;
442
- }
443
- }
444
- if (newValue == null || newValue === false) {
445
- if (newValue !== false || elm.getAttribute(memberName) === '') {
446
- if (xlink) {
447
- elm.removeAttributeNS(XLINK_NS, memberName);
448
- }
449
- else {
450
- elm.removeAttribute(memberName);
451
- }
452
- }
453
- }
454
- else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
455
- newValue = newValue === true ? '' : newValue;
456
- if (xlink) {
457
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
458
- }
459
- else {
460
- elm.setAttribute(memberName, newValue);
461
- }
462
- }
463
- }
464
- }
465
- };
466
- const parseClassListRegex = /\s/;
467
- /**
468
- * Parsed a string of classnames into an array
469
- * @param value className string, e.g. "foo bar baz"
470
- * @returns list of classes, e.g. ["foo", "bar", "baz"]
471
- */
472
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
473
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
474
- // if the element passed in is a shadow root, which is a document fragment
475
- // then we want to be adding attrs/props to the shadow root's "host" element
476
- // if it's not a shadow root, then we add attrs/props to the same element
477
- const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
478
- ? newVnode.$elm$.host
479
- : newVnode.$elm$;
480
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
481
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
482
- {
483
- // remove attributes no longer present on the vnode by setting them to undefined
484
- for (memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
485
- if (!(memberName in newVnodeAttrs)) {
486
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
487
- }
488
- }
489
- }
490
- // add new & update changed attributes
491
- for (memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
492
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
493
- }
494
- };
495
- /**
496
- * Sort a list of attribute names to ensure that all the attribute names which
497
- * are _not_ `"ref"` come before `"ref"`. Preserve the order of the non-ref
498
- * attributes.
499
- *
500
- * **Note**: if the supplied attributes do not include `'ref'` then the same
501
- * (by reference) array will be returned without modification.
502
- *
503
- * @param attrNames attribute names to sort
504
- * @returns a list of attribute names, sorted if they include `"ref"`
505
- */
506
- function sortedAttrNames(attrNames) {
507
- return attrNames.includes('ref')
508
- ? // we need to sort these to ensure that `'ref'` is the last attr
509
- [...attrNames.filter((attr) => attr !== 'ref'), 'ref']
510
- : // no need to sort, return the original array
511
- attrNames;
512
- }
513
- /**
514
- * Create a DOM Node corresponding to one of the children of a given VNode.
515
- *
516
- * @param oldParentVNode the parent VNode from the previous render
517
- * @param newParentVNode the parent VNode from the current render
518
- * @param childIndex the index of the VNode, in the _new_ parent node's
519
- * children, for which we will create a new DOM node
520
- * @param parentElm the parent DOM node which our new node will be a child of
521
- * @returns the newly created node
522
- */
523
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
524
- // tslint:disable-next-line: prefer-const
525
- const newVNode = newParentVNode.$children$[childIndex];
526
- let i = 0;
527
- let elm;
528
- let childNode;
529
- if (newVNode.$text$ !== null) {
530
- // create text node
531
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
532
- }
533
- else {
534
- if (!isSvgMode) {
535
- isSvgMode = newVNode.$tag$ === 'svg';
536
- }
537
- // create element
538
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
539
- );
540
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
541
- isSvgMode = false;
542
- }
543
- // add css classes, attrs, props, listeners, etc.
544
- {
545
- updateElement(null, newVNode, isSvgMode);
546
- }
547
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
548
- // if there is a scopeId and this is the initial render
549
- // then let's add the scopeId as a css class
550
- elm.classList.add((elm['s-si'] = scopeId));
551
- }
552
- if (newVNode.$children$) {
553
- for (i = 0; i < newVNode.$children$.length; ++i) {
554
- // create the node
555
- childNode = createElm(oldParentVNode, newVNode, i);
556
- // return node could have been null
557
- if (childNode) {
558
- // append our new node
559
- elm.appendChild(childNode);
560
- }
561
- }
562
- }
563
- {
564
- if (newVNode.$tag$ === 'svg') {
565
- // Only reset the SVG context when we're exiting <svg> element
566
- isSvgMode = false;
567
- }
568
- else if (elm.tagName === 'foreignObject') {
569
- // Reenter SVG context when we're exiting <foreignObject> element
570
- isSvgMode = true;
571
- }
572
- }
573
- }
574
- // This needs to always happen so we can hide nodes that are projected
575
- // to another component but don't end up in a slot
576
- elm['s-hn'] = hostTagName;
577
- return elm;
578
- };
579
- /**
580
- * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
581
- * add them to the DOM in the appropriate place.
582
- *
583
- * @param parentElm the DOM node which should be used as a parent for the new
584
- * DOM nodes
585
- * @param before a child of the `parentElm` which the new children should be
586
- * inserted before (optional)
587
- * @param parentVNode the parent virtual DOM node
588
- * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
589
- * @param startIdx the index in the child virtual DOM nodes at which to start
590
- * creating DOM nodes (inclusive)
591
- * @param endIdx the index in the child virtual DOM nodes at which to stop
592
- * creating DOM nodes (inclusive)
593
- */
594
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
595
- let containerElm = (parentElm);
596
- let childNode;
597
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
598
- containerElm = containerElm.shadowRoot;
599
- }
600
- for (; startIdx <= endIdx; ++startIdx) {
601
- if (vnodes[startIdx]) {
602
- childNode = createElm(null, parentVNode, startIdx);
603
- if (childNode) {
604
- vnodes[startIdx].$elm$ = childNode;
605
- containerElm.insertBefore(childNode, before);
606
- }
607
- }
608
- }
609
- };
610
- /**
611
- * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
612
- * This can be used to, for instance, clean up after a list of children which
613
- * should no longer be shown.
614
- *
615
- * This function also handles some of Stencil's slot relocation logic.
616
- *
617
- * @param vnodes a list of virtual DOM nodes to remove
618
- * @param startIdx the index at which to start removing nodes (inclusive)
619
- * @param endIdx the index at which to stop removing nodes (inclusive)
620
- */
621
- const removeVnodes = (vnodes, startIdx, endIdx) => {
622
- for (let index = startIdx; index <= endIdx; ++index) {
623
- const vnode = vnodes[index];
624
- if (vnode) {
625
- const elm = vnode.$elm$;
626
- if (elm) {
627
- // remove the vnode's element from the dom
628
- elm.remove();
629
- }
630
- }
631
- }
632
- };
633
- /**
634
- * Reconcile the children of a new VNode with the children of an old VNode by
635
- * traversing the two collections of children, identifying nodes that are
636
- * conserved or changed, calling out to `patch` to make any necessary
637
- * updates to the DOM, and rearranging DOM nodes as needed.
638
- *
639
- * The algorithm for reconciling children works by analyzing two 'windows' onto
640
- * the two arrays of children (`oldCh` and `newCh`). We keep track of the
641
- * 'windows' by storing start and end indices and references to the
642
- * corresponding array entries. Initially the two 'windows' are basically equal
643
- * to the entire array, but we progressively narrow the windows until there are
644
- * no children left to update by doing the following:
645
- *
646
- * 1. Skip any `null` entries at the beginning or end of the two arrays, so
647
- * that if we have an initial array like the following we'll end up dealing
648
- * only with a window bounded by the highlighted elements:
649
- *
650
- * [null, null, VNode1 , ... , VNode2, null, null]
651
- * ^^^^^^ ^^^^^^
652
- *
653
- * 2. Check to see if the elements at the head and tail positions are equal
654
- * across the windows. This will basically detect elements which haven't
655
- * been added, removed, or changed position, i.e. if you had the following
656
- * VNode elements (represented as HTML):
657
- *
658
- * oldVNode: `<div><p><span>HEY</span></p></div>`
659
- * newVNode: `<div><p><span>THERE</span></p></div>`
660
- *
661
- * Then when comparing the children of the `<div>` tag we check the equality
662
- * of the VNodes corresponding to the `<p>` tags and, since they are the
663
- * same tag in the same position, we'd be able to avoid completely
664
- * re-rendering the subtree under them with a new DOM element and would just
665
- * call out to `patch` to handle reconciling their children and so on.
666
- *
667
- * 3. Check, for both windows, to see if the element at the beginning of the
668
- * window corresponds to the element at the end of the other window. This is
669
- * a heuristic which will let us identify _some_ situations in which
670
- * elements have changed position, for instance it _should_ detect that the
671
- * children nodes themselves have not changed but merely moved in the
672
- * following example:
673
- *
674
- * oldVNode: `<div><element-one /><element-two /></div>`
675
- * newVNode: `<div><element-two /><element-one /></div>`
676
- *
677
- * If we find cases like this then we also need to move the concrete DOM
678
- * elements corresponding to the moved children to write the re-order to the
679
- * DOM.
680
- *
681
- * 4. Finally, if VNodes have the `key` attribute set on them we check for any
682
- * nodes in the old children which have the same key as the first element in
683
- * our window on the new children. If we find such a node we handle calling
684
- * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
685
- * what we find.
686
- *
687
- * Finally, once we've narrowed our 'windows' to the point that either of them
688
- * collapse (i.e. they have length 0) we then handle any remaining VNode
689
- * insertion or deletion that needs to happen to get a DOM state that correctly
690
- * reflects the new child VNodes. If, for instance, after our window on the old
691
- * children has collapsed we still have more nodes on the new children that
692
- * we haven't dealt with yet then we need to add them, or if the new children
693
- * collapse but we still have unhandled _old_ children then we need to make
694
- * sure the corresponding DOM nodes are removed.
695
- *
696
- * @param parentElm the node into which the parent VNode is rendered
697
- * @param oldCh the old children of the parent node
698
- * @param newVNode the new VNode which will replace the parent
699
- * @param newCh the new children of the parent node
700
- * @param isInitialRender whether or not this is the first render of the vdom
701
- */
702
- const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
703
- let oldStartIdx = 0;
704
- let newStartIdx = 0;
705
- let idxInOld = 0;
706
- let i = 0;
707
- let oldEndIdx = oldCh.length - 1;
708
- let oldStartVnode = oldCh[0];
709
- let oldEndVnode = oldCh[oldEndIdx];
710
- let newEndIdx = newCh.length - 1;
711
- let newStartVnode = newCh[0];
712
- let newEndVnode = newCh[newEndIdx];
713
- let node;
714
- let elmToMove;
715
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
716
- if (oldStartVnode == null) {
717
- // VNode might have been moved left
718
- oldStartVnode = oldCh[++oldStartIdx];
719
- }
720
- else if (oldEndVnode == null) {
721
- oldEndVnode = oldCh[--oldEndIdx];
722
- }
723
- else if (newStartVnode == null) {
724
- newStartVnode = newCh[++newStartIdx];
725
- }
726
- else if (newEndVnode == null) {
727
- newEndVnode = newCh[--newEndIdx];
728
- }
729
- else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
730
- // if the start nodes are the same then we should patch the new VNode
731
- // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
732
- // indices to reflect that. We don't need to move any DOM Nodes around
733
- // since things are matched up in order.
734
- patch(oldStartVnode, newStartVnode, isInitialRender);
735
- oldStartVnode = oldCh[++oldStartIdx];
736
- newStartVnode = newCh[++newStartIdx];
737
- }
738
- else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
739
- // likewise, if the end nodes are the same we patch new onto old and
740
- // decrement our end indices, and also likewise in this case we don't
741
- // need to move any DOM Nodes.
742
- patch(oldEndVnode, newEndVnode, isInitialRender);
743
- oldEndVnode = oldCh[--oldEndIdx];
744
- newEndVnode = newCh[--newEndIdx];
745
- }
746
- else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
747
- patch(oldStartVnode, newEndVnode, isInitialRender);
748
- // We need to move the element for `oldStartVnode` into a position which
749
- // will be appropriate for `newEndVnode`. For this we can use
750
- // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
751
- // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
752
- // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
753
- //
754
- // <old-start-node />
755
- // <some-intervening-node />
756
- // <old-end-node />
757
- // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
758
- // <next-sibling />
759
- //
760
- // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
761
- // the node for `oldStartVnode` at the end of the children of
762
- // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
763
- // aren't any siblings, and passing `null` to `Node.insertBefore` will
764
- // append it to the children of the parent element.
765
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
766
- oldStartVnode = oldCh[++oldStartIdx];
767
- newEndVnode = newCh[--newEndIdx];
768
- }
769
- else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
770
- patch(oldEndVnode, newStartVnode, isInitialRender);
771
- // We've already checked above if `oldStartVnode` and `newStartVnode` are
772
- // the same node, so since we're here we know that they are not. Thus we
773
- // can move the element for `oldEndVnode` _before_ the element for
774
- // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
775
- // future.
776
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
777
- oldEndVnode = oldCh[--oldEndIdx];
778
- newStartVnode = newCh[++newStartIdx];
779
- }
780
- else {
781
- // Here we do some checks to match up old and new nodes based on the
782
- // `$key$` attribute, which is set by putting a `key="my-key"` attribute
783
- // in the JSX for a DOM element in the implementation of a Stencil
784
- // component.
785
- //
786
- // First we check to see if there are any nodes in the array of old
787
- // children which have the same key as the first node in the new
788
- // children.
789
- idxInOld = -1;
790
- {
791
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
792
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
793
- idxInOld = i;
794
- break;
795
- }
796
- }
797
- }
798
- if (idxInOld >= 0) {
799
- // We found a node in the old children which matches up with the first
800
- // node in the new children! So let's deal with that
801
- elmToMove = oldCh[idxInOld];
802
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
803
- // the tag doesn't match so we'll need a new DOM element
804
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
805
- }
806
- else {
807
- patch(elmToMove, newStartVnode, isInitialRender);
808
- // invalidate the matching old node so that we won't try to update it
809
- // again later on
810
- oldCh[idxInOld] = undefined;
811
- node = elmToMove.$elm$;
812
- }
813
- newStartVnode = newCh[++newStartIdx];
814
- }
815
- else {
816
- // We either didn't find an element in the old children that matches
817
- // the key of the first new child OR the build is not using `key`
818
- // attributes at all. In either case we need to create a new element
819
- // for the new node.
820
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
821
- newStartVnode = newCh[++newStartIdx];
822
- }
823
- if (node) {
824
- // if we created a new node then handle inserting it to the DOM
825
- {
826
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
827
- }
828
- }
829
- }
830
- }
831
- if (oldStartIdx > oldEndIdx) {
832
- // we have some more new nodes to add which don't match up with old nodes
833
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
834
- }
835
- else if (newStartIdx > newEndIdx) {
836
- // there are nodes in the `oldCh` array which no longer correspond to nodes
837
- // in the new array, so lets remove them (which entails cleaning up the
838
- // relevant DOM nodes)
839
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
840
- }
841
- };
842
- /**
843
- * Compare two VNodes to determine if they are the same
844
- *
845
- * **NB**: This function is an equality _heuristic_ based on the available
846
- * information set on the two VNodes and can be misleading under certain
847
- * circumstances. In particular, if the two nodes do not have `key` attrs
848
- * (available under `$key$` on VNodes) then the function falls back on merely
849
- * checking that they have the same tag.
850
- *
851
- * So, in other words, if `key` attrs are not set on VNodes which may be
852
- * changing order within a `children` array or something along those lines then
853
- * we could obtain a false negative and then have to do needless re-rendering
854
- * (i.e. we'd say two VNodes aren't equal when in fact they should be).
855
- *
856
- * @param leftVNode the first VNode to check
857
- * @param rightVNode the second VNode to check
858
- * @param isInitialRender whether or not this is the first render of the vdom
859
- * @returns whether they're equal or not
860
- */
861
- const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
862
- // compare if two vnode to see if they're "technically" the same
863
- // need to have the same element tag, and same key to be the same
864
- if (leftVNode.$tag$ === rightVNode.$tag$) {
865
- // this will be set if JSX tags in the build have `key` attrs set on them
866
- // we only want to check this if we're not on the first render since on
867
- // first render `leftVNode.$key$` will always be `null`, so we can be led
868
- // astray and, for instance, accidentally delete a DOM node that we want to
869
- // keep around.
870
- if (!isInitialRender) {
871
- return leftVNode.$key$ === rightVNode.$key$;
872
- }
873
- return true;
874
- }
875
- return false;
876
- };
877
- /**
878
- * Handle reconciling an outdated VNode with a new one which corresponds to
879
- * it. This function handles flushing updates to the DOM and reconciling the
880
- * children of the two nodes (if any).
881
- *
882
- * @param oldVNode an old VNode whose DOM element and children we want to update
883
- * @param newVNode a new VNode representing an updated version of the old one
884
- * @param isInitialRender whether or not this is the first render of the vdom
885
- */
886
- const patch = (oldVNode, newVNode, isInitialRender = false) => {
887
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
888
- const oldChildren = oldVNode.$children$;
889
- const newChildren = newVNode.$children$;
890
- const tag = newVNode.$tag$;
891
- const text = newVNode.$text$;
892
- if (text === null) {
893
- {
894
- // test if we're rendering an svg element, or still rendering nodes inside of one
895
- // only add this to the when the compiler sees we're using an svg somewhere
896
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
897
- }
898
- {
899
- {
900
- // either this is the first render of an element OR it's an update
901
- // AND we already know it's possible it could have changed
902
- // this updates the element's css classes, attrs, props, listeners, etc.
903
- updateElement(oldVNode, newVNode, isSvgMode);
904
- }
905
- }
906
- if (oldChildren !== null && newChildren !== null) {
907
- // looks like there's child vnodes for both the old and new vnodes
908
- // so we need to call `updateChildren` to reconcile them
909
- updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
910
- }
911
- else if (newChildren !== null) {
912
- // no old child vnodes, but there are new child vnodes to add
913
- if (oldVNode.$text$ !== null) {
914
- // the old vnode was text, so be sure to clear it out
915
- elm.textContent = '';
916
- }
917
- // add the new vnode children
918
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
919
- }
920
- else if (oldChildren !== null) {
921
- // no new child vnodes, but there are old child vnodes to remove
922
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
923
- }
924
- if (isSvgMode && tag === 'svg') {
925
- isSvgMode = false;
926
- }
927
- }
928
- else if (oldVNode.$text$ !== text) {
929
- // update the text content for the text only vnode
930
- // and also only if the text is different than before
931
- elm.data = text;
932
- }
933
- };
934
- /**
935
- * The main entry point for Stencil's virtual DOM-based rendering engine
936
- *
937
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
938
- * function will handle creating a virtual DOM tree with a single root, patching
939
- * the current virtual DOM tree onto an old one (if any), dealing with slot
940
- * relocation, and reflecting attributes.
941
- *
942
- * @param hostRef data needed to root and render the virtual DOM tree, such as
943
- * the DOM node into which it should be rendered.
944
- * @param renderFnResults the virtual DOM nodes to be rendered
945
- * @param isInitialLoad whether or not this is the first call after page load
946
- */
947
- const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
948
- const hostElm = hostRef.$hostElement$;
949
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
950
- // if `renderFnResults` is a Host node then we can use it directly. If not,
951
- // we need to call `h` again to wrap the children of our component in a
952
- // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
953
- // implicitly that the top-level vdom node is 1) an only child and 2)
954
- // contains attrs that need to be set on the host element.
955
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
956
- hostTagName = hostElm.tagName;
957
- // On the first render and *only* on the first render we want to check for
958
- // any attributes set on the host element which are also set on the vdom
959
- // node. If we find them, we override the value on the VDom node attrs with
960
- // the value from the host element, which allows developers building apps
961
- // with Stencil components to override e.g. the `role` attribute on a
962
- // component even if it's already set on the `Host`.
963
- if (isInitialLoad && rootVnode.$attrs$) {
964
- for (const key of Object.keys(rootVnode.$attrs$)) {
965
- // We have a special implementation in `setAccessor` for `style` and
966
- // `class` which reconciles values coming from the VDom with values
967
- // already present on the DOM element, so we don't want to override those
968
- // attributes on the VDom tree with values from the host element if they
969
- // are present.
970
- //
971
- // Likewise, `ref` and `key` are special internal values for the Stencil
972
- // runtime and we don't want to override those either.
973
- if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
974
- rootVnode.$attrs$[key] = hostElm[key];
975
- }
976
- }
977
- }
978
- rootVnode.$tag$ = null;
979
- rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
980
- hostRef.$vnode$ = rootVnode;
981
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
982
- {
983
- scopeId = hostElm['s-sc'];
984
- }
985
- // synchronous patch
986
- patch(oldVNode, rootVnode, isInitialLoad);
987
- };
988
- const attachToAncestor = (hostRef, ancestorComponent) => {
989
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
990
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
991
- }
992
- };
993
- const scheduleUpdate = (hostRef, isInitialLoad) => {
994
- {
995
- hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
996
- }
997
- if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
998
- hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
999
- return;
1000
- }
1001
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1002
- // there is no ancestor component or the ancestor component
1003
- // has already fired off its lifecycle update then
1004
- // fire off the initial update
1005
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1006
- return writeTask(dispatch) ;
1007
- };
1008
- /**
1009
- * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1010
- * component lifecycle methods like `componentWillLoad` as well as
1011
- * {@link updateComponent}, which will kick off the virtual DOM re-render.
1012
- *
1013
- * @param hostRef a reference to a host DOM node
1014
- * @param isInitialLoad whether we're on the initial load or not
1015
- * @returns an empty Promise which is used to enqueue a series of operations for
1016
- * the component
1017
- */
1018
- const dispatchHooks = (hostRef, isInitialLoad) => {
1019
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1020
- const instance = hostRef.$lazyInstance$ ;
1021
- // We're going to use this variable together with `enqueue` to implement a
1022
- // little promise-based queue. We start out with it `undefined`. When we add
1023
- // the first function to the queue we'll set this variable to be that
1024
- // function's return value. When we attempt to add subsequent values to the
1025
- // queue we'll check that value and, if it was a `Promise`, we'll then chain
1026
- // the new function off of that `Promise` using `.then()`. This will give our
1027
- // queue two nice properties:
1028
- //
1029
- // 1. If all functions added to the queue are synchronous they'll be called
1030
- // synchronously right away.
1031
- // 2. If all functions added to the queue are asynchronous they'll all be
1032
- // called in order after `dispatchHooks` exits.
1033
- let maybePromise;
1034
- endSchedule();
1035
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1036
- };
1037
- /**
1038
- * This function uses a Promise to implement a simple first-in, first-out queue
1039
- * of functions to be called.
1040
- *
1041
- * The queue is ordered on the basis of the first argument. If it's
1042
- * `undefined`, then nothing is on the queue yet, so the provided function can
1043
- * be called synchronously (although note that this function may return a
1044
- * `Promise`). The idea is that then the return value of that enqueueing
1045
- * operation is kept around, so that if it was a `Promise` then subsequent
1046
- * functions can be enqueued by calling this function again with that `Promise`
1047
- * as the first argument.
1048
- *
1049
- * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1050
- * @param fn a function to enqueue
1051
- * @returns either a `Promise` or the return value of the provided function
1052
- */
1053
- const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1054
- /**
1055
- * Check that a value is a `Promise`. To check, we first see if the value is an
1056
- * instance of the `Promise` global. In a few circumstances, in particular if
1057
- * the global has been overwritten, this is could be misleading, so we also do
1058
- * a little 'duck typing' check to see if the `.then` property of the value is
1059
- * defined and a function.
1060
- *
1061
- * @param maybePromise it might be a promise!
1062
- * @returns whether it is or not
1063
- */
1064
- const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1065
- (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1066
- /**
1067
- * Update a component given reference to its host elements and so on.
1068
- *
1069
- * @param hostRef an object containing references to the element's host node,
1070
- * VDom nodes, and other metadata
1071
- * @param instance a reference to the underlying host element where it will be
1072
- * rendered
1073
- * @param isInitialLoad whether or not this function is being called as part of
1074
- * the first render cycle
1075
- */
1076
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1077
- var _a;
1078
- const elm = hostRef.$hostElement$;
1079
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1080
- const rc = elm['s-rc'];
1081
- if (isInitialLoad) {
1082
- // DOM WRITE!
1083
- attachStyles(hostRef);
1084
- }
1085
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1086
- {
1087
- callRender(hostRef, instance, elm, isInitialLoad);
1088
- }
1089
- if (rc) {
1090
- // ok, so turns out there are some child host elements
1091
- // waiting on this parent element to load
1092
- // let's fire off all update callbacks waiting
1093
- rc.map((cb) => cb());
1094
- elm['s-rc'] = undefined;
1095
- }
1096
- endRender();
1097
- endUpdate();
1098
- {
1099
- const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1100
- const postUpdate = () => postUpdateComponent(hostRef);
1101
- if (childrenPromises.length === 0) {
1102
- postUpdate();
1103
- }
1104
- else {
1105
- Promise.all(childrenPromises).then(postUpdate);
1106
- hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1107
- childrenPromises.length = 0;
1108
- }
1109
- }
1110
- };
1111
- /**
1112
- * Handle making the call to the VDom renderer with the proper context given
1113
- * various build variables
1114
- *
1115
- * @param hostRef an object containing references to the element's host node,
1116
- * VDom nodes, and other metadata
1117
- * @param instance a reference to the underlying host element where it will be
1118
- * rendered
1119
- * @param elm the Host element for the component
1120
- * @param isInitialLoad whether or not this function is being called as part of
1121
- * @returns an empty promise
1122
- */
1123
- const callRender = (hostRef, instance, elm, isInitialLoad) => {
1124
- try {
1125
- /**
1126
- * minification optimization: `allRenderFn` is `true` if all components have a `render`
1127
- * method, so we can call the method immediately. If not, check before calling it.
1128
- */
1129
- instance = instance.render() ;
1130
- {
1131
- hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1132
- }
1133
- {
1134
- hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1135
- }
1136
- {
1137
- {
1138
- // looks like we've got child nodes to render into this host element
1139
- // or we need to update the css class/attrs on the host element
1140
- // DOM WRITE!
1141
- {
1142
- renderVdom(hostRef, instance, isInitialLoad);
1143
- }
1144
- }
1145
- }
1146
- }
1147
- catch (e) {
1148
- consoleError(e, hostRef.$hostElement$);
1149
- }
1150
- return null;
1151
- };
1152
- const postUpdateComponent = (hostRef) => {
1153
- const tagName = hostRef.$cmpMeta$.$tagName$;
1154
- const elm = hostRef.$hostElement$;
1155
- const endPostUpdate = createTime('postUpdate', tagName);
1156
- const ancestorComponent = hostRef.$ancestorComponent$;
1157
- if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1158
- hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1159
- {
1160
- // DOM WRITE!
1161
- addHydratedFlag(elm);
1162
- }
1163
- endPostUpdate();
1164
- {
1165
- hostRef.$onReadyResolve$(elm);
1166
- if (!ancestorComponent) {
1167
- appDidLoad();
1168
- }
1169
- }
1170
- }
1171
- else {
1172
- endPostUpdate();
1173
- }
1174
- // load events fire from bottom to top
1175
- // the deepest elements load first then bubbles up
1176
- {
1177
- if (hostRef.$onRenderResolve$) {
1178
- hostRef.$onRenderResolve$();
1179
- hostRef.$onRenderResolve$ = undefined;
1180
- }
1181
- if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1182
- nextTick(() => scheduleUpdate(hostRef, false));
1183
- }
1184
- hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1185
- }
1186
- // ( •_•)
1187
- // ( •_•)>⌐■-■
1188
- // (⌐■_■)
1189
- };
1190
- const appDidLoad = (who) => {
1191
- // on appload
1192
- // we have finish the first big initial render
1193
- {
1194
- addHydratedFlag(doc.documentElement);
1195
- }
1196
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1197
- };
1198
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1199
- ;
1200
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1201
- const setValue = (ref, propName, newVal, cmpMeta) => {
1202
- // check our new property value against our internal value
1203
- const hostRef = getHostRef(ref);
1204
- const oldVal = hostRef.$instanceValues$.get(propName);
1205
- const flags = hostRef.$flags$;
1206
- const instance = hostRef.$lazyInstance$ ;
1207
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1208
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1209
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1210
- const didValueChange = newVal !== oldVal && !areBothNaN;
1211
- if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1212
- // gadzooks! the property's value has changed!!
1213
- // set our new value!
1214
- hostRef.$instanceValues$.set(propName, newVal);
1215
- if (instance) {
1216
- if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1217
- // looks like this value actually changed, so we've got work to do!
1218
- // but only if we've already rendered, otherwise just chill out
1219
- // queue that we need to do an update, but don't worry about queuing
1220
- // up millions cuz this function ensures it only runs once
1221
- scheduleUpdate(hostRef, false);
1222
- }
1223
- }
1224
- }
1225
- };
1226
- /**
1227
- * Attach a series of runtime constructs to a compiled Stencil component
1228
- * constructor, including getters and setters for the `@Prop` and `@State`
1229
- * decorators, callbacks for when attributes change, and so on.
1230
- *
1231
- * @param Cstr the constructor for a component that we need to process
1232
- * @param cmpMeta metadata collected previously about the component
1233
- * @param flags a number used to store a series of bit flags
1234
- * @returns a reference to the same constructor passed in (but now mutated)
1235
- */
1236
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1237
- var _a;
1238
- const prototype = Cstr.prototype;
1239
- if (cmpMeta.$members$) {
1240
- // It's better to have a const than two Object.entries()
1241
- const members = Object.entries(cmpMeta.$members$);
1242
- members.map(([memberName, [memberFlags]]) => {
1243
- if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1244
- ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1245
- // proxyComponent - prop
1246
- Object.defineProperty(prototype, memberName, {
1247
- get() {
1248
- // proxyComponent, get value
1249
- return getValue(this, memberName);
1250
- },
1251
- set(newValue) {
1252
- // proxyComponent, set value
1253
- setValue(this, memberName, newValue, cmpMeta);
1254
- },
1255
- configurable: true,
1256
- enumerable: true,
1257
- });
1258
- }
1259
- });
1260
- if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1261
- const attrNameToPropName = new Map();
1262
- prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1263
- plt.jmp(() => {
1264
- var _a;
1265
- const propName = attrNameToPropName.get(attrName);
1266
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1267
- // in the case where an attribute was set inline.
1268
- // ```html
1269
- // <my-component some-attribute="some-value"></my-component>
1270
- // ```
1271
- //
1272
- // There is an edge case where a developer sets the attribute inline on a custom element and then
1273
- // programmatically changes it before it has been upgraded as shown below:
1274
- //
1275
- // ```html
1276
- // <!-- this component has _not_ been upgraded yet -->
1277
- // <my-component id="test" some-attribute="some-value"></my-component>
1278
- // <script>
1279
- // // grab non-upgraded component
1280
- // el = document.querySelector("#test");
1281
- // el.someAttribute = "another-value";
1282
- // // upgrade component
1283
- // customElements.define('my-component', MyComponent);
1284
- // </script>
1285
- // ```
1286
- // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1287
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1288
- // to the value that was set inline i.e. "some-value" from above example. When
1289
- // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1290
- //
1291
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1292
- // by connectedCallback as this attributeChangedCallback will not fire.
1293
- //
1294
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1295
- //
1296
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1297
- // properties here given that this goes against best practices outlined here
1298
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1299
- if (this.hasOwnProperty(propName)) {
1300
- newValue = this[propName];
1301
- delete this[propName];
1302
- }
1303
- else if (prototype.hasOwnProperty(propName) &&
1304
- typeof this[propName] === 'number' &&
1305
- this[propName] == newValue) {
1306
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1307
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1308
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1309
- return;
1310
- }
1311
- else if (propName == null) {
1312
- // At this point we should know this is not a "member", so we can treat it like watching an attribute
1313
- // on a vanilla web component
1314
- const hostRef = getHostRef(this);
1315
- const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1316
- // We only want to trigger the callback(s) if:
1317
- // 1. The instance is ready
1318
- // 2. The watchers are ready
1319
- // 3. The value has changed
1320
- if (flags &&
1321
- !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1322
- flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1323
- newValue !== oldValue) {
1324
- const instance = hostRef.$lazyInstance$ ;
1325
- const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1326
- entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1327
- if (instance[callbackName] != null) {
1328
- instance[callbackName].call(instance, newValue, oldValue, attrName);
1329
- }
1330
- });
1331
- }
1332
- return;
1333
- }
1334
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1335
- });
1336
- };
1337
- // Create an array of attributes to observe
1338
- // This list in comprised of all strings used within a `@Watch()` decorator
1339
- // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1340
- // As such, there is no way to guarantee type-safety here that a user hasn't entered
1341
- // an invalid attribute.
1342
- Cstr.observedAttributes = Array.from(new Set([
1343
- ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1344
- ...members
1345
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1346
- .map(([propName, m]) => {
1347
- const attrName = m[1] || propName;
1348
- attrNameToPropName.set(attrName, propName);
1349
- return attrName;
1350
- }),
1351
- ]));
1352
- }
1353
- }
1354
- return Cstr;
1355
- };
1356
- /**
1357
- * Initialize a Stencil component given a reference to its host element, its
1358
- * runtime bookkeeping data structure, runtime metadata about the component,
1359
- * and (optionally) an HMR version ID.
1360
- *
1361
- * @param elm a host element
1362
- * @param hostRef the element's runtime bookkeeping object
1363
- * @param cmpMeta runtime metadata for the Stencil component
1364
- * @param hmrVersionId an (optional) HMR version ID
1365
- */
1366
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1367
- let Cstr;
1368
- // initializeComponent
1369
- if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1370
- // Let the runtime know that the component has been initialized
1371
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1372
- const bundleId = cmpMeta.$lazyBundleId$;
1373
- if (bundleId) {
1374
- // lazy loaded components
1375
- // request the component's implementation to be
1376
- // wired up with the host element
1377
- Cstr = loadModule(cmpMeta);
1378
- if (Cstr.then) {
1379
- // Await creates a micro-task avoid if possible
1380
- const endLoad = uniqueTime();
1381
- Cstr = await Cstr;
1382
- endLoad();
1383
- }
1384
- if (!Cstr.isProxied) {
1385
- proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1386
- Cstr.isProxied = true;
1387
- }
1388
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1389
- // ok, time to construct the instance
1390
- // but let's keep track of when we start and stop
1391
- // so that the getters/setters don't incorrectly step on data
1392
- {
1393
- hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1394
- }
1395
- // construct the lazy-loaded component implementation
1396
- // passing the hostRef is very important during
1397
- // construction in order to directly wire together the
1398
- // host element and the lazy-loaded instance
1399
- try {
1400
- new Cstr(hostRef);
1401
- }
1402
- catch (e) {
1403
- consoleError(e);
1404
- }
1405
- {
1406
- hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1407
- }
1408
- endNewInstance();
1409
- }
1410
- else {
1411
- // sync constructor component
1412
- Cstr = elm.constructor;
1413
- // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
1414
- // watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
1415
- // Stencil has completed instantiating the component.
1416
- customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
1417
- }
1418
- if (Cstr.style) {
1419
- // this component has styles but we haven't registered them yet
1420
- let style = Cstr.style;
1421
- const scopeId = getScopeId(cmpMeta);
1422
- if (!styles.has(scopeId)) {
1423
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1424
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1425
- endRegisterStyles();
1426
- }
1427
- }
1428
- }
1429
- // we've successfully created a lazy instance
1430
- const ancestorComponent = hostRef.$ancestorComponent$;
1431
- const schedule = () => scheduleUpdate(hostRef, true);
1432
- if (ancestorComponent && ancestorComponent['s-rc']) {
1433
- // this is the initial load and this component it has an ancestor component
1434
- // but the ancestor component has NOT fired its will update lifecycle yet
1435
- // so let's just cool our jets and wait for the ancestor to continue first
1436
- // this will get fired off when the ancestor component
1437
- // finally gets around to rendering its lazy self
1438
- // fire off the initial update
1439
- ancestorComponent['s-rc'].push(schedule);
1440
- }
1441
- else {
1442
- schedule();
1443
- }
1444
- };
1445
- const fireConnectedCallback = (instance) => {
1446
- };
1447
- const connectedCallback = (elm) => {
1448
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1449
- const hostRef = getHostRef(elm);
1450
- const cmpMeta = hostRef.$cmpMeta$;
1451
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1452
- if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1453
- // first time this component has connected
1454
- hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1455
- {
1456
- // find the first ancestor component (if there is one) and register
1457
- // this component as one of the actively loading child components for its ancestor
1458
- let ancestorComponent = elm;
1459
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1460
- // climb up the ancestors looking for the first
1461
- // component that hasn't finished its lifecycle update yet
1462
- if (ancestorComponent['s-p']) {
1463
- // we found this components first ancestor component
1464
- // keep a reference to this component's ancestor component
1465
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1466
- break;
1467
- }
1468
- }
1469
- }
1470
- // Lazy properties
1471
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1472
- if (cmpMeta.$members$) {
1473
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1474
- if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1475
- const value = elm[memberName];
1476
- delete elm[memberName];
1477
- elm[memberName] = value;
1478
- }
1479
- });
1480
- }
1481
- {
1482
- initializeComponent(elm, hostRef, cmpMeta);
1483
- }
1484
- }
1485
- else {
1486
- // fire off connectedCallback() on component instance
1487
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1488
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1489
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1490
- }
1491
- }
1492
- endConnected();
1493
- }
1494
- };
1495
- const disconnectInstance = (instance) => {
1496
- };
1497
- const disconnectedCallback = async (elm) => {
1498
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1499
- const hostRef = getHostRef(elm);
1500
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1501
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1502
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1503
- }
1504
- }
1505
- };
1506
- const bootstrapLazy = (lazyBundles, options = {}) => {
1507
- var _a;
1508
- const endBootstrap = createTime();
1509
- const cmpTags = [];
1510
- const exclude = options.exclude || [];
1511
- const customElements = win.customElements;
1512
- const head = doc.head;
1513
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1514
- const dataStyles = /*@__PURE__*/ doc.createElement('style');
1515
- const deferredConnectedCallbacks = [];
1516
- let appLoadFallback;
1517
- let isBootstrapping = true;
1518
- Object.assign(plt, options);
1519
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1520
- let hasSlotRelocation = false;
1521
- lazyBundles.map((lazyBundle) => {
1522
- lazyBundle[1].map((compactMeta) => {
1523
- const cmpMeta = {
1524
- $flags$: compactMeta[0],
1525
- $tagName$: compactMeta[1],
1526
- $members$: compactMeta[2],
1527
- $listeners$: compactMeta[3],
1528
- };
1529
- // Check if we are using slots outside the shadow DOM in this component.
1530
- // We'll use this information later to add styles for `slot-fb` elements
1531
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1532
- hasSlotRelocation = true;
1533
- }
1534
- {
1535
- cmpMeta.$members$ = compactMeta[2];
1536
- }
1537
- const tagName = cmpMeta.$tagName$;
1538
- const HostElement = class extends HTMLElement {
1539
- // StencilLazyHost
1540
- constructor(self) {
1541
- // @ts-ignore
1542
- super(self);
1543
- self = this;
1544
- registerHost(self, cmpMeta);
1545
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1546
- // this component is using shadow dom
1547
- // and this browser supports shadow dom
1548
- // add the read-only property "shadowRoot" to the host element
1549
- // adding the shadow root build conditionals to minimize runtime
1550
- {
1551
- {
1552
- self.attachShadow({ mode: 'open' });
1553
- }
1554
- }
1555
- }
1556
- }
1557
- connectedCallback() {
1558
- if (appLoadFallback) {
1559
- clearTimeout(appLoadFallback);
1560
- appLoadFallback = null;
1561
- }
1562
- if (isBootstrapping) {
1563
- // connectedCallback will be processed once all components have been registered
1564
- deferredConnectedCallbacks.push(this);
1565
- }
1566
- else {
1567
- plt.jmp(() => connectedCallback(this));
1568
- }
1569
- }
1570
- disconnectedCallback() {
1571
- plt.jmp(() => disconnectedCallback(this));
1572
- }
1573
- componentOnReady() {
1574
- return getHostRef(this).$onReadyPromise$;
1575
- }
1576
- };
1577
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1578
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1579
- cmpTags.push(tagName);
1580
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1581
- }
1582
- });
1583
- });
1584
- // Only bother generating CSS if we have components
1585
- // TODO(STENCIL-1118): Add test cases for CSS content based on conditionals
1586
- if (cmpTags.length > 0) {
1587
- // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
1588
- if (hasSlotRelocation) {
1589
- dataStyles.textContent += SLOT_FB_CSS;
1590
- }
1591
- // Add hydration styles
1592
- {
1593
- dataStyles.textContent += cmpTags + HYDRATED_CSS;
1594
- }
1595
- // If we have styles, add them to the DOM
1596
- if (dataStyles.innerHTML.length) {
1597
- dataStyles.setAttribute('data-styles', '');
1598
- // Apply CSP nonce to the style tag if it exists
1599
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1600
- if (nonce != null) {
1601
- dataStyles.setAttribute('nonce', nonce);
1602
- }
1603
- // Insert the styles into the document head
1604
- // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
1605
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1606
- }
1607
- }
1608
- // Process deferred connectedCallbacks now all components have been registered
1609
- isBootstrapping = false;
1610
- if (deferredConnectedCallbacks.length) {
1611
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
1612
- }
1613
- else {
1614
- {
1615
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1616
- }
1617
- }
1618
- // Fallback appLoad event
1619
- endBootstrap();
1620
- };
1621
- /**
1622
- * Assigns the given value to the nonce property on the runtime platform object.
1623
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1624
- * @param nonce The value to be assigned to the platform nonce property.
1625
- * @returns void
1626
- */
1627
- const setNonce = (nonce) => (plt.$nonce$ = nonce);
1628
- /**
1629
- * A WeakMap mapping runtime component references to their corresponding host reference
1630
- * instances.
1631
- *
1632
- * **Note**: If we're in an HMR context we need to store a reference to this
1633
- * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1634
- * to {@link d.HostRef} across HMR updates.
1635
- *
1636
- * This is necessary because when HMR updates for a component are processed by
1637
- * the browser-side dev server client the JS bundle for that component is
1638
- * re-fetched. Since the module containing {@link hostRefs} is included in
1639
- * that bundle, if we do not store a reference to it the new iteration of the
1640
- * component will not have access to the previous hostRef map, leading to a
1641
- * bug where the new version of the component cannot properly initialize.
1642
- */
1643
- const hostRefs = new WeakMap();
1644
- /**
1645
- * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1646
- *
1647
- * @param ref the runtime ref of interest
1648
- * @returns the Host reference (if found) or undefined
1649
- */
1650
- const getHostRef = (ref) => hostRefs.get(ref);
1651
- /**
1652
- * Register a lazy instance with the {@link hostRefs} object so it's
1653
- * corresponding {@link d.HostRef} can be retrieved later.
1654
- *
1655
- * @param lazyInstance the lazy instance of interest
1656
- * @param hostRef that instances `HostRef` object
1657
- * @returns a reference to the host ref WeakMap
1658
- */
1659
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1660
- /**
1661
- * Register a host element for a Stencil component, setting up various metadata
1662
- * and callbacks based on {@link BUILD} flags as well as the component's runtime
1663
- * metadata.
1664
- *
1665
- * @param hostElement the host element to register
1666
- * @param cmpMeta runtime metadata for that component
1667
- * @returns a reference to the host ref WeakMap
1668
- */
1669
- const registerHost = (hostElement, cmpMeta) => {
1670
- const hostRef = {
1671
- $flags$: 0,
1672
- $hostElement$: hostElement,
1673
- $cmpMeta$: cmpMeta,
1674
- $instanceValues$: new Map(),
1675
- };
1676
- {
1677
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1678
- hostElement['s-p'] = [];
1679
- hostElement['s-rc'] = [];
1680
- }
1681
- return hostRefs.set(hostElement, hostRef);
1682
- };
1683
- const isMemberInElement = (elm, memberName) => memberName in elm;
1684
- const consoleError = (e, el) => (0, console.error)(e, el);
1685
- const cmpModules = /*@__PURE__*/ new Map();
1686
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1687
- // loadModuleImport
1688
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1689
- const bundleId = cmpMeta.$lazyBundleId$;
1690
- const module = cmpModules.get(bundleId) ;
1691
- if (module) {
1692
- return module[exportName];
1693
- }
1694
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1695
- return import(
1696
- /* @vite-ignore */
1697
- /* webpackInclude: /\.entry\.js$/ */
1698
- /* webpackExclude: /\.system\.entry\.js$/ */
1699
- /* webpackMode: "lazy" */
1700
- `./${bundleId}.entry.js${''}`).then((importedModule) => {
1701
- {
1702
- cmpModules.set(bundleId, importedModule);
1703
- }
1704
- return importedModule[exportName];
1705
- }, consoleError);
1706
- };
1707
- const styles = /*@__PURE__*/ new Map();
1708
- const win = typeof window !== 'undefined' ? window : {};
1709
- const doc = win.document || { head: {} };
1710
- const plt = {
1711
- $flags$: 0,
1712
- $resourcesUrl$: '',
1713
- jmp: (h) => h(),
1714
- raf: (h) => requestAnimationFrame(h),
1715
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1716
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1717
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
1718
- };
1719
- const promiseResolve = (v) => Promise.resolve(v);
1720
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1721
- try {
1722
- new CSSStyleSheet();
1723
- return typeof new CSSStyleSheet().replaceSync === 'function';
1724
- }
1725
- catch (e) { }
1726
- return false;
1727
- })()
1728
- ;
1729
- const queueDomReads = [];
1730
- const queueDomWrites = [];
1731
- const queueTask = (queue, write) => (cb) => {
1732
- queue.push(cb);
1733
- if (!queuePending) {
1734
- queuePending = true;
1735
- if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1736
- nextTick(flush);
1737
- }
1738
- else {
1739
- plt.raf(flush);
1740
- }
1741
- }
1742
- };
1743
- const consume = (queue) => {
1744
- for (let i = 0; i < queue.length; i++) {
1745
- try {
1746
- queue[i](performance.now());
1747
- }
1748
- catch (e) {
1749
- consoleError(e);
1750
- }
1751
- }
1752
- queue.length = 0;
1753
- };
1754
- const flush = () => {
1755
- // always force a bunch of medium callbacks to run, but still have
1756
- // a throttle on how many can run in a certain time
1757
- // DOM READS!!!
1758
- consume(queueDomReads);
1759
- // DOM WRITES!!!
1760
- {
1761
- consume(queueDomWrites);
1762
- if ((queuePending = queueDomReads.length > 0)) {
1763
- // still more to do yet, but we've run out of time
1764
- // let's let this thing cool off and try again in the next tick
1765
- plt.raf(flush);
1766
- }
1767
- }
1768
- };
1769
- const nextTick = (cb) => promiseResolve().then(cb);
1770
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1771
-
1772
- export { bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };