@salla.sa/twilight-components 2.14.353 → 2.14.354

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 (311) hide show
  1. package/dist/cjs/bell-ring-BfKPinNo.js +13 -0
  2. package/dist/cjs/{interfaces-CX9-6aLf.js → camera-DytepEoK.js} +0 -11
  3. package/dist/cjs/cancel-De6vslRA.js +13 -0
  4. package/dist/cjs/cart-s-x1Fshk.js +13 -0
  5. package/dist/cjs/check-circle2-BDvlT4_n.js +13 -0
  6. package/dist/cjs/{check-CLRvuniI.js → check-x3w3-gpj.js} +2 -2
  7. package/dist/cjs/{filepond-7SxqaoXb.js → filepond-CuKErtOy.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-file-poster-DwIv84hN.js → filepond-plugin-file-poster-d-8BSuST.js} +1 -1
  9. package/dist/cjs/{filepond-plugin-file-validate-size-NUNnIo4Q.js → filepond-plugin-file-validate-size-zgI_JcqY.js} +1 -1
  10. package/dist/cjs/{filepond-plugin-file-validate-type-CXI-hfww.js → filepond-plugin-file-validate-type-Cy8IgG2P.js} +1 -1
  11. package/dist/cjs/{filepond-plugin-image-edit-fBeBGIBb.js → filepond-plugin-image-edit-9ZAUzCvh.js} +1 -1
  12. package/dist/cjs/{filepond-plugin-image-exif-orientation-BmLTdQ6d.js → filepond-plugin-image-exif-orientation-DzNe_tY2.js} +1 -1
  13. package/dist/cjs/{filepond-plugin-image-preview-CssKRM6n.js → filepond-plugin-image-preview-Cfna6xTB.js} +1 -1
  14. package/dist/{esm/gift-C0JNGIpa.js → cjs/gift-CJ-3Yw_x.js} +4 -2
  15. package/dist/cjs/image-BoZ6Hums.js +13 -0
  16. package/dist/cjs/{index-B5soIVRX.js → index-Ce40E8tZ.js} +136 -12
  17. package/dist/cjs/{index-B9TEdQDE.js → index-ff-xJfhj.js} +1 -1
  18. package/dist/cjs/interfaces-CRqrf5RX.js +15 -0
  19. package/dist/cjs/keyboard_arrow_down-DHJ3FFZq.js +13 -0
  20. package/dist/cjs/keyboard_arrow_right-BayM_Il2.js +21 -0
  21. package/dist/cjs/loader.cjs.js +2 -2
  22. package/dist/cjs/minus-CCryh1qf.js +21 -0
  23. package/dist/cjs/salla-accordion-body_3.cjs.entry.js +775 -0
  24. package/dist/cjs/salla-accordion_6.cjs.entry.js +768 -0
  25. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +2389 -0
  26. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-alert_2.cjs.entry.js +194 -0
  28. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-booking-field_7.cjs.entry.js +1565 -0
  31. package/dist/cjs/{salla-cart-item-offers.cjs.entry.js → salla-cart-item-offers_2.cjs.entry.js} +104 -5
  32. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1661 -0
  33. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  35. package/dist/cjs/salla-count-down_2.cjs.entry.js +302 -0
  36. package/dist/cjs/salla-custom-fields.cjs.entry.js +4 -3
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gifting.cjs.entry.js +488 -0
  40. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +91 -0
  42. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-list-tile.cjs.entry.js +34 -0
  44. package/dist/cjs/salla-localization-modal.cjs.entry.js +137 -0
  45. package/dist/cjs/salla-login-modal.cjs.entry.js +320 -0
  46. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty.cjs.entry.js +211 -0
  49. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +40 -0
  50. package/dist/cjs/salla-menu.cjs.entry.js +139 -0
  51. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +220 -0
  53. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +598 -0
  54. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +69 -0
  55. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-offer-modal.cjs.entry.js +206 -0
  58. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
  63. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-placeholder.cjs.entry.js +51 -0
  67. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-product-size-guide.cjs.entry.js +66 -0
  69. package/dist/cjs/salla-products-list.cjs.entry.js +762 -0
  70. package/dist/cjs/salla-products-slider.cjs.entry.js +115 -0
  71. package/dist/cjs/salla-progress-bar.cjs.entry.js +73 -0
  72. package/dist/cjs/salla-quick-order.cjs.entry.js +239 -0
  73. package/dist/cjs/salla-rating-modal.cjs.entry.js +453 -0
  74. package/dist/cjs/salla-scopes.cjs.entry.js +180 -0
  75. package/dist/cjs/salla-search.cjs.entry.js +153 -0
  76. package/dist/cjs/salla-skeleton.cjs.entry.js +36 -0
  77. package/dist/cjs/salla-slider.cjs.entry.js +10389 -0
  78. package/dist/cjs/salla-social-share.cjs.entry.js +165 -0
  79. package/dist/cjs/salla-social.cjs.entry.js +3 -3
  80. package/dist/cjs/salla-tab-content_3.cjs.entry.js +157 -0
  81. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-user-menu.cjs.entry.js +275 -0
  85. package/dist/cjs/salla-user-profile.cjs.entry.js +145 -0
  86. package/dist/cjs/salla-user-settings.cjs.entry.js +88 -0
  87. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  89. package/dist/cjs/search-c7Aa7lM9.js +13 -0
  90. package/dist/cjs/{special-discount-OVG_9Kf9.js → special-discount-DC2oXurL.js} +0 -8
  91. package/dist/cjs/star-DGcH7Yso.js +13 -0
  92. package/dist/cjs/star2-R146a27p.js +13 -0
  93. package/dist/cjs/twilight.cjs.js +2 -2
  94. package/dist/cjs/{vanilla-picker-C6fk8_TR.js → vanilla-picker-zQsXQIff.js} +1 -1
  95. package/dist/cjs/{whatsapp2-D7Sbg8Ey.js → whatsapp2-BdMd5Gx1.js} +2 -2
  96. package/dist/collection/collection-manifest.json +55 -1
  97. package/dist/collection/components/salla-product-options/salla-product-options.js +36 -3
  98. package/dist/components/index.js +2 -2
  99. package/dist/components/salla-product-options2.js +19 -2
  100. package/dist/esm/bell-ring-D3mWkc-3.js +11 -0
  101. package/dist/esm/{interfaces-CBT_Nxny.js → camera-C6jIkM-X.js} +1 -12
  102. package/dist/esm/cancel-BsLF_HK7.js +11 -0
  103. package/dist/esm/cart-DY4LZmNP.js +11 -0
  104. package/dist/esm/{check-uTyAzPSy.js → check-BsXh13x8.js} +2 -2
  105. package/dist/esm/check-circle2-BV4kqbdL.js +11 -0
  106. package/dist/esm/{filepond-Cuqyleyy.js → filepond-DEzyRrdH.js} +1 -1
  107. package/dist/esm/{filepond-plugin-file-poster-C6Wara8q.js → filepond-plugin-file-poster-DyLcCcHM.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-validate-size-D-M3KSxo.js → filepond-plugin-file-validate-size-Cxp5Yzea.js} +1 -1
  109. package/dist/esm/{filepond-plugin-file-validate-type-DzAl1VI8.js → filepond-plugin-file-validate-type-D2qNOQP4.js} +1 -1
  110. package/dist/esm/{filepond-plugin-image-edit-flutfc9I.js → filepond-plugin-image-edit-DndTlA7m.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-exif-orientation-B2UkG6iE.js → filepond-plugin-image-exif-orientation-CiT1CQoK.js} +1 -1
  112. package/dist/esm/{filepond-plugin-image-preview-B4u8N2nE.js → filepond-plugin-image-preview-DBG7keFZ.js} +1 -1
  113. package/dist/{cjs/gift-BPDUPIY_.js → esm/gift-BChI23pG.js} +2 -4
  114. package/dist/esm/image-C-tzSDxw.js +11 -0
  115. package/dist/esm/{index-6mr785rH.js → index-B74h9G6a.js} +137 -13
  116. package/dist/esm/{index-xWIb6INF.js → index-BLw7mdtM.js} +1 -1
  117. package/dist/esm/interfaces-OF8QcbMM.js +15 -0
  118. package/dist/esm/keyboard_arrow_down-DCZbpt2a.js +11 -0
  119. package/dist/esm/keyboard_arrow_right-Vqpj4CWE.js +18 -0
  120. package/dist/esm/loader.js +3 -3
  121. package/dist/esm/minus-DfeagqF1.js +18 -0
  122. package/dist/esm/salla-accordion-body_3.entry.js +771 -0
  123. package/dist/esm/salla-accordion_6.entry.js +761 -0
  124. package/dist/esm/salla-add-product-button_4.entry.js +2384 -0
  125. package/dist/esm/salla-advertisement.entry.js +1 -1
  126. package/dist/esm/salla-alert_2.entry.js +191 -0
  127. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  128. package/dist/esm/salla-apps-icons.entry.js +1 -1
  129. package/dist/esm/salla-booking-field_7.entry.js +1539 -0
  130. package/dist/esm/{salla-cart-item-offers.entry.js → salla-cart-item-offers_2.entry.js} +104 -6
  131. package/dist/esm/salla-comment-form_8.entry.js +1652 -0
  132. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  133. package/dist/esm/salla-contacts.entry.js +3 -3
  134. package/dist/esm/salla-count-down_2.entry.js +299 -0
  135. package/dist/esm/salla-custom-fields.entry.js +3 -2
  136. package/dist/esm/salla-filters-widget.entry.js +1 -1
  137. package/dist/esm/salla-filters.entry.js +1 -1
  138. package/dist/esm/salla-gifting.entry.js +486 -0
  139. package/dist/esm/salla-hook.entry.js +1 -1
  140. package/dist/esm/salla-infinite-scroll.entry.js +89 -0
  141. package/dist/esm/salla-installment.entry.js +1 -1
  142. package/dist/esm/salla-list-tile.entry.js +32 -0
  143. package/dist/esm/salla-localization-modal.entry.js +135 -0
  144. package/dist/esm/salla-login-modal.entry.js +318 -0
  145. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  146. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  147. package/dist/esm/salla-loyalty.entry.js +209 -0
  148. package/dist/esm/salla-maintenance-alert.entry.js +38 -0
  149. package/dist/esm/salla-menu.entry.js +137 -0
  150. package/dist/esm/salla-metadata.entry.js +1 -1
  151. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +217 -0
  152. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +595 -0
  153. package/dist/esm/salla-multiple-bundle-product.entry.js +67 -0
  154. package/dist/esm/salla-notification-item.entry.js +1 -1
  155. package/dist/esm/salla-notifications.entry.js +1 -1
  156. package/dist/esm/salla-offer-modal.entry.js +204 -0
  157. package/dist/esm/salla-offer.entry.js +1 -1
  158. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  159. package/dist/esm/salla-order-details-options.entry.js +1 -1
  160. package/dist/esm/salla-order-details.entry.js +1 -1
  161. package/dist/esm/salla-order-summary.entry.js +3 -3
  162. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  163. package/dist/esm/salla-orders.entry.js +1 -1
  164. package/dist/esm/salla-payments.entry.js +1 -1
  165. package/dist/esm/salla-placeholder.entry.js +49 -0
  166. package/dist/esm/salla-price-range.entry.js +1 -1
  167. package/dist/esm/salla-product-size-guide.entry.js +64 -0
  168. package/dist/esm/salla-products-list.entry.js +760 -0
  169. package/dist/esm/salla-products-slider.entry.js +113 -0
  170. package/dist/esm/salla-progress-bar.entry.js +71 -0
  171. package/dist/esm/salla-quick-order.entry.js +237 -0
  172. package/dist/esm/salla-rating-modal.entry.js +451 -0
  173. package/dist/esm/salla-scopes.entry.js +178 -0
  174. package/dist/esm/salla-search.entry.js +151 -0
  175. package/dist/esm/salla-skeleton.entry.js +34 -0
  176. package/dist/esm/salla-slider.entry.js +10387 -0
  177. package/dist/esm/salla-social-share.entry.js +163 -0
  178. package/dist/esm/salla-social.entry.js +2 -2
  179. package/dist/esm/salla-tab-content_3.entry.js +153 -0
  180. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  181. package/dist/esm/salla-tooltip.entry.js +1 -1
  182. package/dist/esm/salla-trust-badges.entry.js +1 -1
  183. package/dist/esm/salla-user-menu.entry.js +273 -0
  184. package/dist/esm/salla-user-profile.entry.js +143 -0
  185. package/dist/esm/salla-user-settings.entry.js +86 -0
  186. package/dist/esm/salla-verify.entry.js +1 -1
  187. package/dist/esm/salla-wallet.entry.js +1 -1
  188. package/dist/esm/search-BscTeWDc.js +11 -0
  189. package/dist/esm/{special-discount-yRO-ZESF.js → special-discount-Ctkfc4K-.js} +1 -8
  190. package/dist/esm/star-ZT7ehBBk.js +11 -0
  191. package/dist/esm/star2-D4oPi1Ov.js +11 -0
  192. package/dist/esm/twilight.js +3 -3
  193. package/dist/esm/{vanilla-picker-B4PKRAhm.js → vanilla-picker-CtwkXTap.js} +1 -1
  194. package/dist/esm/{whatsapp2-DWksgowB.js → whatsapp2-CgR-T_ZS.js} +2 -2
  195. package/dist/twilight/{p-2a26c1d6.entry.js → p-0134b4fd.entry.js} +1 -1
  196. package/dist/twilight/{p-d4aaeef4.entry.js → p-01daaaa6.entry.js} +1 -1
  197. package/dist/twilight/p-07da7390.entry.js +4 -0
  198. package/dist/twilight/{p-81702ecb.entry.js → p-08badc32.entry.js} +1 -1
  199. package/dist/twilight/{p-4bc98557.entry.js → p-0aa5a12a.entry.js} +1 -1
  200. package/dist/twilight/{p-6f576591.entry.js → p-10dcd981.entry.js} +1 -1
  201. package/dist/twilight/{p-5067322a.entry.js → p-212a0710.entry.js} +1 -1
  202. package/dist/twilight/p-229275db.entry.js +4 -0
  203. package/dist/twilight/{p-dde21f4b.entry.js → p-232185ec.entry.js} +1 -1
  204. package/dist/twilight/{p-12e49031.entry.js → p-2a927eac.entry.js} +1 -1
  205. package/dist/twilight/p-2d880232.entry.js +4 -0
  206. package/dist/twilight/p-2de9df64.entry.js +4 -0
  207. package/dist/twilight/p-309a0ba4.entry.js +4 -0
  208. package/dist/twilight/{p-e909d28b.entry.js → p-32732ca7.entry.js} +1 -1
  209. package/dist/twilight/{p-19e07b9e.entry.js → p-32ca34ec.entry.js} +1 -1
  210. package/dist/twilight/{p-9946fa76.entry.js → p-33093880.entry.js} +1 -1
  211. package/dist/twilight/p-3cffa4c9.entry.js +4 -0
  212. package/dist/twilight/p-3d0bb451.entry.js +4 -0
  213. package/dist/twilight/p-3e0d814c.entry.js +4 -0
  214. package/dist/twilight/p-4036d5dc.entry.js +4 -0
  215. package/dist/twilight/p-40fe4b01.entry.js +4 -0
  216. package/dist/twilight/p-47ac0ca5.entry.js +4 -0
  217. package/dist/twilight/{p-5bf05092.entry.js → p-4cd9da44.entry.js} +1 -1
  218. package/dist/twilight/p-5c9281d3.entry.js +4 -0
  219. package/dist/twilight/p-5d044466.entry.js +4 -0
  220. package/dist/twilight/p-5d21334a.entry.js +4 -0
  221. package/dist/twilight/{p-c096e336.entry.js → p-654429df.entry.js} +1 -1
  222. package/dist/twilight/p-6b8453be.entry.js +4 -0
  223. package/dist/twilight/p-6be7bbb0.entry.js +4 -0
  224. package/dist/twilight/{p-4253fc44.entry.js → p-6c8f5c94.entry.js} +1 -1
  225. package/dist/twilight/{p-6f5d02c6.entry.js → p-6fa02770.entry.js} +1 -1
  226. package/dist/twilight/p-7040ea33.entry.js +4 -0
  227. package/dist/twilight/p-8c189d76.entry.js +4 -0
  228. package/dist/twilight/p-8f1f052c.entry.js +4 -0
  229. package/dist/twilight/{p-ac6fc286.entry.js → p-9051a540.entry.js} +1 -1
  230. package/dist/twilight/p-9f1c561f.entry.js +4 -0
  231. package/dist/twilight/{p-B2SkkGH8.js → p-B69XOH6h.js} +1 -1
  232. package/dist/twilight/{p-6mr785rH.js → p-B74h9G6a.js} +2 -2
  233. package/dist/twilight/{p-C0JNGIpa.js → p-BChI23pG.js} +1 -1
  234. package/dist/twilight/{p-C_h1JDCU.js → p-BCxm-ISm.js} +1 -1
  235. package/dist/twilight/{p-Bp_xKTyn.js → p-BPqZ249Z.js} +1 -1
  236. package/dist/twilight/p-BV4kqbdL.js +4 -0
  237. package/dist/twilight/p-BsLF_HK7.js +4 -0
  238. package/dist/twilight/{p-uTyAzPSy.js → p-BsXh13x8.js} +1 -1
  239. package/dist/twilight/p-BscTeWDc.js +4 -0
  240. package/dist/twilight/p-C-tzSDxw.js +4 -0
  241. package/dist/twilight/p-C6jIkM-X.js +4 -0
  242. package/dist/twilight/p-CO-PeZ27.js +4 -0
  243. package/dist/twilight/{p-ChfiVIJv.js → p-CQq81yb5.js} +1 -1
  244. package/dist/twilight/{p-DWksgowB.js → p-CgR-T_ZS.js} +1 -1
  245. package/dist/twilight/p-Ctkfc4K-.js +4 -0
  246. package/dist/twilight/p-D3mWkc-3.js +4 -0
  247. package/dist/twilight/p-D4oPi1Ov.js +4 -0
  248. package/dist/twilight/p-DCZbpt2a.js +4 -0
  249. package/dist/twilight/p-DY4LZmNP.js +4 -0
  250. package/dist/twilight/p-DfeagqF1.js +4 -0
  251. package/dist/twilight/{p-Cuxsz9f-.js → p-DpsbV3x1.js} +1 -1
  252. package/dist/twilight/p-OF8QcbMM.js +4 -0
  253. package/dist/twilight/p-Vqpj4CWE.js +4 -0
  254. package/dist/twilight/p-ZT7ehBBk.js +4 -0
  255. package/dist/twilight/{p-tFBCbVoG.js → p-_-aXm0Wb.js} +1 -1
  256. package/dist/twilight/p-a100bd38.entry.js +4 -0
  257. package/dist/twilight/{p-0c87ef6c.entry.js → p-a2756650.entry.js} +1 -1
  258. package/dist/twilight/{p-8b018d82.entry.js → p-aab45a16.entry.js} +1 -1
  259. package/dist/twilight/p-aae761ff.entry.js +4 -0
  260. package/dist/twilight/p-afd61e47.entry.js +4 -0
  261. package/dist/twilight/p-b1fc6dfc.entry.js +4 -0
  262. package/dist/twilight/p-b206a0a1.entry.js +4 -0
  263. package/dist/twilight/p-b2332516.entry.js +4 -0
  264. package/dist/twilight/{p-18ebec2c.entry.js → p-b588ef46.entry.js} +1 -1
  265. package/dist/twilight/p-b71fc1b5.entry.js +4 -0
  266. package/dist/twilight/{p-zHj-W7EE.js → p-bVqtOl1F.js} +1 -1
  267. package/dist/twilight/{p-300624bb.entry.js → p-bf65b263.entry.js} +1 -1
  268. package/dist/twilight/{p-33ea3141.entry.js → p-c56a47b0.entry.js} +1 -1
  269. package/dist/twilight/p-c73189e3.entry.js +4 -0
  270. package/dist/twilight/p-d1203242.entry.js +4 -0
  271. package/dist/twilight/p-d4edfed4.entry.js +4 -0
  272. package/dist/twilight/{p-6472200c.entry.js → p-d86ce978.entry.js} +1 -1
  273. package/dist/twilight/{p-fa585081.entry.js → p-d9e7973d.entry.js} +1 -1
  274. package/dist/twilight/p-e3e33238.entry.js +4 -0
  275. package/dist/twilight/p-e6bb7362.entry.js +4 -0
  276. package/dist/twilight/{p-28900b2e.entry.js → p-e7813c80.entry.js} +1 -1
  277. package/dist/twilight/p-ec2fd37e.entry.js +4 -0
  278. package/dist/twilight/{p-b60db6c8.entry.js → p-ec77c523.entry.js} +1 -1
  279. package/dist/twilight/{p-8c7b7712.entry.js → p-efc18ce6.entry.js} +1 -1
  280. package/dist/twilight/p-f4039c40.entry.js +4 -0
  281. package/dist/twilight/p-f47b130c.entry.js +4 -0
  282. package/dist/twilight/{p-7e39343d.entry.js → p-f57ca123.entry.js} +1 -1
  283. package/dist/twilight/{p-2d209f96.entry.js → p-f5ad6572.entry.js} +1 -1
  284. package/dist/twilight/p-fc65084f.entry.js +4 -0
  285. package/dist/twilight/p-fd81a311.entry.js +4 -0
  286. package/dist/twilight/{p-16b8d78c.entry.js → p-fe983809.entry.js} +1 -1
  287. package/dist/twilight/{p-BijadG7g.js → p-i5J7XGS6.js} +1 -1
  288. package/dist/twilight/{p-DnELO4MH.js → p-shFpk0H3.js} +1 -1
  289. package/dist/twilight/twilight.esm.js +1 -1
  290. package/dist/types/components/salla-product-options/salla-product-options.d.ts +8 -1
  291. package/dist/types/components.d.ts +4 -0
  292. package/package.json +5 -5
  293. package/dist/cjs/salla-accordion_62.cjs.entry.js +0 -22470
  294. package/dist/cjs/salla-review-card.cjs.entry.js +0 -183
  295. package/dist/cjs/salla-reviews-page.cjs.entry.js +0 -695
  296. package/dist/cjs/salla-reviews.cjs.entry.js +0 -106
  297. package/dist/esm/salla-accordion_62.entry.js +0 -22389
  298. package/dist/esm/salla-review-card.entry.js +0 -181
  299. package/dist/esm/salla-reviews-page.entry.js +0 -693
  300. package/dist/esm/salla-reviews.entry.js +0 -104
  301. package/dist/twilight/p-67830f2a.entry.js +0 -4
  302. package/dist/twilight/p-751dddd4.entry.js +0 -4
  303. package/dist/twilight/p-9b22a7eb.entry.js +0 -4
  304. package/dist/twilight/p-CBT_Nxny.js +0 -4
  305. package/dist/twilight/p-Dz7o69vX.js +0 -4
  306. package/dist/twilight/p-a515a8cc.entry.js +0 -4
  307. package/dist/twilight/p-c4821f8b.entry.js +0 -4
  308. package/dist/twilight/p-de807340.entry.js +0 -4
  309. package/dist/twilight/p-yRO-ZESF.js +0 -4
  310. package/dist/cjs/{twitter-pOrUNjXi.js → facebook-DbXua6B9.js} +2 -2
  311. package/dist/esm/{twitter-Dz7o69vX.js → facebook-CO-PeZ27.js} +2 -2
@@ -0,0 +1,1539 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-B74h9G6a.js';
5
+ import { A as ArrowDown } from './keyboard_arrow_down-DCZbpt2a.js';
6
+ import { p as plusIcon, m as minusIcon } from './minus-DfeagqF1.js';
7
+ import { H as Helper } from './Helper-B5RLi6Xo.js';
8
+ import './anime.es-CgtvEd63.js';
9
+
10
+ var BookingTime = `<!-- Generated by IcoMoon.io -->
11
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
12
+ <title>calendar-time</title>
13
+ <path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>
14
+ </svg>
15
+ `;
16
+
17
+ var Calendar = `<!-- Generated by IcoMoon.io -->
18
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
19
+ <title>calendar</title>
20
+ <path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>
21
+ </svg>
22
+ `;
23
+
24
+ var TimeIcon = `<!-- Generated by IcoMoon.io -->
25
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
26
+ <title>time</title>
27
+ <path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>
28
+ </svg>
29
+ `;
30
+
31
+ const sallaBookingFieldCss = ":host{display:block}";
32
+
33
+ const SallaBookingField = class {
34
+ constructor(hostRef) {
35
+ registerInstance(this, hostRef);
36
+ this.invalidInput = createEvent(this, "invalidInput");
37
+ this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');
38
+ this.editLabel = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');
39
+ this.bookedLabel = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');
40
+ this.selectDate = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');
41
+ this.bookingUrl = '';
42
+ this.iframeReady = false;
43
+ this.reservations = [];
44
+ // Load translations
45
+ salla.lang.onLoaded(() => this.setTranslations());
46
+ // Register event listeners
47
+ Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));
48
+ }
49
+ async setTranslations() {
50
+ const setNestedAsync = (lang, key, value) => {
51
+ return new Promise((resolve) => {
52
+ salla.helpers.setNested(salla.lang.messages[lang], key, value);
53
+ resolve(true);
54
+ });
55
+ };
56
+ await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');
57
+ await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');
58
+ await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');
59
+ await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');
60
+ await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');
61
+ await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');
62
+ await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');
63
+ await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');
64
+ this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');
65
+ this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');
66
+ this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');
67
+ this.selectDate = salla.lang.get('pages.cart.select_appointment_date');
68
+ }
69
+ openBookingModal(event, afterReload = false) {
70
+ if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {
71
+ return;
72
+ }
73
+ if (salla.config.isGuest()) {
74
+ this.setAfterReloadEvent('booking::open-after-reload', this.productId);
75
+ salla.event.dispatch('login::open');
76
+ return;
77
+ }
78
+ salla.booking.add(this.productId, false)
79
+ .then((resp) => {
80
+ if (resp.data.redirect.to !== 'booking') {
81
+ throw new Error('Unexpected redirect!');
82
+ }
83
+ salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });
84
+ })
85
+ .catch((error) => {
86
+ salla.error(salla.lang.get('common.errors.error_occurred'));
87
+ salla.logger.error(error.response || error);
88
+ });
89
+ }
90
+ handleBookingOpen(data) {
91
+ if (data.id !== this.productId)
92
+ return;
93
+ this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);
94
+ this.iframeReady = true;
95
+ setTimeout(() => {
96
+ this.modal.setTitle(this.selectDate);
97
+ this.modal.open();
98
+ }, 100);
99
+ }
100
+ setAfterReloadEvent(event, payload) {
101
+ salla.storage.set('afterReloadEvent', { event, payload });
102
+ }
103
+ emitAfterReloadEvent() {
104
+ const eventDetails = salla.storage.get('afterReloadEvent');
105
+ if (eventDetails && eventDetails.event) {
106
+ const customEvent = new CustomEvent(eventDetails.event, {
107
+ detail: eventDetails.payload
108
+ });
109
+ window.dispatchEvent(customEvent);
110
+ salla.storage.remove('afterReloadEvent');
111
+ }
112
+ }
113
+ componentWillLoad() {
114
+ if (this.option && this.option.details.length) {
115
+ this.reservations = this.option.details;
116
+ }
117
+ }
118
+ componentDidLoad() {
119
+ window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));
120
+ this.emitAfterReloadEvent();
121
+ window.addEventListener('message', this.handleMessageEvent.bind(this));
122
+ this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));
123
+ this.reservationsInput.addEventListener('input', () => {
124
+ this.reservationsInput.setCustomValidity('');
125
+ this.reservationsInput.reportValidity();
126
+ });
127
+ }
128
+ handleMessageEvent(event) {
129
+ if (event.data.source !== 'booking')
130
+ return;
131
+ const action = event.data.type;
132
+ const value = event.data.message;
133
+ if (localStorage.getItem('debug'))
134
+ console.log(`Received an action:${action}`, event.data);
135
+ if (action === 'error') {
136
+ if (value.fields?.reservation) {
137
+ salla.notify.error(value.fields.reservation[0]);
138
+ return;
139
+ }
140
+ const errorList = Object.values(value.fields || [value.message]).flat().map(error => `<li>${error}</li>`).join('');
141
+ salla.notify.error(`<ul>${errorList}</ul>`);
142
+ }
143
+ if (action === 'success') {
144
+ if (Number(value.productId) !== Number(this.productId))
145
+ return;
146
+ this.reservations = value.data.reservations.map(schedule => {
147
+ if (schedule.time && schedule.time.length > 0) {
148
+ const timeSlot = schedule.time[0];
149
+ return {
150
+ date: schedule.date,
151
+ day: schedule.day,
152
+ from_timestamp: timeSlot.from,
153
+ to_timestamp: timeSlot.to,
154
+ };
155
+ }
156
+ return null;
157
+ }).filter(item => item !== null);
158
+ salla.notify.success(this.bookedLabel);
159
+ this.modal?.close();
160
+ setTimeout(() => window.location.reload());
161
+ }
162
+ if (action === 'height') {
163
+ this.iframe.height = value?.height + 'px';
164
+ }
165
+ }
166
+ bookingModal() {
167
+ return (h("salla-modal", { class: "s-booking-field-modal", ref: modal => (this.modal = modal), width: "md", position: "middle", noPadding: true }, h("iframe", { ref: iframe => (this.iframe = iframe), src: this.bookingUrl, frameborder: "0" })));
168
+ }
169
+ renderReservationDate(reservation) {
170
+ return (h("span", { class: reservation.from_timestamp ? 's-booking-field-reservations-has-time' : '' }, h("i", { class: "s-booking-field-reservations-icon", innerHTML: Calendar }), reservation.date));
171
+ }
172
+ renderReservationTime(reservation) {
173
+ if (!reservation.from_timestamp)
174
+ return '';
175
+ return (h("span", { class: "s-booking-field-reservations-time" }, h("i", { class: "s-booking-field-reservations-icon", innerHTML: TimeIcon }), h("span", null, reservation.from_timestamp, " - ", reservation.to_timestamp)));
176
+ }
177
+ render() {
178
+ return (h(Host, { key: '04c9e3dc3dc825bd6905221d858c260f7ca34748' }, h("div", { key: '07ec38cec1bd1798640dd7ea9592bb3b17d945c6', class: "s-booking-field-main" }, this.option.required || this.reservations.length > 0 ? h("div", { class: "s-booking-field-price" }, h("span", { innerHTML: salla.money(this.option.price) })) : '', h("salla-button", { key: '6b71889cfc0429d15c466a6f194df31549f09786', class: "s-booking-field-book-now", size: "small", loaderPosition: "center", fill: "outline", onClick: event => this.openBookingModal(event, false) }, h("span", { key: 'a16f8db6f52c7751ea605efcae04057ca0dc5b61', class: "s-booking-field-book-now-content" }, h("span", { key: '95f6086a599bcc620c87ece6c6ae9620dba15581', innerHTML: BookingTime }), this.reservations.length ? this.editLabel : this.bookNowLabel))), this.reservations.length > 0 && (h("div", { key: 'b3615100bbfff3d98d0ac99145aaf53449790c94', class: "s-booking-field-reservations" }, this.reservations.map((reservation, index) => (h("div", { key: index, class: "s-booking-field-reservations-item" }, this.renderReservationDate(reservation), this.renderReservationTime(reservation)))))), h("input", { key: '126f14f2e520b8696bc7450e209bad30b267878b', class: "s-hidden", name: this.option.name, required: this.option.required, value: JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations), ref: reservations => this.reservationsInput = reservations }), this.iframeReady && this.bookingModal()));
179
+ }
180
+ get host() { return getElement(this); }
181
+ };
182
+ SallaBookingField.style = sallaBookingFieldCss;
183
+
184
+ const sallaColorPickerCss = "";
185
+
186
+ const SallaColorPicker = class {
187
+ constructor(hostRef) {
188
+ registerInstance(this, hostRef);
189
+ this.colorChanged = createEvent(this, "colorChanged");
190
+ this.invalidInput = createEvent(this, "invalidInput");
191
+ this.submitted = createEvent(this, "submitted");
192
+ this.popupOpened = createEvent(this, "popupOpened");
193
+ this.popupClosed = createEvent(this, "popupClosed");
194
+ /** Lazy-loaded to avoid bundling vanilla-picker (Babel polyfills) into main/hydrate bundle. */
195
+ this.picker = null;
196
+ this.pickerReady = null;
197
+ /**
198
+ * File input name for the native formData
199
+ */
200
+ this.name = 'color';
201
+ /**
202
+ * Set if the color picker input is required or not
203
+ */
204
+ this.required = false;
205
+ /**
206
+ * How to display the selected color in the text field
207
+ * (the text field still supports input in any format).
208
+ */
209
+ this.format = 'hex';
210
+ /**
211
+ * Whether to have a "Cancel" button which closes the popup.
212
+ */
213
+ this.showCancelButton = false;
214
+ /**
215
+ * Whether to show a text field for color value editing.
216
+ */
217
+ this.showTextField = true;
218
+ /**
219
+ * Whether to enable adjusting the alpha channel.
220
+ */
221
+ this.enableAlpha = false;
222
+ this.updateViewportCache = () => {
223
+ this.cachedViewportWidth = this.getViewportWidthFromBreakpoints();
224
+ };
225
+ this.cachedViewportWidth = 0; // Will be populated in componentDidLoad via requestAnimationFrame
226
+ }
227
+ colorChangeHandler(color) {
228
+ if (this.colorInput)
229
+ this.colorInput.value = color.hex;
230
+ this.colorChanged.emit(color);
231
+ }
232
+ async submittedHandler(color) {
233
+ await this.setColorValue(color.rgbaString, true);
234
+ if (this.canvas)
235
+ this.canvas.style.backgroundColor = color.rgbString;
236
+ if (this.colorInput) {
237
+ this.colorInput.value = color.hex;
238
+ this.colorInput.dispatchEvent(new window.Event('change', { bubbles: true }));
239
+ }
240
+ this.submitted.emit(color);
241
+ }
242
+ popupOpenedHandler(color) {
243
+ // Double rAF: defer setPopInPosition (getBoundingClientRect) until after paint to avoid forced reflow
244
+ requestAnimationFrame(() => {
245
+ requestAnimationFrame(() => this.setPopInPosition());
246
+ });
247
+ this.popupOpened.emit(color);
248
+ }
249
+ popupClosedHandler(color) {
250
+ this.popupClosed.emit(color);
251
+ }
252
+ /** Methods */
253
+ async ensurePicker() {
254
+ if (this.picker)
255
+ return this.picker;
256
+ if (this.pickerReady)
257
+ return await this.pickerReady;
258
+ throw new Error('Color picker not initialized');
259
+ }
260
+ /**
261
+ * Set the picker options.
262
+ *
263
+ * (Usually a new .parent and .color).
264
+ * @param {Object} options
265
+ */
266
+ async setPickerOption(options) {
267
+ const picker = await this.ensurePicker();
268
+ picker.setOptions(options);
269
+ }
270
+ /**
271
+ * Move the popup to a different parent, optionally opening it at the same time.
272
+ *
273
+ * (Usually a new .parent and .color).
274
+ * @param {Options} option
275
+ *
276
+ * Whether to open the popup immediately.
277
+ * @param {boolean} openImmediately
278
+ */
279
+ async movePopUp(options, openImmediately) {
280
+ const picker = await this.ensurePicker();
281
+ picker.movePopup(options, openImmediately);
282
+ }
283
+ /**
284
+ * Set/initialize the picker's color.
285
+ *
286
+ * Color name, RGBA/HSLA/HEX string, or RGBA array.
287
+ * @param {string} color
288
+ *
289
+ * If true, won't trigger onChange.
290
+ * @param {boolean} triggerEvent
291
+ */
292
+ async setColorValue(color, triggerEvent) {
293
+ const picker = await this.ensurePicker();
294
+ picker.setColor(color, triggerEvent);
295
+ }
296
+ /**
297
+ * Show/open the picker.
298
+ */
299
+ async openPicker() {
300
+ const picker = await this.ensurePicker();
301
+ picker.show();
302
+ }
303
+ /**
304
+ * Close/Hide the picker.
305
+ */
306
+ async closePicker() {
307
+ const picker = await this.ensurePicker();
308
+ picker.hide();
309
+ }
310
+ /**
311
+ * Release all resources used by this picker instance.
312
+ */
313
+ async destroyPicker() {
314
+ const picker = await this.ensurePicker();
315
+ picker.destroy();
316
+ this.picker = null;
317
+ this.pickerReady = null;
318
+ }
319
+ disconnectedCallback() {
320
+ window.removeEventListener('resize', this.updateViewportCache);
321
+ }
322
+ componentWillLoad() {
323
+ salla.onReady(() => {
324
+ this.color = this.color ? this.color : salla.config.get('theme.color.primary', '#5dd5c4');
325
+ });
326
+ }
327
+ /**
328
+ * Returns viewport width from matchMedia breakpoints (no layout read).
329
+ * Must match updateViewportCache breakpoints for consistency.
330
+ */
331
+ getViewportWidthFromBreakpoints() {
332
+ if (typeof window === 'undefined')
333
+ return 1024;
334
+ if (window.matchMedia('(min-width: 1200px)').matches)
335
+ return 1200;
336
+ if (window.matchMedia('(min-width: 992px)').matches)
337
+ return 992;
338
+ if (window.matchMedia('(min-width: 768px)').matches)
339
+ return 768;
340
+ return 375;
341
+ }
342
+ setPopInPosition() {
343
+ // Use cached viewport width – reading innerWidth at popup open causes forced reflow.
344
+ // Fallback: matchMedia-based value when cache is 0 (e.g. SSR before hydration). Same breakpoints as updateViewportCache.
345
+ const viewportWidth = this.cachedViewportWidth || this.getViewportWidthFromBreakpoints();
346
+ const popup = this.host.querySelector('.picker_wrapper');
347
+ const widgetEl = this.host.querySelector('.s-color-picker-widget');
348
+ if (!popup || !widgetEl)
349
+ return;
350
+ const widgetPosition = widgetEl.getBoundingClientRect();
351
+ const widgetToWindowEq = viewportWidth / 2 - widgetPosition.width / 2;
352
+ const widgetInLeft = widgetToWindowEq > widgetPosition.x;
353
+ const widgetInRight = widgetToWindowEq < widgetPosition.x;
354
+ const widgetInCenter = widgetToWindowEq === widgetPosition.x;
355
+ const isMobile = !window.matchMedia('(min-width: 768px)').matches;
356
+ if (isMobile && widgetInLeft) {
357
+ popup.style.left = '0';
358
+ }
359
+ if (isMobile && widgetInRight) {
360
+ popup.style.left = 'auto';
361
+ }
362
+ if (!isMobile || (isMobile && ((!widgetInRight && !widgetInLeft) || widgetInCenter))) {
363
+ popup.style.left = `-95px`;
364
+ }
365
+ }
366
+ initColorPicker() {
367
+ this.pickerReady = import('./vanilla-picker-CtwkXTap.js').then(function (n) { return n.v; }).then(mod => {
368
+ const Picker = mod.default;
369
+ const picker = new Picker({
370
+ parent: this.host,
371
+ color: this.color,
372
+ popup: 'bottom',
373
+ alpha: this.enableAlpha,
374
+ editor: this.showTextField,
375
+ editorFormat: this.format,
376
+ cancelButton: this.showCancelButton,
377
+ onChange: (color) => this.colorChangeHandler(color),
378
+ onDone: (color) => this.submittedHandler(color),
379
+ onOpen: (color) => this.popupOpenedHandler(color),
380
+ onClose: (color) => this.popupClosedHandler(color),
381
+ });
382
+ this.picker = picker;
383
+ return this.picker;
384
+ });
385
+ }
386
+ render() {
387
+ return (h(Host, { key: 'dc90f101197031b0ec17939dc940b527cbb42764', class: "s-color-picker-main" }, h("slot", { key: '504a93f8bba3130a953dbfc1e03420d622247c0f', name: "widget" }, h("div", { key: '7eb60d1353d1fa6edefc400d7851499d083c3000', class: "s-color-picker-widget" }, h("div", { key: '01361959e0beeecd5c4b9ba0210931f3864b9273', class: "s-color-picker-widget-canvas", ref: dv => (this.canvas = dv) }), h("span", { key: '4091ba421758a3af182e7224ffbd74c5ca58166a', innerHTML: ArrowDown }))), h("input", { key: '5302b4da7dc9beaec6ab469175dee79d5b8c5dc5', class: "s-hidden", name: this.name, required: this.required, value: this.color, ref: color => (this.colorInput = color) })));
388
+ }
389
+ componentDidLoad() {
390
+ if (this.canvas)
391
+ this.canvas.style.backgroundColor = this.color;
392
+ this.initColorPicker();
393
+ // Populate viewport cache in next frame (avoids forced reflow during initial render)
394
+ requestAnimationFrame(() => this.updateViewportCache());
395
+ window.addEventListener('resize', this.updateViewportCache);
396
+ if (this.colorInput) {
397
+ this.colorInput.addEventListener('invalid', e => {
398
+ this.invalidInput.emit(e);
399
+ });
400
+ this.colorInput.addEventListener('input', () => {
401
+ this.colorInput.setCustomValidity('');
402
+ this.colorInput.reportValidity();
403
+ });
404
+ }
405
+ }
406
+ get host() { return getElement(this); }
407
+ };
408
+ SallaColorPicker.style = sallaColorPickerCss;
409
+
410
+ const SallaConditionalFields = class {
411
+ constructor(hostRef) {
412
+ registerInstance(this, hostRef);
413
+ }
414
+ hideAllOptions(optionId) {
415
+ this.host.querySelectorAll(`[data-show-when^="options[${optionId}"]`).forEach((field) => {
416
+ field.classList.add('hidden');
417
+ this.hideAllOptions(field.dataset.optionId);
418
+ this.disableInputs(field);
419
+ });
420
+ }
421
+ disableInputs(field) {
422
+ field.querySelectorAll('[name]').forEach((input) => {
423
+ input.setAttribute('disabled', '');
424
+ input.removeAttribute('required');
425
+ if (input?.tagName?.toLowerCase() === 'select') {
426
+ input.value = '';
427
+ }
428
+ if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {
429
+ // @ts-ignore
430
+ input.checked = false;
431
+ }
432
+ });
433
+ }
434
+ changeHandler(event) {
435
+ salla.event.emit('salla-onditional-fields::change', event);
436
+ salla.log('Received the change/input event: ', event);
437
+ if (!event.target ||
438
+ (!['SELECT', 'INPUT', 'TEXTAREA'].includes(event.target.tagName) &&
439
+ !['checkbox', 'radio', 'text'].includes(event.target.getAttribute('type')))) {
440
+ salla.log('Ignore the event because is not a supported input: ' + (event?.target?.tagName || 'N/A'));
441
+ return;
442
+ }
443
+ // For text inputs, debounce the handling to improve performance on mobile
444
+ const isTextInput = ['INPUT', 'TEXTAREA'].includes(event.target.tagName) &&
445
+ (!event.target.getAttribute('type') || event.target.getAttribute('type') === 'text');
446
+ if (isTextInput && event.type === 'input') {
447
+ clearTimeout(this.debounceTimeout);
448
+ this.debounceTimeout = setTimeout(() => {
449
+ this.processConditionalFields(event);
450
+ }, 300); // 300ms debounce for text inputs
451
+ return;
452
+ }
453
+ // Process immediately for change events and non-text inputs
454
+ this.processConditionalFields(event);
455
+ }
456
+ processConditionalFields(event) {
457
+ let optionId = event.target.name.replace('[]', '');
458
+ let isMultiple = event.target.getAttribute('type') === 'checkbox';
459
+ let isRadio = event.target.getAttribute('type') === 'radio';
460
+ let isTextInput = ['INPUT', 'TEXTAREA'].includes(event.target.tagName) &&
461
+ (!event.target.getAttribute('type') || event.target.getAttribute('type') === 'text');
462
+ salla.log('Trying to find all elements with condition:', `[data-show-when^="${optionId}"]`);
463
+ this.host.querySelectorAll(`[data-show-when^="${optionId}"]`)
464
+ .forEach((field) => {
465
+ let isEqual = !field?.dataset.showWhen.includes('!=');
466
+ let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();
467
+ let isSelected;
468
+ if (isMultiple) {
469
+ let selectedValues = Array.from(this.host.querySelectorAll(`input[name="${event.target.name}"]:checked`), e => e?.value);
470
+ isSelected = selectedValues.includes(value.toString());
471
+ }
472
+ else if (isRadio) {
473
+ // Handle radio inputs.
474
+ isSelected = event.target.checked && event.target.value === value;
475
+ }
476
+ else if (isTextInput) {
477
+ // Handle text inputs and textareas - check if value matches or is not empty for boolean conditions
478
+ isSelected = value === event.target.value || (value.toLowerCase() === 'true' && event.target.value.trim() !== '');
479
+ }
480
+ else {
481
+ isSelected = value === event.target.value;
482
+ }
483
+ salla.log('The input is ', isMultiple ? 'Multiple' : isRadio ? 'Radio' : isTextInput ? 'Text' : 'Single', ' value:', isSelected);
484
+ let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);
485
+ if (showTheInput) {
486
+ field.classList.remove('hidden');
487
+ field.querySelectorAll('[name]').forEach((input) => {
488
+ input.removeAttribute('disabled');
489
+ const closestProductOption = input.closest('.s-product-options-option');
490
+ if (closestProductOption.dataset.optionRequired === 'true') {
491
+ input.setAttribute('required', '');
492
+ }
493
+ if (input.getAttribute('type') === 'checkbox') {
494
+ const checkboxes = Array.from(document.querySelectorAll(`input[type="checkbox"][name="${input.getAttribute('name')}"]`));
495
+ const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked);
496
+ if (isAnyChecked) {
497
+ checkboxes.forEach((checkbox) => {
498
+ checkbox.removeAttribute('required');
499
+ });
500
+ }
501
+ }
502
+ });
503
+ }
504
+ else {
505
+ this.hideAllOptions(field.dataset.optionId);
506
+ field.classList.add('hidden');
507
+ this.disableInputs(field);
508
+ }
509
+ });
510
+ }
511
+ componentDidRender() {
512
+ this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {
513
+ // @ts-ignore
514
+ let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();
515
+ if (!optionName) {
516
+ return;
517
+ }
518
+ this.changeHandler({
519
+ target: this.host.querySelector('[name^="' + optionName + '"]')
520
+ });
521
+ });
522
+ }
523
+ render() {
524
+ return (h(Host, { key: 'af75ffed0725edefeb9e6fcd2f95bf9209f63dd0' }, h("slot", { key: 'b28f91555071a31d967d85ba7d693e16266bcc6c' })));
525
+ }
526
+ get host() { return getElement(this); }
527
+ };
528
+
529
+ const sallaDatetimePickerCss = ".flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:'';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:\"\";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:\"\";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}";
530
+
531
+ const SallaDatetimePicker = class {
532
+ constructor(hostRef) {
533
+ registerInstance(this, hostRef);
534
+ this.picked = createEvent(this, "picked");
535
+ this.invalidInput = createEvent(this, "invalidInput");
536
+ /**
537
+ * Two way data binding to retrieve the selected date[time] value
538
+ */
539
+ this.value = null;
540
+ /**
541
+ * Placeholder text to show on the input element
542
+ */
543
+ this.placeholder = salla.lang.get('blocks.buy_as_gift.select_send_date_and_time');
544
+ /**
545
+ * Allows the user to enter a date directly into the input field. By default, direct entry is disabled.
546
+ */
547
+ this.allowInput = true;
548
+ /**
549
+ * Allows the preloading of an invalid date. When disabled, the field will be cleared if the provided date is invalid
550
+ */
551
+ this.allowInvalidPreload = false;
552
+ /**
553
+ * Exactly the same as date format, but for the altInput field.
554
+ */
555
+ this.altFormat = "F j, Y";
556
+ /**
557
+ * Show the user a readable date (as per altFormat), but return something totally different to the server.
558
+ */
559
+ this.altInput = false;
560
+ /**
561
+ * Instead of body, appends the calendar to the specified node instead.
562
+ */
563
+ this.appendTo = undefined;
564
+ /**
565
+ * Defines how the date will be formatted in the aria-label for calendar days,
566
+ * using the same tokens as dateFormat. If you change this, you should choose a
567
+ * value that will make sense if a screen reader reads it out loud.
568
+ */
569
+ this.ariaDateFormat = "F j, Y";
570
+ /**
571
+ * Whether the default time should be auto-filled when the input is empty and gains or loses focus.
572
+ */
573
+ this.autoFillDefaultTime = true;
574
+ /**
575
+ * Whether clicking on the input should open the picker.
576
+ * Set it to false if you only want to open the calendar programmatically with [open()]
577
+ */
578
+ this.clickOpens = true;
579
+ /**
580
+ * Whether calendar should close after date selection or not
581
+ */
582
+ this.closeOnSelect = true;
583
+ /**
584
+ * A string of characters which are used to define how the date will be displayed in the input box.
585
+ * The supported characters are defined in the table below.
586
+ */
587
+ this.dateFormat = "Y-m-d";
588
+ /**
589
+ * Initial value of the hour element, when no date is selected
590
+ */
591
+ this.defaultHour = 12;
592
+ /**
593
+ * Initial value of the minute element, when no date is selected
594
+ */
595
+ this.defaultMinute = 0;
596
+ /**
597
+ * Initial value of the seconds element, when no date is selected
598
+ */
599
+ this.defaultSeconds = 0;
600
+ /**
601
+ * Disables certain dates, preventing them from being selected.
602
+ * See https://chmln.github.io/flatpickr/examples/#disabling-specific-dates
603
+ */
604
+ this.disable = [];
605
+ /**
606
+ * Set this to true to always use the non-native picker on mobile devices.
607
+ * By default, Flatpickr utilizes native datetime widgets unless certain options (e.g. disable) are used.
608
+ */
609
+ this.disableMobile = false;
610
+ /**
611
+ * Disables all dates except these specified. See https://chmln.github.io/flatpickr/examples/#disabling-all-dates-except-select-few
612
+ */
613
+ this.enable = [(_) => true];
614
+ /**
615
+ * Enables seconds selection in the time picker.
616
+ */
617
+ this.enableSeconds = false;
618
+ /**
619
+ * Enables the time picker
620
+ */
621
+ this.enableTime = false;
622
+ /**
623
+ * Adjusts the step for the hour input (incl. scrolling)
624
+ */
625
+ this.hourIncrement = 1;
626
+ /**
627
+ * Displays the calendar inline
628
+ */
629
+ this.inline = false;
630
+ /**
631
+ * The locale, either as a string (e.g. "ar", "en") or as an object.
632
+ * See https://chmln.github.io/flatpickr/localization/
633
+ */
634
+ this.locale = "en";
635
+ /**
636
+ * The maximum date that a user can pick to (inclusive).
637
+ */
638
+ this.maxDate = null;
639
+ /**
640
+ * The minimum date that a user can start picking from (inclusive).
641
+ */
642
+ this.maxTime = null;
643
+ /**
644
+ * The minimum date that a user can start picking from (inclusive).
645
+ */
646
+ this.minDate = null;
647
+ /**
648
+ * The minimum time that a user can start picking from (inclusive).
649
+ */
650
+ this.minTime = null;
651
+ /**
652
+ * Adjusts the step for the minute input (incl. scrolling) Defaults to 5
653
+ */
654
+ this.minuteIncrement = 5;
655
+ /**
656
+ * Date selection mode, defaults to "single"
657
+ */
658
+ this.mode = "single";
659
+ /**
660
+ * How the month should be displayed in the header of the calendar.
661
+ * If showMonths has a value greater than 1, the month is always shown as static.
662
+ */
663
+ this.monthSelectorType = "dropdown";
664
+ /**
665
+ * HTML for the arrow icon, used to switch months.
666
+ */
667
+ this.nextArrow = '<span class="sicon-keyboard_arrow_right"></span>';
668
+ /**
669
+ * Hides the day selection in calendar. Use it along with enableTime to create a time picker.
670
+ */
671
+ this.noCalendar = false;
672
+ /**
673
+ * How the calendar should be positioned with regards to the input. Defaults to "auto"
674
+ */
675
+ this.position = "auto";
676
+ /**
677
+ * HTML for the left arrow icon, used to switch months.
678
+ */
679
+ this.prevArrow = '<span class="sicon-keyboard_arrow_left"></span>';
680
+ /**
681
+ * Whether to display the current month name in shorthand mode, e.g. "Sep" instead "September"
682
+ */
683
+ this.shorthandCurrentMonth = false;
684
+ /**
685
+ * Position the calendar inside the wrapper and next to the input element*.
686
+ */
687
+ this.static = false;
688
+ /**
689
+ * The number of months to be shown at the same time when displaying the calendar.
690
+ */
691
+ this.showMonths = 1;
692
+ /**
693
+ * Displays time picker in 24 hour mode without AM/PM selection when enabled.
694
+ */
695
+ this.time_24hr = false;
696
+ /**
697
+ * Enables display of week numbers in calendar.
698
+ */
699
+ this.weekNumbers = false;
700
+ /**
701
+ * See https://chmln.github.io/flatpickr/examples/#flatpickr-external-elements
702
+ */
703
+ this.wrap = false;
704
+ /**
705
+ * Whether the input is disabled
706
+ */
707
+ this.disabled = false;
708
+ }
709
+ /**
710
+ * Lazy load flatpickr library
711
+ * This reduces initial bundle size by ~35-40KB
712
+ */
713
+ async loadFlatpickr() {
714
+ if (this.flatpickr)
715
+ return;
716
+ try {
717
+ const flatpickrModule = await import('./index-D-twzdLJ.js');
718
+ this.flatpickr = flatpickrModule.default;
719
+ // Load locale if not English
720
+ if (this.locale && this.locale !== 'en') {
721
+ try {
722
+ await import(`flatpickr/dist/l10n/${this.locale}.js`);
723
+ }
724
+ catch (e) {
725
+ console.warn(`Flatpickr locale ${this.locale} not found, using default`);
726
+ }
727
+ }
728
+ }
729
+ catch (error) {
730
+ console.error('Failed to load Flatpickr:', error);
731
+ salla.notify?.error?.('Failed to load date picker. Please refresh the page.');
732
+ throw error;
733
+ }
734
+ }
735
+ render() {
736
+ return h("div", { key: 'f619b5fa5fdb68b3cc8562be43496dabb1d78f37', class: "s-datetime-picker" }, h("input", { key: 'dc9b5d0680cd31109a2b82fcf435b8b68d5fbb8d', type: "datetime", name: this.name, value: this.value, required: this.required, disabled: this.disabled, placeholder: this.placeholder, class: "s-datetime-picker-input", ref: (el) => this.dateInput = el }));
737
+ }
738
+ async componentDidLoad() {
739
+ // Load flatpickr before initializing
740
+ await this.loadFlatpickr();
741
+ let options = {
742
+ allowInput: this.allowInput,
743
+ allowInvalidPreload: this.allowInvalidPreload,
744
+ altFormat: this.altFormat,
745
+ altInput: this.altInput,
746
+ altInputClass: this.altInputClass,
747
+ appendTo: this.appendTo,
748
+ ariaDateFormat: this.ariaDateFormat,
749
+ autoFillDefaultTime: this.autoFillDefaultTime,
750
+ clickOpens: this.clickOpens,
751
+ closeOnSelect: this.closeOnSelect,
752
+ conjunction: this.conjunction,
753
+ dateFormat: this.dateFormat,
754
+ defaultDate: !!this.value ? Date.parse(this.value) : this.defaultDate,
755
+ defaultHour: this.defaultHour,
756
+ defaultMinute: this.defaultMinute,
757
+ defaultSeconds: this.defaultSeconds,
758
+ disable: this.disable,
759
+ disableMobile: this.disableMobile,
760
+ enable: this.enable,
761
+ enableSeconds: this.enableSeconds,
762
+ enableTime: this.enableTime,
763
+ formatDate: this.formatDate,
764
+ hourIncrement: this.hourIncrement,
765
+ inline: this.inline,
766
+ locale: this.locale,
767
+ maxDate: this.maxDate,
768
+ maxTime: this.maxTime,
769
+ minDate: this.minDate,
770
+ minTime: this.minTime,
771
+ minuteIncrement: this.minuteIncrement,
772
+ mode: this.mode,
773
+ monthSelectorType: this.monthSelectorType,
774
+ nextArrow: this.nextArrow,
775
+ noCalendar: this.noCalendar,
776
+ parseDate: this.dateParser,
777
+ position: this.position,
778
+ positionElement: this.positionElement,
779
+ prevArrow: this.prevArrow,
780
+ shorthandCurrentMonth: this.shorthandCurrentMonth,
781
+ static: this.static,
782
+ showMonths: this.showMonths,
783
+ time_24hr: this.time_24hr,
784
+ weekNumbers: this.weekNumbers,
785
+ wrap: this.wrap,
786
+ // @ts-ignore
787
+ onChange: (selectedDates, dateStr) => this.picked.emit(this.value = dateStr)
788
+ // onOpen: this.handleOnOpen(selectedDates, dateStr, instance)
789
+ // onClose: this.handleOnClose(selectedDates, dateStr, instance)
790
+ };
791
+ this.flatpickr(this.dateInput, options);
792
+ this.dateInput.addEventListener('invalid', e => {
793
+ this.invalidInput.emit(e);
794
+ });
795
+ this.dateInput.addEventListener('input', () => {
796
+ this.dateInput.setCustomValidity('');
797
+ this.dateInput.reportValidity();
798
+ });
799
+ }
800
+ };
801
+ SallaDatetimePicker.style = sallaDatetimePickerCss;
802
+
803
+ const sallaFileUploadCss = "/*!\n * FilePond 4.32.8\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:flex;justify-content:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;box-shadow:0 0 0 0 hsla(0,0%,100%,0);transition:box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:flex;flex-direction:column;align-items:flex-start;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:flex;flex-direction:column;align-items:flex-end;flex-grow:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:flex;height:100%;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity;touch-action:auto}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{transition:box-shadow .125s ease-in-out;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:flex;justify-content:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.4;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--image-preview-markup{position:absolute;left:0;top:0}.filepond--image-preview-wrapper{z-index:2}.filepond--image-preview-overlay{display:block;position:absolute;left:0;top:0;width:100%;min-height:5rem;max-height:7rem;margin:0;opacity:0;z-index:2;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--image-preview-overlay svg{width:100%;height:auto;color:inherit;max-height:inherit}.filepond--image-preview-overlay-idle{mix-blend-mode:multiply;color:rgba(40, 40, 40, 0.85)}.filepond--image-preview-overlay-success{mix-blend-mode:normal;color:rgba(54, 151, 99, 1)}.filepond--image-preview-overlay-failure{mix-blend-mode:normal;color:rgba(196, 78, 71, 1)}@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)){.filepond--image-preview-overlay-idle{mix-blend-mode:normal}}.filepond--image-preview-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;left:0;top:0;right:0;height:100%;margin:0;border-radius:0.45em;overflow:hidden;background:rgba(0, 0, 0, 0.01)}.filepond--image-preview{position:absolute;left:0;top:0;z-index:1;display:flex;align-items:center;height:100%;width:100%;pointer-events:none;background:#222;will-change:transform, opacity}.filepond--image-clip{position:relative;overflow:hidden;margin:0 auto;}.filepond--image-clip[data-transparency-indicator='grid'] img,.filepond--image-clip[data-transparency-indicator='grid'] canvas{background-color:#fff;background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");background-size:1.25em 1.25em}.filepond--image-bitmap,.filepond--image-vector{position:absolute;left:0;top:0;will-change:transform}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview-wrapper{border-radius:0}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview{height:100%;display:flex;justify-content:center;align-items:center}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-wrapper{border-radius:99999rem}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-overlay{top:auto;bottom:0;-webkit-transform:scaleY(-1);transform:scaleY(-1)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']){margin-bottom:0.325em}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='left']{left:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='right']{right:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='right']{margin-bottom:calc(0.325em + 0.1875em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='center']{margin-top:0;margin-bottom:0.1875em;margin-left:0.1875em}/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='center']{margin-left:-0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom']{margin-bottom:-0.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 0.25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item{opacity:1 !important;visibility:visible !important}.s-file-upload-wrapper .filepond--file-info-main{-webkit-line-clamp:1;display:-webkit-box;-webkit-box-orient:vertical}";
804
+
805
+ const SallaFileUpload = class {
806
+ /**
807
+ * Lazy load FilePond and all plugins
808
+ * This reduces initial bundle size by ~200-250KB
809
+ */
810
+ async loadFilePond() {
811
+ if (this.filePondLoaded)
812
+ return;
813
+ try {
814
+ const [FilePondModule, FilePondPluginFileValidateSize, FilePondPluginImageExifOrientation, FilePondPluginImagePreview, FilePondPluginImageEdit, FilePondPluginFileValidateType, FilePondPluginFilePoster] = await Promise.all([
815
+ import('./filepond-DEzyRrdH.js').then(function (n) { return n.f; }),
816
+ import('./filepond-plugin-file-validate-size-Cxp5Yzea.js').then(function (n) { return n.f; }),
817
+ import('./filepond-plugin-image-exif-orientation-CiT1CQoK.js').then(function (n) { return n.f; }),
818
+ import('./filepond-plugin-image-preview-DBG7keFZ.js').then(function (n) { return n.f; }),
819
+ import('./filepond-plugin-image-edit-DndTlA7m.js').then(function (n) { return n.f; }),
820
+ import('./filepond-plugin-file-validate-type-D2qNOQP4.js').then(function (n) { return n.f; }),
821
+ import('./filepond-plugin-file-poster-DyLcCcHM.js').then(function (n) { return n.f; })
822
+ ]);
823
+ this.FilePond = FilePondModule;
824
+ // Register plugins
825
+ this.FilePond.registerPlugin(FilePondPluginImagePreview.default, FilePondPluginImageExifOrientation.default, FilePondPluginFileValidateSize.default, FilePondPluginImageEdit.default, FilePondPluginFileValidateType.default, FilePondPluginFilePoster.default);
826
+ this.filePondLoaded = true;
827
+ }
828
+ catch (error) {
829
+ console.error('Failed to load FilePond:', error);
830
+ salla.notify?.error?.('Failed to load file uploader. Please refresh the page.');
831
+ throw error;
832
+ }
833
+ }
834
+ constructor(hostRef) {
835
+ registerInstance(this, hostRef);
836
+ this.added = createEvent(this, "added");
837
+ this.invalidInput = createEvent(this, "invalidInput");
838
+ this.uploaded = createEvent(this, "uploaded");
839
+ this.removed = createEvent(this, "removed");
840
+ this.filePondLoaded = false;
841
+ this.max_images_count = (count) => salla.lang.get('common.uploader.max_images_count', { count });
842
+ this.max_count_hint = (count) => salla.lang.get('common.uploader.max_count_hint', { count });
843
+ this.uploadedFiles = [];
844
+ this.isListScrollerListenerAdded = false;
845
+ this.showMaxCountHint = false;
846
+ /**
847
+ * Set the component to be profile image uploader with a preview and a circular shape
848
+ */
849
+ this.profileImage = false;
850
+ /**
851
+ * Allow to pass extra params to be sent with the upload request
852
+ */
853
+ this.payloadParams = {};
854
+ /**
855
+ * Accepted file types
856
+ */
857
+ this.accept = "image/png, image/jpeg, image/jpg, image/gif";
858
+ /**
859
+ * The submit request method.
860
+ */
861
+ this.method = 'POST';
862
+ /**
863
+ * json formData to be injected in the submit request
864
+ */
865
+ this.formData = "{}";
866
+ /**
867
+ * Enable or disable drag n' drop
868
+ */
869
+ this.allowDrop = true;
870
+ /**
871
+ * Enable or disable file browser
872
+ */
873
+ this.allowBrowse = true;
874
+ /**
875
+ * Allow drop to replace a file, only works when allowMultiple is false
876
+ */
877
+ this.allowReplace = true;
878
+ /**
879
+ * Enable or disable the revert processing button
880
+ */
881
+ this.allowRevert = true;
882
+ /**
883
+ * When set to false the remove button is hidden and disabled
884
+ */
885
+ this.allowRemove = true;
886
+ /**
887
+ * Enable or disable preview mode
888
+ */
889
+ this.allowImagePreview = true;
890
+ /**
891
+ * Fixed image preview height, overrides min and max preview height
892
+ */
893
+ this.imagePreviewHeight = null;
894
+ /**
895
+ * Fixed image poster height, overrides min and max preview height
896
+ */
897
+ this.filePosterHeight = null;
898
+ /**
899
+ * The maximum number of files that the pond can handle
900
+ */
901
+ this.maxFilesCount = 1;
902
+ /**
903
+ * The maxmimum number of files that can be uploaded in parallel
904
+ */
905
+ this.maxParallelUploads = 3;
906
+ /**
907
+ * Set to 'after' to add files to end of list (when dropped at the top of the list or added using browse or paste),
908
+ * set to 'before' to add files at start of list.
909
+ * Set to a compare function to automatically sort items when added
910
+ */
911
+ this.itemInsertLocation = 'after';
912
+ /**
913
+ * The interval to use before showing each item being added to the list
914
+ */
915
+ this.itemInsertInterval = 75;
916
+ /**
917
+ * Require drop on the FilePond element itself to catch the file.
918
+ */
919
+ this.dropOnElement = true;
920
+ /**
921
+ * Ignored file names when handling dropped directories. Dropping directories is not supported on all browsers.
922
+ */
923
+ this.ignoredFiles = ['.ds_store', 'thumbs.db', 'desktop.ini'];
924
+ /**
925
+ * The size of a chunk in bytes
926
+ */
927
+ this.chunkSize = 5000000;
928
+ /**
929
+ * Amount of times, and delayes, between retried uploading of a chunk
930
+ */
931
+ this.chunkRetryDelays = [500, 1000, 3000];
932
+ /// Labels Props
933
+ /**
934
+ * The decimal separator used to render numbers. By default this is determined automatically.
935
+ */
936
+ this.labelDecimalSeparator = undefined;
937
+ /**
938
+ * The thousdands separator used to render numbers. By default this is determined automatically.
939
+ */
940
+ this.labelThousandsSeparator = undefined;
941
+ /// SVG Icons
942
+ /**
943
+ * The icon used for remove actions
944
+ */
945
+ this.iconRemove = '<svg>...</svg>';
946
+ /**
947
+ * The icon used for process actions
948
+ */
949
+ this.iconProcess = '<svg>...</svg>';
950
+ /**
951
+ * The icon used for retry actions
952
+ */
953
+ this.iconRetry = '<svg>...</svg>';
954
+ /**
955
+ * The icon used for undo actions
956
+ */
957
+ this.iconUndo = '<svg>...</svg>';
958
+ this.openFileBrowser = () => {
959
+ this.filepond.browse();
960
+ };
961
+ //if cartItemIdIsPassed, we need to set the url
962
+ if (!this.url && this.cartItemId) {
963
+ this.url = salla.cart.getUploadImageEndpoint();
964
+ this.instantUpload = true;
965
+ }
966
+ if (!this.url && this.profileImage) {
967
+ this.url = salla.url.api('profile/update');
968
+ this.instantUpload = true;
969
+ this.host.hasAttribute('name') || (this.name = 'avatar');
970
+ }
971
+ if (!this.name) {
972
+ this.name = 'file';
973
+ }
974
+ salla.lang.onLoaded(() => {
975
+ this.host.querySelectorAll('.filepond--drop-label>label').forEach(label => label.innerHTML = this.getLabel());
976
+ if (this.filepond) {
977
+ this.filepond.labelFileTypeNotAllowed = salla.lang.get('common.uploader.invalid_type');
978
+ this.filepond.labelMaxFileSizeExceeded = salla.lang.get('common.uploader.too_large');
979
+ this.filepond.labelFileSizeNotAvailable = salla.lang.get('common.uploader.size_not_available');
980
+ this.filepond.labelFileLoading = salla.lang.get('common.elements.loading');
981
+ this.filepond.labelFileLoadError = salla.lang.get('common.uploader.failed_to_load');
982
+ this.filepond.labelFileProcessingAborted = salla.lang.get('common.uploader.upload_cancelled');
983
+ this.filepond.labelTapToCancel = salla.lang.get("common.elements.cancel");
984
+ this.filepond.labelTapToRetry = salla.lang.get("common.elements.retry");
985
+ this.filepond.labelButtonRemoveItem = salla.lang.get("common.elements.remove");
986
+ this.filepond.labelButtonUndoItemProcessing = salla.lang.get("common.elements.undo");
987
+ this.filepond.labelButtonProcessItem = salla.lang.get("common.uploader.upload");
988
+ this.filepond.labelFileProcessingComplete = salla.lang.get('common.uploader.file_processing_complete'),
989
+ this.filepond.labelTapToUndo = salla.lang.get('common.uploader.tap_to_undo'),
990
+ this.filepond.labelFileProcessing = salla.lang.get('common.uploader.file_processing'),
991
+ this.filepond.labelFileProcessingError = salla.lang.get('common.uploader.file_processing_error');
992
+ }
993
+ const setNestedAsync = (lang, key, value) => {
994
+ return new Promise((resolve) => {
995
+ salla.helpers.setNested(salla.lang.messages[lang], key, value);
996
+ resolve(true);
997
+ });
998
+ };
999
+ const setTranslations = async () => {
1000
+ await setNestedAsync('ar.trans', 'common.uploader.max_images_count', '.أضف :count صور كحد أقصى');
1001
+ await setNestedAsync('en.trans', 'common.uploader.max_images_count', 'Add up to :count images maximum.');
1002
+ await setNestedAsync('ar.trans', 'common.uploader.max_count_hint', 'يمكنك رفع حتى :count صور');
1003
+ await setNestedAsync('en.trans', 'common.uploader.max_count_hint', 'You can upload up to :count images.');
1004
+ };
1005
+ this.max_count_hint = (count) => salla.lang.get('common.uploader.max_count_hint', { count });
1006
+ this.max_images_count = (count) => salla.lang.get('common.uploader.max_images_count', { count });
1007
+ setTranslations();
1008
+ });
1009
+ }
1010
+ addedHandler(error, file) {
1011
+ this.added.emit({ error: error, file: file });
1012
+ //if the file passed on initiate will not have type
1013
+ this.host.querySelector('.filepond--root').classList.remove('s-file-upload-has-error');
1014
+ if (error || !file.file.type) {
1015
+ this.host.querySelector('.filepond--root').classList.add('s-file-upload-has-error');
1016
+ return;
1017
+ }
1018
+ let container = new DataTransfer;
1019
+ let fileInput = this.getFormDataFileInput();
1020
+ // @ts-ignore
1021
+ container.items.add(file.file);
1022
+ fileInput.type = 'file';
1023
+ fileInput.files = container.files;
1024
+ fileInput.dispatchEvent(new window.Event('change', { bubbles: true }));
1025
+ }
1026
+ uploadedHandler() {
1027
+ let fileInput = this.getFormDataFileInput();
1028
+ fileInput.type = 'hidden';
1029
+ fileInput.value = this.value;
1030
+ this.hiddenInput.value = this.value;
1031
+ fileInput.dispatchEvent(new window.Event('change', { bubbles: true }));
1032
+ return this.uploaded.emit(this.value);
1033
+ }
1034
+ removedHandler(deletedFile) {
1035
+ let fileInput = this.getFormDataFileInput();
1036
+ fileInput.type = 'hidden';
1037
+ fileInput.value = '';
1038
+ this.host.closest('.s-product-options-option')?.removeAttribute('data-has-value');
1039
+ if (salla.url.is_page("cart") && deletedFile.getMetadata('id')) {
1040
+ salla.cart.api.deleteImage(deletedFile.getMetadata('id'));
1041
+ }
1042
+ if (this.height) {
1043
+ setTimeout(() => this.host.querySelector('.filepond--root').style.height = this.height, 1000);
1044
+ }
1045
+ this.hiddenInput.value = '';
1046
+ fileInput.dispatchEvent(new window.Event('change', { bubbles: true }));
1047
+ let toDelete = this.allowMultiple ? deletedFile.getMetadata('id') : deletedFile;
1048
+ return this.removed.emit(toDelete);
1049
+ }
1050
+ /**
1051
+ * Method to set option for filepond
1052
+ * */
1053
+ async setOption(key, value) {
1054
+ this.filepond[key] = value;
1055
+ }
1056
+ getLabel() {
1057
+ if (this.labelIdle) {
1058
+ //some times we are passing label before translations is loaded, so here we will make sure that all translations are translated
1059
+ return this.labelIdle
1060
+ .replace('common.uploader.drag_and_drop', salla.lang.get('common.uploader.drag_and_drop'))
1061
+ .replace('common.uploader.browse', salla.lang.get('common.uploader.browse'));
1062
+ }
1063
+ return `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
1064
+ }
1065
+ /**
1066
+ *
1067
+ * This method will fire head request to get the file size, it's head request,so it will be too fast.
1068
+ */
1069
+ getFileSize(url) {
1070
+ let http = new XMLHttpRequest();
1071
+ http.open('HEAD', url, false); // false = Synchronous
1072
+ http.send(null); // it will stop here until this http request is complete
1073
+ return http.status === 200 ? http.getResponseHeader('content-length') : '';
1074
+ }
1075
+ getFormDataFileInput() {
1076
+ return this.host.querySelector('.filepond--data input');
1077
+ }
1078
+ getFiles() {
1079
+ if (!this.value && !this.files) {
1080
+ return [];
1081
+ }
1082
+ try {
1083
+ let files = this.files
1084
+ ? typeof this.files === 'string' ? JSON.parse(this.files) : this.files
1085
+ : this.value.split(',').map(file => ({ url: file }));
1086
+ if (files.length) {
1087
+ this.host.closest('.s-product-options-option')?.setAttribute('data-has-value', 'true');
1088
+ }
1089
+ return files.map(file => ({
1090
+ source: file.id ? `${file.id}` : file.url,
1091
+ options: {
1092
+ type: 'local',
1093
+ file: {
1094
+ name: file.url.substring(file.url.lastIndexOf('/') + 1),
1095
+ size: this.getFileSize(file.url)
1096
+ },
1097
+ metadata: { poster: file.url, name: file.url, id: file.id },
1098
+ },
1099
+ }));
1100
+ }
1101
+ catch (e) {
1102
+ salla.log('failed To get files from: ' + (this.files || this.value));
1103
+ }
1104
+ return [];
1105
+ }
1106
+ async componentWillLoad() {
1107
+ // Load FilePond before component renders (reduces initial bundle by ~200-250KB)
1108
+ await this.loadFilePond();
1109
+ if (!this.labelIdle) {
1110
+ this.labelIdle = this.host.innerHTML;
1111
+ this.host.innerHTML = '';
1112
+ }
1113
+ }
1114
+ render() {
1115
+ return (h(Host, { key: '45383bff9bc408ef0328e888751827e6fc70038d', class: {
1116
+ "s-file-upload": true,
1117
+ "s-file-upload-profile-image": this.profileImage,
1118
+ "s-file-upload-multiple": this.allowMultiple,
1119
+ } }, h("input", { key: '323e469923868db4e322d67c1dd8a7efc245fe5f', type: "file", name: this.name, value: this.value, ref: ele => this.fileUploader = ele, required: this.required, class: "s-file-upload-wrapper s-file-upload-input", accept: this.accept }), this.allowMultiple && this.showMaxCountHint ? h("div", { class: "s-file-upload-hint s-hidden" }, this.max_count_hint(this.maxFilesCount)) : '', h("input", { key: '42458ac28b13ba4e6c6dc80a30054e0e567a9366', class: "s-hidden", name: 'hidden-' + this.name, required: this.required, value: this.value, ref: input => this.hiddenInput = input })));
1120
+ }
1121
+ componentDidLoad() {
1122
+ let files = this.getFiles();
1123
+ this.filepond = this.FilePond.create(this.fileUploader, {
1124
+ name: this.payloadName || this.name,
1125
+ //@ts-ignore
1126
+ files: files,
1127
+ required: this.required,
1128
+ disabled: this.disabled,
1129
+ allowDrop: this.allowDrop,
1130
+ allowBrowse: this.allowBrowse,
1131
+ allowPaste: this.allowPaste,
1132
+ allowMultiple: this.allowMultiple, //||files.length,
1133
+ allowReplace: this.allowReplace,
1134
+ allowRevert: this.allowRevert,
1135
+ allowProcess: this.allowProcess,
1136
+ allowReorder: this.allowReorder,
1137
+ storeAsFile: this.storeAsFile,
1138
+ forceRevert: this.forceRevert,
1139
+ maxFiles: this.maxFilesCount,
1140
+ imagePreviewHeight: this.imagePreviewHeight,
1141
+ filePosterHeight: this.filePosterHeight,
1142
+ allowImagePreview: this.allowImagePreview,
1143
+ maxParallelUploads: this.maxParallelUploads,
1144
+ checkValidity: this.checkValidity,
1145
+ itemInsertLocation: this.itemInsertLocation,
1146
+ itemInsertInterval: this.itemInsertInterval,
1147
+ credits: this.credits,
1148
+ dropOnPage: this.dropOnPage,
1149
+ dropOnElement: this.dropOnElement,
1150
+ dropValidation: this.dropValidation,
1151
+ ignoredFiles: this.ignoredFiles,
1152
+ onaddfile: (error, file) => this.addedHandler(error, file),
1153
+ onwarning: (error, _file, _status) => {
1154
+ if (error.body === "Max files") {
1155
+ salla.notify.error(this.max_images_count(this.maxFilesCount));
1156
+ }
1157
+ },
1158
+ onprocessfile: (error, file) => {
1159
+ if (this.allowMultiple && !error) {
1160
+ // Find the uploaded file data using the serverId returned from onload
1161
+ const serverId = file.serverId;
1162
+ const uploadedFile = this.uploadedFiles.find(f => f.id === serverId);
1163
+ if (uploadedFile) {
1164
+ // Set metadata on the file
1165
+ file.setMetadata('id', uploadedFile.id, true);
1166
+ file.setMetadata('url', uploadedFile.url, true);
1167
+ this.value = {
1168
+ id: uploadedFile.id,
1169
+ url: uploadedFile.url
1170
+ };
1171
+ this.uploadedHandler();
1172
+ }
1173
+ }
1174
+ },
1175
+ onupdatefiles: (fileItems) => {
1176
+ const dropLabel = this.host.querySelector('.filepond--drop-label');
1177
+ const listScroller = this.host.querySelector('.filepond--list-scroller');
1178
+ if (this.allowMultiple) {
1179
+ if (fileItems.length > 0) {
1180
+ dropLabel.classList.add('s-hidden');
1181
+ if (!this.isListScrollerListenerAdded && fileItems.length < this.maxFilesCount) {
1182
+ this.showMaxCountHint = true;
1183
+ listScroller.addEventListener('click', this.openFileBrowser);
1184
+ this.isListScrollerListenerAdded = true;
1185
+ }
1186
+ }
1187
+ else {
1188
+ dropLabel.classList.remove('s-hidden');
1189
+ if (this.isListScrollerListenerAdded) {
1190
+ listScroller.removeEventListener('click', this.openFileBrowser);
1191
+ this.isListScrollerListenerAdded = false;
1192
+ }
1193
+ }
1194
+ // Check if fileItems length equals maxFilesCount and remove event listener
1195
+ if (fileItems.length === this.maxFilesCount && this.isListScrollerListenerAdded) {
1196
+ listScroller.removeEventListener('click', this.openFileBrowser);
1197
+ this.isListScrollerListenerAdded = false;
1198
+ this.showMaxCountHint = false;
1199
+ }
1200
+ }
1201
+ },
1202
+ server: {
1203
+ url: this.url,
1204
+ method: this.method,
1205
+ revert: null,
1206
+ // @ts-ignore
1207
+ process: {
1208
+ onload: (response) => {
1209
+ let responseData = JSON.parse(response).data;
1210
+ if ((this.instantUpload || this.allowMultiple) && Array.isArray(responseData) && responseData.length > 0) {
1211
+ const fileId = `${this.host.id}-${Math.floor(100 + Math.random() * 900)}`;
1212
+ const fileUrl = responseData[0];
1213
+ // Store the upload result to be picked up by onprocessfile
1214
+ this.uploadedFiles.push({
1215
+ id: fileId,
1216
+ url: fileUrl
1217
+ });
1218
+ // Return the serverId that FilePond will use to identify this file
1219
+ // We'll use the fileId as the serverId
1220
+ return fileId;
1221
+ }
1222
+ else {
1223
+ this.value = responseData.filePath || responseData.url;
1224
+ this.uploadedHandler();
1225
+ return this.value;
1226
+ }
1227
+ },
1228
+ headers: salla.api.getHeaders(),
1229
+ onerror: response => {
1230
+ try {
1231
+ let field = JSON.parse(response).error.fields;
1232
+ field = field[this.payloadName || this.name];
1233
+ return (field && field[0]) || salla.lang.get('common.errors.error_occurred');
1234
+ }
1235
+ catch (e) {
1236
+ salla.log('FileUpload:: Error', e);
1237
+ return salla.lang.get('common.errors.error_occurred');
1238
+ }
1239
+ },
1240
+ ondata: formData => {
1241
+ if (this.allowMultiple) {
1242
+ const newFormData = new FormData();
1243
+ // ? This line suppose to send all files in one request but its not working properly
1244
+ // const filesArray = this.filepond.getFiles().map(file => file.file);
1245
+ formData.forEach((value) => {
1246
+ newFormData.append(`files[]`, value);
1247
+ });
1248
+ newFormData.append("type", this.type);
1249
+ return newFormData;
1250
+ }
1251
+ if (this.payloadName && this.payloadName != this.name && !this.allowMultiple) {
1252
+ formData.append(this.payloadName, this.filepond.getFile(0).file);
1253
+ formData.delete(this.name);
1254
+ }
1255
+ if (this.payloadParams) {
1256
+ for (const [k, v] of Object.entries(this.payloadParams)) {
1257
+ formData.append(k, v);
1258
+ }
1259
+ }
1260
+ if (this.cartItemId) {
1261
+ formData.append('cart_item_id', this.cartItemId);
1262
+ }
1263
+ try {
1264
+ Object.entries(JSON.parse(this.formData)).forEach((value) => value[1] && formData.append(value[0], value[1]));
1265
+ }
1266
+ catch (e) {
1267
+ salla.log('Error to inject formData', e);
1268
+ }
1269
+ return formData;
1270
+ }
1271
+ },
1272
+ },
1273
+ instantUpload: this.instantUpload,
1274
+ chunkUploads: this.chunkUploads,
1275
+ chunkForce: this.chunkForce,
1276
+ chunkSize: this.chunkSize,
1277
+ chunkRetryDelays: this.chunkRetryDelays,
1278
+ labelDecimalSeparator: this.labelDecimalSeparator,
1279
+ labelThousandsSeparator: this.labelThousandsSeparator,
1280
+ labelIdle: this.getLabel(),
1281
+ acceptedFileTypes: this.accept.replace(/\s+/g, '').split(','),
1282
+ labelFileTypeNotAllowed: salla.lang.get('common.uploader.invalid_type'),
1283
+ labelFileProcessingComplete: salla.lang.get('common.uploader.file_processing_complete'),
1284
+ labelTapToUndo: salla.lang.get('common.uploader.tap_to_undo'),
1285
+ labelFileProcessing: salla.lang.get('common.uploader.file_processing'),
1286
+ labelFileProcessingError: salla.lang.get('common.uploader.file_processing_error'),
1287
+ fileValidateTypeLabelExpectedTypes: '{allButLastType}, {lastType}',
1288
+ labelMaxFileSizeExceeded: salla.lang.get('common.uploader.too_large'),
1289
+ labelMaxFileSize: '{filesize}',
1290
+ maxFileSize: `${salla.config.get('store.settings.upload_size')}KB` || this.maxFileSize,
1291
+ beforeRemoveFile: (deletedFile) => new Promise((resolve) => {
1292
+ this.removedHandler(deletedFile);
1293
+ resolve(true);
1294
+ }),
1295
+ });
1296
+ this.hiddenInput.addEventListener('invalid', e => {
1297
+ this.invalidInput.emit(e);
1298
+ });
1299
+ this.hiddenInput.addEventListener('change', () => {
1300
+ this.hiddenInput.setCustomValidity('');
1301
+ this.hiddenInput.reportValidity();
1302
+ });
1303
+ }
1304
+ get host() { return getElement(this); }
1305
+ };
1306
+ SallaFileUpload.style = sallaFileUploadCss;
1307
+
1308
+ const sallaQuantityInputCss = "";
1309
+
1310
+ const SallaQuantityInput = class {
1311
+ constructor(hostRef) {
1312
+ registerInstance(this, hostRef);
1313
+ /**
1314
+ * Based on store setting: store.settings.product.manual_quantity
1315
+ */
1316
+ this.disableInput = false;
1317
+ this.hostAttributes = {};
1318
+ this.hasIncrementSlot = false;
1319
+ this.hasDecrementSlot = false;
1320
+ this.didLoaded = false;
1321
+ this.quantity = 1;
1322
+ this.fireChangeEvent = true;
1323
+ }
1324
+ /**
1325
+ * Workaround to fire change event for the input.
1326
+ */
1327
+ watchPropHandler() {
1328
+ if (!this.didLoaded) {
1329
+ return;
1330
+ }
1331
+ if (!this.fireChangeEvent) {
1332
+ this.fireChangeEvent = true;
1333
+ return;
1334
+ }
1335
+ Helper.debounce(() => {
1336
+ salla.document.event.fireEvent(this.textInput, 'change', {
1337
+ bubbles: true,
1338
+ detail: { productId: this.cartItemId, quantity: this.quantity }
1339
+ });
1340
+ });
1341
+ }
1342
+ async componentWillLoad() {
1343
+ await salla.onReady();
1344
+ this.disableInput = !salla.config.get('store.settings.product.manual_quantity');
1345
+ this.quantity = parseInt(this.host.getAttribute('value')) || 1;
1346
+ this.hasIncrementSlot = !!this.host.querySelector('[slot="increment-button"]');
1347
+ this.hasDecrementSlot = !!this.host.querySelector('[slot="decrement-button"]');
1348
+ }
1349
+ componentDidLoad() {
1350
+ this.didLoaded = true;
1351
+ this.textInput.addEventListener('input', (event) => salla.helpers.inputDigitsOnly(event.target));
1352
+ }
1353
+ getInputAttributes() {
1354
+ for (let i = 0; i < this.host.attributes.length; i++) {
1355
+ if (!['id', 'value', 'min', 'class'].includes(this.host.attributes[i].name)) {
1356
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
1357
+ }
1358
+ }
1359
+ return this.hostAttributes;
1360
+ }
1361
+ /**
1362
+ * decrease quantity by one.
1363
+ * @return HTMLSallaQuantityInputElement
1364
+ */
1365
+ async decrease() {
1366
+ return this.setValue(this.quantity - 1);
1367
+ }
1368
+ /**
1369
+ * increase quantity by one.
1370
+ * @return HTMLSallaQuantityInputElement
1371
+ */
1372
+ async increase() {
1373
+ return this.setValue(Number(this.quantity) + 1);
1374
+ }
1375
+ /**
1376
+ * set quantity by one.
1377
+ * @return HTMLSallaQuantityInputElement
1378
+ */
1379
+ async setValue(value, fireChangeEvent = true) {
1380
+ this.fireChangeEvent = fireChangeEvent;
1381
+ let maxQuantity = parseInt(this.host.getAttribute('max'));
1382
+ if (maxQuantity && value > maxQuantity) {
1383
+ value = maxQuantity;
1384
+ }
1385
+ if (value <= 1) {
1386
+ value = 1;
1387
+ }
1388
+ this.quantity = value;
1389
+ return this.host;
1390
+ }
1391
+ render() {
1392
+ const inputAttributes = this.getInputAttributes();
1393
+ if (!inputAttributes['aria-label'] && !inputAttributes['aria-labelledby']) {
1394
+ inputAttributes['aria-label'] = salla.lang.getWithDefault('common.elements.quantity', 'Quantity');
1395
+ }
1396
+ return (h(Host, { key: 'ba636a941071cccc06a8fbcadf7a3ff93d88f4d0', class: "s-quantity-input" }, h("div", { key: '5fbe227ca172661fb8edc32940f586e7e26c8d46', class: "s-quantity-input-container" }, h("button", { key: 'dbdb3cbac199c2fb73ef49dcdb513ebd38f5f3b5', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button", "aria-label": salla.lang.getWithDefault('common.elements.increase_quantity', 'Increase quantity') }, !this.hasIncrementSlot ? h("span", { innerHTML: plusIcon }) : '', h("slot", { key: 'f117c437e73134ab4fe949c61190e38e4db81e44', name: "increment-button" })), h("input", { key: 'c41fd5bbb8760171462d3a5cc54ebe9ae54747fc', class: "s-quantity-input-input", ...inputAttributes, ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", readOnly: this.disableInput, value: this.quantity }), h("button", { key: '94ea2537b3deb379d9a07233e49d60fb3982784e', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button", "aria-label": salla.lang.getWithDefault('common.elements.decrease_quantity', 'Decrease quantity') }, !this.hasDecrementSlot ? h("span", { innerHTML: minusIcon }) : '', h("slot", { key: '4756e4069e6e16f92de72eefa99d48c3793d58cf', name: "decrement-button" })))));
1397
+ }
1398
+ get host() { return getElement(this); }
1399
+ static get watchers() { return {
1400
+ "quantity": ["watchPropHandler"]
1401
+ }; }
1402
+ };
1403
+ SallaQuantityInput.style = sallaQuantityInputCss;
1404
+
1405
+ const sallaTelInputCss = ".iti{width:100%;position:relative;display:inline-block}.iti *{box-sizing:border-box;-moz-box-sizing:border-box}.iti__hide{display:none}.iti__v-hide{visibility:hidden}.iti input,.iti input[type=text],.iti input[type=tel]{position:relative;z-index:0;direction:ltr !important;margin-top:0 !important;margin-bottom:0 !important;padding-left:95px !important;padding-right:15px !important;margin-left:0 !important}.iti__flag-container{width:100%;position:absolute;top:0;bottom:0;left:0;padding:1px}.iti__selected-flag{width:80px;z-index:1;position:relative;display:flex;align-items:center;height:100%;float:left;padding:0 15px;box-shadow:none !important;outline:none !important}.ltr .iti__selected-flag{justify-content:flex-end}.iti__selected-flag:before{content:\"\";display:block;width:1px;height:70%;background:#eee;position:absolute;top:15%;right:0}.iti__selected-flag .iti__flag{display:none}.iti__arrow{width:15px;height:15px;line-height:15px;position:absolute;left:10px;top:50%;transform:translateY(-50%)}.iti__arrow:after{content:url(\"data:image/svg+xml,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");font-size:16px;color:#999;opacity:0.65}.iti__arrow--up:after{transform:rotate(180deg)}.iti__country-list{width:100%;max-height:160px;position:absolute;top:100%;left:0;z-index:2;list-style:none;margin:0;padding:0;margin:5px 0 0 0;border-radius:5px;box-shadow:0px 2px 4px 2px rgba(0, 0, 0, 0.05);border:1px solid #f5f7f9;background-color:white;white-space:nowrap;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.iti__country-list::-webkit-scrollbar{width:4px}.dark .iti__country-list{background-color:rgb(82, 82, 91);border-color:rgb(82, 82, 91)}.iti__country-list li{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;padding:8px 10px;transition:background-color 0.3s}.iti__country-list li span{font-size:12px}.iti__country-list li:hover,.iti__country-list li.highlighted{background-color:rgba(0, 0, 0, 0.05)}.iti__country-list--dropup{bottom:100%;top:unset;margin:0 0 5px 0}@media (max-width: 500px){.iti__country-list{white-space:normal}}.iti__flag-box{display:inline-block;width:20px;margin:0 0 0 5px}.iti__divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #eee}.iti__country{padding:5px 10px;outline:none}.iti__dial-code{font-family:Arial;color:#999;unicode-bidi:plaintext;letter-spacing:1px}.iti__country.iti__highlight{background-color:rgba(0, 0, 0, 0.05)}.iti__flag-box,.iti__country-name,.iti__dial-code{vertical-align:middle}.iti__country-name{flex:auto;margin:0;padding:0 10px;white-space:normal;line-height:1.3}.iti--allow-dropdown .iti__flag-container,.iti--separate-dial-code .iti__flag-container{left:0}.iti--allow-dropdown .iti__flag-container:hover{cursor:pointer}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover{cursor:default}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover .iti__selected-flag,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover .iti__selected-flag{background-color:transparent}.iti--separate-dial-code .iti__selected-dial-code{unicode-bidi:plaintext;direction:ltr;letter-spacing:1px;font-family:\"Arial\", serif;font-size:13px}.iti--container{top:-18px !important;left:0 !important;padding:1px}.iti--container:hover{cursor:pointer}.iti-mobile .iti--container{inset:0;margin:20px;width:calc(100% - 40px);position:fixed;z-index:9999}.iti-mobile .iti__country-list{max-height:100%;width:100%;inset:0}.iti-mobile .iti__country{padding:10px 10px;line-height:1.5em}.iti__flag{width:20px}.iti__flag.iti__be{width:18px}.iti__flag.iti__ch{width:15px}.iti__flag.iti__mc{width:19px}.iti__flag.iti__ne{width:18px}.iti__flag.iti__np{width:13px}.iti__flag.iti__va{width:15px}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-size:5652px 15px}}.iti__flag.iti__ac{height:10px;background-position:0px 0px}.iti__flag.iti__ad{height:14px;background-position:-22px 0px}.iti__flag.iti__ae{height:10px;background-position:-44px 0px}.iti__flag.iti__af{height:14px;background-position:-66px 0px}.iti__flag.iti__ag{height:14px;background-position:-88px 0px}.iti__flag.iti__ai{height:10px;background-position:-110px 0px}.iti__flag.iti__al{height:15px;background-position:-132px 0px}.iti__flag.iti__am{height:10px;background-position:-154px 0px}.iti__flag.iti__ao{height:14px;background-position:-176px 0px}.iti__flag.iti__aq{height:14px;background-position:-198px 0px}.iti__flag.iti__ar{height:13px;background-position:-220px 0px}.iti__flag.iti__as{height:10px;background-position:-242px 0px}.iti__flag.iti__at{height:14px;background-position:-264px 0px}.iti__flag.iti__au{height:10px;background-position:-286px 0px}.iti__flag.iti__aw{height:14px;background-position:-308px 0px}.iti__flag.iti__ax{height:13px;background-position:-330px 0px}.iti__flag.iti__az{height:10px;background-position:-352px 0px}.iti__flag.iti__ba{height:10px;background-position:-374px 0px}.iti__flag.iti__bb{height:14px;background-position:-396px 0px}.iti__flag.iti__bd{height:12px;background-position:-418px 0px}.iti__flag.iti__be{height:15px;background-position:-440px 0px}.iti__flag.iti__bf{height:14px;background-position:-460px 0px}.iti__flag.iti__bg{height:12px;background-position:-482px 0px}.iti__flag.iti__bh{height:12px;background-position:-504px 0px}.iti__flag.iti__bi{height:12px;background-position:-526px 0px}.iti__flag.iti__bj{height:14px;background-position:-548px 0px}.iti__flag.iti__bl{height:14px;background-position:-570px 0px}.iti__flag.iti__bm{height:10px;background-position:-592px 0px}.iti__flag.iti__bn{height:10px;background-position:-614px 0px}.iti__flag.iti__bo{height:14px;background-position:-636px 0px}.iti__flag.iti__bq{height:14px;background-position:-658px 0px}.iti__flag.iti__br{height:14px;background-position:-680px 0px}.iti__flag.iti__bs{height:10px;background-position:-702px 0px}.iti__flag.iti__bt{height:14px;background-position:-724px 0px}.iti__flag.iti__bv{height:15px;background-position:-746px 0px}.iti__flag.iti__bw{height:14px;background-position:-768px 0px}.iti__flag.iti__by{height:10px;background-position:-790px 0px}.iti__flag.iti__bz{height:14px;background-position:-812px 0px}.iti__flag.iti__ca{height:10px;background-position:-834px 0px}.iti__flag.iti__cc{height:10px;background-position:-856px 0px}.iti__flag.iti__cd{height:15px;background-position:-878px 0px}.iti__flag.iti__cf{height:14px;background-position:-900px 0px}.iti__flag.iti__cg{height:14px;background-position:-922px 0px}.iti__flag.iti__ch{height:15px;background-position:-944px 0px}.iti__flag.iti__ci{height:14px;background-position:-961px 0px}.iti__flag.iti__ck{height:10px;background-position:-983px 0px}.iti__flag.iti__cl{height:14px;background-position:-1005px 0px}.iti__flag.iti__cm{height:14px;background-position:-1027px 0px}.iti__flag.iti__cn{height:14px;background-position:-1049px 0px}.iti__flag.iti__co{height:14px;background-position:-1071px 0px}.iti__flag.iti__cp{height:14px;background-position:-1093px 0px}.iti__flag.iti__cr{height:12px;background-position:-1115px 0px}.iti__flag.iti__cu{height:10px;background-position:-1137px 0px}.iti__flag.iti__cv{height:12px;background-position:-1159px 0px}.iti__flag.iti__cw{height:14px;background-position:-1181px 0px}.iti__flag.iti__cx{height:10px;background-position:-1203px 0px}.iti__flag.iti__cy{height:14px;background-position:-1225px 0px}.iti__flag.iti__cz{height:14px;background-position:-1247px 0px}.iti__flag.iti__de{height:12px;background-position:-1269px 0px}.iti__flag.iti__dg{height:10px;background-position:-1291px 0px}.iti__flag.iti__dj{height:14px;background-position:-1313px 0px}.iti__flag.iti__dk{height:15px;background-position:-1335px 0px}.iti__flag.iti__dm{height:10px;background-position:-1357px 0px}.iti__flag.iti__do{height:14px;background-position:-1379px 0px}.iti__flag.iti__dz{height:14px;background-position:-1401px 0px}.iti__flag.iti__ea{height:14px;background-position:-1423px 0px}.iti__flag.iti__ec{height:14px;background-position:-1445px 0px}.iti__flag.iti__ee{height:13px;background-position:-1467px 0px}.iti__flag.iti__eg{height:14px;background-position:-1489px 0px}.iti__flag.iti__eh{height:10px;background-position:-1511px 0px}.iti__flag.iti__er{height:10px;background-position:-1533px 0px}.iti__flag.iti__es{height:14px;background-position:-1555px 0px}.iti__flag.iti__et{height:10px;background-position:-1577px 0px}.iti__flag.iti__eu{height:14px;background-position:-1599px 0px}.iti__flag.iti__fi{height:12px;background-position:-1621px 0px}.iti__flag.iti__fj{height:10px;background-position:-1643px 0px}.iti__flag.iti__fk{height:10px;background-position:-1665px 0px}.iti__flag.iti__fm{height:11px;background-position:-1687px 0px}.iti__flag.iti__fo{height:15px;background-position:-1709px 0px}.iti__flag.iti__fr{height:14px;background-position:-1731px 0px}.iti__flag.iti__ga{height:15px;background-position:-1753px 0px}.iti__flag.iti__gb{height:10px;background-position:-1775px 0px}.iti__flag.iti__gd{height:12px;background-position:-1797px 0px}.iti__flag.iti__ge{height:14px;background-position:-1819px 0px}.iti__flag.iti__gf{height:14px;background-position:-1841px 0px}.iti__flag.iti__gg{height:14px;background-position:-1863px 0px}.iti__flag.iti__gh{height:14px;background-position:-1885px 0px}.iti__flag.iti__gi{height:10px;background-position:-1907px 0px}.iti__flag.iti__gl{height:14px;background-position:-1929px 0px}.iti__flag.iti__gm{height:14px;background-position:-1951px 0px}.iti__flag.iti__gn{height:14px;background-position:-1973px 0px}.iti__flag.iti__gp{height:14px;background-position:-1995px 0px}.iti__flag.iti__gq{height:14px;background-position:-2017px 0px}.iti__flag.iti__gr{height:14px;background-position:-2039px 0px}.iti__flag.iti__gs{height:10px;background-position:-2061px 0px}.iti__flag.iti__gt{height:13px;background-position:-2083px 0px}.iti__flag.iti__gu{height:11px;background-position:-2105px 0px}.iti__flag.iti__gw{height:10px;background-position:-2127px 0px}.iti__flag.iti__gy{height:12px;background-position:-2149px 0px}.iti__flag.iti__hk{height:14px;background-position:-2171px 0px}.iti__flag.iti__hm{height:10px;background-position:-2193px 0px}.iti__flag.iti__hn{height:10px;background-position:-2215px 0px}.iti__flag.iti__hr{height:10px;background-position:-2237px 0px}.iti__flag.iti__ht{height:12px;background-position:-2259px 0px}.iti__flag.iti__hu{height:10px;background-position:-2281px 0px}.iti__flag.iti__ic{height:14px;background-position:-2303px 0px}.iti__flag.iti__id{height:14px;background-position:-2325px 0px}.iti__flag.iti__ie{height:10px;background-position:-2347px 0px}.iti__flag.iti__il{height:15px;background-position:-2369px 0px}.iti__flag.iti__im{height:10px;background-position:-2391px 0px}.iti__flag.iti__in{height:14px;background-position:-2413px 0px}.iti__flag.iti__io{height:10px;background-position:-2435px 0px}.iti__flag.iti__iq{height:14px;background-position:-2457px 0px}.iti__flag.iti__ir{height:12px;background-position:-2479px 0px}.iti__flag.iti__is{height:15px;background-position:-2501px 0px}.iti__flag.iti__it{height:14px;background-position:-2523px 0px}.iti__flag.iti__je{height:12px;background-position:-2545px 0px}.iti__flag.iti__jm{height:10px;background-position:-2567px 0px}.iti__flag.iti__jo{height:10px;background-position:-2589px 0px}.iti__flag.iti__jp{height:14px;background-position:-2611px 0px}.iti__flag.iti__ke{height:14px;background-position:-2633px 0px}.iti__flag.iti__kg{height:12px;background-position:-2655px 0px}.iti__flag.iti__kh{height:13px;background-position:-2677px 0px}.iti__flag.iti__ki{height:10px;background-position:-2699px 0px}.iti__flag.iti__km{height:12px;background-position:-2721px 0px}.iti__flag.iti__kn{height:14px;background-position:-2743px 0px}.iti__flag.iti__kp{height:10px;background-position:-2765px 0px}.iti__flag.iti__kr{height:14px;background-position:-2787px 0px}.iti__flag.iti__kw{height:10px;background-position:-2809px 0px}.iti__flag.iti__ky{height:10px;background-position:-2831px 0px}.iti__flag.iti__kz{height:10px;background-position:-2853px 0px}.iti__flag.iti__la{height:14px;background-position:-2875px 0px}.iti__flag.iti__lb{height:14px;background-position:-2897px 0px}.iti__flag.iti__lc{height:10px;background-position:-2919px 0px}.iti__flag.iti__li{height:12px;background-position:-2941px 0px}.iti__flag.iti__lk{height:10px;background-position:-2963px 0px}.iti__flag.iti__lr{height:11px;background-position:-2985px 0px}.iti__flag.iti__ls{height:14px;background-position:-3007px 0px}.iti__flag.iti__lt{height:12px;background-position:-3029px 0px}.iti__flag.iti__lu{height:12px;background-position:-3051px 0px}.iti__flag.iti__lv{height:10px;background-position:-3073px 0px}.iti__flag.iti__ly{height:10px;background-position:-3095px 0px}.iti__flag.iti__ma{height:14px;background-position:-3117px 0px}.iti__flag.iti__mc{height:15px;background-position:-3139px 0px}.iti__flag.iti__md{height:10px;background-position:-3160px 0px}.iti__flag.iti__me{height:10px;background-position:-3182px 0px}.iti__flag.iti__mf{height:14px;background-position:-3204px 0px}.iti__flag.iti__mg{height:14px;background-position:-3226px 0px}.iti__flag.iti__mh{height:11px;background-position:-3248px 0px}.iti__flag.iti__mk{height:10px;background-position:-3270px 0px}.iti__flag.iti__ml{height:14px;background-position:-3292px 0px}.iti__flag.iti__mm{height:14px;background-position:-3314px 0px}.iti__flag.iti__mn{height:10px;background-position:-3336px 0px}.iti__flag.iti__mo{height:14px;background-position:-3358px 0px}.iti__flag.iti__mp{height:10px;background-position:-3380px 0px}.iti__flag.iti__mq{height:14px;background-position:-3402px 0px}.iti__flag.iti__mr{height:14px;background-position:-3424px 0px}.iti__flag.iti__ms{height:10px;background-position:-3446px 0px}.iti__flag.iti__mt{height:14px;background-position:-3468px 0px}.iti__flag.iti__mu{height:14px;background-position:-3490px 0px}.iti__flag.iti__mv{height:14px;background-position:-3512px 0px}.iti__flag.iti__mw{height:14px;background-position:-3534px 0px}.iti__flag.iti__mx{height:12px;background-position:-3556px 0px}.iti__flag.iti__my{height:10px;background-position:-3578px 0px}.iti__flag.iti__mz{height:14px;background-position:-3600px 0px}.iti__flag.iti__na{height:14px;background-position:-3622px 0px}.iti__flag.iti__nc{height:10px;background-position:-3644px 0px}.iti__flag.iti__ne{height:15px;background-position:-3666px 0px}.iti__flag.iti__nf{height:10px;background-position:-3686px 0px}.iti__flag.iti__ng{height:10px;background-position:-3708px 0px}.iti__flag.iti__ni{height:12px;background-position:-3730px 0px}.iti__flag.iti__nl{height:14px;background-position:-3752px 0px}.iti__flag.iti__no{height:15px;background-position:-3774px 0px}.iti__flag.iti__np{height:15px;background-position:-3796px 0px}.iti__flag.iti__nr{height:10px;background-position:-3811px 0px}.iti__flag.iti__nu{height:10px;background-position:-3833px 0px}.iti__flag.iti__nz{height:10px;background-position:-3855px 0px}.iti__flag.iti__om{height:10px;background-position:-3877px 0px}.iti__flag.iti__pa{height:14px;background-position:-3899px 0px}.iti__flag.iti__pe{height:14px;background-position:-3921px 0px}.iti__flag.iti__pf{height:14px;background-position:-3943px 0px}.iti__flag.iti__pg{height:15px;background-position:-3965px 0px}.iti__flag.iti__ph{height:10px;background-position:-3987px 0px}.iti__flag.iti__pk{height:14px;background-position:-4009px 0px}.iti__flag.iti__pl{height:13px;background-position:-4031px 0px}.iti__flag.iti__pm{height:14px;background-position:-4053px 0px}.iti__flag.iti__pn{height:10px;background-position:-4075px 0px}.iti__flag.iti__pr{height:14px;background-position:-4097px 0px}.iti__flag.iti__ps{height:10px;background-position:-4119px 0px}.iti__flag.iti__pt{height:14px;background-position:-4141px 0px}.iti__flag.iti__pw{height:13px;background-position:-4163px 0px}.iti__flag.iti__py{height:11px;background-position:-4185px 0px}.iti__flag.iti__qa{height:8px;background-position:-4207px 0px}.iti__flag.iti__re{height:14px;background-position:-4229px 0px}.iti__flag.iti__ro{height:14px;background-position:-4251px 0px}.iti__flag.iti__rs{height:14px;background-position:-4273px 0px}.iti__flag.iti__ru{height:14px;background-position:-4295px 0px}.iti__flag.iti__rw{height:14px;background-position:-4317px 0px}.iti__flag.iti__sa{height:14px;background-position:-4339px 0px}.iti__flag.iti__sb{height:10px;background-position:-4361px 0px}.iti__flag.iti__sc{height:10px;background-position:-4383px 0px}.iti__flag.iti__sd{height:10px;background-position:-4405px 0px}.iti__flag.iti__se{height:13px;background-position:-4427px 0px}.iti__flag.iti__sg{height:14px;background-position:-4449px 0px}.iti__flag.iti__sh{height:10px;background-position:-4471px 0px}.iti__flag.iti__si{height:10px;background-position:-4493px 0px}.iti__flag.iti__sj{height:15px;background-position:-4515px 0px}.iti__flag.iti__sk{height:14px;background-position:-4537px 0px}.iti__flag.iti__sl{height:14px;background-position:-4559px 0px}.iti__flag.iti__sm{height:15px;background-position:-4581px 0px}.iti__flag.iti__sn{height:14px;background-position:-4603px 0px}.iti__flag.iti__so{height:14px;background-position:-4625px 0px}.iti__flag.iti__sr{height:14px;background-position:-4647px 0px}.iti__flag.iti__ss{height:10px;background-position:-4669px 0px}.iti__flag.iti__st{height:10px;background-position:-4691px 0px}.iti__flag.iti__sv{height:12px;background-position:-4713px 0px}.iti__flag.iti__sx{height:14px;background-position:-4735px 0px}.iti__flag.iti__sy{height:14px;background-position:-4757px 0px}.iti__flag.iti__sz{height:14px;background-position:-4779px 0px}.iti__flag.iti__ta{height:10px;background-position:-4801px 0px}.iti__flag.iti__tc{height:10px;background-position:-4823px 0px}.iti__flag.iti__td{height:14px;background-position:-4845px 0px}.iti__flag.iti__tf{height:14px;background-position:-4867px 0px}.iti__flag.iti__tg{height:13px;background-position:-4889px 0px}.iti__flag.iti__th{height:14px;background-position:-4911px 0px}.iti__flag.iti__tj{height:10px;background-position:-4933px 0px}.iti__flag.iti__tk{height:10px;background-position:-4955px 0px}.iti__flag.iti__tl{height:10px;background-position:-4977px 0px}.iti__flag.iti__tm{height:14px;background-position:-4999px 0px}.iti__flag.iti__tn{height:14px;background-position:-5021px 0px}.iti__flag.iti__to{height:10px;background-position:-5043px 0px}.iti__flag.iti__tr{height:14px;background-position:-5065px 0px}.iti__flag.iti__tt{height:12px;background-position:-5087px 0px}.iti__flag.iti__tv{height:10px;background-position:-5109px 0px}.iti__flag.iti__tw{height:14px;background-position:-5131px 0px}.iti__flag.iti__tz{height:14px;background-position:-5153px 0px}.iti__flag.iti__ua{height:14px;background-position:-5175px 0px}.iti__flag.iti__ug{height:14px;background-position:-5197px 0px}.iti__flag.iti__um{height:11px;background-position:-5219px 0px}.iti__flag.iti__un{height:14px;background-position:-5241px 0px}.iti__flag.iti__us{height:11px;background-position:-5263px 0px}.iti__flag.iti__uy{height:14px;background-position:-5285px 0px}.iti__flag.iti__uz{height:10px;background-position:-5307px 0px}.iti__flag.iti__va{height:15px;background-position:-5329px 0px}.iti__flag.iti__vc{height:14px;background-position:-5346px 0px}.iti__flag.iti__ve{height:14px;background-position:-5368px 0px}.iti__flag.iti__vg{height:10px;background-position:-5390px 0px}.iti__flag.iti__vi{height:14px;background-position:-5412px 0px}.iti__flag.iti__vn{height:14px;background-position:-5434px 0px}.iti__flag.iti__vu{height:12px;background-position:-5456px 0px}.iti__flag.iti__wf{height:14px;background-position:-5478px 0px}.iti__flag.iti__ws{height:10px;background-position:-5500px 0px}.iti__flag.iti__xk{height:15px;background-position:-5522px 0px}.iti__flag.iti__ye{height:14px;background-position:-5544px 0px}.iti__flag.iti__yt{height:14px;background-position:-5566px 0px}.iti__flag.iti__za{height:14px;background-position:-5588px 0px}.iti__flag.iti__zm{height:14px;background-position:-5610px 0px}.iti__flag.iti__zw{height:10px;background-position:-5632px 0px}.iti__flag{height:15px;box-shadow:0px 0px 1px 0px #888;background-image:url(\"https://cdn.salla.network/images/flags.png\");background-repeat:no-repeat;background-color:#f5f7f9;background-position:20px 0}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-image:url(\"https://cdn.salla.network/images/flags@2x.png\")}}.iti__flag.iti__np{background-color:transparent}";
1406
+
1407
+ const SallaTelInput = class {
1408
+ /**
1409
+ * Lazy load intl-tel-input library
1410
+ * This reduces initial bundle size by ~80-90KB
1411
+ */
1412
+ async loadTelInput() {
1413
+ if (this.TelInput)
1414
+ return;
1415
+ try {
1416
+ const telInputModule = await import('./index-BLw7mdtM.js').then(function (n) { return n.i; });
1417
+ this.TelInput = telInputModule.default;
1418
+ }
1419
+ catch (error) {
1420
+ console.error('Failed to load Tel Input:', error);
1421
+ salla.notify?.error?.('Failed to load phone input. Please refresh the page.');
1422
+ throw error;
1423
+ }
1424
+ }
1425
+ constructor(hostRef) {
1426
+ registerInstance(this, hostRef);
1427
+ this.phoneEntered = createEvent(this, "phoneEntered");
1428
+ /**
1429
+ * input name
1430
+ */
1431
+ this.name = 'phone';
1432
+ /**
1433
+ * input name
1434
+ */
1435
+ this.disabled = false;
1436
+ /**
1437
+ * Current country_code
1438
+ */
1439
+ this.countryCode = salla.config.get('user.country_code', 'SA') || 'SA';
1440
+ this.countryCodeLabel = salla.lang.get('common.country_code');
1441
+ this.mobileLabel = salla.lang.get('common.elements.mobile');
1442
+ this.tooShort = salla.lang.get('common.errors.too_short', { attribute: this.mobileLabel });
1443
+ this.tooLong = salla.lang.get('common.errors.too_long', { attribute: this.mobileLabel });
1444
+ this.invalidCountryCode = salla.lang.get('common.errors.invalid_value', { attribute: this.countryCodeLabel });
1445
+ this.invalidNumber = salla.lang.get('common.errors.invalid_value', { attribute: this.mobileLabel });
1446
+ this.errorMap = [this.invalidNumber, this.invalidCountryCode, this.tooShort, this.tooLong, this.invalidNumber];
1447
+ salla.lang.onLoaded(() => {
1448
+ this.mobileLabel = salla.lang.get('common.elements.mobile');
1449
+ this.countryCodeLabel = salla.lang.get('common.elements.country_code');
1450
+ this.invalidNumber = salla.lang.get('common.errors.invalid_value', { attribute: this.mobileLabel });
1451
+ this.invalidCountryCode = salla.lang.get('common.errors.invalid_value', { attribute: this.countryCodeLabel });
1452
+ this.tooShort = salla.lang.get('common.errors.too_short', { attribute: this.mobileLabel });
1453
+ this.tooLong = salla.lang.get('common.errors.too_long', { attribute: this.mobileLabel });
1454
+ this.mobileRequired = salla.lang.get('common.errors.field_required', { attribute: this.mobileLabel });
1455
+ this.errorMap = [this.invalidNumber, this.invalidCountryCode, this.tooShort, this.tooLong, this.invalidNumber];
1456
+ });
1457
+ }
1458
+ /**
1459
+ * Get current values
1460
+ * @return {{mobile:number,countryCode:'SA'|string}}
1461
+ */
1462
+ async getValues() {
1463
+ return {
1464
+ [this.name]: this.phone = this.phoneInput.value,
1465
+ countryCode: this.countryCode = this.countryCodeInput.value,
1466
+ countryKey: this.host.querySelector('.iti__selected-dial-code').innerText
1467
+ };
1468
+ }
1469
+ /**
1470
+ * Is current data valid or not
1471
+ * @return {boolean}
1472
+ */
1473
+ async isValid() {
1474
+ this.reset();
1475
+ if (this.iti.isValidNumber())
1476
+ return true;
1477
+ if (!this.phoneInput.value.trim()) {
1478
+ this.phoneInput.classList.add("s-has-error");
1479
+ this.errorMsg.innerText = this.mobileRequired || 'The mobile is required';
1480
+ return;
1481
+ }
1482
+ this.phoneInput.classList.add("s-has-error");
1483
+ let errorCode = this.iti.getValidationError();
1484
+ this.errorMsg.innerText = this.errorMap[errorCode] || '';
1485
+ salla.logger.info('Phone number (' + this.countryCode + ' - ' + this.phone + ') is not valid, error code ' + errorCode);
1486
+ return false;
1487
+ }
1488
+ async initTelInput() {
1489
+ // Load intl-tel-input before initializing
1490
+ await this.loadTelInput();
1491
+ salla.helpers.inputDigitsOnly(this.phoneInput);
1492
+ this.iti = this.TelInput(this.phoneInput, {
1493
+ initialCountry: this.countryCode?.toLowerCase() || 'sa',
1494
+ preferredCountries: ['sa', 'ae', 'kw', 'bh', 'qa', 'iq', 'om', 'ye', 'eg', 'jo', 'ps', 'sd', 'lb', 'dz', 'tn', 'ma', 'ly'],
1495
+ excludeCountries: ['sy', 'ir', 'cu', 'kp'],
1496
+ formatOnDisplay: false,
1497
+ separateDialCode: true,
1498
+ autoPlaceholder: 'aggressive',
1499
+ utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/21.2.7/js/utils.min.js',
1500
+ dropdownContainer: this.host
1501
+ });
1502
+ this.autofocus && this.phoneInput.focus();
1503
+ this.phoneInput.addEventListener("countrychange", () => {
1504
+ let data = this.iti.getSelectedCountryData();
1505
+ let value = data.iso2.toUpperCase();
1506
+ this.countryCodeInput.value = value;
1507
+ this.countryCode = value;
1508
+ this.phoneEntered.emit({ number: this.phone, country_code: value });
1509
+ });
1510
+ // on blur: validate
1511
+ // this.phoneInput.addEventListener('blur', () => this.isValid());
1512
+ // on keyup / change flag: reset
1513
+ this.phoneInput.addEventListener('input', (e) => {
1514
+ salla.helpers.inputDigitsOnly(e.target);
1515
+ this.reset();
1516
+ this.phoneEntered.emit({ number: e.target.value, country_code: this.countryCode });
1517
+ });
1518
+ }
1519
+ reset() {
1520
+ this.phoneInput.classList.remove("s-has-error");
1521
+ this.errorMsg.innerHTML = "";
1522
+ }
1523
+ ;
1524
+ handleCountryInput(event) {
1525
+ if (!!this.phone) {
1526
+ this.phoneEntered.emit({ number: event.target.value, country_code: this.countryCode });
1527
+ }
1528
+ }
1529
+ render() {
1530
+ return (h(Host, { key: '362e48d1b39b0715c10df0c15c730ca21793a46b', class: "s-tel-input" }, h("input", { key: '07dcb2fcf639c2d7b95c250079bd24a80441e0ca', type: "tel", disabled: this.disabled, name: this.name, value: this.phone, onChange: (event) => this.handleCountryInput(event), ref: el => this.phoneInput = el, enterkeyhint: "next", autocomplete: "tel", class: "s-tel-input-control tel-input s-ltr" }), h("span", { key: 'c50f81a50debf37dc92f81fc61c3ddd3e622031f', class: "s-tel-input-error-msg", ref: el => this.errorMsg = el }), h("input", { key: '2217131b313a32c5b62dcce6132a4914f30dc005', type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" })));
1531
+ }
1532
+ componentDidLoad() {
1533
+ this.initTelInput();
1534
+ }
1535
+ get host() { return getElement(this); }
1536
+ };
1537
+ SallaTelInput.style = sallaTelInputCss;
1538
+
1539
+ export { SallaBookingField as salla_booking_field, SallaColorPicker as salla_color_picker, SallaConditionalFields as salla_conditional_fields, SallaDatetimePicker as salla_datetime_picker, SallaFileUpload as salla_file_upload, SallaQuantityInput as salla_quantity_input, SallaTelInput as salla_tel_input };