@nylas/web-elements 1.0.0-prealpha1

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 (879) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-0a7b82d9.js +23 -0
  3. package/dist/cjs/_commonjsHelpers-0a7b82d9.js.map +1 -0
  4. package/dist/cjs/app-globals-d58ac016.js +11 -0
  5. package/dist/cjs/app-globals-d58ac016.js.map +1 -0
  6. package/dist/cjs/archive-icon_7.cjs.entry.js +120 -0
  7. package/dist/cjs/archive-icon_7.cjs.entry.js.map +1 -0
  8. package/dist/cjs/arrow-icon.cjs.entry.js +24 -0
  9. package/dist/cjs/arrow-icon.cjs.entry.js.map +1 -0
  10. package/dist/cjs/bold-icon_3.cjs.entry.js +56 -0
  11. package/dist/cjs/bold-icon_3.cjs.entry.js.map +1 -0
  12. package/dist/cjs/calendar-cancel-icon.cjs.entry.js +24 -0
  13. package/dist/cjs/calendar-cancel-icon.cjs.entry.js.map +1 -0
  14. package/dist/cjs/calendar-check-icon_3.cjs.entry.js +56 -0
  15. package/dist/cjs/calendar-check-icon_3.cjs.entry.js.map +1 -0
  16. package/dist/cjs/calendar-icon.cjs.entry.js +24 -0
  17. package/dist/cjs/calendar-icon.cjs.entry.js.map +1 -0
  18. package/dist/cjs/chevron-icon.cjs.entry.js +24 -0
  19. package/dist/cjs/chevron-icon.cjs.entry.js.map +1 -0
  20. package/dist/cjs/close-icon_2.cjs.entry.js +40 -0
  21. package/dist/cjs/close-icon_2.cjs.entry.js.map +1 -0
  22. package/dist/cjs/document-refresh-icon.cjs.entry.js +24 -0
  23. package/dist/cjs/document-refresh-icon.cjs.entry.js.map +1 -0
  24. package/dist/cjs/duration-18b22d1b.js +84 -0
  25. package/dist/cjs/duration-18b22d1b.js.map +1 -0
  26. package/dist/cjs/elements-b06c817b.js +21585 -0
  27. package/dist/cjs/elements-b06c817b.js.map +1 -0
  28. package/dist/cjs/flow-d922fbd4.js +891 -0
  29. package/dist/cjs/flow-d922fbd4.js.map +1 -0
  30. package/dist/cjs/focus-visible-857fc8f9.js +327 -0
  31. package/dist/cjs/focus-visible-857fc8f9.js.map +1 -0
  32. package/dist/cjs/forward-icon_6.cjs.entry.js +2216 -0
  33. package/dist/cjs/forward-icon_6.cjs.entry.js.map +1 -0
  34. package/dist/cjs/globe-icon.cjs.entry.js +24 -0
  35. package/dist/cjs/globe-icon.cjs.entry.js.map +1 -0
  36. package/dist/cjs/index-34e64e2d.js +2173 -0
  37. package/dist/cjs/index-34e64e2d.js.map +1 -0
  38. package/dist/cjs/index-e869130c.js +198 -0
  39. package/dist/cjs/index-e869130c.js.map +1 -0
  40. package/dist/cjs/index.cjs.js +12 -0
  41. package/dist/cjs/index.cjs.js.map +1 -0
  42. package/dist/cjs/index.es-e78884f5.js +3217 -0
  43. package/dist/cjs/index.es-e78884f5.js.map +1 -0
  44. package/dist/cjs/loader.cjs.js +17 -0
  45. package/dist/cjs/loader.cjs.js.map +1 -0
  46. package/dist/cjs/loading-icon.cjs.entry.js +24 -0
  47. package/dist/cjs/loading-icon.cjs.entry.js.map +1 -0
  48. package/dist/cjs/mailbox-store-0b1636fa.js +529 -0
  49. package/dist/cjs/mailbox-store-0b1636fa.js.map +1 -0
  50. package/dist/cjs/nylas-booked-event-card_9.cjs.entry.js +8127 -0
  51. package/dist/cjs/nylas-booked-event-card_9.cjs.entry.js.map +1 -0
  52. package/dist/cjs/nylas-if-state_3.cjs.entry.js +409 -0
  53. package/dist/cjs/nylas-if-state_3.cjs.entry.js.map +1 -0
  54. package/dist/cjs/nylas-list-folders.cjs.entry.js +120 -0
  55. package/dist/cjs/nylas-list-folders.cjs.entry.js.map +1 -0
  56. package/dist/cjs/nylas-list-threads.cjs.entry.js +89 -0
  57. package/dist/cjs/nylas-list-threads.cjs.entry.js.map +1 -0
  58. package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js +140 -0
  59. package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js.map +1 -0
  60. package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +100 -0
  61. package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js.map +1 -0
  62. package/dist/cjs/nylas-open-hours-picker.cjs.entry.js +333 -0
  63. package/dist/cjs/nylas-open-hours-picker.cjs.entry.js.map +1 -0
  64. package/dist/cjs/nylas-provider.cjs.entry.js +184 -0
  65. package/dist/cjs/nylas-provider.cjs.entry.js.map +1 -0
  66. package/dist/cjs/nylas-scheduler.cjs.entry.js +242 -0
  67. package/dist/cjs/nylas-scheduler.cjs.entry.js.map +1 -0
  68. package/dist/cjs/nylas-threads-refresh.cjs.entry.js +118 -0
  69. package/dist/cjs/nylas-threads-refresh.cjs.entry.js.map +1 -0
  70. package/dist/cjs/nylas-threads-search.cjs.entry.js +84 -0
  71. package/dist/cjs/nylas-threads-search.cjs.entry.js.map +1 -0
  72. package/dist/cjs/nylas-view-thread.cjs.entry.js +234 -0
  73. package/dist/cjs/nylas-view-thread.cjs.entry.js.map +1 -0
  74. package/dist/cjs/nylas-web-elements.cjs.js +27 -0
  75. package/dist/cjs/nylas-web-elements.cjs.js.map +1 -0
  76. package/dist/cjs/play-icon_2.cjs.entry.js +40 -0
  77. package/dist/cjs/play-icon_2.cjs.entry.js.map +1 -0
  78. package/dist/cjs/property-d934a711.js +47 -0
  79. package/dist/cjs/property-d934a711.js.map +1 -0
  80. package/dist/cjs/refresh-icon.cjs.entry.js +24 -0
  81. package/dist/cjs/refresh-icon.cjs.entry.js.map +1 -0
  82. package/dist/cjs/register-component-f76b61a6.js +140 -0
  83. package/dist/cjs/register-component-f76b61a6.js.map +1 -0
  84. package/dist/cjs/scheduler-store-e9822441.js +254 -0
  85. package/dist/cjs/scheduler-store-e9822441.js.map +1 -0
  86. package/dist/cjs/translate-icon.cjs.entry.js +24 -0
  87. package/dist/cjs/translate-icon.cjs.entry.js.map +1 -0
  88. package/dist/cjs/utils-f91d4c73.js +161 -0
  89. package/dist/cjs/utils-f91d4c73.js.map +1 -0
  90. package/dist/collection/assets/icons/chevron.svg +3 -0
  91. package/dist/collection/collection-manifest.json +66 -0
  92. package/dist/collection/common/abstract-provider.js +231 -0
  93. package/dist/collection/common/abstract-provider.js.map +1 -0
  94. package/dist/collection/common/component-types.js +2 -0
  95. package/dist/collection/common/component-types.js.map +1 -0
  96. package/dist/collection/common/constants.js +12 -0
  97. package/dist/collection/common/constants.js.map +1 -0
  98. package/dist/collection/common/global.js +4 -0
  99. package/dist/collection/common/global.js.map +1 -0
  100. package/dist/collection/common/icons/archive.js +63 -0
  101. package/dist/collection/common/icons/archive.js.map +1 -0
  102. package/dist/collection/common/icons/arrow.js +63 -0
  103. package/dist/collection/common/icons/arrow.js.map +1 -0
  104. package/dist/collection/common/icons/bold.js +63 -0
  105. package/dist/collection/common/icons/bold.js.map +1 -0
  106. package/dist/collection/common/icons/calendar-cancel.js +63 -0
  107. package/dist/collection/common/icons/calendar-cancel.js.map +1 -0
  108. package/dist/collection/common/icons/calendar-check.js +63 -0
  109. package/dist/collection/common/icons/calendar-check.js.map +1 -0
  110. package/dist/collection/common/icons/calendar.js +63 -0
  111. package/dist/collection/common/icons/calendar.js.map +1 -0
  112. package/dist/collection/common/icons/checkmark-circle.js +63 -0
  113. package/dist/collection/common/icons/checkmark-circle.js.map +1 -0
  114. package/dist/collection/common/icons/chevron.js +63 -0
  115. package/dist/collection/common/icons/chevron.js.map +1 -0
  116. package/dist/collection/common/icons/close.js +63 -0
  117. package/dist/collection/common/icons/close.js.map +1 -0
  118. package/dist/collection/common/icons/document-refresh.js +63 -0
  119. package/dist/collection/common/icons/document-refresh.js.map +1 -0
  120. package/dist/collection/common/icons/folder.js +63 -0
  121. package/dist/collection/common/icons/folder.js.map +1 -0
  122. package/dist/collection/common/icons/forward.js +63 -0
  123. package/dist/collection/common/icons/forward.js.map +1 -0
  124. package/dist/collection/common/icons/globe.js +63 -0
  125. package/dist/collection/common/icons/globe.js.map +1 -0
  126. package/dist/collection/common/icons/icon.css +3 -0
  127. package/dist/collection/common/icons/inbox.js +63 -0
  128. package/dist/collection/common/icons/inbox.js.map +1 -0
  129. package/dist/collection/common/icons/italic.js +63 -0
  130. package/dist/collection/common/icons/italic.js.map +1 -0
  131. package/dist/collection/common/icons/loading.css +33 -0
  132. package/dist/collection/common/icons/loading.js +63 -0
  133. package/dist/collection/common/icons/loading.js.map +1 -0
  134. package/dist/collection/common/icons/nylas-logo.js +63 -0
  135. package/dist/collection/common/icons/nylas-logo.js.map +1 -0
  136. package/dist/collection/common/icons/people.js +63 -0
  137. package/dist/collection/common/icons/people.js.map +1 -0
  138. package/dist/collection/common/icons/play.js +63 -0
  139. package/dist/collection/common/icons/play.js.map +1 -0
  140. package/dist/collection/common/icons/refresh.js +63 -0
  141. package/dist/collection/common/icons/refresh.js.map +1 -0
  142. package/dist/collection/common/icons/reply-all.js +63 -0
  143. package/dist/collection/common/icons/reply-all.js.map +1 -0
  144. package/dist/collection/common/icons/reply.js +63 -0
  145. package/dist/collection/common/icons/reply.js.map +1 -0
  146. package/dist/collection/common/icons/sent.js +63 -0
  147. package/dist/collection/common/icons/sent.js.map +1 -0
  148. package/dist/collection/common/icons/spam.js +63 -0
  149. package/dist/collection/common/icons/spam.js.map +1 -0
  150. package/dist/collection/common/icons/star.js +63 -0
  151. package/dist/collection/common/icons/star.js.map +1 -0
  152. package/dist/collection/common/icons/stop.js +63 -0
  153. package/dist/collection/common/icons/stop.js.map +1 -0
  154. package/dist/collection/common/icons/translate.js +63 -0
  155. package/dist/collection/common/icons/translate.js.map +1 -0
  156. package/dist/collection/common/icons/trash.js +63 -0
  157. package/dist/collection/common/icons/trash.js.map +1 -0
  158. package/dist/collection/common/icons/underline.js +63 -0
  159. package/dist/collection/common/icons/underline.js.map +1 -0
  160. package/dist/collection/common/icons/warning.js +63 -0
  161. package/dist/collection/common/icons/warning.js.map +1 -0
  162. package/dist/collection/common/mocks/threads.js +57 -0
  163. package/dist/collection/common/mocks/threads.js.map +1 -0
  164. package/dist/collection/common/nylas-theme/index.js +4 -0
  165. package/dist/collection/common/nylas-theme/index.js.map +1 -0
  166. package/dist/collection/common/register-component.js +134 -0
  167. package/dist/collection/common/register-component.js.map +1 -0
  168. package/dist/collection/common/types.js +2 -0
  169. package/dist/collection/common/types.js.map +1 -0
  170. package/dist/collection/components/mailbox/nylas-composer/nylas-composer.css +89 -0
  171. package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js +241 -0
  172. package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js.map +1 -0
  173. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.e2e.js +10 -0
  174. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.e2e.js.map +1 -0
  175. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.js +12 -0
  176. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.js.map +1 -0
  177. package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.css +37 -0
  178. package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js +193 -0
  179. package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js.map +1 -0
  180. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.e2e.js +10 -0
  181. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.e2e.js.map +1 -0
  182. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.spec.js +12 -0
  183. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.spec.js.map +1 -0
  184. package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.css +156 -0
  185. package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js +218 -0
  186. package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js.map +1 -0
  187. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.e2e.js +22 -0
  188. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.e2e.js.map +1 -0
  189. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.spec.js +25 -0
  190. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.spec.js.map +1 -0
  191. package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.css +3 -0
  192. package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js +474 -0
  193. package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js.map +1 -0
  194. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.e2e.js +16 -0
  195. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.e2e.js.map +1 -0
  196. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.spec.js +32 -0
  197. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.spec.js.map +1 -0
  198. package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.css +55 -0
  199. package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.js +371 -0
  200. package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.js.map +1 -0
  201. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.e2e.js +10 -0
  202. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.e2e.js.map +1 -0
  203. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.spec.js +12 -0
  204. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.spec.js.map +1 -0
  205. package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.css +18 -0
  206. package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js +182 -0
  207. package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js.map +1 -0
  208. package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.css +61 -0
  209. package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js +329 -0
  210. package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js.map +1 -0
  211. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.e2e.js +10 -0
  212. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.e2e.js.map +1 -0
  213. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.spec.js +12 -0
  214. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.spec.js.map +1 -0
  215. package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.css +53 -0
  216. package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js +172 -0
  217. package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js.map +1 -0
  218. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.e2e.js +10 -0
  219. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.e2e.js.map +1 -0
  220. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.spec.js +12 -0
  221. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.spec.js.map +1 -0
  222. package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.css +8 -0
  223. package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js +130 -0
  224. package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js.map +1 -0
  225. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.e2e.js +10 -0
  226. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.e2e.js.map +1 -0
  227. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.spec.js +12 -0
  228. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.spec.js.map +1 -0
  229. package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.css +43 -0
  230. package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js +282 -0
  231. package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js.map +1 -0
  232. package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.css +243 -0
  233. package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js +342 -0
  234. package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js.map +1 -0
  235. package/dist/collection/components/mailbox/nylas-view-thread/view-thread-message.js +25 -0
  236. package/dist/collection/components/mailbox/nylas-view-thread/view-thread-message.js.map +1 -0
  237. package/dist/collection/components/nylas-if-state/nylas-if-state.css +84 -0
  238. package/dist/collection/components/nylas-if-state/nylas-if-state.js +241 -0
  239. package/dist/collection/components/nylas-if-state/nylas-if-state.js.map +1 -0
  240. package/dist/collection/components/nylas-if-state/test/nylas-if-state.e2e.js +10 -0
  241. package/dist/collection/components/nylas-if-state/test/nylas-if-state.e2e.js.map +1 -0
  242. package/dist/collection/components/nylas-if-state/test/nylas-if-state.spec.js +12 -0
  243. package/dist/collection/components/nylas-if-state/test/nylas-if-state.spec.js.map +1 -0
  244. package/dist/collection/components/nylas-login/nylas-login.css +94 -0
  245. package/dist/collection/components/nylas-login/nylas-login.js +289 -0
  246. package/dist/collection/components/nylas-login/nylas-login.js.map +1 -0
  247. package/dist/collection/components/nylas-login/test/nylas-login.e2e.js +10 -0
  248. package/dist/collection/components/nylas-login/test/nylas-login.e2e.js.map +1 -0
  249. package/dist/collection/components/nylas-login/test/nylas-login.spec.js +12 -0
  250. package/dist/collection/components/nylas-login/test/nylas-login.spec.js.map +1 -0
  251. package/dist/collection/components/nylas-provider/nylas-provider.css +3 -0
  252. package/dist/collection/components/nylas-provider/nylas-provider.js +423 -0
  253. package/dist/collection/components/nylas-provider/nylas-provider.js.map +1 -0
  254. package/dist/collection/components/nylas-provider/test/nylas-provider.e2e.js +10 -0
  255. package/dist/collection/components/nylas-provider/test/nylas-provider.e2e.js.map +1 -0
  256. package/dist/collection/components/nylas-provider/test/nylas-provider.spec.js +32 -0
  257. package/dist/collection/components/nylas-provider/test/nylas-provider.spec.js.map +1 -0
  258. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.css +155 -0
  259. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +178 -0
  260. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -0
  261. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.css +129 -0
  262. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +323 -0
  263. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -0
  264. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.css +78 -0
  265. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +107 -0
  266. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js.map +1 -0
  267. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.css +150 -0
  268. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +213 -0
  269. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -0
  270. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.css +72 -0
  271. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js +147 -0
  272. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js.map +1 -0
  273. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.css +63 -0
  274. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js +132 -0
  275. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js.map +1 -0
  276. package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.css +105 -0
  277. package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.js +460 -0
  278. package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.js.map +1 -0
  279. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.e2e.js +10 -0
  280. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.e2e.js.map +1 -0
  281. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.spec.js +12 -0
  282. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.spec.js.map +1 -0
  283. package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.css +182 -0
  284. package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.js +533 -0
  285. package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.js.map +1 -0
  286. package/dist/collection/components/scheduler/nylas-scheduler/scheduler-view.js +6 -0
  287. package/dist/collection/components/scheduler/nylas-scheduler/scheduler-view.js.map +1 -0
  288. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.css +63 -0
  289. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +150 -0
  290. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js.map +1 -0
  291. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.css +115 -0
  292. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +311 -0
  293. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -0
  294. package/dist/collection/connector/connector-interface.js +2 -0
  295. package/dist/collection/connector/connector-interface.js.map +1 -0
  296. package/dist/collection/connector/nylas-connector/index.js +78 -0
  297. package/dist/collection/connector/nylas-connector/index.js.map +1 -0
  298. package/dist/collection/connector/nylas-mailbox-connector/index.js +62 -0
  299. package/dist/collection/connector/nylas-mailbox-connector/index.js.map +1 -0
  300. package/dist/collection/connector/nylas-scheduler-connector/index.js +43 -0
  301. package/dist/collection/connector/nylas-scheduler-connector/index.js.map +1 -0
  302. package/dist/collection/connector/shared/api/auth.js +60 -0
  303. package/dist/collection/connector/shared/api/auth.js.map +1 -0
  304. package/dist/collection/connector/shared/api/folders.js +33 -0
  305. package/dist/collection/connector/shared/api/folders.js.map +1 -0
  306. package/dist/collection/connector/shared/api/messages.js +95 -0
  307. package/dist/collection/connector/shared/api/messages.js.map +1 -0
  308. package/dist/collection/connector/shared/api/scheduler.js +203 -0
  309. package/dist/collection/connector/shared/api/scheduler.js.map +1 -0
  310. package/dist/collection/connector/shared/api/threads.js +165 -0
  311. package/dist/collection/connector/shared/api/threads.js.map +1 -0
  312. package/dist/collection/index.js +4 -0
  313. package/dist/collection/index.js.map +1 -0
  314. package/dist/collection/routers/hash-router.js +109 -0
  315. package/dist/collection/routers/hash-router.js.map +1 -0
  316. package/dist/collection/routers/router-interface.js +2 -0
  317. package/dist/collection/routers/router-interface.js.map +1 -0
  318. package/dist/collection/stores/auth-store.js +18 -0
  319. package/dist/collection/stores/auth-store.js.map +1 -0
  320. package/dist/collection/stores/mailbox-store.js +42 -0
  321. package/dist/collection/stores/mailbox-store.js.map +1 -0
  322. package/dist/collection/stores/scheduler-store.js +44 -0
  323. package/dist/collection/stores/scheduler-store.js.map +1 -0
  324. package/dist/collection/utils/color-utils.js +161 -0
  325. package/dist/collection/utils/color-utils.js.map +1 -0
  326. package/dist/collection/utils/utils.js +157 -0
  327. package/dist/collection/utils/utils.js.map +1 -0
  328. package/dist/collection/utils/utils.spec.js +16 -0
  329. package/dist/collection/utils/utils.spec.js.map +1 -0
  330. package/dist/components/_commonjsHelpers.js +20 -0
  331. package/dist/components/_commonjsHelpers.js.map +1 -0
  332. package/dist/components/archive-icon.d.ts +11 -0
  333. package/dist/components/archive-icon.js +8 -0
  334. package/dist/components/archive-icon.js.map +1 -0
  335. package/dist/components/archive.js +37 -0
  336. package/dist/components/archive.js.map +1 -0
  337. package/dist/components/arrow-icon.d.ts +11 -0
  338. package/dist/components/arrow-icon.js +8 -0
  339. package/dist/components/arrow-icon.js.map +1 -0
  340. package/dist/components/arrow.js +37 -0
  341. package/dist/components/arrow.js.map +1 -0
  342. package/dist/components/assets/chevron.svg +3 -0
  343. package/dist/components/bold-icon.d.ts +11 -0
  344. package/dist/components/bold-icon.js +8 -0
  345. package/dist/components/bold-icon.js.map +1 -0
  346. package/dist/components/bold.js +37 -0
  347. package/dist/components/bold.js.map +1 -0
  348. package/dist/components/calendar-cancel-icon.d.ts +11 -0
  349. package/dist/components/calendar-cancel-icon.js +8 -0
  350. package/dist/components/calendar-cancel-icon.js.map +1 -0
  351. package/dist/components/calendar-cancel.js +37 -0
  352. package/dist/components/calendar-cancel.js.map +1 -0
  353. package/dist/components/calendar-check-icon.d.ts +11 -0
  354. package/dist/components/calendar-check-icon.js +8 -0
  355. package/dist/components/calendar-check-icon.js.map +1 -0
  356. package/dist/components/calendar-check.js +37 -0
  357. package/dist/components/calendar-check.js.map +1 -0
  358. package/dist/components/calendar-icon.d.ts +11 -0
  359. package/dist/components/calendar-icon.js +8 -0
  360. package/dist/components/calendar-icon.js.map +1 -0
  361. package/dist/components/calendar.js +37 -0
  362. package/dist/components/calendar.js.map +1 -0
  363. package/dist/components/checkmark-circle-icon.d.ts +11 -0
  364. package/dist/components/checkmark-circle-icon.js +8 -0
  365. package/dist/components/checkmark-circle-icon.js.map +1 -0
  366. package/dist/components/checkmark-circle.js +37 -0
  367. package/dist/components/checkmark-circle.js.map +1 -0
  368. package/dist/components/chevron-icon.d.ts +11 -0
  369. package/dist/components/chevron-icon.js +8 -0
  370. package/dist/components/chevron-icon.js.map +1 -0
  371. package/dist/components/chevron.js +37 -0
  372. package/dist/components/chevron.js.map +1 -0
  373. package/dist/components/close-icon.d.ts +11 -0
  374. package/dist/components/close-icon.js +8 -0
  375. package/dist/components/close-icon.js.map +1 -0
  376. package/dist/components/close.js +37 -0
  377. package/dist/components/close.js.map +1 -0
  378. package/dist/components/constants.js +7296 -0
  379. package/dist/components/constants.js.map +1 -0
  380. package/dist/components/define-element.js +40 -0
  381. package/dist/components/define-element.js.map +1 -0
  382. package/dist/components/document-refresh-icon.d.ts +11 -0
  383. package/dist/components/document-refresh-icon.js +40 -0
  384. package/dist/components/document-refresh-icon.js.map +1 -0
  385. package/dist/components/duration.js +78 -0
  386. package/dist/components/duration.js.map +1 -0
  387. package/dist/components/elements.js +21583 -0
  388. package/dist/components/elements.js.map +1 -0
  389. package/dist/components/flow.js +888 -0
  390. package/dist/components/flow.js.map +1 -0
  391. package/dist/components/focus-visible.js +325 -0
  392. package/dist/components/focus-visible.js.map +1 -0
  393. package/dist/components/folder-icon.d.ts +11 -0
  394. package/dist/components/folder-icon.js +8 -0
  395. package/dist/components/folder-icon.js.map +1 -0
  396. package/dist/components/folder.js +37 -0
  397. package/dist/components/folder.js.map +1 -0
  398. package/dist/components/forward-icon.d.ts +11 -0
  399. package/dist/components/forward-icon.js +8 -0
  400. package/dist/components/forward-icon.js.map +1 -0
  401. package/dist/components/forward.js +37 -0
  402. package/dist/components/forward.js.map +1 -0
  403. package/dist/components/globe-icon.d.ts +11 -0
  404. package/dist/components/globe-icon.js +8 -0
  405. package/dist/components/globe-icon.js.map +1 -0
  406. package/dist/components/globe.js +37 -0
  407. package/dist/components/globe.js.map +1 -0
  408. package/dist/components/inbox-icon.d.ts +11 -0
  409. package/dist/components/inbox-icon.js +8 -0
  410. package/dist/components/inbox-icon.js.map +1 -0
  411. package/dist/components/inbox.js +37 -0
  412. package/dist/components/inbox.js.map +1 -0
  413. package/dist/components/index.d.ts +33 -0
  414. package/dist/components/index.es.js +3211 -0
  415. package/dist/components/index.es.js.map +1 -0
  416. package/dist/components/index.js +16 -0
  417. package/dist/components/index.js.map +1 -0
  418. package/dist/components/index2.js +196 -0
  419. package/dist/components/index2.js.map +1 -0
  420. package/dist/components/italic-icon.d.ts +11 -0
  421. package/dist/components/italic-icon.js +8 -0
  422. package/dist/components/italic-icon.js.map +1 -0
  423. package/dist/components/italic.js +37 -0
  424. package/dist/components/italic.js.map +1 -0
  425. package/dist/components/loading-icon.d.ts +11 -0
  426. package/dist/components/loading-icon.js +8 -0
  427. package/dist/components/loading-icon.js.map +1 -0
  428. package/dist/components/loading.js +38 -0
  429. package/dist/components/loading.js.map +1 -0
  430. package/dist/components/mailbox-store.js +521 -0
  431. package/dist/components/mailbox-store.js.map +1 -0
  432. package/dist/components/nylas-booked-event-card.d.ts +11 -0
  433. package/dist/components/nylas-booked-event-card.js +8 -0
  434. package/dist/components/nylas-booked-event-card.js.map +1 -0
  435. package/dist/components/nylas-booked-event-card2.js +121 -0
  436. package/dist/components/nylas-booked-event-card2.js.map +1 -0
  437. package/dist/components/nylas-booking-form.d.ts +11 -0
  438. package/dist/components/nylas-booking-form.js +8 -0
  439. package/dist/components/nylas-booking-form.js.map +1 -0
  440. package/dist/components/nylas-booking-form2.js +224 -0
  441. package/dist/components/nylas-booking-form2.js.map +1 -0
  442. package/dist/components/nylas-cancelled-event-card.d.ts +11 -0
  443. package/dist/components/nylas-cancelled-event-card.js +8 -0
  444. package/dist/components/nylas-cancelled-event-card.js.map +1 -0
  445. package/dist/components/nylas-cancelled-event-card2.js +85 -0
  446. package/dist/components/nylas-cancelled-event-card2.js.map +1 -0
  447. package/dist/components/nylas-composer.d.ts +11 -0
  448. package/dist/components/nylas-composer.js +8 -0
  449. package/dist/components/nylas-composer.js.map +1 -0
  450. package/dist/components/nylas-composer2.js +186 -0
  451. package/dist/components/nylas-composer2.js.map +1 -0
  452. package/dist/components/nylas-date-picker.d.ts +11 -0
  453. package/dist/components/nylas-date-picker.js +8 -0
  454. package/dist/components/nylas-date-picker.js.map +1 -0
  455. package/dist/components/nylas-date-picker2.js +150 -0
  456. package/dist/components/nylas-date-picker2.js.map +1 -0
  457. package/dist/components/nylas-if-state.d.ts +11 -0
  458. package/dist/components/nylas-if-state.js +153 -0
  459. package/dist/components/nylas-if-state.js.map +1 -0
  460. package/dist/components/nylas-list-folders.d.ts +11 -0
  461. package/dist/components/nylas-list-folders.js +183 -0
  462. package/dist/components/nylas-list-folders.js.map +1 -0
  463. package/dist/components/nylas-list-threads.d.ts +11 -0
  464. package/dist/components/nylas-list-threads.js +109 -0
  465. package/dist/components/nylas-list-threads.js.map +1 -0
  466. package/dist/components/nylas-locale-switch.d.ts +11 -0
  467. package/dist/components/nylas-locale-switch.js +8 -0
  468. package/dist/components/nylas-locale-switch.js.map +1 -0
  469. package/dist/components/nylas-locale-switch2.js +103 -0
  470. package/dist/components/nylas-locale-switch2.js.map +1 -0
  471. package/dist/components/nylas-login.d.ts +11 -0
  472. package/dist/components/nylas-login.js +127 -0
  473. package/dist/components/nylas-login.js.map +1 -0
  474. package/dist/components/nylas-logo.d.ts +11 -0
  475. package/dist/components/nylas-logo.js +8 -0
  476. package/dist/components/nylas-logo.js.map +1 -0
  477. package/dist/components/nylas-logo2.js +37 -0
  478. package/dist/components/nylas-logo2.js.map +1 -0
  479. package/dist/components/nylas-mailbox-pagination.d.ts +11 -0
  480. package/dist/components/nylas-mailbox-pagination.js +175 -0
  481. package/dist/components/nylas-mailbox-pagination.js.map +1 -0
  482. package/dist/components/nylas-mailbox-toolbar-button.d.ts +11 -0
  483. package/dist/components/nylas-mailbox-toolbar-button.js +119 -0
  484. package/dist/components/nylas-mailbox-toolbar-button.js.map +1 -0
  485. package/dist/components/nylas-mailbox.d.ts +11 -0
  486. package/dist/components/nylas-mailbox.js +219 -0
  487. package/dist/components/nylas-mailbox.js.map +1 -0
  488. package/dist/components/nylas-notification.d.ts +11 -0
  489. package/dist/components/nylas-notification.js +8 -0
  490. package/dist/components/nylas-notification.js.map +1 -0
  491. package/dist/components/nylas-notification2.js +90 -0
  492. package/dist/components/nylas-notification2.js.map +1 -0
  493. package/dist/components/nylas-open-hours-picker.d.ts +11 -0
  494. package/dist/components/nylas-open-hours-picker.js +365 -0
  495. package/dist/components/nylas-open-hours-picker.js.map +1 -0
  496. package/dist/components/nylas-provider.d.ts +11 -0
  497. package/dist/components/nylas-provider.js +206 -0
  498. package/dist/components/nylas-provider.js.map +1 -0
  499. package/dist/components/nylas-scheduler.d.ts +11 -0
  500. package/dist/components/nylas-scheduler.js +392 -0
  501. package/dist/components/nylas-scheduler.js.map +1 -0
  502. package/dist/components/nylas-selected-event-card.d.ts +11 -0
  503. package/dist/components/nylas-selected-event-card.js +8 -0
  504. package/dist/components/nylas-selected-event-card.js.map +1 -0
  505. package/dist/components/nylas-selected-event-card2.js +110 -0
  506. package/dist/components/nylas-selected-event-card2.js.map +1 -0
  507. package/dist/components/nylas-summarize-message-button.d.ts +11 -0
  508. package/dist/components/nylas-summarize-message-button.js +8 -0
  509. package/dist/components/nylas-summarize-message-button.js.map +1 -0
  510. package/dist/components/nylas-summarize-message-button2.js +233 -0
  511. package/dist/components/nylas-summarize-message-button2.js.map +1 -0
  512. package/dist/components/nylas-threads-refresh.d.ts +11 -0
  513. package/dist/components/nylas-threads-refresh.js +149 -0
  514. package/dist/components/nylas-threads-refresh.js.map +1 -0
  515. package/dist/components/nylas-threads-search.d.ts +11 -0
  516. package/dist/components/nylas-threads-search.js +103 -0
  517. package/dist/components/nylas-threads-search.js.map +1 -0
  518. package/dist/components/nylas-timeslot-picker.d.ts +11 -0
  519. package/dist/components/nylas-timeslot-picker.js +8 -0
  520. package/dist/components/nylas-timeslot-picker.js.map +1 -0
  521. package/dist/components/nylas-timeslot-picker2.js +174 -0
  522. package/dist/components/nylas-timeslot-picker2.js.map +1 -0
  523. package/dist/components/nylas-view-email.d.ts +11 -0
  524. package/dist/components/nylas-view-email.js +8 -0
  525. package/dist/components/nylas-view-email.js.map +1 -0
  526. package/dist/components/nylas-view-email2.js +1859 -0
  527. package/dist/components/nylas-view-email2.js.map +1 -0
  528. package/dist/components/nylas-view-thread.d.ts +11 -0
  529. package/dist/components/nylas-view-thread.js +338 -0
  530. package/dist/components/nylas-view-thread.js.map +1 -0
  531. package/dist/components/people-icon.d.ts +11 -0
  532. package/dist/components/people-icon.js +8 -0
  533. package/dist/components/people-icon.js.map +1 -0
  534. package/dist/components/people.js +37 -0
  535. package/dist/components/people.js.map +1 -0
  536. package/dist/components/play-icon.d.ts +11 -0
  537. package/dist/components/play-icon.js +8 -0
  538. package/dist/components/play-icon.js.map +1 -0
  539. package/dist/components/play.js +37 -0
  540. package/dist/components/play.js.map +1 -0
  541. package/dist/components/property.js +36 -0
  542. package/dist/components/property.js.map +1 -0
  543. package/dist/components/refresh-icon.d.ts +11 -0
  544. package/dist/components/refresh-icon.js +8 -0
  545. package/dist/components/refresh-icon.js.map +1 -0
  546. package/dist/components/refresh.js +37 -0
  547. package/dist/components/refresh.js.map +1 -0
  548. package/dist/components/register-component.js +138 -0
  549. package/dist/components/register-component.js.map +1 -0
  550. package/dist/components/reply-all-icon.d.ts +11 -0
  551. package/dist/components/reply-all-icon.js +8 -0
  552. package/dist/components/reply-all-icon.js.map +1 -0
  553. package/dist/components/reply-all.js +37 -0
  554. package/dist/components/reply-all.js.map +1 -0
  555. package/dist/components/reply-icon.d.ts +11 -0
  556. package/dist/components/reply-icon.js +8 -0
  557. package/dist/components/reply-icon.js.map +1 -0
  558. package/dist/components/reply.js +37 -0
  559. package/dist/components/reply.js.map +1 -0
  560. package/dist/components/scheduler-store.js +251 -0
  561. package/dist/components/scheduler-store.js.map +1 -0
  562. package/dist/components/sent-icon.d.ts +11 -0
  563. package/dist/components/sent-icon.js +8 -0
  564. package/dist/components/sent-icon.js.map +1 -0
  565. package/dist/components/sent.js +37 -0
  566. package/dist/components/sent.js.map +1 -0
  567. package/dist/components/sp-icon-chevron-left.js +23 -0
  568. package/dist/components/sp-icon-chevron-left.js.map +1 -0
  569. package/dist/components/spam-icon.d.ts +11 -0
  570. package/dist/components/spam-icon.js +8 -0
  571. package/dist/components/spam-icon.js.map +1 -0
  572. package/dist/components/spam.js +37 -0
  573. package/dist/components/spam.js.map +1 -0
  574. package/dist/components/star-icon.d.ts +11 -0
  575. package/dist/components/star-icon.js +8 -0
  576. package/dist/components/star-icon.js.map +1 -0
  577. package/dist/components/star.js +37 -0
  578. package/dist/components/star.js.map +1 -0
  579. package/dist/components/stop-icon.d.ts +11 -0
  580. package/dist/components/stop-icon.js +8 -0
  581. package/dist/components/stop-icon.js.map +1 -0
  582. package/dist/components/stop.js +37 -0
  583. package/dist/components/stop.js.map +1 -0
  584. package/dist/components/translate-icon.d.ts +11 -0
  585. package/dist/components/translate-icon.js +8 -0
  586. package/dist/components/translate-icon.js.map +1 -0
  587. package/dist/components/translate.js +37 -0
  588. package/dist/components/translate.js.map +1 -0
  589. package/dist/components/trash-icon.d.ts +11 -0
  590. package/dist/components/trash-icon.js +8 -0
  591. package/dist/components/trash-icon.js.map +1 -0
  592. package/dist/components/trash.js +37 -0
  593. package/dist/components/trash.js.map +1 -0
  594. package/dist/components/underline-icon.d.ts +11 -0
  595. package/dist/components/underline-icon.js +8 -0
  596. package/dist/components/underline-icon.js.map +1 -0
  597. package/dist/components/underline.js +37 -0
  598. package/dist/components/underline.js.map +1 -0
  599. package/dist/components/utils.js +140 -0
  600. package/dist/components/utils.js.map +1 -0
  601. package/dist/components/warning-icon.d.ts +11 -0
  602. package/dist/components/warning-icon.js +8 -0
  603. package/dist/components/warning-icon.js.map +1 -0
  604. package/dist/components/warning.js +37 -0
  605. package/dist/components/warning.js.map +1 -0
  606. package/dist/esm/_commonjsHelpers-57e89916.js +20 -0
  607. package/dist/esm/_commonjsHelpers-57e89916.js.map +1 -0
  608. package/dist/esm/app-globals-47969cee.js +9 -0
  609. package/dist/esm/app-globals-47969cee.js.map +1 -0
  610. package/dist/esm/archive-icon_7.entry.js +110 -0
  611. package/dist/esm/archive-icon_7.entry.js.map +1 -0
  612. package/dist/esm/arrow-icon.entry.js +20 -0
  613. package/dist/esm/arrow-icon.entry.js.map +1 -0
  614. package/dist/esm/bold-icon_3.entry.js +50 -0
  615. package/dist/esm/bold-icon_3.entry.js.map +1 -0
  616. package/dist/esm/calendar-cancel-icon.entry.js +20 -0
  617. package/dist/esm/calendar-cancel-icon.entry.js.map +1 -0
  618. package/dist/esm/calendar-check-icon_3.entry.js +50 -0
  619. package/dist/esm/calendar-check-icon_3.entry.js.map +1 -0
  620. package/dist/esm/calendar-icon.entry.js +20 -0
  621. package/dist/esm/calendar-icon.entry.js.map +1 -0
  622. package/dist/esm/chevron-icon.entry.js +20 -0
  623. package/dist/esm/chevron-icon.entry.js.map +1 -0
  624. package/dist/esm/close-icon_2.entry.js +35 -0
  625. package/dist/esm/close-icon_2.entry.js.map +1 -0
  626. package/dist/esm/document-refresh-icon.entry.js +20 -0
  627. package/dist/esm/document-refresh-icon.entry.js.map +1 -0
  628. package/dist/esm/duration-bddc4a13.js +78 -0
  629. package/dist/esm/duration-bddc4a13.js.map +1 -0
  630. package/dist/esm/elements-60ebdb01.js +21583 -0
  631. package/dist/esm/elements-60ebdb01.js.map +1 -0
  632. package/dist/esm/flow-40ff9cea.js +888 -0
  633. package/dist/esm/flow-40ff9cea.js.map +1 -0
  634. package/dist/esm/focus-visible-e8093c16.js +325 -0
  635. package/dist/esm/focus-visible-e8093c16.js.map +1 -0
  636. package/dist/esm/forward-icon_6.entry.js +2207 -0
  637. package/dist/esm/forward-icon_6.entry.js.map +1 -0
  638. package/dist/esm/globe-icon.entry.js +20 -0
  639. package/dist/esm/globe-icon.entry.js.map +1 -0
  640. package/dist/esm/index-2b85580a.js +196 -0
  641. package/dist/esm/index-2b85580a.js.map +1 -0
  642. package/dist/esm/index-b2270b4a.js +2141 -0
  643. package/dist/esm/index-b2270b4a.js.map +1 -0
  644. package/dist/esm/index.es-6f3582a1.js +3211 -0
  645. package/dist/esm/index.es-6f3582a1.js.map +1 -0
  646. package/dist/esm/index.js +8 -0
  647. package/dist/esm/index.js.map +1 -0
  648. package/dist/esm/loader.js +13 -0
  649. package/dist/esm/loader.js.map +1 -0
  650. package/dist/esm/loading-icon.entry.js +20 -0
  651. package/dist/esm/loading-icon.entry.js.map +1 -0
  652. package/dist/esm/mailbox-store-0019772c.js +521 -0
  653. package/dist/esm/mailbox-store-0019772c.js.map +1 -0
  654. package/dist/esm/nylas-booked-event-card_9.entry.js +8115 -0
  655. package/dist/esm/nylas-booked-event-card_9.entry.js.map +1 -0
  656. package/dist/esm/nylas-if-state_3.entry.js +403 -0
  657. package/dist/esm/nylas-if-state_3.entry.js.map +1 -0
  658. package/dist/esm/nylas-list-folders.entry.js +116 -0
  659. package/dist/esm/nylas-list-folders.entry.js.map +1 -0
  660. package/dist/esm/nylas-list-threads.entry.js +85 -0
  661. package/dist/esm/nylas-list-threads.entry.js.map +1 -0
  662. package/dist/esm/nylas-mailbox-pagination.entry.js +136 -0
  663. package/dist/esm/nylas-mailbox-pagination.entry.js.map +1 -0
  664. package/dist/esm/nylas-mailbox-toolbar-button.entry.js +96 -0
  665. package/dist/esm/nylas-mailbox-toolbar-button.entry.js.map +1 -0
  666. package/dist/esm/nylas-open-hours-picker.entry.js +329 -0
  667. package/dist/esm/nylas-open-hours-picker.entry.js.map +1 -0
  668. package/dist/esm/nylas-provider.entry.js +180 -0
  669. package/dist/esm/nylas-provider.entry.js.map +1 -0
  670. package/dist/esm/nylas-scheduler.entry.js +238 -0
  671. package/dist/esm/nylas-scheduler.entry.js.map +1 -0
  672. package/dist/esm/nylas-threads-refresh.entry.js +114 -0
  673. package/dist/esm/nylas-threads-refresh.entry.js.map +1 -0
  674. package/dist/esm/nylas-threads-search.entry.js +80 -0
  675. package/dist/esm/nylas-threads-search.entry.js.map +1 -0
  676. package/dist/esm/nylas-view-thread.entry.js +230 -0
  677. package/dist/esm/nylas-view-thread.entry.js.map +1 -0
  678. package/dist/esm/nylas-web-elements.js +22 -0
  679. package/dist/esm/nylas-web-elements.js.map +1 -0
  680. package/dist/esm/play-icon_2.entry.js +35 -0
  681. package/dist/esm/play-icon_2.entry.js.map +1 -0
  682. package/dist/esm/polyfills/core-js.js +11 -0
  683. package/dist/esm/polyfills/dom.js +79 -0
  684. package/dist/esm/polyfills/es5-html-element.js +1 -0
  685. package/dist/esm/polyfills/index.js +34 -0
  686. package/dist/esm/polyfills/system.js +6 -0
  687. package/dist/esm/property-0065dde7.js +36 -0
  688. package/dist/esm/property-0065dde7.js.map +1 -0
  689. package/dist/esm/refresh-icon.entry.js +20 -0
  690. package/dist/esm/refresh-icon.entry.js.map +1 -0
  691. package/dist/esm/register-component-55376f31.js +138 -0
  692. package/dist/esm/register-component-55376f31.js.map +1 -0
  693. package/dist/esm/scheduler-store-5a39585a.js +251 -0
  694. package/dist/esm/scheduler-store-5a39585a.js.map +1 -0
  695. package/dist/esm/translate-icon.entry.js +20 -0
  696. package/dist/esm/translate-icon.entry.js.map +1 -0
  697. package/dist/esm/utils-5074a070.js +140 -0
  698. package/dist/esm/utils-5074a070.js.map +1 -0
  699. package/dist/index.cjs.js +1 -0
  700. package/dist/index.js +1 -0
  701. package/dist/nylas-web-elements/index.esm.js +2 -0
  702. package/dist/nylas-web-elements/index.esm.js.map +1 -0
  703. package/dist/nylas-web-elements/nylas-web-elements.css +239 -0
  704. package/dist/nylas-web-elements/nylas-web-elements.esm.js +2 -0
  705. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -0
  706. package/dist/nylas-web-elements/p-06974d68.js +2 -0
  707. package/dist/nylas-web-elements/p-06974d68.js.map +1 -0
  708. package/dist/nylas-web-elements/p-113fe52e.entry.js +2 -0
  709. package/dist/nylas-web-elements/p-113fe52e.entry.js.map +1 -0
  710. package/dist/nylas-web-elements/p-16fb3c85.entry.js +2 -0
  711. package/dist/nylas-web-elements/p-16fb3c85.entry.js.map +1 -0
  712. package/dist/nylas-web-elements/p-24c42c37.entry.js +2 -0
  713. package/dist/nylas-web-elements/p-24c42c37.entry.js.map +1 -0
  714. package/dist/nylas-web-elements/p-2881b62f.js +16519 -0
  715. package/dist/nylas-web-elements/p-2881b62f.js.map +1 -0
  716. package/dist/nylas-web-elements/p-33da6cf1.entry.js +2 -0
  717. package/dist/nylas-web-elements/p-33da6cf1.entry.js.map +1 -0
  718. package/dist/nylas-web-elements/p-37f99b96.entry.js +2 -0
  719. package/dist/nylas-web-elements/p-37f99b96.entry.js.map +1 -0
  720. package/dist/nylas-web-elements/p-3bc3426e.entry.js +2 -0
  721. package/dist/nylas-web-elements/p-3bc3426e.entry.js.map +1 -0
  722. package/dist/nylas-web-elements/p-3c8822f1.entry.js +2 -0
  723. package/dist/nylas-web-elements/p-3c8822f1.entry.js.map +1 -0
  724. package/dist/nylas-web-elements/p-5770704d.js +2 -0
  725. package/dist/nylas-web-elements/p-5770704d.js.map +1 -0
  726. package/dist/nylas-web-elements/p-5862975b.js +2 -0
  727. package/dist/nylas-web-elements/p-5862975b.js.map +1 -0
  728. package/dist/nylas-web-elements/p-647cf7be.entry.js +2 -0
  729. package/dist/nylas-web-elements/p-647cf7be.entry.js.map +1 -0
  730. package/dist/nylas-web-elements/p-663edeb8.entry.js +2 -0
  731. package/dist/nylas-web-elements/p-663edeb8.entry.js.map +1 -0
  732. package/dist/nylas-web-elements/p-67c9158e.entry.js +2 -0
  733. package/dist/nylas-web-elements/p-67c9158e.entry.js.map +1 -0
  734. package/dist/nylas-web-elements/p-6ba7a037.js +2 -0
  735. package/dist/nylas-web-elements/p-6ba7a037.js.map +1 -0
  736. package/dist/nylas-web-elements/p-6da0b8f0.entry.js +2 -0
  737. package/dist/nylas-web-elements/p-6da0b8f0.entry.js.map +1 -0
  738. package/dist/nylas-web-elements/p-6df00ba0.js +27 -0
  739. package/dist/nylas-web-elements/p-6df00ba0.js.map +1 -0
  740. package/dist/nylas-web-elements/p-74141ef6.entry.js +2 -0
  741. package/dist/nylas-web-elements/p-74141ef6.entry.js.map +1 -0
  742. package/dist/nylas-web-elements/p-85d41197.entry.js +2 -0
  743. package/dist/nylas-web-elements/p-85d41197.entry.js.map +1 -0
  744. package/dist/nylas-web-elements/p-97518578.entry.js +2 -0
  745. package/dist/nylas-web-elements/p-97518578.entry.js.map +1 -0
  746. package/dist/nylas-web-elements/p-98ec4a7a.js +2 -0
  747. package/dist/nylas-web-elements/p-98ec4a7a.js.map +1 -0
  748. package/dist/nylas-web-elements/p-998d25d5.entry.js +2 -0
  749. package/dist/nylas-web-elements/p-998d25d5.entry.js.map +1 -0
  750. package/dist/nylas-web-elements/p-a7bfd3af.entry.js +77 -0
  751. package/dist/nylas-web-elements/p-a7bfd3af.entry.js.map +1 -0
  752. package/dist/nylas-web-elements/p-a95208c7.js +2 -0
  753. package/dist/nylas-web-elements/p-a95208c7.js.map +1 -0
  754. package/dist/nylas-web-elements/p-adacdaeb.entry.js +2 -0
  755. package/dist/nylas-web-elements/p-adacdaeb.entry.js.map +1 -0
  756. package/dist/nylas-web-elements/p-b7d4b7b5.entry.js +2 -0
  757. package/dist/nylas-web-elements/p-b7d4b7b5.entry.js.map +1 -0
  758. package/dist/nylas-web-elements/p-b85dfeac.entry.js +2 -0
  759. package/dist/nylas-web-elements/p-b85dfeac.entry.js.map +1 -0
  760. package/dist/nylas-web-elements/p-b96b37f1.entry.js +2 -0
  761. package/dist/nylas-web-elements/p-b96b37f1.entry.js.map +1 -0
  762. package/dist/nylas-web-elements/p-c2e69618.entry.js +2 -0
  763. package/dist/nylas-web-elements/p-c2e69618.entry.js.map +1 -0
  764. package/dist/nylas-web-elements/p-c440f148.entry.js +2 -0
  765. package/dist/nylas-web-elements/p-c440f148.entry.js.map +1 -0
  766. package/dist/nylas-web-elements/p-c66e27d0.js +3 -0
  767. package/dist/nylas-web-elements/p-c66e27d0.js.map +1 -0
  768. package/dist/nylas-web-elements/p-c685e944.entry.js +3 -0
  769. package/dist/nylas-web-elements/p-c685e944.entry.js.map +1 -0
  770. package/dist/nylas-web-elements/p-cb65c223.js +2 -0
  771. package/dist/nylas-web-elements/p-cb65c223.js.map +1 -0
  772. package/dist/nylas-web-elements/p-cc21d351.js +17 -0
  773. package/dist/nylas-web-elements/p-cc21d351.js.map +1 -0
  774. package/dist/nylas-web-elements/p-d4b1e3e4.entry.js +2 -0
  775. package/dist/nylas-web-elements/p-d4b1e3e4.entry.js.map +1 -0
  776. package/dist/nylas-web-elements/p-db24cc70.entry.js +2 -0
  777. package/dist/nylas-web-elements/p-db24cc70.entry.js.map +1 -0
  778. package/dist/nylas-web-elements/p-de1bcc4a.js +2 -0
  779. package/dist/nylas-web-elements/p-de1bcc4a.js.map +1 -0
  780. package/dist/nylas-web-elements/p-df9f71ea.js +2 -0
  781. package/dist/nylas-web-elements/p-df9f71ea.js.map +1 -0
  782. package/dist/nylas-web-elements/p-eeb0a591.js +2 -0
  783. package/dist/nylas-web-elements/p-eeb0a591.js.map +1 -0
  784. package/dist/nylas-web-elements/p-f029c1b7.entry.js +2 -0
  785. package/dist/nylas-web-elements/p-f029c1b7.entry.js.map +1 -0
  786. package/dist/nylas-web-elements/p-f9a4758a.entry.js +2 -0
  787. package/dist/nylas-web-elements/p-f9a4758a.entry.js.map +1 -0
  788. package/dist/types/common/abstract-provider.d.ts +52 -0
  789. package/dist/types/common/component-types.d.ts +22 -0
  790. package/dist/types/common/constants.d.ts +6 -0
  791. package/dist/types/common/global.d.ts +1 -0
  792. package/dist/types/common/icons/archive.d.ts +5 -0
  793. package/dist/types/common/icons/arrow.d.ts +5 -0
  794. package/dist/types/common/icons/bold.d.ts +5 -0
  795. package/dist/types/common/icons/calendar-cancel.d.ts +5 -0
  796. package/dist/types/common/icons/calendar-check.d.ts +5 -0
  797. package/dist/types/common/icons/calendar.d.ts +5 -0
  798. package/dist/types/common/icons/checkmark-circle.d.ts +5 -0
  799. package/dist/types/common/icons/chevron.d.ts +5 -0
  800. package/dist/types/common/icons/close.d.ts +5 -0
  801. package/dist/types/common/icons/document-refresh.d.ts +5 -0
  802. package/dist/types/common/icons/folder.d.ts +5 -0
  803. package/dist/types/common/icons/forward.d.ts +5 -0
  804. package/dist/types/common/icons/globe.d.ts +5 -0
  805. package/dist/types/common/icons/inbox.d.ts +5 -0
  806. package/dist/types/common/icons/italic.d.ts +5 -0
  807. package/dist/types/common/icons/loading.d.ts +5 -0
  808. package/dist/types/common/icons/nylas-logo.d.ts +5 -0
  809. package/dist/types/common/icons/people.d.ts +5 -0
  810. package/dist/types/common/icons/play.d.ts +5 -0
  811. package/dist/types/common/icons/refresh.d.ts +5 -0
  812. package/dist/types/common/icons/reply-all.d.ts +5 -0
  813. package/dist/types/common/icons/reply.d.ts +5 -0
  814. package/dist/types/common/icons/sent.d.ts +5 -0
  815. package/dist/types/common/icons/spam.d.ts +5 -0
  816. package/dist/types/common/icons/star.d.ts +5 -0
  817. package/dist/types/common/icons/stop.d.ts +5 -0
  818. package/dist/types/common/icons/translate.d.ts +5 -0
  819. package/dist/types/common/icons/trash.d.ts +5 -0
  820. package/dist/types/common/icons/underline.d.ts +5 -0
  821. package/dist/types/common/icons/warning.d.ts +5 -0
  822. package/dist/types/common/mocks/threads.d.ts +3 -0
  823. package/dist/types/common/nylas-theme/index.d.ts +27 -0
  824. package/dist/types/common/register-component.d.ts +29 -0
  825. package/dist/types/common/types.d.ts +108 -0
  826. package/dist/types/components/mailbox/nylas-composer/nylas-composer.d.ts +22 -0
  827. package/dist/types/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.d.ts +1 -0
  828. package/dist/types/components/mailbox/nylas-list-folders/nylas-list-folders.d.ts +19 -0
  829. package/dist/types/components/mailbox/nylas-list-threads/nylas-list-threads.d.ts +19 -0
  830. package/dist/types/components/mailbox/nylas-mailbox/nylas-mailbox.d.ts +35 -0
  831. package/dist/types/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.d.ts +30 -0
  832. package/dist/types/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.d.ts +26 -0
  833. package/dist/types/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.d.ts +25 -0
  834. package/dist/types/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.d.ts +23 -0
  835. package/dist/types/components/mailbox/nylas-threads-search/nylas-threads-search.d.ts +13 -0
  836. package/dist/types/components/mailbox/nylas-view-email/nylas-view-email.d.ts +25 -0
  837. package/dist/types/components/mailbox/nylas-view-thread/nylas-view-thread.d.ts +30 -0
  838. package/dist/types/components/mailbox/nylas-view-thread/view-thread-message.d.ts +12 -0
  839. package/dist/types/components/nylas-if-state/nylas-if-state.d.ts +22 -0
  840. package/dist/types/components/nylas-login/nylas-login.d.ts +26 -0
  841. package/dist/types/components/nylas-provider/nylas-provider.d.ts +35 -0
  842. package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +22 -0
  843. package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +33 -0
  844. package/dist/types/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.d.ts +13 -0
  845. package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +19 -0
  846. package/dist/types/components/scheduler/nylas-locale-switch/nylas-locale-switch.d.ts +13 -0
  847. package/dist/types/components/scheduler/nylas-notification/nylas-notification.d.ts +13 -0
  848. package/dist/types/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.d.ts +40 -0
  849. package/dist/types/components/scheduler/nylas-scheduler/nylas-scheduler.d.ts +41 -0
  850. package/dist/types/components/scheduler/nylas-scheduler/scheduler-view.d.ts +6 -0
  851. package/dist/types/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.d.ts +15 -0
  852. package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +28 -0
  853. package/dist/types/components.d.ts +2123 -0
  854. package/dist/types/connector/connector-interface.d.ts +35 -0
  855. package/dist/types/connector/nylas-connector/index.d.ts +59 -0
  856. package/dist/types/connector/nylas-mailbox-connector/index.d.ts +52 -0
  857. package/dist/types/connector/nylas-scheduler-connector/index.d.ts +24 -0
  858. package/dist/types/connector/shared/api/auth.d.ts +13 -0
  859. package/dist/types/connector/shared/api/folders.d.ts +10 -0
  860. package/dist/types/connector/shared/api/messages.d.ts +13 -0
  861. package/dist/types/connector/shared/api/scheduler.d.ts +29 -0
  862. package/dist/types/connector/shared/api/threads.d.ts +20 -0
  863. package/dist/types/index.d.ts +4 -0
  864. package/dist/types/routers/hash-router.d.ts +21 -0
  865. package/dist/types/routers/router-interface.d.ts +16 -0
  866. package/dist/types/stencil-public-runtime.d.ts +1681 -0
  867. package/dist/types/stores/auth-store.d.ts +9 -0
  868. package/dist/types/stores/mailbox-store.d.ts +19 -0
  869. package/dist/types/stores/scheduler-store.d.ts +32 -0
  870. package/dist/types/utils/color-utils.d.ts +9 -0
  871. package/dist/types/utils/utils.d.ts +28 -0
  872. package/loader/cdn.js +3 -0
  873. package/loader/index.cjs.js +3 -0
  874. package/loader/index.d.ts +21 -0
  875. package/loader/index.es2017.js +3 -0
  876. package/loader/index.js +4 -0
  877. package/loader/package.json +11 -0
  878. package/package.json +69 -0
  879. package/readme.md +42 -0
@@ -0,0 +1,2173 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespace(e) {
4
+ if (e && e.__esModule) return e;
5
+ var n = Object.create(null);
6
+ if (e) {
7
+ Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default') {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () {
13
+ return e[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n['default'] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ const NAMESPACE = 'nylas-web-elements';
24
+
25
+ /**
26
+ * Virtual DOM patching algorithm based on Snabbdom by
27
+ * Simon Friis Vindum (@paldepind)
28
+ * Licensed under the MIT License
29
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
30
+ *
31
+ * Modified for Stencil's renderer and slot projection
32
+ */
33
+ let scopeId;
34
+ let hostTagName;
35
+ let isSvgMode = false;
36
+ let renderingRef = null;
37
+ let queuePending = false;
38
+ const createTime = (fnName, tagName = '') => {
39
+ {
40
+ return () => {
41
+ return;
42
+ };
43
+ }
44
+ };
45
+ const uniqueTime = (key, measureText) => {
46
+ {
47
+ return () => {
48
+ return;
49
+ };
50
+ }
51
+ };
52
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
53
+ /**
54
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
55
+ *
56
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
57
+ * support as of Stencil v4.
58
+ */
59
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
60
+ /**
61
+ * Default style mode id
62
+ */
63
+ /**
64
+ * Reusable empty obj/array
65
+ * Don't add values to these!!
66
+ */
67
+ const EMPTY_OBJ = {};
68
+ /**
69
+ * Namespaces
70
+ */
71
+ const SVG_NS = 'http://www.w3.org/2000/svg';
72
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
73
+ const isDef = (v) => v != null;
74
+ /**
75
+ * Check whether a value is a 'complex type', defined here as an object or a
76
+ * function.
77
+ *
78
+ * @param o the value to check
79
+ * @returns whether it's a complex type or not
80
+ */
81
+ const isComplexType = (o) => {
82
+ // https://jsperf.com/typeof-fn-object/5
83
+ o = typeof o;
84
+ return o === 'object' || o === 'function';
85
+ };
86
+ /**
87
+ * Helper method for querying a `meta` tag that contains a nonce value
88
+ * out of a DOM's head.
89
+ *
90
+ * @param doc The DOM containing the `head` to query against
91
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
92
+ * exists or the tag has no content.
93
+ */
94
+ function queryNonceMetaTagContent(doc) {
95
+ var _a, _b, _c;
96
+ 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;
97
+ }
98
+ /**
99
+ * Production h() function based on Preact by
100
+ * Jason Miller (@developit)
101
+ * Licensed under the MIT License
102
+ * https://github.com/developit/preact/blob/master/LICENSE
103
+ *
104
+ * Modified for Stencil's compiler and vdom
105
+ */
106
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
107
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
108
+ const h = (nodeName, vnodeData, ...children) => {
109
+ let child = null;
110
+ let key = null;
111
+ let simple = false;
112
+ let lastSimple = false;
113
+ const vNodeChildren = [];
114
+ const walk = (c) => {
115
+ for (let i = 0; i < c.length; i++) {
116
+ child = c[i];
117
+ if (Array.isArray(child)) {
118
+ walk(child);
119
+ }
120
+ else if (child != null && typeof child !== 'boolean') {
121
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
122
+ child = String(child);
123
+ }
124
+ if (simple && lastSimple) {
125
+ // If the previous child was simple (string), we merge both
126
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
127
+ }
128
+ else {
129
+ // Append a new vNode, if it's text, we create a text vNode
130
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
131
+ }
132
+ lastSimple = simple;
133
+ }
134
+ }
135
+ };
136
+ walk(children);
137
+ if (vnodeData) {
138
+ if (vnodeData.key) {
139
+ key = vnodeData.key;
140
+ }
141
+ // normalize class / className attributes
142
+ {
143
+ const classData = vnodeData.className || vnodeData.class;
144
+ if (classData) {
145
+ vnodeData.class =
146
+ typeof classData !== 'object'
147
+ ? classData
148
+ : Object.keys(classData)
149
+ .filter((k) => classData[k])
150
+ .join(' ');
151
+ }
152
+ }
153
+ }
154
+ if (typeof nodeName === 'function') {
155
+ // nodeName is a functional component
156
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
157
+ }
158
+ const vnode = newVNode(nodeName, null);
159
+ vnode.$attrs$ = vnodeData;
160
+ if (vNodeChildren.length > 0) {
161
+ vnode.$children$ = vNodeChildren;
162
+ }
163
+ {
164
+ vnode.$key$ = key;
165
+ }
166
+ return vnode;
167
+ };
168
+ /**
169
+ * A utility function for creating a virtual DOM node from a tag and some
170
+ * possible text content.
171
+ *
172
+ * @param tag the tag for this element
173
+ * @param text possible text content for the node
174
+ * @returns a newly-minted virtual DOM node
175
+ */
176
+ const newVNode = (tag, text) => {
177
+ const vnode = {
178
+ $flags$: 0,
179
+ $tag$: tag,
180
+ $text$: text,
181
+ $elm$: null,
182
+ $children$: null,
183
+ };
184
+ {
185
+ vnode.$attrs$ = null;
186
+ }
187
+ {
188
+ vnode.$key$ = null;
189
+ }
190
+ return vnode;
191
+ };
192
+ const Host = {};
193
+ /**
194
+ * Check whether a given node is a Host node or not
195
+ *
196
+ * @param node the virtual DOM node to check
197
+ * @returns whether it's a Host node or not
198
+ */
199
+ const isHost = (node) => node && node.$tag$ === Host;
200
+ /**
201
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
202
+ *
203
+ * Note that these functions convert from {@link d.VNode} to
204
+ * {@link d.ChildNode} to give functional component developers a friendly
205
+ * interface.
206
+ */
207
+ const vdomFnUtils = {
208
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
209
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
210
+ };
211
+ /**
212
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
213
+ * friendlier public interface (hence, 'convertToPublic').
214
+ *
215
+ * @param node the virtual DOM node to convert
216
+ * @returns a converted child node
217
+ */
218
+ const convertToPublic = (node) => ({
219
+ vattrs: node.$attrs$,
220
+ vchildren: node.$children$,
221
+ vkey: node.$key$,
222
+ vname: node.$name$,
223
+ vtag: node.$tag$,
224
+ vtext: node.$text$,
225
+ });
226
+ /**
227
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
228
+ * order to use the resulting object in the virtual DOM. The initial object was
229
+ * likely created as part of presenting a public API, so converting it back
230
+ * involved making it 'private' again (hence, `convertToPrivate`).
231
+ *
232
+ * @param node the child node to convert
233
+ * @returns a converted virtual DOM node
234
+ */
235
+ const convertToPrivate = (node) => {
236
+ if (typeof node.vtag === 'function') {
237
+ const vnodeData = Object.assign({}, node.vattrs);
238
+ if (node.vkey) {
239
+ vnodeData.key = node.vkey;
240
+ }
241
+ if (node.vname) {
242
+ vnodeData.name = node.vname;
243
+ }
244
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
245
+ }
246
+ const vnode = newVNode(node.vtag, node.vtext);
247
+ vnode.$attrs$ = node.vattrs;
248
+ vnode.$children$ = node.vchildren;
249
+ vnode.$key$ = node.vkey;
250
+ vnode.$name$ = node.vname;
251
+ return vnode;
252
+ };
253
+ /**
254
+ * Parse a new property value for a given property type.
255
+ *
256
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
257
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
258
+ * 1. `any`, the type given to `propValue` in the function signature
259
+ * 2. the type stored from `propType`.
260
+ *
261
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
262
+ *
263
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
264
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
265
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
266
+ * ```tsx
267
+ * <my-cmp prop-val={0}></my-cmp>
268
+ * ```
269
+ *
270
+ * HTML prop values on the other hand, will always a string
271
+ *
272
+ * @param propValue the new value to coerce to some type
273
+ * @param propType the type of the prop, expressed as a binary number
274
+ * @returns the parsed/coerced value
275
+ */
276
+ const parsePropertyValue = (propValue, propType) => {
277
+ // ensure this value is of the correct prop type
278
+ if (propValue != null && !isComplexType(propValue)) {
279
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
280
+ // per the HTML spec, any string value means it is a boolean true value
281
+ // but we'll cheat here and say that the string "false" is the boolean false
282
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
283
+ }
284
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
285
+ // force it to be a number
286
+ return parseFloat(propValue);
287
+ }
288
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
289
+ // could have been passed as a number or boolean
290
+ // but we still want it as a string
291
+ return String(propValue);
292
+ }
293
+ // redundant return here for better minification
294
+ return propValue;
295
+ }
296
+ // not sure exactly what type we want
297
+ // so no need to change to a different type
298
+ return propValue;
299
+ };
300
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
301
+ const createEvent = (ref, name, flags) => {
302
+ const elm = getElement(ref);
303
+ return {
304
+ emit: (detail) => {
305
+ return emitEvent(elm, name, {
306
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
307
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
308
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
309
+ detail,
310
+ });
311
+ },
312
+ };
313
+ };
314
+ /**
315
+ * Helper function to create & dispatch a custom Event on a provided target
316
+ * @param elm the target of the Event
317
+ * @param name the name to give the custom Event
318
+ * @param opts options for configuring a custom Event
319
+ * @returns the custom Event
320
+ */
321
+ const emitEvent = (elm, name, opts) => {
322
+ const ev = plt.ce(name, opts);
323
+ elm.dispatchEvent(ev);
324
+ return ev;
325
+ };
326
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
327
+ const registerStyle = (scopeId, cssText, allowCS) => {
328
+ let style = styles.get(scopeId);
329
+ if (supportsConstructableStylesheets && allowCS) {
330
+ style = (style || new CSSStyleSheet());
331
+ if (typeof style === 'string') {
332
+ style = cssText;
333
+ }
334
+ else {
335
+ style.replaceSync(cssText);
336
+ }
337
+ }
338
+ else {
339
+ style = cssText;
340
+ }
341
+ styles.set(scopeId, style);
342
+ };
343
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
344
+ var _a;
345
+ const scopeId = getScopeId(cmpMeta);
346
+ const style = styles.get(scopeId);
347
+ // if an element is NOT connected then getRootNode() will return the wrong root node
348
+ // so the fallback is to always use the document for the root node in those cases
349
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
350
+ if (style) {
351
+ if (typeof style === 'string') {
352
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
353
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
354
+ let styleElm;
355
+ if (!appliedStyles) {
356
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
357
+ }
358
+ if (!appliedStyles.has(scopeId)) {
359
+ {
360
+ styleElm = doc.createElement('style');
361
+ styleElm.innerHTML = style;
362
+ // Apply CSP nonce to the style tag if it exists
363
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
364
+ if (nonce != null) {
365
+ styleElm.setAttribute('nonce', nonce);
366
+ }
367
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
368
+ }
369
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
370
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
371
+ styleElm.innerHTML += SLOT_FB_CSS;
372
+ }
373
+ if (appliedStyles) {
374
+ appliedStyles.add(scopeId);
375
+ }
376
+ }
377
+ }
378
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
379
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
380
+ }
381
+ }
382
+ return scopeId;
383
+ };
384
+ const attachStyles = (hostRef) => {
385
+ const cmpMeta = hostRef.$cmpMeta$;
386
+ const elm = hostRef.$hostElement$;
387
+ const flags = cmpMeta.$flags$;
388
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
389
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
390
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
391
+ // only required when we're NOT using native shadow dom (slot)
392
+ // or this browser doesn't support native shadow dom
393
+ // and this host element was NOT created with SSR
394
+ // let's pick out the inner content for slot projection
395
+ // create a node to represent where the original
396
+ // content was first placed, which is useful later on
397
+ // DOM WRITE!!
398
+ elm['s-sc'] = scopeId;
399
+ elm.classList.add(scopeId + '-h');
400
+ if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
401
+ elm.classList.add(scopeId + '-s');
402
+ }
403
+ }
404
+ endAttachStyles();
405
+ };
406
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
407
+ /**
408
+ * Production setAccessor() function based on Preact by
409
+ * Jason Miller (@developit)
410
+ * Licensed under the MIT License
411
+ * https://github.com/developit/preact/blob/master/LICENSE
412
+ *
413
+ * Modified for Stencil's compiler and vdom
414
+ */
415
+ /**
416
+ * When running a VDom render set properties present on a VDom node onto the
417
+ * corresponding HTML element.
418
+ *
419
+ * Note that this function has special functionality for the `class`,
420
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
421
+ * `onClick`, etc). All others are just passed through as-is.
422
+ *
423
+ * @param elm the HTMLElement onto which attributes should be set
424
+ * @param memberName the name of the attribute to set
425
+ * @param oldValue the old value for the attribute
426
+ * @param newValue the new value for the attribute
427
+ * @param isSvg whether we're in an svg context or not
428
+ * @param flags bitflags for Vdom variables
429
+ */
430
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
431
+ if (oldValue !== newValue) {
432
+ let isProp = isMemberInElement(elm, memberName);
433
+ let ln = memberName.toLowerCase();
434
+ if (memberName === 'class') {
435
+ const classList = elm.classList;
436
+ const oldClasses = parseClassList(oldValue);
437
+ const newClasses = parseClassList(newValue);
438
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
439
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
440
+ }
441
+ else if (memberName === 'style') {
442
+ // update style attribute, css properties and values
443
+ {
444
+ for (const prop in oldValue) {
445
+ if (!newValue || newValue[prop] == null) {
446
+ if (prop.includes('-')) {
447
+ elm.style.removeProperty(prop);
448
+ }
449
+ else {
450
+ elm.style[prop] = '';
451
+ }
452
+ }
453
+ }
454
+ }
455
+ for (const prop in newValue) {
456
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
457
+ if (prop.includes('-')) {
458
+ elm.style.setProperty(prop, newValue[prop]);
459
+ }
460
+ else {
461
+ elm.style[prop] = newValue[prop];
462
+ }
463
+ }
464
+ }
465
+ }
466
+ else if (memberName === 'key')
467
+ ;
468
+ else if (memberName === 'ref') {
469
+ // minifier will clean this up
470
+ if (newValue) {
471
+ newValue(elm);
472
+ }
473
+ }
474
+ else if ((!isProp ) &&
475
+ memberName[0] === 'o' &&
476
+ memberName[1] === 'n') {
477
+ // Event Handlers
478
+ // so if the member name starts with "on" and the 3rd characters is
479
+ // a capital letter, and it's not already a member on the element,
480
+ // then we're assuming it's an event listener
481
+ if (memberName[2] === '-') {
482
+ // on- prefixed events
483
+ // allows to be explicit about the dom event to listen without any magic
484
+ // under the hood:
485
+ // <my-cmp on-click> // listens for "click"
486
+ // <my-cmp on-Click> // listens for "Click"
487
+ // <my-cmp on-ionChange> // listens for "ionChange"
488
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
489
+ memberName = memberName.slice(3);
490
+ }
491
+ else if (isMemberInElement(win, ln)) {
492
+ // standard event
493
+ // the JSX attribute could have been "onMouseOver" and the
494
+ // member name "onmouseover" is on the window's prototype
495
+ // so let's add the listener "mouseover", which is all lowercased
496
+ memberName = ln.slice(2);
497
+ }
498
+ else {
499
+ // custom event
500
+ // the JSX attribute could have been "onMyCustomEvent"
501
+ // so let's trim off the "on" prefix and lowercase the first character
502
+ // and add the listener "myCustomEvent"
503
+ // except for the first character, we keep the event name case
504
+ memberName = ln[2] + memberName.slice(3);
505
+ }
506
+ if (oldValue || newValue) {
507
+ // Need to account for "capture" events.
508
+ // If the event name ends with "Capture", we'll update the name to remove
509
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
510
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
511
+ // Make sure we only replace the last instance of "Capture"
512
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
513
+ if (oldValue) {
514
+ plt.rel(elm, memberName, oldValue, capture);
515
+ }
516
+ if (newValue) {
517
+ plt.ael(elm, memberName, newValue, capture);
518
+ }
519
+ }
520
+ }
521
+ else {
522
+ // Set property if it exists and it's not a SVG
523
+ const isComplex = isComplexType(newValue);
524
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
525
+ try {
526
+ if (!elm.tagName.includes('-')) {
527
+ const n = newValue == null ? '' : newValue;
528
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
529
+ if (memberName === 'list') {
530
+ isProp = false;
531
+ }
532
+ else if (oldValue == null || elm[memberName] != n) {
533
+ elm[memberName] = n;
534
+ }
535
+ }
536
+ else {
537
+ elm[memberName] = newValue;
538
+ }
539
+ }
540
+ catch (e) {
541
+ /**
542
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
543
+ */
544
+ }
545
+ }
546
+ if (newValue == null || newValue === false) {
547
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
548
+ {
549
+ elm.removeAttribute(memberName);
550
+ }
551
+ }
552
+ }
553
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
554
+ newValue = newValue === true ? '' : newValue;
555
+ {
556
+ elm.setAttribute(memberName, newValue);
557
+ }
558
+ }
559
+ }
560
+ }
561
+ };
562
+ const parseClassListRegex = /\s/;
563
+ /**
564
+ * Parsed a string of classnames into an array
565
+ * @param value className string, e.g. "foo bar baz"
566
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
567
+ */
568
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
569
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
570
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
571
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
572
+ // if the element passed in is a shadow root, which is a document fragment
573
+ // then we want to be adding attrs/props to the shadow root's "host" element
574
+ // if it's not a shadow root, then we add attrs/props to the same element
575
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
576
+ ? newVnode.$elm$.host
577
+ : newVnode.$elm$;
578
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
579
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
580
+ {
581
+ // remove attributes no longer present on the vnode by setting them to undefined
582
+ for (memberName in oldVnodeAttrs) {
583
+ if (!(memberName in newVnodeAttrs)) {
584
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
585
+ }
586
+ }
587
+ }
588
+ // add new & update changed attributes
589
+ for (memberName in newVnodeAttrs) {
590
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
591
+ }
592
+ };
593
+ /**
594
+ * Create a DOM Node corresponding to one of the children of a given VNode.
595
+ *
596
+ * @param oldParentVNode the parent VNode from the previous render
597
+ * @param newParentVNode the parent VNode from the current render
598
+ * @param childIndex the index of the VNode, in the _new_ parent node's
599
+ * children, for which we will create a new DOM node
600
+ * @param parentElm the parent DOM node which our new node will be a child of
601
+ * @returns the newly created node
602
+ */
603
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
604
+ // tslint:disable-next-line: prefer-const
605
+ const newVNode = newParentVNode.$children$[childIndex];
606
+ let i = 0;
607
+ let elm;
608
+ let childNode;
609
+ if (newVNode.$text$ !== null) {
610
+ // create text node
611
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
612
+ }
613
+ else {
614
+ if (!isSvgMode) {
615
+ isSvgMode = newVNode.$tag$ === 'svg';
616
+ }
617
+ // create element
618
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
619
+ );
620
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
621
+ isSvgMode = false;
622
+ }
623
+ // add css classes, attrs, props, listeners, etc.
624
+ {
625
+ updateElement(null, newVNode, isSvgMode);
626
+ }
627
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
628
+ // if there is a scopeId and this is the initial render
629
+ // then let's add the scopeId as a css class
630
+ elm.classList.add((elm['s-si'] = scopeId));
631
+ }
632
+ if (newVNode.$children$) {
633
+ for (i = 0; i < newVNode.$children$.length; ++i) {
634
+ // create the node
635
+ childNode = createElm(oldParentVNode, newVNode, i);
636
+ // return node could have been null
637
+ if (childNode) {
638
+ // append our new node
639
+ elm.appendChild(childNode);
640
+ }
641
+ }
642
+ }
643
+ {
644
+ if (newVNode.$tag$ === 'svg') {
645
+ // Only reset the SVG context when we're exiting <svg> element
646
+ isSvgMode = false;
647
+ }
648
+ else if (elm.tagName === 'foreignObject') {
649
+ // Reenter SVG context when we're exiting <foreignObject> element
650
+ isSvgMode = true;
651
+ }
652
+ }
653
+ }
654
+ // This needs to always happen so we can hide nodes that are projected
655
+ // to another component but don't end up in a slot
656
+ elm['s-hn'] = hostTagName;
657
+ return elm;
658
+ };
659
+ /**
660
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
661
+ * add them to the DOM in the appropriate place.
662
+ *
663
+ * @param parentElm the DOM node which should be used as a parent for the new
664
+ * DOM nodes
665
+ * @param before a child of the `parentElm` which the new children should be
666
+ * inserted before (optional)
667
+ * @param parentVNode the parent virtual DOM node
668
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
669
+ * @param startIdx the index in the child virtual DOM nodes at which to start
670
+ * creating DOM nodes (inclusive)
671
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
672
+ * creating DOM nodes (inclusive)
673
+ */
674
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
675
+ let containerElm = (parentElm);
676
+ let childNode;
677
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
678
+ containerElm = containerElm.shadowRoot;
679
+ }
680
+ for (; startIdx <= endIdx; ++startIdx) {
681
+ if (vnodes[startIdx]) {
682
+ childNode = createElm(null, parentVNode, startIdx);
683
+ if (childNode) {
684
+ vnodes[startIdx].$elm$ = childNode;
685
+ containerElm.insertBefore(childNode, before);
686
+ }
687
+ }
688
+ }
689
+ };
690
+ /**
691
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
692
+ * This can be used to, for instance, clean up after a list of children which
693
+ * should no longer be shown.
694
+ *
695
+ * This function also handles some of Stencil's slot relocation logic.
696
+ *
697
+ * @param vnodes a list of virtual DOM nodes to remove
698
+ * @param startIdx the index at which to start removing nodes (inclusive)
699
+ * @param endIdx the index at which to stop removing nodes (inclusive)
700
+ */
701
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
702
+ for (let index = startIdx; index <= endIdx; ++index) {
703
+ const vnode = vnodes[index];
704
+ if (vnode) {
705
+ const elm = vnode.$elm$;
706
+ nullifyVNodeRefs(vnode);
707
+ if (elm) {
708
+ // remove the vnode's element from the dom
709
+ elm.remove();
710
+ }
711
+ }
712
+ }
713
+ };
714
+ /**
715
+ * Reconcile the children of a new VNode with the children of an old VNode by
716
+ * traversing the two collections of children, identifying nodes that are
717
+ * conserved or changed, calling out to `patch` to make any necessary
718
+ * updates to the DOM, and rearranging DOM nodes as needed.
719
+ *
720
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
721
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
722
+ * 'windows' by storing start and end indices and references to the
723
+ * corresponding array entries. Initially the two 'windows' are basically equal
724
+ * to the entire array, but we progressively narrow the windows until there are
725
+ * no children left to update by doing the following:
726
+ *
727
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
728
+ * that if we have an initial array like the following we'll end up dealing
729
+ * only with a window bounded by the highlighted elements:
730
+ *
731
+ * [null, null, VNode1 , ... , VNode2, null, null]
732
+ * ^^^^^^ ^^^^^^
733
+ *
734
+ * 2. Check to see if the elements at the head and tail positions are equal
735
+ * across the windows. This will basically detect elements which haven't
736
+ * been added, removed, or changed position, i.e. if you had the following
737
+ * VNode elements (represented as HTML):
738
+ *
739
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
740
+ * newVNode: `<div><p><span>THERE</span></p></div>`
741
+ *
742
+ * Then when comparing the children of the `<div>` tag we check the equality
743
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
744
+ * same tag in the same position, we'd be able to avoid completely
745
+ * re-rendering the subtree under them with a new DOM element and would just
746
+ * call out to `patch` to handle reconciling their children and so on.
747
+ *
748
+ * 3. Check, for both windows, to see if the element at the beginning of the
749
+ * window corresponds to the element at the end of the other window. This is
750
+ * a heuristic which will let us identify _some_ situations in which
751
+ * elements have changed position, for instance it _should_ detect that the
752
+ * children nodes themselves have not changed but merely moved in the
753
+ * following example:
754
+ *
755
+ * oldVNode: `<div><element-one /><element-two /></div>`
756
+ * newVNode: `<div><element-two /><element-one /></div>`
757
+ *
758
+ * If we find cases like this then we also need to move the concrete DOM
759
+ * elements corresponding to the moved children to write the re-order to the
760
+ * DOM.
761
+ *
762
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
763
+ * nodes in the old children which have the same key as the first element in
764
+ * our window on the new children. If we find such a node we handle calling
765
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
766
+ * what we find.
767
+ *
768
+ * Finally, once we've narrowed our 'windows' to the point that either of them
769
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
770
+ * insertion or deletion that needs to happen to get a DOM state that correctly
771
+ * reflects the new child VNodes. If, for instance, after our window on the old
772
+ * children has collapsed we still have more nodes on the new children that
773
+ * we haven't dealt with yet then we need to add them, or if the new children
774
+ * collapse but we still have unhandled _old_ children then we need to make
775
+ * sure the corresponding DOM nodes are removed.
776
+ *
777
+ * @param parentElm the node into which the parent VNode is rendered
778
+ * @param oldCh the old children of the parent node
779
+ * @param newVNode the new VNode which will replace the parent
780
+ * @param newCh the new children of the parent node
781
+ * @param isInitialRender whether or not this is the first render of the vdom
782
+ */
783
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
784
+ let oldStartIdx = 0;
785
+ let newStartIdx = 0;
786
+ let idxInOld = 0;
787
+ let i = 0;
788
+ let oldEndIdx = oldCh.length - 1;
789
+ let oldStartVnode = oldCh[0];
790
+ let oldEndVnode = oldCh[oldEndIdx];
791
+ let newEndIdx = newCh.length - 1;
792
+ let newStartVnode = newCh[0];
793
+ let newEndVnode = newCh[newEndIdx];
794
+ let node;
795
+ let elmToMove;
796
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
797
+ if (oldStartVnode == null) {
798
+ // VNode might have been moved left
799
+ oldStartVnode = oldCh[++oldStartIdx];
800
+ }
801
+ else if (oldEndVnode == null) {
802
+ oldEndVnode = oldCh[--oldEndIdx];
803
+ }
804
+ else if (newStartVnode == null) {
805
+ newStartVnode = newCh[++newStartIdx];
806
+ }
807
+ else if (newEndVnode == null) {
808
+ newEndVnode = newCh[--newEndIdx];
809
+ }
810
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
811
+ // if the start nodes are the same then we should patch the new VNode
812
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
813
+ // indices to reflect that. We don't need to move any DOM Nodes around
814
+ // since things are matched up in order.
815
+ patch(oldStartVnode, newStartVnode, isInitialRender);
816
+ oldStartVnode = oldCh[++oldStartIdx];
817
+ newStartVnode = newCh[++newStartIdx];
818
+ }
819
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
820
+ // likewise, if the end nodes are the same we patch new onto old and
821
+ // decrement our end indices, and also likewise in this case we don't
822
+ // need to move any DOM Nodes.
823
+ patch(oldEndVnode, newEndVnode, isInitialRender);
824
+ oldEndVnode = oldCh[--oldEndIdx];
825
+ newEndVnode = newCh[--newEndIdx];
826
+ }
827
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
828
+ patch(oldStartVnode, newEndVnode, isInitialRender);
829
+ // We need to move the element for `oldStartVnode` into a position which
830
+ // will be appropriate for `newEndVnode`. For this we can use
831
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
832
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
833
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
834
+ //
835
+ // <old-start-node />
836
+ // <some-intervening-node />
837
+ // <old-end-node />
838
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
839
+ // <next-sibling />
840
+ //
841
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
842
+ // the node for `oldStartVnode` at the end of the children of
843
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
844
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
845
+ // append it to the children of the parent element.
846
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
847
+ oldStartVnode = oldCh[++oldStartIdx];
848
+ newEndVnode = newCh[--newEndIdx];
849
+ }
850
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
851
+ patch(oldEndVnode, newStartVnode, isInitialRender);
852
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
853
+ // the same node, so since we're here we know that they are not. Thus we
854
+ // can move the element for `oldEndVnode` _before_ the element for
855
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
856
+ // future.
857
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
858
+ oldEndVnode = oldCh[--oldEndIdx];
859
+ newStartVnode = newCh[++newStartIdx];
860
+ }
861
+ else {
862
+ // Here we do some checks to match up old and new nodes based on the
863
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
864
+ // in the JSX for a DOM element in the implementation of a Stencil
865
+ // component.
866
+ //
867
+ // First we check to see if there are any nodes in the array of old
868
+ // children which have the same key as the first node in the new
869
+ // children.
870
+ idxInOld = -1;
871
+ {
872
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
873
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
874
+ idxInOld = i;
875
+ break;
876
+ }
877
+ }
878
+ }
879
+ if (idxInOld >= 0) {
880
+ // We found a node in the old children which matches up with the first
881
+ // node in the new children! So let's deal with that
882
+ elmToMove = oldCh[idxInOld];
883
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
884
+ // the tag doesn't match so we'll need a new DOM element
885
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
886
+ }
887
+ else {
888
+ patch(elmToMove, newStartVnode, isInitialRender);
889
+ // invalidate the matching old node so that we won't try to update it
890
+ // again later on
891
+ oldCh[idxInOld] = undefined;
892
+ node = elmToMove.$elm$;
893
+ }
894
+ newStartVnode = newCh[++newStartIdx];
895
+ }
896
+ else {
897
+ // We either didn't find an element in the old children that matches
898
+ // the key of the first new child OR the build is not using `key`
899
+ // attributes at all. In either case we need to create a new element
900
+ // for the new node.
901
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
902
+ newStartVnode = newCh[++newStartIdx];
903
+ }
904
+ if (node) {
905
+ // if we created a new node then handle inserting it to the DOM
906
+ {
907
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
908
+ }
909
+ }
910
+ }
911
+ }
912
+ if (oldStartIdx > oldEndIdx) {
913
+ // we have some more new nodes to add which don't match up with old nodes
914
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
915
+ }
916
+ else if (newStartIdx > newEndIdx) {
917
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
918
+ // in the new array, so lets remove them (which entails cleaning up the
919
+ // relevant DOM nodes)
920
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
921
+ }
922
+ };
923
+ /**
924
+ * Compare two VNodes to determine if they are the same
925
+ *
926
+ * **NB**: This function is an equality _heuristic_ based on the available
927
+ * information set on the two VNodes and can be misleading under certain
928
+ * circumstances. In particular, if the two nodes do not have `key` attrs
929
+ * (available under `$key$` on VNodes) then the function falls back on merely
930
+ * checking that they have the same tag.
931
+ *
932
+ * So, in other words, if `key` attrs are not set on VNodes which may be
933
+ * changing order within a `children` array or something along those lines then
934
+ * we could obtain a false negative and then have to do needless re-rendering
935
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
936
+ *
937
+ * @param leftVNode the first VNode to check
938
+ * @param rightVNode the second VNode to check
939
+ * @param isInitialRender whether or not this is the first render of the vdom
940
+ * @returns whether they're equal or not
941
+ */
942
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
943
+ // compare if two vnode to see if they're "technically" the same
944
+ // need to have the same element tag, and same key to be the same
945
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
946
+ // this will be set if JSX tags in the build have `key` attrs set on them
947
+ // we only want to check this if we're not on the first render since on
948
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
949
+ // astray and, for instance, accidentally delete a DOM node that we want to
950
+ // keep around.
951
+ if (!isInitialRender) {
952
+ return leftVNode.$key$ === rightVNode.$key$;
953
+ }
954
+ return true;
955
+ }
956
+ return false;
957
+ };
958
+ /**
959
+ * Handle reconciling an outdated VNode with a new one which corresponds to
960
+ * it. This function handles flushing updates to the DOM and reconciling the
961
+ * children of the two nodes (if any).
962
+ *
963
+ * @param oldVNode an old VNode whose DOM element and children we want to update
964
+ * @param newVNode a new VNode representing an updated version of the old one
965
+ * @param isInitialRender whether or not this is the first render of the vdom
966
+ */
967
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
968
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
969
+ const oldChildren = oldVNode.$children$;
970
+ const newChildren = newVNode.$children$;
971
+ const tag = newVNode.$tag$;
972
+ const text = newVNode.$text$;
973
+ if (text === null) {
974
+ {
975
+ // test if we're rendering an svg element, or still rendering nodes inside of one
976
+ // only add this to the when the compiler sees we're using an svg somewhere
977
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
978
+ }
979
+ {
980
+ if (tag === 'slot')
981
+ ;
982
+ else {
983
+ // either this is the first render of an element OR it's an update
984
+ // AND we already know it's possible it could have changed
985
+ // this updates the element's css classes, attrs, props, listeners, etc.
986
+ updateElement(oldVNode, newVNode, isSvgMode);
987
+ }
988
+ }
989
+ if (oldChildren !== null && newChildren !== null) {
990
+ // looks like there's child vnodes for both the old and new vnodes
991
+ // so we need to call `updateChildren` to reconcile them
992
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
993
+ }
994
+ else if (newChildren !== null) {
995
+ // no old child vnodes, but there are new child vnodes to add
996
+ if (oldVNode.$text$ !== null) {
997
+ // the old vnode was text, so be sure to clear it out
998
+ elm.textContent = '';
999
+ }
1000
+ // add the new vnode children
1001
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1002
+ }
1003
+ else if (oldChildren !== null) {
1004
+ // no new child vnodes, but there are old child vnodes to remove
1005
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1006
+ }
1007
+ if (isSvgMode && tag === 'svg') {
1008
+ isSvgMode = false;
1009
+ }
1010
+ }
1011
+ else if (oldVNode.$text$ !== text) {
1012
+ // update the text content for the text only vnode
1013
+ // and also only if the text is different than before
1014
+ elm.data = text;
1015
+ }
1016
+ };
1017
+ /**
1018
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1019
+ * them with `null`. This signals that the DOM element corresponding to the VDom
1020
+ * node has been removed from the DOM.
1021
+ *
1022
+ * @param vNode a virtual DOM node
1023
+ */
1024
+ const nullifyVNodeRefs = (vNode) => {
1025
+ {
1026
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1027
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1028
+ }
1029
+ };
1030
+ /**
1031
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1032
+ *
1033
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1034
+ * function will handle creating a virtual DOM tree with a single root, patching
1035
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1036
+ * relocation, and reflecting attributes.
1037
+ *
1038
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1039
+ * the DOM node into which it should be rendered.
1040
+ * @param renderFnResults the virtual DOM nodes to be rendered
1041
+ * @param isInitialLoad whether or not this is the first call after page load
1042
+ */
1043
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1044
+ const hostElm = hostRef.$hostElement$;
1045
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1046
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1047
+ // we need to call `h` again to wrap the children of our component in a
1048
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1049
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1050
+ // contains attrs that need to be set on the host element.
1051
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1052
+ hostTagName = hostElm.tagName;
1053
+ // On the first render and *only* on the first render we want to check for
1054
+ // any attributes set on the host element which are also set on the vdom
1055
+ // node. If we find them, we override the value on the VDom node attrs with
1056
+ // the value from the host element, which allows developers building apps
1057
+ // with Stencil components to override e.g. the `role` attribute on a
1058
+ // component even if it's already set on the `Host`.
1059
+ if (isInitialLoad && rootVnode.$attrs$) {
1060
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1061
+ // We have a special implementation in `setAccessor` for `style` and
1062
+ // `class` which reconciles values coming from the VDom with values
1063
+ // already present on the DOM element, so we don't want to override those
1064
+ // attributes on the VDom tree with values from the host element if they
1065
+ // are present.
1066
+ //
1067
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1068
+ // runtime and we don't want to override those either.
1069
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1070
+ rootVnode.$attrs$[key] = hostElm[key];
1071
+ }
1072
+ }
1073
+ }
1074
+ rootVnode.$tag$ = null;
1075
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1076
+ hostRef.$vnode$ = rootVnode;
1077
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1078
+ {
1079
+ scopeId = hostElm['s-sc'];
1080
+ }
1081
+ // synchronous patch
1082
+ patch(oldVNode, rootVnode, isInitialLoad);
1083
+ };
1084
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1085
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1086
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1087
+ }
1088
+ };
1089
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1090
+ {
1091
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1092
+ }
1093
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1094
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1095
+ return;
1096
+ }
1097
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1098
+ // there is no ancestor component or the ancestor component
1099
+ // has already fired off its lifecycle update then
1100
+ // fire off the initial update
1101
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1102
+ return writeTask(dispatch) ;
1103
+ };
1104
+ /**
1105
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1106
+ * component lifecycle methods like `componentWillLoad` as well as
1107
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1108
+ *
1109
+ * @param hostRef a reference to a host DOM node
1110
+ * @param isInitialLoad whether we're on the initial load or not
1111
+ * @returns an empty Promise which is used to enqueue a series of operations for
1112
+ * the component
1113
+ */
1114
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1115
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1116
+ const instance = hostRef.$lazyInstance$ ;
1117
+ // We're going to use this variable together with `enqueue` to implement a
1118
+ // little promise-based queue. We start out with it `undefined`. When we add
1119
+ // the first function to the queue we'll set this variable to be that
1120
+ // function's return value. When we attempt to add subsequent values to the
1121
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1122
+ // the new function off of that `Promise` using `.then()`. This will give our
1123
+ // queue two nice properties:
1124
+ //
1125
+ // 1. If all functions added to the queue are synchronous they'll be called
1126
+ // synchronously right away.
1127
+ // 2. If all functions added to the queue are asynchronous they'll all be
1128
+ // called in order after `dispatchHooks` exits.
1129
+ let maybePromise;
1130
+ if (isInitialLoad) {
1131
+ {
1132
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1133
+ if (hostRef.$queuedListeners$) {
1134
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1135
+ hostRef.$queuedListeners$ = undefined;
1136
+ }
1137
+ }
1138
+ {
1139
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1140
+ // whatever's going on in that `Promise` before we launch into
1141
+ // rendering the component, doing other lifecycle stuff, etc. So
1142
+ // in that case we assign the returned promise to the variable we
1143
+ // declared above to hold a possible 'queueing' Promise
1144
+ maybePromise = safeCall(instance, 'componentWillLoad');
1145
+ }
1146
+ }
1147
+ {
1148
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1149
+ }
1150
+ endSchedule();
1151
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1152
+ };
1153
+ /**
1154
+ * This function uses a Promise to implement a simple first-in, first-out queue
1155
+ * of functions to be called.
1156
+ *
1157
+ * The queue is ordered on the basis of the first argument. If it's
1158
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1159
+ * be called synchronously (although note that this function may return a
1160
+ * `Promise`). The idea is that then the return value of that enqueueing
1161
+ * operation is kept around, so that if it was a `Promise` then subsequent
1162
+ * functions can be enqueued by calling this function again with that `Promise`
1163
+ * as the first argument.
1164
+ *
1165
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1166
+ * @param fn a function to enqueue
1167
+ * @returns either a `Promise` or the return value of the provided function
1168
+ */
1169
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1170
+ /**
1171
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1172
+ * instance of the `Promise` global. In a few circumstances, in particular if
1173
+ * the global has been overwritten, this is could be misleading, so we also do
1174
+ * a little 'duck typing' check to see if the `.then` property of the value is
1175
+ * defined and a function.
1176
+ *
1177
+ * @param maybePromise it might be a promise!
1178
+ * @returns whether it is or not
1179
+ */
1180
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1181
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1182
+ /**
1183
+ * Update a component given reference to its host elements and so on.
1184
+ *
1185
+ * @param hostRef an object containing references to the element's host node,
1186
+ * VDom nodes, and other metadata
1187
+ * @param instance a reference to the underlying host element where it will be
1188
+ * rendered
1189
+ * @param isInitialLoad whether or not this function is being called as part of
1190
+ * the first render cycle
1191
+ */
1192
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1193
+ var _a;
1194
+ const elm = hostRef.$hostElement$;
1195
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1196
+ const rc = elm['s-rc'];
1197
+ if (isInitialLoad) {
1198
+ // DOM WRITE!
1199
+ attachStyles(hostRef);
1200
+ }
1201
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1202
+ {
1203
+ callRender(hostRef, instance, elm, isInitialLoad);
1204
+ }
1205
+ if (rc) {
1206
+ // ok, so turns out there are some child host elements
1207
+ // waiting on this parent element to load
1208
+ // let's fire off all update callbacks waiting
1209
+ rc.map((cb) => cb());
1210
+ elm['s-rc'] = undefined;
1211
+ }
1212
+ endRender();
1213
+ endUpdate();
1214
+ {
1215
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1216
+ const postUpdate = () => postUpdateComponent(hostRef);
1217
+ if (childrenPromises.length === 0) {
1218
+ postUpdate();
1219
+ }
1220
+ else {
1221
+ Promise.all(childrenPromises).then(postUpdate);
1222
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1223
+ childrenPromises.length = 0;
1224
+ }
1225
+ }
1226
+ };
1227
+ /**
1228
+ * Handle making the call to the VDom renderer with the proper context given
1229
+ * various build variables
1230
+ *
1231
+ * @param hostRef an object containing references to the element's host node,
1232
+ * VDom nodes, and other metadata
1233
+ * @param instance a reference to the underlying host element where it will be
1234
+ * rendered
1235
+ * @param elm the Host element for the component
1236
+ * @param isInitialLoad whether or not this function is being called as part of
1237
+ * @returns an empty promise
1238
+ */
1239
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
1240
+ try {
1241
+ renderingRef = instance;
1242
+ /**
1243
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
1244
+ * method, so we can call the method immediately. If not, check before calling it.
1245
+ */
1246
+ instance = instance.render() ;
1247
+ {
1248
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1249
+ }
1250
+ {
1251
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1252
+ }
1253
+ {
1254
+ {
1255
+ // looks like we've got child nodes to render into this host element
1256
+ // or we need to update the css class/attrs on the host element
1257
+ // DOM WRITE!
1258
+ {
1259
+ renderVdom(hostRef, instance, isInitialLoad);
1260
+ }
1261
+ }
1262
+ }
1263
+ }
1264
+ catch (e) {
1265
+ consoleError(e, hostRef.$hostElement$);
1266
+ }
1267
+ renderingRef = null;
1268
+ return null;
1269
+ };
1270
+ const getRenderingRef = () => renderingRef;
1271
+ const postUpdateComponent = (hostRef) => {
1272
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1273
+ const elm = hostRef.$hostElement$;
1274
+ const endPostUpdate = createTime('postUpdate', tagName);
1275
+ const instance = hostRef.$lazyInstance$ ;
1276
+ const ancestorComponent = hostRef.$ancestorComponent$;
1277
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1278
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1279
+ {
1280
+ // DOM WRITE!
1281
+ addHydratedFlag(elm);
1282
+ }
1283
+ {
1284
+ safeCall(instance, 'componentDidLoad');
1285
+ }
1286
+ endPostUpdate();
1287
+ {
1288
+ hostRef.$onReadyResolve$(elm);
1289
+ if (!ancestorComponent) {
1290
+ appDidLoad();
1291
+ }
1292
+ }
1293
+ }
1294
+ else {
1295
+ endPostUpdate();
1296
+ }
1297
+ {
1298
+ hostRef.$onInstanceResolve$(elm);
1299
+ }
1300
+ // load events fire from bottom to top
1301
+ // the deepest elements load first then bubbles up
1302
+ {
1303
+ if (hostRef.$onRenderResolve$) {
1304
+ hostRef.$onRenderResolve$();
1305
+ hostRef.$onRenderResolve$ = undefined;
1306
+ }
1307
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1308
+ nextTick(() => scheduleUpdate(hostRef, false));
1309
+ }
1310
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1311
+ }
1312
+ // ( •_•)
1313
+ // ( •_•)>⌐■-■
1314
+ // (⌐■_■)
1315
+ };
1316
+ const forceUpdate = (ref) => {
1317
+ {
1318
+ const hostRef = getHostRef(ref);
1319
+ const isConnected = hostRef.$hostElement$.isConnected;
1320
+ if (isConnected &&
1321
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1322
+ scheduleUpdate(hostRef, false);
1323
+ }
1324
+ // Returns "true" when the forced update was successfully scheduled
1325
+ return isConnected;
1326
+ }
1327
+ };
1328
+ const appDidLoad = (who) => {
1329
+ // on appload
1330
+ // we have finish the first big initial render
1331
+ {
1332
+ addHydratedFlag(doc.documentElement);
1333
+ }
1334
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1335
+ };
1336
+ /**
1337
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1338
+ * e.g. custom element node. If a build figures out that e.g. no component
1339
+ * has a `componentDidLoad` method, the instance method gets removed from the
1340
+ * output bundle and this function returns `undefined`.
1341
+ * @param instance any object that may or may not contain methods
1342
+ * @param method method name
1343
+ * @param arg single arbitrary argument
1344
+ * @returns result of method call if it exists, otherwise `undefined`
1345
+ */
1346
+ const safeCall = (instance, method, arg) => {
1347
+ if (instance && instance[method]) {
1348
+ try {
1349
+ return instance[method](arg);
1350
+ }
1351
+ catch (e) {
1352
+ consoleError(e);
1353
+ }
1354
+ }
1355
+ return undefined;
1356
+ };
1357
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1358
+ ;
1359
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1360
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1361
+ // check our new property value against our internal value
1362
+ const hostRef = getHostRef(ref);
1363
+ const elm = hostRef.$hostElement$ ;
1364
+ const oldVal = hostRef.$instanceValues$.get(propName);
1365
+ const flags = hostRef.$flags$;
1366
+ const instance = hostRef.$lazyInstance$ ;
1367
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1368
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1369
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1370
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1371
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1372
+ // gadzooks! the property's value has changed!!
1373
+ // set our new value!
1374
+ hostRef.$instanceValues$.set(propName, newVal);
1375
+ if (instance) {
1376
+ // get an array of method names of watch functions to call
1377
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1378
+ const watchMethods = cmpMeta.$watchers$[propName];
1379
+ if (watchMethods) {
1380
+ // this instance is watching for when this property changed
1381
+ watchMethods.map((watchMethodName) => {
1382
+ try {
1383
+ // fire off each of the watch methods that are watching this property
1384
+ instance[watchMethodName](newVal, oldVal, propName);
1385
+ }
1386
+ catch (e) {
1387
+ consoleError(e, elm);
1388
+ }
1389
+ });
1390
+ }
1391
+ }
1392
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1393
+ // looks like this value actually changed, so we've got work to do!
1394
+ // but only if we've already rendered, otherwise just chill out
1395
+ // queue that we need to do an update, but don't worry about queuing
1396
+ // up millions cuz this function ensures it only runs once
1397
+ scheduleUpdate(hostRef, false);
1398
+ }
1399
+ }
1400
+ }
1401
+ };
1402
+ /**
1403
+ * Attach a series of runtime constructs to a compiled Stencil component
1404
+ * constructor, including getters and setters for the `@Prop` and `@State`
1405
+ * decorators, callbacks for when attributes change, and so on.
1406
+ *
1407
+ * @param Cstr the constructor for a component that we need to process
1408
+ * @param cmpMeta metadata collected previously about the component
1409
+ * @param flags a number used to store a series of bit flags
1410
+ * @returns a reference to the same constructor passed in (but now mutated)
1411
+ */
1412
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1413
+ var _a;
1414
+ const prototype = Cstr.prototype;
1415
+ if (cmpMeta.$members$) {
1416
+ if (Cstr.watchers) {
1417
+ cmpMeta.$watchers$ = Cstr.watchers;
1418
+ }
1419
+ // It's better to have a const than two Object.entries()
1420
+ const members = Object.entries(cmpMeta.$members$);
1421
+ members.map(([memberName, [memberFlags]]) => {
1422
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1423
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1424
+ // proxyComponent - prop
1425
+ Object.defineProperty(prototype, memberName, {
1426
+ get() {
1427
+ // proxyComponent, get value
1428
+ return getValue(this, memberName);
1429
+ },
1430
+ set(newValue) {
1431
+ // proxyComponent, set value
1432
+ setValue(this, memberName, newValue, cmpMeta);
1433
+ },
1434
+ configurable: true,
1435
+ enumerable: true,
1436
+ });
1437
+ }
1438
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1439
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1440
+ // proxyComponent - method
1441
+ Object.defineProperty(prototype, memberName, {
1442
+ value(...args) {
1443
+ var _a;
1444
+ const ref = getHostRef(this);
1445
+ return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1446
+ },
1447
+ });
1448
+ }
1449
+ });
1450
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1451
+ const attrNameToPropName = new Map();
1452
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1453
+ plt.jmp(() => {
1454
+ var _a;
1455
+ const propName = attrNameToPropName.get(attrName);
1456
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1457
+ // in the case where an attribute was set inline.
1458
+ // ```html
1459
+ // <my-component some-attribute="some-value"></my-component>
1460
+ // ```
1461
+ //
1462
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1463
+ // programmatically changes it before it has been upgraded as shown below:
1464
+ //
1465
+ // ```html
1466
+ // <!-- this component has _not_ been upgraded yet -->
1467
+ // <my-component id="test" some-attribute="some-value"></my-component>
1468
+ // <script>
1469
+ // // grab non-upgraded component
1470
+ // el = document.querySelector("#test");
1471
+ // el.someAttribute = "another-value";
1472
+ // // upgrade component
1473
+ // customElements.define('my-component', MyComponent);
1474
+ // </script>
1475
+ // ```
1476
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1477
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1478
+ // to the value that was set inline i.e. "some-value" from above example. When
1479
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1480
+ //
1481
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1482
+ // by connectedCallback as this attributeChangedCallback will not fire.
1483
+ //
1484
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1485
+ //
1486
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1487
+ // properties here given that this goes against best practices outlined here
1488
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1489
+ if (this.hasOwnProperty(propName)) {
1490
+ newValue = this[propName];
1491
+ delete this[propName];
1492
+ }
1493
+ else if (prototype.hasOwnProperty(propName) &&
1494
+ typeof this[propName] === 'number' &&
1495
+ this[propName] == newValue) {
1496
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1497
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1498
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1499
+ return;
1500
+ }
1501
+ else if (propName == null) {
1502
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1503
+ // on a vanilla web component
1504
+ const hostRef = getHostRef(this);
1505
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1506
+ // We only want to trigger the callback(s) if:
1507
+ // 1. The instance is ready
1508
+ // 2. The watchers are ready
1509
+ // 3. The value has changed
1510
+ if (flags &&
1511
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1512
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1513
+ newValue !== oldValue) {
1514
+ const instance = hostRef.$lazyInstance$ ;
1515
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1516
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1517
+ if (instance[callbackName] != null) {
1518
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1519
+ }
1520
+ });
1521
+ }
1522
+ return;
1523
+ }
1524
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1525
+ });
1526
+ };
1527
+ // Create an array of attributes to observe
1528
+ // This list in comprised of all strings used within a `@Watch()` decorator
1529
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1530
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1531
+ // an invalid attribute.
1532
+ Cstr.observedAttributes = Array.from(new Set([
1533
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1534
+ ...members
1535
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1536
+ .map(([propName, m]) => {
1537
+ const attrName = m[1] || propName;
1538
+ attrNameToPropName.set(attrName, propName);
1539
+ return attrName;
1540
+ }),
1541
+ ]));
1542
+ }
1543
+ }
1544
+ return Cstr;
1545
+ };
1546
+ /**
1547
+ * Initialize a Stencil component given a reference to its host element, its
1548
+ * runtime bookkeeping data structure, runtime metadata about the component,
1549
+ * and (optionally) an HMR version ID.
1550
+ *
1551
+ * @param elm a host element
1552
+ * @param hostRef the element's runtime bookkeeping object
1553
+ * @param cmpMeta runtime metadata for the Stencil component
1554
+ * @param hmrVersionId an (optional) HMR version ID
1555
+ */
1556
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1557
+ let Cstr;
1558
+ // initializeComponent
1559
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1560
+ // Let the runtime know that the component has been initialized
1561
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1562
+ {
1563
+ // lazy loaded components
1564
+ // request the component's implementation to be
1565
+ // wired up with the host element
1566
+ Cstr = loadModule(cmpMeta);
1567
+ if (Cstr.then) {
1568
+ // Await creates a micro-task avoid if possible
1569
+ const endLoad = uniqueTime();
1570
+ Cstr = await Cstr;
1571
+ endLoad();
1572
+ }
1573
+ if (!Cstr.isProxied) {
1574
+ // we've never proxied this Constructor before
1575
+ // let's add the getters/setters to its prototype before
1576
+ // the first time we create an instance of the implementation
1577
+ {
1578
+ cmpMeta.$watchers$ = Cstr.watchers;
1579
+ }
1580
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1581
+ Cstr.isProxied = true;
1582
+ }
1583
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1584
+ // ok, time to construct the instance
1585
+ // but let's keep track of when we start and stop
1586
+ // so that the getters/setters don't incorrectly step on data
1587
+ {
1588
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1589
+ }
1590
+ // construct the lazy-loaded component implementation
1591
+ // passing the hostRef is very important during
1592
+ // construction in order to directly wire together the
1593
+ // host element and the lazy-loaded instance
1594
+ try {
1595
+ new Cstr(hostRef);
1596
+ }
1597
+ catch (e) {
1598
+ consoleError(e);
1599
+ }
1600
+ {
1601
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1602
+ }
1603
+ {
1604
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1605
+ }
1606
+ endNewInstance();
1607
+ fireConnectedCallback(hostRef.$lazyInstance$);
1608
+ }
1609
+ if (Cstr.style) {
1610
+ // this component has styles but we haven't registered them yet
1611
+ let style = Cstr.style;
1612
+ const scopeId = getScopeId(cmpMeta);
1613
+ if (!styles.has(scopeId)) {
1614
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1615
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1616
+ endRegisterStyles();
1617
+ }
1618
+ }
1619
+ }
1620
+ // we've successfully created a lazy instance
1621
+ const ancestorComponent = hostRef.$ancestorComponent$;
1622
+ const schedule = () => scheduleUpdate(hostRef, true);
1623
+ if (ancestorComponent && ancestorComponent['s-rc']) {
1624
+ // this is the initial load and this component it has an ancestor component
1625
+ // but the ancestor component has NOT fired its will update lifecycle yet
1626
+ // so let's just cool our jets and wait for the ancestor to continue first
1627
+ // this will get fired off when the ancestor component
1628
+ // finally gets around to rendering its lazy self
1629
+ // fire off the initial update
1630
+ ancestorComponent['s-rc'].push(schedule);
1631
+ }
1632
+ else {
1633
+ schedule();
1634
+ }
1635
+ };
1636
+ const fireConnectedCallback = (instance) => {
1637
+ {
1638
+ safeCall(instance, 'connectedCallback');
1639
+ }
1640
+ };
1641
+ const connectedCallback = (elm) => {
1642
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1643
+ const hostRef = getHostRef(elm);
1644
+ const cmpMeta = hostRef.$cmpMeta$;
1645
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1646
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1647
+ // first time this component has connected
1648
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1649
+ {
1650
+ // find the first ancestor component (if there is one) and register
1651
+ // this component as one of the actively loading child components for its ancestor
1652
+ let ancestorComponent = elm;
1653
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1654
+ // climb up the ancestors looking for the first
1655
+ // component that hasn't finished its lifecycle update yet
1656
+ if (ancestorComponent['s-p']) {
1657
+ // we found this components first ancestor component
1658
+ // keep a reference to this component's ancestor component
1659
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1660
+ break;
1661
+ }
1662
+ }
1663
+ }
1664
+ // Lazy properties
1665
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1666
+ if (cmpMeta.$members$) {
1667
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1668
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1669
+ const value = elm[memberName];
1670
+ delete elm[memberName];
1671
+ elm[memberName] = value;
1672
+ }
1673
+ });
1674
+ }
1675
+ {
1676
+ initializeComponent(elm, hostRef, cmpMeta);
1677
+ }
1678
+ }
1679
+ else {
1680
+ // not the first time this has connected
1681
+ // reattach any event listeners to the host
1682
+ // since they would have been removed when disconnected
1683
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1684
+ // fire off connectedCallback() on component instance
1685
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1686
+ fireConnectedCallback(hostRef.$lazyInstance$);
1687
+ }
1688
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1689
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1690
+ }
1691
+ }
1692
+ endConnected();
1693
+ }
1694
+ };
1695
+ const disconnectInstance = (instance) => {
1696
+ {
1697
+ safeCall(instance, 'disconnectedCallback');
1698
+ }
1699
+ };
1700
+ const disconnectedCallback = async (elm) => {
1701
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1702
+ const hostRef = getHostRef(elm);
1703
+ {
1704
+ if (hostRef.$rmListeners$) {
1705
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1706
+ hostRef.$rmListeners$ = undefined;
1707
+ }
1708
+ }
1709
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1710
+ disconnectInstance(hostRef.$lazyInstance$);
1711
+ }
1712
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1713
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1714
+ }
1715
+ }
1716
+ };
1717
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1718
+ var _a;
1719
+ const endBootstrap = createTime();
1720
+ const cmpTags = [];
1721
+ const exclude = options.exclude || [];
1722
+ const customElements = win.customElements;
1723
+ const head = doc.head;
1724
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1725
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
1726
+ const deferredConnectedCallbacks = [];
1727
+ let appLoadFallback;
1728
+ let isBootstrapping = true;
1729
+ Object.assign(plt, options);
1730
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1731
+ let hasSlotRelocation = false;
1732
+ lazyBundles.map((lazyBundle) => {
1733
+ lazyBundle[1].map((compactMeta) => {
1734
+ var _a;
1735
+ const cmpMeta = {
1736
+ $flags$: compactMeta[0],
1737
+ $tagName$: compactMeta[1],
1738
+ $members$: compactMeta[2],
1739
+ $listeners$: compactMeta[3],
1740
+ };
1741
+ // Check if we are using slots outside the shadow DOM in this component.
1742
+ // We'll use this information later to add styles for `slot-fb` elements
1743
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1744
+ hasSlotRelocation = true;
1745
+ }
1746
+ {
1747
+ cmpMeta.$members$ = compactMeta[2];
1748
+ }
1749
+ {
1750
+ cmpMeta.$listeners$ = compactMeta[3];
1751
+ }
1752
+ {
1753
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
1754
+ }
1755
+ const tagName = cmpMeta.$tagName$;
1756
+ const HostElement = class extends HTMLElement {
1757
+ // StencilLazyHost
1758
+ constructor(self) {
1759
+ // @ts-ignore
1760
+ super(self);
1761
+ self = this;
1762
+ registerHost(self, cmpMeta);
1763
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1764
+ // this component is using shadow dom
1765
+ // and this browser supports shadow dom
1766
+ // add the read-only property "shadowRoot" to the host element
1767
+ // adding the shadow root build conditionals to minimize runtime
1768
+ {
1769
+ {
1770
+ self.attachShadow({ mode: 'open' });
1771
+ }
1772
+ }
1773
+ }
1774
+ }
1775
+ connectedCallback() {
1776
+ if (appLoadFallback) {
1777
+ clearTimeout(appLoadFallback);
1778
+ appLoadFallback = null;
1779
+ }
1780
+ if (isBootstrapping) {
1781
+ // connectedCallback will be processed once all components have been registered
1782
+ deferredConnectedCallbacks.push(this);
1783
+ }
1784
+ else {
1785
+ plt.jmp(() => connectedCallback(this));
1786
+ }
1787
+ }
1788
+ disconnectedCallback() {
1789
+ plt.jmp(() => disconnectedCallback(this));
1790
+ }
1791
+ componentOnReady() {
1792
+ return getHostRef(this).$onReadyPromise$;
1793
+ }
1794
+ };
1795
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1796
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1797
+ cmpTags.push(tagName);
1798
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1799
+ }
1800
+ });
1801
+ });
1802
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
1803
+ if (hasSlotRelocation) {
1804
+ dataStyles.innerHTML += SLOT_FB_CSS;
1805
+ }
1806
+ // Add hydration styles
1807
+ {
1808
+ dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
1809
+ }
1810
+ // If we have styles, add them to the DOM
1811
+ if (dataStyles.innerHTML.length) {
1812
+ dataStyles.setAttribute('data-styles', '');
1813
+ // Apply CSP nonce to the style tag if it exists
1814
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1815
+ if (nonce != null) {
1816
+ dataStyles.setAttribute('nonce', nonce);
1817
+ }
1818
+ // Insert the styles into the document head
1819
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
1820
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1821
+ }
1822
+ // Process deferred connectedCallbacks now all components have been registered
1823
+ isBootstrapping = false;
1824
+ if (deferredConnectedCallbacks.length) {
1825
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1826
+ }
1827
+ else {
1828
+ {
1829
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1830
+ }
1831
+ }
1832
+ // Fallback appLoad event
1833
+ endBootstrap();
1834
+ };
1835
+ const Fragment = (_, children) => children;
1836
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1837
+ if (listeners) {
1838
+ listeners.map(([flags, name, method]) => {
1839
+ const target = getHostListenerTarget(elm, flags) ;
1840
+ const handler = hostListenerProxy(hostRef, method);
1841
+ const opts = hostListenerOpts(flags);
1842
+ plt.ael(target, name, handler, opts);
1843
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1844
+ });
1845
+ }
1846
+ };
1847
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1848
+ try {
1849
+ {
1850
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1851
+ // instance is ready, let's call it's member method for this event
1852
+ hostRef.$lazyInstance$[methodName](ev);
1853
+ }
1854
+ else {
1855
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1856
+ }
1857
+ }
1858
+ }
1859
+ catch (e) {
1860
+ consoleError(e);
1861
+ }
1862
+ };
1863
+ const getHostListenerTarget = (elm, flags) => {
1864
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1865
+ return win;
1866
+ if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
1867
+ return doc.body;
1868
+ return elm;
1869
+ };
1870
+ // prettier-ignore
1871
+ const hostListenerOpts = (flags) => supportsListenerOptions
1872
+ ? ({
1873
+ passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
1874
+ capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
1875
+ })
1876
+ : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1877
+ /**
1878
+ * Assigns the given value to the nonce property on the runtime platform object.
1879
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1880
+ * @param nonce The value to be assigned to the platform nonce property.
1881
+ * @returns void
1882
+ */
1883
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1884
+ /**
1885
+ * A WeakMap mapping runtime component references to their corresponding host reference
1886
+ * instances.
1887
+ *
1888
+ * **Note**: If we're in an HMR context we need to store a reference to this
1889
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1890
+ * to {@link d.HostRef} across HMR updates.
1891
+ *
1892
+ * This is necessary because when HMR updates for a component are processed by
1893
+ * the browser-side dev server client the JS bundle for that component is
1894
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1895
+ * that bundle, if we do not store a reference to it the new iteration of the
1896
+ * component will not have access to the previous hostRef map, leading to a
1897
+ * bug where the new version of the component cannot properly initialize.
1898
+ */
1899
+ const hostRefs = new WeakMap();
1900
+ /**
1901
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1902
+ *
1903
+ * @param ref the runtime ref of interest
1904
+ * @returns the Host reference (if found) or undefined
1905
+ */
1906
+ const getHostRef = (ref) => hostRefs.get(ref);
1907
+ /**
1908
+ * Register a lazy instance with the {@link hostRefs} object so it's
1909
+ * corresponding {@link d.HostRef} can be retrieved later.
1910
+ *
1911
+ * @param lazyInstance the lazy instance of interest
1912
+ * @param hostRef that instances `HostRef` object
1913
+ * @returns a reference to the host ref WeakMap
1914
+ */
1915
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1916
+ /**
1917
+ * Register a host element for a Stencil component, setting up various metadata
1918
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
1919
+ * metadata.
1920
+ *
1921
+ * @param hostElement the host element to register
1922
+ * @param cmpMeta runtime metadata for that component
1923
+ * @returns a reference to the host ref WeakMap
1924
+ */
1925
+ const registerHost = (hostElement, cmpMeta) => {
1926
+ const hostRef = {
1927
+ $flags$: 0,
1928
+ $hostElement$: hostElement,
1929
+ $cmpMeta$: cmpMeta,
1930
+ $instanceValues$: new Map(),
1931
+ };
1932
+ {
1933
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
1934
+ }
1935
+ {
1936
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1937
+ hostElement['s-p'] = [];
1938
+ hostElement['s-rc'] = [];
1939
+ }
1940
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
1941
+ return hostRefs.set(hostElement, hostRef);
1942
+ };
1943
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1944
+ const consoleError = (e, el) => (0, console.error)(e, el);
1945
+ const cmpModules = /*@__PURE__*/ new Map();
1946
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1947
+ // loadModuleImport
1948
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1949
+ const bundleId = cmpMeta.$lazyBundleId$;
1950
+ const module = cmpModules.get(bundleId) ;
1951
+ if (module) {
1952
+ return module[exportName];
1953
+ }
1954
+
1955
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1956
+ const processMod = importedModule => {
1957
+ cmpModules.set(bundleId, importedModule);
1958
+ return importedModule[exportName];
1959
+ }
1960
+ switch(bundleId) {
1961
+
1962
+ case 'nylas-if-state_3.cjs':
1963
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1964
+ /* webpackMode: "lazy" */
1965
+ './nylas-if-state_3.cjs.entry.js')); }).then(processMod, consoleError);
1966
+ case 'document-refresh-icon.cjs':
1967
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1968
+ /* webpackMode: "lazy" */
1969
+ './document-refresh-icon.cjs.entry.js')); }).then(processMod, consoleError);
1970
+ case 'nylas-list-folders.cjs':
1971
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1972
+ /* webpackMode: "lazy" */
1973
+ './nylas-list-folders.cjs.entry.js')); }).then(processMod, consoleError);
1974
+ case 'nylas-list-threads.cjs':
1975
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1976
+ /* webpackMode: "lazy" */
1977
+ './nylas-list-threads.cjs.entry.js')); }).then(processMod, consoleError);
1978
+ case 'nylas-mailbox-pagination.cjs':
1979
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1980
+ /* webpackMode: "lazy" */
1981
+ './nylas-mailbox-pagination.cjs.entry.js')); }).then(processMod, consoleError);
1982
+ case 'nylas-mailbox-toolbar-button.cjs':
1983
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1984
+ /* webpackMode: "lazy" */
1985
+ './nylas-mailbox-toolbar-button.cjs.entry.js')); }).then(processMod, consoleError);
1986
+ case 'nylas-open-hours-picker.cjs':
1987
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1988
+ /* webpackMode: "lazy" */
1989
+ './nylas-open-hours-picker.cjs.entry.js')); }).then(processMod, consoleError);
1990
+ case 'nylas-provider.cjs':
1991
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1992
+ /* webpackMode: "lazy" */
1993
+ './nylas-provider.cjs.entry.js')); }).then(processMod, consoleError);
1994
+ case 'nylas-scheduler.cjs':
1995
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1996
+ /* webpackMode: "lazy" */
1997
+ './nylas-scheduler.cjs.entry.js')); }).then(processMod, consoleError);
1998
+ case 'nylas-threads-refresh.cjs':
1999
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2000
+ /* webpackMode: "lazy" */
2001
+ './nylas-threads-refresh.cjs.entry.js')); }).then(processMod, consoleError);
2002
+ case 'nylas-threads-search.cjs':
2003
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2004
+ /* webpackMode: "lazy" */
2005
+ './nylas-threads-search.cjs.entry.js')); }).then(processMod, consoleError);
2006
+ case 'nylas-view-thread.cjs':
2007
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2008
+ /* webpackMode: "lazy" */
2009
+ './nylas-view-thread.cjs.entry.js')); }).then(processMod, consoleError);
2010
+ case 'archive-icon_7.cjs':
2011
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2012
+ /* webpackMode: "lazy" */
2013
+ './archive-icon_7.cjs.entry.js')); }).then(processMod, consoleError);
2014
+ case 'arrow-icon.cjs':
2015
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2016
+ /* webpackMode: "lazy" */
2017
+ './arrow-icon.cjs.entry.js')); }).then(processMod, consoleError);
2018
+ case 'forward-icon_6.cjs':
2019
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2020
+ /* webpackMode: "lazy" */
2021
+ './forward-icon_6.cjs.entry.js')); }).then(processMod, consoleError);
2022
+ case 'nylas-booked-event-card_9.cjs':
2023
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2024
+ /* webpackMode: "lazy" */
2025
+ './nylas-booked-event-card_9.cjs.entry.js')); }).then(processMod, consoleError);
2026
+ case 'bold-icon_3.cjs':
2027
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2028
+ /* webpackMode: "lazy" */
2029
+ './bold-icon_3.cjs.entry.js')); }).then(processMod, consoleError);
2030
+ case 'calendar-cancel-icon.cjs':
2031
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2032
+ /* webpackMode: "lazy" */
2033
+ './calendar-cancel-icon.cjs.entry.js')); }).then(processMod, consoleError);
2034
+ case 'calendar-check-icon_3.cjs':
2035
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2036
+ /* webpackMode: "lazy" */
2037
+ './calendar-check-icon_3.cjs.entry.js')); }).then(processMod, consoleError);
2038
+ case 'calendar-icon.cjs':
2039
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2040
+ /* webpackMode: "lazy" */
2041
+ './calendar-icon.cjs.entry.js')); }).then(processMod, consoleError);
2042
+ case 'close-icon_2.cjs':
2043
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2044
+ /* webpackMode: "lazy" */
2045
+ './close-icon_2.cjs.entry.js')); }).then(processMod, consoleError);
2046
+ case 'play-icon_2.cjs':
2047
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2048
+ /* webpackMode: "lazy" */
2049
+ './play-icon_2.cjs.entry.js')); }).then(processMod, consoleError);
2050
+ case 'refresh-icon.cjs':
2051
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2052
+ /* webpackMode: "lazy" */
2053
+ './refresh-icon.cjs.entry.js')); }).then(processMod, consoleError);
2054
+ case 'translate-icon.cjs':
2055
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2056
+ /* webpackMode: "lazy" */
2057
+ './translate-icon.cjs.entry.js')); }).then(processMod, consoleError);
2058
+ case 'chevron-icon.cjs':
2059
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2060
+ /* webpackMode: "lazy" */
2061
+ './chevron-icon.cjs.entry.js')); }).then(processMod, consoleError);
2062
+ case 'globe-icon.cjs':
2063
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2064
+ /* webpackMode: "lazy" */
2065
+ './globe-icon.cjs.entry.js')); }).then(processMod, consoleError);
2066
+ case 'loading-icon.cjs':
2067
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2068
+ /* webpackMode: "lazy" */
2069
+ './loading-icon.cjs.entry.js')); }).then(processMod, consoleError);
2070
+ }
2071
+ }
2072
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2073
+ /* @vite-ignore */
2074
+ /* webpackInclude: /\.entry\.js$/ */
2075
+ /* webpackExclude: /\.system\.entry\.js$/ */
2076
+ /* webpackMode: "lazy" */
2077
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2078
+ {
2079
+ cmpModules.set(bundleId, importedModule);
2080
+ }
2081
+ return importedModule[exportName];
2082
+ }, consoleError);
2083
+ };
2084
+ const styles = /*@__PURE__*/ new Map();
2085
+ const win = typeof window !== 'undefined' ? window : {};
2086
+ const doc = win.document || { head: {} };
2087
+ const plt = {
2088
+ $flags$: 0,
2089
+ $resourcesUrl$: '',
2090
+ jmp: (h) => h(),
2091
+ raf: (h) => requestAnimationFrame(h),
2092
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2093
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2094
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
2095
+ };
2096
+ const supportsListenerOptions = /*@__PURE__*/ (() => {
2097
+ let supportsListenerOptions = false;
2098
+ try {
2099
+ doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
2100
+ get() {
2101
+ supportsListenerOptions = true;
2102
+ },
2103
+ }));
2104
+ }
2105
+ catch (e) { }
2106
+ return supportsListenerOptions;
2107
+ })();
2108
+ const promiseResolve = (v) => Promise.resolve(v);
2109
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2110
+ try {
2111
+ new CSSStyleSheet();
2112
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2113
+ }
2114
+ catch (e) { }
2115
+ return false;
2116
+ })()
2117
+ ;
2118
+ const queueDomReads = [];
2119
+ const queueDomWrites = [];
2120
+ const queueTask = (queue, write) => (cb) => {
2121
+ queue.push(cb);
2122
+ if (!queuePending) {
2123
+ queuePending = true;
2124
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2125
+ nextTick(flush);
2126
+ }
2127
+ else {
2128
+ plt.raf(flush);
2129
+ }
2130
+ }
2131
+ };
2132
+ const consume = (queue) => {
2133
+ for (let i = 0; i < queue.length; i++) {
2134
+ try {
2135
+ queue[i](performance.now());
2136
+ }
2137
+ catch (e) {
2138
+ consoleError(e);
2139
+ }
2140
+ }
2141
+ queue.length = 0;
2142
+ };
2143
+ const flush = () => {
2144
+ // always force a bunch of medium callbacks to run, but still have
2145
+ // a throttle on how many can run in a certain time
2146
+ // DOM READS!!!
2147
+ consume(queueDomReads);
2148
+ // DOM WRITES!!!
2149
+ {
2150
+ consume(queueDomWrites);
2151
+ if ((queuePending = queueDomReads.length > 0)) {
2152
+ // still more to do yet, but we've run out of time
2153
+ // let's let this thing cool off and try again in the next tick
2154
+ plt.raf(flush);
2155
+ }
2156
+ }
2157
+ };
2158
+ const nextTick = (cb) => promiseResolve().then(cb);
2159
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2160
+
2161
+ exports.Fragment = Fragment;
2162
+ exports.Host = Host;
2163
+ exports.bootstrapLazy = bootstrapLazy;
2164
+ exports.createEvent = createEvent;
2165
+ exports.forceUpdate = forceUpdate;
2166
+ exports.getElement = getElement;
2167
+ exports.getRenderingRef = getRenderingRef;
2168
+ exports.h = h;
2169
+ exports.promiseResolve = promiseResolve;
2170
+ exports.registerInstance = registerInstance;
2171
+ exports.setNonce = setNonce;
2172
+
2173
+ //# sourceMappingURL=index-34e64e2d.js.map