@salla.sa/twilight-components 2.14.450 → 2.14.452
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.
- package/dist/cjs/{filepond-u7zONIpU.js → filepond-CUDa4yzK.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DPE2-7A4.js → filepond-plugin-file-poster-ZBZ4eV18.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-QFJIY-td.js → filepond-plugin-file-validate-size-MuHAoRee.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CqUNeom7.js → filepond-plugin-file-validate-type-YJnozwws.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-B2Z3rRkn.js → filepond-plugin-image-edit-DoGvWbfA.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DxoN6Z-R.js → filepond-plugin-image-exif-orientation-DHT3msJG.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-doqEZlz_.js → filepond-plugin-image-preview-Cilr0qGC.js} +1 -1
- package/dist/cjs/{functions-CZozSu7O.js → functions-BD36RfEv.js} +1 -1
- package/dist/cjs/{index-CCSZWnkr.js → index-B3yg95Y_.js} +1 -1
- package/dist/cjs/{index-tPF0UB3W.js → index-D-llXlYu.js} +12 -7
- package/dist/cjs/index.esm-DOwgk2YK.js +2444 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +21 -17
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +4611 -24
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/{tracked-promise-DVCwmpuo.js → tracked-promise-XWqMedEM.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DQ8iQ9l5.js → vanilla-picker-DuVcVt-y.js} +1 -1
- package/dist/collection/assets/svg/location-tag.svg +10 -0
- package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +20 -16
- package/dist/collection/components/salla-bullet-delivery/api-service.js +6 -0
- package/dist/collection/components/salla-bullet-delivery/helpers.js +3 -1
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +128 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +195 -20
- package/dist/components/index.esm.js +2424 -0
- package/dist/components/index.js +8 -3
- package/dist/components/salla-bottom-alert.js +20 -16
- package/dist/components/salla-bullet-delivery.js +4644 -51
- package/dist/esm/{filepond-N1L04Plt.js → filepond-B8YVLlGK.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-2E1WZVzP.js → filepond-plugin-file-poster-BVHkBLq8.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-C0LhcfOR.js → filepond-plugin-file-validate-size-Cq7xe76f.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-Be8IgUh8.js → filepond-plugin-file-validate-type-CTsg2jzF.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CFFuq7E_.js → filepond-plugin-image-edit-B_lgP65N.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DPCeA1B5.js → filepond-plugin-image-exif-orientation-CiQmLZE0.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CEvNq5JJ.js → filepond-plugin-image-preview-DEDwRroB.js} +1 -1
- package/dist/esm/{functions-Ba6VuRnB.js → functions-BTVjvurG.js} +1 -1
- package/dist/esm/{index-CrNw20pf.js → index-Dimo1ZpU.js} +12 -7
- package/dist/esm/{index-IqFJsnTE.js → index-iyZKRGHO.js} +1 -1
- package/dist/esm/index.esm-BkPzCq-C.js +2424 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +21 -17
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +10 -10
- package/dist/esm/salla-bullet-delivery_2.entry.js +4646 -59
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner.entry.js +2 -2
- package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card_2.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-reward-action_4.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/{tracked-promise-DH7_DYgQ.js → tracked-promise-CvY0ZPlq.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-NvsTGeIC.js → vanilla-picker-DR-rCO7V.js} +1 -1
- package/dist/twilight/{p-446bfa5f.entry.js → p-02189879.entry.js} +1 -1
- package/dist/twilight/{p-5c07ab28.entry.js → p-023b2fdd.entry.js} +1 -1
- package/dist/twilight/{p-1633e09a.entry.js → p-02abc240.entry.js} +1 -1
- package/dist/twilight/{p-c42fd7ea.entry.js → p-06ba7dd1.entry.js} +1 -1
- package/dist/twilight/{p-120ca46f.entry.js → p-0d1154bf.entry.js} +1 -1
- package/dist/twilight/{p-6ffe65f2.entry.js → p-0f6b0f92.entry.js} +1 -1
- package/dist/twilight/{p-f83a4131.entry.js → p-16339bf0.entry.js} +1 -1
- package/dist/twilight/{p-c8ad8625.entry.js → p-17b94783.entry.js} +1 -1
- package/dist/twilight/p-1af6d934.entry.js +4 -0
- package/dist/twilight/{p-f47cd970.entry.js → p-1b859261.entry.js} +1 -1
- package/dist/twilight/{p-3d7d52b9.entry.js → p-1e2f547d.entry.js} +1 -1
- package/dist/twilight/{p-3649da70.entry.js → p-206e6265.entry.js} +1 -1
- package/dist/twilight/{p-e034fe03.entry.js → p-266aa19a.entry.js} +1 -1
- package/dist/twilight/{p-00a2d304.entry.js → p-2b1d0041.entry.js} +1 -1
- package/dist/twilight/{p-ff148d38.entry.js → p-3e541136.entry.js} +1 -1
- package/dist/twilight/{p-5395aed1.entry.js → p-41db9b1a.entry.js} +1 -1
- package/dist/twilight/{p-46301bdd.entry.js → p-43a4763b.entry.js} +1 -1
- package/dist/twilight/{p-1726199f.entry.js → p-4523e5c0.entry.js} +1 -1
- package/dist/twilight/{p-77c69000.entry.js → p-453e432c.entry.js} +1 -1
- package/dist/twilight/{p-f011898b.entry.js → p-46039e28.entry.js} +1 -1
- package/dist/twilight/p-48da0c37.entry.js +1019 -0
- package/dist/twilight/p-4901594b.entry.js +4 -0
- package/dist/twilight/{p-eec8f211.entry.js → p-4a242b08.entry.js} +1 -1
- package/dist/twilight/{p-ba68d83b.entry.js → p-4d6914e5.entry.js} +1 -1
- package/dist/twilight/{p-bd790b16.entry.js → p-4e90d0fb.entry.js} +1 -1
- package/dist/twilight/{p-942e5b3e.entry.js → p-5088b883.entry.js} +1 -1
- package/dist/twilight/{p-a22fd70d.entry.js → p-5d44c12a.entry.js} +1 -1
- package/dist/twilight/{p-4896533c.entry.js → p-60b9640d.entry.js} +1 -1
- package/dist/twilight/{p-cf3d3103.entry.js → p-615626cd.entry.js} +1 -1
- package/dist/twilight/{p-a68644af.entry.js → p-6342b0a5.entry.js} +1 -1
- package/dist/twilight/{p-9b225829.entry.js → p-63c68634.entry.js} +1 -1
- package/dist/twilight/{p-82fdf4e7.entry.js → p-63e74f12.entry.js} +1 -1
- package/dist/twilight/{p-7988b7a5.entry.js → p-642345d6.entry.js} +1 -1
- package/dist/twilight/{p-771ca405.entry.js → p-653b4634.entry.js} +1 -1
- package/dist/twilight/{p-5e4a9088.entry.js → p-6802c454.entry.js} +1 -1
- package/dist/twilight/{p-c5e14a6d.entry.js → p-6b1aeef4.entry.js} +1 -1
- package/dist/twilight/{p-4818c549.entry.js → p-6bc83d28.entry.js} +1 -1
- package/dist/twilight/{p-9d9da993.entry.js → p-6eb716e9.entry.js} +1 -1
- package/dist/twilight/{p-83b70db5.entry.js → p-74bb0829.entry.js} +1 -1
- package/dist/twilight/{p-bac02561.entry.js → p-75f69c89.entry.js} +1 -1
- package/dist/twilight/{p-4b9070f7.entry.js → p-7edf9c5f.entry.js} +1 -1
- package/dist/twilight/{p-c1ab6774.entry.js → p-7f07b3db.entry.js} +1 -1
- package/dist/twilight/{p-1fe09ed1.entry.js → p-81288fd1.entry.js} +1 -1
- package/dist/twilight/{p-57a86efd.entry.js → p-81741aef.entry.js} +1 -1
- package/dist/twilight/{p-eff611b9.entry.js → p-884a8742.entry.js} +1 -1
- package/dist/twilight/{p-bf7f213d.entry.js → p-8eb1ea0f.entry.js} +1 -1
- package/dist/twilight/{p-2774b070.entry.js → p-8f197b19.entry.js} +1 -1
- package/dist/twilight/{p-033c9e98.entry.js → p-8f93bae7.entry.js} +1 -1
- package/dist/twilight/{p-f7376365.entry.js → p-8f9cf7be.entry.js} +1 -1
- package/dist/twilight/{p-7f99f835.entry.js → p-90933152.entry.js} +1 -1
- package/dist/twilight/{p-fc540bfc.entry.js → p-9612e6b1.entry.js} +1 -1
- package/dist/twilight/{p-b9922101.entry.js → p-965ca629.entry.js} +1 -1
- package/dist/twilight/p-98a1855a.entry.js +4 -0
- package/dist/twilight/{p-40ea40b7.entry.js → p-99299763.entry.js} +1 -1
- package/dist/twilight/{p-4c69d380.entry.js → p-9c2d73d6.entry.js} +1 -1
- package/dist/twilight/{p-Cq2l9LEk.js → p-BLQ1h81p.js} +1 -1
- package/dist/twilight/p-BkPzCq-C.js +4 -0
- package/dist/twilight/{p-Cb-27f78.js → p-C6CshMy7.js} +1 -1
- package/dist/twilight/{p-CcwaGQ9_.js → p-C_of-n0U.js} +1 -1
- package/dist/twilight/{p-CzMGWnoB.js → p-D70qx2vr.js} +1 -1
- package/dist/twilight/p-D82DKoi_.js +4 -0
- package/dist/twilight/{p-BZ_8M_tQ.js → p-DNGUZSFZ.js} +1 -1
- package/dist/twilight/{p-oPliK7PL.js → p-Dd4Vpmci.js} +1 -1
- package/dist/twilight/p-Dimo1ZpU.js +5 -0
- package/dist/twilight/{p-DD5p3dqh.js → p-Dxrx9S2J.js} +1 -1
- package/dist/twilight/{p-D1BtXmLB.js → p-ESYTDRNV.js} +1 -1
- package/dist/twilight/{p-C0GYDeEy.js → p-JpkF-q4E.js} +1 -1
- package/dist/twilight/{p-13160d7a.entry.js → p-a1add8d1.entry.js} +1 -1
- package/dist/twilight/{p-53b1b8dd.entry.js → p-a1c2765d.entry.js} +1 -1
- package/dist/twilight/{p-886d3ea9.entry.js → p-a64332cc.entry.js} +1 -1
- package/dist/twilight/{p-380c9f58.entry.js → p-a7a021e1.entry.js} +1 -1
- package/dist/twilight/{p-d36d4dd0.entry.js → p-a86e5802.entry.js} +1 -1
- package/dist/twilight/{p-1a624e8e.entry.js → p-ab456964.entry.js} +1 -1
- package/dist/twilight/{p-dabf3edb.entry.js → p-ac57d9b4.entry.js} +1 -1
- package/dist/twilight/{p-81362474.entry.js → p-addd0fd8.entry.js} +1 -1
- package/dist/twilight/{p-2fea82d1.entry.js → p-b40525ea.entry.js} +1 -1
- package/dist/twilight/{p-36b79398.entry.js → p-b4a2e25b.entry.js} +1 -1
- package/dist/twilight/{p-20ca668a.entry.js → p-b5640db5.entry.js} +1 -1
- package/dist/twilight/{p-368d6551.entry.js → p-b8eedf15.entry.js} +1 -1
- package/dist/twilight/{p-1184e75d.entry.js → p-b973cdeb.entry.js} +1 -1
- package/dist/twilight/{p-42d531d7.entry.js → p-bc324586.entry.js} +1 -1
- package/dist/twilight/{p-bca94624.entry.js → p-bc633001.entry.js} +1 -1
- package/dist/twilight/{p-09a25c7b.entry.js → p-bd2364b9.entry.js} +1 -1
- package/dist/twilight/{p-7679487d.entry.js → p-bd36fa14.entry.js} +1 -1
- package/dist/twilight/{p-db9d3135.entry.js → p-be39695f.entry.js} +1 -1
- package/dist/twilight/{p-d62d8969.entry.js → p-c19843de.entry.js} +1 -1
- package/dist/twilight/{p-f0320140.entry.js → p-c2a09e77.entry.js} +1 -1
- package/dist/twilight/{p-6a5e3e9b.entry.js → p-c5d58f7b.entry.js} +1 -1
- package/dist/twilight/{p-3160ed65.entry.js → p-cb7c5983.entry.js} +1 -1
- package/dist/twilight/{p-3bfc8662.entry.js → p-cc748f8d.entry.js} +1 -1
- package/dist/twilight/{p-33369508.entry.js → p-cf518897.entry.js} +1 -1
- package/dist/twilight/{p-84daf1b1.entry.js → p-cfa61a61.entry.js} +1 -1
- package/dist/twilight/{p-9b14cfd6.entry.js → p-d061531b.entry.js} +1 -1
- package/dist/twilight/{p-4508f1ad.entry.js → p-d288d199.entry.js} +1 -1
- package/dist/twilight/{p-50fd3bb0.entry.js → p-de91804b.entry.js} +1 -1
- package/dist/twilight/{p-3feb7ca8.entry.js → p-df78511a.entry.js} +1 -1
- package/dist/twilight/{p-084a6e4a.entry.js → p-e65d2899.entry.js} +1 -1
- package/dist/twilight/{p-2eb7be80.entry.js → p-f870a5da.entry.js} +1 -1
- package/dist/twilight/{p-BGYOHdWO.js → p-fUqHHnkG.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/api-service.d.ts +1 -0
- package/dist/types/components/salla-bullet-delivery/helpers.d.ts +3 -0
- package/dist/types/components/salla-bullet-delivery/interfaces.d.ts +3 -0
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +23 -1
- package/package.json +9 -5
- package/dist/twilight/p-94d03d81.entry.js +0 -4
- package/dist/twilight/p-CrNw20pf.js +0 -5
- package/dist/twilight/p-SRRlvI95.js +0 -4
- package/dist/twilight/p-a09eb593.entry.js +0 -4
- package/dist/twilight/p-d86fb5f9.entry.js +0 -4
- package/dist/twilight/p-e96b8d47.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as a,h as t,H as
|
|
4
|
+
import{r as e,c as a,h as t,H as i}from"./p-Dimo1ZpU.js";const s=class{constructor(t){e(this,t),this.prizeItemSelected=a(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return t(i,{key:"601dbcf73e68678eecc912c14c2b1be612a78551"},t("div",{key:"074f8b4cb736bfabd5885d9df77bf74e7c4829a1",onClick:this.onPrizeItemClick.bind(this)},t("img",{key:"4bec672992f7e998bde639295831a5c9ad5f5088",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),t("div",{key:"c8f858a7f406fe8e9123c57df627a4b6a2cbd719",class:"s-loyalty-prize-item-title"},this.item.name),t("div",{key:"81b954aa730e07c7f32ee538692581dede3543db",class:"s-loyalty-prize-item-subtitle"},this.item.description),t("div",{key:"b7baeada2da364fec6ee7bd606b595b1f652d8a8",class:"s-loyalty-prize-item-points"},this.item.cost_points," ",salla.lang.get("pages.loyalty_program.point"))))}};s.style="salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";export{s as salla_loyalty_prize_item}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as s}from"./p-
|
|
4
|
+
import{r as e,h as s}from"./p-Dimo1ZpU.js";import{G as l}from"./p-OF8QcbMM.js";const a=class{constructor(s){e(this,s),this.minAge=10,this.isEditable=!0,this.disableAction=!1,this.isLoading=!0,this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"}),salla.lang.onLoaded((()=>{this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"})}))}phoneNumberFieldEventHandler(e){e.detail.number?(this.userData.phone.number=Number.parseInt(e.detail.number),this.userData.phone.country=e.detail.country_code,this.disableAction=!1):this.disableAction=!0}handleFieldChange(e,s,l=!1){s.target.value?(this.userData[e]=s.target.value,this.disableAction=!1):l&&(this.disableAction=!0)}handleEmailInput(e,s){const l=document.getElementById("email-error"),a=s.target.value;if(!a)return this.disableAction=!0,void(l.textContent=this.email_required_trans);/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(a)||(this.disableAction=!0,l.textContent=this.invalid_email_trans),l.textContent="",this.userData[e]=a,this.disableAction=!1}submitForm(e){e.preventDefault(),this.disableAction=!0;const s=Object.assign({},this.userData);s.phone=void 0,s.phone=this.userData.phone.number,s.country_code=this.userData.phone.country,salla.api.profile.update(s).finally((()=>{this.disableAction=!1}))}getBirthDateRestriction(){const e=new Date,s=e.getFullYear()-this.minAge;return e.setFullYear(s),e}fetchData(){return salla.api.profile.info().then((e=>{this.userData=e.data})).finally((()=>{this.isLoading=!1,this.isEditable=!Salla.config.get("store.features").includes("sso-login")}))}renderLoadingSection(){return s("div",{class:"s-user-profile-skeleton-wrapper"},Array.from({length:6},((e,l)=>s("salla-skeleton",{class:"skeleton-item",width:"100%",height:"50px",key:l}))))}componentWillLoad(){Salla.onReady().then((()=>this.fetchData()))}render(){return this.isLoading?this.renderLoadingSection():s("form",{onSubmit:e=>this.submitForm(e)},s("div",{class:"s-user-profile-wrapper"},s("div",{class:"s-user-profile-field"},s("label",{htmlFor:"first-name",class:"s-user-profile-field-label"},this.first_name_trans),s("input",{disabled:!this.isEditable,type:"text",name:"first_name",value:this.userData.first_name,id:"first-name",required:!0,autocomplete:"first_name",class:"form-input",onChange:e=>this.handleFieldChange("first_name",e)})),s("div",{class:"s-user-profile-field"},s("label",{htmlFor:"last-name",class:"s-user-profile-field-label"},this.last_name_trans),s("input",{disabled:!this.isEditable,type:"text",name:"last_name",value:this.userData.last_name,id:"last-name",required:!0,autocomplete:"last_name",class:"form-input",onChange:e=>this.handleFieldChange("last_name",e)})),s("div",{class:"s-user-profile-field"},s("label",{htmlFor:"birthday",class:"s-user-profile-field-label"},this.birthday_trans),s("salla-datetime-picker",{disabled:!this.isEditable,dateFormat:"Y-m-d",value:this.userData.birthday,placeholder:this.birthday_placeholder_trans,required:!0,maxDate:this.getBirthDateRestriction(),name:"birthday",onPicked:e=>this.handleFieldChange("birthday",e)})),s("div",{class:"s-user-profile-field"},s("label",{htmlFor:"gender",class:"s-user-profile-field-label"},this.gender_trans),s("select",{disabled:!this.isEditable,class:"form-input",name:"gender",required:!0,onChange:e=>this.handleFieldChange("gender",e)},s("option",{value:""},this.gender_placeholder_trans),s("option",{value:l.Male,selected:this.userData.gender===l.Male},this.male_trans),s("option",{value:l.Female,selected:this.userData.gender===l.Female},this.female_trans))),s("div",{class:"s-user-profile-field"},s("label",{htmlFor:"email",class:"s-user-profile-field-label"},this.email_trans),s("input",{disabled:!this.isEditable,type:"email",name:"email",value:this.userData.email,id:"email",class:"form-input",required:!0,onInput:e=>this.handleEmailInput("email",e)}),s("p",{id:"email-error",class:"s-user-profile-field-error"})),s("div",{class:"s-user-profile-field"},s("label",{htmlFor:"international-mobile",class:"s-user-profile-field-label"},this.mobile_trans),s("salla-tel-input",{disabled:!this.isEditable,name:"international-mobile","country-code":this.userData.phone.country,phone:`${this.userData.phone.number}`,onPhoneEntered:e=>this.phoneNumberFieldEventHandler(e)}))),s("salla-button",{type:"submit",loading:this.disableAction,disabled:this.disableAction||!this.isEditable,"loader-position":"end",class:"s-user-profile-submit"},this.save_btn_trans))}};a.style=":host{display:block}";export{a as salla_user_profile}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as c,H as s,c as e,a as t}from"./p-
|
|
4
|
+
import{r as a,h as c,H as s,c as e,a as t}from"./p-Dimo1ZpU.js";import{p as d,m as o}from"./p-DfeagqF1.js";const i=class{constructor(c){a(this,c)}render(){return c(s,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},c("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};i.style="";const r=class{constructor(c){a(this,c),this.accordionToggle=e(this,"accordionToggle"),this.collapsible=!1,this.collapsed=!0}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){this.collapsible&&(this.collapsed=!this.collapsed,this.host.parentElement?.setAttribute("data-collapsed",this.collapsed.toString()),this.host.parentElement?.querySelector("salla-accordion-body")?.setAttribute("data-collapsed",this.collapsed.toString()),this.emitCollapsePanel())}render(){return c(s,{key:"9d88d243306cdf451c20d7068fbb9f48807b22e9","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},c("div",{key:"bad4c5a913ce1c4581b09c0b6d96fcbdb4236638",class:"s-accordion-head-wrapper-start"},c("slot",{key:"acb83cec8cbca5771a9f84e81c0b955c3edad731",name:"title"}),c("slot",{key:"a4ad42ea6fad4f452c4c218a9ee02dca0adb4a67",name:"progress"}),c("slot",{key:"96ab95d413dc906ac299079f4008816f01881990",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&c("div",{key:"8f9666a5038cd7b1ac6e357c6920ea26d31c5f03",class:"s-accordion-head-wrapper-end"},c("slot",{key:"14895e8c1385e91c14f046c9ae38ce5e4a4c9a60",name:"note"}),this.collapsible&&c("button",{key:"97dc7fabbb207fcc8b68ebf0a86f6c8a980dca13",class:{"s-accordion-head-wrapper-toggle":!0,active:!this.collapsed},onClick:a=>{a.stopPropagation(),this.toggleCollapse()}},c("span",{key:"3b24faf71dcd332663a354310b2ce09f7879eddc",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?d:o}))))}get host(){return t(this)}};r.style="";export{i as salla_accordion_body,r as salla_accordion_head}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as i,H as e,a as t}from"./p-CrNw20pf.js";function l(s,i){localStorage.getItem("salla-delivery-promise-debug")&&(void 0!==i?console.log(s,i):console.log(s))}async function r(s,i){l("fetchCities start",{productId:s,keyword:i});const e=null!=i?`?keyword=${encodeURIComponent(i)}`:"",t=await salla.api.request(salla.url.api(`products/${s}/delivery-promises/cities${e}`));return t.success&&Array.isArray(t.data)&&0!==t.data.length?(l("fetchCities success",{count:t.data.length}),{cities:t.data}):(l("fetchCities: no data",{response:t}),{cities:[]})}function a(){const s=(Boolean(salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"))?salla.storage.store:salla.storage.session).get("bullet_delivery_intent");return s&&"object"==typeof s?s:null}const o={deliveryTo:"توصيل إلى",pickupFromBranch:"الاستلام من فرع",noResults:"لا توجد نتائج",selectCity:"اختر المدينة",changeCityTitle:"تغيير المدينة",changeCitySubtitle:"",cityFieldLabel:"المدينة",modalSearchPlaceholder:"ابحث عن مدينة",confirmAddress:"تأكيد العنوان",errorDeliveryPromise:"لا يتوفر وعد تسليم لهذه المدينة",errorPickupPromise:"لا يتوفر وعد تسليم لهذا الفرع"},n="salla-bullet-delivery-override-ip",h=class{constructor(i){s(this,i),this.isDeliveryPromiseEnabled=!1,this.isLoginCycleEnabled=!1,this.canRender=!1,this.labels=o,this.selectedLabel=null,this.deliveryMessage=null,this.hasError=!1,this.errorMessage="",this.isLoadingPromises=!1,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,this.cities=[],this.selectedCity=null,this.isLoadingCities=!1,this.cityPendingSelection=null,this.modalCities=[],this.isSearchingCities=!1,this.citySearchCounter=0,this.onBulletDeliveryConfirmed=()=>{this.applyBulletIntent()},this.handleCitySearch=s=>{if(clearTimeout(this.citySearchTimer),!s.trim())return this.modalCities=[...this.cities],void(this.isSearchingCities=!1);this.citySearchTimer=setTimeout((()=>this.searchCitiesRemote(s)),300)},this.handleHeaderClick=s=>{s.stopPropagation(),this.isLoginCycleEnabled?this.openBulletDeliveryModal():this.openCityChangeModal()}}async componentDidLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.labels={deliveryTo:salla.lang.getWithDefault("pages.products.promise_deliver_to",o.deliveryTo),pickupFromBranch:salla.lang.getWithDefault("pages.products.promise_pickup_from_branch",o.pickupFromBranch),noResults:salla.lang.getWithDefault("common.elements.no_options",o.noResults),selectCity:salla.lang.getWithDefault("common.elements.select_city",o.selectCity),changeCityTitle:salla.lang.getWithDefault("pages.products.promise_change_city_title",o.changeCityTitle),changeCitySubtitle:salla.lang.getWithDefault("pages.products.promise_change_city_subtitle","قد تتغيّر مدة التوصيل حسب المدينة."),cityFieldLabel:salla.lang.getWithDefault("pages.products.promise_city_field",o.cityFieldLabel),modalSearchPlaceholder:salla.lang.getWithDefault("pages.products.promise_search_city",o.modalSearchPlaceholder),confirmAddress:salla.lang.getWithDefault("pages.checkout.confirm_address",o.confirmAddress),errorDeliveryPromise:salla.lang.getWithDefault("pages.products.promise_delivery_not_available",o.errorDeliveryPromise),errorPickupPromise:salla.lang.getWithDefault("pages.products.promise_pickup_not_available",o.errorPickupPromise)},this.isDeliveryPromiseEnabled=salla.config.get("store.features",[]).includes("delivery-promises"),this.isLoginCycleEnabled=salla.config.get("store.features",[]).includes("bullet-delivery-v2"),this.productId=salla.config.get("page.id"),this.isDeliveryPromiseEnabled?this.isLoginCycleEnabled?await this.initLoginCycleFlow():(this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,await this.loadCities()):this.canRender=!1}disconnectedCallback(){window.removeEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)}getIPDeliveryLocation(){const s="store.shipping.delivery_location",i={cityId:salla.config.get(`${s}.city_id`),cityName:salla.config.get(`${s}.city_name`)};return localStorage.getItem(n)?JSON.parse(localStorage.getItem(n)):i}async initLoginCycleFlow(){const s=this.applyBulletIntent(),{cityId:i,cityName:e}=this.getIPDeliveryLocation();l("delivery promise login cycle flow getIPDeliveryLocation",this.getIPDeliveryLocation()),i&&e&&!s&&(this.selectedLabel=`${this.labels.deliveryTo} ${e}`,await this.loadDeliveryMessage(i,"city")),this.canRender=!0,window.addEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)}applyBulletIntent(){const s=function(){const s=a();if(!s)return null;if("address"===s.type){const i=s.address_details?.city,e=null!=i?.id?Number(i.id):null!=s.city_id?Number(s.city_id):null,t=i?.name?.trim()||"";return null!=e?{type:"address",option:{id:e,name:t}}:null}if("branch"===s.type){const i=null!=s.branch_id?Number(s.branch_id):null!=s.branch_details?.id?Number(s.branch_details.id):null,e=s.branch_details?.name?.trim()||"";return null!=i?{type:"branch",option:{id:i,name:e}}:null}return null}();return s?("address"===s.type?(this.selectedCityLoginCycle=s.option,this.selectedBranchLoginCycle=null,this.selectedLabel=`${this.labels.deliveryTo} ${s.option.name||this.labels.selectCity}`,this.loadDeliveryMessage(s.option.id,"city")):(this.selectedBranchLoginCycle=s.option,this.selectedCityLoginCycle=null,this.selectedLabel=`${this.labels.pickupFromBranch} ${s.option.name}`,this.loadDeliveryMessage(s.option.id,"branch")),!0):(this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,this.deliveryMessage=null,!1)}openBulletDeliveryModal(){salla.event.emit("salla::bullet-delivery.modal.open.requested",function(){const s=a(),i={};if("address"===s?.type&&null!=s.address_id&&(i.preselected_address_id=Number(s.address_id)),"branch"===s?.type){const e=s.branch_id??s.branch_details?.id;null!=e&&(i.preselected_branch_id=Number(e))}return i}())}async loadCities(){this.isLoadingCities=!0,this.hasError=!1;const{cityId:s,cityName:i}=this.getIPDeliveryLocation();l("delivery promise standard flow getIPDeliveryLocation",this.getIPDeliveryLocation());try{const{cities:e}=await r(this.productId);if(!e.length)return void(this.canRender=!1);if(this.cities=e,this.canRender=!0,s&&i){this.selectedLabel=`${this.labels.deliveryTo} ${i}`;const e=this.cities.find((i=>String(i.id)===String(s)));e&&(l("delivery promise standard flow autoCity found",e),this.selectedCity=e),await this.loadDeliveryMessage(s,"city")}}catch(s){this.hasError=!0,this.errorMessage=s.message||"Failed to load cities",this.canRender=!1}finally{this.isLoadingCities=!1}}async loadDeliveryMessage(s,i){this.isLoadingPromises=!0,this.hasError=!1,this.deliveryMessage=null;try{this.deliveryMessage=await async function(s,i,e,t){l("fetchDeliveryMessage start",{productId:s,id:i,optionType:e});let r="";r="city"!==e||t?`?reference_id=${i}&reference_type=${e}`:`?reference_id=${i}`;const a=await salla.api.withoutNotifier((()=>salla.api.request(salla.url.api(`products/${s}/delivery-promises${r}`))));if(!a.success)throw l("fetchDeliveryMessage error",{response:a}),new Error(a.error?.message||"Failed to fetch delivery promise");const o=a.data?.message?.trim();return l("fetchDeliveryMessage success",{message:o}),o||null}(this.productId,s,i,this.isLoginCycleEnabled)}catch(s){this.hasError=!0,this.errorMessage="city"===i?this.labels.errorDeliveryPromise:this.labels.errorPickupPromise}finally{this.isLoadingPromises=!1}}async openCityChangeModal(){this.cityModalRef&&(this.cityPendingSelection=null,this.modalCities=[...this.cities],await this.cityModalRef.setTitle(this.labels.changeCityTitle),await this.cityModalRef.open())}async searchCitiesRemote(s){const i=++this.citySearchCounter;this.isSearchingCities=!0;try{const{cities:e}=await r(this.productId,s);if(i!==this.citySearchCounter)return;this.modalCities=e}catch{if(i!==this.citySearchCounter)return;this.modalCities=[]}finally{i===this.citySearchCounter&&(this.isSearchingCities=!1)}}async handleConfirmCityModal(){if(!this.cityPendingSelection)return void await(this.cityModalRef?.close());const s=this.cityPendingSelection;this.selectedCity=s,this.selectedLabel=`${this.labels.deliveryTo} ${function(s){const i=salla.config.get("user.language_code");return i&&"ar"!==i&&s.name_en?.trim()?s.name_en.trim():s.name}(s)}`,await this.loadDeliveryMessage(s.id,"city"),await(this.cityModalRef?.close())}renderLoadingSkeleton(){return i(e,{class:"s-delivery-promise-wrapper s-delivery-promise-skeleton"},i("div",{class:"s-delivery-promise-container"},i("div",{class:"s-delivery-promise-header s-delivery-promise-header-skeleton"},i("div",{class:"s-delivery-promise-location"},i("salla-skeleton",{height:"14px",width:"180px"})),i("salla-skeleton",{height:"18px",width:"18px"})),i("div",{class:"s-delivery-promise-loading"},i("salla-skeleton",{height:"20px",width:"80%"}))))}renderDeliveryMessage(){return this.isLoadingPromises?i("div",{class:"s-delivery-promise-loading"},i("salla-skeleton",{height:"20px",width:"80%"})):this.deliveryMessage?i("div",{class:"s-delivery-promise-message"},this.deliveryMessage):null}renderCityModalBody(){return i("div",{class:"s-delivery-promise-modal-body"},i("salla-searchable-dropdown",{label:this.labels.cityFieldLabel,placeholder:this.labels.modalSearchPlaceholder,items:this.modalCities,selectedItem:this.cityPendingSelection,searching:this.isSearchingCities,required:!0,noResultsText:this.labels.noResults,inputId:"s-delivery-promise-modal-search",onItemSelected:s=>{this.cityPendingSelection=s.detail},onSearchInput:s=>{this.handleCitySearch(s.detail)}}))}renderCityChangeModal(){return this.isLoginCycleEnabled?null:i("salla-modal",{id:"s-delivery-promise-city-modal",ref:s=>{this.cityModalRef=s},class:"s-delivery-promise-city-modal",isClosable:!0,width:"md","modal-title":this.labels.changeCityTitle,subTitle:this.labels.changeCitySubtitle},this.renderCityModalBody(),i("salla-button",{slot:"footer",width:"wide",disabled:!this.cityPendingSelection,onClick:()=>this.handleConfirmCityModal()},!this.isLoadingPromises&&this.labels.confirmAddress))}render(){return this.isDeliveryPromiseEnabled?this.isLoadingCities?this.renderLoadingSkeleton():this.canRender?i(e,{class:"s-delivery-promise-wrapper"},i("div",{class:"s-delivery-promise-container"},i("div",{class:"s-delivery-promise-header",onClick:this.handleHeaderClick},i("div",{class:"s-delivery-promise-location"},i("span",{class:"s-delivery-promise-title"},this.selectedLabel)),i("i",{class:"sicon-keyboard_arrow_down s-delivery-promise-arrow"})),this.hasError&&i("div",{class:"s-delivery-promise-error"},this.errorMessage),!this.hasError&&this.renderDeliveryMessage()),this.renderCityChangeModal()):null:null}get host(){return t(this)}};export{h as salla_delivery_promise}
|
|
4
|
+
import{r as s,h as i,H as e,a as t}from"./p-Dimo1ZpU.js";function l(s,i){localStorage.getItem("salla-delivery-promise-debug")&&(void 0!==i?console.log(s,i):console.log(s))}async function r(s,i){l("fetchCities start",{productId:s,keyword:i});const e=null!=i?`?keyword=${encodeURIComponent(i)}`:"",t=await salla.api.request(salla.url.api(`products/${s}/delivery-promises/cities${e}`));return t.success&&Array.isArray(t.data)&&0!==t.data.length?(l("fetchCities success",{count:t.data.length}),{cities:t.data}):(l("fetchCities: no data",{response:t}),{cities:[]})}function a(){const s=(Boolean(salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"))?salla.storage.store:salla.storage.session).get("bullet_delivery_intent");return s&&"object"==typeof s?s:null}const o={deliveryTo:"توصيل إلى",pickupFromBranch:"الاستلام من فرع",noResults:"لا توجد نتائج",selectCity:"اختر المدينة",changeCityTitle:"تغيير المدينة",changeCitySubtitle:"",cityFieldLabel:"المدينة",modalSearchPlaceholder:"ابحث عن مدينة",confirmAddress:"تأكيد العنوان",errorDeliveryPromise:"لا يتوفر وعد تسليم لهذه المدينة",errorPickupPromise:"لا يتوفر وعد تسليم لهذا الفرع"},n="salla-bullet-delivery-override-ip",h=class{constructor(i){s(this,i),this.isDeliveryPromiseEnabled=!1,this.isLoginCycleEnabled=!1,this.canRender=!1,this.labels=o,this.selectedLabel=null,this.deliveryMessage=null,this.hasError=!1,this.errorMessage="",this.isLoadingPromises=!1,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,this.cities=[],this.selectedCity=null,this.isLoadingCities=!1,this.cityPendingSelection=null,this.modalCities=[],this.isSearchingCities=!1,this.citySearchCounter=0,this.onBulletDeliveryConfirmed=()=>{this.applyBulletIntent()},this.handleCitySearch=s=>{if(clearTimeout(this.citySearchTimer),!s.trim())return this.modalCities=[...this.cities],void(this.isSearchingCities=!1);this.citySearchTimer=setTimeout((()=>this.searchCitiesRemote(s)),300)},this.handleHeaderClick=s=>{s.stopPropagation(),this.isLoginCycleEnabled?this.openBulletDeliveryModal():this.openCityChangeModal()}}async componentDidLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.labels={deliveryTo:salla.lang.getWithDefault("pages.products.promise_deliver_to",o.deliveryTo),pickupFromBranch:salla.lang.getWithDefault("pages.products.promise_pickup_from_branch",o.pickupFromBranch),noResults:salla.lang.getWithDefault("common.elements.no_options",o.noResults),selectCity:salla.lang.getWithDefault("common.elements.select_city",o.selectCity),changeCityTitle:salla.lang.getWithDefault("pages.products.promise_change_city_title",o.changeCityTitle),changeCitySubtitle:salla.lang.getWithDefault("pages.products.promise_change_city_subtitle","قد تتغيّر مدة التوصيل حسب المدينة."),cityFieldLabel:salla.lang.getWithDefault("pages.products.promise_city_field",o.cityFieldLabel),modalSearchPlaceholder:salla.lang.getWithDefault("pages.products.promise_search_city",o.modalSearchPlaceholder),confirmAddress:salla.lang.getWithDefault("pages.checkout.confirm_address",o.confirmAddress),errorDeliveryPromise:salla.lang.getWithDefault("pages.products.promise_delivery_not_available",o.errorDeliveryPromise),errorPickupPromise:salla.lang.getWithDefault("pages.products.promise_pickup_not_available",o.errorPickupPromise)},this.isDeliveryPromiseEnabled=salla.config.get("store.features",[]).includes("delivery-promises"),this.isLoginCycleEnabled=salla.config.get("store.features",[]).includes("bullet-delivery-v2"),this.productId=salla.config.get("page.id"),this.isDeliveryPromiseEnabled?this.isLoginCycleEnabled?await this.initLoginCycleFlow():(this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,await this.loadCities()):this.canRender=!1}disconnectedCallback(){window.removeEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)}getIPDeliveryLocation(){const s="store.shipping.delivery_location",i={cityId:salla.config.get(`${s}.city_id`),cityName:salla.config.get(`${s}.city_name`)};return localStorage.getItem(n)?JSON.parse(localStorage.getItem(n)):i}async initLoginCycleFlow(){const s=this.applyBulletIntent(),{cityId:i,cityName:e}=this.getIPDeliveryLocation();l("delivery promise login cycle flow getIPDeliveryLocation",this.getIPDeliveryLocation()),i&&e&&!s&&(this.selectedLabel=`${this.labels.deliveryTo} ${e}`,await this.loadDeliveryMessage(i,"city")),this.canRender=!0,window.addEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)}applyBulletIntent(){const s=function(){const s=a();if(!s)return null;if("address"===s.type){const i=s.address_details?.city,e=null!=i?.id?Number(i.id):null!=s.city_id?Number(s.city_id):null,t=i?.name?.trim()||"";return null!=e?{type:"address",option:{id:e,name:t}}:null}if("branch"===s.type){const i=null!=s.branch_id?Number(s.branch_id):null!=s.branch_details?.id?Number(s.branch_details.id):null,e=s.branch_details?.name?.trim()||"";return null!=i?{type:"branch",option:{id:i,name:e}}:null}return null}();return s?("address"===s.type?(this.selectedCityLoginCycle=s.option,this.selectedBranchLoginCycle=null,this.selectedLabel=`${this.labels.deliveryTo} ${s.option.name||this.labels.selectCity}`,this.loadDeliveryMessage(s.option.id,"city")):(this.selectedBranchLoginCycle=s.option,this.selectedCityLoginCycle=null,this.selectedLabel=`${this.labels.pickupFromBranch} ${s.option.name}`,this.loadDeliveryMessage(s.option.id,"branch")),!0):(this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,this.deliveryMessage=null,!1)}openBulletDeliveryModal(){salla.event.emit("salla::bullet-delivery.modal.open.requested",function(){const s=a(),i={};if("address"===s?.type&&null!=s.address_id&&(i.preselected_address_id=Number(s.address_id)),"branch"===s?.type){const e=s.branch_id??s.branch_details?.id;null!=e&&(i.preselected_branch_id=Number(e))}return i}())}async loadCities(){this.isLoadingCities=!0,this.hasError=!1;const{cityId:s,cityName:i}=this.getIPDeliveryLocation();l("delivery promise standard flow getIPDeliveryLocation",this.getIPDeliveryLocation());try{const{cities:e}=await r(this.productId);if(!e.length)return void(this.canRender=!1);if(this.cities=e,this.canRender=!0,s&&i){this.selectedLabel=`${this.labels.deliveryTo} ${i}`;const e=this.cities.find((i=>String(i.id)===String(s)));e&&(l("delivery promise standard flow autoCity found",e),this.selectedCity=e),await this.loadDeliveryMessage(s,"city")}}catch(s){this.hasError=!0,this.errorMessage=s.message||"Failed to load cities",this.canRender=!1}finally{this.isLoadingCities=!1}}async loadDeliveryMessage(s,i){this.isLoadingPromises=!0,this.hasError=!1,this.deliveryMessage=null;try{this.deliveryMessage=await async function(s,i,e,t){l("fetchDeliveryMessage start",{productId:s,id:i,optionType:e});let r="";r="city"!==e||t?`?reference_id=${i}&reference_type=${e}`:`?reference_id=${i}`;const a=await salla.api.withoutNotifier((()=>salla.api.request(salla.url.api(`products/${s}/delivery-promises${r}`))));if(!a.success)throw l("fetchDeliveryMessage error",{response:a}),new Error(a.error?.message||"Failed to fetch delivery promise");const o=a.data?.message?.trim();return l("fetchDeliveryMessage success",{message:o}),o||null}(this.productId,s,i,this.isLoginCycleEnabled)}catch(s){this.hasError=!0,this.errorMessage="city"===i?this.labels.errorDeliveryPromise:this.labels.errorPickupPromise}finally{this.isLoadingPromises=!1}}async openCityChangeModal(){this.cityModalRef&&(this.cityPendingSelection=null,this.modalCities=[...this.cities],await this.cityModalRef.setTitle(this.labels.changeCityTitle),await this.cityModalRef.open())}async searchCitiesRemote(s){const i=++this.citySearchCounter;this.isSearchingCities=!0;try{const{cities:e}=await r(this.productId,s);if(i!==this.citySearchCounter)return;this.modalCities=e}catch{if(i!==this.citySearchCounter)return;this.modalCities=[]}finally{i===this.citySearchCounter&&(this.isSearchingCities=!1)}}async handleConfirmCityModal(){if(!this.cityPendingSelection)return void await(this.cityModalRef?.close());const s=this.cityPendingSelection;this.selectedCity=s,this.selectedLabel=`${this.labels.deliveryTo} ${function(s){const i=salla.config.get("user.language_code");return i&&"ar"!==i&&s.name_en?.trim()?s.name_en.trim():s.name}(s)}`,await this.loadDeliveryMessage(s.id,"city"),await(this.cityModalRef?.close())}renderLoadingSkeleton(){return i(e,{class:"s-delivery-promise-wrapper s-delivery-promise-skeleton"},i("div",{class:"s-delivery-promise-container"},i("div",{class:"s-delivery-promise-header s-delivery-promise-header-skeleton"},i("div",{class:"s-delivery-promise-location"},i("salla-skeleton",{height:"14px",width:"180px"})),i("salla-skeleton",{height:"18px",width:"18px"})),i("div",{class:"s-delivery-promise-loading"},i("salla-skeleton",{height:"20px",width:"80%"}))))}renderDeliveryMessage(){return this.isLoadingPromises?i("div",{class:"s-delivery-promise-loading"},i("salla-skeleton",{height:"20px",width:"80%"})):this.deliveryMessage?i("div",{class:"s-delivery-promise-message"},this.deliveryMessage):null}renderCityModalBody(){return i("div",{class:"s-delivery-promise-modal-body"},i("salla-searchable-dropdown",{label:this.labels.cityFieldLabel,placeholder:this.labels.modalSearchPlaceholder,items:this.modalCities,selectedItem:this.cityPendingSelection,searching:this.isSearchingCities,required:!0,noResultsText:this.labels.noResults,inputId:"s-delivery-promise-modal-search",onItemSelected:s=>{this.cityPendingSelection=s.detail},onSearchInput:s=>{this.handleCitySearch(s.detail)}}))}renderCityChangeModal(){return this.isLoginCycleEnabled?null:i("salla-modal",{id:"s-delivery-promise-city-modal",ref:s=>{this.cityModalRef=s},class:"s-delivery-promise-city-modal",isClosable:!0,width:"md","modal-title":this.labels.changeCityTitle,subTitle:this.labels.changeCitySubtitle},this.renderCityModalBody(),i("salla-button",{slot:"footer",width:"wide",disabled:!this.cityPendingSelection,onClick:()=>this.handleConfirmCityModal()},!this.isLoadingPromises&&this.labels.confirmAddress))}render(){return this.isDeliveryPromiseEnabled?this.isLoadingCities?this.renderLoadingSkeleton():this.canRender?i(e,{class:"s-delivery-promise-wrapper"},i("div",{class:"s-delivery-promise-container"},i("div",{class:"s-delivery-promise-header",onClick:this.handleHeaderClick},i("div",{class:"s-delivery-promise-location"},i("span",{class:"s-delivery-promise-title"},this.selectedLabel)),i("i",{class:"sicon-keyboard_arrow_down s-delivery-promise-arrow"})),this.hasError&&i("div",{class:"s-delivery-promise-error"},this.errorMessage),!this.hasError&&this.renderDeliveryMessage()),this.renderCityChangeModal()):null:null}get host(){return t(this)}};export{h as salla_delivery_promise}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as s,h as
|
|
4
|
+
import{r as t,c as s,h as i,H as e,a}from"./p-Dimo1ZpU.js";import{F as l}from"./p-DL4h2bc3.js";import{H as r}from"./p-CHf8XdiS.js";import"./p-CgtvEd63.js";const o=class{constructor(i){t(this,i),this.changed=s(this,"changed"),this.isReady=!1,this.filtersData={},salla.event.on("filters::hidden",(()=>this.host.style.display="none")),salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply"),this.reset=salla.lang.get("pages.categories.filters_reset")})),salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{if(t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label,"rating"==t.key){t.type=l.VALUES;let{max:s,min:i}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=i||t<=s))}this.filtersData.variants&&t.type==l.VARIANTS&&(s.variants=this.filtersData.variants),this.filtersData[t.key]&&t.type!==l.VARIANTS&&(s[t.key]=this.filtersData[t.key]);let i=new URLSearchParams(window.location.search),e=!1;for(let t of i.keys())if(t.includes("filters")){e=!0;break}if("product.index"==salla.config.get("page.slug")&&0==Object.keys(s).length&&!e){let t=window.location.href,i=salla.config.get("page.id"),e=-1!==t.indexOf("?")?"&":"?",a=t+e+"filters[category_id]="+i;s.category_id=i,window.history.pushState({path:a},"",a)}return t})),this.filtersData=s,this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady)return;let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries())s.startsWith("filters")&&t.searchParams.delete(s);let s=this.encodeFilters(this.filtersData),i=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");t.search=i?t.search.split("&filters")[0]+"&"+s:`?${s}`,window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);t.searchParams?.delete("filters"),window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData),this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const i=[];for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const a=t[e],l=s?`${s}[${e}]`:e;if(Array.isArray(a))for(let t=0;t<a.length;t++)i.push(`${l}[${t}]=${a[t]}`);else i.push("object"==typeof a&&null!==a?this.encodeFilters(a,l):`${l}=${a}`)}return i.join("&")}async resetFilters(){return this.removeFiltersQueryParams(),this.filtersData={},this.host.childNodes.forEach((t=>t.reset&&t.reset())),salla.event.emit("salla-filters::reset"),this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search),s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&"),i=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",i)}handleOptionChange(t,s,i){s.type===l.RANGE&&(this.filtersData[s.key]=i);let e=t.target.checked;s.type===l.VARIANTS?(this.filtersData.variants=this.filtersData.variants||{},e&&(this.filtersData.variants[s.key]=i),e||delete this.filtersData.variants[s.key]):"radio"==t.target.type?(e&&(this.filtersData[s.key]=i),e||delete this.filtersData[s.key]):"checkbox"==t.target.type&&(this.filtersData[s.key]=this.filtersData[s.key]||[],e&&this.filtersData[s.key].push(i),this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=i))),this.applyFilters()}render(){return i(e,{key:"8fe009d0a0b52956fa634544aa414e554b77a128"},this.filters?.map((t=>i("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:i}})=>{this.handleOptionChange(t,s,i)}}))),this.filters?.length?i("div",{class:"s-filters-footer"},i("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=!0}get host(){return a(this)}};o.style=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";export{o as salla_filters}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,c as e,h as r,H as d}from"./p-Dimo1ZpU.js";const c=class{constructor(r){t(this,r),this.orderEditProductSelected=e(this,"orderEditProductSelected")}get productData(){if(!this.product)return{};if("object"==typeof this.product)return this.product;try{return JSON.parse(this.product)}catch(t){return{}}}handleSelectProduct(){this.orderEditProductSelected.emit({product:this.productData})}render(){const t=this.productData,e=t?.name||salla.lang.getWithDefault("common.elements.product","منتج"),c=t?.price;return r(d,{key:"9f9278890bd821cf7b1caecdf4484a26273fe407"},r("button",{key:"6d28490ff098143000fff6543702ba805e997077",type:"button",class:"s-order-edit-product-card",onClick:()=>this.handleSelectProduct()},r("div",{key:"b7399553a7b79303b8bae8c9b624f460fe761946",class:"s-order-edit-product-card-media"},t?.image?.url?r("img",{src:t.image.url,alt:t.image.alt||e,class:"s-order-edit-product-card-image"}):r("div",{class:"s-order-edit-product-card-placeholder"},r("i",{class:"sicon-shopping-bag"}))),r("div",{key:"5cd57cf519f5d681116336cc6db8aed3569b761d",class:"s-order-edit-product-card-content"},r("h3",{key:"51312a3708d95f3d6d654099b25a2a4644c70aaa",class:"s-order-edit-product-card-title"},e),null!=c&&r("p",{key:"c09988f616198ae0d527e994e5c55e8b0a01c218",class:"s-order-edit-product-card-price",innerHTML:salla.money(c)}))))}};c.style=":host{display:block;min-width:0}";export{c as salla_order_edit_product_card}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as s,H as a}from"./p-
|
|
4
|
+
import{r as e,h as s,H as a}from"./p-Dimo1ZpU.js";const t=class{constructor(s){e(this,s),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel=""}componentWillLoad(){this.initializeTranslations()}initializeTranslations(){salla.lang.onLoaded((()=>{const e=(e,s,a)=>{salla.helpers.setNested(salla.lang.messages[e],s,a)};e("ar.trans","blocks.footer.commercial_register","السجل التجاري"),e("en.trans","blocks.footer.commercial_register","Commercial Register"),e("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),e("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const e=salla.config.get("store.settings.commercial_number"),s=salla.config.get("store.settings.freelance_number");return e?{number:e,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:s?{number:s,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const e=this.getBadgeData();return e?s(a,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},s("img",{class:"s-trust-badges-image",width:"55",height:"55",src:e.imageUrl,alt:e.label}),s("div",{class:"s-trust-badges-content"},s("p",{class:"s-trust-badges-label"},e.label),s("b",{class:"s-trust-badges-number"},e.number))):null}};t.style="";export{t as salla_trust_badges}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as a,H as t,a as o}from"./p-
|
|
4
|
+
import{r as s,h as a,H as t,a as o}from"./p-Dimo1ZpU.js";const c=class{constructor(a){s(this,a),this.availableCoupons=[],this.cartTotal=0,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=s=>{this.cartTotal=s.sub_total??s.total??0;const a=s.coupon||"";a!==this.currentCoupon&&(this.currentCoupon=a,this.couponInputValue=a),this.couponError=""},this.couponAddedHandler=()=>{},this.couponAdditionFailedHandler=s=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(s?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{},this.onKeyUp=s=>{"Enter"===s.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=s=>{this.couponInputValue=s.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadCouponsData(),this.loadCartTotal(),this.setupCartEventListeners()}componentDidLoad(){this.setupCouponInputEvents()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){this.couponInputRef?.removeEventListener("keyup",this.onKeyUp),this.couponInputRef?.removeEventListener("input",this.onInput),salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(s){const a=this.availableCoupons.find((a=>a.code===s));if(a){if(!this.isEligible(a))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(s),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:a,bubbles:!0}))}catch(s){throw s}}return a}async loadCouponsData(){try{const s=await salla.api.request("coupons"),a=s?.data,t=Array.isArray(a)?a:Array.isArray(a?.data)?a.data:[];this.availableCoupons=t}catch(s){console.warn("Failed to load coupons:",s),this.availableCoupons=[]}}loadCartTotal(){const s=salla.storage.get("cart");this.cartTotal=s?.summary?.sub_total??s?.sub_total??0,this.currentCoupon=s?.coupon||"",this.couponInputValue=s?.coupon||""}setupCouponInputEvents(){this.couponInputRef&&this.couponButtonRef&&(this.couponInputRef.addEventListener("keyup",this.onKeyUp),this.couponInputRef.addEventListener("input",this.onInput))}async handleCouponButtonClick(){if(this.isApplying)return;const s=!!this.currentCoupon;if(s||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{s?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim())}catch(s){this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}showCouponError(s){this.couponError=s}handleCouponClick(s){this.applyCoupon(s.code,!1).catch((()=>{}))}async applyCoupon(s,a=!0){if(this.isApplying){if(a)throw new Error("Coupon application already in progress")}else{this.couponInputValue=s,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(s.trim())}catch(s){if(this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),a)throw s}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(s){if("percentage"===s.type)return`${salla.helpers.number("object"==typeof s.amount?s.amount.amount:s.amount)}%`;{const t="object"==typeof s.amount?s.amount:{amount:s.amount,currency:s.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return a("span",{innerHTML:salla.money(t.amount,t.currency)})}}isEligible(s){return!(s.minimum_amount&&this.cartTotal<parseFloat(s.minimum_amount.amount))}renderCouponCard(s){const t=this.isEligible(s);return a("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},a("div",{class:"s-cart-coupons-card "+(!t||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>t&&!this.isApplying&&this.handleCouponClick(s)},a("div",{class:"s-cart-coupons-top-section"},a("div",{class:"s-cart-coupons-discount-values"},a("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(s)),s.free_shipping?a("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):s.maximum_amount&&a("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",a("span",{innerHTML:salla.money(s.maximum_amount.amount,s.maximum_amount.currency)}))),a("div",{class:"s-cart-coupons-code"},s.code)),a("div",{class:"s-cart-coupons-divider"}),a("div",{class:"s-cart-coupons-bottom-section"},a("div",{class:"s-cart-coupons-terms"},null!=s.remaining_days&&a("div",{class:"s-cart-coupons-expiry "+(s.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===s.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${s.remaining_days} ${salla.lang.get("pages.cart.day")}`),s.minimum_amount&&parseFloat(s.minimum_amount.amount)>0&&a("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",a("span",{innerHTML:salla.money(s.minimum_amount.amount,s.minimum_amount.currency)}))),a("div",{class:"s-cart-coupons-action"},t?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return a(t,{key:"f3f3d943ab2c1a6488a1da02d2cc031dbc88b482"},a("div",{key:"abf88828017041b19a6c54ba2f99e6c246bd8d04",class:"s-cart-coupons-wrapper"},a("div",{key:"c2946579a7cca935722997229f50ede603acb8b2",class:"s-cart-coupons-input-section"},a("label",{key:"50042d827c86daf853babd4e41ba3a920aceda9d",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),a("div",{key:"4b01047727bd3a83f6cfbac37221e7732076248f",class:"s-cart-coupons-coupon-input-container"},a("input",{key:"555108f68b7a60c618d9a904905ef321cd274c7a",type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,ref:s=>this.couponInputRef=s,"aria-label":salla.lang.get("pages.cart.apply_coupon")}),a("salla-button",{key:"0416bbaf029f7d8951ca6a419cdc676ae50ee792",ref:s=>this.couponButtonRef=s,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick()},this.currentCoupon?a("i",{class:"sicon-cancel"}):a("span",null,salla.lang.get("pages.cart.save_coupon")))),this.couponError&&a("span",{key:"f7c77e8676cb07b4820b571dbd8ee25dca79a1b1",class:"s-cart-coupons-coupon-error"},this.couponError)),this.availableCoupons&&this.availableCoupons.length>0&&a("salla-slider",{key:"daee9c6705de734d5f81ff86d92ad6952b5a7332",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},a("div",{key:"5d5ef30a6ff7f7c2b406cc5cec6622c2f028d17e",slot:"items"},this.availableCoupons.map((s=>this.renderCouponCard(s)))))))}get host(){return o(this)}};c.style="";export{c as salla_cart_coupons}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as s,H as n,a as t}from"./p-
|
|
4
|
+
import{r as a,h as s,H as n,a as t}from"./p-Dimo1ZpU.js";import{s as l}from"./p-B-Rj6b9M.js";const e=class{constructor(s){a(this,s),this.cashbackData=null,this.productId=null}async componentWillLoad(){try{if(await salla.onReady(),await salla.lang.onLoaded(),await l(),this.productId=this.host.dataset.productId||salla.config.get("page.id"),!this.productId)return;const a=await salla.api.request(`/products/${this.productId}/cashback-offer`).catch((()=>null));this.cashbackData=a?.data||null}catch(a){salla?.logger?.warn?.("salla-cashback-banner: init failed",a)}}getPaymentMethodsText(a=[]){return a.map((a=>String(a||"").trim())).filter(Boolean).map((a=>salla.lang.get(`pages.checkout.${a}`)||a)).join(", ")}getCashbackMessage(){const a=this.cashbackData?.payment_method_restrictions?.included??[];return a.length?salla.lang.get("pages.loyalty_program.cashback_when_buying_product_payment_method",{payment_method:this.getPaymentMethodsText(a)}):salla.lang.get("pages.loyalty_program.cashback_when_buying_product")}render(){if(!this.productId||!Number(this.cashbackData?.amount))return null;const a=this.cashbackData.amount,t=this.cashbackData.currency,l=this.getCashbackMessage(),e=this.cashbackData.offer_type;return s(n,null,s("div",{class:"s-cashback-banner-container"},s("div",{class:"s-cashback-banner-icon"},s("span",{class:"s-cashback-banner-inner-icon",innerHTML:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_5667_2008)">\n<path d="M9.00003 0.935974C9.37203 0.935974 9.72003 1.06797 10.044 1.33197C10.344 1.57197 10.596 1.90797 10.8 2.33997L12.114 5.00397C12.174 5.09997 12.27 5.19897 12.402 5.30097C12.534 5.40297 12.66 5.46597 12.78 5.48997L15.174 5.88597C15.618 5.95797 15.996 6.10197 16.308 6.31797C16.644 6.54597 16.869 6.83697 16.983 7.19097C17.097 7.54497 17.082 7.91397 16.938 8.29797C16.806 8.64597 16.578 8.98797 16.254 9.32397L14.4 11.196C14.316 11.28 14.247 11.409 14.193 11.583C14.139 11.757 14.13 11.91 14.166 12.042L14.688 14.364C14.808 14.88 14.832 15.342 14.76 15.75C14.676 16.206 14.475 16.551 14.157 16.785C13.839 17.019 13.452 17.106 12.996 17.046C12.588 16.998 12.156 16.836 11.7 16.56L9.45003 15.21C9.34203 15.15 9.19203 15.12 9.00003 15.12C8.80803 15.12 8.65803 15.15 8.55003 15.21L6.30003 16.56C5.84403 16.836 5.41203 16.998 5.00403 17.046C4.54803 17.106 4.16103 17.016 3.84303 16.776C3.52503 16.536 3.32403 16.194 3.24003 15.75C3.16803 15.342 3.19203 14.88 3.31203 14.364L3.83403 12.042C3.85803 11.91 3.84603 11.757 3.79803 11.583C3.75003 11.409 3.68403 11.28 3.60003 11.196L1.74603 9.32397C1.41003 8.98797 1.18203 8.64597 1.06203 8.29797C0.918027 7.91397 0.900027 7.54497 1.00803 7.19097C1.11603 6.83697 1.34403 6.54597 1.69203 6.31797C1.99203 6.10197 2.37003 5.95797 2.82603 5.88597L5.22003 5.48997C5.32803 5.46597 5.45103 5.40297 5.58903 5.30097C5.72703 5.19897 5.82003 5.09997 5.86803 5.00397L7.18203 2.33997C7.39803 1.90797 7.65603 1.57197 7.95603 1.33197C8.28003 1.06797 8.62803 0.935974 9.00003 0.935974Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_5667_2008">\n<rect width="18" height="18" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n'})),s("p",null,s("span",{class:"s-cashback-banner-label"},salla.lang.get("pages.loyalty_program.earn")," "),s("span",{class:"s-cashback-banner-value"},"percentage"===e?"+":"",a," ",["SAR","ر.س"].includes(t)?s("i",{class:"sicon-sar"}):t," "),s("span",{class:"s-cashback-banner-label"},l))))}get host(){return t(this)}};e.style="";export{e as salla_cashback_banner}
|