@maggioli-design-system/magma 1.0.0-beta → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (907) hide show
  1. package/README.md +44 -226
  2. package/dist/cjs/{_commonjsHelpers-0192c5b3.js → _commonjsHelpers-e6ff1d6e.js} +0 -5
  3. package/dist/cjs/{aria-8237fdab.js → aria-0b8ae8a3.js} +18 -2
  4. package/dist/cjs/file-extensions-cd2fa955.js +126 -0
  5. package/dist/cjs/{floating-ui.dom.esm-58e05c82.js → floating-ui.dom.esm-4d912aff.js} +484 -40
  6. package/dist/cjs/{index-9808fc83.js → index-eccfa195.js} +24 -297
  7. package/dist/cjs/{keyboard-manager-fa9d665b.js → keyboard-manager-952eef32.js} +2 -2
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/locale-9add6645.js +845 -0
  10. package/dist/cjs/locale.it-e5e117c5.js +466 -0
  11. package/dist/cjs/magma-components.cjs.js +3 -3
  12. package/dist/cjs/mds-accordion-item.cjs.entry.js +1 -1
  13. package/dist/cjs/mds-accordion-timer-item.cjs.entry.js +2 -2
  14. package/dist/cjs/mds-accordion-timer.cjs.entry.js +17 -13
  15. package/dist/cjs/mds-accordion.cjs.entry.js +1 -1
  16. package/dist/cjs/mds-author.cjs.entry.js +1 -1
  17. package/dist/cjs/mds-avatar.cjs.entry.js +3 -3
  18. package/dist/cjs/mds-badge.cjs.entry.js +2 -2
  19. package/dist/cjs/mds-banner.cjs.entry.js +24 -8
  20. package/dist/cjs/mds-benchmark-bar.cjs.entry.js +1 -1
  21. package/dist/cjs/mds-bibliography.cjs.entry.js +1 -1
  22. package/dist/cjs/mds-breadcrumb-item.cjs.entry.js +4 -4
  23. package/dist/cjs/mds-breadcrumb.cjs.entry.js +39 -4
  24. package/dist/cjs/mds-button_3.cjs.entry.js +53 -20
  25. package/dist/cjs/mds-card-content.cjs.entry.js +1 -1
  26. package/dist/cjs/mds-card-footer.cjs.entry.js +1 -1
  27. package/dist/cjs/mds-card-header.cjs.entry.js +1 -1
  28. package/dist/cjs/mds-card-media.cjs.entry.js +1 -1
  29. package/dist/cjs/mds-card.cjs.entry.js +1 -1
  30. package/dist/cjs/mds-chip.cjs.entry.js +83 -28
  31. package/dist/cjs/mds-details.cjs.entry.js +3 -3
  32. package/dist/cjs/{mds-dropdown_2.cjs.entry.js → mds-dropdown.cjs.entry.js} +12 -890
  33. package/dist/cjs/mds-entity.cjs.entry.js +5 -5
  34. package/dist/cjs/mds-file-preview.cjs.entry.js +44 -11
  35. package/dist/cjs/mds-file.cjs.entry.js +44 -13
  36. package/dist/cjs/mds-filter-item.cjs.entry.js +3 -3
  37. package/dist/cjs/mds-filter.cjs.entry.js +2 -2
  38. package/dist/cjs/mds-header-bar.cjs.entry.js +1 -1
  39. package/dist/cjs/mds-header.cjs.entry.js +5 -3
  40. package/dist/cjs/mds-help.cjs.entry.js +4 -4
  41. package/dist/cjs/mds-horizontal-scroll.cjs.entry.js +1 -1
  42. package/dist/cjs/mds-hr.cjs.entry.js +1 -1
  43. package/dist/cjs/mds-img.cjs.entry.js +23 -7
  44. package/dist/cjs/mds-input-field.cjs.entry.js +3 -3
  45. package/dist/cjs/mds-input-range.cjs.entry.js +6 -5
  46. package/dist/cjs/mds-input-select.cjs.entry.js +8 -8
  47. package/dist/cjs/mds-input-switch.cjs.entry.js +9 -8
  48. package/dist/cjs/mds-input-tip_2.cjs.entry.js +36 -12
  49. package/dist/cjs/mds-input-upload.cjs.entry.js +159 -31
  50. package/dist/cjs/mds-input.cjs.entry.js +44 -16
  51. package/dist/cjs/mds-kpi-item.cjs.entry.js +6 -4
  52. package/dist/cjs/mds-kpi.cjs.entry.js +2 -2
  53. package/dist/cjs/mds-label.cjs.entry.js +33 -5
  54. package/dist/cjs/mds-list-item.cjs.entry.js +2 -2
  55. package/dist/cjs/mds-list.cjs.entry.js +2 -2
  56. package/dist/cjs/mds-modal.cjs.entry.js +6 -4
  57. package/dist/cjs/mds-note.cjs.entry.js +38 -3
  58. package/dist/cjs/mds-notification.cjs.entry.js +4 -3
  59. package/dist/cjs/mds-paginator-item.cjs.entry.js +5 -5
  60. package/dist/cjs/mds-paginator.cjs.entry.js +3 -3
  61. package/dist/cjs/mds-pref-animation.cjs.entry.js +9 -7
  62. package/dist/cjs/mds-pref-consumption.cjs.entry.js +9 -7
  63. package/dist/cjs/mds-pref-contrast.cjs.entry.js +9 -7
  64. package/dist/cjs/mds-pref-language-item.cjs.entry.js +11 -4
  65. package/dist/cjs/mds-pref-language.cjs.entry.js +855 -12
  66. package/dist/cjs/mds-pref-theme.cjs.entry.js +14 -8
  67. package/dist/cjs/mds-pref.cjs.entry.js +8 -4
  68. package/dist/cjs/mds-price-table-features-cell.cjs.entry.js +1 -1
  69. package/dist/cjs/mds-price-table-features-row.cjs.entry.js +1 -1
  70. package/dist/cjs/mds-price-table-features.cjs.entry.js +1 -1
  71. package/dist/cjs/mds-price-table-header.cjs.entry.js +1 -1
  72. package/dist/cjs/mds-price-table-list-item.cjs.entry.js +1 -1
  73. package/dist/cjs/mds-price-table-list.cjs.entry.js +4 -4
  74. package/dist/cjs/mds-price-table.cjs.entry.js +1 -1
  75. package/dist/cjs/mds-progress.cjs.entry.js +10 -4
  76. package/dist/cjs/mds-push-notification.cjs.entry.js +87 -19
  77. package/dist/cjs/mds-push-notifications.cjs.entry.js +1 -1
  78. package/dist/cjs/mds-quote.cjs.entry.js +3 -2
  79. package/dist/cjs/mds-separator.cjs.entry.js +2 -2
  80. package/dist/cjs/mds-stepper-bar-item.cjs.entry.js +3 -3
  81. package/dist/cjs/mds-stepper-bar.cjs.entry.js +1 -1
  82. package/dist/cjs/mds-tab-bar-item.cjs.entry.js +2 -2
  83. package/dist/cjs/mds-tab-bar.cjs.entry.js +1 -1
  84. package/dist/cjs/mds-tab_2.cjs.entry.js +2 -2
  85. package/dist/cjs/mds-table-body.cjs.entry.js +1 -1
  86. package/dist/cjs/mds-table-cell.cjs.entry.js +2 -2
  87. package/dist/cjs/mds-table-footer.cjs.entry.js +1 -1
  88. package/dist/cjs/mds-table-header-cell.cjs.entry.js +8 -8
  89. package/dist/cjs/mds-table-header.cjs.entry.js +1 -1
  90. package/dist/cjs/mds-table-row.cjs.entry.js +16 -3
  91. package/dist/cjs/mds-table.cjs.entry.js +18 -3
  92. package/dist/cjs/mds-text.cjs.entry.js +4 -2
  93. package/dist/cjs/mds-toast.cjs.entry.js +8 -4
  94. package/dist/cjs/mds-tooltip.cjs.entry.js +10 -11
  95. package/dist/cjs/mds-url-view.cjs.entry.js +55 -4
  96. package/dist/cjs/mds-usage.cjs.entry.js +3 -13
  97. package/dist/cjs/mds-video-wall.cjs.entry.js +5 -5
  98. package/dist/cjs/mds-zero.cjs.entry.js +2 -2
  99. package/dist/collection/collection-manifest.json +2 -3
  100. package/dist/collection/common/aria.js +17 -1
  101. package/dist/collection/common/device.js +6 -0
  102. package/dist/collection/common/keyboard-manager.js +2 -2
  103. package/dist/collection/common/locale.js +17 -5
  104. package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +16 -12
  105. package/dist/collection/components/mds-accordion-timer-item/mds-accordion-timer-item.js +1 -1
  106. package/dist/collection/components/mds-avatar/mds-avatar.css +6 -6
  107. package/dist/collection/components/mds-badge/mds-badge.css +70 -72
  108. package/dist/collection/components/mds-banner/mds-banner.css +5 -5
  109. package/dist/collection/components/mds-banner/mds-banner.js +36 -2
  110. package/dist/collection/components/mds-breadcrumb/mds-breadcrumb.js +46 -2
  111. package/dist/collection/components/mds-breadcrumb-item/mds-breadcrumb-item.css +3 -0
  112. package/dist/collection/components/mds-breadcrumb-item/mds-breadcrumb-item.js +1 -1
  113. package/dist/collection/components/mds-button/mds-button.css +147 -133
  114. package/dist/collection/components/mds-button/mds-button.js +4 -2
  115. package/dist/collection/components/mds-chip/mds-chip.css +231 -33
  116. package/dist/collection/components/mds-chip/mds-chip.js +167 -48
  117. package/dist/collection/components/mds-chip/test/mds-chip.stories.js +27 -8
  118. package/dist/collection/components/mds-details/mds-details.css +4 -3
  119. package/dist/collection/components/mds-dropdown/mds-dropdown.js +9 -7
  120. package/dist/collection/components/mds-entity/mds-entity.js +4 -4
  121. package/dist/collection/components/mds-entity/test/mds-entity.stories.js +3 -3
  122. package/dist/collection/components/mds-file/mds-file.js +45 -22
  123. package/dist/collection/components/mds-file-preview/mds-file-preview.css +126 -82
  124. package/dist/collection/components/mds-file-preview/mds-file-preview.js +49 -3
  125. package/dist/collection/components/mds-filter/mds-filter.js +1 -1
  126. package/dist/collection/components/mds-filter-item/mds-filter-item.js +1 -1
  127. package/dist/collection/components/mds-header/mds-header.js +4 -2
  128. package/dist/collection/components/mds-help/mds-help.css +4 -9
  129. package/dist/collection/components/mds-help/mds-help.js +2 -1
  130. package/dist/collection/components/mds-icon/mds-icon.js +2 -4
  131. package/dist/collection/components/mds-icon/services/icons-set.service.js +42 -9
  132. package/dist/collection/components/mds-icon/test/mds-icon.stories.js +15 -0
  133. package/dist/collection/components/mds-img/mds-img.css +3 -3
  134. package/dist/collection/components/mds-img/mds-img.js +32 -2
  135. package/dist/collection/components/mds-input/mds-input.css +4 -4
  136. package/dist/collection/components/mds-input/mds-input.js +40 -15
  137. package/dist/collection/components/mds-input/test/mds-input.stories.js +16 -7
  138. package/dist/collection/components/mds-input-field/mds-input-field.js +9 -9
  139. package/dist/collection/components/mds-input-range/mds-input-range.css +6 -6
  140. package/dist/collection/components/mds-input-range/mds-input-range.js +4 -3
  141. package/dist/collection/components/mds-input-range/test/mds-input-range.stories.js +4 -4
  142. package/dist/collection/components/mds-input-select/mds-input-select.css +12 -12
  143. package/dist/collection/components/mds-input-select/mds-input-select.js +11 -11
  144. package/dist/collection/components/mds-input-switch/mds-input-switch.css +2 -2
  145. package/dist/collection/components/mds-input-switch/mds-input-switch.js +6 -5
  146. package/dist/collection/components/mds-input-tip-item/mds-input-tip-item.js +41 -7
  147. package/dist/collection/components/mds-input-upload/mds-input-upload.css +1 -1
  148. package/dist/collection/components/mds-input-upload/mds-input-upload.js +41 -7
  149. package/dist/collection/components/mds-kpi/mds-kpi.js +1 -1
  150. package/dist/collection/components/mds-kpi-item/mds-kpi-item.css +4 -4
  151. package/dist/collection/components/mds-kpi-item/mds-kpi-item.js +5 -3
  152. package/dist/collection/components/mds-label/mds-label.css +2 -9
  153. package/dist/collection/components/mds-label/mds-label.js +44 -2
  154. package/dist/collection/components/mds-list/mds-list.js +1 -1
  155. package/dist/collection/components/mds-list-item/mds-list-item.js +1 -1
  156. package/dist/collection/components/mds-modal/mds-modal.js +5 -3
  157. package/dist/collection/components/mds-modal/test/mds-modal.stories.js +8 -4
  158. package/dist/collection/components/mds-note/mds-note.js +45 -1
  159. package/dist/collection/components/mds-notification/mds-notification.js +2 -1
  160. package/dist/collection/components/mds-paginator/mds-paginator.js +2 -2
  161. package/dist/collection/components/mds-paginator-item/mds-paginator-item.css +3 -3
  162. package/dist/collection/components/mds-paginator-item/mds-paginator-item.js +2 -2
  163. package/dist/collection/components/mds-pref/mds-pref.js +28 -2
  164. package/dist/collection/components/mds-pref-animation/mds-pref-animation.js +32 -4
  165. package/dist/collection/components/mds-pref-animation/meta/dictionary.js +2 -2
  166. package/dist/collection/components/mds-pref-consumption/mds-pref-consumption.js +32 -4
  167. package/dist/collection/components/mds-pref-contrast/mds-pref-contrast.js +32 -4
  168. package/dist/collection/components/mds-pref-language/mds-pref-language.css +20 -2
  169. package/dist/collection/components/mds-pref-language/mds-pref-language.js +47 -19
  170. package/dist/collection/components/mds-pref-language/meta/dictionary.js +2 -0
  171. package/dist/collection/components/mds-pref-language/test/mds-pref-language.stories.js +1 -1
  172. package/dist/collection/components/mds-pref-language-item/mds-pref-language-item.js +38 -11
  173. package/dist/collection/components/mds-pref-theme/mds-pref-theme.js +37 -5
  174. package/dist/collection/components/mds-price-table/test/mds-price-table.stories.js +1 -1
  175. package/dist/collection/components/mds-price-table-features/mds-price-table-features.css +2 -0
  176. package/dist/collection/components/mds-price-table-list/mds-price-table-list.css +4 -4
  177. package/dist/collection/components/mds-price-table-list/mds-price-table-list.js +2 -2
  178. package/dist/collection/components/mds-progress/mds-progress.css +16 -16
  179. package/dist/collection/components/mds-progress/mds-progress.js +8 -2
  180. package/dist/collection/components/mds-progress/test/mds-progress.stories.js +1 -1
  181. package/dist/collection/components/mds-push-notification/mds-push-notification.css +6 -6
  182. package/dist/collection/components/mds-push-notification/mds-push-notification.js +36 -2
  183. package/dist/collection/components/mds-quote/mds-quote.js +26 -1
  184. package/dist/collection/components/mds-quote/test/mds-quote.stories.js +11 -0
  185. package/dist/collection/components/mds-spinner/mds-spinner.css +3 -3
  186. package/dist/collection/components/mds-stepper-bar-item/mds-stepper-bar-item.css +1 -1
  187. package/dist/collection/components/mds-stepper-bar-item/mds-stepper-bar-item.js +1 -1
  188. package/dist/collection/components/mds-tab/mds-tab.css +1 -1
  189. package/dist/collection/components/mds-tab-bar-item/mds-tab-bar-item.css +8 -8
  190. package/dist/collection/components/mds-table/mds-table.css +3 -3
  191. package/dist/collection/components/mds-table/mds-table.js +16 -1
  192. package/dist/collection/components/mds-table/test/mds-table.stories.js +5 -0
  193. package/dist/collection/components/mds-table-cell/mds-table-cell.js +1 -1
  194. package/dist/collection/components/mds-table-header-cell/mds-table-header-cell.css +2 -6
  195. package/dist/collection/components/mds-table-header-cell/mds-table-header-cell.js +7 -7
  196. package/dist/collection/components/mds-table-row/mds-table-row.css +59 -0
  197. package/dist/collection/components/mds-table-row/mds-table-row.js +26 -1
  198. package/dist/collection/components/mds-text/mds-text.js +6 -4
  199. package/dist/collection/components/mds-text/test/mds-text.stories.js +1 -1
  200. package/dist/collection/components/mds-toast/mds-toast.js +7 -3
  201. package/dist/collection/components/mds-tooltip/mds-tooltip.js +8 -9
  202. package/dist/collection/components/mds-url-view/mds-url-view.js +45 -1
  203. package/dist/collection/components/mds-usage/mds-usage.css +14 -14
  204. package/dist/collection/components/mds-usage/mds-usage.js +1 -11
  205. package/dist/collection/components/mds-video-wall/mds-video-wall.css +19 -3
  206. package/dist/collection/components/mds-video-wall/mds-video-wall.js +3 -3
  207. package/dist/collection/components/mds-zero/mds-zero.js +1 -1
  208. package/dist/collection/dictionary/file-extensions.js +114 -56
  209. package/dist/collection/dictionary/text.js +60 -1
  210. package/dist/collection/dictionary/variant.js +10 -1
  211. package/dist/components/aria.js +17 -2
  212. package/dist/components/floating-ui.dom.esm.js +484 -40
  213. package/dist/components/keyboard-manager.js +2 -2
  214. package/dist/components/locale.it.js +578 -0
  215. package/dist/components/locale.js +668 -4615
  216. package/dist/components/mds-accordion-timer-item.js +1 -1
  217. package/dist/components/mds-accordion-timer.js +16 -12
  218. package/dist/components/mds-avatar2.js +2 -2
  219. package/dist/components/mds-badge2.js +1 -1
  220. package/dist/components/mds-banner.js +23 -5
  221. package/dist/components/mds-breadcrumb-item.js +2 -2
  222. package/dist/components/mds-breadcrumb.js +39 -3
  223. package/dist/components/mds-button2.js +5 -3
  224. package/dist/components/mds-chip.js +91 -29
  225. package/dist/components/mds-details.js +1 -1
  226. package/dist/components/mds-dropdown2.js +9 -7
  227. package/dist/components/mds-entity.js +4 -4
  228. package/dist/components/mds-file-preview2.js +40 -6
  229. package/dist/components/mds-file.js +39 -8
  230. package/dist/components/mds-filter-item2.js +1 -1
  231. package/dist/components/mds-filter.js +1 -1
  232. package/dist/components/mds-header.js +4 -2
  233. package/dist/components/mds-help.js +5 -4
  234. package/dist/components/mds-icon2.js +44 -13
  235. package/dist/components/mds-img2.js +22 -4
  236. package/dist/components/mds-input-field.js +2 -2
  237. package/dist/components/mds-input-range.js +5 -4
  238. package/dist/components/mds-input-select.js +7 -7
  239. package/dist/components/mds-input-switch.js +7 -6
  240. package/dist/components/mds-input-tip-item2.js +36 -10
  241. package/dist/components/mds-input-upload.js +158 -28
  242. package/dist/components/mds-input2.js +42 -13
  243. package/dist/components/mds-kpi-item.js +5 -3
  244. package/dist/components/mds-kpi.js +1 -1
  245. package/dist/components/mds-label.js +33 -4
  246. package/dist/components/mds-list-item.js +1 -1
  247. package/dist/components/mds-list.js +1 -1
  248. package/dist/components/mds-modal2.js +5 -3
  249. package/dist/components/mds-note.js +38 -2
  250. package/dist/components/mds-notification.js +2 -1
  251. package/dist/components/mds-paginator-item2.js +3 -3
  252. package/dist/components/mds-paginator.js +2 -2
  253. package/dist/components/mds-pref-animation.js +9 -5
  254. package/dist/components/mds-pref-consumption.js +9 -5
  255. package/dist/components/mds-pref-contrast.js +9 -5
  256. package/dist/components/mds-pref-language-item.js +11 -2
  257. package/dist/components/mds-pref-language.js +863 -23
  258. package/dist/components/mds-pref-theme.js +14 -6
  259. package/dist/components/mds-pref.js +8 -2
  260. package/dist/components/mds-price-table-list.js +3 -3
  261. package/dist/components/mds-progress2.js +9 -3
  262. package/dist/components/mds-push-notification.js +89 -20
  263. package/dist/components/mds-quote.js +4 -2
  264. package/dist/components/mds-spinner2.js +1 -1
  265. package/dist/components/mds-stepper-bar-item.js +2 -2
  266. package/dist/components/mds-tab-bar-item.js +1 -1
  267. package/dist/components/mds-tab2.js +1 -1
  268. package/dist/components/mds-table-cell.js +1 -1
  269. package/dist/components/mds-table-header-cell.js +7 -7
  270. package/dist/components/mds-table-row.js +17 -3
  271. package/dist/components/mds-table.js +17 -2
  272. package/dist/components/mds-text2.js +3 -1
  273. package/dist/components/mds-toast.js +7 -3
  274. package/dist/components/mds-tooltip2.js +8 -9
  275. package/dist/components/mds-url-view.js +54 -2
  276. package/dist/components/mds-usage.js +2 -12
  277. package/dist/components/mds-video-wall.js +4 -4
  278. package/dist/components/mds-zero.js +1 -1
  279. package/dist/documentation.json +929 -484
  280. package/dist/{components/_commonjsHelpers.js → esm/_commonjsHelpers-bdec4bbd.js} +1 -5
  281. package/dist/esm/{aria-0e390d9c.js → aria-ed9d415d.js} +17 -2
  282. package/dist/esm/file-extensions-97006435.js +123 -0
  283. package/dist/esm/{floating-ui.dom.esm-f7b7f919.js → floating-ui.dom.esm-b6d2205c.js} +484 -40
  284. package/dist/esm/{index-f08bac5f.js → index-44fd80a1.js} +24 -297
  285. package/dist/esm/{keyboard-manager-f3d273fc.js → keyboard-manager-9f287ab7.js} +2 -2
  286. package/dist/esm/loader.js +3 -3
  287. package/dist/esm/locale-149207d6.js +843 -0
  288. package/dist/esm/locale.it-94429e24.js +457 -0
  289. package/dist/esm/magma-components.js +4 -4
  290. package/dist/esm/mds-accordion-item.entry.js +1 -1
  291. package/dist/esm/mds-accordion-timer-item.entry.js +2 -2
  292. package/dist/esm/mds-accordion-timer.entry.js +17 -13
  293. package/dist/esm/mds-accordion.entry.js +1 -1
  294. package/dist/esm/mds-author.entry.js +1 -1
  295. package/dist/esm/mds-avatar.entry.js +3 -3
  296. package/dist/esm/mds-badge.entry.js +2 -2
  297. package/dist/esm/mds-banner.entry.js +24 -8
  298. package/dist/esm/mds-benchmark-bar.entry.js +1 -1
  299. package/dist/esm/mds-bibliography.entry.js +1 -1
  300. package/dist/esm/mds-breadcrumb-item.entry.js +4 -4
  301. package/dist/esm/mds-breadcrumb.entry.js +39 -4
  302. package/dist/esm/mds-button_3.entry.js +53 -20
  303. package/dist/esm/mds-card-content.entry.js +1 -1
  304. package/dist/esm/mds-card-footer.entry.js +1 -1
  305. package/dist/esm/mds-card-header.entry.js +1 -1
  306. package/dist/esm/mds-card-media.entry.js +1 -1
  307. package/dist/esm/mds-card.entry.js +1 -1
  308. package/dist/esm/mds-chip.entry.js +83 -28
  309. package/dist/esm/mds-details.entry.js +3 -3
  310. package/dist/esm/{mds-dropdown_2.entry.js → mds-dropdown.entry.js} +13 -890
  311. package/dist/esm/mds-entity.entry.js +5 -5
  312. package/dist/esm/mds-file-preview.entry.js +40 -7
  313. package/dist/esm/mds-file.entry.js +39 -8
  314. package/dist/esm/mds-filter-item.entry.js +3 -3
  315. package/dist/esm/mds-filter.entry.js +2 -2
  316. package/dist/esm/mds-header-bar.entry.js +1 -1
  317. package/dist/esm/mds-header.entry.js +5 -3
  318. package/dist/esm/mds-help.entry.js +4 -4
  319. package/dist/esm/mds-horizontal-scroll.entry.js +1 -1
  320. package/dist/esm/mds-hr.entry.js +1 -1
  321. package/dist/esm/mds-img.entry.js +23 -7
  322. package/dist/esm/mds-input-field.entry.js +3 -3
  323. package/dist/esm/mds-input-range.entry.js +6 -5
  324. package/dist/esm/mds-input-select.entry.js +8 -8
  325. package/dist/esm/mds-input-switch.entry.js +9 -8
  326. package/dist/esm/mds-input-tip_2.entry.js +36 -12
  327. package/dist/esm/mds-input-upload.entry.js +159 -31
  328. package/dist/esm/mds-input.entry.js +44 -16
  329. package/dist/esm/mds-kpi-item.entry.js +6 -4
  330. package/dist/esm/mds-kpi.entry.js +2 -2
  331. package/dist/esm/mds-label.entry.js +33 -5
  332. package/dist/esm/mds-list-item.entry.js +2 -2
  333. package/dist/esm/mds-list.entry.js +2 -2
  334. package/dist/esm/mds-modal.entry.js +6 -4
  335. package/dist/esm/mds-note.entry.js +38 -3
  336. package/dist/esm/mds-notification.entry.js +4 -3
  337. package/dist/esm/mds-paginator-item.entry.js +5 -5
  338. package/dist/esm/mds-paginator.entry.js +3 -3
  339. package/dist/esm/mds-pref-animation.entry.js +9 -7
  340. package/dist/esm/mds-pref-consumption.entry.js +9 -7
  341. package/dist/esm/mds-pref-contrast.entry.js +9 -7
  342. package/dist/esm/mds-pref-language-item.entry.js +11 -4
  343. package/dist/esm/mds-pref-language.entry.js +855 -12
  344. package/dist/esm/mds-pref-theme.entry.js +14 -8
  345. package/dist/esm/mds-pref.entry.js +8 -4
  346. package/dist/esm/mds-price-table-features-cell.entry.js +1 -1
  347. package/dist/esm/mds-price-table-features-row.entry.js +1 -1
  348. package/dist/esm/mds-price-table-features.entry.js +1 -1
  349. package/dist/esm/mds-price-table-header.entry.js +1 -1
  350. package/dist/esm/mds-price-table-list-item.entry.js +1 -1
  351. package/dist/esm/mds-price-table-list.entry.js +4 -4
  352. package/dist/esm/mds-price-table.entry.js +1 -1
  353. package/dist/esm/mds-progress.entry.js +10 -4
  354. package/dist/esm/mds-push-notification.entry.js +87 -19
  355. package/dist/esm/mds-push-notifications.entry.js +1 -1
  356. package/dist/esm/mds-quote.entry.js +3 -2
  357. package/dist/esm/mds-separator.entry.js +2 -2
  358. package/dist/esm/mds-stepper-bar-item.entry.js +3 -3
  359. package/dist/esm/mds-stepper-bar.entry.js +1 -1
  360. package/dist/esm/mds-tab-bar-item.entry.js +2 -2
  361. package/dist/esm/mds-tab-bar.entry.js +1 -1
  362. package/dist/esm/mds-tab_2.entry.js +2 -2
  363. package/dist/esm/mds-table-body.entry.js +1 -1
  364. package/dist/esm/mds-table-cell.entry.js +2 -2
  365. package/dist/esm/mds-table-footer.entry.js +1 -1
  366. package/dist/esm/mds-table-header-cell.entry.js +8 -8
  367. package/dist/esm/mds-table-header.entry.js +1 -1
  368. package/dist/esm/mds-table-row.entry.js +16 -3
  369. package/dist/esm/mds-table.entry.js +18 -3
  370. package/dist/esm/mds-text.entry.js +4 -2
  371. package/dist/esm/mds-toast.entry.js +8 -4
  372. package/dist/esm/mds-tooltip.entry.js +10 -11
  373. package/dist/esm/mds-url-view.entry.js +54 -3
  374. package/dist/esm/mds-usage.entry.js +3 -13
  375. package/dist/esm/mds-video-wall.entry.js +5 -5
  376. package/dist/esm/mds-zero.entry.js +2 -2
  377. package/dist/esm-es5/_commonjsHelpers-bdec4bbd.js +1 -0
  378. package/dist/esm-es5/aria-ed9d415d.js +1 -0
  379. package/dist/esm-es5/file-extensions-97006435.js +1 -0
  380. package/dist/esm-es5/floating-ui.dom.esm-b6d2205c.js +1 -0
  381. package/dist/esm-es5/index-44fd80a1.js +1 -0
  382. package/dist/esm-es5/{keyboard-manager-f3d273fc.js → keyboard-manager-9f287ab7.js} +1 -1
  383. package/dist/esm-es5/loader.js +1 -1
  384. package/dist/esm-es5/locale-149207d6.js +6 -0
  385. package/dist/esm-es5/locale.it-94429e24.js +1 -0
  386. package/dist/esm-es5/magma-components.js +1 -1
  387. package/dist/esm-es5/mds-accordion-item.entry.js +1 -1
  388. package/dist/esm-es5/mds-accordion-timer-item.entry.js +1 -1
  389. package/dist/esm-es5/mds-accordion-timer.entry.js +1 -1
  390. package/dist/esm-es5/mds-accordion.entry.js +1 -1
  391. package/dist/esm-es5/mds-author.entry.js +1 -1
  392. package/dist/esm-es5/mds-avatar.entry.js +1 -1
  393. package/dist/esm-es5/mds-badge.entry.js +1 -1
  394. package/dist/esm-es5/mds-banner.entry.js +1 -1
  395. package/dist/esm-es5/mds-benchmark-bar.entry.js +1 -1
  396. package/dist/esm-es5/mds-bibliography.entry.js +1 -1
  397. package/dist/esm-es5/mds-breadcrumb-item.entry.js +1 -1
  398. package/dist/esm-es5/mds-breadcrumb.entry.js +1 -1
  399. package/dist/esm-es5/mds-button_3.entry.js +1 -1
  400. package/dist/esm-es5/mds-card-content.entry.js +1 -1
  401. package/dist/esm-es5/mds-card-footer.entry.js +1 -1
  402. package/dist/esm-es5/mds-card-header.entry.js +1 -1
  403. package/dist/esm-es5/mds-card-media.entry.js +1 -1
  404. package/dist/esm-es5/mds-card.entry.js +1 -1
  405. package/dist/esm-es5/mds-chip.entry.js +1 -1
  406. package/dist/esm-es5/mds-details.entry.js +1 -1
  407. package/dist/esm-es5/mds-dropdown.entry.js +1 -0
  408. package/dist/esm-es5/mds-entity.entry.js +1 -1
  409. package/dist/esm-es5/mds-file-preview.entry.js +2 -2
  410. package/dist/esm-es5/mds-file.entry.js +3 -3
  411. package/dist/esm-es5/mds-filter-item.entry.js +1 -1
  412. package/dist/esm-es5/mds-filter.entry.js +1 -1
  413. package/dist/esm-es5/mds-header-bar.entry.js +1 -1
  414. package/dist/esm-es5/mds-header.entry.js +1 -1
  415. package/dist/esm-es5/mds-help.entry.js +1 -1
  416. package/dist/esm-es5/mds-horizontal-scroll.entry.js +1 -1
  417. package/dist/esm-es5/mds-hr.entry.js +1 -1
  418. package/dist/esm-es5/mds-img.entry.js +1 -1
  419. package/dist/esm-es5/mds-input-field.entry.js +1 -1
  420. package/dist/esm-es5/mds-input-range.entry.js +1 -1
  421. package/dist/esm-es5/mds-input-select.entry.js +1 -1
  422. package/dist/esm-es5/mds-input-switch.entry.js +1 -1
  423. package/dist/esm-es5/mds-input-tip_2.entry.js +1 -1
  424. package/dist/esm-es5/mds-input-upload.entry.js +1 -1
  425. package/dist/esm-es5/mds-input.entry.js +1 -1
  426. package/dist/esm-es5/mds-kpi-item.entry.js +1 -1
  427. package/dist/esm-es5/mds-kpi.entry.js +1 -1
  428. package/dist/esm-es5/mds-label.entry.js +1 -1
  429. package/dist/esm-es5/mds-list-item.entry.js +1 -1
  430. package/dist/esm-es5/mds-list.entry.js +1 -1
  431. package/dist/esm-es5/mds-modal.entry.js +1 -1
  432. package/dist/esm-es5/mds-note.entry.js +1 -1
  433. package/dist/esm-es5/mds-notification.entry.js +1 -1
  434. package/dist/esm-es5/mds-paginator-item.entry.js +1 -1
  435. package/dist/esm-es5/mds-paginator.entry.js +1 -1
  436. package/dist/esm-es5/mds-pref-animation.entry.js +1 -1
  437. package/dist/esm-es5/mds-pref-consumption.entry.js +1 -1
  438. package/dist/esm-es5/mds-pref-contrast.entry.js +1 -1
  439. package/dist/esm-es5/mds-pref-language-item.entry.js +1 -1
  440. package/dist/esm-es5/mds-pref-language.entry.js +1 -1
  441. package/dist/esm-es5/mds-pref-theme.entry.js +1 -1
  442. package/dist/esm-es5/mds-pref.entry.js +1 -1
  443. package/dist/esm-es5/mds-price-table-features-cell.entry.js +1 -1
  444. package/dist/esm-es5/mds-price-table-features-row.entry.js +1 -1
  445. package/dist/esm-es5/mds-price-table-features.entry.js +1 -1
  446. package/dist/esm-es5/mds-price-table-header.entry.js +1 -1
  447. package/dist/esm-es5/mds-price-table-list-item.entry.js +1 -1
  448. package/dist/esm-es5/mds-price-table-list.entry.js +1 -1
  449. package/dist/esm-es5/mds-price-table.entry.js +1 -1
  450. package/dist/esm-es5/mds-progress.entry.js +1 -1
  451. package/dist/esm-es5/mds-push-notification.entry.js +1 -1
  452. package/dist/esm-es5/mds-push-notifications.entry.js +1 -1
  453. package/dist/esm-es5/mds-quote.entry.js +1 -1
  454. package/dist/esm-es5/mds-separator.entry.js +1 -1
  455. package/dist/esm-es5/mds-stepper-bar-item.entry.js +1 -1
  456. package/dist/esm-es5/mds-stepper-bar.entry.js +1 -1
  457. package/dist/esm-es5/mds-tab-bar-item.entry.js +1 -1
  458. package/dist/esm-es5/mds-tab-bar.entry.js +1 -1
  459. package/dist/esm-es5/mds-tab_2.entry.js +1 -1
  460. package/dist/esm-es5/mds-table-body.entry.js +1 -1
  461. package/dist/esm-es5/mds-table-cell.entry.js +1 -1
  462. package/dist/esm-es5/mds-table-footer.entry.js +1 -1
  463. package/dist/esm-es5/mds-table-header-cell.entry.js +1 -1
  464. package/dist/esm-es5/mds-table-header.entry.js +1 -1
  465. package/dist/esm-es5/mds-table-row.entry.js +1 -1
  466. package/dist/esm-es5/mds-table.entry.js +1 -1
  467. package/dist/esm-es5/mds-text.entry.js +1 -1
  468. package/dist/esm-es5/mds-toast.entry.js +1 -1
  469. package/dist/esm-es5/mds-tooltip.entry.js +1 -1
  470. package/dist/esm-es5/mds-url-view.entry.js +1 -1
  471. package/dist/esm-es5/mds-usage.entry.js +1 -1
  472. package/dist/esm-es5/mds-video-wall.entry.js +1 -1
  473. package/dist/esm-es5/mds-zero.entry.js +1 -1
  474. package/dist/hydrate/index.d.ts +6 -0
  475. package/dist/hydrate/index.js +3705 -5972
  476. package/dist/hydrate/index.mjs +3705 -5972
  477. package/dist/magma-components/magma-components.esm.js +1 -1
  478. package/dist/magma-components/magma-components.js +1 -1
  479. package/dist/magma-components/p-03c13bdf.system.entry.js +1 -0
  480. package/dist/magma-components/p-0492e275.entry.js +1 -0
  481. package/dist/magma-components/p-04c61fa1.system.entry.js +1 -0
  482. package/dist/magma-components/p-05bf15c7.entry.js +1 -0
  483. package/dist/magma-components/{p-5f0f0448.system.entry.js → p-07253a21.system.entry.js} +1 -1
  484. package/dist/magma-components/p-086c8147.entry.js +1 -0
  485. package/dist/magma-components/p-0b2a9068.entry.js +1 -0
  486. package/dist/magma-components/p-0b6b57fb.js +1 -0
  487. package/dist/magma-components/p-0b77bb1c.system.entry.js +1 -0
  488. package/dist/magma-components/p-0f3e17bc.js +1 -0
  489. package/dist/magma-components/{p-7d460c08.system.entry.js → p-0f6c6757.system.entry.js} +1 -1
  490. package/dist/magma-components/p-13c6c73b.entry.js +1 -0
  491. package/dist/magma-components/p-13ce8757.system.entry.js +1 -0
  492. package/dist/magma-components/p-1400e3c3.system.entry.js +1 -0
  493. package/dist/magma-components/p-1581b10e.system.entry.js +1 -0
  494. package/dist/magma-components/{p-8980cf86.system.entry.js → p-17d63927.system.entry.js} +1 -1
  495. package/dist/magma-components/{p-ae612034.system.entry.js → p-19114f13.system.entry.js} +1 -1
  496. package/dist/magma-components/{p-53f8a981.entry.js → p-19c55d3e.entry.js} +1 -1
  497. package/dist/magma-components/{p-5258907f.system.entry.js → p-1b436c7c.system.entry.js} +1 -1
  498. package/dist/magma-components/{p-2f7dd737.system.entry.js → p-1bb949c2.system.entry.js} +1 -1
  499. package/dist/magma-components/p-217aed60.system.entry.js +1 -0
  500. package/dist/magma-components/p-21b1acec.system.js +1 -0
  501. package/dist/magma-components/{p-f62b4856.entry.js → p-22954bd0.entry.js} +1 -1
  502. package/dist/magma-components/{p-67f8aea1.entry.js → p-23c0e5bb.entry.js} +1 -1
  503. package/dist/magma-components/p-247e25c9.entry.js +1 -0
  504. package/dist/magma-components/p-2547e1c5.entry.js +1 -0
  505. package/dist/magma-components/p-25602048.system.entry.js +1 -0
  506. package/dist/magma-components/{p-dbde7f2c.system.entry.js → p-27923d25.system.entry.js} +1 -1
  507. package/dist/magma-components/p-2a0bffc8.entry.js +1 -0
  508. package/dist/magma-components/p-2bedaf5f.system.entry.js +1 -0
  509. package/dist/magma-components/p-2d5135c7.entry.js +1 -0
  510. package/dist/magma-components/p-2d58b5b8.system.entry.js +1 -0
  511. package/dist/magma-components/{p-b4c84e8e.entry.js → p-2e3e7ae9.entry.js} +1 -1
  512. package/dist/magma-components/{p-12c9e7c1.system.entry.js → p-30326380.system.entry.js} +1 -1
  513. package/dist/magma-components/p-304b1738.entry.js +1 -0
  514. package/dist/magma-components/{p-c7267a25.system.entry.js → p-30671bb6.system.entry.js} +1 -1
  515. package/dist/magma-components/p-31ad7005.entry.js +1 -0
  516. package/dist/magma-components/p-3213bed3.js +1 -0
  517. package/dist/magma-components/{p-06bbdfbc.system.js → p-32f55263.system.js} +1 -1
  518. package/dist/magma-components/{p-3ebb87fd.system.entry.js → p-332ef4c5.system.entry.js} +1 -1
  519. package/dist/magma-components/p-340717b1.entry.js +1 -0
  520. package/dist/magma-components/{p-19ffbf29.system.entry.js → p-3545d28a.system.entry.js} +1 -1
  521. package/dist/magma-components/p-3759b1b2.system.js +6 -0
  522. package/dist/magma-components/{p-57e85f09.entry.js → p-3c4114a1.entry.js} +1 -1
  523. package/dist/magma-components/{p-e1ae3377.entry.js → p-3c7584e0.entry.js} +1 -1
  524. package/dist/magma-components/p-3d9b24ed.system.entry.js +1 -0
  525. package/dist/magma-components/p-3dcee09b.entry.js +1 -0
  526. package/dist/magma-components/p-413e1924.entry.js +8 -0
  527. package/dist/magma-components/{p-7ff9ee47.system.entry.js → p-41b0013f.system.entry.js} +1 -1
  528. package/dist/magma-components/p-42aaebea.entry.js +1 -0
  529. package/dist/magma-components/p-42c66e40.entry.js +1 -0
  530. package/dist/magma-components/{p-eba07611.system.entry.js → p-438c83a4.system.entry.js} +1 -1
  531. package/dist/magma-components/p-4509e5dd.entry.js +1 -0
  532. package/dist/magma-components/{p-8b576fd8.entry.js → p-46df472e.entry.js} +1 -1
  533. package/dist/magma-components/{p-12a6692f.entry.js → p-47044832.entry.js} +1 -1
  534. package/dist/magma-components/{p-1a2e5af9.entry.js → p-4a57c918.entry.js} +1 -1
  535. package/dist/magma-components/p-4d469a01.entry.js +1 -0
  536. package/dist/magma-components/{p-d41cdc56.entry.js → p-4e0c9d47.entry.js} +1 -1
  537. package/dist/magma-components/{p-d219007f.system.entry.js → p-4f52b15e.system.entry.js} +1 -1
  538. package/dist/magma-components/p-5100bf68.system.entry.js +1 -0
  539. package/dist/magma-components/p-55842900.entry.js +1 -0
  540. package/dist/magma-components/{p-8f8fd8f5.entry.js → p-5629c1f5.entry.js} +1 -1
  541. package/dist/magma-components/p-5818b17b.system.entry.js +1 -0
  542. package/dist/magma-components/p-5a2c6a26.system.entry.js +1 -0
  543. package/dist/magma-components/p-5af31a47.system.js +1 -0
  544. package/dist/magma-components/{p-0e54cbdd.entry.js → p-5d39c94f.entry.js} +1 -1
  545. package/dist/magma-components/{p-8c185de1.system.entry.js → p-5e063b6a.system.entry.js} +1 -1
  546. package/dist/magma-components/{p-32c2e662.system.entry.js → p-5fbe3d63.system.entry.js} +1 -1
  547. package/dist/magma-components/{p-eb1dcb87.system.entry.js → p-600f012f.system.entry.js} +1 -1
  548. package/dist/magma-components/{p-3013e2cb.entry.js → p-605913ba.entry.js} +1 -1
  549. package/dist/magma-components/p-60ab906d.entry.js +1 -0
  550. package/dist/magma-components/{p-945820db.system.entry.js → p-62ac240e.system.entry.js} +1 -1
  551. package/dist/magma-components/{p-00c6b918.system.entry.js → p-63e3f820.system.entry.js} +1 -1
  552. package/dist/magma-components/p-65ba0450.entry.js +1 -0
  553. package/dist/magma-components/p-6617f185.entry.js +1 -0
  554. package/dist/magma-components/p-665f05ca.system.entry.js +1 -0
  555. package/dist/magma-components/p-66ef6f68.system.entry.js +1 -0
  556. package/dist/magma-components/{p-d1f52b0b.system.js → p-6803cf8d.system.js} +1 -1
  557. package/dist/magma-components/p-694ac497.entry.js +1 -0
  558. package/dist/magma-components/p-6a2ec000.entry.js +1 -0
  559. package/dist/magma-components/p-6aed6b97.system.entry.js +1 -0
  560. package/dist/magma-components/p-6c4c3d44.system.entry.js +1 -0
  561. package/dist/magma-components/{p-f43e59d4.entry.js → p-6dc71639.entry.js} +1 -1
  562. package/dist/magma-components/{p-63e8bc17.system.entry.js → p-6f15b2d9.system.entry.js} +1 -1
  563. package/dist/magma-components/{p-7f235611.system.entry.js → p-71601583.system.entry.js} +1 -1
  564. package/dist/magma-components/p-759c9af3.entry.js +1 -0
  565. package/dist/magma-components/{p-b5f501d2.system.entry.js → p-782313bb.system.entry.js} +1 -1
  566. package/dist/magma-components/p-7a7220e5.entry.js +1 -0
  567. package/dist/magma-components/p-7ad5eeb3.system.entry.js +1 -0
  568. package/dist/magma-components/p-7affff90.system.entry.js +1 -0
  569. package/dist/magma-components/p-810ba60f.system.entry.js +1 -0
  570. package/dist/magma-components/{p-5ddef57f.entry.js → p-813176b0.entry.js} +1 -1
  571. package/dist/magma-components/p-84a3bc2b.system.entry.js +1 -0
  572. package/dist/magma-components/p-85aa8e05.js +1 -0
  573. package/dist/magma-components/p-85e7baee.entry.js +1 -0
  574. package/dist/magma-components/{p-20143ec9.entry.js → p-892e949c.entry.js} +1 -1
  575. package/dist/magma-components/p-893a87dc.system.entry.js +1 -0
  576. package/dist/magma-components/p-89f9e0d2.entry.js +1 -0
  577. package/dist/magma-components/{p-0349e303.system.entry.js → p-8fe9a0a2.system.entry.js} +1 -1
  578. package/dist/magma-components/p-917ba0e2.entry.js +1 -0
  579. package/dist/magma-components/p-94db8071.system.js +1 -0
  580. package/dist/magma-components/p-96afff9f.system.entry.js +1 -0
  581. package/dist/magma-components/p-96d07c9f.system.entry.js +1 -0
  582. package/dist/magma-components/p-96e60eca.system.entry.js +1 -0
  583. package/dist/magma-components/{p-c4b093c4.entry.js → p-9bd6657b.entry.js} +1 -1
  584. package/dist/magma-components/p-9bd9e612.system.entry.js +1 -0
  585. package/dist/magma-components/p-9c7039f0.entry.js +1 -0
  586. package/dist/magma-components/p-9d991391.entry.js +1 -0
  587. package/dist/magma-components/p-9df056cb.entry.js +1 -0
  588. package/dist/magma-components/p-a191a987.entry.js +1 -0
  589. package/dist/magma-components/{p-99678cdd.system.entry.js → p-a1f69741.system.entry.js} +1 -1
  590. package/dist/magma-components/{p-36c13a31.entry.js → p-a306ff28.entry.js} +1 -1
  591. package/dist/magma-components/p-a44d3db9.entry.js +1 -0
  592. package/dist/magma-components/p-a47aae12.entry.js +1 -0
  593. package/dist/magma-components/p-a4fc1b0b.entry.js +1 -0
  594. package/dist/magma-components/p-a557bad7.system.entry.js +1 -0
  595. package/dist/magma-components/p-a9432fee.system.entry.js +1 -0
  596. package/dist/magma-components/p-a9f8f986.system.entry.js +9 -0
  597. package/dist/magma-components/p-aa133f48.entry.js +1 -0
  598. package/dist/magma-components/p-aa24e213.system.entry.js +1 -0
  599. package/dist/magma-components/{p-e49f99c2.entry.js → p-aa8999ba.entry.js} +1 -1
  600. package/dist/magma-components/p-ac7403b5.system.js +1 -0
  601. package/dist/magma-components/{p-8321c0d3.entry.js → p-ac97dd43.entry.js} +1 -1
  602. package/dist/magma-components/p-ae0b6dcb.system.entry.js +1 -0
  603. package/dist/magma-components/{p-2a670d3c.system.entry.js → p-ae0c3e38.system.entry.js} +1 -1
  604. package/dist/magma-components/{p-8323a952.system.entry.js → p-aead7eab.system.entry.js} +1 -1
  605. package/dist/magma-components/p-b0868749.entry.js +1 -0
  606. package/dist/magma-components/p-b0bb702b.entry.js +1 -0
  607. package/dist/magma-components/p-b44f3e19.entry.js +1 -0
  608. package/dist/magma-components/{p-3d741487.entry.js → p-b458a7b7.entry.js} +1 -1
  609. package/dist/magma-components/p-b5551799.system.entry.js +1 -0
  610. package/dist/magma-components/p-b5a65fcd.system.js +1 -0
  611. package/dist/magma-components/p-b62d164b.system.entry.js +1 -0
  612. package/dist/magma-components/{p-efdb9fda.entry.js → p-b6cc1d20.entry.js} +1 -1
  613. package/dist/magma-components/p-b7889230.system.entry.js +1 -0
  614. package/dist/magma-components/{p-ec8975f3.entry.js → p-b8fcf897.entry.js} +1 -1
  615. package/dist/magma-components/{p-73ccc008.entry.js → p-bbe19d86.entry.js} +1 -1
  616. package/dist/magma-components/p-bd7c0f2b.entry.js +1 -0
  617. package/dist/magma-components/p-c0611d00.system.entry.js +1 -0
  618. package/dist/magma-components/{p-cd60481a.system.entry.js → p-c2291312.system.entry.js} +1 -1
  619. package/dist/magma-components/{p-0b471b37.system.entry.js → p-c2c1ca38.system.entry.js} +1 -1
  620. package/dist/magma-components/p-c310b41f.js +6 -0
  621. package/dist/magma-components/p-c3b57b65.entry.js +1 -0
  622. package/dist/magma-components/{p-f0bf8d7e.entry.js → p-c55796f6.entry.js} +1 -1
  623. package/dist/magma-components/p-c6616cf4.entry.js +1 -0
  624. package/dist/magma-components/p-c6f72257.entry.js +1 -0
  625. package/dist/magma-components/p-c7d97a3c.entry.js +1 -0
  626. package/dist/magma-components/p-c94628eb.system.js +2 -0
  627. package/dist/magma-components/p-d06b650f.entry.js +1 -0
  628. package/dist/magma-components/{p-bebaf8c9.system.entry.js → p-d239736c.system.entry.js} +1 -1
  629. package/dist/magma-components/p-d3f2a762.system.entry.js +1 -0
  630. package/dist/magma-components/p-d4a14ac6.entry.js +1 -0
  631. package/dist/magma-components/{p-adafaeb1.system.entry.js → p-d4ad6446.system.entry.js} +1 -1
  632. package/dist/magma-components/{p-5f3b296e.system.entry.js → p-d4f60172.system.entry.js} +1 -1
  633. package/dist/magma-components/p-d7fe5fb4.entry.js +1 -0
  634. package/dist/magma-components/p-dd0f6f83.entry.js +1 -0
  635. package/dist/magma-components/{p-0a4fcd1d.system.entry.js → p-dd7b49e7.system.entry.js} +1 -1
  636. package/dist/magma-components/p-ddb91a8e.system.entry.js +1 -0
  637. package/dist/magma-components/p-de21d32b.system.entry.js +1 -0
  638. package/dist/magma-components/p-dea5d36c.entry.js +1 -0
  639. package/dist/magma-components/{p-bf66db4f.entry.js → p-df55c1ea.entry.js} +1 -1
  640. package/dist/magma-components/{p-56132185.system.entry.js → p-e0288f0c.system.entry.js} +1 -1
  641. package/dist/magma-components/p-e03788d9.entry.js +1 -0
  642. package/dist/magma-components/p-e290055a.entry.js +18 -0
  643. package/dist/magma-components/p-e3423b24.entry.js +1 -0
  644. package/dist/magma-components/{p-d60d99ac.entry.js → p-e3b9a60f.entry.js} +1 -1
  645. package/dist/magma-components/p-e420031e.js +1 -0
  646. package/dist/magma-components/{p-ac5f1e42.system.entry.js → p-e5c3a802.system.entry.js} +1 -1
  647. package/dist/magma-components/p-e6e67992.entry.js +1 -0
  648. package/dist/magma-components/p-e82d486e.system.entry.js +18 -0
  649. package/dist/magma-components/p-e95f01d6.system.entry.js +1 -0
  650. package/dist/magma-components/{p-c2938231.system.entry.js → p-e9940be7.system.entry.js} +1 -1
  651. package/dist/magma-components/p-eab621a7.js +2 -0
  652. package/dist/magma-components/{p-9a878d34.entry.js → p-eae957b3.entry.js} +1 -1
  653. package/dist/magma-components/p-eb4bc264.system.entry.js +1 -0
  654. package/dist/magma-components/p-eb8bbb53.entry.js +1 -0
  655. package/dist/magma-components/{p-a09946ab.entry.js → p-edbaf4ab.entry.js} +1 -1
  656. package/dist/magma-components/p-ee536517.entry.js +1 -0
  657. package/dist/magma-components/{p-c2a42118.system.entry.js → p-eef53c2a.system.entry.js} +1 -1
  658. package/dist/magma-components/p-f0027ed8.system.entry.js +1 -0
  659. package/dist/magma-components/p-f00c93f4.js +1 -0
  660. package/dist/magma-components/p-f060e8cc.system.entry.js +1 -0
  661. package/dist/magma-components/p-f142ee72.entry.js +1 -0
  662. package/dist/magma-components/{p-efa3471a.entry.js → p-f1d7b5ea.entry.js} +1 -1
  663. package/dist/magma-components/{p-a5183c20.system.entry.js → p-f63148da.system.entry.js} +1 -1
  664. package/dist/magma-components/{p-44aaca66.system.entry.js → p-f94593f9.system.entry.js} +1 -1
  665. package/dist/magma-components/{p-c4cf09ea.system.entry.js → p-fa5fb4be.system.entry.js} +1 -1
  666. package/dist/magma-components/p-fc8bce99.system.entry.js +1 -0
  667. package/dist/magma-components/p-fe13fac9.system.entry.js +1 -0
  668. package/dist/magma-components/{p-12a225e3.system.entry.js → p-feadfe43.system.entry.js} +1 -1
  669. package/dist/magma-components/{p-bf242a75.system.entry.js → p-ffa94d0f.system.entry.js} +1 -1
  670. package/dist/stats.json +3575 -2712
  671. package/dist/types/common/aria.d.ts +3 -1
  672. package/dist/types/common/date.d.ts +1 -1
  673. package/dist/types/common/device.d.ts +2 -0
  674. package/dist/types/common/file.d.ts +2 -2
  675. package/dist/types/common/locale.d.ts +3 -1
  676. package/dist/types/components/mds-accordion/mds-accordion.d.ts +1 -1
  677. package/dist/types/components/mds-accordion-item/mds-accordion-item.d.ts +1 -1
  678. package/dist/types/components/mds-accordion-timer/mds-accordion-timer.d.ts +1 -1
  679. package/dist/types/components/mds-accordion-timer-item/mds-accordion-timer-item.d.ts +1 -1
  680. package/dist/types/components/mds-avatar/mds-avatar.d.ts +1 -1
  681. package/dist/types/components/mds-badge/mds-badge.d.ts +2 -2
  682. package/dist/types/components/mds-banner/mds-banner.d.ts +3 -1
  683. package/dist/types/components/mds-benchmark-bar/mds-benchmark-bar.d.ts +1 -1
  684. package/dist/types/components/mds-bibliography/mds-bibliography.d.ts +1 -1
  685. package/dist/types/components/mds-breadcrumb/mds-breadcrumb.d.ts +5 -1
  686. package/dist/types/components/mds-button/mds-button.d.ts +2 -2
  687. package/dist/types/components/mds-chip/mds-chip.d.ts +22 -7
  688. package/dist/types/components/mds-chip/test/mds-chip.stories.d.ts +30 -4
  689. package/dist/types/components/mds-dropdown/mds-dropdown.d.ts +1 -1
  690. package/dist/types/components/mds-entity/mds-entity.d.ts +1 -1
  691. package/dist/types/components/mds-file/mds-file.d.ts +4 -5
  692. package/dist/types/components/mds-file-preview/mds-file-preview.d.ts +7 -4
  693. package/dist/types/components/mds-file-preview/meta/event-detail.d.ts +1 -1
  694. package/dist/types/components/mds-filter/mds-filter.d.ts +1 -1
  695. package/dist/types/components/mds-header/mds-header.d.ts +1 -1
  696. package/dist/types/components/mds-header-bar/mds-header-bar.d.ts +1 -1
  697. package/dist/types/components/mds-help/mds-help.d.ts +1 -1
  698. package/dist/types/components/mds-icon/services/icons-set.service.d.ts +20 -4
  699. package/dist/types/components/mds-icon/test/mds-icon.stories.d.ts +1 -0
  700. package/dist/types/components/mds-img/mds-img.d.ts +3 -1
  701. package/dist/types/components/mds-input/mds-input.d.ts +6 -7
  702. package/dist/types/components/mds-input/test/mds-input.stories.d.ts +1 -0
  703. package/dist/types/components/mds-input-field/mds-input-field.d.ts +5 -6
  704. package/dist/types/components/mds-input-range/mds-input-range.d.ts +1 -0
  705. package/dist/types/components/mds-input-range/test/mds-input-range.stories.d.ts +0 -4
  706. package/dist/types/components/mds-input-select/mds-input-select.d.ts +3 -3
  707. package/dist/types/components/mds-input-switch/mds-input-switch.d.ts +2 -1
  708. package/dist/types/components/mds-input-switch/meta/interfaces.d.ts +1 -1
  709. package/dist/types/components/mds-input-tip-item/mds-input-tip-item.d.ts +3 -1
  710. package/dist/types/components/mds-input-upload/mds-input-upload.d.ts +13 -10
  711. package/dist/types/components/mds-kpi-item/mds-kpi-item.d.ts +1 -1
  712. package/dist/types/components/mds-label/mds-label.d.ts +6 -3
  713. package/dist/types/components/mds-list-item/mds-list-item.d.ts +1 -1
  714. package/dist/types/components/mds-modal/test/mds-modal.stories.d.ts +1 -2
  715. package/dist/types/components/mds-note/mds-note.d.ts +5 -1
  716. package/dist/types/components/mds-pref/mds-pref.d.ts +2 -0
  717. package/dist/types/components/mds-pref-animation/mds-pref-animation.d.ts +9 -8
  718. package/dist/types/components/mds-pref-consumption/mds-pref-consumption.d.ts +10 -9
  719. package/dist/types/components/mds-pref-contrast/mds-pref-contrast.d.ts +11 -10
  720. package/dist/types/components/mds-pref-language/mds-pref-language.d.ts +20 -15
  721. package/dist/types/components/mds-pref-language/test/mds-pref-language.stories.d.ts +1 -1
  722. package/dist/types/components/mds-pref-language-item/mds-pref-language-item.d.ts +5 -4
  723. package/dist/types/components/mds-pref-theme/mds-pref-theme.d.ts +14 -12
  724. package/dist/types/components/mds-price-table-list-item/mds-price-table-list-item.d.ts +1 -1
  725. package/dist/types/components/mds-progress/mds-progress.d.ts +2 -1
  726. package/dist/types/components/mds-push-notification/mds-push-notification.d.ts +4 -2
  727. package/dist/types/components/mds-quote/mds-quote.d.ts +6 -1
  728. package/dist/types/components/mds-quote/test/mds-quote.stories.d.ts +7 -0
  729. package/dist/types/components/mds-stepper-bar-item/mds-stepper-bar-item.d.ts +1 -1
  730. package/dist/types/components/mds-tab/mds-tab.d.ts +1 -1
  731. package/dist/types/components/mds-tab-bar-item/mds-tab-bar-item.d.ts +1 -1
  732. package/dist/types/components/mds-tab-item/mds-tab-item.d.ts +1 -1
  733. package/dist/types/components/mds-table/mds-table.d.ts +1 -0
  734. package/dist/types/components/mds-table/test/mds-table.stories.d.ts +1 -0
  735. package/dist/types/components/mds-table-header-cell/meta/types.d.ts +1 -1
  736. package/dist/types/components/mds-table-row/mds-table-row.d.ts +4 -0
  737. package/dist/types/components/mds-text/mds-text.d.ts +4 -3
  738. package/dist/types/components/mds-text/meta/types.d.ts +0 -1
  739. package/dist/types/components/mds-toast/mds-toast.d.ts +1 -1
  740. package/dist/types/components/mds-tooltip/mds-tooltip.d.ts +2 -2
  741. package/dist/types/components/mds-url-view/mds-url-view.d.ts +5 -1
  742. package/dist/types/components/mds-usage/mds-usage.d.ts +0 -2
  743. package/dist/types/components.d.ts +99 -117
  744. package/dist/types/dictionary/file-extensions.d.ts +1 -1
  745. package/dist/types/dictionary/text.d.ts +3 -1
  746. package/dist/types/dictionary/variant.d.ts +2 -1
  747. package/dist/types/event-detail/language.d.ts +1 -2
  748. package/dist/types/event-detail/preference.d.ts +2 -2
  749. package/dist/types/stencil-public-runtime.d.ts +6 -0
  750. package/dist/types/type/autocomplete.d.ts +1 -1
  751. package/dist/types/type/input.d.ts +3 -0
  752. package/dist/types/type/text.d.ts +2 -0
  753. package/dist/types/type/variant-file-format.d.ts +1 -1
  754. package/dist/types/type/variant.d.ts +2 -1
  755. package/loader/cdn.js +2 -0
  756. package/loader/index.cjs.js +2 -0
  757. package/loader/index.d.ts +24 -0
  758. package/loader/index.es2017.js +2 -0
  759. package/loader/index.js +3 -0
  760. package/loader/package.json +11 -0
  761. package/package.json +17 -13
  762. package/dist/cjs/file-0d013422.js +0 -154
  763. package/dist/cjs/file-extensions-b57dcf2c.js +0 -68
  764. package/dist/cjs/locale-c6c02a3a.js +0 -4796
  765. package/dist/collection/components/mds-input/meta/event-detail.js +0 -1
  766. package/dist/collection/components/mds-pref-language-nav/mds-pref-language-nav.css +0 -28
  767. package/dist/collection/components/mds-pref-language-nav/mds-pref-language-nav.js +0 -118
  768. package/dist/collection/interface/input-value.js +0 -1
  769. package/dist/collection/type/language.js +0 -1
  770. package/dist/components/file.js +0 -212
  771. package/dist/components/mds-pref-language-nav.d.ts +0 -11
  772. package/dist/components/mds-pref-language-nav.js +0 -6
  773. package/dist/components/mds-pref-language-nav2.js +0 -936
  774. package/dist/esm/_commonjsHelpers-e557d4a5.js +0 -11
  775. package/dist/esm/file-4e952d4d.js +0 -149
  776. package/dist/esm/file-extensions-e7320b03.js +0 -65
  777. package/dist/esm/locale-a730711f.js +0 -4794
  778. package/dist/esm-es5/_commonjsHelpers-e557d4a5.js +0 -1
  779. package/dist/esm-es5/aria-0e390d9c.js +0 -1
  780. package/dist/esm-es5/file-4e952d4d.js +0 -1
  781. package/dist/esm-es5/file-extensions-e7320b03.js +0 -1
  782. package/dist/esm-es5/floating-ui.dom.esm-f7b7f919.js +0 -1
  783. package/dist/esm-es5/index-f08bac5f.js +0 -1
  784. package/dist/esm-es5/locale-a730711f.js +0 -1
  785. package/dist/esm-es5/mds-dropdown_2.entry.js +0 -1
  786. package/dist/magma-components/p-00f83b1c.entry.js +0 -1
  787. package/dist/magma-components/p-02d1e968.entry.js +0 -1
  788. package/dist/magma-components/p-06adda46.system.entry.js +0 -1
  789. package/dist/magma-components/p-0d867719.entry.js +0 -1
  790. package/dist/magma-components/p-0e2ba962.entry.js +0 -1
  791. package/dist/magma-components/p-0fb85a5b.entry.js +0 -1
  792. package/dist/magma-components/p-19d5cfd1.system.entry.js +0 -1
  793. package/dist/magma-components/p-1a8bb922.system.entry.js +0 -1
  794. package/dist/magma-components/p-1c618541.entry.js +0 -1
  795. package/dist/magma-components/p-1ebc919c.system.entry.js +0 -1
  796. package/dist/magma-components/p-239398e3.entry.js +0 -1
  797. package/dist/magma-components/p-30c59b63.entry.js +0 -1
  798. package/dist/magma-components/p-348bfa69.system.entry.js +0 -1
  799. package/dist/magma-components/p-34b6dae4.entry.js +0 -1
  800. package/dist/magma-components/p-35010f4f.system.entry.js +0 -1
  801. package/dist/magma-components/p-369fc037.system.js +0 -2
  802. package/dist/magma-components/p-39379806.js +0 -1
  803. package/dist/magma-components/p-39f3c979.entry.js +0 -1
  804. package/dist/magma-components/p-3a1212f7.system.js +0 -1
  805. package/dist/magma-components/p-3b821237.entry.js +0 -1
  806. package/dist/magma-components/p-3bce2736.entry.js +0 -1
  807. package/dist/magma-components/p-3bd5921c.entry.js +0 -1
  808. package/dist/magma-components/p-3bd829b2.system.entry.js +0 -1
  809. package/dist/magma-components/p-3c7dd9e6.entry.js +0 -1
  810. package/dist/magma-components/p-3d6026a7.entry.js +0 -1
  811. package/dist/magma-components/p-40444810.entry.js +0 -1
  812. package/dist/magma-components/p-456e8f90.entry.js +0 -1
  813. package/dist/magma-components/p-45840cb9.js +0 -1
  814. package/dist/magma-components/p-4818acd8.entry.js +0 -1
  815. package/dist/magma-components/p-4852095e.system.entry.js +0 -1
  816. package/dist/magma-components/p-49457689.entry.js +0 -1
  817. package/dist/magma-components/p-498d8d1f.system.entry.js +0 -1
  818. package/dist/magma-components/p-4a21d75f.entry.js +0 -1
  819. package/dist/magma-components/p-4ba3ec43.entry.js +0 -1
  820. package/dist/magma-components/p-4bb672d5.system.entry.js +0 -1
  821. package/dist/magma-components/p-4cd1cddc.js +0 -1
  822. package/dist/magma-components/p-4cf59911.system.entry.js +0 -1
  823. package/dist/magma-components/p-5251fc6b.entry.js +0 -18
  824. package/dist/magma-components/p-53b343a8.js +0 -1
  825. package/dist/magma-components/p-56e687bd.entry.js +0 -1
  826. package/dist/magma-components/p-5958cf43.entry.js +0 -1
  827. package/dist/magma-components/p-5de2329f.entry.js +0 -1
  828. package/dist/magma-components/p-5ff768d2.system.entry.js +0 -1
  829. package/dist/magma-components/p-606200e3.entry.js +0 -1
  830. package/dist/magma-components/p-61fd38ea.system.entry.js +0 -1
  831. package/dist/magma-components/p-62358ead.entry.js +0 -1
  832. package/dist/magma-components/p-62bf3a83.system.entry.js +0 -1
  833. package/dist/magma-components/p-63f0d264.entry.js +0 -1
  834. package/dist/magma-components/p-66056cdc.system.js +0 -1
  835. package/dist/magma-components/p-663bb379.system.entry.js +0 -1
  836. package/dist/magma-components/p-66976b79.entry.js +0 -1
  837. package/dist/magma-components/p-66f540ac.system.entry.js +0 -1
  838. package/dist/magma-components/p-676db22b.entry.js +0 -1
  839. package/dist/magma-components/p-6810a806.system.entry.js +0 -1
  840. package/dist/magma-components/p-6c14d91c.entry.js +0 -1
  841. package/dist/magma-components/p-6e2784c9.entry.js +0 -1
  842. package/dist/magma-components/p-6eecbc9e.system.entry.js +0 -1
  843. package/dist/magma-components/p-71f86ae7.system.entry.js +0 -1
  844. package/dist/magma-components/p-728cf2dc.entry.js +0 -1
  845. package/dist/magma-components/p-763ed882.entry.js +0 -1
  846. package/dist/magma-components/p-7776a592.entry.js +0 -1
  847. package/dist/magma-components/p-7a41c057.system.entry.js +0 -1
  848. package/dist/magma-components/p-7cae0221.system.entry.js +0 -1
  849. package/dist/magma-components/p-7d19a7c6.entry.js +0 -1
  850. package/dist/magma-components/p-7d45974f.entry.js +0 -1
  851. package/dist/magma-components/p-7ff9abda.system.entry.js +0 -1
  852. package/dist/magma-components/p-82c83671.system.entry.js +0 -1
  853. package/dist/magma-components/p-846bafa4.system.js +0 -1
  854. package/dist/magma-components/p-85efbd11.entry.js +0 -1
  855. package/dist/magma-components/p-8a3e4d1f.system.entry.js +0 -1
  856. package/dist/magma-components/p-8ab85f10.entry.js +0 -1
  857. package/dist/magma-components/p-8c9bba00.system.entry.js +0 -1
  858. package/dist/magma-components/p-8ddbf6c1.system.entry.js +0 -1
  859. package/dist/magma-components/p-91391486.entry.js +0 -1
  860. package/dist/magma-components/p-91deec04.system.entry.js +0 -1
  861. package/dist/magma-components/p-934a4af6.system.entry.js +0 -18
  862. package/dist/magma-components/p-9381402f.entry.js +0 -1
  863. package/dist/magma-components/p-94bbfe16.entry.js +0 -1
  864. package/dist/magma-components/p-95e2abb6.js +0 -1
  865. package/dist/magma-components/p-9dfb1723.system.js +0 -1
  866. package/dist/magma-components/p-9f4b5a49.entry.js +0 -1
  867. package/dist/magma-components/p-9f80f36c.system.entry.js +0 -1
  868. package/dist/magma-components/p-9fefae6a.system.entry.js +0 -1
  869. package/dist/magma-components/p-a56a4fe4.entry.js +0 -1
  870. package/dist/magma-components/p-ac2a7c27.js +0 -1
  871. package/dist/magma-components/p-aebd1b47.entry.js +0 -1
  872. package/dist/magma-components/p-af75f100.entry.js +0 -1
  873. package/dist/magma-components/p-b3afbdcd.system.js +0 -1
  874. package/dist/magma-components/p-b3db90c1.entry.js +0 -1
  875. package/dist/magma-components/p-b435daa4.system.entry.js +0 -1
  876. package/dist/magma-components/p-b4395edb.system.entry.js +0 -1
  877. package/dist/magma-components/p-b4ce85d6.system.entry.js +0 -1
  878. package/dist/magma-components/p-b4ee4798.entry.js +0 -1
  879. package/dist/magma-components/p-b53e817c.system.entry.js +0 -1
  880. package/dist/magma-components/p-b6defcb6.js +0 -2
  881. package/dist/magma-components/p-b975c42a.js +0 -1
  882. package/dist/magma-components/p-bc867380.entry.js +0 -1
  883. package/dist/magma-components/p-bf08086c.system.entry.js +0 -1
  884. package/dist/magma-components/p-c6c8c32d.system.entry.js +0 -1
  885. package/dist/magma-components/p-c7343c40.system.entry.js +0 -9
  886. package/dist/magma-components/p-c852e0cb.entry.js +0 -8
  887. package/dist/magma-components/p-ca5f0f4d.entry.js +0 -1
  888. package/dist/magma-components/p-caf2dd9c.system.entry.js +0 -1
  889. package/dist/magma-components/p-cd9191a7.system.entry.js +0 -1
  890. package/dist/magma-components/p-d2cf0fd3.entry.js +0 -1
  891. package/dist/magma-components/p-dcc96bdb.entry.js +0 -1
  892. package/dist/magma-components/p-e203fbb0.system.entry.js +0 -1
  893. package/dist/magma-components/p-e249cc64.system.js +0 -1
  894. package/dist/magma-components/p-e307af8d.system.entry.js +0 -1
  895. package/dist/magma-components/p-e3b16a3f.entry.js +0 -1
  896. package/dist/magma-components/p-e72c4889.system.entry.js +0 -1
  897. package/dist/magma-components/p-e9042c7c.system.entry.js +0 -1
  898. package/dist/magma-components/p-eaade5d2.entry.js +0 -1
  899. package/dist/magma-components/p-ebfe7149.entry.js +0 -1
  900. package/dist/magma-components/p-ec231a39.system.entry.js +0 -1
  901. package/dist/magma-components/p-ee6d48f2.system.entry.js +0 -1
  902. package/dist/magma-components/p-f4bbd91e.system.entry.js +0 -1
  903. package/dist/magma-components/p-f855cdc0.entry.js +0 -1
  904. package/dist/types/components/mds-input/meta/event-detail.d.ts +0 -3
  905. package/dist/types/components/mds-pref-language-nav/mds-pref-language-nav.d.ts +0 -23
  906. package/dist/types/interface/input-value.d.ts +0 -4
  907. package/dist/types/type/language.d.ts +0 -2
@@ -1,4794 +0,0 @@
1
- import { g as getDefaultExportFromCjs } from './_commonjsHelpers-e557d4a5.js';
2
-
3
- var handlebars = {exports: {}};
4
-
5
- var handlebars_runtime = {exports: {}};
6
-
7
- var base$1 = {};
8
-
9
- var utils = {};
10
-
11
- utils.__esModule = true;
12
- utils.extend = extend;
13
- utils.indexOf = indexOf;
14
- utils.escapeExpression = escapeExpression;
15
- utils.isEmpty = isEmpty;
16
- utils.createFrame = createFrame;
17
- utils.blockParams = blockParams;
18
- utils.appendContextPath = appendContextPath;
19
- var escape = {
20
- '&': '&',
21
- '<': '&lt;',
22
- '>': '&gt;',
23
- '"': '&quot;',
24
- "'": '&#x27;',
25
- '`': '&#x60;',
26
- '=': '&#x3D;'
27
- };
28
-
29
- var badChars = /[&<>"'`=]/g,
30
- possible = /[&<>"'`=]/;
31
-
32
- function escapeChar(chr) {
33
- return escape[chr];
34
- }
35
-
36
- function extend(obj /* , ...source */) {
37
- for (var i = 1; i < arguments.length; i++) {
38
- for (var key in arguments[i]) {
39
- if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
40
- obj[key] = arguments[i][key];
41
- }
42
- }
43
- }
44
-
45
- return obj;
46
- }
47
-
48
- var toString = Object.prototype.toString;
49
-
50
- utils.toString = toString;
51
- // Sourced from lodash
52
- // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
53
- /* eslint-disable func-style */
54
- var isFunction = function isFunction(value) {
55
- return typeof value === 'function';
56
- };
57
- // fallback for older versions of Chrome and Safari
58
- /* istanbul ignore next */
59
- if (isFunction(/x/)) {
60
- utils.isFunction = isFunction = function (value) {
61
- return typeof value === 'function' && toString.call(value) === '[object Function]';
62
- };
63
- }
64
- utils.isFunction = isFunction;
65
-
66
- /* eslint-enable func-style */
67
-
68
- /* istanbul ignore next */
69
- var isArray = Array.isArray || function (value) {
70
- return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
71
- };
72
-
73
- utils.isArray = isArray;
74
- // Older IE versions do not directly support indexOf so we must implement our own, sadly.
75
-
76
- function indexOf(array, value) {
77
- for (var i = 0, len = array.length; i < len; i++) {
78
- if (array[i] === value) {
79
- return i;
80
- }
81
- }
82
- return -1;
83
- }
84
-
85
- function escapeExpression(string) {
86
- if (typeof string !== 'string') {
87
- // don't escape SafeStrings, since they're already safe
88
- if (string && string.toHTML) {
89
- return string.toHTML();
90
- } else if (string == null) {
91
- return '';
92
- } else if (!string) {
93
- return string + '';
94
- }
95
-
96
- // Force a string conversion as this will be done by the append regardless and
97
- // the regex test will do this transparently behind the scenes, causing issues if
98
- // an object's to string has escaped characters in it.
99
- string = '' + string;
100
- }
101
-
102
- if (!possible.test(string)) {
103
- return string;
104
- }
105
- return string.replace(badChars, escapeChar);
106
- }
107
-
108
- function isEmpty(value) {
109
- if (!value && value !== 0) {
110
- return true;
111
- } else if (isArray(value) && value.length === 0) {
112
- return true;
113
- } else {
114
- return false;
115
- }
116
- }
117
-
118
- function createFrame(object) {
119
- var frame = extend({}, object);
120
- frame._parent = object;
121
- return frame;
122
- }
123
-
124
- function blockParams(params, ids) {
125
- params.path = ids;
126
- return params;
127
- }
128
-
129
- function appendContextPath(contextPath, id) {
130
- return (contextPath ? contextPath + '.' : '') + id;
131
- }
132
-
133
- var exception = {exports: {}};
134
-
135
- (function (module, exports) {
136
-
137
- exports.__esModule = true;
138
- var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
139
-
140
- function Exception(message, node) {
141
- var loc = node && node.loc,
142
- line = undefined,
143
- endLineNumber = undefined,
144
- column = undefined,
145
- endColumn = undefined;
146
-
147
- if (loc) {
148
- line = loc.start.line;
149
- endLineNumber = loc.end.line;
150
- column = loc.start.column;
151
- endColumn = loc.end.column;
152
-
153
- message += ' - ' + line + ':' + column;
154
- }
155
-
156
- var tmp = Error.prototype.constructor.call(this, message);
157
-
158
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
159
- for (var idx = 0; idx < errorProps.length; idx++) {
160
- this[errorProps[idx]] = tmp[errorProps[idx]];
161
- }
162
-
163
- /* istanbul ignore else */
164
- if (Error.captureStackTrace) {
165
- Error.captureStackTrace(this, Exception);
166
- }
167
-
168
- try {
169
- if (loc) {
170
- this.lineNumber = line;
171
- this.endLineNumber = endLineNumber;
172
-
173
- // Work around issue under safari where we can't directly set the column value
174
- /* istanbul ignore next */
175
- if (Object.defineProperty) {
176
- Object.defineProperty(this, 'column', {
177
- value: column,
178
- enumerable: true
179
- });
180
- Object.defineProperty(this, 'endColumn', {
181
- value: endColumn,
182
- enumerable: true
183
- });
184
- } else {
185
- this.column = column;
186
- this.endColumn = endColumn;
187
- }
188
- }
189
- } catch (nop) {
190
- /* Ignore if the browser is very particular */
191
- }
192
- }
193
-
194
- Exception.prototype = new Error();
195
-
196
- exports['default'] = Exception;
197
- module.exports = exports['default'];
198
-
199
- }(exception, exception.exports));
200
-
201
- var helpers$1 = {};
202
-
203
- var blockHelperMissing = {exports: {}};
204
-
205
- (function (module, exports) {
206
-
207
- exports.__esModule = true;
208
-
209
- var _utils = utils;
210
-
211
- exports['default'] = function (instance) {
212
- instance.registerHelper('blockHelperMissing', function (context, options) {
213
- var inverse = options.inverse,
214
- fn = options.fn;
215
-
216
- if (context === true) {
217
- return fn(this);
218
- } else if (context === false || context == null) {
219
- return inverse(this);
220
- } else if (_utils.isArray(context)) {
221
- if (context.length > 0) {
222
- if (options.ids) {
223
- options.ids = [options.name];
224
- }
225
-
226
- return instance.helpers.each(context, options);
227
- } else {
228
- return inverse(this);
229
- }
230
- } else {
231
- if (options.data && options.ids) {
232
- var data = _utils.createFrame(options.data);
233
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
234
- options = { data: data };
235
- }
236
-
237
- return fn(context, options);
238
- }
239
- });
240
- };
241
-
242
- module.exports = exports['default'];
243
-
244
- }(blockHelperMissing, blockHelperMissing.exports));
245
-
246
- var each = {exports: {}};
247
-
248
- (function (module, exports) {
249
-
250
- exports.__esModule = true;
251
- // istanbul ignore next
252
-
253
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
254
-
255
- var _utils = utils;
256
-
257
- var _exception = exception.exports;
258
-
259
- var _exception2 = _interopRequireDefault(_exception);
260
-
261
- exports['default'] = function (instance) {
262
- instance.registerHelper('each', function (context, options) {
263
- if (!options) {
264
- throw new _exception2['default']('Must pass iterator to #each');
265
- }
266
-
267
- var fn = options.fn,
268
- inverse = options.inverse,
269
- i = 0,
270
- ret = '',
271
- data = undefined,
272
- contextPath = undefined;
273
-
274
- if (options.data && options.ids) {
275
- contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
276
- }
277
-
278
- if (_utils.isFunction(context)) {
279
- context = context.call(this);
280
- }
281
-
282
- if (options.data) {
283
- data = _utils.createFrame(options.data);
284
- }
285
-
286
- function execIteration(field, index, last) {
287
- if (data) {
288
- data.key = field;
289
- data.index = index;
290
- data.first = index === 0;
291
- data.last = !!last;
292
-
293
- if (contextPath) {
294
- data.contextPath = contextPath + field;
295
- }
296
- }
297
-
298
- ret = ret + fn(context[field], {
299
- data: data,
300
- blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
301
- });
302
- }
303
-
304
- if (context && typeof context === 'object') {
305
- if (_utils.isArray(context)) {
306
- for (var j = context.length; i < j; i++) {
307
- if (i in context) {
308
- execIteration(i, i, i === context.length - 1);
309
- }
310
- }
311
- } else if (typeof Symbol === 'function' && context[Symbol.iterator]) {
312
- var newContext = [];
313
- var iterator = context[Symbol.iterator]();
314
- for (var it = iterator.next(); !it.done; it = iterator.next()) {
315
- newContext.push(it.value);
316
- }
317
- context = newContext;
318
- for (var j = context.length; i < j; i++) {
319
- execIteration(i, i, i === context.length - 1);
320
- }
321
- } else {
322
- (function () {
323
- var priorKey = undefined;
324
-
325
- Object.keys(context).forEach(function (key) {
326
- // We're running the iterations one step out of sync so we can detect
327
- // the last iteration without have to scan the object twice and create
328
- // an itermediate keys array.
329
- if (priorKey !== undefined) {
330
- execIteration(priorKey, i - 1);
331
- }
332
- priorKey = key;
333
- i++;
334
- });
335
- if (priorKey !== undefined) {
336
- execIteration(priorKey, i - 1, true);
337
- }
338
- })();
339
- }
340
- }
341
-
342
- if (i === 0) {
343
- ret = inverse(this);
344
- }
345
-
346
- return ret;
347
- });
348
- };
349
-
350
- module.exports = exports['default'];
351
-
352
- }(each, each.exports));
353
-
354
- var helperMissing = {exports: {}};
355
-
356
- (function (module, exports) {
357
-
358
- exports.__esModule = true;
359
- // istanbul ignore next
360
-
361
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
362
-
363
- var _exception = exception.exports;
364
-
365
- var _exception2 = _interopRequireDefault(_exception);
366
-
367
- exports['default'] = function (instance) {
368
- instance.registerHelper('helperMissing', function () /* [args, ]options */{
369
- if (arguments.length === 1) {
370
- // A missing field in a {{foo}} construct.
371
- return undefined;
372
- } else {
373
- // Someone is actually trying to call something, blow up.
374
- throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
375
- }
376
- });
377
- };
378
-
379
- module.exports = exports['default'];
380
-
381
- }(helperMissing, helperMissing.exports));
382
-
383
- var _if = {exports: {}};
384
-
385
- (function (module, exports) {
386
-
387
- exports.__esModule = true;
388
- // istanbul ignore next
389
-
390
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
391
-
392
- var _utils = utils;
393
-
394
- var _exception = exception.exports;
395
-
396
- var _exception2 = _interopRequireDefault(_exception);
397
-
398
- exports['default'] = function (instance) {
399
- instance.registerHelper('if', function (conditional, options) {
400
- if (arguments.length != 2) {
401
- throw new _exception2['default']('#if requires exactly one argument');
402
- }
403
- if (_utils.isFunction(conditional)) {
404
- conditional = conditional.call(this);
405
- }
406
-
407
- // Default behavior is to render the positive path if the value is truthy and not empty.
408
- // The `includeZero` option may be set to treat the condtional as purely not empty based on the
409
- // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
410
- if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
411
- return options.inverse(this);
412
- } else {
413
- return options.fn(this);
414
- }
415
- });
416
-
417
- instance.registerHelper('unless', function (conditional, options) {
418
- if (arguments.length != 2) {
419
- throw new _exception2['default']('#unless requires exactly one argument');
420
- }
421
- return instance.helpers['if'].call(this, conditional, {
422
- fn: options.inverse,
423
- inverse: options.fn,
424
- hash: options.hash
425
- });
426
- });
427
- };
428
-
429
- module.exports = exports['default'];
430
-
431
- }(_if, _if.exports));
432
-
433
- var log$1 = {exports: {}};
434
-
435
- (function (module, exports) {
436
-
437
- exports.__esModule = true;
438
-
439
- exports['default'] = function (instance) {
440
- instance.registerHelper('log', function () /* message, options */{
441
- var args = [undefined],
442
- options = arguments[arguments.length - 1];
443
- for (var i = 0; i < arguments.length - 1; i++) {
444
- args.push(arguments[i]);
445
- }
446
-
447
- var level = 1;
448
- if (options.hash.level != null) {
449
- level = options.hash.level;
450
- } else if (options.data && options.data.level != null) {
451
- level = options.data.level;
452
- }
453
- args[0] = level;
454
-
455
- instance.log.apply(instance, args);
456
- });
457
- };
458
-
459
- module.exports = exports['default'];
460
-
461
- }(log$1, log$1.exports));
462
-
463
- var lookup = {exports: {}};
464
-
465
- (function (module, exports) {
466
-
467
- exports.__esModule = true;
468
-
469
- exports['default'] = function (instance) {
470
- instance.registerHelper('lookup', function (obj, field, options) {
471
- if (!obj) {
472
- // Note for 5.0: Change to "obj == null" in 5.0
473
- return obj;
474
- }
475
- return options.lookupProperty(obj, field);
476
- });
477
- };
478
-
479
- module.exports = exports['default'];
480
-
481
- }(lookup, lookup.exports));
482
-
483
- var _with = {exports: {}};
484
-
485
- (function (module, exports) {
486
-
487
- exports.__esModule = true;
488
- // istanbul ignore next
489
-
490
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
491
-
492
- var _utils = utils;
493
-
494
- var _exception = exception.exports;
495
-
496
- var _exception2 = _interopRequireDefault(_exception);
497
-
498
- exports['default'] = function (instance) {
499
- instance.registerHelper('with', function (context, options) {
500
- if (arguments.length != 2) {
501
- throw new _exception2['default']('#with requires exactly one argument');
502
- }
503
- if (_utils.isFunction(context)) {
504
- context = context.call(this);
505
- }
506
-
507
- var fn = options.fn;
508
-
509
- if (!_utils.isEmpty(context)) {
510
- var data = options.data;
511
- if (options.data && options.ids) {
512
- data = _utils.createFrame(options.data);
513
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
514
- }
515
-
516
- return fn(context, {
517
- data: data,
518
- blockParams: _utils.blockParams([context], [data && data.contextPath])
519
- });
520
- } else {
521
- return options.inverse(this);
522
- }
523
- });
524
- };
525
-
526
- module.exports = exports['default'];
527
-
528
- }(_with, _with.exports));
529
-
530
- helpers$1.__esModule = true;
531
- helpers$1.registerDefaultHelpers = registerDefaultHelpers;
532
- helpers$1.moveHelperToHooks = moveHelperToHooks;
533
- // istanbul ignore next
534
-
535
- function _interopRequireDefault$7(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
536
-
537
- var _helpersBlockHelperMissing = blockHelperMissing.exports;
538
-
539
- var _helpersBlockHelperMissing2 = _interopRequireDefault$7(_helpersBlockHelperMissing);
540
-
541
- var _helpersEach = each.exports;
542
-
543
- var _helpersEach2 = _interopRequireDefault$7(_helpersEach);
544
-
545
- var _helpersHelperMissing = helperMissing.exports;
546
-
547
- var _helpersHelperMissing2 = _interopRequireDefault$7(_helpersHelperMissing);
548
-
549
- var _helpersIf = _if.exports;
550
-
551
- var _helpersIf2 = _interopRequireDefault$7(_helpersIf);
552
-
553
- var _helpersLog = log$1.exports;
554
-
555
- var _helpersLog2 = _interopRequireDefault$7(_helpersLog);
556
-
557
- var _helpersLookup = lookup.exports;
558
-
559
- var _helpersLookup2 = _interopRequireDefault$7(_helpersLookup);
560
-
561
- var _helpersWith = _with.exports;
562
-
563
- var _helpersWith2 = _interopRequireDefault$7(_helpersWith);
564
-
565
- function registerDefaultHelpers(instance) {
566
- _helpersBlockHelperMissing2['default'](instance);
567
- _helpersEach2['default'](instance);
568
- _helpersHelperMissing2['default'](instance);
569
- _helpersIf2['default'](instance);
570
- _helpersLog2['default'](instance);
571
- _helpersLookup2['default'](instance);
572
- _helpersWith2['default'](instance);
573
- }
574
-
575
- function moveHelperToHooks(instance, helperName, keepHelper) {
576
- if (instance.helpers[helperName]) {
577
- instance.hooks[helperName] = instance.helpers[helperName];
578
- if (!keepHelper) {
579
- delete instance.helpers[helperName];
580
- }
581
- }
582
- }
583
-
584
- var decorators = {};
585
-
586
- var inline = {exports: {}};
587
-
588
- (function (module, exports) {
589
-
590
- exports.__esModule = true;
591
-
592
- var _utils = utils;
593
-
594
- exports['default'] = function (instance) {
595
- instance.registerDecorator('inline', function (fn, props, container, options) {
596
- var ret = fn;
597
- if (!props.partials) {
598
- props.partials = {};
599
- ret = function (context, options) {
600
- // Create a new partials stack frame prior to exec.
601
- var original = container.partials;
602
- container.partials = _utils.extend({}, original, props.partials);
603
- var ret = fn(context, options);
604
- container.partials = original;
605
- return ret;
606
- };
607
- }
608
-
609
- props.partials[options.args[0]] = options.fn;
610
-
611
- return ret;
612
- });
613
- };
614
-
615
- module.exports = exports['default'];
616
-
617
- }(inline, inline.exports));
618
-
619
- decorators.__esModule = true;
620
- decorators.registerDefaultDecorators = registerDefaultDecorators;
621
- // istanbul ignore next
622
-
623
- function _interopRequireDefault$6(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
624
-
625
- var _decoratorsInline = inline.exports;
626
-
627
- var _decoratorsInline2 = _interopRequireDefault$6(_decoratorsInline);
628
-
629
- function registerDefaultDecorators(instance) {
630
- _decoratorsInline2['default'](instance);
631
- }
632
-
633
- var logger = {exports: {}};
634
-
635
- (function (module, exports) {
636
-
637
- exports.__esModule = true;
638
-
639
- var _utils = utils;
640
-
641
- var logger = {
642
- methodMap: ['debug', 'info', 'warn', 'error'],
643
- level: 'info',
644
-
645
- // Maps a given level value to the `methodMap` indexes above.
646
- lookupLevel: function lookupLevel(level) {
647
- if (typeof level === 'string') {
648
- var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
649
- if (levelMap >= 0) {
650
- level = levelMap;
651
- } else {
652
- level = parseInt(level, 10);
653
- }
654
- }
655
-
656
- return level;
657
- },
658
-
659
- // Can be overridden in the host environment
660
- log: function log(level) {
661
- level = logger.lookupLevel(level);
662
-
663
- if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
664
- var method = logger.methodMap[level];
665
- // eslint-disable-next-line no-console
666
- if (!console[method]) {
667
- method = 'log';
668
- }
669
-
670
- for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
671
- message[_key - 1] = arguments[_key];
672
- }
673
-
674
- console[method].apply(console, message); // eslint-disable-line no-console
675
- }
676
- }
677
- };
678
-
679
- exports['default'] = logger;
680
- module.exports = exports['default'];
681
-
682
- }(logger, logger.exports));
683
-
684
- var protoAccess = {};
685
-
686
- var createNewLookupObject$1 = {};
687
-
688
- createNewLookupObject$1.__esModule = true;
689
- createNewLookupObject$1.createNewLookupObject = createNewLookupObject;
690
-
691
- var _utils$4 = utils;
692
-
693
- /**
694
- * Create a new object with "null"-prototype to avoid truthy results on prototype properties.
695
- * The resulting object can be used with "object[property]" to check if a property exists
696
- * @param {...object} sources a varargs parameter of source objects that will be merged
697
- * @returns {object}
698
- */
699
-
700
- function createNewLookupObject() {
701
- for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
702
- sources[_key] = arguments[_key];
703
- }
704
-
705
- return _utils$4.extend.apply(undefined, [Object.create(null)].concat(sources));
706
- }
707
-
708
- protoAccess.__esModule = true;
709
- protoAccess.createProtoAccessControl = createProtoAccessControl;
710
- protoAccess.resultIsAllowed = resultIsAllowed;
711
- protoAccess.resetLoggedProperties = resetLoggedProperties;
712
- // istanbul ignore next
713
-
714
- function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
715
-
716
- var _createNewLookupObject = createNewLookupObject$1;
717
-
718
- var _logger$1 = logger.exports;
719
-
720
- var _logger2$1 = _interopRequireDefault$5(_logger$1);
721
-
722
- var loggedProperties = Object.create(null);
723
-
724
- function createProtoAccessControl(runtimeOptions) {
725
- var defaultMethodWhiteList = Object.create(null);
726
- defaultMethodWhiteList['constructor'] = false;
727
- defaultMethodWhiteList['__defineGetter__'] = false;
728
- defaultMethodWhiteList['__defineSetter__'] = false;
729
- defaultMethodWhiteList['__lookupGetter__'] = false;
730
-
731
- var defaultPropertyWhiteList = Object.create(null);
732
- // eslint-disable-next-line no-proto
733
- defaultPropertyWhiteList['__proto__'] = false;
734
-
735
- return {
736
- properties: {
737
- whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
738
- defaultValue: runtimeOptions.allowProtoPropertiesByDefault
739
- },
740
- methods: {
741
- whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
742
- defaultValue: runtimeOptions.allowProtoMethodsByDefault
743
- }
744
- };
745
- }
746
-
747
- function resultIsAllowed(result, protoAccessControl, propertyName) {
748
- if (typeof result === 'function') {
749
- return checkWhiteList(protoAccessControl.methods, propertyName);
750
- } else {
751
- return checkWhiteList(protoAccessControl.properties, propertyName);
752
- }
753
- }
754
-
755
- function checkWhiteList(protoAccessControlForType, propertyName) {
756
- if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
757
- return protoAccessControlForType.whitelist[propertyName] === true;
758
- }
759
- if (protoAccessControlForType.defaultValue !== undefined) {
760
- return protoAccessControlForType.defaultValue;
761
- }
762
- logUnexpecedPropertyAccessOnce(propertyName);
763
- return false;
764
- }
765
-
766
- function logUnexpecedPropertyAccessOnce(propertyName) {
767
- if (loggedProperties[propertyName] !== true) {
768
- loggedProperties[propertyName] = true;
769
- _logger2$1['default'].log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
770
- }
771
- }
772
-
773
- function resetLoggedProperties() {
774
- Object.keys(loggedProperties).forEach(function (propertyName) {
775
- delete loggedProperties[propertyName];
776
- });
777
- }
778
-
779
- base$1.__esModule = true;
780
- base$1.HandlebarsEnvironment = HandlebarsEnvironment;
781
- // istanbul ignore next
782
-
783
- function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
784
-
785
- var _utils$3 = utils;
786
-
787
- var _exception$3 = exception.exports;
788
-
789
- var _exception2$3 = _interopRequireDefault$4(_exception$3);
790
-
791
- var _helpers$2 = helpers$1;
792
-
793
- var _decorators = decorators;
794
-
795
- var _logger = logger.exports;
796
-
797
- var _logger2 = _interopRequireDefault$4(_logger);
798
-
799
- var _internalProtoAccess$1 = protoAccess;
800
-
801
- var VERSION = '4.7.8';
802
- base$1.VERSION = VERSION;
803
- var COMPILER_REVISION = 8;
804
- base$1.COMPILER_REVISION = COMPILER_REVISION;
805
- var LAST_COMPATIBLE_COMPILER_REVISION = 7;
806
-
807
- base$1.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
808
- var REVISION_CHANGES = {
809
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
810
- 2: '== 1.0.0-rc.3',
811
- 3: '== 1.0.0-rc.4',
812
- 4: '== 1.x.x',
813
- 5: '== 2.0.0-alpha.x',
814
- 6: '>= 2.0.0-beta.1',
815
- 7: '>= 4.0.0 <4.3.0',
816
- 8: '>= 4.3.0'
817
- };
818
-
819
- base$1.REVISION_CHANGES = REVISION_CHANGES;
820
- var objectType = '[object Object]';
821
-
822
- function HandlebarsEnvironment(helpers, partials, decorators) {
823
- this.helpers = helpers || {};
824
- this.partials = partials || {};
825
- this.decorators = decorators || {};
826
-
827
- _helpers$2.registerDefaultHelpers(this);
828
- _decorators.registerDefaultDecorators(this);
829
- }
830
-
831
- HandlebarsEnvironment.prototype = {
832
- constructor: HandlebarsEnvironment,
833
-
834
- logger: _logger2['default'],
835
- log: _logger2['default'].log,
836
-
837
- registerHelper: function registerHelper(name, fn) {
838
- if (_utils$3.toString.call(name) === objectType) {
839
- if (fn) {
840
- throw new _exception2$3['default']('Arg not supported with multiple helpers');
841
- }
842
- _utils$3.extend(this.helpers, name);
843
- } else {
844
- this.helpers[name] = fn;
845
- }
846
- },
847
- unregisterHelper: function unregisterHelper(name) {
848
- delete this.helpers[name];
849
- },
850
-
851
- registerPartial: function registerPartial(name, partial) {
852
- if (_utils$3.toString.call(name) === objectType) {
853
- _utils$3.extend(this.partials, name);
854
- } else {
855
- if (typeof partial === 'undefined') {
856
- throw new _exception2$3['default']('Attempting to register a partial called "' + name + '" as undefined');
857
- }
858
- this.partials[name] = partial;
859
- }
860
- },
861
- unregisterPartial: function unregisterPartial(name) {
862
- delete this.partials[name];
863
- },
864
-
865
- registerDecorator: function registerDecorator(name, fn) {
866
- if (_utils$3.toString.call(name) === objectType) {
867
- if (fn) {
868
- throw new _exception2$3['default']('Arg not supported with multiple decorators');
869
- }
870
- _utils$3.extend(this.decorators, name);
871
- } else {
872
- this.decorators[name] = fn;
873
- }
874
- },
875
- unregisterDecorator: function unregisterDecorator(name) {
876
- delete this.decorators[name];
877
- },
878
- /**
879
- * Reset the memory of illegal property accesses that have already been logged.
880
- * @deprecated should only be used in handlebars test-cases
881
- */
882
- resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
883
- _internalProtoAccess$1.resetLoggedProperties();
884
- }
885
- };
886
-
887
- var log = _logger2['default'].log;
888
-
889
- base$1.log = log;
890
- base$1.createFrame = _utils$3.createFrame;
891
- base$1.logger = _logger2['default'];
892
-
893
- var safeString = {exports: {}};
894
-
895
- (function (module, exports) {
896
-
897
- exports.__esModule = true;
898
- function SafeString(string) {
899
- this.string = string;
900
- }
901
-
902
- SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
903
- return '' + this.string;
904
- };
905
-
906
- exports['default'] = SafeString;
907
- module.exports = exports['default'];
908
-
909
- }(safeString, safeString.exports));
910
-
911
- var runtime = {};
912
-
913
- var wrapHelper$1 = {};
914
-
915
- wrapHelper$1.__esModule = true;
916
- wrapHelper$1.wrapHelper = wrapHelper;
917
-
918
- function wrapHelper(helper, transformOptionsFn) {
919
- if (typeof helper !== 'function') {
920
- // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
921
- // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
922
- return helper;
923
- }
924
- var wrapper = function wrapper() /* dynamic arguments */{
925
- var options = arguments[arguments.length - 1];
926
- arguments[arguments.length - 1] = transformOptionsFn(options);
927
- return helper.apply(this, arguments);
928
- };
929
- return wrapper;
930
- }
931
-
932
- runtime.__esModule = true;
933
- runtime.checkRevision = checkRevision;
934
- runtime.template = template;
935
- runtime.wrapProgram = wrapProgram;
936
- runtime.resolvePartial = resolvePartial;
937
- runtime.invokePartial = invokePartial;
938
- runtime.noop = noop;
939
- // istanbul ignore next
940
-
941
- function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
942
-
943
- // istanbul ignore next
944
-
945
- function _interopRequireWildcard$1(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
946
-
947
- var _utils$2 = utils;
948
-
949
- var Utils = _interopRequireWildcard$1(_utils$2);
950
-
951
- var _exception$2 = exception.exports;
952
-
953
- var _exception2$2 = _interopRequireDefault$3(_exception$2);
954
-
955
- var _base = base$1;
956
-
957
- var _helpers$1 = helpers$1;
958
-
959
- var _internalWrapHelper = wrapHelper$1;
960
-
961
- var _internalProtoAccess = protoAccess;
962
-
963
- function checkRevision(compilerInfo) {
964
- var compilerRevision = compilerInfo && compilerInfo[0] || 1,
965
- currentRevision = _base.COMPILER_REVISION;
966
-
967
- if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
968
- return;
969
- }
970
-
971
- if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
972
- var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
973
- compilerVersions = _base.REVISION_CHANGES[compilerRevision];
974
- throw new _exception2$2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
975
- } else {
976
- // Use the embedded version info since the runtime doesn't know about this revision yet
977
- throw new _exception2$2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
978
- }
979
- }
980
-
981
- function template(templateSpec, env) {
982
- /* istanbul ignore next */
983
- if (!env) {
984
- throw new _exception2$2['default']('No environment passed to template');
985
- }
986
- if (!templateSpec || !templateSpec.main) {
987
- throw new _exception2$2['default']('Unknown template object: ' + typeof templateSpec);
988
- }
989
-
990
- templateSpec.main.decorator = templateSpec.main_d;
991
-
992
- // Note: Using env.VM references rather than local var references throughout this section to allow
993
- // for external users to override these as pseudo-supported APIs.
994
- env.VM.checkRevision(templateSpec.compiler);
995
-
996
- // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
997
- var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
998
-
999
- function invokePartialWrapper(partial, context, options) {
1000
- if (options.hash) {
1001
- context = Utils.extend({}, context, options.hash);
1002
- if (options.ids) {
1003
- options.ids[0] = true;
1004
- }
1005
- }
1006
- partial = env.VM.resolvePartial.call(this, partial, context, options);
1007
-
1008
- var extendedOptions = Utils.extend({}, options, {
1009
- hooks: this.hooks,
1010
- protoAccessControl: this.protoAccessControl
1011
- });
1012
-
1013
- var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
1014
-
1015
- if (result == null && env.compile) {
1016
- options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1017
- result = options.partials[options.name](context, extendedOptions);
1018
- }
1019
- if (result != null) {
1020
- if (options.indent) {
1021
- var lines = result.split('\n');
1022
- for (var i = 0, l = lines.length; i < l; i++) {
1023
- if (!lines[i] && i + 1 === l) {
1024
- break;
1025
- }
1026
-
1027
- lines[i] = options.indent + lines[i];
1028
- }
1029
- result = lines.join('\n');
1030
- }
1031
- return result;
1032
- } else {
1033
- throw new _exception2$2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1034
- }
1035
- }
1036
-
1037
- // Just add water
1038
- var container = {
1039
- strict: function strict(obj, name, loc) {
1040
- if (!obj || !(name in obj)) {
1041
- throw new _exception2$2['default']('"' + name + '" not defined in ' + obj, {
1042
- loc: loc
1043
- });
1044
- }
1045
- return container.lookupProperty(obj, name);
1046
- },
1047
- lookupProperty: function lookupProperty(parent, propertyName) {
1048
- var result = parent[propertyName];
1049
- if (result == null) {
1050
- return result;
1051
- }
1052
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
1053
- return result;
1054
- }
1055
-
1056
- if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
1057
- return result;
1058
- }
1059
- return undefined;
1060
- },
1061
- lookup: function lookup(depths, name) {
1062
- var len = depths.length;
1063
- for (var i = 0; i < len; i++) {
1064
- var result = depths[i] && container.lookupProperty(depths[i], name);
1065
- if (result != null) {
1066
- return depths[i][name];
1067
- }
1068
- }
1069
- },
1070
- lambda: function lambda(current, context) {
1071
- return typeof current === 'function' ? current.call(context) : current;
1072
- },
1073
-
1074
- escapeExpression: Utils.escapeExpression,
1075
- invokePartial: invokePartialWrapper,
1076
-
1077
- fn: function fn(i) {
1078
- var ret = templateSpec[i];
1079
- ret.decorator = templateSpec[i + '_d'];
1080
- return ret;
1081
- },
1082
-
1083
- programs: [],
1084
- program: function program(i, data, declaredBlockParams, blockParams, depths) {
1085
- var programWrapper = this.programs[i],
1086
- fn = this.fn(i);
1087
- if (data || depths || blockParams || declaredBlockParams) {
1088
- programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1089
- } else if (!programWrapper) {
1090
- programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1091
- }
1092
- return programWrapper;
1093
- },
1094
-
1095
- data: function data(value, depth) {
1096
- while (value && depth--) {
1097
- value = value._parent;
1098
- }
1099
- return value;
1100
- },
1101
- mergeIfNeeded: function mergeIfNeeded(param, common) {
1102
- var obj = param || common;
1103
-
1104
- if (param && common && param !== common) {
1105
- obj = Utils.extend({}, common, param);
1106
- }
1107
-
1108
- return obj;
1109
- },
1110
- // An empty object to use as replacement for null-contexts
1111
- nullContext: Object.seal({}),
1112
-
1113
- noop: env.VM.noop,
1114
- compilerInfo: templateSpec.compiler
1115
- };
1116
-
1117
- function ret(context) {
1118
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1119
-
1120
- var data = options.data;
1121
-
1122
- ret._setup(options);
1123
- if (!options.partial && templateSpec.useData) {
1124
- data = initData(context, data);
1125
- }
1126
- var depths = undefined,
1127
- blockParams = templateSpec.useBlockParams ? [] : undefined;
1128
- if (templateSpec.useDepths) {
1129
- if (options.depths) {
1130
- depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
1131
- } else {
1132
- depths = [context];
1133
- }
1134
- }
1135
-
1136
- function main(context /*, options*/) {
1137
- return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1138
- }
1139
-
1140
- main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1141
- return main(context, options);
1142
- }
1143
-
1144
- ret.isTop = true;
1145
-
1146
- ret._setup = function (options) {
1147
- if (!options.partial) {
1148
- var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
1149
- wrapHelpersToPassLookupProperty(mergedHelpers, container);
1150
- container.helpers = mergedHelpers;
1151
-
1152
- if (templateSpec.usePartial) {
1153
- // Use mergeIfNeeded here to prevent compiling global partials multiple times
1154
- container.partials = container.mergeIfNeeded(options.partials, env.partials);
1155
- }
1156
- if (templateSpec.usePartial || templateSpec.useDecorators) {
1157
- container.decorators = Utils.extend({}, env.decorators, options.decorators);
1158
- }
1159
-
1160
- container.hooks = {};
1161
- container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
1162
-
1163
- var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
1164
- _helpers$1.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
1165
- _helpers$1.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
1166
- } else {
1167
- container.protoAccessControl = options.protoAccessControl; // internal option
1168
- container.helpers = options.helpers;
1169
- container.partials = options.partials;
1170
- container.decorators = options.decorators;
1171
- container.hooks = options.hooks;
1172
- }
1173
- };
1174
-
1175
- ret._child = function (i, data, blockParams, depths) {
1176
- if (templateSpec.useBlockParams && !blockParams) {
1177
- throw new _exception2$2['default']('must pass block params');
1178
- }
1179
- if (templateSpec.useDepths && !depths) {
1180
- throw new _exception2$2['default']('must pass parent depths');
1181
- }
1182
-
1183
- return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1184
- };
1185
- return ret;
1186
- }
1187
-
1188
- function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1189
- function prog(context) {
1190
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1191
-
1192
- var currentDepths = depths;
1193
- if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
1194
- currentDepths = [context].concat(depths);
1195
- }
1196
-
1197
- return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1198
- }
1199
-
1200
- prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1201
-
1202
- prog.program = i;
1203
- prog.depth = depths ? depths.length : 0;
1204
- prog.blockParams = declaredBlockParams || 0;
1205
- return prog;
1206
- }
1207
-
1208
- /**
1209
- * This is currently part of the official API, therefore implementation details should not be changed.
1210
- */
1211
-
1212
- function resolvePartial(partial, context, options) {
1213
- if (!partial) {
1214
- if (options.name === '@partial-block') {
1215
- partial = options.data['partial-block'];
1216
- } else {
1217
- partial = options.partials[options.name];
1218
- }
1219
- } else if (!partial.call && !options.name) {
1220
- // This is a dynamic partial that returned a string
1221
- options.name = partial;
1222
- partial = options.partials[partial];
1223
- }
1224
- return partial;
1225
- }
1226
-
1227
- function invokePartial(partial, context, options) {
1228
- // Use the current closure context to save the partial-block if this partial
1229
- var currentPartialBlock = options.data && options.data['partial-block'];
1230
- options.partial = true;
1231
- if (options.ids) {
1232
- options.data.contextPath = options.ids[0] || options.data.contextPath;
1233
- }
1234
-
1235
- var partialBlock = undefined;
1236
- if (options.fn && options.fn !== noop) {
1237
- (function () {
1238
- options.data = _base.createFrame(options.data);
1239
- // Wrapper function to get access to currentPartialBlock from the closure
1240
- var fn = options.fn;
1241
- partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
1242
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1243
-
1244
- // Restore the partial-block from the closure for the execution of the block
1245
- // i.e. the part inside the block of the partial call.
1246
- options.data = _base.createFrame(options.data);
1247
- options.data['partial-block'] = currentPartialBlock;
1248
- return fn(context, options);
1249
- };
1250
- if (fn.partials) {
1251
- options.partials = Utils.extend({}, options.partials, fn.partials);
1252
- }
1253
- })();
1254
- }
1255
-
1256
- if (partial === undefined && partialBlock) {
1257
- partial = partialBlock;
1258
- }
1259
-
1260
- if (partial === undefined) {
1261
- throw new _exception2$2['default']('The partial ' + options.name + ' could not be found');
1262
- } else if (partial instanceof Function) {
1263
- return partial(context, options);
1264
- }
1265
- }
1266
-
1267
- function noop() {
1268
- return '';
1269
- }
1270
-
1271
- function initData(context, data) {
1272
- if (!data || !('root' in data)) {
1273
- data = data ? _base.createFrame(data) : {};
1274
- data.root = context;
1275
- }
1276
- return data;
1277
- }
1278
-
1279
- function executeDecorators(fn, prog, container, depths, data, blockParams) {
1280
- if (fn.decorator) {
1281
- var props = {};
1282
- prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1283
- Utils.extend(prog, props);
1284
- }
1285
- return prog;
1286
- }
1287
-
1288
- function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
1289
- Object.keys(mergedHelpers).forEach(function (helperName) {
1290
- var helper = mergedHelpers[helperName];
1291
- mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
1292
- });
1293
- }
1294
-
1295
- function passLookupPropertyOption(helper, container) {
1296
- var lookupProperty = container.lookupProperty;
1297
- return _internalWrapHelper.wrapHelper(helper, function (options) {
1298
- return Utils.extend({ lookupProperty: lookupProperty }, options);
1299
- });
1300
- }
1301
-
1302
- var noConflict = {exports: {}};
1303
-
1304
- /* global globalThis */
1305
-
1306
- (function (module, exports) {
1307
-
1308
- exports.__esModule = true;
1309
-
1310
- exports['default'] = function (Handlebars) {
1311
- /* istanbul ignore next */
1312
- // https://mathiasbynens.be/notes/globalthis
1313
- (function () {
1314
- if (typeof globalThis === 'object') return;
1315
- Object.prototype.__defineGetter__('__magic__', function () {
1316
- return this;
1317
- });
1318
- __magic__.globalThis = __magic__; // eslint-disable-line no-undef
1319
- delete Object.prototype.__magic__;
1320
- })();
1321
-
1322
- var $Handlebars = globalThis.Handlebars;
1323
-
1324
- /* istanbul ignore next */
1325
- Handlebars.noConflict = function () {
1326
- if (globalThis.Handlebars === Handlebars) {
1327
- globalThis.Handlebars = $Handlebars;
1328
- }
1329
- return Handlebars;
1330
- };
1331
- };
1332
-
1333
- module.exports = exports['default'];
1334
-
1335
- }(noConflict, noConflict.exports));
1336
-
1337
- (function (module, exports) {
1338
-
1339
- exports.__esModule = true;
1340
- // istanbul ignore next
1341
-
1342
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
1343
-
1344
- // istanbul ignore next
1345
-
1346
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
1347
-
1348
- var _handlebarsBase = base$1;
1349
-
1350
- var base = _interopRequireWildcard(_handlebarsBase);
1351
-
1352
- // Each of these augment the Handlebars object. No need to setup here.
1353
- // (This is done to easily share code between commonjs and browse envs)
1354
-
1355
- var _handlebarsSafeString = safeString.exports;
1356
-
1357
- var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
1358
-
1359
- var _handlebarsException = exception.exports;
1360
-
1361
- var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
1362
-
1363
- var _handlebarsUtils = utils;
1364
-
1365
- var Utils = _interopRequireWildcard(_handlebarsUtils);
1366
-
1367
- var _handlebarsRuntime = runtime;
1368
-
1369
- var runtime$1 = _interopRequireWildcard(_handlebarsRuntime);
1370
-
1371
- var _handlebarsNoConflict = noConflict.exports;
1372
-
1373
- var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
1374
-
1375
- // For compatibility and usage outside of module systems, make the Handlebars object a namespace
1376
- function create() {
1377
- var hb = new base.HandlebarsEnvironment();
1378
-
1379
- Utils.extend(hb, base);
1380
- hb.SafeString = _handlebarsSafeString2['default'];
1381
- hb.Exception = _handlebarsException2['default'];
1382
- hb.Utils = Utils;
1383
- hb.escapeExpression = Utils.escapeExpression;
1384
-
1385
- hb.VM = runtime$1;
1386
- hb.template = function (spec) {
1387
- return runtime$1.template(spec, hb);
1388
- };
1389
-
1390
- return hb;
1391
- }
1392
-
1393
- var inst = create();
1394
- inst.create = create;
1395
-
1396
- _handlebarsNoConflict2['default'](inst);
1397
-
1398
- inst['default'] = inst;
1399
-
1400
- exports['default'] = inst;
1401
- module.exports = exports['default'];
1402
-
1403
- }(handlebars_runtime, handlebars_runtime.exports));
1404
-
1405
- var ast = {exports: {}};
1406
-
1407
- (function (module, exports) {
1408
-
1409
- exports.__esModule = true;
1410
- var AST = {
1411
- // Public API used to evaluate derived attributes regarding AST nodes
1412
- helpers: {
1413
- // a mustache is definitely a helper if:
1414
- // * it is an eligible helper, and
1415
- // * it has at least one parameter or hash segment
1416
- helperExpression: function helperExpression(node) {
1417
- return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
1418
- },
1419
-
1420
- scopedId: function scopedId(path) {
1421
- return (/^\.|this\b/.test(path.original)
1422
- );
1423
- },
1424
-
1425
- // an ID is simple if it only has one part, and that part is not
1426
- // `..` or `this`.
1427
- simpleId: function simpleId(path) {
1428
- return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
1429
- }
1430
- }
1431
- };
1432
-
1433
- // Must be exported as an object rather than the root of the module as the jison lexer
1434
- // must modify the object to operate properly.
1435
- exports['default'] = AST;
1436
- module.exports = exports['default'];
1437
-
1438
- }(ast, ast.exports));
1439
-
1440
- var base = {};
1441
-
1442
- var parser = {exports: {}};
1443
-
1444
- (function (module, exports) {
1445
-
1446
- exports.__esModule = true;
1447
- var handlebars = (function () {
1448
- var parser = { trace: function trace() {},
1449
- yy: {},
1450
- symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
1451
- terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
1452
- productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
1453
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
1454
-
1455
- var $0 = $$.length - 1;
1456
- switch (yystate) {
1457
- case 1:
1458
- return $$[$0 - 1];
1459
- case 2:
1460
- this.$ = yy.prepareProgram($$[$0]);
1461
- break;
1462
- case 3:
1463
- this.$ = $$[$0];
1464
- break;
1465
- case 4:
1466
- this.$ = $$[$0];
1467
- break;
1468
- case 5:
1469
- this.$ = $$[$0];
1470
- break;
1471
- case 6:
1472
- this.$ = $$[$0];
1473
- break;
1474
- case 7:
1475
- this.$ = $$[$0];
1476
- break;
1477
- case 8:
1478
- this.$ = $$[$0];
1479
- break;
1480
- case 9:
1481
- this.$ = {
1482
- type: 'CommentStatement',
1483
- value: yy.stripComment($$[$0]),
1484
- strip: yy.stripFlags($$[$0], $$[$0]),
1485
- loc: yy.locInfo(this._$)
1486
- };
1487
-
1488
- break;
1489
- case 10:
1490
- this.$ = {
1491
- type: 'ContentStatement',
1492
- original: $$[$0],
1493
- value: $$[$0],
1494
- loc: yy.locInfo(this._$)
1495
- };
1496
-
1497
- break;
1498
- case 11:
1499
- this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1500
- break;
1501
- case 12:
1502
- this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
1503
- break;
1504
- case 13:
1505
- this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
1506
- break;
1507
- case 14:
1508
- this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
1509
- break;
1510
- case 15:
1511
- this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1512
- break;
1513
- case 16:
1514
- this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1515
- break;
1516
- case 17:
1517
- this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1518
- break;
1519
- case 18:
1520
- this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
1521
- break;
1522
- case 19:
1523
- var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
1524
- program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
1525
- program.chained = true;
1526
-
1527
- this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
1528
-
1529
- break;
1530
- case 20:
1531
- this.$ = $$[$0];
1532
- break;
1533
- case 21:
1534
- this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
1535
- break;
1536
- case 22:
1537
- this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1538
- break;
1539
- case 23:
1540
- this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1541
- break;
1542
- case 24:
1543
- this.$ = {
1544
- type: 'PartialStatement',
1545
- name: $$[$0 - 3],
1546
- params: $$[$0 - 2],
1547
- hash: $$[$0 - 1],
1548
- indent: '',
1549
- strip: yy.stripFlags($$[$0 - 4], $$[$0]),
1550
- loc: yy.locInfo(this._$)
1551
- };
1552
-
1553
- break;
1554
- case 25:
1555
- this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1556
- break;
1557
- case 26:
1558
- this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
1559
- break;
1560
- case 27:
1561
- this.$ = $$[$0];
1562
- break;
1563
- case 28:
1564
- this.$ = $$[$0];
1565
- break;
1566
- case 29:
1567
- this.$ = {
1568
- type: 'SubExpression',
1569
- path: $$[$0 - 3],
1570
- params: $$[$0 - 2],
1571
- hash: $$[$0 - 1],
1572
- loc: yy.locInfo(this._$)
1573
- };
1574
-
1575
- break;
1576
- case 30:
1577
- this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
1578
- break;
1579
- case 31:
1580
- this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
1581
- break;
1582
- case 32:
1583
- this.$ = yy.id($$[$0 - 1]);
1584
- break;
1585
- case 33:
1586
- this.$ = $$[$0];
1587
- break;
1588
- case 34:
1589
- this.$ = $$[$0];
1590
- break;
1591
- case 35:
1592
- this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
1593
- break;
1594
- case 36:
1595
- this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
1596
- break;
1597
- case 37:
1598
- this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
1599
- break;
1600
- case 38:
1601
- this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
1602
- break;
1603
- case 39:
1604
- this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
1605
- break;
1606
- case 40:
1607
- this.$ = $$[$0];
1608
- break;
1609
- case 41:
1610
- this.$ = $$[$0];
1611
- break;
1612
- case 42:
1613
- this.$ = yy.preparePath(true, $$[$0], this._$);
1614
- break;
1615
- case 43:
1616
- this.$ = yy.preparePath(false, $$[$0], this._$);
1617
- break;
1618
- case 44:
1619
- $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
1620
- break;
1621
- case 45:
1622
- this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
1623
- break;
1624
- case 46:
1625
- this.$ = [];
1626
- break;
1627
- case 47:
1628
- $$[$0 - 1].push($$[$0]);
1629
- break;
1630
- case 48:
1631
- this.$ = [];
1632
- break;
1633
- case 49:
1634
- $$[$0 - 1].push($$[$0]);
1635
- break;
1636
- case 50:
1637
- this.$ = [];
1638
- break;
1639
- case 51:
1640
- $$[$0 - 1].push($$[$0]);
1641
- break;
1642
- case 58:
1643
- this.$ = [];
1644
- break;
1645
- case 59:
1646
- $$[$0 - 1].push($$[$0]);
1647
- break;
1648
- case 64:
1649
- this.$ = [];
1650
- break;
1651
- case 65:
1652
- $$[$0 - 1].push($$[$0]);
1653
- break;
1654
- case 70:
1655
- this.$ = [];
1656
- break;
1657
- case 71:
1658
- $$[$0 - 1].push($$[$0]);
1659
- break;
1660
- case 78:
1661
- this.$ = [];
1662
- break;
1663
- case 79:
1664
- $$[$0 - 1].push($$[$0]);
1665
- break;
1666
- case 82:
1667
- this.$ = [];
1668
- break;
1669
- case 83:
1670
- $$[$0 - 1].push($$[$0]);
1671
- break;
1672
- case 86:
1673
- this.$ = [];
1674
- break;
1675
- case 87:
1676
- $$[$0 - 1].push($$[$0]);
1677
- break;
1678
- case 90:
1679
- this.$ = [];
1680
- break;
1681
- case 91:
1682
- $$[$0 - 1].push($$[$0]);
1683
- break;
1684
- case 94:
1685
- this.$ = [];
1686
- break;
1687
- case 95:
1688
- $$[$0 - 1].push($$[$0]);
1689
- break;
1690
- case 98:
1691
- this.$ = [$$[$0]];
1692
- break;
1693
- case 99:
1694
- $$[$0 - 1].push($$[$0]);
1695
- break;
1696
- case 100:
1697
- this.$ = [$$[$0]];
1698
- break;
1699
- case 101:
1700
- $$[$0 - 1].push($$[$0]);
1701
- break;
1702
- }
1703
- },
1704
- table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
1705
- defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] },
1706
- parseError: function parseError(str, hash) {
1707
- throw new Error(str);
1708
- },
1709
- parse: function parse(input) {
1710
- var self = this,
1711
- stack = [0],
1712
- vstack = [null],
1713
- lstack = [],
1714
- table = this.table,
1715
- yytext = "",
1716
- yylineno = 0,
1717
- yyleng = 0;
1718
- this.lexer.setInput(input);
1719
- this.lexer.yy = this.yy;
1720
- this.yy.lexer = this.lexer;
1721
- this.yy.parser = this;
1722
- if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
1723
- var yyloc = this.lexer.yylloc;
1724
- lstack.push(yyloc);
1725
- var ranges = this.lexer.options && this.lexer.options.ranges;
1726
- if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
1727
- function lex() {
1728
- var token;
1729
- token = self.lexer.lex() || 1;
1730
- if (typeof token !== "number") {
1731
- token = self.symbols_[token] || token;
1732
- }
1733
- return token;
1734
- }
1735
- var symbol,
1736
- state,
1737
- action,
1738
- r,
1739
- yyval = {},
1740
- p,
1741
- len,
1742
- newState,
1743
- expected;
1744
- while (true) {
1745
- state = stack[stack.length - 1];
1746
- if (this.defaultActions[state]) {
1747
- action = this.defaultActions[state];
1748
- } else {
1749
- if (symbol === null || typeof symbol == "undefined") {
1750
- symbol = lex();
1751
- }
1752
- action = table[state] && table[state][symbol];
1753
- }
1754
- if (typeof action === "undefined" || !action.length || !action[0]) {
1755
- var errStr = "";
1756
- {
1757
- expected = [];
1758
- for (p in table[state]) if (this.terminals_[p] && p > 2) {
1759
- expected.push("'" + this.terminals_[p] + "'");
1760
- }
1761
- if (this.lexer.showPosition) {
1762
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
1763
- } else {
1764
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
1765
- }
1766
- this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
1767
- }
1768
- }
1769
- if (action[0] instanceof Array && action.length > 1) {
1770
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1771
- }
1772
- switch (action[0]) {
1773
- case 1:
1774
- stack.push(symbol);
1775
- vstack.push(this.lexer.yytext);
1776
- lstack.push(this.lexer.yylloc);
1777
- stack.push(action[1]);
1778
- symbol = null;
1779
- {
1780
- yyleng = this.lexer.yyleng;
1781
- yytext = this.lexer.yytext;
1782
- yylineno = this.lexer.yylineno;
1783
- yyloc = this.lexer.yylloc;
1784
- }
1785
- break;
1786
- case 2:
1787
- len = this.productions_[action[1]][1];
1788
- yyval.$ = vstack[vstack.length - len];
1789
- yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
1790
- if (ranges) {
1791
- yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
1792
- }
1793
- r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
1794
- if (typeof r !== "undefined") {
1795
- return r;
1796
- }
1797
- if (len) {
1798
- stack = stack.slice(0, -1 * len * 2);
1799
- vstack = vstack.slice(0, -1 * len);
1800
- lstack = lstack.slice(0, -1 * len);
1801
- }
1802
- stack.push(this.productions_[action[1]][0]);
1803
- vstack.push(yyval.$);
1804
- lstack.push(yyval._$);
1805
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1806
- stack.push(newState);
1807
- break;
1808
- case 3:
1809
- return true;
1810
- }
1811
- }
1812
- return true;
1813
- }
1814
- };
1815
- /* Jison generated lexer */
1816
- var lexer = (function () {
1817
- var lexer = { EOF: 1,
1818
- parseError: function parseError(str, hash) {
1819
- if (this.yy.parser) {
1820
- this.yy.parser.parseError(str, hash);
1821
- } else {
1822
- throw new Error(str);
1823
- }
1824
- },
1825
- setInput: function setInput(input) {
1826
- this._input = input;
1827
- this._more = this._less = this.done = false;
1828
- this.yylineno = this.yyleng = 0;
1829
- this.yytext = this.matched = this.match = '';
1830
- this.conditionStack = ['INITIAL'];
1831
- this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
1832
- if (this.options.ranges) this.yylloc.range = [0, 0];
1833
- this.offset = 0;
1834
- return this;
1835
- },
1836
- input: function input() {
1837
- var ch = this._input[0];
1838
- this.yytext += ch;
1839
- this.yyleng++;
1840
- this.offset++;
1841
- this.match += ch;
1842
- this.matched += ch;
1843
- var lines = ch.match(/(?:\r\n?|\n).*/g);
1844
- if (lines) {
1845
- this.yylineno++;
1846
- this.yylloc.last_line++;
1847
- } else {
1848
- this.yylloc.last_column++;
1849
- }
1850
- if (this.options.ranges) this.yylloc.range[1]++;
1851
-
1852
- this._input = this._input.slice(1);
1853
- return ch;
1854
- },
1855
- unput: function unput(ch) {
1856
- var len = ch.length;
1857
- var lines = ch.split(/(?:\r\n?|\n)/g);
1858
-
1859
- this._input = ch + this._input;
1860
- this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
1861
- //this.yyleng -= len;
1862
- this.offset -= len;
1863
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1864
- this.match = this.match.substr(0, this.match.length - 1);
1865
- this.matched = this.matched.substr(0, this.matched.length - 1);
1866
-
1867
- if (lines.length - 1) this.yylineno -= lines.length - 1;
1868
- var r = this.yylloc.range;
1869
-
1870
- this.yylloc = { first_line: this.yylloc.first_line,
1871
- last_line: this.yylineno + 1,
1872
- first_column: this.yylloc.first_column,
1873
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
1874
- };
1875
-
1876
- if (this.options.ranges) {
1877
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1878
- }
1879
- return this;
1880
- },
1881
- more: function more() {
1882
- this._more = true;
1883
- return this;
1884
- },
1885
- less: function less(n) {
1886
- this.unput(this.match.slice(n));
1887
- },
1888
- pastInput: function pastInput() {
1889
- var past = this.matched.substr(0, this.matched.length - this.match.length);
1890
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
1891
- },
1892
- upcomingInput: function upcomingInput() {
1893
- var next = this.match;
1894
- if (next.length < 20) {
1895
- next += this._input.substr(0, 20 - next.length);
1896
- }
1897
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
1898
- },
1899
- showPosition: function showPosition() {
1900
- var pre = this.pastInput();
1901
- var c = new Array(pre.length + 1).join("-");
1902
- return pre + this.upcomingInput() + "\n" + c + "^";
1903
- },
1904
- next: function next() {
1905
- if (this.done) {
1906
- return this.EOF;
1907
- }
1908
- if (!this._input) this.done = true;
1909
-
1910
- var token, match, tempMatch, index, lines;
1911
- if (!this._more) {
1912
- this.yytext = '';
1913
- this.match = '';
1914
- }
1915
- var rules = this._currentRules();
1916
- for (var i = 0; i < rules.length; i++) {
1917
- tempMatch = this._input.match(this.rules[rules[i]]);
1918
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1919
- match = tempMatch;
1920
- index = i;
1921
- if (!this.options.flex) break;
1922
- }
1923
- }
1924
- if (match) {
1925
- lines = match[0].match(/(?:\r\n?|\n).*/g);
1926
- if (lines) this.yylineno += lines.length;
1927
- this.yylloc = { first_line: this.yylloc.last_line,
1928
- last_line: this.yylineno + 1,
1929
- first_column: this.yylloc.last_column,
1930
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
1931
- this.yytext += match[0];
1932
- this.match += match[0];
1933
- this.matches = match;
1934
- this.yyleng = this.yytext.length;
1935
- if (this.options.ranges) {
1936
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
1937
- }
1938
- this._more = false;
1939
- this._input = this._input.slice(match[0].length);
1940
- this.matched += match[0];
1941
- token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
1942
- if (this.done && this._input) this.done = false;
1943
- if (token) return token;else return;
1944
- }
1945
- if (this._input === "") {
1946
- return this.EOF;
1947
- } else {
1948
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
1949
- }
1950
- },
1951
- lex: function lex() {
1952
- var r = this.next();
1953
- if (typeof r !== 'undefined') {
1954
- return r;
1955
- } else {
1956
- return this.lex();
1957
- }
1958
- },
1959
- begin: function begin(condition) {
1960
- this.conditionStack.push(condition);
1961
- },
1962
- popState: function popState() {
1963
- return this.conditionStack.pop();
1964
- },
1965
- _currentRules: function _currentRules() {
1966
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1967
- },
1968
- topState: function topState() {
1969
- return this.conditionStack[this.conditionStack.length - 2];
1970
- },
1971
- pushState: function begin(condition) {
1972
- this.begin(condition);
1973
- } };
1974
- lexer.options = {};
1975
- lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1976
-
1977
- function strip(start, end) {
1978
- return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start);
1979
- }
1980
- switch ($avoiding_name_collisions) {
1981
- case 0:
1982
- if (yy_.yytext.slice(-2) === "\\\\") {
1983
- strip(0, 1);
1984
- this.begin("mu");
1985
- } else if (yy_.yytext.slice(-1) === "\\") {
1986
- strip(0, 1);
1987
- this.begin("emu");
1988
- } else {
1989
- this.begin("mu");
1990
- }
1991
- if (yy_.yytext) return 15;
1992
-
1993
- break;
1994
- case 1:
1995
- return 15;
1996
- case 2:
1997
- this.popState();
1998
- return 15;
1999
- case 3:
2000
- this.begin('raw');return 15;
2001
- case 4:
2002
- this.popState();
2003
- // Should be using `this.topState()` below, but it currently
2004
- // returns the second top instead of the first top. Opened an
2005
- // issue about it at https://github.com/zaach/jison/issues/291
2006
- if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
2007
- return 15;
2008
- } else {
2009
- strip(5, 9);
2010
- return 'END_RAW_BLOCK';
2011
- }
2012
- case 5:
2013
- return 15;
2014
- case 6:
2015
- this.popState();
2016
- return 14;
2017
- case 7:
2018
- return 65;
2019
- case 8:
2020
- return 68;
2021
- case 9:
2022
- return 19;
2023
- case 10:
2024
- this.popState();
2025
- this.begin('raw');
2026
- return 23;
2027
- case 11:
2028
- return 55;
2029
- case 12:
2030
- return 60;
2031
- case 13:
2032
- return 29;
2033
- case 14:
2034
- return 47;
2035
- case 15:
2036
- this.popState();return 44;
2037
- case 16:
2038
- this.popState();return 44;
2039
- case 17:
2040
- return 34;
2041
- case 18:
2042
- return 39;
2043
- case 19:
2044
- return 51;
2045
- case 20:
2046
- return 48;
2047
- case 21:
2048
- this.unput(yy_.yytext);
2049
- this.popState();
2050
- this.begin('com');
2051
-
2052
- break;
2053
- case 22:
2054
- this.popState();
2055
- return 14;
2056
- case 23:
2057
- return 48;
2058
- case 24:
2059
- return 73;
2060
- case 25:
2061
- return 72;
2062
- case 26:
2063
- return 72;
2064
- case 27:
2065
- return 87;
2066
- case 28:
2067
- // ignore whitespace
2068
- break;
2069
- case 29:
2070
- this.popState();return 54;
2071
- case 30:
2072
- this.popState();return 33;
2073
- case 31:
2074
- yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
2075
- case 32:
2076
- yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
2077
- case 33:
2078
- return 85;
2079
- case 34:
2080
- return 82;
2081
- case 35:
2082
- return 82;
2083
- case 36:
2084
- return 83;
2085
- case 37:
2086
- return 84;
2087
- case 38:
2088
- return 81;
2089
- case 39:
2090
- return 75;
2091
- case 40:
2092
- return 77;
2093
- case 41:
2094
- return 72;
2095
- case 42:
2096
- yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
2097
- case 43:
2098
- return 'INVALID';
2099
- case 44:
2100
- return 5;
2101
- }
2102
- };
2103
- lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2104
- lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
2105
- return lexer;
2106
- })();
2107
- parser.lexer = lexer;
2108
- function Parser() {
2109
- this.yy = {};
2110
- }Parser.prototype = parser;parser.Parser = Parser;
2111
- return new Parser();
2112
- })();exports["default"] = handlebars;
2113
- module.exports = exports["default"];
2114
-
2115
- }(parser, parser.exports));
2116
-
2117
- var whitespaceControl = {exports: {}};
2118
-
2119
- var visitor = {exports: {}};
2120
-
2121
- (function (module, exports) {
2122
-
2123
- exports.__esModule = true;
2124
- // istanbul ignore next
2125
-
2126
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2127
-
2128
- var _exception = exception.exports;
2129
-
2130
- var _exception2 = _interopRequireDefault(_exception);
2131
-
2132
- function Visitor() {
2133
- this.parents = [];
2134
- }
2135
-
2136
- Visitor.prototype = {
2137
- constructor: Visitor,
2138
- mutating: false,
2139
-
2140
- // Visits a given value. If mutating, will replace the value if necessary.
2141
- acceptKey: function acceptKey(node, name) {
2142
- var value = this.accept(node[name]);
2143
- if (this.mutating) {
2144
- // Hacky sanity check: This may have a few false positives for type for the helper
2145
- // methods but will generally do the right thing without a lot of overhead.
2146
- if (value && !Visitor.prototype[value.type]) {
2147
- throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
2148
- }
2149
- node[name] = value;
2150
- }
2151
- },
2152
-
2153
- // Performs an accept operation with added sanity check to ensure
2154
- // required keys are not removed.
2155
- acceptRequired: function acceptRequired(node, name) {
2156
- this.acceptKey(node, name);
2157
-
2158
- if (!node[name]) {
2159
- throw new _exception2['default'](node.type + ' requires ' + name);
2160
- }
2161
- },
2162
-
2163
- // Traverses a given array. If mutating, empty respnses will be removed
2164
- // for child elements.
2165
- acceptArray: function acceptArray(array) {
2166
- for (var i = 0, l = array.length; i < l; i++) {
2167
- this.acceptKey(array, i);
2168
-
2169
- if (!array[i]) {
2170
- array.splice(i, 1);
2171
- i--;
2172
- l--;
2173
- }
2174
- }
2175
- },
2176
-
2177
- accept: function accept(object) {
2178
- if (!object) {
2179
- return;
2180
- }
2181
-
2182
- /* istanbul ignore next: Sanity code */
2183
- if (!this[object.type]) {
2184
- throw new _exception2['default']('Unknown type: ' + object.type, object);
2185
- }
2186
-
2187
- if (this.current) {
2188
- this.parents.unshift(this.current);
2189
- }
2190
- this.current = object;
2191
-
2192
- var ret = this[object.type](object);
2193
-
2194
- this.current = this.parents.shift();
2195
-
2196
- if (!this.mutating || ret) {
2197
- return ret;
2198
- } else if (ret !== false) {
2199
- return object;
2200
- }
2201
- },
2202
-
2203
- Program: function Program(program) {
2204
- this.acceptArray(program.body);
2205
- },
2206
-
2207
- MustacheStatement: visitSubExpression,
2208
- Decorator: visitSubExpression,
2209
-
2210
- BlockStatement: visitBlock,
2211
- DecoratorBlock: visitBlock,
2212
-
2213
- PartialStatement: visitPartial,
2214
- PartialBlockStatement: function PartialBlockStatement(partial) {
2215
- visitPartial.call(this, partial);
2216
-
2217
- this.acceptKey(partial, 'program');
2218
- },
2219
-
2220
- ContentStatement: function ContentStatement() /* content */{},
2221
- CommentStatement: function CommentStatement() /* comment */{},
2222
-
2223
- SubExpression: visitSubExpression,
2224
-
2225
- PathExpression: function PathExpression() /* path */{},
2226
-
2227
- StringLiteral: function StringLiteral() /* string */{},
2228
- NumberLiteral: function NumberLiteral() /* number */{},
2229
- BooleanLiteral: function BooleanLiteral() /* bool */{},
2230
- UndefinedLiteral: function UndefinedLiteral() /* literal */{},
2231
- NullLiteral: function NullLiteral() /* literal */{},
2232
-
2233
- Hash: function Hash(hash) {
2234
- this.acceptArray(hash.pairs);
2235
- },
2236
- HashPair: function HashPair(pair) {
2237
- this.acceptRequired(pair, 'value');
2238
- }
2239
- };
2240
-
2241
- function visitSubExpression(mustache) {
2242
- this.acceptRequired(mustache, 'path');
2243
- this.acceptArray(mustache.params);
2244
- this.acceptKey(mustache, 'hash');
2245
- }
2246
- function visitBlock(block) {
2247
- visitSubExpression.call(this, block);
2248
-
2249
- this.acceptKey(block, 'program');
2250
- this.acceptKey(block, 'inverse');
2251
- }
2252
- function visitPartial(partial) {
2253
- this.acceptRequired(partial, 'name');
2254
- this.acceptArray(partial.params);
2255
- this.acceptKey(partial, 'hash');
2256
- }
2257
-
2258
- exports['default'] = Visitor;
2259
- module.exports = exports['default'];
2260
-
2261
- }(visitor, visitor.exports));
2262
-
2263
- (function (module, exports) {
2264
-
2265
- exports.__esModule = true;
2266
- // istanbul ignore next
2267
-
2268
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2269
-
2270
- var _visitor = visitor.exports;
2271
-
2272
- var _visitor2 = _interopRequireDefault(_visitor);
2273
-
2274
- function WhitespaceControl() {
2275
- var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
2276
-
2277
- this.options = options;
2278
- }
2279
- WhitespaceControl.prototype = new _visitor2['default']();
2280
-
2281
- WhitespaceControl.prototype.Program = function (program) {
2282
- var doStandalone = !this.options.ignoreStandalone;
2283
-
2284
- var isRoot = !this.isRootSeen;
2285
- this.isRootSeen = true;
2286
-
2287
- var body = program.body;
2288
- for (var i = 0, l = body.length; i < l; i++) {
2289
- var current = body[i],
2290
- strip = this.accept(current);
2291
-
2292
- if (!strip) {
2293
- continue;
2294
- }
2295
-
2296
- var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
2297
- _isNextWhitespace = isNextWhitespace(body, i, isRoot),
2298
- openStandalone = strip.openStandalone && _isPrevWhitespace,
2299
- closeStandalone = strip.closeStandalone && _isNextWhitespace,
2300
- inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
2301
-
2302
- if (strip.close) {
2303
- omitRight(body, i, true);
2304
- }
2305
- if (strip.open) {
2306
- omitLeft(body, i, true);
2307
- }
2308
-
2309
- if (doStandalone && inlineStandalone) {
2310
- omitRight(body, i);
2311
-
2312
- if (omitLeft(body, i)) {
2313
- // If we are on a standalone node, save the indent info for partials
2314
- if (current.type === 'PartialStatement') {
2315
- // Pull out the whitespace from the final line
2316
- current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
2317
- }
2318
- }
2319
- }
2320
- if (doStandalone && openStandalone) {
2321
- omitRight((current.program || current.inverse).body);
2322
-
2323
- // Strip out the previous content node if it's whitespace only
2324
- omitLeft(body, i);
2325
- }
2326
- if (doStandalone && closeStandalone) {
2327
- // Always strip the next node
2328
- omitRight(body, i);
2329
-
2330
- omitLeft((current.inverse || current.program).body);
2331
- }
2332
- }
2333
-
2334
- return program;
2335
- };
2336
-
2337
- WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
2338
- this.accept(block.program);
2339
- this.accept(block.inverse);
2340
-
2341
- // Find the inverse program that is involed with whitespace stripping.
2342
- var program = block.program || block.inverse,
2343
- inverse = block.program && block.inverse,
2344
- firstInverse = inverse,
2345
- lastInverse = inverse;
2346
-
2347
- if (inverse && inverse.chained) {
2348
- firstInverse = inverse.body[0].program;
2349
-
2350
- // Walk the inverse chain to find the last inverse that is actually in the chain.
2351
- while (lastInverse.chained) {
2352
- lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
2353
- }
2354
- }
2355
-
2356
- var strip = {
2357
- open: block.openStrip.open,
2358
- close: block.closeStrip.close,
2359
-
2360
- // Determine the standalone candiacy. Basically flag our content as being possibly standalone
2361
- // so our parent can determine if we actually are standalone
2362
- openStandalone: isNextWhitespace(program.body),
2363
- closeStandalone: isPrevWhitespace((firstInverse || program).body)
2364
- };
2365
-
2366
- if (block.openStrip.close) {
2367
- omitRight(program.body, null, true);
2368
- }
2369
-
2370
- if (inverse) {
2371
- var inverseStrip = block.inverseStrip;
2372
-
2373
- if (inverseStrip.open) {
2374
- omitLeft(program.body, null, true);
2375
- }
2376
-
2377
- if (inverseStrip.close) {
2378
- omitRight(firstInverse.body, null, true);
2379
- }
2380
- if (block.closeStrip.open) {
2381
- omitLeft(lastInverse.body, null, true);
2382
- }
2383
-
2384
- // Find standalone else statments
2385
- if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
2386
- omitLeft(program.body);
2387
- omitRight(firstInverse.body);
2388
- }
2389
- } else if (block.closeStrip.open) {
2390
- omitLeft(program.body, null, true);
2391
- }
2392
-
2393
- return strip;
2394
- };
2395
-
2396
- WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
2397
- return mustache.strip;
2398
- };
2399
-
2400
- WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
2401
- /* istanbul ignore next */
2402
- var strip = node.strip || {};
2403
- return {
2404
- inlineStandalone: true,
2405
- open: strip.open,
2406
- close: strip.close
2407
- };
2408
- };
2409
-
2410
- function isPrevWhitespace(body, i, isRoot) {
2411
- if (i === undefined) {
2412
- i = body.length;
2413
- }
2414
-
2415
- // Nodes that end with newlines are considered whitespace (but are special
2416
- // cased for strip operations)
2417
- var prev = body[i - 1],
2418
- sibling = body[i - 2];
2419
- if (!prev) {
2420
- return isRoot;
2421
- }
2422
-
2423
- if (prev.type === 'ContentStatement') {
2424
- return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
2425
- }
2426
- }
2427
- function isNextWhitespace(body, i, isRoot) {
2428
- if (i === undefined) {
2429
- i = -1;
2430
- }
2431
-
2432
- var next = body[i + 1],
2433
- sibling = body[i + 2];
2434
- if (!next) {
2435
- return isRoot;
2436
- }
2437
-
2438
- if (next.type === 'ContentStatement') {
2439
- return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
2440
- }
2441
- }
2442
-
2443
- // Marks the node to the right of the position as omitted.
2444
- // I.e. {{foo}}' ' will mark the ' ' node as omitted.
2445
- //
2446
- // If i is undefined, then the first child will be marked as such.
2447
- //
2448
- // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2449
- // content is met.
2450
- function omitRight(body, i, multiple) {
2451
- var current = body[i == null ? 0 : i + 1];
2452
- if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
2453
- return;
2454
- }
2455
-
2456
- var original = current.value;
2457
- current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
2458
- current.rightStripped = current.value !== original;
2459
- }
2460
-
2461
- // Marks the node to the left of the position as omitted.
2462
- // I.e. ' '{{foo}} will mark the ' ' node as omitted.
2463
- //
2464
- // If i is undefined then the last child will be marked as such.
2465
- //
2466
- // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2467
- // content is met.
2468
- function omitLeft(body, i, multiple) {
2469
- var current = body[i == null ? body.length - 1 : i - 1];
2470
- if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
2471
- return;
2472
- }
2473
-
2474
- // We omit the last node if it's whitespace only and not preceded by a non-content node.
2475
- var original = current.value;
2476
- current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
2477
- current.leftStripped = current.value !== original;
2478
- return current.leftStripped;
2479
- }
2480
-
2481
- exports['default'] = WhitespaceControl;
2482
- module.exports = exports['default'];
2483
-
2484
- }(whitespaceControl, whitespaceControl.exports));
2485
-
2486
- var helpers = {};
2487
-
2488
- helpers.__esModule = true;
2489
- helpers.SourceLocation = SourceLocation;
2490
- helpers.id = id;
2491
- helpers.stripFlags = stripFlags;
2492
- helpers.stripComment = stripComment;
2493
- helpers.preparePath = preparePath;
2494
- helpers.prepareMustache = prepareMustache;
2495
- helpers.prepareRawBlock = prepareRawBlock;
2496
- helpers.prepareBlock = prepareBlock;
2497
- helpers.prepareProgram = prepareProgram;
2498
- helpers.preparePartialBlock = preparePartialBlock;
2499
- // istanbul ignore next
2500
-
2501
- function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2502
-
2503
- var _exception$1 = exception.exports;
2504
-
2505
- var _exception2$1 = _interopRequireDefault$2(_exception$1);
2506
-
2507
- function validateClose(open, close) {
2508
- close = close.path ? close.path.original : close;
2509
-
2510
- if (open.path.original !== close) {
2511
- var errorNode = { loc: open.path.loc };
2512
-
2513
- throw new _exception2$1['default'](open.path.original + " doesn't match " + close, errorNode);
2514
- }
2515
- }
2516
-
2517
- function SourceLocation(source, locInfo) {
2518
- this.source = source;
2519
- this.start = {
2520
- line: locInfo.first_line,
2521
- column: locInfo.first_column
2522
- };
2523
- this.end = {
2524
- line: locInfo.last_line,
2525
- column: locInfo.last_column
2526
- };
2527
- }
2528
-
2529
- function id(token) {
2530
- if (/^\[.*\]$/.test(token)) {
2531
- return token.substring(1, token.length - 1);
2532
- } else {
2533
- return token;
2534
- }
2535
- }
2536
-
2537
- function stripFlags(open, close) {
2538
- return {
2539
- open: open.charAt(2) === '~',
2540
- close: close.charAt(close.length - 3) === '~'
2541
- };
2542
- }
2543
-
2544
- function stripComment(comment) {
2545
- return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
2546
- }
2547
-
2548
- function preparePath(data, parts, loc) {
2549
- loc = this.locInfo(loc);
2550
-
2551
- var original = data ? '@' : '',
2552
- dig = [],
2553
- depth = 0;
2554
-
2555
- for (var i = 0, l = parts.length; i < l; i++) {
2556
- var part = parts[i].part,
2557
-
2558
- // If we have [] syntax then we do not treat path references as operators,
2559
- // i.e. foo.[this] resolves to approximately context.foo['this']
2560
- isLiteral = parts[i].original !== part;
2561
- original += (parts[i].separator || '') + part;
2562
-
2563
- if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
2564
- if (dig.length > 0) {
2565
- throw new _exception2$1['default']('Invalid path: ' + original, { loc: loc });
2566
- } else if (part === '..') {
2567
- depth++;
2568
- }
2569
- } else {
2570
- dig.push(part);
2571
- }
2572
- }
2573
-
2574
- return {
2575
- type: 'PathExpression',
2576
- data: data,
2577
- depth: depth,
2578
- parts: dig,
2579
- original: original,
2580
- loc: loc
2581
- };
2582
- }
2583
-
2584
- function prepareMustache(path, params, hash, open, strip, locInfo) {
2585
- // Must use charAt to support IE pre-10
2586
- var escapeFlag = open.charAt(3) || open.charAt(2),
2587
- escaped = escapeFlag !== '{' && escapeFlag !== '&';
2588
-
2589
- var decorator = /\*/.test(open);
2590
- return {
2591
- type: decorator ? 'Decorator' : 'MustacheStatement',
2592
- path: path,
2593
- params: params,
2594
- hash: hash,
2595
- escaped: escaped,
2596
- strip: strip,
2597
- loc: this.locInfo(locInfo)
2598
- };
2599
- }
2600
-
2601
- function prepareRawBlock(openRawBlock, contents, close, locInfo) {
2602
- validateClose(openRawBlock, close);
2603
-
2604
- locInfo = this.locInfo(locInfo);
2605
- var program = {
2606
- type: 'Program',
2607
- body: contents,
2608
- strip: {},
2609
- loc: locInfo
2610
- };
2611
-
2612
- return {
2613
- type: 'BlockStatement',
2614
- path: openRawBlock.path,
2615
- params: openRawBlock.params,
2616
- hash: openRawBlock.hash,
2617
- program: program,
2618
- openStrip: {},
2619
- inverseStrip: {},
2620
- closeStrip: {},
2621
- loc: locInfo
2622
- };
2623
- }
2624
-
2625
- function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
2626
- if (close && close.path) {
2627
- validateClose(openBlock, close);
2628
- }
2629
-
2630
- var decorator = /\*/.test(openBlock.open);
2631
-
2632
- program.blockParams = openBlock.blockParams;
2633
-
2634
- var inverse = undefined,
2635
- inverseStrip = undefined;
2636
-
2637
- if (inverseAndProgram) {
2638
- if (decorator) {
2639
- throw new _exception2$1['default']('Unexpected inverse block on decorator', inverseAndProgram);
2640
- }
2641
-
2642
- if (inverseAndProgram.chain) {
2643
- inverseAndProgram.program.body[0].closeStrip = close.strip;
2644
- }
2645
-
2646
- inverseStrip = inverseAndProgram.strip;
2647
- inverse = inverseAndProgram.program;
2648
- }
2649
-
2650
- if (inverted) {
2651
- inverted = inverse;
2652
- inverse = program;
2653
- program = inverted;
2654
- }
2655
-
2656
- return {
2657
- type: decorator ? 'DecoratorBlock' : 'BlockStatement',
2658
- path: openBlock.path,
2659
- params: openBlock.params,
2660
- hash: openBlock.hash,
2661
- program: program,
2662
- inverse: inverse,
2663
- openStrip: openBlock.strip,
2664
- inverseStrip: inverseStrip,
2665
- closeStrip: close && close.strip,
2666
- loc: this.locInfo(locInfo)
2667
- };
2668
- }
2669
-
2670
- function prepareProgram(statements, loc) {
2671
- if (!loc && statements.length) {
2672
- var firstLoc = statements[0].loc,
2673
- lastLoc = statements[statements.length - 1].loc;
2674
-
2675
- /* istanbul ignore else */
2676
- if (firstLoc && lastLoc) {
2677
- loc = {
2678
- source: firstLoc.source,
2679
- start: {
2680
- line: firstLoc.start.line,
2681
- column: firstLoc.start.column
2682
- },
2683
- end: {
2684
- line: lastLoc.end.line,
2685
- column: lastLoc.end.column
2686
- }
2687
- };
2688
- }
2689
- }
2690
-
2691
- return {
2692
- type: 'Program',
2693
- body: statements,
2694
- strip: {},
2695
- loc: loc
2696
- };
2697
- }
2698
-
2699
- function preparePartialBlock(open, program, close, locInfo) {
2700
- validateClose(open, close);
2701
-
2702
- return {
2703
- type: 'PartialBlockStatement',
2704
- name: open.path,
2705
- params: open.params,
2706
- hash: open.hash,
2707
- program: program,
2708
- openStrip: open.strip,
2709
- closeStrip: close && close.strip,
2710
- loc: this.locInfo(locInfo)
2711
- };
2712
- }
2713
-
2714
- base.__esModule = true;
2715
- base.parseWithoutProcessing = parseWithoutProcessing;
2716
- base.parse = parse;
2717
- // istanbul ignore next
2718
-
2719
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
2720
-
2721
- // istanbul ignore next
2722
-
2723
- function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2724
-
2725
- var _parser = parser.exports;
2726
-
2727
- var _parser2 = _interopRequireDefault$1(_parser);
2728
-
2729
- var _whitespaceControl = whitespaceControl.exports;
2730
-
2731
- var _whitespaceControl2 = _interopRequireDefault$1(_whitespaceControl);
2732
-
2733
- var _helpers = helpers;
2734
-
2735
- var Helpers = _interopRequireWildcard(_helpers);
2736
-
2737
- var _utils$1 = utils;
2738
-
2739
- base.parser = _parser2['default'];
2740
-
2741
- var yy = {};
2742
- _utils$1.extend(yy, Helpers);
2743
-
2744
- function parseWithoutProcessing(input, options) {
2745
- // Just return if an already-compiled AST was passed in.
2746
- if (input.type === 'Program') {
2747
- return input;
2748
- }
2749
-
2750
- _parser2['default'].yy = yy;
2751
-
2752
- // Altering the shared object here, but this is ok as parser is a sync operation
2753
- yy.locInfo = function (locInfo) {
2754
- return new yy.SourceLocation(options && options.srcName, locInfo);
2755
- };
2756
-
2757
- var ast = _parser2['default'].parse(input);
2758
-
2759
- return ast;
2760
- }
2761
-
2762
- function parse(input, options) {
2763
- var ast = parseWithoutProcessing(input, options);
2764
- var strip = new _whitespaceControl2['default'](options);
2765
-
2766
- return strip.accept(ast);
2767
- }
2768
-
2769
- var compiler = {};
2770
-
2771
- /* eslint-disable new-cap */
2772
-
2773
- compiler.__esModule = true;
2774
- compiler.Compiler = Compiler;
2775
- compiler.precompile = precompile;
2776
- compiler.compile = compile;
2777
- // istanbul ignore next
2778
-
2779
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2780
-
2781
- var _exception = exception.exports;
2782
-
2783
- var _exception2 = _interopRequireDefault(_exception);
2784
-
2785
- var _utils = utils;
2786
-
2787
- var _ast = ast.exports;
2788
-
2789
- var _ast2 = _interopRequireDefault(_ast);
2790
-
2791
- var slice = [].slice;
2792
-
2793
- function Compiler() {}
2794
-
2795
- // the foundHelper register will disambiguate helper lookup from finding a
2796
- // function in a context. This is necessary for mustache compatibility, which
2797
- // requires that context functions in blocks are evaluated by blockHelperMissing,
2798
- // and then proceed as if the resulting value was provided to blockHelperMissing.
2799
-
2800
- Compiler.prototype = {
2801
- compiler: Compiler,
2802
-
2803
- equals: function equals(other) {
2804
- var len = this.opcodes.length;
2805
- if (other.opcodes.length !== len) {
2806
- return false;
2807
- }
2808
-
2809
- for (var i = 0; i < len; i++) {
2810
- var opcode = this.opcodes[i],
2811
- otherOpcode = other.opcodes[i];
2812
- if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
2813
- return false;
2814
- }
2815
- }
2816
-
2817
- // We know that length is the same between the two arrays because they are directly tied
2818
- // to the opcode behavior above.
2819
- len = this.children.length;
2820
- for (var i = 0; i < len; i++) {
2821
- if (!this.children[i].equals(other.children[i])) {
2822
- return false;
2823
- }
2824
- }
2825
-
2826
- return true;
2827
- },
2828
-
2829
- guid: 0,
2830
-
2831
- compile: function compile(program, options) {
2832
- this.sourceNode = [];
2833
- this.opcodes = [];
2834
- this.children = [];
2835
- this.options = options;
2836
- this.stringParams = options.stringParams;
2837
- this.trackIds = options.trackIds;
2838
-
2839
- options.blockParams = options.blockParams || [];
2840
-
2841
- options.knownHelpers = _utils.extend(Object.create(null), {
2842
- helperMissing: true,
2843
- blockHelperMissing: true,
2844
- each: true,
2845
- 'if': true,
2846
- unless: true,
2847
- 'with': true,
2848
- log: true,
2849
- lookup: true
2850
- }, options.knownHelpers);
2851
-
2852
- return this.accept(program);
2853
- },
2854
-
2855
- compileProgram: function compileProgram(program) {
2856
- var childCompiler = new this.compiler(),
2857
- // eslint-disable-line new-cap
2858
- result = childCompiler.compile(program, this.options),
2859
- guid = this.guid++;
2860
-
2861
- this.usePartial = this.usePartial || result.usePartial;
2862
-
2863
- this.children[guid] = result;
2864
- this.useDepths = this.useDepths || result.useDepths;
2865
-
2866
- return guid;
2867
- },
2868
-
2869
- accept: function accept(node) {
2870
- /* istanbul ignore next: Sanity code */
2871
- if (!this[node.type]) {
2872
- throw new _exception2['default']('Unknown type: ' + node.type, node);
2873
- }
2874
-
2875
- this.sourceNode.unshift(node);
2876
- var ret = this[node.type](node);
2877
- this.sourceNode.shift();
2878
- return ret;
2879
- },
2880
-
2881
- Program: function Program(program) {
2882
- this.options.blockParams.unshift(program.blockParams);
2883
-
2884
- var body = program.body,
2885
- bodyLength = body.length;
2886
- for (var i = 0; i < bodyLength; i++) {
2887
- this.accept(body[i]);
2888
- }
2889
-
2890
- this.options.blockParams.shift();
2891
-
2892
- this.isSimple = bodyLength === 1;
2893
- this.blockParams = program.blockParams ? program.blockParams.length : 0;
2894
-
2895
- return this;
2896
- },
2897
-
2898
- BlockStatement: function BlockStatement(block) {
2899
- transformLiteralToPath(block);
2900
-
2901
- var program = block.program,
2902
- inverse = block.inverse;
2903
-
2904
- program = program && this.compileProgram(program);
2905
- inverse = inverse && this.compileProgram(inverse);
2906
-
2907
- var type = this.classifySexpr(block);
2908
-
2909
- if (type === 'helper') {
2910
- this.helperSexpr(block, program, inverse);
2911
- } else if (type === 'simple') {
2912
- this.simpleSexpr(block);
2913
-
2914
- // now that the simple mustache is resolved, we need to
2915
- // evaluate it by executing `blockHelperMissing`
2916
- this.opcode('pushProgram', program);
2917
- this.opcode('pushProgram', inverse);
2918
- this.opcode('emptyHash');
2919
- this.opcode('blockValue', block.path.original);
2920
- } else {
2921
- this.ambiguousSexpr(block, program, inverse);
2922
-
2923
- // now that the simple mustache is resolved, we need to
2924
- // evaluate it by executing `blockHelperMissing`
2925
- this.opcode('pushProgram', program);
2926
- this.opcode('pushProgram', inverse);
2927
- this.opcode('emptyHash');
2928
- this.opcode('ambiguousBlockValue');
2929
- }
2930
-
2931
- this.opcode('append');
2932
- },
2933
-
2934
- DecoratorBlock: function DecoratorBlock(decorator) {
2935
- var program = decorator.program && this.compileProgram(decorator.program);
2936
- var params = this.setupFullMustacheParams(decorator, program, undefined),
2937
- path = decorator.path;
2938
-
2939
- this.useDecorators = true;
2940
- this.opcode('registerDecorator', params.length, path.original);
2941
- },
2942
-
2943
- PartialStatement: function PartialStatement(partial) {
2944
- this.usePartial = true;
2945
-
2946
- var program = partial.program;
2947
- if (program) {
2948
- program = this.compileProgram(partial.program);
2949
- }
2950
-
2951
- var params = partial.params;
2952
- if (params.length > 1) {
2953
- throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
2954
- } else if (!params.length) {
2955
- if (this.options.explicitPartialContext) {
2956
- this.opcode('pushLiteral', 'undefined');
2957
- } else {
2958
- params.push({ type: 'PathExpression', parts: [], depth: 0 });
2959
- }
2960
- }
2961
-
2962
- var partialName = partial.name.original,
2963
- isDynamic = partial.name.type === 'SubExpression';
2964
- if (isDynamic) {
2965
- this.accept(partial.name);
2966
- }
2967
-
2968
- this.setupFullMustacheParams(partial, program, undefined, true);
2969
-
2970
- var indent = partial.indent || '';
2971
- if (this.options.preventIndent && indent) {
2972
- this.opcode('appendContent', indent);
2973
- indent = '';
2974
- }
2975
-
2976
- this.opcode('invokePartial', isDynamic, partialName, indent);
2977
- this.opcode('append');
2978
- },
2979
- PartialBlockStatement: function PartialBlockStatement(partialBlock) {
2980
- this.PartialStatement(partialBlock);
2981
- },
2982
-
2983
- MustacheStatement: function MustacheStatement(mustache) {
2984
- this.SubExpression(mustache);
2985
-
2986
- if (mustache.escaped && !this.options.noEscape) {
2987
- this.opcode('appendEscaped');
2988
- } else {
2989
- this.opcode('append');
2990
- }
2991
- },
2992
- Decorator: function Decorator(decorator) {
2993
- this.DecoratorBlock(decorator);
2994
- },
2995
-
2996
- ContentStatement: function ContentStatement(content) {
2997
- if (content.value) {
2998
- this.opcode('appendContent', content.value);
2999
- }
3000
- },
3001
-
3002
- CommentStatement: function CommentStatement() {},
3003
-
3004
- SubExpression: function SubExpression(sexpr) {
3005
- transformLiteralToPath(sexpr);
3006
- var type = this.classifySexpr(sexpr);
3007
-
3008
- if (type === 'simple') {
3009
- this.simpleSexpr(sexpr);
3010
- } else if (type === 'helper') {
3011
- this.helperSexpr(sexpr);
3012
- } else {
3013
- this.ambiguousSexpr(sexpr);
3014
- }
3015
- },
3016
- ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
3017
- var path = sexpr.path,
3018
- name = path.parts[0],
3019
- isBlock = program != null || inverse != null;
3020
-
3021
- this.opcode('getContext', path.depth);
3022
-
3023
- this.opcode('pushProgram', program);
3024
- this.opcode('pushProgram', inverse);
3025
-
3026
- path.strict = true;
3027
- this.accept(path);
3028
-
3029
- this.opcode('invokeAmbiguous', name, isBlock);
3030
- },
3031
-
3032
- simpleSexpr: function simpleSexpr(sexpr) {
3033
- var path = sexpr.path;
3034
- path.strict = true;
3035
- this.accept(path);
3036
- this.opcode('resolvePossibleLambda');
3037
- },
3038
-
3039
- helperSexpr: function helperSexpr(sexpr, program, inverse) {
3040
- var params = this.setupFullMustacheParams(sexpr, program, inverse),
3041
- path = sexpr.path,
3042
- name = path.parts[0];
3043
-
3044
- if (this.options.knownHelpers[name]) {
3045
- this.opcode('invokeKnownHelper', params.length, name);
3046
- } else if (this.options.knownHelpersOnly) {
3047
- throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
3048
- } else {
3049
- path.strict = true;
3050
- path.falsy = true;
3051
-
3052
- this.accept(path);
3053
- this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
3054
- }
3055
- },
3056
-
3057
- PathExpression: function PathExpression(path) {
3058
- this.addDepth(path.depth);
3059
- this.opcode('getContext', path.depth);
3060
-
3061
- var name = path.parts[0],
3062
- scoped = _ast2['default'].helpers.scopedId(path),
3063
- blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
3064
-
3065
- if (blockParamId) {
3066
- this.opcode('lookupBlockParam', blockParamId, path.parts);
3067
- } else if (!name) {
3068
- // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
3069
- this.opcode('pushContext');
3070
- } else if (path.data) {
3071
- this.options.data = true;
3072
- this.opcode('lookupData', path.depth, path.parts, path.strict);
3073
- } else {
3074
- this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
3075
- }
3076
- },
3077
-
3078
- StringLiteral: function StringLiteral(string) {
3079
- this.opcode('pushString', string.value);
3080
- },
3081
-
3082
- NumberLiteral: function NumberLiteral(number) {
3083
- this.opcode('pushLiteral', number.value);
3084
- },
3085
-
3086
- BooleanLiteral: function BooleanLiteral(bool) {
3087
- this.opcode('pushLiteral', bool.value);
3088
- },
3089
-
3090
- UndefinedLiteral: function UndefinedLiteral() {
3091
- this.opcode('pushLiteral', 'undefined');
3092
- },
3093
-
3094
- NullLiteral: function NullLiteral() {
3095
- this.opcode('pushLiteral', 'null');
3096
- },
3097
-
3098
- Hash: function Hash(hash) {
3099
- var pairs = hash.pairs,
3100
- i = 0,
3101
- l = pairs.length;
3102
-
3103
- this.opcode('pushHash');
3104
-
3105
- for (; i < l; i++) {
3106
- this.pushParam(pairs[i].value);
3107
- }
3108
- while (i--) {
3109
- this.opcode('assignToHash', pairs[i].key);
3110
- }
3111
- this.opcode('popHash');
3112
- },
3113
-
3114
- // HELPERS
3115
- opcode: function opcode(name) {
3116
- this.opcodes.push({
3117
- opcode: name,
3118
- args: slice.call(arguments, 1),
3119
- loc: this.sourceNode[0].loc
3120
- });
3121
- },
3122
-
3123
- addDepth: function addDepth(depth) {
3124
- if (!depth) {
3125
- return;
3126
- }
3127
-
3128
- this.useDepths = true;
3129
- },
3130
-
3131
- classifySexpr: function classifySexpr(sexpr) {
3132
- var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
3133
-
3134
- var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
3135
-
3136
- // a mustache is an eligible helper if:
3137
- // * its id is simple (a single part, not `this` or `..`)
3138
- var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
3139
-
3140
- // if a mustache is an eligible helper but not a definite
3141
- // helper, it is ambiguous, and will be resolved in a later
3142
- // pass or at runtime.
3143
- var isEligible = !isBlockParam && (isHelper || isSimple);
3144
-
3145
- // if ambiguous, we can possibly resolve the ambiguity now
3146
- // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
3147
- if (isEligible && !isHelper) {
3148
- var _name = sexpr.path.parts[0],
3149
- options = this.options;
3150
- if (options.knownHelpers[_name]) {
3151
- isHelper = true;
3152
- } else if (options.knownHelpersOnly) {
3153
- isEligible = false;
3154
- }
3155
- }
3156
-
3157
- if (isHelper) {
3158
- return 'helper';
3159
- } else if (isEligible) {
3160
- return 'ambiguous';
3161
- } else {
3162
- return 'simple';
3163
- }
3164
- },
3165
-
3166
- pushParams: function pushParams(params) {
3167
- for (var i = 0, l = params.length; i < l; i++) {
3168
- this.pushParam(params[i]);
3169
- }
3170
- },
3171
-
3172
- pushParam: function pushParam(val) {
3173
- var value = val.value != null ? val.value : val.original || '';
3174
-
3175
- if (this.stringParams) {
3176
- if (value.replace) {
3177
- value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
3178
- }
3179
-
3180
- if (val.depth) {
3181
- this.addDepth(val.depth);
3182
- }
3183
- this.opcode('getContext', val.depth || 0);
3184
- this.opcode('pushStringParam', value, val.type);
3185
-
3186
- if (val.type === 'SubExpression') {
3187
- // SubExpressions get evaluated and passed in
3188
- // in string params mode.
3189
- this.accept(val);
3190
- }
3191
- } else {
3192
- if (this.trackIds) {
3193
- var blockParamIndex = undefined;
3194
- if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
3195
- blockParamIndex = this.blockParamIndex(val.parts[0]);
3196
- }
3197
- if (blockParamIndex) {
3198
- var blockParamChild = val.parts.slice(1).join('.');
3199
- this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
3200
- } else {
3201
- value = val.original || value;
3202
- if (value.replace) {
3203
- value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
3204
- }
3205
-
3206
- this.opcode('pushId', val.type, value);
3207
- }
3208
- }
3209
- this.accept(val);
3210
- }
3211
- },
3212
-
3213
- setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
3214
- var params = sexpr.params;
3215
- this.pushParams(params);
3216
-
3217
- this.opcode('pushProgram', program);
3218
- this.opcode('pushProgram', inverse);
3219
-
3220
- if (sexpr.hash) {
3221
- this.accept(sexpr.hash);
3222
- } else {
3223
- this.opcode('emptyHash', omitEmpty);
3224
- }
3225
-
3226
- return params;
3227
- },
3228
-
3229
- blockParamIndex: function blockParamIndex(name) {
3230
- for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
3231
- var blockParams = this.options.blockParams[depth],
3232
- param = blockParams && _utils.indexOf(blockParams, name);
3233
- if (blockParams && param >= 0) {
3234
- return [depth, param];
3235
- }
3236
- }
3237
- }
3238
- };
3239
-
3240
- function precompile(input, options, env) {
3241
- if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3242
- throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
3243
- }
3244
-
3245
- options = options || {};
3246
- if (!('data' in options)) {
3247
- options.data = true;
3248
- }
3249
- if (options.compat) {
3250
- options.useDepths = true;
3251
- }
3252
-
3253
- var ast = env.parse(input, options),
3254
- environment = new env.Compiler().compile(ast, options);
3255
- return new env.JavaScriptCompiler().compile(environment, options);
3256
- }
3257
-
3258
- function compile(input, options, env) {
3259
- if (options === undefined) options = {};
3260
-
3261
- if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3262
- throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
3263
- }
3264
-
3265
- options = _utils.extend({}, options);
3266
- if (!('data' in options)) {
3267
- options.data = true;
3268
- }
3269
- if (options.compat) {
3270
- options.useDepths = true;
3271
- }
3272
-
3273
- var compiled = undefined;
3274
-
3275
- function compileInput() {
3276
- var ast = env.parse(input, options),
3277
- environment = new env.Compiler().compile(ast, options),
3278
- templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
3279
- return env.template(templateSpec);
3280
- }
3281
-
3282
- // Template is only compiled on first use and cached after that point.
3283
- function ret(context, execOptions) {
3284
- if (!compiled) {
3285
- compiled = compileInput();
3286
- }
3287
- return compiled.call(this, context, execOptions);
3288
- }
3289
- ret._setup = function (setupOptions) {
3290
- if (!compiled) {
3291
- compiled = compileInput();
3292
- }
3293
- return compiled._setup(setupOptions);
3294
- };
3295
- ret._child = function (i, data, blockParams, depths) {
3296
- if (!compiled) {
3297
- compiled = compileInput();
3298
- }
3299
- return compiled._child(i, data, blockParams, depths);
3300
- };
3301
- return ret;
3302
- }
3303
-
3304
- function argEquals(a, b) {
3305
- if (a === b) {
3306
- return true;
3307
- }
3308
-
3309
- if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
3310
- for (var i = 0; i < a.length; i++) {
3311
- if (!argEquals(a[i], b[i])) {
3312
- return false;
3313
- }
3314
- }
3315
- return true;
3316
- }
3317
- }
3318
-
3319
- function transformLiteralToPath(sexpr) {
3320
- if (!sexpr.path.parts) {
3321
- var literal = sexpr.path;
3322
- // Casting to string here to make false and 0 literal values play nicely with the rest
3323
- // of the system.
3324
- sexpr.path = {
3325
- type: 'PathExpression',
3326
- data: false,
3327
- depth: 0,
3328
- parts: [literal.original + ''],
3329
- original: literal.original + '',
3330
- loc: literal.loc
3331
- };
3332
- }
3333
- }
3334
-
3335
- var javascriptCompiler = {exports: {}};
3336
-
3337
- var codeGen = {exports: {}};
3338
-
3339
- /* global define, require */
3340
-
3341
- (function (module, exports) {
3342
-
3343
- exports.__esModule = true;
3344
-
3345
- var _utils = utils;
3346
-
3347
- var SourceNode = undefined;
3348
-
3349
- try {
3350
- /* istanbul ignore next */
3351
- {
3352
- // We don't support this in AMD environments. For these environments, we assume that
3353
- // they are running on the browser and thus have no need for the source-map library.
3354
- var SourceMap = require('source-map');
3355
- SourceNode = SourceMap.SourceNode;
3356
- }
3357
- } catch (err) {}
3358
- /* NOP */
3359
-
3360
- /* istanbul ignore if: tested but not covered in istanbul due to dist build */
3361
- if (!SourceNode) {
3362
- SourceNode = function (line, column, srcFile, chunks) {
3363
- this.src = '';
3364
- if (chunks) {
3365
- this.add(chunks);
3366
- }
3367
- };
3368
- /* istanbul ignore next */
3369
- SourceNode.prototype = {
3370
- add: function add(chunks) {
3371
- if (_utils.isArray(chunks)) {
3372
- chunks = chunks.join('');
3373
- }
3374
- this.src += chunks;
3375
- },
3376
- prepend: function prepend(chunks) {
3377
- if (_utils.isArray(chunks)) {
3378
- chunks = chunks.join('');
3379
- }
3380
- this.src = chunks + this.src;
3381
- },
3382
- toStringWithSourceMap: function toStringWithSourceMap() {
3383
- return { code: this.toString() };
3384
- },
3385
- toString: function toString() {
3386
- return this.src;
3387
- }
3388
- };
3389
- }
3390
-
3391
- function castChunk(chunk, codeGen, loc) {
3392
- if (_utils.isArray(chunk)) {
3393
- var ret = [];
3394
-
3395
- for (var i = 0, len = chunk.length; i < len; i++) {
3396
- ret.push(codeGen.wrap(chunk[i], loc));
3397
- }
3398
- return ret;
3399
- } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
3400
- // Handle primitives that the SourceNode will throw up on
3401
- return chunk + '';
3402
- }
3403
- return chunk;
3404
- }
3405
-
3406
- function CodeGen(srcFile) {
3407
- this.srcFile = srcFile;
3408
- this.source = [];
3409
- }
3410
-
3411
- CodeGen.prototype = {
3412
- isEmpty: function isEmpty() {
3413
- return !this.source.length;
3414
- },
3415
- prepend: function prepend(source, loc) {
3416
- this.source.unshift(this.wrap(source, loc));
3417
- },
3418
- push: function push(source, loc) {
3419
- this.source.push(this.wrap(source, loc));
3420
- },
3421
-
3422
- merge: function merge() {
3423
- var source = this.empty();
3424
- this.each(function (line) {
3425
- source.add([' ', line, '\n']);
3426
- });
3427
- return source;
3428
- },
3429
-
3430
- each: function each(iter) {
3431
- for (var i = 0, len = this.source.length; i < len; i++) {
3432
- iter(this.source[i]);
3433
- }
3434
- },
3435
-
3436
- empty: function empty() {
3437
- var loc = this.currentLocation || { start: {} };
3438
- return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
3439
- },
3440
- wrap: function wrap(chunk) {
3441
- var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
3442
-
3443
- if (chunk instanceof SourceNode) {
3444
- return chunk;
3445
- }
3446
-
3447
- chunk = castChunk(chunk, this, loc);
3448
-
3449
- return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
3450
- },
3451
-
3452
- functionCall: function functionCall(fn, type, params) {
3453
- params = this.generateList(params);
3454
- return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
3455
- },
3456
-
3457
- quotedString: function quotedString(str) {
3458
- return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
3459
- .replace(/\u2029/g, '\\u2029') + '"';
3460
- },
3461
-
3462
- objectLiteral: function objectLiteral(obj) {
3463
- // istanbul ignore next
3464
-
3465
- var _this = this;
3466
-
3467
- var pairs = [];
3468
-
3469
- Object.keys(obj).forEach(function (key) {
3470
- var value = castChunk(obj[key], _this);
3471
- if (value !== 'undefined') {
3472
- pairs.push([_this.quotedString(key), ':', value]);
3473
- }
3474
- });
3475
-
3476
- var ret = this.generateList(pairs);
3477
- ret.prepend('{');
3478
- ret.add('}');
3479
- return ret;
3480
- },
3481
-
3482
- generateList: function generateList(entries) {
3483
- var ret = this.empty();
3484
-
3485
- for (var i = 0, len = entries.length; i < len; i++) {
3486
- if (i) {
3487
- ret.add(',');
3488
- }
3489
-
3490
- ret.add(castChunk(entries[i], this));
3491
- }
3492
-
3493
- return ret;
3494
- },
3495
-
3496
- generateArray: function generateArray(entries) {
3497
- var ret = this.generateList(entries);
3498
- ret.prepend('[');
3499
- ret.add(']');
3500
-
3501
- return ret;
3502
- }
3503
- };
3504
-
3505
- exports['default'] = CodeGen;
3506
- module.exports = exports['default'];
3507
-
3508
- }(codeGen, codeGen.exports));
3509
-
3510
- (function (module, exports) {
3511
-
3512
- exports.__esModule = true;
3513
- // istanbul ignore next
3514
-
3515
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
3516
-
3517
- var _base = base$1;
3518
-
3519
- var _exception = exception.exports;
3520
-
3521
- var _exception2 = _interopRequireDefault(_exception);
3522
-
3523
- var _utils = utils;
3524
-
3525
- var _codeGen = codeGen.exports;
3526
-
3527
- var _codeGen2 = _interopRequireDefault(_codeGen);
3528
-
3529
- function Literal(value) {
3530
- this.value = value;
3531
- }
3532
-
3533
- function JavaScriptCompiler() {}
3534
-
3535
- JavaScriptCompiler.prototype = {
3536
- // PUBLIC API: You can override these methods in a subclass to provide
3537
- // alternative compiled forms for name lookup and buffering semantics
3538
- nameLookup: function nameLookup(parent, name /*, type */) {
3539
- return this.internalNameLookup(parent, name);
3540
- },
3541
- depthedLookup: function depthedLookup(name) {
3542
- return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
3543
- },
3544
-
3545
- compilerInfo: function compilerInfo() {
3546
- var revision = _base.COMPILER_REVISION,
3547
- versions = _base.REVISION_CHANGES[revision];
3548
- return [revision, versions];
3549
- },
3550
-
3551
- appendToBuffer: function appendToBuffer(source, location, explicit) {
3552
- // Force a source as this simplifies the merge logic.
3553
- if (!_utils.isArray(source)) {
3554
- source = [source];
3555
- }
3556
- source = this.source.wrap(source, location);
3557
-
3558
- if (this.environment.isSimple) {
3559
- return ['return ', source, ';'];
3560
- } else if (explicit) {
3561
- // This is a case where the buffer operation occurs as a child of another
3562
- // construct, generally braces. We have to explicitly output these buffer
3563
- // operations to ensure that the emitted code goes in the correct location.
3564
- return ['buffer += ', source, ';'];
3565
- } else {
3566
- source.appendToBuffer = true;
3567
- return source;
3568
- }
3569
- },
3570
-
3571
- initializeBuffer: function initializeBuffer() {
3572
- return this.quotedString('');
3573
- },
3574
- // END PUBLIC API
3575
- internalNameLookup: function internalNameLookup(parent, name) {
3576
- this.lookupPropertyFunctionIsUsed = true;
3577
- return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
3578
- },
3579
-
3580
- lookupPropertyFunctionIsUsed: false,
3581
-
3582
- compile: function compile(environment, options, context, asObject) {
3583
- this.environment = environment;
3584
- this.options = options;
3585
- this.stringParams = this.options.stringParams;
3586
- this.trackIds = this.options.trackIds;
3587
- this.precompile = !asObject;
3588
-
3589
- this.name = this.environment.name;
3590
- this.isChild = !!context;
3591
- this.context = context || {
3592
- decorators: [],
3593
- programs: [],
3594
- environments: []
3595
- };
3596
-
3597
- this.preamble();
3598
-
3599
- this.stackSlot = 0;
3600
- this.stackVars = [];
3601
- this.aliases = {};
3602
- this.registers = { list: [] };
3603
- this.hashes = [];
3604
- this.compileStack = [];
3605
- this.inlineStack = [];
3606
- this.blockParams = [];
3607
-
3608
- this.compileChildren(environment, options);
3609
-
3610
- this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
3611
- this.useBlockParams = this.useBlockParams || environment.useBlockParams;
3612
-
3613
- var opcodes = environment.opcodes,
3614
- opcode = undefined,
3615
- firstLoc = undefined,
3616
- i = undefined,
3617
- l = undefined;
3618
-
3619
- for (i = 0, l = opcodes.length; i < l; i++) {
3620
- opcode = opcodes[i];
3621
-
3622
- this.source.currentLocation = opcode.loc;
3623
- firstLoc = firstLoc || opcode.loc;
3624
- this[opcode.opcode].apply(this, opcode.args);
3625
- }
3626
-
3627
- // Flush any trailing content that might be pending.
3628
- this.source.currentLocation = firstLoc;
3629
- this.pushSource('');
3630
-
3631
- /* istanbul ignore next */
3632
- if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
3633
- throw new _exception2['default']('Compile completed with content left on stack');
3634
- }
3635
-
3636
- if (!this.decorators.isEmpty()) {
3637
- this.useDecorators = true;
3638
-
3639
- this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
3640
- this.decorators.push('return fn;');
3641
-
3642
- if (asObject) {
3643
- this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
3644
- } else {
3645
- this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
3646
- this.decorators.push('}\n');
3647
- this.decorators = this.decorators.merge();
3648
- }
3649
- } else {
3650
- this.decorators = undefined;
3651
- }
3652
-
3653
- var fn = this.createFunctionContext(asObject);
3654
- if (!this.isChild) {
3655
- var ret = {
3656
- compiler: this.compilerInfo(),
3657
- main: fn
3658
- };
3659
-
3660
- if (this.decorators) {
3661
- ret.main_d = this.decorators; // eslint-disable-line camelcase
3662
- ret.useDecorators = true;
3663
- }
3664
-
3665
- var _context = this.context;
3666
- var programs = _context.programs;
3667
- var decorators = _context.decorators;
3668
-
3669
- for (i = 0, l = programs.length; i < l; i++) {
3670
- if (programs[i]) {
3671
- ret[i] = programs[i];
3672
- if (decorators[i]) {
3673
- ret[i + '_d'] = decorators[i];
3674
- ret.useDecorators = true;
3675
- }
3676
- }
3677
- }
3678
-
3679
- if (this.environment.usePartial) {
3680
- ret.usePartial = true;
3681
- }
3682
- if (this.options.data) {
3683
- ret.useData = true;
3684
- }
3685
- if (this.useDepths) {
3686
- ret.useDepths = true;
3687
- }
3688
- if (this.useBlockParams) {
3689
- ret.useBlockParams = true;
3690
- }
3691
- if (this.options.compat) {
3692
- ret.compat = true;
3693
- }
3694
-
3695
- if (!asObject) {
3696
- ret.compiler = JSON.stringify(ret.compiler);
3697
-
3698
- this.source.currentLocation = { start: { line: 1, column: 0 } };
3699
- ret = this.objectLiteral(ret);
3700
-
3701
- if (options.srcName) {
3702
- ret = ret.toStringWithSourceMap({ file: options.destName });
3703
- ret.map = ret.map && ret.map.toString();
3704
- } else {
3705
- ret = ret.toString();
3706
- }
3707
- } else {
3708
- ret.compilerOptions = this.options;
3709
- }
3710
-
3711
- return ret;
3712
- } else {
3713
- return fn;
3714
- }
3715
- },
3716
-
3717
- preamble: function preamble() {
3718
- // track the last context pushed into place to allow skipping the
3719
- // getContext opcode when it would be a noop
3720
- this.lastContext = 0;
3721
- this.source = new _codeGen2['default'](this.options.srcName);
3722
- this.decorators = new _codeGen2['default'](this.options.srcName);
3723
- },
3724
-
3725
- createFunctionContext: function createFunctionContext(asObject) {
3726
- // istanbul ignore next
3727
-
3728
- var _this = this;
3729
-
3730
- var varDeclarations = '';
3731
-
3732
- var locals = this.stackVars.concat(this.registers.list);
3733
- if (locals.length > 0) {
3734
- varDeclarations += ', ' + locals.join(', ');
3735
- }
3736
-
3737
- // Generate minimizer alias mappings
3738
- //
3739
- // When using true SourceNodes, this will update all references to the given alias
3740
- // as the source nodes are reused in situ. For the non-source node compilation mode,
3741
- // aliases will not be used, but this case is already being run on the client and
3742
- // we aren't concern about minimizing the template size.
3743
- var aliasCount = 0;
3744
- Object.keys(this.aliases).forEach(function (alias) {
3745
- var node = _this.aliases[alias];
3746
- if (node.children && node.referenceCount > 1) {
3747
- varDeclarations += ', alias' + ++aliasCount + '=' + alias;
3748
- node.children[0] = 'alias' + aliasCount;
3749
- }
3750
- });
3751
-
3752
- if (this.lookupPropertyFunctionIsUsed) {
3753
- varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();
3754
- }
3755
-
3756
- var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
3757
-
3758
- if (this.useBlockParams || this.useDepths) {
3759
- params.push('blockParams');
3760
- }
3761
- if (this.useDepths) {
3762
- params.push('depths');
3763
- }
3764
-
3765
- // Perform a second pass over the output to merge content when possible
3766
- var source = this.mergeSource(varDeclarations);
3767
-
3768
- if (asObject) {
3769
- params.push(source);
3770
-
3771
- return Function.apply(this, params);
3772
- } else {
3773
- return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
3774
- }
3775
- },
3776
- mergeSource: function mergeSource(varDeclarations) {
3777
- var isSimple = this.environment.isSimple,
3778
- appendOnly = !this.forceBuffer,
3779
- appendFirst = undefined,
3780
- sourceSeen = undefined,
3781
- bufferStart = undefined,
3782
- bufferEnd = undefined;
3783
- this.source.each(function (line) {
3784
- if (line.appendToBuffer) {
3785
- if (bufferStart) {
3786
- line.prepend(' + ');
3787
- } else {
3788
- bufferStart = line;
3789
- }
3790
- bufferEnd = line;
3791
- } else {
3792
- if (bufferStart) {
3793
- if (!sourceSeen) {
3794
- appendFirst = true;
3795
- } else {
3796
- bufferStart.prepend('buffer += ');
3797
- }
3798
- bufferEnd.add(';');
3799
- bufferStart = bufferEnd = undefined;
3800
- }
3801
-
3802
- sourceSeen = true;
3803
- if (!isSimple) {
3804
- appendOnly = false;
3805
- }
3806
- }
3807
- });
3808
-
3809
- if (appendOnly) {
3810
- if (bufferStart) {
3811
- bufferStart.prepend('return ');
3812
- bufferEnd.add(';');
3813
- } else if (!sourceSeen) {
3814
- this.source.push('return "";');
3815
- }
3816
- } else {
3817
- varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
3818
-
3819
- if (bufferStart) {
3820
- bufferStart.prepend('return buffer + ');
3821
- bufferEnd.add(';');
3822
- } else {
3823
- this.source.push('return buffer;');
3824
- }
3825
- }
3826
-
3827
- if (varDeclarations) {
3828
- this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
3829
- }
3830
-
3831
- return this.source.merge();
3832
- },
3833
-
3834
- lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
3835
- return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim();
3836
- },
3837
-
3838
- // [blockValue]
3839
- //
3840
- // On stack, before: hash, inverse, program, value
3841
- // On stack, after: return value of blockHelperMissing
3842
- //
3843
- // The purpose of this opcode is to take a block of the form
3844
- // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
3845
- // replace it on the stack with the result of properly
3846
- // invoking blockHelperMissing.
3847
- blockValue: function blockValue(name) {
3848
- var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
3849
- params = [this.contextName(0)];
3850
- this.setupHelperArgs(name, 0, params);
3851
-
3852
- var blockName = this.popStack();
3853
- params.splice(1, 0, blockName);
3854
-
3855
- this.push(this.source.functionCall(blockHelperMissing, 'call', params));
3856
- },
3857
-
3858
- // [ambiguousBlockValue]
3859
- //
3860
- // On stack, before: hash, inverse, program, value
3861
- // Compiler value, before: lastHelper=value of last found helper, if any
3862
- // On stack, after, if no lastHelper: same as [blockValue]
3863
- // On stack, after, if lastHelper: value
3864
- ambiguousBlockValue: function ambiguousBlockValue() {
3865
- // We're being a bit cheeky and reusing the options value from the prior exec
3866
- var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
3867
- params = [this.contextName(0)];
3868
- this.setupHelperArgs('', 0, params, true);
3869
-
3870
- this.flushInline();
3871
-
3872
- var current = this.topStack();
3873
- params.splice(1, 0, current);
3874
-
3875
- this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
3876
- },
3877
-
3878
- // [appendContent]
3879
- //
3880
- // On stack, before: ...
3881
- // On stack, after: ...
3882
- //
3883
- // Appends the string value of `content` to the current buffer
3884
- appendContent: function appendContent(content) {
3885
- if (this.pendingContent) {
3886
- content = this.pendingContent + content;
3887
- } else {
3888
- this.pendingLocation = this.source.currentLocation;
3889
- }
3890
-
3891
- this.pendingContent = content;
3892
- },
3893
-
3894
- // [append]
3895
- //
3896
- // On stack, before: value, ...
3897
- // On stack, after: ...
3898
- //
3899
- // Coerces `value` to a String and appends it to the current buffer.
3900
- //
3901
- // If `value` is truthy, or 0, it is coerced into a string and appended
3902
- // Otherwise, the empty string is appended
3903
- append: function append() {
3904
- if (this.isInline()) {
3905
- this.replaceStack(function (current) {
3906
- return [' != null ? ', current, ' : ""'];
3907
- });
3908
-
3909
- this.pushSource(this.appendToBuffer(this.popStack()));
3910
- } else {
3911
- var local = this.popStack();
3912
- this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
3913
- if (this.environment.isSimple) {
3914
- this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
3915
- }
3916
- }
3917
- },
3918
-
3919
- // [appendEscaped]
3920
- //
3921
- // On stack, before: value, ...
3922
- // On stack, after: ...
3923
- //
3924
- // Escape `value` and append it to the buffer
3925
- appendEscaped: function appendEscaped() {
3926
- this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
3927
- },
3928
-
3929
- // [getContext]
3930
- //
3931
- // On stack, before: ...
3932
- // On stack, after: ...
3933
- // Compiler value, after: lastContext=depth
3934
- //
3935
- // Set the value of the `lastContext` compiler value to the depth
3936
- getContext: function getContext(depth) {
3937
- this.lastContext = depth;
3938
- },
3939
-
3940
- // [pushContext]
3941
- //
3942
- // On stack, before: ...
3943
- // On stack, after: currentContext, ...
3944
- //
3945
- // Pushes the value of the current context onto the stack.
3946
- pushContext: function pushContext() {
3947
- this.pushStackLiteral(this.contextName(this.lastContext));
3948
- },
3949
-
3950
- // [lookupOnContext]
3951
- //
3952
- // On stack, before: ...
3953
- // On stack, after: currentContext[name], ...
3954
- //
3955
- // Looks up the value of `name` on the current context and pushes
3956
- // it onto the stack.
3957
- lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
3958
- var i = 0;
3959
-
3960
- if (!scoped && this.options.compat && !this.lastContext) {
3961
- // The depthed query is expected to handle the undefined logic for the root level that
3962
- // is implemented below, so we evaluate that directly in compat mode
3963
- this.push(this.depthedLookup(parts[i++]));
3964
- } else {
3965
- this.pushContext();
3966
- }
3967
-
3968
- this.resolvePath('context', parts, i, falsy, strict);
3969
- },
3970
-
3971
- // [lookupBlockParam]
3972
- //
3973
- // On stack, before: ...
3974
- // On stack, after: blockParam[name], ...
3975
- //
3976
- // Looks up the value of `parts` on the given block param and pushes
3977
- // it onto the stack.
3978
- lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
3979
- this.useBlockParams = true;
3980
-
3981
- this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
3982
- this.resolvePath('context', parts, 1);
3983
- },
3984
-
3985
- // [lookupData]
3986
- //
3987
- // On stack, before: ...
3988
- // On stack, after: data, ...
3989
- //
3990
- // Push the data lookup operator
3991
- lookupData: function lookupData(depth, parts, strict) {
3992
- if (!depth) {
3993
- this.pushStackLiteral('data');
3994
- } else {
3995
- this.pushStackLiteral('container.data(data, ' + depth + ')');
3996
- }
3997
-
3998
- this.resolvePath('data', parts, 0, true, strict);
3999
- },
4000
-
4001
- resolvePath: function resolvePath(type, parts, i, falsy, strict) {
4002
- // istanbul ignore next
4003
-
4004
- var _this2 = this;
4005
-
4006
- if (this.options.strict || this.options.assumeObjects) {
4007
- this.push(strictLookup(this.options.strict && strict, this, parts, i, type));
4008
- return;
4009
- }
4010
-
4011
- var len = parts.length;
4012
- for (; i < len; i++) {
4013
- /* eslint-disable no-loop-func */
4014
- this.replaceStack(function (current) {
4015
- var lookup = _this2.nameLookup(current, parts[i], type);
4016
- // We want to ensure that zero and false are handled properly if the context (falsy flag)
4017
- // needs to have the special handling for these values.
4018
- if (!falsy) {
4019
- return [' != null ? ', lookup, ' : ', current];
4020
- } else {
4021
- // Otherwise we can use generic falsy handling
4022
- return [' && ', lookup];
4023
- }
4024
- });
4025
- /* eslint-enable no-loop-func */
4026
- }
4027
- },
4028
-
4029
- // [resolvePossibleLambda]
4030
- //
4031
- // On stack, before: value, ...
4032
- // On stack, after: resolved value, ...
4033
- //
4034
- // If the `value` is a lambda, replace it on the stack by
4035
- // the return value of the lambda
4036
- resolvePossibleLambda: function resolvePossibleLambda() {
4037
- this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
4038
- },
4039
-
4040
- // [pushStringParam]
4041
- //
4042
- // On stack, before: ...
4043
- // On stack, after: string, currentContext, ...
4044
- //
4045
- // This opcode is designed for use in string mode, which
4046
- // provides the string value of a parameter along with its
4047
- // depth rather than resolving it immediately.
4048
- pushStringParam: function pushStringParam(string, type) {
4049
- this.pushContext();
4050
- this.pushString(type);
4051
-
4052
- // If it's a subexpression, the string result
4053
- // will be pushed after this opcode.
4054
- if (type !== 'SubExpression') {
4055
- if (typeof string === 'string') {
4056
- this.pushString(string);
4057
- } else {
4058
- this.pushStackLiteral(string);
4059
- }
4060
- }
4061
- },
4062
-
4063
- emptyHash: function emptyHash(omitEmpty) {
4064
- if (this.trackIds) {
4065
- this.push('{}'); // hashIds
4066
- }
4067
- if (this.stringParams) {
4068
- this.push('{}'); // hashContexts
4069
- this.push('{}'); // hashTypes
4070
- }
4071
- this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
4072
- },
4073
- pushHash: function pushHash() {
4074
- if (this.hash) {
4075
- this.hashes.push(this.hash);
4076
- }
4077
- this.hash = { values: {}, types: [], contexts: [], ids: [] };
4078
- },
4079
- popHash: function popHash() {
4080
- var hash = this.hash;
4081
- this.hash = this.hashes.pop();
4082
-
4083
- if (this.trackIds) {
4084
- this.push(this.objectLiteral(hash.ids));
4085
- }
4086
- if (this.stringParams) {
4087
- this.push(this.objectLiteral(hash.contexts));
4088
- this.push(this.objectLiteral(hash.types));
4089
- }
4090
-
4091
- this.push(this.objectLiteral(hash.values));
4092
- },
4093
-
4094
- // [pushString]
4095
- //
4096
- // On stack, before: ...
4097
- // On stack, after: quotedString(string), ...
4098
- //
4099
- // Push a quoted version of `string` onto the stack
4100
- pushString: function pushString(string) {
4101
- this.pushStackLiteral(this.quotedString(string));
4102
- },
4103
-
4104
- // [pushLiteral]
4105
- //
4106
- // On stack, before: ...
4107
- // On stack, after: value, ...
4108
- //
4109
- // Pushes a value onto the stack. This operation prevents
4110
- // the compiler from creating a temporary variable to hold
4111
- // it.
4112
- pushLiteral: function pushLiteral(value) {
4113
- this.pushStackLiteral(value);
4114
- },
4115
-
4116
- // [pushProgram]
4117
- //
4118
- // On stack, before: ...
4119
- // On stack, after: program(guid), ...
4120
- //
4121
- // Push a program expression onto the stack. This takes
4122
- // a compile-time guid and converts it into a runtime-accessible
4123
- // expression.
4124
- pushProgram: function pushProgram(guid) {
4125
- if (guid != null) {
4126
- this.pushStackLiteral(this.programExpression(guid));
4127
- } else {
4128
- this.pushStackLiteral(null);
4129
- }
4130
- },
4131
-
4132
- // [registerDecorator]
4133
- //
4134
- // On stack, before: hash, program, params..., ...
4135
- // On stack, after: ...
4136
- //
4137
- // Pops off the decorator's parameters, invokes the decorator,
4138
- // and inserts the decorator into the decorators list.
4139
- registerDecorator: function registerDecorator(paramSize, name) {
4140
- var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
4141
- options = this.setupHelperArgs(name, paramSize);
4142
-
4143
- this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
4144
- },
4145
-
4146
- // [invokeHelper]
4147
- //
4148
- // On stack, before: hash, inverse, program, params..., ...
4149
- // On stack, after: result of helper invocation
4150
- //
4151
- // Pops off the helper's parameters, invokes the helper,
4152
- // and pushes the helper's return value onto the stack.
4153
- //
4154
- // If the helper is not found, `helperMissing` is called.
4155
- invokeHelper: function invokeHelper(paramSize, name, isSimple) {
4156
- var nonHelper = this.popStack(),
4157
- helper = this.setupHelper(paramSize, name);
4158
-
4159
- var possibleFunctionCalls = [];
4160
-
4161
- if (isSimple) {
4162
- // direct call to helper
4163
- possibleFunctionCalls.push(helper.name);
4164
- }
4165
- // call a function from the input object
4166
- possibleFunctionCalls.push(nonHelper);
4167
- if (!this.options.strict) {
4168
- possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing'));
4169
- }
4170
-
4171
- var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')'];
4172
- var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams);
4173
- this.push(functionCall);
4174
- },
4175
-
4176
- itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
4177
- var result = [];
4178
- result.push(items[0]);
4179
- for (var i = 1; i < items.length; i++) {
4180
- result.push(separator, items[i]);
4181
- }
4182
- return result;
4183
- },
4184
- // [invokeKnownHelper]
4185
- //
4186
- // On stack, before: hash, inverse, program, params..., ...
4187
- // On stack, after: result of helper invocation
4188
- //
4189
- // This operation is used when the helper is known to exist,
4190
- // so a `helperMissing` fallback is not required.
4191
- invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
4192
- var helper = this.setupHelper(paramSize, name);
4193
- this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
4194
- },
4195
-
4196
- // [invokeAmbiguous]
4197
- //
4198
- // On stack, before: hash, inverse, program, params..., ...
4199
- // On stack, after: result of disambiguation
4200
- //
4201
- // This operation is used when an expression like `{{foo}}`
4202
- // is provided, but we don't know at compile-time whether it
4203
- // is a helper or a path.
4204
- //
4205
- // This operation emits more code than the other options,
4206
- // and can be avoided by passing the `knownHelpers` and
4207
- // `knownHelpersOnly` flags at compile-time.
4208
- invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
4209
- this.useRegister('helper');
4210
-
4211
- var nonHelper = this.popStack();
4212
-
4213
- this.emptyHash();
4214
- var helper = this.setupHelper(0, name, helperCall);
4215
-
4216
- var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
4217
-
4218
- var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
4219
- if (!this.options.strict) {
4220
- lookup[0] = '(helper = ';
4221
- lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing'));
4222
- }
4223
-
4224
- this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
4225
- },
4226
-
4227
- // [invokePartial]
4228
- //
4229
- // On stack, before: context, ...
4230
- // On stack after: result of partial invocation
4231
- //
4232
- // This operation pops off a context, invokes a partial with that context,
4233
- // and pushes the result of the invocation back.
4234
- invokePartial: function invokePartial(isDynamic, name, indent) {
4235
- var params = [],
4236
- options = this.setupParams(name, 1, params);
4237
-
4238
- if (isDynamic) {
4239
- name = this.popStack();
4240
- delete options.name;
4241
- }
4242
-
4243
- if (indent) {
4244
- options.indent = JSON.stringify(indent);
4245
- }
4246
- options.helpers = 'helpers';
4247
- options.partials = 'partials';
4248
- options.decorators = 'container.decorators';
4249
-
4250
- if (!isDynamic) {
4251
- params.unshift(this.nameLookup('partials', name, 'partial'));
4252
- } else {
4253
- params.unshift(name);
4254
- }
4255
-
4256
- if (this.options.compat) {
4257
- options.depths = 'depths';
4258
- }
4259
- options = this.objectLiteral(options);
4260
- params.push(options);
4261
-
4262
- this.push(this.source.functionCall('container.invokePartial', '', params));
4263
- },
4264
-
4265
- // [assignToHash]
4266
- //
4267
- // On stack, before: value, ..., hash, ...
4268
- // On stack, after: ..., hash, ...
4269
- //
4270
- // Pops a value off the stack and assigns it to the current hash
4271
- assignToHash: function assignToHash(key) {
4272
- var value = this.popStack(),
4273
- context = undefined,
4274
- type = undefined,
4275
- id = undefined;
4276
-
4277
- if (this.trackIds) {
4278
- id = this.popStack();
4279
- }
4280
- if (this.stringParams) {
4281
- type = this.popStack();
4282
- context = this.popStack();
4283
- }
4284
-
4285
- var hash = this.hash;
4286
- if (context) {
4287
- hash.contexts[key] = context;
4288
- }
4289
- if (type) {
4290
- hash.types[key] = type;
4291
- }
4292
- if (id) {
4293
- hash.ids[key] = id;
4294
- }
4295
- hash.values[key] = value;
4296
- },
4297
-
4298
- pushId: function pushId(type, name, child) {
4299
- if (type === 'BlockParam') {
4300
- this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
4301
- } else if (type === 'PathExpression') {
4302
- this.pushString(name);
4303
- } else if (type === 'SubExpression') {
4304
- this.pushStackLiteral('true');
4305
- } else {
4306
- this.pushStackLiteral('null');
4307
- }
4308
- },
4309
-
4310
- // HELPERS
4311
-
4312
- compiler: JavaScriptCompiler,
4313
-
4314
- compileChildren: function compileChildren(environment, options) {
4315
- var children = environment.children,
4316
- child = undefined,
4317
- compiler = undefined;
4318
-
4319
- for (var i = 0, l = children.length; i < l; i++) {
4320
- child = children[i];
4321
- compiler = new this.compiler(); // eslint-disable-line new-cap
4322
-
4323
- var existing = this.matchExistingProgram(child);
4324
-
4325
- if (existing == null) {
4326
- this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
4327
- var index = this.context.programs.length;
4328
- child.index = index;
4329
- child.name = 'program' + index;
4330
- this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
4331
- this.context.decorators[index] = compiler.decorators;
4332
- this.context.environments[index] = child;
4333
-
4334
- this.useDepths = this.useDepths || compiler.useDepths;
4335
- this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
4336
- child.useDepths = this.useDepths;
4337
- child.useBlockParams = this.useBlockParams;
4338
- } else {
4339
- child.index = existing.index;
4340
- child.name = 'program' + existing.index;
4341
-
4342
- this.useDepths = this.useDepths || existing.useDepths;
4343
- this.useBlockParams = this.useBlockParams || existing.useBlockParams;
4344
- }
4345
- }
4346
- },
4347
- matchExistingProgram: function matchExistingProgram(child) {
4348
- for (var i = 0, len = this.context.environments.length; i < len; i++) {
4349
- var environment = this.context.environments[i];
4350
- if (environment && environment.equals(child)) {
4351
- return environment;
4352
- }
4353
- }
4354
- },
4355
-
4356
- programExpression: function programExpression(guid) {
4357
- var child = this.environment.children[guid],
4358
- programParams = [child.index, 'data', child.blockParams];
4359
-
4360
- if (this.useBlockParams || this.useDepths) {
4361
- programParams.push('blockParams');
4362
- }
4363
- if (this.useDepths) {
4364
- programParams.push('depths');
4365
- }
4366
-
4367
- return 'container.program(' + programParams.join(', ') + ')';
4368
- },
4369
-
4370
- useRegister: function useRegister(name) {
4371
- if (!this.registers[name]) {
4372
- this.registers[name] = true;
4373
- this.registers.list.push(name);
4374
- }
4375
- },
4376
-
4377
- push: function push(expr) {
4378
- if (!(expr instanceof Literal)) {
4379
- expr = this.source.wrap(expr);
4380
- }
4381
-
4382
- this.inlineStack.push(expr);
4383
- return expr;
4384
- },
4385
-
4386
- pushStackLiteral: function pushStackLiteral(item) {
4387
- this.push(new Literal(item));
4388
- },
4389
-
4390
- pushSource: function pushSource(source) {
4391
- if (this.pendingContent) {
4392
- this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
4393
- this.pendingContent = undefined;
4394
- }
4395
-
4396
- if (source) {
4397
- this.source.push(source);
4398
- }
4399
- },
4400
-
4401
- replaceStack: function replaceStack(callback) {
4402
- var prefix = ['('],
4403
- stack = undefined,
4404
- createdStack = undefined,
4405
- usedLiteral = undefined;
4406
-
4407
- /* istanbul ignore next */
4408
- if (!this.isInline()) {
4409
- throw new _exception2['default']('replaceStack on non-inline');
4410
- }
4411
-
4412
- // We want to merge the inline statement into the replacement statement via ','
4413
- var top = this.popStack(true);
4414
-
4415
- if (top instanceof Literal) {
4416
- // Literals do not need to be inlined
4417
- stack = [top.value];
4418
- prefix = ['(', stack];
4419
- usedLiteral = true;
4420
- } else {
4421
- // Get or create the current stack name for use by the inline
4422
- createdStack = true;
4423
- var _name = this.incrStack();
4424
-
4425
- prefix = ['((', this.push(_name), ' = ', top, ')'];
4426
- stack = this.topStack();
4427
- }
4428
-
4429
- var item = callback.call(this, stack);
4430
-
4431
- if (!usedLiteral) {
4432
- this.popStack();
4433
- }
4434
- if (createdStack) {
4435
- this.stackSlot--;
4436
- }
4437
- this.push(prefix.concat(item, ')'));
4438
- },
4439
-
4440
- incrStack: function incrStack() {
4441
- this.stackSlot++;
4442
- if (this.stackSlot > this.stackVars.length) {
4443
- this.stackVars.push('stack' + this.stackSlot);
4444
- }
4445
- return this.topStackName();
4446
- },
4447
- topStackName: function topStackName() {
4448
- return 'stack' + this.stackSlot;
4449
- },
4450
- flushInline: function flushInline() {
4451
- var inlineStack = this.inlineStack;
4452
- this.inlineStack = [];
4453
- for (var i = 0, len = inlineStack.length; i < len; i++) {
4454
- var entry = inlineStack[i];
4455
- /* istanbul ignore if */
4456
- if (entry instanceof Literal) {
4457
- this.compileStack.push(entry);
4458
- } else {
4459
- var stack = this.incrStack();
4460
- this.pushSource([stack, ' = ', entry, ';']);
4461
- this.compileStack.push(stack);
4462
- }
4463
- }
4464
- },
4465
- isInline: function isInline() {
4466
- return this.inlineStack.length;
4467
- },
4468
-
4469
- popStack: function popStack(wrapped) {
4470
- var inline = this.isInline(),
4471
- item = (inline ? this.inlineStack : this.compileStack).pop();
4472
-
4473
- if (!wrapped && item instanceof Literal) {
4474
- return item.value;
4475
- } else {
4476
- if (!inline) {
4477
- /* istanbul ignore next */
4478
- if (!this.stackSlot) {
4479
- throw new _exception2['default']('Invalid stack pop');
4480
- }
4481
- this.stackSlot--;
4482
- }
4483
- return item;
4484
- }
4485
- },
4486
-
4487
- topStack: function topStack() {
4488
- var stack = this.isInline() ? this.inlineStack : this.compileStack,
4489
- item = stack[stack.length - 1];
4490
-
4491
- /* istanbul ignore if */
4492
- if (item instanceof Literal) {
4493
- return item.value;
4494
- } else {
4495
- return item;
4496
- }
4497
- },
4498
-
4499
- contextName: function contextName(context) {
4500
- if (this.useDepths && context) {
4501
- return 'depths[' + context + ']';
4502
- } else {
4503
- return 'depth' + context;
4504
- }
4505
- },
4506
-
4507
- quotedString: function quotedString(str) {
4508
- return this.source.quotedString(str);
4509
- },
4510
-
4511
- objectLiteral: function objectLiteral(obj) {
4512
- return this.source.objectLiteral(obj);
4513
- },
4514
-
4515
- aliasable: function aliasable(name) {
4516
- var ret = this.aliases[name];
4517
- if (ret) {
4518
- ret.referenceCount++;
4519
- return ret;
4520
- }
4521
-
4522
- ret = this.aliases[name] = this.source.wrap(name);
4523
- ret.aliasable = true;
4524
- ret.referenceCount = 1;
4525
-
4526
- return ret;
4527
- },
4528
-
4529
- setupHelper: function setupHelper(paramSize, name, blockHelper) {
4530
- var params = [],
4531
- paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
4532
- var foundHelper = this.nameLookup('helpers', name, 'helper'),
4533
- callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})');
4534
-
4535
- return {
4536
- params: params,
4537
- paramsInit: paramsInit,
4538
- name: foundHelper,
4539
- callParams: [callContext].concat(params)
4540
- };
4541
- },
4542
-
4543
- setupParams: function setupParams(helper, paramSize, params) {
4544
- var options = {},
4545
- contexts = [],
4546
- types = [],
4547
- ids = [],
4548
- objectArgs = !params,
4549
- param = undefined;
4550
-
4551
- if (objectArgs) {
4552
- params = [];
4553
- }
4554
-
4555
- options.name = this.quotedString(helper);
4556
- options.hash = this.popStack();
4557
-
4558
- if (this.trackIds) {
4559
- options.hashIds = this.popStack();
4560
- }
4561
- if (this.stringParams) {
4562
- options.hashTypes = this.popStack();
4563
- options.hashContexts = this.popStack();
4564
- }
4565
-
4566
- var inverse = this.popStack(),
4567
- program = this.popStack();
4568
-
4569
- // Avoid setting fn and inverse if neither are set. This allows
4570
- // helpers to do a check for `if (options.fn)`
4571
- if (program || inverse) {
4572
- options.fn = program || 'container.noop';
4573
- options.inverse = inverse || 'container.noop';
4574
- }
4575
-
4576
- // The parameters go on to the stack in order (making sure that they are evaluated in order)
4577
- // so we need to pop them off the stack in reverse order
4578
- var i = paramSize;
4579
- while (i--) {
4580
- param = this.popStack();
4581
- params[i] = param;
4582
-
4583
- if (this.trackIds) {
4584
- ids[i] = this.popStack();
4585
- }
4586
- if (this.stringParams) {
4587
- types[i] = this.popStack();
4588
- contexts[i] = this.popStack();
4589
- }
4590
- }
4591
-
4592
- if (objectArgs) {
4593
- options.args = this.source.generateArray(params);
4594
- }
4595
-
4596
- if (this.trackIds) {
4597
- options.ids = this.source.generateArray(ids);
4598
- }
4599
- if (this.stringParams) {
4600
- options.types = this.source.generateArray(types);
4601
- options.contexts = this.source.generateArray(contexts);
4602
- }
4603
-
4604
- if (this.options.data) {
4605
- options.data = 'data';
4606
- }
4607
- if (this.useBlockParams) {
4608
- options.blockParams = 'blockParams';
4609
- }
4610
- return options;
4611
- },
4612
-
4613
- setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
4614
- var options = this.setupParams(helper, paramSize, params);
4615
- options.loc = JSON.stringify(this.source.currentLocation);
4616
- options = this.objectLiteral(options);
4617
- if (useRegister) {
4618
- this.useRegister('options');
4619
- params.push('options');
4620
- return ['options=', options];
4621
- } else if (params) {
4622
- params.push(options);
4623
- return '';
4624
- } else {
4625
- return options;
4626
- }
4627
- }
4628
- };
4629
-
4630
- (function () {
4631
- var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');
4632
-
4633
- var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
4634
-
4635
- for (var i = 0, l = reservedWords.length; i < l; i++) {
4636
- compilerWords[reservedWords[i]] = true;
4637
- }
4638
- })();
4639
-
4640
- /**
4641
- * @deprecated May be removed in the next major version
4642
- */
4643
- JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
4644
- return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
4645
- };
4646
-
4647
- function strictLookup(requireTerminal, compiler, parts, i, type) {
4648
- var stack = compiler.popStack(),
4649
- len = parts.length;
4650
- if (requireTerminal) {
4651
- len--;
4652
- }
4653
-
4654
- for (; i < len; i++) {
4655
- stack = compiler.nameLookup(stack, parts[i], type);
4656
- }
4657
-
4658
- if (requireTerminal) {
4659
- return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )'];
4660
- } else {
4661
- return stack;
4662
- }
4663
- }
4664
-
4665
- exports['default'] = JavaScriptCompiler;
4666
- module.exports = exports['default'];
4667
-
4668
- }(javascriptCompiler, javascriptCompiler.exports));
4669
-
4670
- (function (module, exports) {
4671
-
4672
- exports.__esModule = true;
4673
- // istanbul ignore next
4674
-
4675
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4676
-
4677
- var _handlebarsRuntime = handlebars_runtime.exports;
4678
-
4679
- var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
4680
-
4681
- // Compiler imports
4682
-
4683
- var _handlebarsCompilerAst = ast.exports;
4684
-
4685
- var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
4686
-
4687
- var _handlebarsCompilerBase = base;
4688
-
4689
- var _handlebarsCompilerCompiler = compiler;
4690
-
4691
- var _handlebarsCompilerJavascriptCompiler = javascriptCompiler.exports;
4692
-
4693
- var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
4694
-
4695
- var _handlebarsCompilerVisitor = visitor.exports;
4696
-
4697
- var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
4698
-
4699
- var _handlebarsNoConflict = noConflict.exports;
4700
-
4701
- var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
4702
-
4703
- var _create = _handlebarsRuntime2['default'].create;
4704
- function create() {
4705
- var hb = _create();
4706
-
4707
- hb.compile = function (input, options) {
4708
- return _handlebarsCompilerCompiler.compile(input, options, hb);
4709
- };
4710
- hb.precompile = function (input, options) {
4711
- return _handlebarsCompilerCompiler.precompile(input, options, hb);
4712
- };
4713
-
4714
- hb.AST = _handlebarsCompilerAst2['default'];
4715
- hb.Compiler = _handlebarsCompilerCompiler.Compiler;
4716
- hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
4717
- hb.Parser = _handlebarsCompilerBase.parser;
4718
- hb.parse = _handlebarsCompilerBase.parse;
4719
- hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
4720
-
4721
- return hb;
4722
- }
4723
-
4724
- var inst = create();
4725
- inst.create = create;
4726
-
4727
- _handlebarsNoConflict2['default'](inst);
4728
-
4729
- inst.Visitor = _handlebarsCompilerVisitor2['default'];
4730
-
4731
- inst['default'] = inst;
4732
-
4733
- exports['default'] = inst;
4734
- module.exports = exports['default'];
4735
-
4736
- }(handlebars, handlebars.exports));
4737
-
4738
- const Handlebars = /*@__PURE__*/getDefaultExportFromCjs(handlebars.exports);
4739
-
4740
- class Locale {
4741
- constructor(configData) {
4742
- this.rollbackLanguage = 'en';
4743
- this.set = (configData) => {
4744
- this.config = configData;
4745
- };
4746
- this.lang = (element) => {
4747
- this.closestElement = element.closest('[lang]');
4748
- if (this.closestElement) {
4749
- if (this.closestElement.lang) {
4750
- this.language = this.closestElement.lang;
4751
- return this.language;
4752
- }
4753
- }
4754
- this.language = this.rollbackLanguage;
4755
- return this.language;
4756
- };
4757
- this.pluralize = (tag, context) => {
4758
- const languagePhrase = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
4759
- const phrases = [];
4760
- if (Array.isArray(languagePhrase)) {
4761
- phrases.push(languagePhrase[0]);
4762
- phrases.push(languagePhrase[1]);
4763
- }
4764
- else {
4765
- phrases.push(languagePhrase);
4766
- phrases.push(languagePhrase);
4767
- }
4768
- const [defaultPhrase] = phrases;
4769
- let translatePhrase = defaultPhrase;
4770
- const keys = Object.keys(context);
4771
- if (keys.length > 0) {
4772
- const [firstKey] = keys;
4773
- if (typeof context[firstKey] === 'number') {
4774
- if (context[firstKey] !== 1) {
4775
- translatePhrase = phrases[1];
4776
- }
4777
- }
4778
- }
4779
- const template = Handlebars.compile(translatePhrase);
4780
- return template(context);
4781
- };
4782
- this.get = (tag, context) => {
4783
- if (context) {
4784
- return this.pluralize(tag, context);
4785
- }
4786
- return this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
4787
- };
4788
- if (configData) {
4789
- this.set(configData);
4790
- }
4791
- }
4792
- }
4793
-
4794
- export { Locale as L };