@salla.sa/twilight-components 2.13.86 → 2.13.87

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 (49) hide show
  1. package/dist/cjs/app-globals-c5340b59.js.map +1 -1
  2. package/dist/cjs/salla-add-product-button_48.cjs.entry.js.map +1 -1
  3. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  4. package/dist/cjs/salla-booking-field_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
  6. package/dist/cjs/salla-product-options.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/salla-booking-field/salla-booking-field.js +1 -1
  8. package/dist/collection/components/salla-booking-field/salla-booking-field.js.map +1 -1
  9. package/dist/collection/components/salla-product-options/salla-product-options.js +1 -1
  10. package/dist/collection/components/salla-product-options/salla-product-options.js.map +1 -1
  11. package/dist/components/index.js.map +1 -1
  12. package/dist/components/salla-booking-field2.js +1 -1
  13. package/dist/components/salla-booking-field2.js.map +1 -1
  14. package/dist/components/salla-product-options.js +1 -1
  15. package/dist/components/salla-product-options.js.map +1 -1
  16. package/dist/components/salla-quick-buy2.js.map +1 -1
  17. package/dist/esm/app-globals-0280e1d0.js.map +1 -1
  18. package/dist/esm/salla-add-product-button_48.entry.js.map +1 -1
  19. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  20. package/dist/esm/salla-booking-field_2.entry.js.map +1 -1
  21. package/dist/esm/salla-product-options.entry.js +1 -1
  22. package/dist/esm/salla-product-options.entry.js.map +1 -1
  23. package/dist/esm-es5/app-globals-0280e1d0.js.map +1 -1
  24. package/dist/esm-es5/salla-add-product-button_48.entry.js.map +1 -1
  25. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  26. package/dist/esm-es5/salla-booking-field_2.entry.js.map +1 -1
  27. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  28. package/dist/esm-es5/salla-product-options.entry.js.map +1 -1
  29. package/dist/twilight/p-411485fc.entry.js.map +1 -1
  30. package/dist/twilight/p-4a9df09e.js.map +1 -1
  31. package/dist/twilight/p-4c2194e3.system.js.map +1 -1
  32. package/dist/twilight/p-4e795693.system.entry.js.map +1 -1
  33. package/dist/twilight/p-54e1a882.system.js +1 -1
  34. package/dist/twilight/{p-f904674c.system.entry.js → p-5ba21699.system.entry.js} +2 -2
  35. package/dist/twilight/p-5ba21699.system.entry.js.map +1 -0
  36. package/dist/twilight/p-6cce417a.entry.js +5 -0
  37. package/dist/twilight/p-6cce417a.entry.js.map +1 -0
  38. package/dist/twilight/p-a642b326.system.entry.js +5 -0
  39. package/dist/twilight/{p-f0c9a140.system.entry.js.map → p-a642b326.system.entry.js.map} +1 -1
  40. package/dist/twilight/p-bd26e79e.entry.js +5 -0
  41. package/dist/twilight/{p-5a27af8a.entry.js.map → p-bd26e79e.entry.js.map} +1 -1
  42. package/dist/twilight/twilight.esm.js +1 -1
  43. package/package.json +5 -5
  44. package/dist/twilight/p-5a27af8a.entry.js +0 -5
  45. package/dist/twilight/p-79e07ffc.entry.js +0 -5
  46. package/dist/twilight/p-79e07ffc.entry.js.map +0 -1
  47. package/dist/twilight/p-f0c9a140.system.entry.js +0 -5
  48. package/dist/twilight/p-f904674c.system.entry.js.map +0 -1
  49. package/dist/types/global.d.ts +0 -20
@@ -1 +1 @@
1
- {"version":3,"names":["DisplayType","Currency","sallaProductOptionsCss","SallaProductOptions","constructor","hostRef","this","fileTypes","pdf","png","jpg","word","exl","txt","outSkus","handleDonationOptions","event","detail","type","salla","helpers","inputDigitsOnly","target","emit","id","productId","price","value","preventDefault","stopPropagation","isCustomDonation","donationInput","focus","hideLabel","option","DONATION","donation","can_donate","getExpireDonationMessage","completed","target_amount","collected_amount","h","class","target_message","money","lang","get","getWithDefault","config","canDisabled","onLoaded","outOfStockText","donationAmount","selectDonationAmount","selectAmount","options","setOptionsData","Array","isArray","JSON","parse","e","log","optionsData","url","is_page","api","product","getDetails","then","resp","data","that","_b","_a","details","forEach","Object","entries","skus_availability","filter","sku","map","push","Number","getSelectedOptionsData","selectedOptions","formData","host","getElementSallaData","key","startsWith","replace","reportValidity","requiredElements","querySelectorAll","pass","i","length","hasOutOfStockOption","some","is_out","selectedSkus","every","includes","getSelectedOptions","getOption","option_id","find","invalidHandler","closestProductOption","closest","scrollIntoView","behavior","block","classList","add","changedHandler","optionElement","FILE","IMAGE","MAP","lat","lng","setTimeout","remove","index","findIndex","assign","setSelectedSkus","handleRequiredMultipleOptions","changed","keys","reduce","p","c","MULTIPLE_OPTIONS","required","optionContainer","querySelector","hasChecked","input","toggleAttribute","getLatLng","split","getDisplayForType","COLOR_PICKER","colorPickerOption","multipleOptions","SINGLE_OPTION","singleOption","BOOKING","onInvalidInput","getOptionShownWhen","visibility_condition","operator","componentWillLoad","onReady","needsCartId","storage","cart","getCurrentCartId","render","Host","name","splitterOption","htmlFor","placeholder","componentDidLoad","selectedDonationOption","is_selected","additional_price","donationOption","checked","onChange","custom_amount_enabled","shown","ref","el","onInput","onBlur","onInvalid","currency","symbol","fileUploader","additions","height","onAdded","getUploadImageEndpoint","cart_item_id","product_id","innerHTML","accept","CameraIcon","FileIcon","imageOption","fileOption","types","Boolean","join","numberOption","textOption","maxLength","textareaOption","rows","mapOption","zoom","searchable","onSelected","onSubmitted","color","timeOption","noCalendar","enableTime","dateFormat","onPicked","dateOption","minDate","Date","datetimeOption","maxDate","to_date_time","from_date_time","getOptionDetailName","outOfStock","optionType","COLOR","isOptionDetailOut","isDetailSelected","outSelectableSkus","disabled","selected","is_required","colorOption","style","thumbnailOption","option_value","image","src","title","alt","CheckCircleIcon"],"sources":["src/components/salla-product-options/interfaces.ts","src/components/salla-product-options/salla-product-options.scss?tag=salla-product-options","src/components/salla-product-options/salla-product-options.tsx"],"sourcesContent":["export enum DisplayType {\n COLOR = \"color\",\n DATE = \"date\",\n DATETIME = \"datetime\",\n DONATION = \"donation\",\n IMAGE = \"image\",\n MULTIPLE_OPTIONS = \"multiple-options\",\n NUMBER = \"number\",\n SINGLE_OPTION = \"single-option\",\n SPLITTER = \"splitter\",\n TEXT = \"text\",\n TEXTAREA = \"textarea\",\n THUMBNAIL = \"thumbnail\",\n TIME = \"time\",\n RADIO = \"radio\",\n CHECKBOX = \"checkbox\",\n MAP = \"map\",\n FILE = \"file\", // similar to image type (file-uploader component)\n COLOR_PICKER = \"color_picker\",\n BOOKING = \"booking\"\n}\n\nexport interface ProductDetail {\n id: string;\n sku: string;\n name: string;\n description: string;\n url: string;\n promotion_title: string;\n subtitle: string;\n type: string;\n status: string;\n price: number;\n sale_price: number;\n regular_price: number;\n starting_price: null;\n quantity: number;\n max_quantity: number;\n discount_ends: number;\n is_taxable: boolean;\n has_read_more: boolean;\n can_add_note: boolean;\n can_show_remained_quantity: boolean;\n can_upload_file: boolean;\n has_custom_form: boolean;\n is_on_sale: boolean;\n is_hidden_quantity: boolean;\n is_available: boolean;\n is_out_of_stock: boolean;\n weight: null;\n calories: null;\n image: SimpleImage;\n brand: Brand;\n donation?: ProductDonation;\n images: Image[];\n tags: Tag[];\n notify_availability: null;\n rating: Rating;\n options: Option[];\n sold_quantity: number;\n category: Category;\n}\n\nexport interface SimpleImage {\n url: string;\n alt: string;\n}\n\nexport interface Category {\n name: string;\n url: string;\n icon: string;\n}\n\nexport interface ProductDonation {\n target_message?: string;\n collected_amount?: number;\n target_amount?: number;\n target_percent?: number;\n target_end_date?: string;\n can_donate: boolean;\n custom_amount_enabled: boolean;\n}\n\nexport interface Image {\n id: number;\n url: string;\n main: boolean;\n three_d_image_url: string;\n alt: string;\n video_url: string;\n type: string;\n sort: number;\n}\n\nexport interface Option {\n id: number;\n name: string;\n required: boolean;\n type: string;\n placeholder: string;\n option_type: string;\n not_same_day_order: boolean;\n availability_range: number;\n from_date_time: null;\n to_date_time: null;\n visibility_condition?: { option: number, operator: \"=\" | \"!=\", value: number };\n details?: Detail[];\n condition_attributes: string;\n value?: any;\n length?: number;\n donation?: Donation\n}\n\nexport interface Donation {\n custom_amount_enabled: boolean;\n target_message?: string;\n target_date: string | \"2023-04-18\";\n target_end_date: string | \"2023-04-18\";\n target_amount: number;\n collected_amount: number;\n can_donate: boolean;\n}\n\nexport interface Detail {\n id: number;\n option_id: number;\n name: string;\n additional_price: number;\n option_value: null | string;\n image: null | string;\n color: null | string;\n is_out: boolean;\n skus_availability?: { [sku_id: number]: boolean };\n is_selected: boolean;\n}\n\nexport interface Brand {\n id: string;\n url: string;\n name: string;\n logo: string;\n}\n\nexport interface PreTaxPrice {\n amount: number;\n currency: Currency;\n}\n\nexport enum Currency {\n Sar = \"SAR\",\n}\n\nexport interface Promotion {\n title: string;\n sub_title: string;\n}\n\nexport interface Rating {\n count: number;\n stars: number;\n}\n\nexport interface Tag {\n name: string;\n url: string;\n}\n","\n.s-product-options{\n &-wrapper{\n\n }\n &-option-container{\n\n }\n &-option{\n\n }\n &-option-label{\n\n }\n &-option-content{\n\n }\n &-colors-wrapper{\n\n }\n &-date-element{\n\n }\n &-time-element{\n \n }\n &-datetime-element{\n\n }\n &-image-input{\n\n }\n &-multiple-options-wrapper{\n\n }\n &-splitter{\n\n }\n &-text{\n\n }\n &-textarea{\n\n }\n &-thumbnails-wrapper{\n\n }\n}","import { Component, Prop, h, State, Element, Host, Event, EventEmitter, Method } from '@stencil/core';\nimport { Option, DisplayType, Detail } from './interfaces';\nimport CheckCircleIcon from '../../assets/svg/check.svg';\nimport CameraIcon from '../../assets/svg/camera.svg';\nimport FileIcon from '../../assets/svg/file-upload.svg';\n\n\n@Component({\n tag: 'salla-product-options',\n styleUrl: 'salla-product-options.scss',\n})\nexport class SallaProductOptions {\n\n constructor() {\n this.canDisabled = !salla.config.get('store.settings.product.notify_options_availability');\n salla.lang.onLoaded(() => {\n this.outOfStockText = salla.lang.get(\"pages.products.out_of_stock\");\n this.donationAmount = salla.lang.get('pages.products.donation_amount');\n this.selectDonationAmount = salla.lang.getWithDefault('pages.products.select_donation_amount', 'تحديد مبلغ التبرع');\n this.selectAmount = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ');\n });\n\n if (this.options) {\n try {\n this.setOptionsData(Array.isArray(this.options) ? this.options : JSON.parse(this.options));\n return;\n } catch (e) {\n salla.log('Bad json passed via options prop');\n }\n }\n if (!Array.isArray(this.optionsData)) {\n salla.log('Options is not an array[] ---> ', this.optionsData);\n this.setOptionsData([]);\n }\n\n if (this.productId && !salla.url.is_page('cart')) {\n salla.api.product.getDetails(this.productId, ['options']).then(resp => this.setOptionsData(resp.data.options));\n }\n }\n\n private setOptionsData(optionsData: Option[]) {\n this.optionsData = optionsData;\n let that = this\n this.optionsData[0]?.details?.forEach(function (detail) {\n Object.entries(detail.skus_availability || {})\n .filter(sku => !sku[1])\n .map(sku => that.outSkus.push(Number(sku[0])));\n });\n }\n\n @Element() host: HTMLElement;\n\n private fileTypes: Object = {\n pdf: 'application/pdf',\n png: 'image/png',\n jpg: 'image/jpeg',\n word: 'application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n exl: 'application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n txt: 'text/plain',\n };\n\n @State() optionsData: Option[];\n @State() outOfStockText: string = ''\n @State() donationAmount: string = salla.lang.get('pages.products.donation_amount')\n @State() selectDonationAmount: string = salla.lang.getWithDefault('pages.products.select_donation_amount', 'تحديد مبلغ التبرع')\n @State() selectAmount: string = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ')\n @State() isCustomDonation: boolean = false;\n @State() selectedOptions: Array<any> = [];\n @State() canDisabled: boolean;\n @State() selectedSkus?: Array<string | number>;\n @State() selectedOutSkus?: Array<string | number>;\n private outSkus: Array<string | number> = [];\n private donationInput?: HTMLInputElement;\n\n /**\n * The id of the product to which the options are going to be fetched for.\n */\n @Prop() productId: number = salla.config.get('page.id');\n\n /**\n * Product detail information.\n */\n @Prop() options: string;\n\n /**\n * Get the id's of the selected options.\n * */\n @Method()\n async getSelectedOptionsData() {\n let selectedOptions = {}\n let formData = (this.host as any).getElementSallaData();\n formData.forEach(function (value, key) {\n key.startsWith('options[') && (selectedOptions[key.replace('options[', '').replace(']', '')] = value);\n });\n return selectedOptions;\n }\n\n /**\n * Report options form validity.\n * */\n @Method()\n async reportValidity() {\n let requiredElements: Array<HTMLInputElement> = this.host.querySelectorAll('[required]') as any;\n let pass = true;\n for (let i = 0; i < requiredElements.length; i++) {\n //if there is only one invalid option, return false\n if ('reportValidity' in requiredElements[i] && !requiredElements[i].reportValidity()) {\n pass = false;\n }\n }\n return pass;\n }\n\n /**\n * Return true if there is any out of stock options are selected and vise versa.\n * */\n @Method()\n async hasOutOfStockOption() {\n return this.selectedOptions.some(option => option.is_out) || (this.selectedSkus?.length && this.selectedSkus?.every(sku => this.outSkus.includes(sku)));\n }\n\n /**\n * Get selected options.\n * */\n @Method()\n async getSelectedOptions() {\n return this.selectedOptions;\n }\n\n /**\n * Get a specific option by its id.\n * */\n @Method()\n async getOption(option_id) {\n return this.optionsData.find(option => option.id === option_id);\n }\n\n /**\n * An event that emitted when any option is changed.\n */\n @Event() changed: EventEmitter;\n\n // @ts-ignore\n private invalidHandler(event, option: Option) {\n const closestProductOption = (event.target as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (!salla.url.is_page('cart')) {\n closestProductOption.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }\n closestProductOption.classList.add('s-product-options-option-error');\n }\n\n private changedHandler(event, option) {\n let data = { event: event, option: option, detail: null };\n if (option.details) {\n let detail = option.details.find((detail) => {\n return Number(detail.id) === Number(event.target.value);\n });\n data.detail = detail\n }\n\n let optionElement = event.target.closest('.s-product-options-option');\n if (event.target.value\n || ((option.type == DisplayType.FILE || option.type == DisplayType.IMAGE) && event.type === 'added')\n || (option.type == DisplayType.MAP && event.type === 'selected' && (event.target.lat && event.target.lng))) {\n setTimeout(() => {\n optionElement.classList.remove('s-product-options-option-error');\n }, 200);\n }\n\n const index = this.selectedOptions.findIndex(option => option.option_id === data.option.id);\n index > -1 ? this.selectedOptions[index] = {\n ...data.detail,\n option_id: data.option.id\n } : this.selectedOptions.push({ ...data.detail, option_id: data.option.id })\n\n if (option.type == DisplayType.DONATION) {\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n }\n this.setSelectedSkus();\n this.handleRequiredMultipleOptions(option);\n this.changed.emit(data);\n salla.event.emit('product-options::change', data);\n }\n\n\n private handleDonationOptions = (event, detail, type) => {\n if (detail == 'custom' && type == 'input') {\n salla.helpers.inputDigitsOnly(event.target)\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.isCustomDonation = event.target.value === 'custom';\n if (this.donationInput) {\n if (event.target.value === 'custom') {\n this.donationInput.value = '';\n this.donationInput.focus()\n } else {\n this.donationInput.value = event.target.value;\n }\n if (detail == 'custom') {\n return\n }\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n }\n }\n\n private hideLabel = (option) => {\n if (option.type === DisplayType.DONATION && (option.donation && !option.donation.can_donate)) {\n return true;\n }\n return false;\n }\n\n private getExpireDonationMessage = (option) => {\n if (!option.donation) {\n return;\n }\n let completed = option.donation.target_amount <= option.donation.collected_amount;\n return <div class={{ \"s-product-options-donation-message\": true, \"s-product-options-donation-completed\": completed, \"s-product-options-donation-expired\": !completed }}>\n <p>{option.donation.target_message}</p>\n <span>{completed ? salla.money(option.donation.target_amount) : ''}</span>\n </div>\n }\n /**\n * loop throw all selected details, then get common sku, if it's only one, means we selected all of them;\n */\n private setSelectedSkus() {\n this.selectedSkus = this.selectedOptions.map(detail => Object.keys(detail.skus_availability || {}))\n .reduce((p, c) => p.filter(e => c.includes(e)))\n .map(sku => Number(sku));\n }\n\n private handleRequiredMultipleOptions(option) {\n if (option.type !== DisplayType.MULTIPLE_OPTIONS || !option.required) {\n return;\n }\n const optionContainer = this.host.querySelector(`[data-option-id=\"${option.id}\"]`);\n const hasChecked = optionContainer.querySelectorAll('input:checked').length;\n optionContainer.querySelectorAll('input').forEach(input => input.toggleAttribute('required', !hasChecked));\n }\n\n private getLatLng(value, type: 'lat' | 'lng') {\n return value\n ? value.split(',')[type == 'lat' ? 0 : 1]\n : '';\n }\n\n private getDisplayForType(option: Option) {\n if (this[`${option.type}Option`]) {\n return this[`${option.type}Option`](option);\n }\n\n if (option.type === DisplayType.COLOR_PICKER) {\n return this.colorPickerOption(option)\n }\n\n if (option.type === DisplayType.MULTIPLE_OPTIONS) {\n return this.multipleOptions(option);\n }\n\n if (option.type === DisplayType.SINGLE_OPTION) {\n return this.singleOption(option);\n } \n \n if (option.type === DisplayType.BOOKING && salla.config.get('page.slug') == 'cart') {\n return <salla-booking-field onInvalidInput={(e) => this.invalidHandler(e, option)} option={option as any} productId={option.value}></salla-booking-field>\n }\n \n salla.log(`Couldn't find options type(${option.type})😢`);\n return '';\n }\n\n protected getOptionShownWhen(option: Option) {\n return option.visibility_condition\n ? { \"data-show-when\": `options[${option.visibility_condition.option}] ${option.visibility_condition.operator} ${option.visibility_condition.value}` }\n : {};\n }\n\n //we need the cart Id for productOption Image\n componentWillLoad() {\n this.outOfStockText = salla.lang.get('pages.products.out_of_stock')\n return salla.onReady(() => {\n const needsCartId = (!salla.storage.get('cart.id') && this.optionsData.some(option => ['file', 'image'].includes(option.type)));\n return needsCartId ? salla.api.cart.getCurrentCartId(false, \"salla-product-options\") : null;\n })\n }\n\n render() {\n if (this.optionsData?.length == 0) {\n return;\n }\n\n return (\n <Host class=\"s-product-options-wrapper\">\n {/* TODO:: move salla-conditional-field logic to here, no need of another component*/}\n <salla-conditional-fields>\n {this.optionsData.map((option: Option) =>\n <div class={`s-product-options-option-container${option.visibility_condition ? ' hidden' : ''}`}\n data-option-id={option.id}\n {...this.getOptionShownWhen(option)}>\n {option.name == 'splitter' ?\n this.splitterOption()\n : <div class=\"s-product-options-option\" data-option-type={option.type}\n data-option-required={`${option.required}`}>\n <label htmlFor={'options[' + option.id + ']'} class={`s-product-options-option-label ${this.hideLabel(option) ? 's-product-options-option-label-hidden' : ''}`}>\n <b>\n {option.name}\n {option.required && <span> * </span>} </b>\n <small>{option.placeholder}</small>\n </label>\n <div class={`s-product-options-option-content ${this.hideLabel(option) ? 's-product-options-option-content-full-width' : ''}`}>\n {this.getDisplayForType(option)}\n </div>\n </div>}\n </div>\n )}\n </salla-conditional-fields>\n </Host>\n );\n\n }\n\n componentDidLoad(){\n if (this.optionsData?.length == 0 && !this.optionsData.some(option => option.type == DisplayType.DONATION)) {\n return;\n }\n let selectedDonationOption = this.optionsData.find(option => option.type == DisplayType.DONATION)?.details.find(detail => detail.is_selected);\n if (!selectedDonationOption) {\n return;\n }\n setTimeout(() => {\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: selectedDonationOption.additional_price\n });\n }, 1000);\n }\n //@ts-ignore\n private donationOption(option: Option, product: Product) {\n return <div class=\"s-product-options-donation-wrapper\">\n\n {option.donation?.can_donate ? [\n option.donation ?\n <div class=\"s-product-options-donation-progress\">\n <salla-progress-bar donation={option.donation}>\n </salla-progress-bar>\n </div>\n : '',\n option.details.length ?\n [<h4>{this.selectAmount}</h4>,\n <div class=\"s-product-options-donation-options\">\n {option.details.map((detail, i) =>\n <div class=\"s-product-options-donation-options-item\">\n <input id={`donation-option-${i}`} type=\"radio\" name=\"donating_option\" checked={detail.is_selected} value={detail.additional_price} onChange={e => this.handleDonationOptions(e, detail, 'option')} />\n <label htmlFor={`donation-option-${i}`}>\n <span>{salla.money(detail.name)}</span>\n </label>\n </div>\n )}\n {option.donation?.custom_amount_enabled ?\n <div class=\"s-product-options-donation-options-item\">\n <input id={`donation-option-custom`} type=\"radio\" name=\"donating_option\" value=\"custom\" onChange={e => this.handleDonationOptions(e, 'custom', 'option')} />\n <label htmlFor={`donation-option-custom`}>\n <span> {this.selectDonationAmount} </span>\n </label>\n </div>\n : ''\n }\n </div>] : '',\n\n <div class={{ \"s-product-options-donation-input-group\": true, \"shown\": !option.details.length || (option.details.length && this.isCustomDonation) }}>\n <input\n type=\"text\"\n id=\"donating-amount\"\n name=\"donation_amount\"\n class=\"s-form-control\"\n ref={el => this.donationInput = el as HTMLInputElement}\n value={\n option.details.length\n && option.details.some(detail => detail.is_selected)\n ? option.details.find(detail => detail.is_selected).additional_price\n : option.value}\n // required\n placeholder={option.placeholder}\n onInput={e => this.handleDonationOptions(e, 'custom', 'input')}\n onBlur={e => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n />\n {/* value={option.value} */}\n <span class=\"s-product-options-donation-amount-currency\">\n {salla.config.currency(salla.config.get('user.currency_code')).symbol}\n </span>\n </div>\n ] :\n this.getExpireDonationMessage(option)\n }\n </div>\n }\n\n private fileUploader(option: Option, additions: Object | null = null) {\n return <salla-file-upload\n {...(additions || {})}\n payload-name=\"file\"\n value={option.value}\n instant-upload={true}\n name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n height=\"120px\"\n onAdded={(e) => this.changedHandler(e, option)}\n url={salla.cart.api.getUploadImageEndpoint()}\n form-data={{ cart_item_id: this.productId, product_id: this.productId }}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n class={{ \"s-product-options-image-input\": true, required: option.required }}\n >\n <div class=\"s-product-options-filepond-placeholder\">\n <span class=\"s-product-options-filepond-placeholder-icon\"\n innerHTML={(additions as any).accept && (additions as any).accept.split(',').every(type => type.includes('image'))\n ? CameraIcon\n : FileIcon}\n />\n <p class=\"s-product-options-filepond-placeholder-text\">{salla.lang.get('common.uploader.drag_and_drop')}</p>\n <span class=\"filepond--label-action\">{salla.lang.get('common.uploader.browse')}</span>\n </div>\n </salla-file-upload>\n }\n\n //@ts-ignore\n private imageOption(option: Option) {\n return this.fileUploader(option, { accept: 'image/png,image/jpeg,image/jpg,image/gif' });\n }\n\n //@ts-ignore\n private fileOption(option: Option) {\n let types = option.details.map(detail => this.fileTypes[detail.name]).filter(Boolean);\n return types?.length\n ? this.fileUploader(option, { accept: types.join(',') })\n : 'File types not selected.';\n }\n\n // TODO: (ONLY FOR TESTING!) find a better way to make it testable, e.g. wrap it with a unique class like textOption\n //@ts-ignore\n private numberOption(option: Option) {\n return <input\n type=\"text\"\n value={option.value}\n class=\"s-form-control\"\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onBlur={e => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onInput={e => salla.helpers.inputDigitsOnly(e.target)} />\n }\n\n //@ts-ignore\n private splitterOption() {\n return <div class=\"s-product-options-splitter\" />\n }\n\n //@ts-ignore\n private textOption(option: Option) {\n return <div class=\"s-product-options-text\">\n <input\n type=\"text\"\n value={option.value}\n maxLength={option?.length}\n class='s-form-control'\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onInput={e => this.changedHandler(e, option)} />\n </div>\n }\n\n //@ts-ignore\n private textareaOption(option: Option) {\n //todo::remove mt-1 class, and if it's okay to remove the tag itself will be great\n return <div class=\"s-product-options-textarea\">\n <div class=\"mt-1\">\n <textarea\n rows={4}\n value={option.value}\n maxLength={option?.length}\n class=\"s-form-control\"\n required={!option.visibility_condition && option.required}\n id={`options[${option.id}]`}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onInput={(e) => this.changedHandler(e, option)} />\n </div>\n </div>\n }\n\n //@ts-ignore\n private mapOption(option: Option) {\n return <salla-map\n zoom={15}\n lat={this.getLatLng(option.value, 'lat')}\n lng={this.getLatLng(option.value, 'lng')}\n name={`options[${option.id}]`}\n searchable={true}\n required={option.required}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onSelected={e => this.changedHandler(e, option)} />\n }\n\n private colorPickerOption(option: Option) {\n return <salla-color-picker\n onSubmitted={e => this.changedHandler(e, option)}\n name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n color={option.value} />\n }\n\n /**\n * ============= Date Time options =============\n */\n //@ts-ignore\n private timeOption(option: Option) {\n return <salla-datetime-picker\n noCalendar={true}\n enableTime={true}\n dateFormat=\"h:i K\"\n value={option.value}\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n class=\"s-product-options-time-element\"\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n }\n\n //@ts-ignore\n private dateOption(option: Option) {\n //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23\n return <div class=\"s-product-options-date-element\">\n <salla-datetime-picker\n value={option.value}\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n minDate={new Date()}\n name={`options[${option.id}]`}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n </div>\n }\n\n //@ts-ignore\n private datetimeOption(option: Option) {\n //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23\n return <div class=\"s-product-options-datetime-element\">\n <salla-datetime-picker\n enableTime={true}\n value={option.value}\n dateFormat=\"Y-m-d G:i:K\"\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n maxDate={option.to_date_time}\n minDate={option.from_date_time}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n </div>\n }\n\n /**\n * ============= Advanced options =============\n */\n protected getOptionDetailName(detail: Detail, outOfStock: boolean = true, optionType?: string) {\n if (optionType && optionType == DisplayType.COLOR) {\n return detail.name\n + ((outOfStock && this.isOptionDetailOut(detail)) ? ` <br/> <p> ${this.outOfStockText} </p>` : '')\n + (detail.additional_price ? ` <p> (${salla.money(detail.additional_price)}) </p>` : '');\n }\n\n return detail.name\n + ((outOfStock && this.isOptionDetailOut(detail)) ? ` - ${this.outOfStockText}` : '')\n + (detail.additional_price ? ` (${salla.money(detail.additional_price)})` : '');\n }\n\n\n protected isOptionDetailOut(detail: Detail) {\n if (detail.is_out || !detail.skus_availability || !this.selectedSkus?.length) {\n return detail.is_out;\n }\n\n let isDetailSelected = this.selectedOptions.filter(option => option.id == detail.id).length;\n //if the current options is the only selected option, so we are sure that it's not out, because there is no other options selected yet\n if (isDetailSelected && this.selectedOptions.length == 1) {\n return false;\n }\n\n //if current details has sku in the possible outSkus it's out for sure\n if (isDetailSelected) {\n //here we will get the possible outSkus for current selected options\n let outSelectableSkus = this.selectedSkus.filter(sku => this.outSkus.includes(sku));\n return Object.keys(detail.skus_availability).some(sku => outSelectableSkus.includes(Number(sku)))\n }\n\n return this.selectedOptions.some(option => option.is_out && option.option_id !== detail.option_id)\n\n }\n\n private singleOption(option: Option) {\n return <div>\n <select name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n class=\"s-form-control\"\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={e => this.changedHandler(e, option)}>\n <option value=\"\">{option.placeholder}</option>\n {\n option?.details.map((detail: Detail) => {\n return <option value={detail.id} disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n selected={detail.is_selected}>\n {this.getOptionDetailName(detail)}\n </option>\n })\n }\n </select>\n </div>\n }\n\n private multipleOptions(option: Option) {\n let is_required = option.required && !option.details.some(detail => detail.is_selected) && !option.visibility_condition;\n return <div class={{ \"s-product-options-multiple-options-wrapper\": true, 'required': option.required }}>\n {\n option?.details.map((detail: Detail) => {\n return <div>\n <input type=\"checkbox\"\n value={detail.id}\n disabled={this.isOptionDetailOut(detail)}\n checked={detail.is_selected}\n required={is_required}\n name={`options[${option.id}][]`}\n id={`field-${option.id}-${detail.id}`}\n onChange={(e) => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n aria-describedby={`options[${option.id}]-description`} />\n <label htmlFor={`field-${option.id}-${detail.id}`}>{this.getOptionDetailName(detail)}</label>\n </div>\n })\n }\n </div>\n }\n\n //@ts-ignore\n private colorOption(option: Option) {\n return <fieldset class=\"s-product-options-colors-wrapper\">\n {\n option?.details.map((detail) =>\n <div class=\"s-product-options-colors-item\">\n <input type=\"radio\"\n value={detail.id}\n required={!option.visibility_condition && option.required}\n checked={detail.is_selected}\n name={`options[${option.id}]`}\n disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n id={`color-${this.productId}-${option.id}-${detail.id}`}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={e => this.changedHandler(e, option)} />\n <label htmlFor={`color-${this.productId}-${option.id}-${detail.id}`}>\n <span style={{ \"background-color\": detail.color }} />\n <div innerHTML={this.getOptionDetailName(detail, true, option.type)}></div>\n </label>\n </div>\n )\n }\n </fieldset>\n }\n\n //@ts-ignore\n private thumbnailOption(option: Option) {\n return <div class=\"s-product-options-thumbnails-wrapper\">\n {option.details.map((detail: Detail) => {\n return <div>\n <input type=\"radio\"\n value={detail.id}\n data-itemid={detail.id} //todo:: why need this? it's already in the value!\n required={!option.visibility_condition && option.required}\n checked={detail.is_selected}\n name={`options[${option.id}]`}\n data-img-id={detail.option_value}\n disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n id={`option_${this.productId}-${option.id}_${detail.id}`}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={(e) => this.changedHandler(e, option)} />\n <label htmlFor={`option_${this.productId}-${option.id}_${detail.id}`}\n data-img-id={detail.option_value}\n class=\"go-to-slide\">\n <img data-src={detail.image} src={detail.image} title={detail.name} alt={detail.name} />\n <span innerHTML={CheckCircleIcon} class=\"s-product-options-thumbnails-icon\" />\n {this.isOptionDetailOut(detail) ?\n [\n <small class=\"s-product-options-thumbnails-stock-badge\">{this.outOfStockText}</small>,\n this.canDisabled ? <div class=\"s-product-options-thumbnails-badge-overlay\" /> : '',\n ]\n : ''}\n </label>\n <p>{this.getOptionDetailName(detail, false)} </p>\n </div>\n })}\n </div>\n }\n}\n"],"mappings":";;;wIAAA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KAAK8C,gBAC9D9C,KAAK4C,YAAcR,EAAA,OAAKC,MAAM,+CAAkD,IAEhF,IAEND,EAAA,SAAIpC,KAAK0N,oBAAoB/M,EAAQ,OAAM,Q"}
1
+ {"version":3,"names":["DisplayType","Currency","sallaProductOptionsCss","SallaProductOptions","constructor","hostRef","this","fileTypes","pdf","png","jpg","word","exl","txt","outSkus","handleDonationOptions","event","detail","type","salla","helpers","inputDigitsOnly","target","emit","id","productId","price","value","preventDefault","stopPropagation","isCustomDonation","donationInput","focus","hideLabel","option","DONATION","donation","can_donate","getExpireDonationMessage","completed","target_amount","collected_amount","h","class","target_message","money","lang","get","getWithDefault","config","canDisabled","onLoaded","outOfStockText","donationAmount","selectDonationAmount","selectAmount","options","setOptionsData","Array","isArray","JSON","parse","e","log","optionsData","url","is_page","api","product","getDetails","then","resp","data","that","_b","_a","details","forEach","Object","entries","skus_availability","filter","sku","map","push","Number","getSelectedOptionsData","selectedOptions","formData","host","getElementSallaData","key","startsWith","replace","reportValidity","requiredElements","querySelectorAll","pass","i","length","hasOutOfStockOption","some","is_out","selectedSkus","every","includes","getSelectedOptions","getOption","option_id","find","invalidHandler","closestProductOption","closest","scrollIntoView","behavior","block","classList","add","changedHandler","optionElement","FILE","IMAGE","MAP","lat","lng","setTimeout","remove","index","findIndex","assign","setSelectedSkus","handleRequiredMultipleOptions","changed","keys","reduce","p","c","MULTIPLE_OPTIONS","required","optionContainer","querySelector","hasChecked","input","toggleAttribute","getLatLng","split","getDisplayForType","COLOR_PICKER","colorPickerOption","multipleOptions","SINGLE_OPTION","singleOption","BOOKING","onInvalidInput","getOptionShownWhen","visibility_condition","operator","componentWillLoad","onReady","needsCartId","storage","cart","getCurrentCartId","render","Host","name","splitterOption","htmlFor","placeholder","componentDidLoad","selectedDonationOption","is_selected","additional_price","donationOption","checked","onChange","custom_amount_enabled","shown","ref","el","onInput","onBlur","onInvalid","currency","symbol","fileUploader","additions","height","onAdded","getUploadImageEndpoint","cart_item_id","product_id","innerHTML","accept","CameraIcon","FileIcon","imageOption","fileOption","types","Boolean","join","numberOption","textOption","maxLength","textareaOption","rows","mapOption","zoom","searchable","onSelected","onSubmitted","color","timeOption","noCalendar","enableTime","dateFormat","onPicked","dateOption","minDate","Date","datetimeOption","maxDate","to_date_time","from_date_time","getOptionDetailName","outOfStock","optionType","COLOR","isOptionDetailOut","isDetailSelected","outSelectableSkus","disabled","selected","is_required","colorOption","style","thumbnailOption","option_value","image","src","title","alt","CheckCircleIcon"],"sources":["src/components/salla-product-options/interfaces.ts","src/components/salla-product-options/salla-product-options.scss?tag=salla-product-options","src/components/salla-product-options/salla-product-options.tsx"],"sourcesContent":["export enum DisplayType {\n COLOR = \"color\",\n DATE = \"date\",\n DATETIME = \"datetime\",\n DONATION = \"donation\",\n IMAGE = \"image\",\n MULTIPLE_OPTIONS = \"multiple-options\",\n NUMBER = \"number\",\n SINGLE_OPTION = \"single-option\",\n SPLITTER = \"splitter\",\n TEXT = \"text\",\n TEXTAREA = \"textarea\",\n THUMBNAIL = \"thumbnail\",\n TIME = \"time\",\n RADIO = \"radio\",\n CHECKBOX = \"checkbox\",\n MAP = \"map\",\n FILE = \"file\", // similar to image type (file-uploader component)\n COLOR_PICKER = \"color_picker\",\n BOOKING = \"booking\"\n}\n\nexport interface ProductDetail {\n id: string;\n sku: string;\n name: string;\n description: string;\n url: string;\n promotion_title: string;\n subtitle: string;\n type: string;\n status: string;\n price: number;\n sale_price: number;\n regular_price: number;\n starting_price: null;\n quantity: number;\n max_quantity: number;\n discount_ends: number;\n is_taxable: boolean;\n has_read_more: boolean;\n can_add_note: boolean;\n can_show_remained_quantity: boolean;\n can_upload_file: boolean;\n has_custom_form: boolean;\n is_on_sale: boolean;\n is_hidden_quantity: boolean;\n is_available: boolean;\n is_out_of_stock: boolean;\n weight: null;\n calories: null;\n image: SimpleImage;\n brand: Brand;\n donation?: ProductDonation;\n images: Image[];\n tags: Tag[];\n notify_availability: null;\n rating: Rating;\n options: Option[];\n sold_quantity: number;\n category: Category;\n}\n\nexport interface SimpleImage {\n url: string;\n alt: string;\n}\n\nexport interface Category {\n name: string;\n url: string;\n icon: string;\n}\n\nexport interface ProductDonation {\n target_message?: string;\n collected_amount?: number;\n target_amount?: number;\n target_percent?: number;\n target_end_date?: string;\n can_donate: boolean;\n custom_amount_enabled: boolean;\n}\n\nexport interface Image {\n id: number;\n url: string;\n main: boolean;\n three_d_image_url: string;\n alt: string;\n video_url: string;\n type: string;\n sort: number;\n}\n\nexport interface Option {\n id: number;\n name: string;\n required: boolean;\n type: string;\n placeholder: string;\n option_type: string;\n not_same_day_order: boolean;\n availability_range: number;\n from_date_time: null;\n to_date_time: null;\n visibility_condition?: { option: number, operator: \"=\" | \"!=\", value: number };\n details?: Detail[];\n condition_attributes: string;\n value?: any;\n length?: number;\n donation?: Donation\n}\n\nexport interface Donation {\n custom_amount_enabled: boolean;\n target_message?: string;\n target_date: string | \"2023-04-18\";\n target_end_date: string | \"2023-04-18\";\n target_amount: number;\n collected_amount: number;\n can_donate: boolean;\n}\n\nexport interface Detail {\n id: number;\n option_id: number;\n name: string;\n additional_price: number;\n option_value: null | string;\n image: null | string;\n color: null | string;\n is_out: boolean;\n skus_availability?: { [sku_id: number]: boolean };\n is_selected: boolean;\n}\n\nexport interface Brand {\n id: string;\n url: string;\n name: string;\n logo: string;\n}\n\nexport interface PreTaxPrice {\n amount: number;\n currency: Currency;\n}\n\nexport enum Currency {\n Sar = \"SAR\",\n}\n\nexport interface Promotion {\n title: string;\n sub_title: string;\n}\n\nexport interface Rating {\n count: number;\n stars: number;\n}\n\nexport interface Tag {\n name: string;\n url: string;\n}\n","\n.s-product-options{\n &-wrapper{\n\n }\n &-option-container{\n\n }\n &-option{\n\n }\n &-option-label{\n\n }\n &-option-content{\n\n }\n &-colors-wrapper{\n\n }\n &-date-element{\n\n }\n &-time-element{\n \n }\n &-datetime-element{\n\n }\n &-image-input{\n\n }\n &-multiple-options-wrapper{\n\n }\n &-splitter{\n\n }\n &-text{\n\n }\n &-textarea{\n\n }\n &-thumbnails-wrapper{\n\n }\n}","import { Component, Prop, h, State, Element, Host, Event, EventEmitter, Method } from '@stencil/core';\nimport { Option, DisplayType, Detail } from './interfaces';\nimport CheckCircleIcon from '../../assets/svg/check.svg';\nimport CameraIcon from '../../assets/svg/camera.svg';\nimport FileIcon from '../../assets/svg/file-upload.svg';\n\n\n@Component({\n tag: 'salla-product-options',\n styleUrl: 'salla-product-options.scss',\n})\nexport class SallaProductOptions {\n\n constructor() {\n this.canDisabled = !salla.config.get('store.settings.product.notify_options_availability');\n salla.lang.onLoaded(() => {\n this.outOfStockText = salla.lang.get(\"pages.products.out_of_stock\");\n this.donationAmount = salla.lang.get('pages.products.donation_amount');\n this.selectDonationAmount = salla.lang.getWithDefault('pages.products.select_donation_amount', 'تحديد مبلغ التبرع');\n this.selectAmount = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ');\n });\n\n if (this.options) {\n try {\n this.setOptionsData(Array.isArray(this.options) ? this.options : JSON.parse(this.options));\n return;\n } catch (e) {\n salla.log('Bad json passed via options prop');\n }\n }\n if (!Array.isArray(this.optionsData)) {\n salla.log('Options is not an array[] ---> ', this.optionsData);\n this.setOptionsData([]);\n }\n\n if (this.productId && !salla.url.is_page('cart')) {\n salla.api.product.getDetails(this.productId, ['options']).then(resp => this.setOptionsData(resp.data.options));\n }\n }\n\n private setOptionsData(optionsData: Option[]) {\n this.optionsData = optionsData;\n let that = this\n this.optionsData[0]?.details?.forEach(function (detail) {\n Object.entries(detail.skus_availability || {})\n .filter(sku => !sku[1])\n .map(sku => that.outSkus.push(Number(sku[0])));\n });\n }\n\n @Element() host: HTMLElement;\n\n private fileTypes: Object = {\n pdf: 'application/pdf',\n png: 'image/png',\n jpg: 'image/jpeg',\n word: 'application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n exl: 'application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n txt: 'text/plain',\n };\n\n @State() optionsData: Option[];\n @State() outOfStockText: string = ''\n @State() donationAmount: string = salla.lang.get('pages.products.donation_amount')\n @State() selectDonationAmount: string = salla.lang.getWithDefault('pages.products.select_donation_amount', 'تحديد مبلغ التبرع')\n @State() selectAmount: string = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ')\n @State() isCustomDonation: boolean = false;\n @State() selectedOptions: Array<any> = [];\n @State() canDisabled: boolean;\n @State() selectedSkus?: Array<string | number>;\n @State() selectedOutSkus?: Array<string | number>;\n private outSkus: Array<string | number> = [];\n private donationInput?: HTMLInputElement;\n\n /**\n * The id of the product to which the options are going to be fetched for.\n */\n @Prop() productId: number = salla.config.get('page.id');\n\n /**\n * Product detail information.\n */\n @Prop() options: string;\n\n /**\n * Get the id's of the selected options.\n * */\n @Method()\n async getSelectedOptionsData() {\n let selectedOptions = {}\n let formData = (this.host as any).getElementSallaData();\n formData.forEach(function (value, key) {\n key.startsWith('options[') && (selectedOptions[key.replace('options[', '').replace(']', '')] = value);\n });\n return selectedOptions;\n }\n\n /**\n * Report options form validity.\n * */\n @Method()\n async reportValidity() {\n let requiredElements: Array<HTMLInputElement> = this.host.querySelectorAll('[required]') as any;\n let pass = true;\n for (let i = 0; i < requiredElements.length; i++) {\n //if there is only one invalid option, return false\n if ('reportValidity' in requiredElements[i] && !requiredElements[i].reportValidity()) {\n pass = false;\n }\n }\n return pass;\n }\n\n /**\n * Return true if there is any out of stock options are selected and vise versa.\n * */\n @Method()\n async hasOutOfStockOption() {\n return this.selectedOptions.some(option => option.is_out) || (this.selectedSkus?.length && this.selectedSkus?.every(sku => this.outSkus.includes(sku)));\n }\n\n /**\n * Get selected options.\n * */\n @Method()\n async getSelectedOptions() {\n return this.selectedOptions;\n }\n\n /**\n * Get a specific option by its id.\n * */\n @Method()\n async getOption(option_id) {\n return this.optionsData.find(option => option.id === option_id);\n }\n\n /**\n * An event that emitted when any option is changed.\n */\n @Event() changed: EventEmitter;\n\n // @ts-ignore\n private invalidHandler(event, option: Option) {\n const closestProductOption = (event.target as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (!salla.url.is_page('cart')) {\n closestProductOption.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }\n closestProductOption.classList.add('s-product-options-option-error');\n }\n\n private changedHandler(event, option) {\n let data = { event: event, option: option, detail: null };\n if (option.details) {\n let detail = option.details.find((detail) => {\n return Number(detail.id) === Number(event.target.value);\n });\n data.detail = detail\n }\n\n let optionElement = event.target.closest('.s-product-options-option');\n if (event.target.value\n || ((option.type == DisplayType.FILE || option.type == DisplayType.IMAGE) && event.type === 'added')\n || (option.type == DisplayType.MAP && event.type === 'selected' && (event.target.lat && event.target.lng))) {\n setTimeout(() => {\n optionElement.classList.remove('s-product-options-option-error');\n }, 200);\n }\n\n const index = this.selectedOptions.findIndex(option => option.option_id === data.option.id);\n index > -1 ? this.selectedOptions[index] = {\n ...data.detail,\n option_id: data.option.id\n } : this.selectedOptions.push({ ...data.detail, option_id: data.option.id })\n\n if (option.type == DisplayType.DONATION) {\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n }\n this.setSelectedSkus();\n this.handleRequiredMultipleOptions(option);\n this.changed.emit(data);\n salla.event.emit('product-options::change', data);\n }\n\n\n private handleDonationOptions = (event, detail, type) => {\n if (detail == 'custom' && type == 'input') {\n salla.helpers.inputDigitsOnly(event.target)\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.isCustomDonation = event.target.value === 'custom';\n if (this.donationInput) {\n if (event.target.value === 'custom') {\n this.donationInput.value = '';\n this.donationInput.focus()\n } else {\n this.donationInput.value = event.target.value;\n }\n if (detail == 'custom') {\n return\n }\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n }\n }\n\n private hideLabel = (option) => {\n if (option.type === DisplayType.DONATION && (option.donation && !option.donation.can_donate)) {\n return true;\n }\n return false;\n }\n\n private getExpireDonationMessage = (option) => {\n if (!option.donation) {\n return;\n }\n let completed = option.donation.target_amount <= option.donation.collected_amount;\n return <div class={{ \"s-product-options-donation-message\": true, \"s-product-options-donation-completed\": completed, \"s-product-options-donation-expired\": !completed }}>\n <p>{option.donation.target_message}</p>\n <span>{completed ? salla.money(option.donation.target_amount) : ''}</span>\n </div>\n }\n /**\n * loop throw all selected details, then get common sku, if it's only one, means we selected all of them;\n */\n private setSelectedSkus() {\n this.selectedSkus = this.selectedOptions.map(detail => Object.keys(detail.skus_availability || {}))\n .reduce((p, c) => p.filter(e => c.includes(e)))\n .map(sku => Number(sku));\n }\n\n private handleRequiredMultipleOptions(option) {\n if (option.type !== DisplayType.MULTIPLE_OPTIONS || !option.required) {\n return;\n }\n const optionContainer = this.host.querySelector(`[data-option-id=\"${option.id}\"]`);\n const hasChecked = optionContainer.querySelectorAll('input:checked').length;\n optionContainer.querySelectorAll('input').forEach(input => input.toggleAttribute('required', !hasChecked));\n }\n\n private getLatLng(value, type: 'lat' | 'lng') {\n return value\n ? value.split(',')[type == 'lat' ? 0 : 1]\n : '';\n }\n\n private getDisplayForType(option: Option) {\n if (this[`${option.type}Option`]) {\n return this[`${option.type}Option`](option);\n }\n\n if (option.type === DisplayType.COLOR_PICKER) {\n return this.colorPickerOption(option)\n }\n\n if (option.type === DisplayType.MULTIPLE_OPTIONS) {\n return this.multipleOptions(option);\n }\n\n if (option.type === DisplayType.SINGLE_OPTION) {\n return this.singleOption(option);\n } \n \n if (option.type === DisplayType.BOOKING && salla.config.get('page.slug') == 'cart') {\n return <salla-booking-field onInvalidInput={(e) => this.invalidHandler(e, option)} option={option as any} productId={option.value}></salla-booking-field>\n }\n \n salla.log(`Couldn't find options type(${option.type})😢`);\n return '';\n }\n\n protected getOptionShownWhen(option: Option) {\n return option.visibility_condition\n ? { \"data-show-when\": `options[${option.visibility_condition.option}] ${option.visibility_condition.operator} ${option.visibility_condition.value}` }\n : {};\n }\n\n //we need the cart Id for productOption Image\n componentWillLoad() {\n this.outOfStockText = salla.lang.get('pages.products.out_of_stock')\n return salla.onReady(() => {\n const needsCartId = (!salla.storage.get('cart.id') && this.optionsData.some(option => ['file', 'image'].includes(option.type)));\n return needsCartId ? salla.api.cart.getCurrentCartId(false, \"salla-product-options\") : null;\n })\n }\n\n render() {\n if (this.optionsData?.length == 0) {\n return;\n }\n\n return (\n <Host class=\"s-product-options-wrapper\">\n {/* TODO:: move salla-conditional-field logic to here, no need of another component*/}\n <salla-conditional-fields>\n {this.optionsData.map((option: Option) =>\n <div class={`s-product-options-option-container${option.visibility_condition ? ' hidden' : ''}`}\n data-option-id={option.id}\n {...this.getOptionShownWhen(option)}>\n {option.name == 'splitter' ?\n this.splitterOption()\n : <div class={{\"s-product-options-option\": true, \"s-product-options-option-booking\": option.type === DisplayType.BOOKING && salla.config.get('page.slug') == 'cart'}} data-option-type={option.type}\n data-option-required={`${option.required}`}>\n <label htmlFor={'options[' + option.id + ']'} class={`s-product-options-option-label ${this.hideLabel(option) ? 's-product-options-option-label-hidden' : ''}`}>\n <b>\n {option.name}\n {option.required && <span> * </span>} </b>\n <small>{option.placeholder}</small>\n </label>\n <div class={`s-product-options-option-content ${this.hideLabel(option) ? 's-product-options-option-content-full-width' : ''}`}>\n {this.getDisplayForType(option)}\n </div>\n </div>}\n </div>\n )}\n </salla-conditional-fields>\n </Host>\n );\n\n }\n\n componentDidLoad(){\n if (this.optionsData?.length == 0 && !this.optionsData.some(option => option.type == DisplayType.DONATION)) {\n return;\n }\n let selectedDonationOption = this.optionsData.find(option => option.type == DisplayType.DONATION)?.details.find(detail => detail.is_selected);\n if (!selectedDonationOption) {\n return;\n }\n setTimeout(() => {\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: selectedDonationOption.additional_price\n });\n }, 1000);\n }\n //@ts-ignore\n private donationOption(option: Option, product: Product) {\n return <div class=\"s-product-options-donation-wrapper\">\n\n {option.donation?.can_donate ? [\n option.donation ?\n <div class=\"s-product-options-donation-progress\">\n <salla-progress-bar donation={option.donation}>\n </salla-progress-bar>\n </div>\n : '',\n option.details.length ?\n [<h4>{this.selectAmount}</h4>,\n <div class=\"s-product-options-donation-options\">\n {option.details.map((detail, i) =>\n <div class=\"s-product-options-donation-options-item\">\n <input id={`donation-option-${i}`} type=\"radio\" name=\"donating_option\" checked={detail.is_selected} value={detail.additional_price} onChange={e => this.handleDonationOptions(e, detail, 'option')} />\n <label htmlFor={`donation-option-${i}`}>\n <span>{salla.money(detail.name)}</span>\n </label>\n </div>\n )}\n {option.donation?.custom_amount_enabled ?\n <div class=\"s-product-options-donation-options-item\">\n <input id={`donation-option-custom`} type=\"radio\" name=\"donating_option\" value=\"custom\" onChange={e => this.handleDonationOptions(e, 'custom', 'option')} />\n <label htmlFor={`donation-option-custom`}>\n <span> {this.selectDonationAmount} </span>\n </label>\n </div>\n : ''\n }\n </div>] : '',\n\n <div class={{ \"s-product-options-donation-input-group\": true, \"shown\": !option.details.length || (option.details.length && this.isCustomDonation) }}>\n <input\n type=\"text\"\n id=\"donating-amount\"\n name=\"donation_amount\"\n class=\"s-form-control\"\n ref={el => this.donationInput = el as HTMLInputElement}\n value={\n option.details.length\n && option.details.some(detail => detail.is_selected)\n ? option.details.find(detail => detail.is_selected).additional_price\n : option.value}\n // required\n placeholder={option.placeholder}\n onInput={e => this.handleDonationOptions(e, 'custom', 'input')}\n onBlur={e => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n />\n {/* value={option.value} */}\n <span class=\"s-product-options-donation-amount-currency\">\n {salla.config.currency(salla.config.get('user.currency_code')).symbol}\n </span>\n </div>\n ] :\n this.getExpireDonationMessage(option)\n }\n </div>\n }\n\n private fileUploader(option: Option, additions: Object | null = null) {\n return <salla-file-upload\n {...(additions || {})}\n payload-name=\"file\"\n value={option.value}\n instant-upload={true}\n name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n height=\"120px\"\n onAdded={(e) => this.changedHandler(e, option)}\n url={salla.cart.api.getUploadImageEndpoint()}\n form-data={{ cart_item_id: this.productId, product_id: this.productId }}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n class={{ \"s-product-options-image-input\": true, required: option.required }}\n >\n <div class=\"s-product-options-filepond-placeholder\">\n <span class=\"s-product-options-filepond-placeholder-icon\"\n innerHTML={(additions as any).accept && (additions as any).accept.split(',').every(type => type.includes('image'))\n ? CameraIcon\n : FileIcon}\n />\n <p class=\"s-product-options-filepond-placeholder-text\">{salla.lang.get('common.uploader.drag_and_drop')}</p>\n <span class=\"filepond--label-action\">{salla.lang.get('common.uploader.browse')}</span>\n </div>\n </salla-file-upload>\n }\n\n //@ts-ignore\n private imageOption(option: Option) {\n return this.fileUploader(option, { accept: 'image/png,image/jpeg,image/jpg,image/gif' });\n }\n\n //@ts-ignore\n private fileOption(option: Option) {\n let types = option.details.map(detail => this.fileTypes[detail.name]).filter(Boolean);\n return types?.length\n ? this.fileUploader(option, { accept: types.join(',') })\n : 'File types not selected.';\n }\n\n // TODO: (ONLY FOR TESTING!) find a better way to make it testable, e.g. wrap it with a unique class like textOption\n //@ts-ignore\n private numberOption(option: Option) {\n return <input\n type=\"text\"\n value={option.value}\n class=\"s-form-control\"\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onBlur={e => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onInput={e => salla.helpers.inputDigitsOnly(e.target)} />\n }\n\n //@ts-ignore\n private splitterOption() {\n return <div class=\"s-product-options-splitter\" />\n }\n\n //@ts-ignore\n private textOption(option: Option) {\n return <div class=\"s-product-options-text\">\n <input\n type=\"text\"\n value={option.value}\n maxLength={option?.length}\n class='s-form-control'\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onInput={e => this.changedHandler(e, option)} />\n </div>\n }\n\n //@ts-ignore\n private textareaOption(option: Option) {\n //todo::remove mt-1 class, and if it's okay to remove the tag itself will be great\n return <div class=\"s-product-options-textarea\">\n <div class=\"mt-1\">\n <textarea\n rows={4}\n value={option.value}\n maxLength={option?.length}\n class=\"s-form-control\"\n required={!option.visibility_condition && option.required}\n id={`options[${option.id}]`}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onInput={(e) => this.changedHandler(e, option)} />\n </div>\n </div>\n }\n\n //@ts-ignore\n private mapOption(option: Option) {\n return <salla-map\n zoom={15}\n lat={this.getLatLng(option.value, 'lat')}\n lng={this.getLatLng(option.value, 'lng')}\n name={`options[${option.id}]`}\n searchable={true}\n required={option.required}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onSelected={e => this.changedHandler(e, option)} />\n }\n\n private colorPickerOption(option: Option) {\n return <salla-color-picker\n onSubmitted={e => this.changedHandler(e, option)}\n name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n color={option.value} />\n }\n\n /**\n * ============= Date Time options =============\n */\n //@ts-ignore\n private timeOption(option: Option) {\n return <salla-datetime-picker\n noCalendar={true}\n enableTime={true}\n dateFormat=\"h:i K\"\n value={option.value}\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n class=\"s-product-options-time-element\"\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n }\n\n //@ts-ignore\n private dateOption(option: Option) {\n //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23\n return <div class=\"s-product-options-date-element\">\n <salla-datetime-picker\n value={option.value}\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n minDate={new Date()}\n name={`options[${option.id}]`}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n </div>\n }\n\n //@ts-ignore\n private datetimeOption(option: Option) {\n //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23\n return <div class=\"s-product-options-datetime-element\">\n <salla-datetime-picker\n enableTime={true}\n value={option.value}\n dateFormat=\"Y-m-d G:i:K\"\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n maxDate={option.to_date_time}\n minDate={option.from_date_time}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n </div>\n }\n\n /**\n * ============= Advanced options =============\n */\n protected getOptionDetailName(detail: Detail, outOfStock: boolean = true, optionType?: string) {\n if (optionType && optionType == DisplayType.COLOR) {\n return detail.name\n + ((outOfStock && this.isOptionDetailOut(detail)) ? ` <br/> <p> ${this.outOfStockText} </p>` : '')\n + (detail.additional_price ? ` <p> (${salla.money(detail.additional_price)}) </p>` : '');\n }\n\n return detail.name\n + ((outOfStock && this.isOptionDetailOut(detail)) ? ` - ${this.outOfStockText}` : '')\n + (detail.additional_price ? ` (${salla.money(detail.additional_price)})` : '');\n }\n\n\n protected isOptionDetailOut(detail: Detail) {\n if (detail.is_out || !detail.skus_availability || !this.selectedSkus?.length) {\n return detail.is_out;\n }\n\n let isDetailSelected = this.selectedOptions.filter(option => option.id == detail.id).length;\n //if the current options is the only selected option, so we are sure that it's not out, because there is no other options selected yet\n if (isDetailSelected && this.selectedOptions.length == 1) {\n return false;\n }\n\n //if current details has sku in the possible outSkus it's out for sure\n if (isDetailSelected) {\n //here we will get the possible outSkus for current selected options\n let outSelectableSkus = this.selectedSkus.filter(sku => this.outSkus.includes(sku));\n return Object.keys(detail.skus_availability).some(sku => outSelectableSkus.includes(Number(sku)))\n }\n\n return this.selectedOptions.some(option => option.is_out && option.option_id !== detail.option_id)\n\n }\n\n private singleOption(option: Option) {\n return <div>\n <select name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n class=\"s-form-control\"\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={e => this.changedHandler(e, option)}>\n <option value=\"\">{option.placeholder}</option>\n {\n option?.details.map((detail: Detail) => {\n return <option value={detail.id} disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n selected={detail.is_selected}>\n {this.getOptionDetailName(detail)}\n </option>\n })\n }\n </select>\n </div>\n }\n\n private multipleOptions(option: Option) {\n let is_required = option.required && !option.details.some(detail => detail.is_selected) && !option.visibility_condition;\n return <div class={{ \"s-product-options-multiple-options-wrapper\": true, 'required': option.required }}>\n {\n option?.details.map((detail: Detail) => {\n return <div>\n <input type=\"checkbox\"\n value={detail.id}\n disabled={this.isOptionDetailOut(detail)}\n checked={detail.is_selected}\n required={is_required}\n name={`options[${option.id}][]`}\n id={`field-${option.id}-${detail.id}`}\n onChange={(e) => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n aria-describedby={`options[${option.id}]-description`} />\n <label htmlFor={`field-${option.id}-${detail.id}`}>{this.getOptionDetailName(detail)}</label>\n </div>\n })\n }\n </div>\n }\n\n //@ts-ignore\n private colorOption(option: Option) {\n return <fieldset class=\"s-product-options-colors-wrapper\">\n {\n option?.details.map((detail) =>\n <div class=\"s-product-options-colors-item\">\n <input type=\"radio\"\n value={detail.id}\n required={!option.visibility_condition && option.required}\n checked={detail.is_selected}\n name={`options[${option.id}]`}\n disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n id={`color-${this.productId}-${option.id}-${detail.id}`}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={e => this.changedHandler(e, option)} />\n <label htmlFor={`color-${this.productId}-${option.id}-${detail.id}`}>\n <span style={{ \"background-color\": detail.color }} />\n <div innerHTML={this.getOptionDetailName(detail, true, option.type)}></div>\n </label>\n </div>\n )\n }\n </fieldset>\n }\n\n //@ts-ignore\n private thumbnailOption(option: Option) {\n return <div class=\"s-product-options-thumbnails-wrapper\">\n {option.details.map((detail: Detail) => {\n return <div>\n <input type=\"radio\"\n value={detail.id}\n data-itemid={detail.id} //todo:: why need this? it's already in the value!\n required={!option.visibility_condition && option.required}\n checked={detail.is_selected}\n name={`options[${option.id}]`}\n data-img-id={detail.option_value}\n disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n id={`option_${this.productId}-${option.id}_${detail.id}`}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={(e) => this.changedHandler(e, option)} />\n <label htmlFor={`option_${this.productId}-${option.id}_${detail.id}`}\n data-img-id={detail.option_value}\n class=\"go-to-slide\">\n <img data-src={detail.image} src={detail.image} title={detail.name} alt={detail.name} />\n <span innerHTML={CheckCircleIcon} class=\"s-product-options-thumbnails-icon\" />\n {this.isOptionDetailOut(detail) ?\n [\n <small class=\"s-product-options-thumbnails-stock-badge\">{this.outOfStockText}</small>,\n this.canDisabled ? <div class=\"s-product-options-thumbnails-badge-overlay\" /> : '',\n ]\n : ''}\n </label>\n <p>{this.getOptionDetailName(detail, false)} </p>\n </div>\n })}\n </div>\n }\n}\n"],"mappings":";;;wIAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,iBACAA,EAAA,eACAA,EAAA,uBACAA,EAAA,uBACAA,EAAA,iBACAA,EAAA,uCACAA,EAAA,mBACAA,EAAA,iCACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,uBACAA,EAAA,yBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,uBACAA,EAAA,aACAA,EAAA,eACAA,EAAA,+BACAA,EAAA,oBACD,EApBD,CAAYA,MAAW,KAqJvB,IAAYC,GAAZ,SAAYA,GACVA,EAAA,YACD,EAFD,CAAYA,MAAQ,K,u/BCrJpB,MAAMC,EAAyB,G,MCWlBC,EAAmB,MAE9B,WAAAC,CAAAC,G,2CAuCQC,KAAAC,UAAoB,CAC1BC,IAAK,kBACLC,IAAK,YACLC,IAAK,aACLC,KAAM,gIACNC,IAAK,yJACLC,IAAK,cAaCP,KAAAQ,QAAkC,GAqHlCR,KAAAS,sBAAwB,CAACC,EAAOC,EAAQC,KAC9C,GAAID,GAAU,UAAYC,GAAQ,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OO,GAAE,cACHP,EAAOO,GACpBkH,UAAWxG,EAAOyH,sBAAwBzH,EAAOwG,SACjDoC,QAAS7J,EAAO0J,YAChBN,KAAM,WAAWnI,EAAOV,MAAK,cAChBP,EAAO4N,aACpBN,SAAUjO,KAAK4C,aAAe5C,KAAK8N,kBAAkBnN,GACrDO,GAAI,UAAUlB,KAAKmB,aAAaS,EAAOV,MAAMP,EAAOO,KACpD8J,UAAYxH,GAAMxD,KAAKwG,eAAehD,EAAG5B,GACzC6I,SAAWjH,GAAMxD,KAAKgH,eAAexD,EAAG5B,KAC1CQ,EAAA,SAAO6H,QAAS,UAAUjK,KAAKmB,aAAaS,EAAOV,MAAMP,EAAOO,KAAI,cACrDP,EAAO4N,aACpBlM,MAAM,eACND,EAAA,kBAAezB,EAAO6N,MAAOC,IAAK9N,EAAO6N,MAAOE,MAAO/N,EAAOoJ,KAAM4E,IAAKhO,EAAOoJ,OAChF3H,EAAA,QAAMsJ,UAAWkD,EAAiBvM,MAAM,sCACvCrC,KAAK8N,kBAAkBnN,GACtB,CACEyB,EAAA,SAAOC,MAAM,4CAA4CrC,KAAK8C,gBAC9D9C,KAAK4C,YAAcR,EAAA,OAAKC,MAAM,+CAAkD,IAEhF,IAEND,EAAA,SAAIpC,KAAK0N,oBAAoB/M,EAAQ,OAAM,Q"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{p as e,b as t}from"./p-bdd00808.js";export{s as setNonce}from"./p-bdd00808.js";import{g as a}from"./p-4a9df09e.js";import"./p-f84bae34.js";const o=()=>{const t=import.meta.url;const a={};if(t!==""){a.resourcesUrl=new URL(".",t).href}return e(a)};o().then((e=>{a();return t(JSON.parse('[["p-95dc9706",[[0,"salla-offer",{"productCardComponent":[1,"product-card-component"],"offersList":[32],"userCurrency":[32],"isMultipleBank":[32],"title":[32],"currentPage":[32],"hasCustomComponent":[32],"isBankOffer":[32],"canRender":[32],"showOffer":[32],"offer_with_price_text":[32],"with_discount_text":[32],"product_discount_text":[32],"special_offer_text":[32],"multipleBankOfferTitleText":[32],"multipleBankOfferTitleDescription":[32],"buy_quantity_text":[32]}]]],["p-0b3b39fc",[[0,"salla-products-slider",{"blockTitle":[1,"block-title"],"subTitle":[1,"sub-title"],"sliderId":[1,"slider-id"],"displayAllUrl":[1,"display-all-url"],"autoplay":[1028],"source":[1537],"sourceValue":[1,"source-value"],"limit":[1026],"sliderConfig":[520,"slider-config"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"productsData":[32],"isReady":[32],"sourceValueIsValid":[32],"hasCustomComponent":[32],"apiUrl":[32],"parsedSourceValue":[32]}]]],["p-5a27af8a",[[0,"salla-product-options",{"productId":[2,"product-id"],"options":[1],"optionsData":[32],"outOfStockText":[32],"donationAmount":[32],"selectDonationAmount":[32],"selectAmount":[32],"isCustomDonation":[32],"selectedOptions":[32],"canDisabled":[32],"selectedSkus":[32],"selectedOutSkus":[32],"getSelectedOptionsData":[64],"reportValidity":[64],"hasOutOfStockOption":[64],"getSelectedOptions":[64],"getOption":[64]}]]],["p-05d7338b",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["p-9a3da756",[[0,"salla-notifications",{"loadMoreText":[1,"load-more-text"],"itemPerPage":[2,"item-per-page"],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"no_notifications_trans":[32],"load_more_text_trans":[32]}]]],["p-0b229465",[[0,"salla-order-summary",{"orderId":[514,"order-id"],"codeCopied":[32],"noItemFound":[32],"order_items":[32]}]]],["p-8ea7d6d1",[[0,"salla-reviews",{"displayAllLink":[516,"display-all-link"],"source":[513],"sourceValue":[513,"source-value"],"limit":[514],"type":[1],"sort":[1],"hideCustomerInfo":[4,"hide-customer-info"],"reviews":[32],"isRTL":[32],"showReviews":[32],"testimonialText":[32],"displayAllLinkText":[32]}]]],["p-2554f5b7",[[0,"salla-conditional-offer",{"offer":[32],"products":[32],"isLoading":[32],"canRender":[32]}]]],["p-7c3d6111",[[0,"salla-orders",{"params":[16],"loadMoreText":[1,"load-more-text"],"orderNumberText":[32],"totalOrderText":[32],"orderDateText":[32],"orderStatusText":[32],"noOrderText":[32],"load_more_text_trans":[32],"languageCode":[32],"orders":[32],"pagination":[32],"hasInfiniteScroll":[32],"total":[32],"nextPage":[32],"showPlaceholder":[32]}]]],["p-57de180e",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["p-2c451eb4",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["p-dabb0e14",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["p-8c1b4c7c",[[0,"salla-contacts",{"contactsTitle":[1025,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["p-2cb87af3",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32],"mispayActive":[32],"installment_sheria_text":[32]}]]],["p-511cee71",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["p-d3b196a8",[[0,"salla-metadata",{"entity":[1],"entityId":[2,"entity-id"],"specs":[32],"download":[32]}]]],["p-7a79eee0",[[0,"salla-payments",{"exclude":[1040]}]]],["p-3faa7926",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["p-411485fc",[[4,"salla-gifting",{"productId":[2,"product-id"],"widgetTitle":[1,"widget-title"],"widgetSubtitle":[1,"widget-subtitle"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[1544,"prize-points"],"customerPoints":[1538,"customer-points"],"prizeTitle":[1537,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1025,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"inline":[516],"withoutReload":[4,"without-reload"],"currentTabName":[32],"regType":[32],"translationLoaded":[32],"isModalOpen":[32],"currentPhone":[32],"currentEmail":[32],"title":[32],"emailErrorMsg":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"hasError":[32],"errorMessage":[32],"dragAndDrop":[32],"browseFromFiles":[32],"customFields":[32],"uploadedImage":[32],"open":[64]},[[8,"verified","onVerified"]]],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"productID":[32],"offer_type":[32],"translationLoaded":[32],"addToCartLabel":[32],"open":[64],"showOffer":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64]}],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"loading":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-user-profile",{"customFields":[1,"custom-fields"],"minAge":[2,"min-age"],"userData":[32],"userDefinedFields":[32],"disableAction":[32],"isLoading":[32],"first_name_trans":[32],"last_name_trans":[32],"birthday_trans":[32],"birthday_placeholder_trans":[32],"gender_trans":[32],"gender_placeholder_trans":[32],"male_trans":[32],"female_trans":[32],"email_trans":[32],"mobile_trans":[32],"save_btn_trans":[32],"drag_and_drop_trans":[32],"browse_trans":[32],"email_required_trans":[32],"invalid_email_trans":[32],"setCustomFields":[64]}],[0,"salla-bottom-alert",{"type":[513],"icon":[513],"message":[513],"actionUrl":[513,"action-url"],"actionLabel":[513,"action-label"],"storeId":[32],"template":[32],"loading":[32],"templateData":[32],"defaultMessage":[32],"defaultActionLabel":[32],"storeFeatures":[32],"storeDetails":[32],"storePrice":[32],"theDeveloper":[32],"templateInformation":[32],"buyTheTemplate":[32],"isRtl":[32]}],[0,"salla-comments",{"itemId":[2,"item-id"],"loadMoreText":[1,"load-more-text"],"hideForm":[4,"hide-form"],"blockTitle":[1,"block-title"],"hideTitle":[4,"hide-title"],"type":[1],"showFormAvatar":[4,"show-form-avatar"],"sort":[1],"testimonials":[4],"comments":[32],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"noComments":[32],"comment_title":[32],"comment_name":[32],"placeholder_text":[32],"reload":[64]}],[0,"salla-quick-order",{"quickOrderTitle":[1025,"quick-order-title"],"subTitle":[1025,"sub-title"],"payButtonTitle":[1025,"pay-button-title"],"confirmPayButtonTitle":[1025,"confirm-pay-button-title"],"agreementText":[1025,"agreement-text"],"isEmailRequired":[1028,"is-email-required"],"productId":[1025,"product-id"],"thanksMessage":[1025,"thanks-message"],"quickOrderStyle":[1025,"quick-order-style"],"user":[32],"isAvailable":[32],"oneClick":[32],"expanded":[32],"isTermsRequired":[32],"countryCode":[32],"submitSucess":[32],"placeHolderEmail":[32],"emailOptional":[32],"agreementShowText":[32],"agreementModalHead":[32],"userNameLabel":[32],"termsChecked":[32]}],[0,"salla-user-settings",{"isNotifiable":[516,"is-notifiable"],"deactivateAccount":[32],"promotionalMsgs":[32],"deactivateDesc":[32],"promotionalMsgsDesc":[32],"sorryForLeavingText":[32],"warningText":[32],"keepAccount":[32],"buttonLoading":[32]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"maxWords":[2,"max-words"],"showAction":[4,"show-action"],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]]],[0,"salla-menu",{"source":[1],"sourceValue":[1,"source-value"],"topnav":[4],"useReactLink":[4,"use-react-link"],"limit":[2],"menus":[32]}],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[513],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"convertedPlatforms":[32],"open":[64],"refresh":[64]}],[0,"salla-breadcrumb",{"breadcrumbs":[32]}],[4,"salla-cart-summary",{"showCartLabel":[4,"show-cart-label"],"cartSummaryCount":[32],"cartSummaryTotal":[32],"cartLabel":[32],"animateToCart":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"loadMoreText":[1,"load-more-text"],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[0,"salla-maintenance-alert",{"title":[32],"message":[32],"buttonTitle":[32]}],[4,"salla-quantity-input",{"cartItemId":[8,"cart-item-id"],"quantity":[32],"fireChangeEvent":[32],"decrease":[64],"increase":[64],"setValue":[64]}],[4,"salla-user-menu",{"inline":[516],"avatarOnly":[516,"avatar-only"],"showHeader":[516,"show-header"],"relativeDropdown":[516,"relative-dropdown"],"accountLoading":[32],"opened":[32],"notifications":[32],"orders":[32],"pending_orders":[32],"wishlist":[32],"profile":[32],"rating":[32],"logout":[32],"hello":[32],"first_name":[32],"last_name":[32],"avatar":[32],"is_loggedIn":[32],"badges":[32],"hasBadges":[32],"OrderUpdate":[32]}],[4,"salla-map",{"name":[1],"required":[4],"readonly":[4],"searchable":[1028],"lat":[1026],"lng":[1026],"apiKey":[1025,"api-key"],"modalTitle":[1,"modal-title"],"zoom":[1026],"theme":[1025],"modalActivityTitle":[32],"confirmButtonTitle":[32],"locateButtonTitle":[32],"locateButtonEdit":[32],"searchPlaceholder":[32],"searchInputValue":[32],"formattedAddress":[32],"geolocationError":[32],"searchInput":[32],"mapInput":[32],"mapElement":[32],"selectedLat":[32],"selectedLng":[32],"open":[64]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"hasError":[32],"errorMessage":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}],[0,"salla-comment-form",{"type":[1537],"showAvatar":[4,"show-avatar"],"itemId":[1544,"item-id"],"placeholder":[32],"submitText":[32],"canComment":[32]}],[4,"salla-color-picker",{"name":[1],"required":[4],"color":[1537],"format":[1],"showCancelButton":[4,"show-cancel-button"],"showTextField":[4,"show-text-field"],"enableAlpha":[4,"enable-alpha"],"widgetColor":[32],"setPickerOption":[64],"movePopUp":[64],"setColorValue":[64],"openPicker":[64],"closePicker":[64],"destroyPicker":[64]}],[0,"salla-products-list",{"source":[1537],"sourceValue":[1032,"source-value"],"limit":[1026],"sortBy":[1025,"sort-by"],"filtersResults":[1540,"filters-results"],"horizontalCards":[516,"horizontal-cards"],"rowCards":[516,"row-cards"],"autoload":[1028],"loadMoreText":[1,"load-more-text"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"page":[32],"nextPage":[32],"hasInfiniteScroll":[32],"hasCustomComponent":[32],"sourceValueIsValid":[32],"placeholderText":[32],"endOfText":[32],"failedLoadMore":[32],"currentPage":[32],"currentCategoryIdFilter":[32],"isReady":[32],"showPlaceholder":[32],"parsedFilters":[32],"setFilters":[64],"reload":[64]}],[4,"salla-product-card",{"product":[1],"horizontal":[4],"shadowOnHover":[4,"shadow-on-hover"],"hideAddBtn":[4,"hide-add-btn"],"fullImage":[4,"full-image"],"minimal":[4],"isSpecial":[4,"is-special"],"showQuantity":[4,"show-quantity"],"productData":[32],"fitImageHeight":[32],"remained":[32],"outOfStock":[32],"donationAmount":[32],"startingPrice":[32],"addToCart":[32],"placeholder":[32]}],[0,"salla-comment-item",{"comment":[16],"hideBought":[16],"has_bought_trans":[32],"rated_trans":[32],"waiting_approval_trans":[32],"has_order_trans":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-add-product-button",{"channels":[513],"subscribedOptions":[1,"subscribed-options"],"quickBuy":[1540,"quick-buy"],"quantity":[514],"donatingAmount":[514,"donating-amount"],"notifyOptionsAvailability":[516,"notify-options-availability"],"productId":[520,"product-id"],"supportStickyBar":[516,"support-sticky-bar"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"hasOutOfStockOption":[32],"hasSubscribedOptions":[32],"selectedOptions":[32],"showQuickBuy":[32],"isApplePayActive":[32],"buyNowText":[32]}],[0,"salla-count-down",{"date":[1],"boxed":[4],"size":[1],"color":[1],"labeled":[4],"endText":[1,"end-text"],"digits":[1],"endOfDay":[4,"end-of-day"],"daysLabel":[32],"hoursLabel":[32],"minutesLabel":[32],"secondsLabel":[32],"endLabel":[32],"invalidDate":[32],"offerEnded":[32],"countInterval":[32],"days":[32],"hours":[32],"minutes":[32],"seconds":[32],"endCountDown":[64]}],[0,"salla-datetime-picker",{"value":[1537],"required":[4],"name":[513],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"dateParser":[16],"position":[1],"positionElement":[16],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4]}],[0,"salla-product-availability",{"channels":[1],"notifyOptionsAvailability":[4,"notify-options-availability"],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]}],[0,"salla-file-upload",{"value":[1537],"files":[513],"height":[513],"cartItemId":[1,"cart-item-id"],"profileImage":[516,"profile-image"],"name":[1537],"payloadName":[1,"payload-name"],"accept":[1537],"fileId":[2,"file-id"],"url":[1025],"method":[1],"formData":[1,"form-data"],"required":[4],"maxFileSize":[1,"max-file-size"],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16],"instantUpload":[1028,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1025,"label-idle"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"setOption":[64]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-progress-bar",{"donation":[1],"target":[1026],"value":[1026],"height":[1025],"header":[1025],"stripped":[1028],"message":[1025],"unit":[1025],"color":[1025]}],[0,"salla-quick-buy",{"type":[1025],"productId":[1025,"product-id"],"cartId":[1025,"cart-id"],"amount":[1538],"currency":[1025],"options":[16],"isRequireShipping":[1028,"is-require-shipping"],"applePayOnly":[1028,"apple-pay-only"],"isApplePayActive":[32],"quickBuy":[32]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2],"reviews":[2]}],[4,"salla-slider",{"blockTitle":[513,"block-title"],"listenToThumbnailsOption":[516,"listen-to-thumbnails-option"],"blockSubtitle":[513,"block-subtitle"],"displayAllUrl":[513,"display-all-url"],"arrowsCentered":[516,"arrows-centered"],"verticalThumbs":[516,"vertical-thumbs"],"gridThumbs":[516,"grid-thumbs"],"vertical":[516],"autoHeight":[516,"auto-height"],"showControls":[516,"show-controls"],"controlsOuter":[516,"controls-outer"],"showThumbsControls":[4,"show-thumbs-controls"],"autoPlay":[4,"auto-play"],"slidesPerView":[1,"slides-per-view"],"pagination":[4],"centered":[4],"loop":[4],"direction":[1537],"type":[1],"sliderConfig":[520,"slider-config"],"thumbsConfig":[520,"thumbs-config"],"currentIndex":[32],"isEnd":[32],"isBeginning":[32],"swiperScript":[32],"displayAllTitle":[32],"windowWidth":[32],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"slideToLoop":[64],"slideNextLoop":[64],"slidePrevLoop":[64],"slideReset":[64],"slideToClosest":[64],"update":[64],"updateAutoHeight":[64],"updateSlides":[64],"updateProgress":[64],"updateSlidesClasses":[64],"getSlides":[64]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[0,"salla-tel-input",{"phone":[1025],"autofocus":[516],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]]],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"type":[513],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["p-bebc6fdf",[[4,"salla-filters-widget",{"withLoadMore":[1028,"with-load-more"],"filtersData":[16],"option":[16],"isOpen":[32],"isShowMore":[32],"showMoreLabel":[32],"showLessLabel":[32],"page":[32],"setWidgetHeight":[64],"reset":[64],"showMore":[64],"toggleWidget":[64]}]]],["p-9239b56b",[[0,"salla-notification-item",{"notification":[16]}]]],["p-79e07ffc",[[0,"salla-booking-field",{"option":[16],"productId":[16],"reservationsInput":[32],"priceLabel":[32],"bookNowLabel":[32],"editLabel":[32],"bookedLabel":[32],"selectDate":[32],"bookingUrl":[32],"iframeReady":[32],"reservations":[32]}],[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-baf55d1d",[[0,"salla-price-range",{"minPrice":[1032,"min-price"],"maxPrice":[1032,"max-price"],"option":[16],"filtersData":[520,"filters-data"],"min":[32],"max":[32],"priceOptions":[32],"moreThanLabel":[32],"lessThanLabel":[32],"toLabel":[32],"fromLabel":[32],"typing":[32],"isMin":[32],"isRTL":[32],"reset":[64]}]]]]'),e)}));
4
+ import{p as e,b as t}from"./p-bdd00808.js";export{s as setNonce}from"./p-bdd00808.js";import{g as a}from"./p-4a9df09e.js";import"./p-f84bae34.js";const o=()=>{const t=import.meta.url;const a={};if(t!==""){a.resourcesUrl=new URL(".",t).href}return e(a)};o().then((e=>{a();return t(JSON.parse('[["p-95dc9706",[[0,"salla-offer",{"productCardComponent":[1,"product-card-component"],"offersList":[32],"userCurrency":[32],"isMultipleBank":[32],"title":[32],"currentPage":[32],"hasCustomComponent":[32],"isBankOffer":[32],"canRender":[32],"showOffer":[32],"offer_with_price_text":[32],"with_discount_text":[32],"product_discount_text":[32],"special_offer_text":[32],"multipleBankOfferTitleText":[32],"multipleBankOfferTitleDescription":[32],"buy_quantity_text":[32]}]]],["p-0b3b39fc",[[0,"salla-products-slider",{"blockTitle":[1,"block-title"],"subTitle":[1,"sub-title"],"sliderId":[1,"slider-id"],"displayAllUrl":[1,"display-all-url"],"autoplay":[1028],"source":[1537],"sourceValue":[1,"source-value"],"limit":[1026],"sliderConfig":[520,"slider-config"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"productsData":[32],"isReady":[32],"sourceValueIsValid":[32],"hasCustomComponent":[32],"apiUrl":[32],"parsedSourceValue":[32]}]]],["p-bd26e79e",[[0,"salla-product-options",{"productId":[2,"product-id"],"options":[1],"optionsData":[32],"outOfStockText":[32],"donationAmount":[32],"selectDonationAmount":[32],"selectAmount":[32],"isCustomDonation":[32],"selectedOptions":[32],"canDisabled":[32],"selectedSkus":[32],"selectedOutSkus":[32],"getSelectedOptionsData":[64],"reportValidity":[64],"hasOutOfStockOption":[64],"getSelectedOptions":[64],"getOption":[64]}]]],["p-05d7338b",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["p-9a3da756",[[0,"salla-notifications",{"loadMoreText":[1,"load-more-text"],"itemPerPage":[2,"item-per-page"],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"no_notifications_trans":[32],"load_more_text_trans":[32]}]]],["p-0b229465",[[0,"salla-order-summary",{"orderId":[514,"order-id"],"codeCopied":[32],"noItemFound":[32],"order_items":[32]}]]],["p-8ea7d6d1",[[0,"salla-reviews",{"displayAllLink":[516,"display-all-link"],"source":[513],"sourceValue":[513,"source-value"],"limit":[514],"type":[1],"sort":[1],"hideCustomerInfo":[4,"hide-customer-info"],"reviews":[32],"isRTL":[32],"showReviews":[32],"testimonialText":[32],"displayAllLinkText":[32]}]]],["p-2554f5b7",[[0,"salla-conditional-offer",{"offer":[32],"products":[32],"isLoading":[32],"canRender":[32]}]]],["p-7c3d6111",[[0,"salla-orders",{"params":[16],"loadMoreText":[1,"load-more-text"],"orderNumberText":[32],"totalOrderText":[32],"orderDateText":[32],"orderStatusText":[32],"noOrderText":[32],"load_more_text_trans":[32],"languageCode":[32],"orders":[32],"pagination":[32],"hasInfiniteScroll":[32],"total":[32],"nextPage":[32],"showPlaceholder":[32]}]]],["p-57de180e",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["p-2c451eb4",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["p-dabb0e14",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["p-8c1b4c7c",[[0,"salla-contacts",{"contactsTitle":[1025,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["p-2cb87af3",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32],"mispayActive":[32],"installment_sheria_text":[32]}]]],["p-511cee71",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["p-d3b196a8",[[0,"salla-metadata",{"entity":[1],"entityId":[2,"entity-id"],"specs":[32],"download":[32]}]]],["p-7a79eee0",[[0,"salla-payments",{"exclude":[1040]}]]],["p-3faa7926",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["p-411485fc",[[4,"salla-gifting",{"productId":[2,"product-id"],"widgetTitle":[1,"widget-title"],"widgetSubtitle":[1,"widget-subtitle"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[1544,"prize-points"],"customerPoints":[1538,"customer-points"],"prizeTitle":[1537,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1025,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"inline":[516],"withoutReload":[4,"without-reload"],"currentTabName":[32],"regType":[32],"translationLoaded":[32],"isModalOpen":[32],"currentPhone":[32],"currentEmail":[32],"title":[32],"emailErrorMsg":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"hasError":[32],"errorMessage":[32],"dragAndDrop":[32],"browseFromFiles":[32],"customFields":[32],"uploadedImage":[32],"open":[64]},[[8,"verified","onVerified"]]],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"productID":[32],"offer_type":[32],"translationLoaded":[32],"addToCartLabel":[32],"open":[64],"showOffer":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64]}],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"loading":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-user-profile",{"customFields":[1,"custom-fields"],"minAge":[2,"min-age"],"userData":[32],"userDefinedFields":[32],"disableAction":[32],"isLoading":[32],"first_name_trans":[32],"last_name_trans":[32],"birthday_trans":[32],"birthday_placeholder_trans":[32],"gender_trans":[32],"gender_placeholder_trans":[32],"male_trans":[32],"female_trans":[32],"email_trans":[32],"mobile_trans":[32],"save_btn_trans":[32],"drag_and_drop_trans":[32],"browse_trans":[32],"email_required_trans":[32],"invalid_email_trans":[32],"setCustomFields":[64]}],[0,"salla-bottom-alert",{"type":[513],"icon":[513],"message":[513],"actionUrl":[513,"action-url"],"actionLabel":[513,"action-label"],"storeId":[32],"template":[32],"loading":[32],"templateData":[32],"defaultMessage":[32],"defaultActionLabel":[32],"storeFeatures":[32],"storeDetails":[32],"storePrice":[32],"theDeveloper":[32],"templateInformation":[32],"buyTheTemplate":[32],"isRtl":[32]}],[0,"salla-comments",{"itemId":[2,"item-id"],"loadMoreText":[1,"load-more-text"],"hideForm":[4,"hide-form"],"blockTitle":[1,"block-title"],"hideTitle":[4,"hide-title"],"type":[1],"showFormAvatar":[4,"show-form-avatar"],"sort":[1],"testimonials":[4],"comments":[32],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"noComments":[32],"comment_title":[32],"comment_name":[32],"placeholder_text":[32],"reload":[64]}],[0,"salla-quick-order",{"quickOrderTitle":[1025,"quick-order-title"],"subTitle":[1025,"sub-title"],"payButtonTitle":[1025,"pay-button-title"],"confirmPayButtonTitle":[1025,"confirm-pay-button-title"],"agreementText":[1025,"agreement-text"],"isEmailRequired":[1028,"is-email-required"],"productId":[1025,"product-id"],"thanksMessage":[1025,"thanks-message"],"quickOrderStyle":[1025,"quick-order-style"],"user":[32],"isAvailable":[32],"oneClick":[32],"expanded":[32],"isTermsRequired":[32],"countryCode":[32],"submitSucess":[32],"placeHolderEmail":[32],"emailOptional":[32],"agreementShowText":[32],"agreementModalHead":[32],"userNameLabel":[32],"termsChecked":[32]}],[0,"salla-user-settings",{"isNotifiable":[516,"is-notifiable"],"deactivateAccount":[32],"promotionalMsgs":[32],"deactivateDesc":[32],"promotionalMsgsDesc":[32],"sorryForLeavingText":[32],"warningText":[32],"keepAccount":[32],"buttonLoading":[32]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"maxWords":[2,"max-words"],"showAction":[4,"show-action"],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]]],[0,"salla-menu",{"source":[1],"sourceValue":[1,"source-value"],"topnav":[4],"useReactLink":[4,"use-react-link"],"limit":[2],"menus":[32]}],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[513],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"convertedPlatforms":[32],"open":[64],"refresh":[64]}],[0,"salla-breadcrumb",{"breadcrumbs":[32]}],[4,"salla-cart-summary",{"showCartLabel":[4,"show-cart-label"],"cartSummaryCount":[32],"cartSummaryTotal":[32],"cartLabel":[32],"animateToCart":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"loadMoreText":[1,"load-more-text"],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[0,"salla-maintenance-alert",{"title":[32],"message":[32],"buttonTitle":[32]}],[4,"salla-quantity-input",{"cartItemId":[8,"cart-item-id"],"quantity":[32],"fireChangeEvent":[32],"decrease":[64],"increase":[64],"setValue":[64]}],[4,"salla-user-menu",{"inline":[516],"avatarOnly":[516,"avatar-only"],"showHeader":[516,"show-header"],"relativeDropdown":[516,"relative-dropdown"],"accountLoading":[32],"opened":[32],"notifications":[32],"orders":[32],"pending_orders":[32],"wishlist":[32],"profile":[32],"rating":[32],"logout":[32],"hello":[32],"first_name":[32],"last_name":[32],"avatar":[32],"is_loggedIn":[32],"badges":[32],"hasBadges":[32],"OrderUpdate":[32]}],[4,"salla-map",{"name":[1],"required":[4],"readonly":[4],"searchable":[1028],"lat":[1026],"lng":[1026],"apiKey":[1025,"api-key"],"modalTitle":[1,"modal-title"],"zoom":[1026],"theme":[1025],"modalActivityTitle":[32],"confirmButtonTitle":[32],"locateButtonTitle":[32],"locateButtonEdit":[32],"searchPlaceholder":[32],"searchInputValue":[32],"formattedAddress":[32],"geolocationError":[32],"searchInput":[32],"mapInput":[32],"mapElement":[32],"selectedLat":[32],"selectedLng":[32],"open":[64]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"hasError":[32],"errorMessage":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}],[0,"salla-comment-form",{"type":[1537],"showAvatar":[4,"show-avatar"],"itemId":[1544,"item-id"],"placeholder":[32],"submitText":[32],"canComment":[32]}],[4,"salla-color-picker",{"name":[1],"required":[4],"color":[1537],"format":[1],"showCancelButton":[4,"show-cancel-button"],"showTextField":[4,"show-text-field"],"enableAlpha":[4,"enable-alpha"],"widgetColor":[32],"setPickerOption":[64],"movePopUp":[64],"setColorValue":[64],"openPicker":[64],"closePicker":[64],"destroyPicker":[64]}],[0,"salla-products-list",{"source":[1537],"sourceValue":[1032,"source-value"],"limit":[1026],"sortBy":[1025,"sort-by"],"filtersResults":[1540,"filters-results"],"horizontalCards":[516,"horizontal-cards"],"rowCards":[516,"row-cards"],"autoload":[1028],"loadMoreText":[1,"load-more-text"],"productCardComponent":[1,"product-card-component"],"includes":[1025],"page":[32],"nextPage":[32],"hasInfiniteScroll":[32],"hasCustomComponent":[32],"sourceValueIsValid":[32],"placeholderText":[32],"endOfText":[32],"failedLoadMore":[32],"currentPage":[32],"currentCategoryIdFilter":[32],"isReady":[32],"showPlaceholder":[32],"parsedFilters":[32],"setFilters":[64],"reload":[64]}],[4,"salla-product-card",{"product":[1],"horizontal":[4],"shadowOnHover":[4,"shadow-on-hover"],"hideAddBtn":[4,"hide-add-btn"],"fullImage":[4,"full-image"],"minimal":[4],"isSpecial":[4,"is-special"],"showQuantity":[4,"show-quantity"],"productData":[32],"fitImageHeight":[32],"remained":[32],"outOfStock":[32],"donationAmount":[32],"startingPrice":[32],"addToCart":[32],"placeholder":[32]}],[0,"salla-comment-item",{"comment":[16],"hideBought":[16],"has_bought_trans":[32],"rated_trans":[32],"waiting_approval_trans":[32],"has_order_trans":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-add-product-button",{"channels":[513],"subscribedOptions":[1,"subscribed-options"],"quickBuy":[1540,"quick-buy"],"quantity":[514],"donatingAmount":[514,"donating-amount"],"notifyOptionsAvailability":[516,"notify-options-availability"],"productId":[520,"product-id"],"supportStickyBar":[516,"support-sticky-bar"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"hasOutOfStockOption":[32],"hasSubscribedOptions":[32],"selectedOptions":[32],"showQuickBuy":[32],"isApplePayActive":[32],"buyNowText":[32]}],[0,"salla-count-down",{"date":[1],"boxed":[4],"size":[1],"color":[1],"labeled":[4],"endText":[1,"end-text"],"digits":[1],"endOfDay":[4,"end-of-day"],"daysLabel":[32],"hoursLabel":[32],"minutesLabel":[32],"secondsLabel":[32],"endLabel":[32],"invalidDate":[32],"offerEnded":[32],"countInterval":[32],"days":[32],"hours":[32],"minutes":[32],"seconds":[32],"endCountDown":[64]}],[0,"salla-datetime-picker",{"value":[1537],"required":[4],"name":[513],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"dateParser":[16],"position":[1],"positionElement":[16],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4]}],[0,"salla-product-availability",{"channels":[1],"notifyOptionsAvailability":[4,"notify-options-availability"],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]}],[0,"salla-file-upload",{"value":[1537],"files":[513],"height":[513],"cartItemId":[1,"cart-item-id"],"profileImage":[516,"profile-image"],"name":[1537],"payloadName":[1,"payload-name"],"accept":[1537],"fileId":[2,"file-id"],"url":[1025],"method":[1],"formData":[1,"form-data"],"required":[4],"maxFileSize":[1,"max-file-size"],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16],"instantUpload":[1028,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1025,"label-idle"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"setOption":[64]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-progress-bar",{"donation":[1],"target":[1026],"value":[1026],"height":[1025],"header":[1025],"stripped":[1028],"message":[1025],"unit":[1025],"color":[1025]}],[0,"salla-quick-buy",{"type":[1025],"productId":[1025,"product-id"],"cartId":[1025,"cart-id"],"amount":[1538],"currency":[1025],"options":[16],"isRequireShipping":[1028,"is-require-shipping"],"applePayOnly":[1028,"apple-pay-only"],"isApplePayActive":[32],"quickBuy":[32]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2],"reviews":[2]}],[4,"salla-slider",{"blockTitle":[513,"block-title"],"listenToThumbnailsOption":[516,"listen-to-thumbnails-option"],"blockSubtitle":[513,"block-subtitle"],"displayAllUrl":[513,"display-all-url"],"arrowsCentered":[516,"arrows-centered"],"verticalThumbs":[516,"vertical-thumbs"],"gridThumbs":[516,"grid-thumbs"],"vertical":[516],"autoHeight":[516,"auto-height"],"showControls":[516,"show-controls"],"controlsOuter":[516,"controls-outer"],"showThumbsControls":[4,"show-thumbs-controls"],"autoPlay":[4,"auto-play"],"slidesPerView":[1,"slides-per-view"],"pagination":[4],"centered":[4],"loop":[4],"direction":[1537],"type":[1],"sliderConfig":[520,"slider-config"],"thumbsConfig":[520,"thumbs-config"],"currentIndex":[32],"isEnd":[32],"isBeginning":[32],"swiperScript":[32],"displayAllTitle":[32],"windowWidth":[32],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"slideToLoop":[64],"slideNextLoop":[64],"slidePrevLoop":[64],"slideReset":[64],"slideToClosest":[64],"update":[64],"updateAutoHeight":[64],"updateSlides":[64],"updateProgress":[64],"updateSlidesClasses":[64],"getSlides":[64]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[0,"salla-tel-input",{"phone":[1025],"autofocus":[516],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]]],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"type":[513],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["p-bebc6fdf",[[4,"salla-filters-widget",{"withLoadMore":[1028,"with-load-more"],"filtersData":[16],"option":[16],"isOpen":[32],"isShowMore":[32],"showMoreLabel":[32],"showLessLabel":[32],"page":[32],"setWidgetHeight":[64],"reset":[64],"showMore":[64],"toggleWidget":[64]}]]],["p-9239b56b",[[0,"salla-notification-item",{"notification":[16]}]]],["p-6cce417a",[[0,"salla-booking-field",{"option":[16],"productId":[16],"reservationsInput":[32],"priceLabel":[32],"bookNowLabel":[32],"editLabel":[32],"bookedLabel":[32],"selectDate":[32],"bookingUrl":[32],"iframeReady":[32],"reservations":[32]}],[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-baf55d1d",[[0,"salla-price-range",{"minPrice":[1032,"min-price"],"maxPrice":[1032,"max-price"],"option":[16],"filtersData":[520,"filters-data"],"min":[32],"max":[32],"priceOptions":[32],"moreThanLabel":[32],"lessThanLabel":[32],"toLabel":[32],"fromLabel":[32],"typing":[32],"isMin":[32],"isRTL":[32],"reset":[64]}]]]]'),e)}));
5
5
  //# sourceMappingURL=twilight.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "2.13.86",
3
+ "version": "2.13.87",
4
4
  "license": "GPL-3.0",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -79,9 +79,9 @@
79
79
  "typescript": "^5.2.2"
80
80
  },
81
81
  "dependencies": {
82
- "@salla.sa/applepay": "^2.13.86",
83
- "@salla.sa/twilight": "^2.13.86",
84
- "@salla.sa/twilight-tailwind-theme": "^2.13.86",
82
+ "@salla.sa/applepay": "^2.13.87",
83
+ "@salla.sa/twilight": "^2.13.87",
84
+ "@salla.sa/twilight-tailwind-theme": "^2.13.87",
85
85
  "@types/node": "^20.4.8",
86
86
  "animejs": "^3.2.1",
87
87
  "filepond": "^4.30.4",
@@ -99,5 +99,5 @@
99
99
  "vanilla-lazyload": "^17.8.3",
100
100
  "vanilla-picker": "^2.12.1"
101
101
  },
102
- "gitHead": "e6b0f96497cd0aa279114161ac2b6bf07e896d2c"
102
+ "gitHead": "77b07bf98e3bb83a9fdf6785e853e7c7edaba03c"
103
103
  }
@@ -1,5 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,c as i,h as o,H as s,g as n}from"./p-bdd00808.js";import{C as e}from"./p-0186ffc1.js";import{C as a}from"./p-4f6a5307.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));const p=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const d="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed",7);this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outSkus=[];this.handleDonationOptions=(t,i,o)=>{if(i=="custom"&&o=="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i=="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}let i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",null,i?salla.money(t.donation.target_amount):""))};this.optionsData=undefined;this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.canDisabled=undefined;this.selectedSkus=undefined;this.selectedOutSkus=undefined;this.productId=salla.config.get("page.id");this.options=undefined;this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}setOptionsData(t){var i,o;this.optionsData=t;let s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){let t={};let i=this.host.getElementSallaData();i.forEach((function(i,o){o.startsWith("options[")&&(t[o.replace("options[","").replace("]","")]=i)}));return t}async reportValidity(){let t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!salla.url.is_page("cart")){o.scrollIntoView({behavior:"smooth",block:"center"})}o.classList.add("s-product-options-option-error")}changedHandler(t,i){let o={event:t,option:i,detail:null};if(i.details){let s=i.details.find((i=>Number(i.id)===Number(t.target.value)));o.detail=s}let s=t.target.closest(".s-product-options-option");if(t.target.value||(i.type==l.FILE||i.type==l.IMAGE)&&t.type==="added"||i.type==l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{s.classList.remove("s-product-options-option-error")}),200)}const n=this.selectedOptions.findIndex((t=>t.option_id===o.option.id));n>-1?this.selectedOptions[n]=Object.assign(Object.assign({},o.detail),{option_id:o.option.id}):this.selectedOptions.push(Object.assign(Object.assign({},o.detail),{option_id:o.option.id}));if(i.type==l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);this.changed.emit(o);salla.event.emit("product-options::change",o)}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t))))).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i=="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.BOOKING&&salla.config.get("page.slug")=="cart"){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}componentWillLoad(){this.outOfStockText=salla.lang.get("pages.products.out_of_stock");return salla.onReady((()=>{const t=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return t?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}))}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)==0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({class:`s-product-options-option-container${t.visibility_condition?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name=="splitter"?this.splitterOption():o("div",{class:"s-product-options-option","data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:"options["+t.id+"]",class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}componentDidLoad(){var t,i;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)==0&&!this.optionsData.some((t=>t.type==l.DONATION))){return}let o=(i=this.optionsData.find((t=>t.type==l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",null,this.selectAmount),o("div",{class:"s-product-options-donation-options"},t.details.map(((t,i)=>o("div",{class:"s-product-options-donation-options-item"},o("input",{id:`donation-option-${i}`,type:"radio",name:"donating_option",checked:t.is_selected,value:t.additional_price,onChange:i=>this.handleDonationOptions(i,t,"option")}),o("label",{htmlFor:`donation-option-${i}`},o("span",null,salla.money(t.name)))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:`donation-option-custom`,type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:`donation-option-custom`},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>this.donationInput=t,value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:i.accept&&i.accept.split(",").every((t=>t.includes("image")))?a:p}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){let i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onInput:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onInput:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){if(o&&o==l.COLOR){return t.name+(i&&this.isOptionDetailOut(t)?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price)}) </p>`:"")}return t.name+(i&&this.isOptionDetailOut(t)?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price)})`:"")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}let o=this.selectedOptions.filter((i=>i.id==t.id)).length;if(o&&this.selectedOptions.length==1){return false}if(o){let i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}singleOption(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}multipleOptions(t){let i=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},t===null||t===void 0?void 0:t.details.map((s=>o("div",null,o("input",{type:"checkbox",value:s.id,disabled:this.isOptionDetailOut(s),checked:s.is_selected,required:i,name:`options[${t.id}][]`,id:`field-${t.id}-${s.id}`,onChange:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),"aria-describedby":`options[${t.id}]-description`}),o("label",{htmlFor:`field-${t.id}-${s.id}`},this.getOptionDetailName(s))))))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item"},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:`color-${this.productId}-${t.id}-${i.id}`,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:`color-${this.productId}-${t.id}-${i.id}`},o("span",{style:{"background-color":i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",null,o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:`option_${this.productId}-${t.id}_${i.id}`,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:`option_${this.productId}-${t.id}_${i.id}`,"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}get host(){return n(this)}};c.style=d;export{c as salla_product_options};
5
- //# sourceMappingURL=p-5a27af8a.entry.js.map
@@ -1,5 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as s,c as e,h as t,H as i,g as a}from"./p-bdd00808.js";const n=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar-time</title>\n<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>\n</svg>\n`;const o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar</title>\n<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>\n</svg>\n`;const l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>time</title>\n<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>\n</svg>\n`;const r=":host{display:block}";const c=class{constructor(t){s(this,t);this.invalidInput=e(this,"invalidInput",7);this.reservationsInput=undefined;this.option=undefined;this.productId=undefined;this.priceLabel=salla.lang.get("pages.products.price");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];salla.lang.onLoaded((()=>{const s=(s,e,t)=>new Promise((i=>{salla.helpers.setNested(salla.lang.messages[s],e,t);i(true)}));const e=async()=>{await s("ar.trans","pages.cart.book_an_appointment","حجز موعد");await s("en.trans","pages.cart.book_an_appointment","Book an Appointment");await s("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد");await s("en.trans","pages.cart.edit_an_appointment","Edit an Appointment");await s("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");await s("en.trans","pages.cart.booked_successfully","Booked Successfully");await s("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد");await s("en.trans","pages.cart.select_appointment_date","Select appointment date");this.priceLabel=salla.lang.get("pages.products.price");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date")};e()}));Salla.event.on("booking::open",(s=>{this.bookingUrl=salla.url.addParamToUrl("product_id",this.productId,s);this.iframeReady=true;setTimeout((()=>{this.modal.setTitle(this.selectDate);this.modal.open()}),100)}))}openBookingModal(s){s.preventDefault();if(salla.config.isGuest()){salla.auth.api.setAfterLoginEvent("booking::open",this.productId);salla.event.dispatch("login::open");return}return salla.booking.add(this.productId,false).then((s=>{if(s.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",s.data.redirect.url)})).catch((s=>{salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(s.response)}))}componentWillLoad(){if(this.option&&this.option.details.length){this.reservations=this.option.details}}bookingModal(){return t("salla-modal",{class:"s-booking-field-modal",ref:s=>this.modal=s,width:"md",position:"middle",noPadding:true,isClosable:false},t("iframe",{ref:s=>this.iframe=s,src:this.bookingUrl,frameborder:"0"}))}componentDidLoad(){window.addEventListener("message",(s=>{if(s.data.source!="booking"){return}let e=s.data.type;let t=s.data.message;localStorage.getItem("debug")&&console.log(`recived an action:${e}`,s.data);if(e=="error"){salla.notify.error(t.fields.reservations[0])}if(e=="success"){this.reservations=t.reservations;salla.notify.success(this.bookedLabel);this.modal.close()}if(e=="height"){return this.iframe.height=(t===null||t===void 0?void 0:t.height)+"px"}}));this.reservationsInput.addEventListener("invalid",(s=>{this.invalidInput.emit(s)}));this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity("");this.reservationsInput.reportValidity()}))}render(){return t(i,null,t("div",{class:"s-booking-field-main"},t("div",{class:"s-booking-field-price"},t("span",null,this.priceLabel),t("span",null,salla.money(this.option.price))),t("salla-button",{class:"s-booking-field-book-now",fill:"outline",onClick:s=>this.openBookingModal(s)},t("span",{class:"s-booking-field-book-now-content"},t("span",{innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length?t("div",{class:"s-booking-field-reservations"},this.reservations.map(((s,e)=>t("div",{key:e,class:"s-booking-field-reservations-item"},this.renderReservationDate(s),this.renderReservationTime(s))))):"",t("input",{class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:s=>this.reservationsInput=s}),this.iframeReady&&this.bookingModal())}renderReservationDate(s){return t("span",{class:s.from_timestamp?"s-booking-field-reservations-has-time":""},t("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),s.date)}renderReservationTime(s){if(!s.from_timestamp){return""}return t("span",{class:"s-booking-field-reservations-time"},t("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),t("span",null," ",s.from_timestamp," - ",s.to_timestamp))}get host(){return a(this)}};c.style=r;const h=class{constructor(e){s(this,e)}hideAllOptions(s){this.host.querySelectorAll(`[data-show-when^="options[${s}"]`).forEach((s=>{s.classList.add("hidden");this.hideAllOptions(s.dataset.optionId);this.disableInputs(s)}))}disableInputs(s){s.querySelectorAll("[name]").forEach((s=>{var e;s.setAttribute("disabled","");s.removeAttribute("required");if(((e=s===null||s===void 0?void 0:s.tagName)===null||e===void 0?void 0:e.toLowerCase())==="select"){s.value=""}if(["checkbox"].includes(s.getAttribute("type"))&&s.hasOwnProperty("checked")){s.checked=false}}))}changeHandler(s){var e;salla.event.emit("salla-onditional-fields::change",s);salla.log("Received the change event: ",s);if(!s.target||!["SELECT"].includes(s.target.tagName)&&!["checkbox"].includes(s.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((e=s===null||s===void 0?void 0:s.target)===null||e===void 0?void 0:e.tagName)||"N/A"));return}let t=s.target.name.replace("[]","");let i=s.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",`[data-show-when^="${t}"]`);this.host.querySelectorAll(`[data-show-when^="${t}"]`).forEach((e=>{let t=!(e===null||e===void 0?void 0:e.dataset.showWhen.includes("!="));let a=e===null||e===void 0?void 0:e.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();let n;if(i){let e=Array.from(this.host.querySelectorAll(`input[name="${s.target.name}"]:checked`),(s=>s===null||s===void 0?void 0:s.value));n=e.includes(a.toString())}else{n=a===s.target.value}salla.log("The input is ",i?"Multiple":"Single"," value:",n);let o=t&&n||!t&&!n;if(o){e.classList.remove("hidden");e.querySelectorAll("[name]").forEach((s=>{s.removeAttribute("disabled");const t=s.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){s.setAttribute("required","")}if(s.getAttribute("type")==="checkbox"){const e=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${s.getAttribute("name")}"]`));const t=e.some((s=>s.checked));if(t){e.forEach((s=>{s.removeAttribute("required")}))}}if(!["checkbox"].includes(s.getAttribute("type"))&&e.getElementsByClassName("required").length){s.setAttribute("required","")}}))}else{this.hideAllOptions(e.dataset.optionId);e.classList.add("hidden");this.disableInputs(e)}}))}componentDidRender(){this.host.querySelectorAll(`[data-show-when]`).forEach((s=>{var e;let t=(e=s===null||s===void 0?void 0:s.dataset)===null||e===void 0?void 0:e.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!t){return}this.changeHandler({target:this.host.querySelector('[name^="'+t+'"]')})}))}render(){return t(i,null,t("slot",null))}get host(){return a(this)}};export{c as salla_booking_field,h as salla_conditional_fields};
5
- //# sourceMappingURL=p-79e07ffc.entry.js.map