@salla.sa/twilight-components 1.0.6 → 1.0.7

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 (65) hide show
  1. package/dist/cjs/{index-e9451c82.js → index-23da2c6b.js} +159 -4
  2. package/dist/cjs/index.cjs.js +3 -3
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/multi-warehouse_3.cjs.entry.js +155 -0
  5. package/dist/cjs/order-rating.cjs.entry.js +227 -0
  6. package/dist/cjs/salla-button.cjs.entry.js +56 -0
  7. package/dist/cjs/salla-localization.cjs.entry.js +49 -0
  8. package/dist/cjs/{salla-login-3ec94029.js → salla-login-476fb312.js} +1 -1
  9. package/dist/cjs/{salla-search-2b1d67e4.js → salla-search-b9403062.js} +7 -7
  10. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  11. package/dist/cjs/twilight-components.cjs.js +2 -2
  12. package/dist/collection/collection-manifest.json +7 -4
  13. package/dist/collection/components/multi-warehouse/multi-warehouse.js +239 -0
  14. package/dist/collection/components/order-rating/order-rating.css +3 -0
  15. package/dist/collection/components/order-rating/order-rating.js +288 -0
  16. package/dist/collection/components/salla-button/salla-button.css +3 -0
  17. package/dist/collection/components/salla-button/salla-button.js +167 -0
  18. package/dist/collection/components/salla-localization/salla-localization.js +106 -0
  19. package/dist/collection/components/{login → salla-login}/salla-login.js +0 -0
  20. package/dist/collection/components/{modal → salla-modal}/salla-modal.js +115 -18
  21. package/dist/collection/components/{search → salla-search}/salla-search.js +21 -21
  22. package/dist/collection/index.js +2 -2
  23. package/dist/collection/plugins/tailwind-theme/generator.js +1 -1
  24. package/dist/esm/{index-8919a244.js → index-643344dc.js} +159 -4
  25. package/dist/esm/index.js +3 -3
  26. package/dist/esm/loader.js +2 -2
  27. package/dist/esm/multi-warehouse_3.entry.js +149 -0
  28. package/dist/esm/order-rating.entry.js +223 -0
  29. package/dist/esm/salla-button.entry.js +52 -0
  30. package/dist/esm/salla-localization.entry.js +45 -0
  31. package/dist/esm/{salla-login-4aa5bb90.js → salla-login-0e85b2d8.js} +1 -1
  32. package/dist/esm/{salla-search-bd2f71b3.js → salla-search-5d4a6f1a.js} +7 -7
  33. package/dist/esm/salla-search.entry.js +2 -2
  34. package/dist/esm/twilight-components.js +2 -2
  35. package/dist/twilight-components/index.esm.js +1 -1
  36. package/dist/twilight-components/{p-41dc89e6.js → p-36c87e2e.js} +1 -1
  37. package/dist/twilight-components/p-4b137380.js +1 -0
  38. package/dist/twilight-components/p-4cc11ee2.entry.js +1 -0
  39. package/dist/twilight-components/p-60f0446f.entry.js +1 -0
  40. package/dist/twilight-components/p-b490f9e0.entry.js +1 -0
  41. package/dist/twilight-components/p-b72e6cfa.entry.js +1 -0
  42. package/dist/twilight-components/p-baeca520.entry.js +1 -0
  43. package/dist/twilight-components/p-d1ef2268.js +1 -0
  44. package/dist/twilight-components/twilight-components.esm.js +1 -1
  45. package/dist/types/components/multi-warehouse/multi-warehouse.d.ts +23 -0
  46. package/dist/types/components/order-rating/order-rating.d.ts +16 -0
  47. package/dist/types/components/salla-button/salla-button.d.ts +15 -0
  48. package/dist/types/components/salla-localization/salla-localization.d.ts +10 -0
  49. package/dist/types/components/{login → salla-login}/salla-login.d.ts +0 -0
  50. package/dist/types/components/{modal → salla-modal}/salla-modal.d.ts +6 -2
  51. package/dist/types/components/{search → salla-search}/salla-search.d.ts +0 -0
  52. package/dist/types/components.d.ts +78 -11
  53. package/dist/types/index.d.ts +2 -2
  54. package/package.json +10 -6
  55. package/dist/cjs/salla-currency-language.cjs.entry.js +0 -46
  56. package/dist/cjs/salla-login_2.cjs.entry.js +0 -57
  57. package/dist/collection/components/currency-language/salla-currency-language.js +0 -97
  58. package/dist/esm/salla-currency-language.entry.js +0 -42
  59. package/dist/esm/salla-login_2.entry.js +0 -52
  60. package/dist/twilight-components/p-1abaafe4.entry.js +0 -1
  61. package/dist/twilight-components/p-58b1afae.js +0 -1
  62. package/dist/twilight-components/p-840f0daa.entry.js +0 -1
  63. package/dist/twilight-components/p-9f9af3e0.js +0 -1
  64. package/dist/twilight-components/p-b134c95d.entry.js +0 -1
  65. package/dist/types/components/currency-language/salla-currency-language.d.ts +0 -10
@@ -0,0 +1,223 @@
1
+ import { r as registerInstance, h, H as Host } from './index-643344dc.js';
2
+ import { H as Helper } from './Helper-23b2de40.js';
3
+
4
+ const orderRatingCss = ":host{display:block}";
5
+
6
+ const OrderRating = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.stars = [1, 2, 3, 4, 5];
10
+ this.order = {
11
+ shipping: { id: 5622 },
12
+ order_id: "179794",
13
+ products: [
14
+ {
15
+ "title": "ميكروفون عالى الجودة",
16
+ "image": "https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/pMdEEyMVpZFj4L1Hrdm2g48AuiSx0TrKULBiOnPo.jpg",
17
+ "price": "‏10,978.00 ر.س",
18
+ "qty": "‏2",
19
+ "totalBefore": "‏1120 ر.س",
20
+ "discount": "-5%",
21
+ "total": "‏1064 ر.س",
22
+ "id": "2314513454",
23
+ "getOptimusRouteKey": "7351233357"
24
+ },
25
+ {
26
+ "title": "وحدة تحكم لمشغل العاب",
27
+ "image": "https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/NOa4kHvOkd1hBWHk3JIgAo1602oVACfuWGFz3vXv.jpg",
28
+ "price": "‏10,978.00 ر.س",
29
+ "qty": "‏2",
30
+ "totalBefore": "‏1120 ر.س",
31
+ "discount": "-5%",
32
+ "total": "‏1064 ر.س",
33
+ "id": "9842833",
34
+ "getOptimusRouteKey": "735152357"
35
+ },
36
+ {
37
+ "title": "ساعة ذكية بنظام اندرويد",
38
+ "image": "https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/T4kTqYNuPAZmPMLw1bx92RnjVMZyFszVXOUZQsFJ.jpg",
39
+ "price": "‏10,978.00 ر.س",
40
+ "qty": "‏2",
41
+ "totalBefore": "‏1120 ر.س",
42
+ "discount": "-5%",
43
+ "total": "‏1064 ر.س",
44
+ "id": "679822376",
45
+ "getOptimusRouteKey": "73233357"
46
+ }
47
+ ],
48
+ ratingMessage: {
49
+ 1: "غير راضي <span class='emoji mx-1'>😒</span>",
50
+ 2: "لم يعجبني <span class='emoji mx-1'>😌</span>",
51
+ 3: "معقول <span class='emoji mx-1'>🙄</span>",
52
+ 4: "أعجبني <span class='emoji mx-1'>👍</span>",
53
+ 5: "أعجبني جداً <span class='emoji mx-1'>🤩</span>"
54
+ },
55
+ settings: {
56
+ isProductsRating: true,
57
+ isStoreRating: true,
58
+ isShippingRating: true,
59
+ }
60
+ };
61
+ }
62
+ render() {
63
+ return (h(Host, null, this.order.settings.isProductsRating && this.renderProductsRating(), this.order.settings.isStoreRating && this.renderStoreRating(), this.order.settings.isShippingRating && this.renderShippingRating()));
64
+ }
65
+ renderProductsRating() {
66
+ return (h("section", { class: "rating-section products-section", "data-type": "product" }, h("div", { class: "bg-white mb-5 p-5 rounded-md overflow-hidden mb-10" }, this.order.products.map((item, index) => {
67
+ var _a;
68
+ return h("div", { class: "rating-outer-form", "data-stars-error": `يرجى تقييم (${item.title}) بواسطة النجمات` }, h("div", { class: "product-item mb-4" }, h("div", { class: "mb-5" }, h("div", { class: "flex space-s-5 mb-8" }, h("img", { src: item.image, alt: item.title, class: "w-18 h-14 object-cover rounded-md" }), h("div", { class: "flex-1" }, h("h3", { class: "section-title leading-5 mb-1.5 md:text-base" }, " ", item.title), h("div", { class: "rw-product-entry__rate" }, h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element rate-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-xsm my-0" })), h("input", { type: "hidden", name: "order_id", value: (_a = this.order) === null || _a === void 0 ? void 0 : _a.order_id }), h("input", { type: "hidden", name: `products[${index}][product_id]`, value: item.getOptimusRouteKey }), h("input", { type: "hidden", name: "type", value: "products" }), h("textarea", { "data-product-id": item.id, name: `products[${index}][comment]`, id: `productReview_${item.id}`, class: "comment form-input h-20 product-review", placeholder: `اضف رأيك عن المنتج (${item.title})` }), h("small", { class: "text-red-400 validation-message" })))))));
69
+ }))));
70
+ }
71
+ renderStoreRating() {
72
+ return (h("section", { class: "rating-section bg-white my-10 p-5 rounded-md mb-5", "data-type": "store" }, h("div", { class: "rating-outer-form", "data-stars-error": "\u064A\u0631\u062C\u0649 \u062A\u0642\u064A\u064A\u0645 \u0627\u0644\u0645\u062A\u062C\u0631 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0646\u062C\u0645\u0627\u062A" }, h("input", { type: "hidden", name: "order_id", value: this.order.order_id }), h("input", { type: "hidden", name: "type", value: "store" }), h("h2", { class: "section-title text-lg font-bold mb-5" }, "\u0643\u064A\u0641 \u0643\u0627\u0646\u062A \u062A\u062C\u0631\u0628\u062A\u0643 \u0645\u0639 \u0627\u0644\u0645\u062A\u062C\u0631 \u0647\u0630\u0647 \u0627\u0644\u0645\u0631\u0629"), h("div", { class: "mb-2" }, h("textarea", { id: "storeReview", name: "comment", class: "form-input comment h-20", placeholder: "\u0627\u0636\u0641 \u0631\u0623\u064A\u0643 \u0639\u0646 \u0627\u0644\u0645\u062A\u062C\u0631.." })), h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element rate-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-sm center mb-0" })), h("small", { class: "text-red-400 validation-message" }))));
73
+ }
74
+ renderShippingRating() {
75
+ return (h("section", { class: "rating-section bg-white my-10 p-5 rounded-md mb-5", "data-type": "shipping" }, h("div", { class: "rating-outer-form", "data-stars-error": "\u064A\u0631\u062C\u0649 \u062A\u0642\u064A\u064A\u0645 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0646\u062C\u0645\u0627\u062A" }, h("input", { type: "hidden", name: "order_id", value: this.order.order_id }), h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.id }), h("input", { type: "hidden", name: "type", value: "shipping" }), h("h2", { class: "section-title text-lg font-bold mb-5" }, "\u062E\u0628\u0631\u0646\u0627 \u0639\u0646 \u062A\u062C\u0631\u0628\u062A\u0643 \u0645\u0639 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646"), h("div", { class: "mb-2" }, h("textarea", { id: "shippingReview", name: "comment", class: "form-input comment h-20 mb-2", placeholder: "\u0627\u0636\u0641 \u0631\u0623\u064A\u0643 \u0639\u0646 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646" })), h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element ratFeedbackPresentere-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-sm center mb-0" })), h("small", { class: "text-red-400 validation-message" }))));
76
+ }
77
+ getStarsRating() {
78
+ return (h("div", { class: "mb-1" }, h("input", { type: "hidden", class: "rating_hidden_input", name: "rating", value: "" }), this.stars.map((star) => h("button", { type: "submit", class: "btn btn--transparent px-1 text-lg text-gray-400 btn--star", "data-star": star, "data-text": this.order.ratingMessage[`${star}`] }, h("i", { class: "sicon-star2" })))));
79
+ }
80
+ //========================= Start Rating Logic =========================//
81
+ initiateRating() {
82
+ this.highlightSelectedStars();
83
+ this.starsRating();
84
+ //show submitRating Button Only When there is a comment field
85
+ Helper.app.toggle('#submitRating', 'btn', 'hidden', () => Helper.app.element('#shippingReview,#storeReview,.product-review'));
86
+ this.ratingChain = Promise.resolve();
87
+ Helper.app.onClick('#submitRating', () => this.sendRating().then(() => window.location.reload()));
88
+ }
89
+ sendRating() {
90
+ this.ratingValidation();
91
+ Helper.app.all('.rating-section', ratingSection => {
92
+ let type = ratingSection.dataset.type;
93
+ let formsData = [];
94
+ ratingSection.querySelectorAll('.rating-outer-form')
95
+ .forEach((form) => {
96
+ let formData = {};
97
+ form.querySelectorAll('[name]')
98
+ .forEach(function (input) {
99
+ let inputData = salla.helpers.inputData(input.name, input.value, formData);
100
+ formData[inputData.name] = inputData.value;
101
+ });
102
+ formsData = [];
103
+ formsData.push(formData);
104
+ this.sendFeedback(type, formsData);
105
+ });
106
+ });
107
+ return this.ratingChain;
108
+ }
109
+ sendFeedback(type, formsData) {
110
+ if (!formsData || formsData.length == 0) {
111
+ return;
112
+ }
113
+ salla.config.canLeave = false;
114
+ this.ratingChain = salla.feedback.api[type](formsData[0])
115
+ .then(function () {
116
+ salla.config.canLeave = true;
117
+ }).catch(() => salla.config.canLeave = true);
118
+ }
119
+ ratingValidation() {
120
+ let errorMsg = '';
121
+ document.querySelectorAll('.rating-section')
122
+ .forEach((ratingSection) => {
123
+ ratingSection.querySelectorAll('.rating-outer-form')
124
+ .forEach((rating) => {
125
+ let ratingInput = rating.querySelector('.rating_hidden_input');
126
+ let commentInput = rating.querySelector('.comment');
127
+ let sectionTitle = rating.querySelector('.section-title');
128
+ let validationMessage = rating.querySelector('.validation-message');
129
+ if (ratingInput.value && commentInput.value && commentInput.value.length > 3) {
130
+ commentInput.classList.remove('has-error');
131
+ sectionTitle === null || sectionTitle === void 0 ? void 0 : sectionTitle.classList.remove('has-error', 'text-red-400');
132
+ validationMessage.innerHTML = '';
133
+ return;
134
+ }
135
+ else if (commentInput.value && commentInput.value.length > 3) {
136
+ commentInput.classList.remove('has-error');
137
+ }
138
+ else {
139
+ commentInput.classList.add('has-error');
140
+ }
141
+ sectionTitle === null || sectionTitle === void 0 ? void 0 : sectionTitle.classList.add('has-error', 'text-red-400');
142
+ errorMsg = ratingInput.value
143
+ ? (salla.lang.get('common.errors.not_less_than_chars', { chars: 4 }) + ' ' + commentInput.getAttribute('placeholder'))
144
+ : (rating.dataset.starsError || salla.lang.get('pages.rating.rate_store_stars'));
145
+ validationMessage.innerHTML = errorMsg;
146
+ });
147
+ });
148
+ //Fire error to prevent sending rating
149
+ if (errorMsg) {
150
+ // scroll to first error
151
+ let ratingErrors = document.querySelectorAll('.has-error');
152
+ if (ratingErrors.length) {
153
+ let firstError = ratingErrors[0].offsetTop;
154
+ window.scrollTo({ top: firstError - 80 }); // 80 = fixed nav height
155
+ }
156
+ throw new Error(errorMsg);
157
+ }
158
+ }
159
+ // for hovered star ---
160
+ highlightSelectedStars() {
161
+ let hover = ['hovered', 'text-theme-yellow'];
162
+ Helper.app.all('.rate-element', el => {
163
+ let starElements = el.querySelectorAll('.btn--star');
164
+ // remove hovered state from stars ---
165
+ el.addEventListener('mouseout', () => el.querySelectorAll('.btn--star').forEach(star => star.classList.remove(...hover)));
166
+ starElements.forEach((starElement, index) => {
167
+ starElement.addEventListener('mouseover', () => {
168
+ starElement.classList.add(...hover);
169
+ if (index <= 1) {
170
+ starElement.previousElementSibling.tagName === 'BUTTON' ? starElement.previousElementSibling.classList.add(...hover) : null;
171
+ }
172
+ else {
173
+ for (let i = 0; i < index; i++) {
174
+ starElements[i].classList.add(...hover);
175
+ }
176
+ }
177
+ });
178
+ starElement.addEventListener('mouseout', () => {
179
+ starElement.classList.contains(...hover) ? starElement.classList.remove(...hover) : null;
180
+ });
181
+ });
182
+ });
183
+ }
184
+ starsRating() {
185
+ let selectedClasses = ['selected', 'text-theme-yellow'];
186
+ // Listen for form submissions
187
+ salla.document.event.onSubmit('.rate-element', function (event) {
188
+ // Prevent form from submitting
189
+ event.preventDefault();
190
+ // Get the selected star - activeElement is not supported in safari
191
+ var activeStars = event.target.querySelectorAll('.btn--star.hovered');
192
+ var selected = activeStars[activeStars.length - 1];
193
+ if (!selected)
194
+ return;
195
+ var selectedIndex = parseInt(selected.dataset.star, 10), selectedText = selected.dataset.text;
196
+ event.target.nextElementSibling.innerHTML = selectedText;
197
+ event.target.querySelector('.rating_hidden_input').value = selectedIndex;
198
+ // Get all stars in this form (only search in the form, not the whole document)
199
+ // Loop through each star, and add or remove the `.selected` class to toggle highlighting
200
+ event.target
201
+ .querySelectorAll('.btn--star')
202
+ .forEach(function (star, index) {
203
+ if (index < selectedIndex) {
204
+ // Selected star or before it, Add highlighting
205
+ star.classList.add(...selectedClasses);
206
+ return;
207
+ }
208
+ // After selected star, Remove highlight
209
+ star.classList.remove(...selectedClasses);
210
+ });
211
+ // Remove aria-pressed from any previously selected star
212
+ var previousRating = event.target.querySelector('.star[aria-pressed="true"]');
213
+ if (previousRating) {
214
+ previousRating.removeAttribute('aria-pressed');
215
+ }
216
+ // Add aria-pressed role to the selected button
217
+ selected.setAttribute('aria-pressed', true);
218
+ });
219
+ }
220
+ };
221
+ OrderRating.style = orderRatingCss;
222
+
223
+ export { OrderRating as order_rating };
@@ -0,0 +1,52 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-643344dc.js';
2
+ import { H as Helper } from './Helper-23b2de40.js';
3
+
4
+ const sallaButtonCss = ":host{display:block}";
5
+
6
+ const SallaButton = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.kind = 'primary';
10
+ this.loading = false;
11
+ this.hostAttributes = {};
12
+ for (let i = 0; i < this.host.attributes.length; i++) {
13
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
14
+ }
15
+ this.hostAttributes['type'] = this.hostAttributes['type'] || 'button';
16
+ this.hostAttributes['class'] = (this.hostAttributes['class'] || '') + ' s-button-btn btn--has-loading btn-' + this.kind;
17
+ delete this.hostAttributes['kind'];
18
+ delete this.hostAttributes['id'];
19
+ }
20
+ async load() {
21
+ this.host.setAttribute('loading', '');
22
+ return this.host;
23
+ }
24
+ async stop() {
25
+ this.host.removeAttribute('loading');
26
+ return this.host;
27
+ }
28
+ async disable() {
29
+ this.btn.setAttribute('disabled', '');
30
+ }
31
+ async enable() {
32
+ this.btn.removeAttribute('disabled');
33
+ }
34
+ handleVisible(newKind, oldKind) {
35
+ this.btn.classList.remove('btn-' + oldKind);
36
+ this.btn.classList.add('btn-' + newKind);
37
+ }
38
+ handleLoading(newVal) {
39
+ Helper.toggleElement(this.btn, 'btn--is-loading', 'btn--no-loading', () => newVal);
40
+ }
41
+ render() {
42
+ return (h("button", Object.assign({ ref: el => this.btn = el }, this.hostAttributes), h("slot", null), this.loading ? h("span", { class: "loader loader--small s-button-loader" }) : ''));
43
+ }
44
+ get host() { return getElement(this); }
45
+ static get watchers() { return {
46
+ "kind": ["handleVisible"],
47
+ "loading": ["handleLoading"]
48
+ }; }
49
+ };
50
+ SallaButton.style = sallaButtonCss;
51
+
52
+ export { SallaButton as salla_button };
@@ -0,0 +1,45 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-643344dc.js';
2
+ import { H as Helper } from './Helper-23b2de40.js';
3
+
4
+ const SallaLocalization = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ Helper.setHost(this.host);
8
+ salla.event.on('localization::show', () => this.show());
9
+ }
10
+ async show() {
11
+ return this.modal.show();
12
+ }
13
+ async hide() {
14
+ return this.modal.hide();
15
+ }
16
+ submit() {
17
+ let url;
18
+ this.btn.load()
19
+ .then(() => {
20
+ let code = Helper.val('[name=currency]:checked');
21
+ if (code !== salla.config.currency.code) {
22
+ url = window.location.href;
23
+ return salla.currency.api.change(code);
24
+ }
25
+ //binding
26
+ }).then(() => {
27
+ let language = Helper.val('[name=lang]:checked');
28
+ if (language !== salla.config.language.code) {
29
+ url = salla.config.languages.filter(lang => lang.code === language)[0].url;
30
+ }
31
+ }).then(() => this.btn.stop())
32
+ .then(() => this.hide())
33
+ .then(() => url && (window.location.href = url));
34
+ }
35
+ render() {
36
+ return (h("salla-modal", { id: "salla-localization", class: "hidden", ref: modal => this.modal = modal }, h("slot", { name: "header" }, h("div", { slot: "header" })), h("div", { class: "s-localization-inner" }, salla.config.languages
37
+ ? h("div", { class: "s-localization-section" }, h("label", { class: "s-localization-title" }, salla.lang.get('common.titles.language')), h("fieldset", { class: "s-localization-fieldset" }, h("legend", { class: "sr-only" }, salla.lang.get('blocks.header.change_language')), h("div", { class: "s-localization-section-inner" }, salla.config.languages.map(lang => h("div", { class: "flex items-center" }, h("input", { id: 'lang-' + lang.code.toLowerCase(), class: "s-localization-input", name: "lang", checked: salla.config.language.code == lang.code, type: "radio", value: lang.code }), h("label", { htmlFor: 'lang-' + lang.code.toLowerCase(), class: "s-localization-label" }, h("span", null, lang.name), h("div", { class: 's-localization-flag flag iti__flag iti__' + lang.country_code })))))))
38
+ : '', salla.config.currencies
39
+ ? h("div", { class: "s-localization-section" }, h("label", { class: "s-localization-title" }, salla.lang.get('common.titles.currency')), h("fieldset", { class: "s-localization-fieldset" }, h("legend", { class: "sr-only" }, salla.lang.get('blocks.header.change_currency')), h("div", { class: "s-localization-section-inner" }, salla.config.currencies.map(currency => h("div", { class: "s-localization-item" }, h("input", { class: "s-localization-input", checked: salla.config.currency.code == currency.code, id: 'currency-' + currency.code, name: "currency", type: "radio", value: currency.code }), h("label", { class: "s-localization-label", htmlFor: 'currency-' + currency.code }, h("span", null, currency.name), h("small", { class: "s-localization-currency" }, currency.code)))))))
40
+ : ''), h("p", { slot: "footer" }, h("slot", { name: "footer" }, h("salla-button", { ref: btn => this.btn = btn, onClick: () => this.submit(), class: "w-full" }, salla.lang.get('common.elements.ok'))))));
41
+ }
42
+ get host() { return getElement(this); }
43
+ };
44
+
45
+ export { SallaLocalization as salla_localization };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-8919a244.js';
1
+ import { r as registerInstance, h } from './index-643344dc.js';
2
2
 
3
3
  const SallaLogin = class {
4
4
  constructor(hostRef) {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-8919a244.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-643344dc.js';
2
2
 
3
3
  const SallaSearch = class {
4
4
  constructor(hostRef) {
@@ -72,18 +72,18 @@ const SallaSearch = class {
72
72
  .replace("{price}", (_a = item.price) === null || _a === void 0 ? void 0 : _a.after)
73
73
  .replace("{url}", item.url)
74
74
  .replace("{thumb}", item.thumb);
75
- return (h("div", { class: "s-search-modal-product", innerHTML: product }));
75
+ return (h("div", { class: "s-search-product", innerHTML: product }));
76
76
  }
77
77
  else {
78
- return (h("div", { class: "s-search-modal-product" }, h("a", { target: "_blank", href: item.url, class: "s-search-modal-product-image-container" }, h("img", { class: "s-search-modal-product-image", src: item.thumb })), h("div", { class: "s-search-modal-product-details" }, h("div", { class: "s-search-modal-product-title" }, item.title), h("div", { class: "s-search-modal-product-price" }, (_b = item.price) === null || _b === void 0 ? void 0 : _b.after))));
78
+ return (h("div", { class: "s-search-product" }, h("a", { target: "_blank", href: item.url, class: "s-search-product-image-container" }, h("img", { class: "s-search-product-image", src: item.thumb })), h("div", { class: "s-search-product-details" }, h("div", { class: "s-search-product-title" }, item.title), h("div", { class: "s-search-product-price" }, (_b = item.price) === null || _b === void 0 ? void 0 : _b.after))));
79
79
  }
80
80
  }
81
81
  render() {
82
- return (h(Host, { class: "s-search-modal" }, h("button", { type: "button", onClick: this.openSearch, class: "s-search-modal-search-button-icon" }, this.hasSearchIconSlot ? (h("slot", { name: "search-icon" })) : (h("i", { class: "sicon-search font-bold" }))), this.showModal && (h("div", { class: "s-search-modal-container", style: { backgroundColor: 'rgba(0,0,0,0.5)' } }, h("div", { class: "s-search-modal-wrapper", onClick: this.closeSearch }, h("div", { class: "s-search-modal-inner", onClick: e => {
82
+ return (h(Host, { class: "s-search" }, h("button", { type: "button", onClick: this.openSearch, class: "s-search-search-button-icon" }, this.hasSearchIconSlot ? (h("slot", { name: "search-icon" })) : (h("i", { class: "sicon-search font-bold" }))), this.showModal && (h("div", { class: "s-search-container", style: { backgroundColor: 'rgba(0,0,0,0.5)' } }, h("div", { class: "s-search-wrapper", onClick: this.closeSearch }, h("div", { class: "s-search-inner", onClick: e => {
83
83
  e.stopPropagation();
84
- } }, h("div", { class: "s-search-modal-search-box-container" }, h("div", { class: !this.showResult
85
- ? 's-search-modal-search-box-inner'
86
- : 's-search-modal-search-box-inner-open' }, h("input", { class: "s-search-modal-input", type: "text", placeholder: this.searchPlaceholder, value: this.searchTerm, onInput: event => this.handleChange(event) }), this.fetchStatus != 'loading' ? (h("button", { class: "s-search-modal-search-icon" }, h("i", { class: "sicon-search" }))) : (h("span", { class: "s-search-modal-spinner" }, h("span", { class: "s-search-modal-spinner-loader" }))))), h("div", { class: "s-search-modal-search-results" }, this.fetchStatus === 'error' && (h("p", { class: "s-search-modal-no-results error p-4 text-sm text-gray-text" }, this.noResultsText)), this.results &&
84
+ } }, h("div", { class: "s-search-search-box-container" }, h("div", { class: !this.showResult
85
+ ? 's-search-search-box-inner'
86
+ : 's-search-search-box-inner-open' }, h("input", { class: "s-search-input", type: "text", placeholder: this.searchPlaceholder, value: this.searchTerm, onInput: event => this.handleChange(event) }), this.fetchStatus != 'loading' ? (h("button", { class: "s-search-search-icon" }, h("i", { class: "sicon-search" }))) : (h("span", { class: "s-search-spinner" }, h("span", { class: "s-search-spinner-loader" }))))), h("div", { class: "s-search-search-results" }, this.fetchStatus === 'error' && (h("p", { class: "s-search-no-results error p-4 text-sm text-gray-text" }, this.noResultsText)), this.results &&
87
87
  this.results.map(item => {
88
88
  return this.getProduct(item);
89
89
  }))))))));
@@ -1,2 +1,2 @@
1
- export { S as salla_search } from './salla-search-bd2f71b3.js';
2
- import './index-8919a244.js';
1
+ export { S as salla_search } from './salla-search-5d4a6f1a.js';
2
+ import './index-643344dc.js';
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-8919a244.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-643344dc.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.8.1 | MIT Licensed | https://stenciljs.com
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["salla-login_2",[[0,"salla-login"],[4,"salla-modal",{"error":[4],"success":[4],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1]}]]],["salla-currency-language",[[4,"salla-currency-language",{"show":[64],"hide":[64]}]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]]], options);
16
+ return bootstrapLazy([["salla-localization",[[4,"salla-localization",{"show":[64],"hide":[64]}]]],["order-rating",[[0,"order-rating",{"order":[8]}]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]],["salla-button",[[4,"salla-button",{"kind":[513],"loading":[516],"load":[64],"stop":[64],"disable":[64],"enable":[64]}]]],["multi-warehouse_3",[[4,"multi-warehouse",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}],[0,"salla-login"],[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[1,"modal-width"],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1],"show":[64],"hide":[64]}]]]], options);
17
17
  });
@@ -1 +1 @@
1
- export{S as SallaLogin}from"./p-41dc89e6.js";export{S as SallaSearch}from"./p-58b1afae.js";import"./p-9f9af3e0.js";
1
+ export{S as SallaLogin}from"./p-36c87e2e.js";export{S as SallaSearch}from"./p-4b137380.js";import"./p-d1ef2268.js";
@@ -1 +1 @@
1
- import{r as e,h as s}from"./p-9f9af3e0.js";const t=class{constructor(s){e(this,s)}render(){return s("salla-modal",{id:"salla-login",title:"سجل دخول إلى الموقع"},s("div",{id:"showLoginMethods"},s("p",{class:"text-sm text-gray-text mb-5"},"اختر الوسيلة المناسبة"),s("div",{id:"openEmailLogin",class:"mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200"},s("div",{class:"flex-shrink-0"},s("div",{class:"bg-primary w-12 h-12 text-lg text-white rounded-icon"},s("i",{class:"sicon-mail"}))),s("div",{class:"flex-1 min-w-0"},s("a",{href:"#",class:"focus:outline-none flex justify-between items-center"},s("div",{class:"flex-1"},s("span",{class:"absolute inset-0","aria-hidden":"true"}),s("p",{class:"text-sm text-gray-text"},"سجل دخول"),s("h6",{class:"font-boldf"},"البريد الإلكتروني")),s("i",{class:"sicon-keyboard_arrow_left text-primary text-xl"})))),s("div",{class:"box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200"},s("div",{class:"flex-shrink-0"},s("div",{class:"bg-primary w-12 h-12 text-lg text-white rounded-icon"},s("i",{class:"sicon-phone"}))),s("div",{class:"flex-1 min-w-0"},s("a",{href:"#",class:"focus:outline-none flex justify-between items-center"},s("div",{class:"flex-1"},s("span",{class:"absolute inset-0","aria-hidden":"true"}),s("p",{class:"text-sm text-gray-text"},"سجل دخول"),s("h6",{class:"font-boldf"},"الهاتف")),s("i",{class:"sicon-keyboard_arrow_left text-primary text-xl"}))))))}};export{t as S}
1
+ import{r as e,h as s}from"./p-d1ef2268.js";const t=class{constructor(s){e(this,s)}render(){return s("salla-modal",{id:"salla-login",title:"سجل دخول إلى الموقع"},s("div",{id:"showLoginMethods"},s("p",{class:"text-sm text-gray-text mb-5"},"اختر الوسيلة المناسبة"),s("div",{id:"openEmailLogin",class:"mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200"},s("div",{class:"flex-shrink-0"},s("div",{class:"bg-primary w-12 h-12 text-lg text-white rounded-icon"},s("i",{class:"sicon-mail"}))),s("div",{class:"flex-1 min-w-0"},s("a",{href:"#",class:"focus:outline-none flex justify-between items-center"},s("div",{class:"flex-1"},s("span",{class:"absolute inset-0","aria-hidden":"true"}),s("p",{class:"text-sm text-gray-text"},"سجل دخول"),s("h6",{class:"font-boldf"},"البريد الإلكتروني")),s("i",{class:"sicon-keyboard_arrow_left text-primary text-xl"})))),s("div",{class:"box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200"},s("div",{class:"flex-shrink-0"},s("div",{class:"bg-primary w-12 h-12 text-lg text-white rounded-icon"},s("i",{class:"sicon-phone"}))),s("div",{class:"flex-1 min-w-0"},s("a",{href:"#",class:"focus:outline-none flex justify-between items-center"},s("div",{class:"flex-1"},s("span",{class:"absolute inset-0","aria-hidden":"true"}),s("p",{class:"text-sm text-gray-text"},"سجل دخول"),s("h6",{class:"font-boldf"},"الهاتف")),s("i",{class:"sicon-keyboard_arrow_left text-primary text-xl"}))))))}};export{t as S}
@@ -0,0 +1 @@
1
+ import{r as s,h as t,H as i,g as e}from"./p-d1ef2268.js";const r=class{constructor(t){s(this,t),this.fetchStatus="",this.showModal=!1,this.searchPlaceholder="Search here ...",this.noResultsText="There are no results at the moment",this.handleChange=s=>{this.searchTerm=s.target.value,this.fetchStatus="loading",this.showResult=!1,this.results=[],this.searchTerm.length>2&&window.salla.search.api.search(this.searchTerm).then((s=>s)).then((s=>{console.log("response",s),this.fetchStatus="idle",this.results=s.results,this.showResult=!0,this.results.length<1&&(this.fetchStatus="error")})).catch((s=>{this.showResult=!0,this.fetchStatus="error",console.log(s)}))},this.openSearch=()=>{this.searchTerm="",this.fetchStatus="",this.results=[],this.showModal=!0,window.scrollTo(0,0),document.getElementsByTagName("html")[0].style.position="fixed",document.getElementsByTagName("html")[0].style.overflowY="scroll"},this.closeSearch=()=>{this.searchTerm="",this.fetchStatus="",this.results=[],document.getElementsByTagName("html")[0].style.position="static",document.getElementsByTagName("html")[0].style.overflowY="auto",this.showModal=!1}}componentWillLoad(){this.hasSearchIconSlot=!!this.hostElement.querySelector('[slot="search-icon"]'),this.hasProductTemplateSlot=!!this.hostElement.querySelector('[slot="product-template"]'),this.hasProductTemplateSlot&&(this.productTemplateHtml=this.hostElement.querySelector('[slot="product-template"]').innerHTML)}getProduct(s){var i,e;if(this.hasProductTemplateSlot){let e=this.productTemplateHtml.replace("{title}",s.title).replace("{price}",null===(i=s.price)||void 0===i?void 0:i.after).replace("{url}",s.url).replace("{thumb}",s.thumb);return t("div",{class:"s-search-product",innerHTML:e})}return t("div",{class:"s-search-product"},t("a",{target:"_blank",href:s.url,class:"s-search-product-image-container"},t("img",{class:"s-search-product-image",src:s.thumb})),t("div",{class:"s-search-product-details"},t("div",{class:"s-search-product-title"},s.title),t("div",{class:"s-search-product-price"},null===(e=s.price)||void 0===e?void 0:e.after)))}render(){return t(i,{class:"s-search"},t("button",{type:"button",onClick:this.openSearch,class:"s-search-search-button-icon"},this.hasSearchIconSlot?t("slot",{name:"search-icon"}):t("i",{class:"sicon-search font-bold"})),this.showModal&&t("div",{class:"s-search-container",style:{backgroundColor:"rgba(0,0,0,0.5)"}},t("div",{class:"s-search-wrapper",onClick:this.closeSearch},t("div",{class:"s-search-inner",onClick:s=>{s.stopPropagation()}},t("div",{class:"s-search-search-box-container"},t("div",{class:this.showResult?"s-search-search-box-inner-open":"s-search-search-box-inner"},t("input",{class:"s-search-input",type:"text",placeholder:this.searchPlaceholder,value:this.searchTerm,onInput:s=>this.handleChange(s)}),"loading"!=this.fetchStatus?t("button",{class:"s-search-search-icon"},t("i",{class:"sicon-search"})):t("span",{class:"s-search-spinner"},t("span",{class:"s-search-spinner-loader"})))),t("div",{class:"s-search-search-results"},"error"===this.fetchStatus&&t("p",{class:"s-search-no-results error p-4 text-sm text-gray-text"},this.noResultsText),this.results&&this.results.map((s=>this.getProduct(s))))))))}get hostElement(){return e(this)}};export{r as S}
@@ -0,0 +1 @@
1
+ import{r as l,h as a,g as s}from"./p-d1ef2268.js";import{H as i}from"./p-520446eb.js";const e=class{constructor(a){l(this,a),i.setHost(this.host),salla.event.on("localization::show",(()=>this.show()))}async show(){return this.modal.show()}async hide(){return this.modal.hide()}submit(){let l;this.btn.load().then((()=>{let a=i.val("[name=currency]:checked");if(a!==salla.config.currency.code)return l=window.location.href,salla.currency.api.change(a)})).then((()=>{let a=i.val("[name=lang]:checked");a!==salla.config.language.code&&(l=salla.config.languages.filter((l=>l.code===a))[0].url)})).then((()=>this.btn.stop())).then((()=>this.hide())).then((()=>l&&(window.location.href=l)))}render(){return a("salla-modal",{id:"salla-localization",class:"hidden",ref:l=>this.modal=l},a("slot",{name:"header"},a("div",{slot:"header"})),a("div",{class:"s-localization-inner"},salla.config.languages?a("div",{class:"s-localization-section"},a("label",{class:"s-localization-title"},salla.lang.get("common.titles.language")),a("fieldset",{class:"s-localization-fieldset"},a("legend",{class:"sr-only"},salla.lang.get("blocks.header.change_language")),a("div",{class:"s-localization-section-inner"},salla.config.languages.map((l=>a("div",{class:"flex items-center"},a("input",{id:"lang-"+l.code.toLowerCase(),class:"s-localization-input",name:"lang",checked:salla.config.language.code==l.code,type:"radio",value:l.code}),a("label",{htmlFor:"lang-"+l.code.toLowerCase(),class:"s-localization-label"},a("span",null,l.name),a("div",{class:"s-localization-flag flag iti__flag iti__"+l.country_code})))))))):"",salla.config.currencies?a("div",{class:"s-localization-section"},a("label",{class:"s-localization-title"},salla.lang.get("common.titles.currency")),a("fieldset",{class:"s-localization-fieldset"},a("legend",{class:"sr-only"},salla.lang.get("blocks.header.change_currency")),a("div",{class:"s-localization-section-inner"},salla.config.currencies.map((l=>a("div",{class:"s-localization-item"},a("input",{class:"s-localization-input",checked:salla.config.currency.code==l.code,id:"currency-"+l.code,name:"currency",type:"radio",value:l.code}),a("label",{class:"s-localization-label",htmlFor:"currency-"+l.code},a("span",null,l.name),a("small",{class:"s-localization-currency"},l.code)))))))):""),a("p",{slot:"footer"},a("slot",{name:"footer"},a("salla-button",{ref:l=>this.btn=l,onClick:()=>this.submit(),class:"w-full"},salla.lang.get("common.elements.ok")))))}get host(){return s(this)}};export{e as salla_localization}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as s}from"./p-d1ef2268.js";import{H as a}from"./p-520446eb.js";const i=class{constructor(e){t(this,e),this.stars=[1,2,3,4,5],this.order={shipping:{id:5622},order_id:"179794",products:[{title:"ميكروفون عالى الجودة",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/pMdEEyMVpZFj4L1Hrdm2g48AuiSx0TrKULBiOnPo.jpg",price:"‏10,978.00 ر.س",qty:"‏2",totalBefore:"‏1120 ر.س",discount:"-5%",total:"‏1064 ر.س",id:"2314513454",getOptimusRouteKey:"7351233357"},{title:"وحدة تحكم لمشغل العاب",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/NOa4kHvOkd1hBWHk3JIgAo1602oVACfuWGFz3vXv.jpg",price:"‏10,978.00 ر.س",qty:"‏2",totalBefore:"‏1120 ر.س",discount:"-5%",total:"‏1064 ر.س",id:"9842833",getOptimusRouteKey:"735152357"},{title:"ساعة ذكية بنظام اندرويد",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/T4kTqYNuPAZmPMLw1bx92RnjVMZyFszVXOUZQsFJ.jpg",price:"‏10,978.00 ر.س",qty:"‏2",totalBefore:"‏1120 ر.س",discount:"-5%",total:"‏1064 ر.س",id:"679822376",getOptimusRouteKey:"73233357"}],ratingMessage:{1:"غير راضي <span class='emoji mx-1'>😒</span>",2:"لم يعجبني <span class='emoji mx-1'>😌</span>",3:"معقول <span class='emoji mx-1'>🙄</span>",4:"أعجبني <span class='emoji mx-1'>👍</span>",5:"أعجبني جداً <span class='emoji mx-1'>🤩</span>"},settings:{isProductsRating:!0,isStoreRating:!0,isShippingRating:!0}}}render(){return e(s,null,this.order.settings.isProductsRating&&this.renderProductsRating(),this.order.settings.isStoreRating&&this.renderStoreRating(),this.order.settings.isShippingRating&&this.renderShippingRating())}renderProductsRating(){return e("section",{class:"rating-section products-section","data-type":"product"},e("div",{class:"bg-white mb-5 p-5 rounded-md overflow-hidden mb-10"},this.order.products.map(((t,s)=>{var a;return e("div",{class:"rating-outer-form","data-stars-error":`يرجى تقييم (${t.title}) بواسطة النجمات`},e("div",{class:"product-item mb-4"},e("div",{class:"mb-5"},e("div",{class:"flex space-s-5 mb-8"},e("img",{src:t.image,alt:t.title,class:"w-18 h-14 object-cover rounded-md"}),e("div",{class:"flex-1"},e("h3",{class:"section-title leading-5 mb-1.5 md:text-base"}," ",t.title),e("div",{class:"rw-product-entry__rate"},e("div",{class:"rating-wrap flex items-center space-s-4"},e("form",{class:"rate-element rate-element--has-label"},this.getStarsRating()),e("p",{class:"rate-label fix-align font-xsm my-0"})),e("input",{type:"hidden",name:"order_id",value:null===(a=this.order)||void 0===a?void 0:a.order_id}),e("input",{type:"hidden",name:`products[${s}][product_id]`,value:t.getOptimusRouteKey}),e("input",{type:"hidden",name:"type",value:"products"}),e("textarea",{"data-product-id":t.id,name:`products[${s}][comment]`,id:`productReview_${t.id}`,class:"comment form-input h-20 product-review",placeholder:`اضف رأيك عن المنتج (${t.title})`}),e("small",{class:"text-red-400 validation-message"})))))))}))))}renderStoreRating(){return e("section",{class:"rating-section bg-white my-10 p-5 rounded-md mb-5","data-type":"store"},e("div",{class:"rating-outer-form","data-stars-error":"يرجى تقييم المتجر بواسطة النجمات"},e("input",{type:"hidden",name:"order_id",value:this.order.order_id}),e("input",{type:"hidden",name:"type",value:"store"}),e("h2",{class:"section-title text-lg font-bold mb-5"},"كيف كانت تجربتك مع المتجر هذه المرة"),e("div",{class:"mb-2"},e("textarea",{id:"storeReview",name:"comment",class:"form-input comment h-20",placeholder:"اضف رأيك عن المتجر.."})),e("div",{class:"rating-wrap flex items-center space-s-4"},e("form",{class:"rate-element rate-element--has-label"},this.getStarsRating()),e("p",{class:"rate-label fix-align font-sm center mb-0"})),e("small",{class:"text-red-400 validation-message"})))}renderShippingRating(){return e("section",{class:"rating-section bg-white my-10 p-5 rounded-md mb-5","data-type":"shipping"},e("div",{class:"rating-outer-form","data-stars-error":"يرجى تقييم شركة الشحن بواسطة النجمات"},e("input",{type:"hidden",name:"order_id",value:this.order.order_id}),e("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.id}),e("input",{type:"hidden",name:"type",value:"shipping"}),e("h2",{class:"section-title text-lg font-bold mb-5"},"خبرنا عن تجربتك مع شركة الشحن"),e("div",{class:"mb-2"},e("textarea",{id:"shippingReview",name:"comment",class:"form-input comment h-20 mb-2",placeholder:"اضف رأيك عن شركة الشحن"})),e("div",{class:"rating-wrap flex items-center space-s-4"},e("form",{class:"rate-element ratFeedbackPresentere-element--has-label"},this.getStarsRating()),e("p",{class:"rate-label fix-align font-sm center mb-0"})),e("small",{class:"text-red-400 validation-message"})))}getStarsRating(){return e("div",{class:"mb-1"},e("input",{type:"hidden",class:"rating_hidden_input",name:"rating",value:""}),this.stars.map((t=>e("button",{type:"submit",class:"btn btn--transparent px-1 text-lg text-gray-400 btn--star","data-star":t,"data-text":this.order.ratingMessage[`${t}`]},e("i",{class:"sicon-star2"})))))}initiateRating(){this.highlightSelectedStars(),this.starsRating(),a.app.toggle("#submitRating","btn","hidden",(()=>a.app.element("#shippingReview,#storeReview,.product-review"))),this.ratingChain=Promise.resolve(),a.app.onClick("#submitRating",(()=>this.sendRating().then((()=>window.location.reload()))))}sendRating(){return this.ratingValidation(),a.app.all(".rating-section",(t=>{let e=t.dataset.type,s=[];t.querySelectorAll(".rating-outer-form").forEach((t=>{let a={};t.querySelectorAll("[name]").forEach((function(t){let e=salla.helpers.inputData(t.name,t.value,a);a[e.name]=e.value})),s=[],s.push(a),this.sendFeedback(e,s)}))})),this.ratingChain}sendFeedback(t,e){e&&0!=e.length&&(salla.config.canLeave=!1,this.ratingChain=salla.feedback.api[t](e[0]).then((function(){salla.config.canLeave=!0})).catch((()=>salla.config.canLeave=!0)))}ratingValidation(){let t="";if(document.querySelectorAll(".rating-section").forEach((e=>{e.querySelectorAll(".rating-outer-form").forEach((e=>{let s=e.querySelector(".rating_hidden_input"),a=e.querySelector(".comment"),i=e.querySelector(".section-title"),r=e.querySelector(".validation-message");if(s.value&&a.value&&a.value.length>3)return a.classList.remove("has-error"),null==i||i.classList.remove("has-error","text-red-400"),void(r.innerHTML="");a.value&&a.value.length>3?a.classList.remove("has-error"):a.classList.add("has-error"),null==i||i.classList.add("has-error","text-red-400"),t=s.value?salla.lang.get("common.errors.not_less_than_chars",{chars:4})+" "+a.getAttribute("placeholder"):e.dataset.starsError||salla.lang.get("pages.rating.rate_store_stars"),r.innerHTML=t}))})),t){let e=document.querySelectorAll(".has-error");throw e.length&&window.scrollTo({top:e[0].offsetTop-80}),new Error(t)}}highlightSelectedStars(){let t=["hovered","text-theme-yellow"];a.app.all(".rate-element",(e=>{let s=e.querySelectorAll(".btn--star");e.addEventListener("mouseout",(()=>e.querySelectorAll(".btn--star").forEach((e=>e.classList.remove(...t))))),s.forEach(((e,a)=>{e.addEventListener("mouseover",(()=>{if(e.classList.add(...t),a<=1)"BUTTON"===e.previousElementSibling.tagName&&e.previousElementSibling.classList.add(...t);else for(let e=0;e<a;e++)s[e].classList.add(...t)})),e.addEventListener("mouseout",(()=>{e.classList.contains(...t)&&e.classList.remove(...t)}))}))}))}starsRating(){let t=["selected","text-theme-yellow"];salla.document.event.onSubmit(".rate-element",(function(e){e.preventDefault();var s=e.target.querySelectorAll(".btn--star.hovered"),a=s[s.length-1];if(a){var i=parseInt(a.dataset.star,10);e.target.nextElementSibling.innerHTML=a.dataset.text,e.target.querySelector(".rating_hidden_input").value=i,e.target.querySelectorAll(".btn--star").forEach((function(e,s){s<i?e.classList.add(...t):e.classList.remove(...t)}));var r=e.target.querySelector('.star[aria-pressed="true"]');r&&r.removeAttribute("aria-pressed"),a.setAttribute("aria-pressed",!0)}}))}};i.style=":host{display:block}";export{i as order_rating}
@@ -0,0 +1 @@
1
+ import{r as s,h as t,g as e,c as i,H as a}from"./p-d1ef2268.js";export{S as salla_login}from"./p-36c87e2e.js";import{H as l}from"./p-520446eb.js";let o=require("store/src/store-engine"),r=require("store/storages/sessionStorage"),n=o.createStore(r);const h=class{constructor(t){s(this,t),this.open=!1,this.isOpenedBefore=n.get("multi-warehouse-opened-before"),this.displayAs="default",this.browseProductsFrom="all",this.branches=[{id:1,name:"فرع الرياض",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:2,name:"فرع جدة",open:!1,available:!1,limited:!1,tag:"غير متوفر"},{id:3,name:"فرع مكة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:4,name:"فرع المدينة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:5,name:"فرع جازان",open:!0,available:!0,limited:!0,tag:"الكمية محدودة"}],this.current=1,this.currentBranch=s=>this.branches.filter((s=>s.id==this.current))[0][s],this.statusColor=(s=null)=>s?s.limited?"text-red-400":s.available?"text-green-500":"text-gray-400":this.currentBranch("limited")?"text-red-400":this.currentBranch("available")?"text-green-500":"text-gray-400",this.isChoiceable=()=>"all"!==this.browseProductsFrom&&"single"==this.position||"header"==this.position,this.formTitle=()=>this.isChoiceable()?"توفر المنتج في الفروع الآخرى":"التسوق من فرع آخر",salla.event.on("branches::show",(()=>this.show()))}async show(){return this.modal.show()}async hide(){return this.modal.hide()}handelChange(s){this.selected=s.target.value}handleSubmit(){n.set("multi-warehouse-opened-before",!0),this.show(),setTimeout((()=>{this.current=this.selected}),300)}render(){return t("salla-modal",{"is-closable":this.isOpenedBefore||"popup"!=this.displayAs?"true":"false",ref:s=>this.modal=s,"modal-width":"w-116",id:"multi-warehouse-modal",class:"hidden"},t("slot",{name:"header"},t("div",{slot:"header"})),t("div",null,t("div",{class:"text-right"},t("div",{class:"flex items-center mb-8"},t("div",{class:"flex-shrink-0 sm:mb-0 me-4"},t("div",{class:"h-16 w-16 border border-gray-200 bg-white text-primary rounded-full flex justify-center items-center"},t("span",{class:"sicon-store-alt"}))),t("div",null,t("p",{class:"mt-1 text-xs text-gray-400"},"أنت الآن تتصفح المتجر من"),t("h4",{class:"text-base"},"فرع الرياض"))),t("fieldset",{class:"mt-4"},t("h4",{class:"text-sm text-gray-600 mb-6"},this.formTitle()),t("legend",{class:"sr-only"},this.formTitle()),this.branches.length<=5?t("div",{class:"space-y-5"},this.branches.map((s=>t("div",{class:"flex items-center"},t("input",{id:this.position+"_branch_"+s.id,disabled:!s.open&&this.isChoiceable(),name:"lang",type:"radio",value:s.id,onChange:s=>this.handelChange(s),class:{"me-3 focus:ring-primary h-4 w-4 text-primary border-gray-300":!0,"opacity-50":!s.open,hidden:!this.isChoiceable()},checked:this.current==s.id}),t("label",{htmlFor:this.position+"_branch_"+s.id,class:{"flex items-center justify-between text-sm font-medium text-gray-700 flex-grow":!0,"cursor-pointer":this.isChoiceable()}},t("span",{class:{"opacity-50":!s.open}},s.name),this.isChoiceable()?t("small",{class:"text-red-400"},s.open?"":"مُغلق"):t("span",{class:this.statusColor(s)},s.tag)))))):t("select",{class:"w-full h-10 transition-colors duration-300 focus:ring-transparent focus:border-primary sm:text-sm border-gray-200 rounded-md appearance-none visibility_condition px-4",onInput:s=>this.handelChange(s)},this.branches.map((s=>t("option",{value:s.id,disabled:!s.open,selected:this.selected==s.id},s.name," ",s.open?"":"- مُغلق"))))))),this.isChoiceable()?t("p",{slot:"footer"},t("slot",{name:"footer"},t("button",{type:"button",class:"mt-8 w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white transition-colors hover:bg-primary-d focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary sm:col-start-2 sm:text-sm",onClick:()=>this.handleSubmit()},salla.lang.get("common.elements.ok")))):"")}componentDidRender(){}get host(){return e(this)}},d=class{constructor(t){s(this,t),this.ready=i(this,"ready",7),this.close=i(this,"close",7),this.error=!1,this.success=!1,this.isClosable=!0,this.modalWidth="w-96",this.visible=!1,this.subTitle="",this.icon="sicon-cancel",salla.event.on("modal::open",(s=>s.dataset.target==this.host.id&&this.show())),salla.event.on("modal::close",(s=>s.dataset.target==this.host.id&&this.hide()))}handleVisible(s){if(!s)return this.toggleModal(!1),void this.close.emit();this.host.classList.remove("hidden"),setTimeout((()=>this.toggleModal(!0))),this.ready.emit()}async show(){return this.host.setAttribute("visible",""),this.host}async hide(){return this.host.removeAttribute("visible"),this.host}toggleModal(s){l.toggleElement(this.host.querySelector(".s-modal-overlay"),"ease-out duration-300 opacity-100","opacity-0",(()=>s)).toggleElement(this.host.querySelector(".s-modal-body"),"ease-out duration-300 opacity-100 translate-y-0 sm:scale-100","opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",(()=>s)).toggleElement(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("hidden")),350)}closeModal(){this.isClosable&&this.host.removeAttribute("visible")}render(){return this.host.id=this.host.id||"salla-modal",t(a,{class:"s-modal-container hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-modal-wrapper"},t("div",{class:"s-modal-overlay",onClick:()=>this.closeModal()}),t("span",{class:"s-modal-spacer"},"​"),t("div",{class:"s-modal-body "+this.modalWidth},t("slot",{name:"header"},t("div",{class:"s-modal-header"},this.isClosable?t("button",{class:"s-modal-close cursor-pointer",onClick:()=>this.closeModal(),type:"button"},t("span",{class:"sicon-cancel"})):"",this.error||this.success?t("div",{class:{"s-modal-icon":!0,"s-modal-bg-error":this.error,"s-modal-bg-success":this.success}},t("i",{class:{[this.icon]:!0,"s-modal-text-error":this.error,"s-modal-text-success":this.success}})):"",t("div",{class:"s-modal-title",innerHTML:this.host.title}),t("p",{class:"s-modal-sub-title",innerHTML:this.subTitle}))),t("slot",null),t("slot",{name:"footer"}))))}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};export{h as multi_warehouse,d as salla_modal}
@@ -0,0 +1 @@
1
+ import{r as t,h as s,g as i}from"./p-d1ef2268.js";import{H as n}from"./p-520446eb.js";const a=class{constructor(s){t(this,s),this.kind="primary",this.loading=!1,this.hostAttributes={};for(let t=0;t<this.host.attributes.length;t++)this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value;this.hostAttributes.type=this.hostAttributes.type||"button",this.hostAttributes.class=(this.hostAttributes.class||"")+" s-button-btn btn--has-loading btn-"+this.kind,delete this.hostAttributes.kind,delete this.hostAttributes.id}async load(){return this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host}async disable(){this.btn.setAttribute("disabled","")}async enable(){this.btn.removeAttribute("disabled")}handleVisible(t,s){this.btn.classList.remove("btn-"+s),this.btn.classList.add("btn-"+t)}handleLoading(t){n.toggleElement(this.btn,"btn--is-loading","btn--no-loading",(()=>t))}render(){return s("button",Object.assign({ref:t=>this.btn=t},this.hostAttributes),s("slot",null),this.loading?s("span",{class:"loader loader--small s-button-loader"}):"")}get host(){return i(this)}static get watchers(){return{kind:["handleVisible"],loading:["handleLoading"]}}};a.style=":host{display:block}";export{a as salla_button}
@@ -0,0 +1 @@
1
+ export{S as salla_search}from"./p-4b137380.js";import"./p-d1ef2268.js";
@@ -0,0 +1 @@
1
+ let e,t,l=!1,n=!1,o=!1,s=!1;const i="undefined"!=typeof window?window:{},r=i.document||{head:{}},c={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,l,n)=>e.addEventListener(t,l,n),rel:(e,t,l,n)=>e.removeEventListener(t,l,n),ce:(e,t)=>new CustomEvent(e,t)},f=e=>Promise.resolve(e),a=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u="http://www.w3.org/1999/xlink",$=new WeakMap,d=e=>"sc-"+e.o,y={},h=e=>"object"==(e=typeof e)||"function"===e,p=(e,t,...l)=>{let n=null,o=null,s=null,i=!1,r=!1,c=[];const f=t=>{for(let l=0;l<t.length;l++)n=t[l],Array.isArray(n)?f(n):null!=n&&"boolean"!=typeof n&&((i="function"!=typeof e&&!h(n))&&(n+=""),i&&r?c[c.length-1].i+=n:c.push(i?m(null,n):n),r=i)};if(f(l),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=m(e,null);return a.u=t,c.length>0&&(a.$=c),a.h=o,a.p=s,a},m=(e,t)=>({t:0,m:e,i:t,k:null,$:null,u:null,h:null,p:null}),b={},w=(e,t,l,n,o,s)=>{if(l!==n){let r=te(e,t),f=t.toLowerCase();if("class"===t){const t=e.classList,o=g(l),s=g(n);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in l)n&&null!=n[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in n)l&&n[t]===l[t]||(t.includes("-")?e.style.setProperty(t,n[t]):e.style[t]=n[t])}else if("key"===t);else if("ref"===t)n&&n(e);else if(r||"o"!==t[0]||"n"!==t[1]){const i=h(n);if((r||i&&null!==n)&&!o)try{if(e.tagName.includes("-"))e[t]=n;else{let o=null==n?"":n;"list"===t?r=!1:null!=l&&e[t]==o||(e[t]=o)}}catch(e){}let c=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(t=f,c=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(u,t):e.removeAttribute(t)):(!r||4&s||o)&&!i&&(n=!0===n?"":n,c?e.setAttributeNS(u,t,n):e.setAttribute(t,n))}else t="-"===t[2]?t.slice(3):te(i,f)?f.slice(2):f[2]+t.slice(3),l&&c.rel(e,t,l,!1),n&&c.ael(e,t,n,!1)}},k=/\s/,g=e=>e?e.split(k):[],S=(e,t,l,n)=>{const o=11===t.k.nodeType&&t.k.host?t.k.host:t.k,s=e&&e.u||y,i=t.u||y;for(n in s)n in i||w(o,n,s[n],void 0,l,t.t);for(n in i)w(o,n,s[n],i[n],l,t.t)},j=(n,s,i)=>{let c,f,a,u=s.$[i],$=0;if(l||(o=!0,"slot"===u.m&&(u.t|=u.$?2:1)),null!==u.i)c=u.k=r.createTextNode(u.i);else if(1&u.t)c=u.k=r.createTextNode("");else if(c=u.k=r.createElement(2&u.t?"slot-fb":u.m),S(null,u,!1),u.$)for($=0;$<u.$.length;++$)f=j(n,u,$),f&&c.appendChild(f);return c["s-hn"]=t,3&u.t&&(c["s-sr"]=!0,c["s-cr"]=e,c["s-sn"]=u.p||"",a=n&&n.$&&n.$[i],a&&a.m===u.m&&n.k&&v(n.k,!1)),c},v=(e,l)=>{c.t|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const s=n[e];s["s-hn"]!==t&&s["s-ol"]&&(x(s).insertBefore(s,R(s)),s["s-ol"].remove(),s["s-ol"]=void 0,o=!0),l&&v(s,l)}c.t&=-2},M=(e,t,l,n,o,s)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(;o<=s;++o)n[o]&&(i=j(null,l,o),i&&(n[o].k=i,r.insertBefore(i,R(t))))},O=(e,t,l,o,s)=>{for(;t<=l;++t)(o=e[t])&&(s=o.k,A(o),n=!0,s["s-ol"]?s["s-ol"].remove():v(s,!0),s.remove())},C=(e,t)=>e.m===t.m&&("slot"===e.m?e.p===t.p:e.h===t.h),R=e=>e&&e["s-ol"]||e,x=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,P=(e,t)=>{const l=t.k=e.k,n=e.$,o=t.$,s=t.i;let i;null===s?("slot"===t.m||S(e,t,!1),null!==n&&null!==o?((e,t,l,n)=>{let o,s,i=0,r=0,c=0,f=0,a=t.length-1,u=t[0],$=t[a],d=n.length-1,y=n[0],h=n[d];for(;i<=a&&r<=d;)if(null==u)u=t[++i];else if(null==$)$=t[--a];else if(null==y)y=n[++r];else if(null==h)h=n[--d];else if(C(u,y))P(u,y),u=t[++i],y=n[++r];else if(C($,h))P($,h),$=t[--a],h=n[--d];else if(C(u,h))"slot"!==u.m&&"slot"!==h.m||v(u.k.parentNode,!1),P(u,h),e.insertBefore(u.k,$.k.nextSibling),u=t[++i],h=n[--d];else if(C($,y))"slot"!==u.m&&"slot"!==h.m||v($.k.parentNode,!1),P($,y),e.insertBefore($.k,u.k),$=t[--a],y=n[++r];else{for(c=-1,f=i;f<=a;++f)if(t[f]&&null!==t[f].h&&t[f].h===y.h){c=f;break}c>=0?(s=t[c],s.m!==y.m?o=j(t&&t[r],l,c):(P(s,y),t[c]=void 0,o=s.k),y=n[++r]):(o=j(t&&t[r],l,r),y=n[++r]),o&&x(u.k).insertBefore(o,R(u.k))}i>a?M(e,null==n[d+1]?null:n[d+1].k,l,n,r,d):r>d&&O(t,i,a)})(l,n,t,o):null!==o?(null!==e.i&&(l.textContent=""),M(l,null,t,o,0,o.length-1)):null!==n&&O(n,0,n.length-1)):(i=l["s-cr"])?i.parentNode.textContent=s:e.i!==s&&(l.data=s)},T=e=>{let t,l,n,o,s,i,r=e.childNodes;for(l=0,n=r.length;l<n;l++)if(t=r[l],1===t.nodeType){if(t["s-sr"])for(s=t["s-sn"],t.hidden=!1,o=0;o<n;o++)if(i=r[o].nodeType,r[o]["s-hn"]!==t["s-hn"]||""!==s){if(1===i&&s===r[o].getAttribute("slot")){t.hidden=!0;break}}else if(1===i||3===i&&""!==r[o].textContent.trim()){t.hidden=!0;break}T(t)}},E=[],L=e=>{let t,l,o,s,i,r,c=0,f=e.childNodes,a=f.length;for(;c<a;c++){if(t=f[c],t["s-sr"]&&(l=t["s-cr"])&&l.parentNode)for(o=l.parentNode.childNodes,s=t["s-sn"],r=o.length-1;r>=0;r--)l=o[r],l["s-cn"]||l["s-nr"]||l["s-hn"]===t["s-hn"]||(W(l,s)?(i=E.find((e=>e.g===l)),n=!0,l["s-sn"]=l["s-sn"]||s,i?i.S=t:E.push({S:t,g:l}),l["s-sr"]&&E.map((e=>{W(e.g,l["s-sn"])&&(i=E.find((e=>e.g===l)),i&&!e.S&&(e.S=i.S))}))):E.some((e=>e.g===l))||E.push({g:l}));1===t.nodeType&&L(t)}},W=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,A=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(A)},F=e=>Y(e).j,H=(e,t,l)=>{const n=F(e);return{emit:e=>N(n,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},N=(e,t,l)=>{const n=c.ce(t,l);return e.dispatchEvent(n),n},U=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},q=(e,t)=>{if(e.t|=16,!(4&e.t))return U(e,e.M),$e((()=>D(e,t)));e.t|=512},D=(e,t)=>{const l=e.O;let n;return t&&(n=G(l,"componentWillLoad")),I(n,(()=>V(e,l,t)))},V=async(e,t,l)=>{const n=e.j,o=n["s-rc"];l&&(e=>{const t=e.C;((e,t)=>{let l=d(t),n=se.get(l);if(e=11===e.nodeType?e:r,n)if("string"==typeof n){let t,o=$.get(e=e.head||e);o||$.set(e,o=new Set),o.has(l)||(t=r.createElement("style"),t.innerHTML=n,e.insertBefore(t,e.querySelector("link")),o&&o.add(l))}else e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n])})(e.j.getRootNode(),t)})(e);_(e,t),o&&(o.map((e=>e())),n["s-rc"]=void 0);{const t=n["s-p"],l=()=>z(e);0===t.length?l():(Promise.all(t).then(l),e.t|=4,t.length=0)}},_=(s,i)=>{try{i=i.render(),s.t&=-17,s.t|=2,((s,i)=>{const f=s.j,a=s.C,u=s.R||m(null,null),$=(e=>e&&e.m===b)(i)?i:p(null,null,i);if(t=f.tagName,a.P&&($.u=$.u||{},a.P.map((([e,t])=>$.u[t]=f[e]))),$.m=null,$.t|=4,s.R=$,$.k=u.k=f,e=f["s-cr"],l=0!=(1&a.t),n=!1,P(u,$),c.t|=1,o){let e,t,l,n,o,s;L($.k);let i=0;for(;i<E.length;i++)e=E[i],t=e.g,t["s-ol"]||(l=r.createTextNode(""),l["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=l,t));for(i=0;i<E.length;i++)if(e=E[i],t=e.g,e.S){for(n=e.S.parentNode,o=e.S.nextSibling,l=t["s-ol"];l=l.previousSibling;)if(s=l["s-nr"],s&&s["s-sn"]===t["s-sn"]&&n===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&n!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),n.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}n&&T($.k),c.t&=-2,E.length=0})(s,i)}catch(e){le(e,s.j)}return null},z=e=>{const t=e.j,l=e.M;G(e.O,"componentDidRender"),64&e.t||(e.t|=64,J(t),e.T(t),l||B()),e.L(t),e.v&&(e.v(),e.v=void 0),512&e.t&&ue((()=>q(e,!1))),e.t&=-517},B=()=>{J(r.documentElement),ue((()=>N(i,"appload",{detail:{namespace:"twilight-components"}})))},G=(e,t,l)=>{if(e&&e[t])try{return e[t](l)}catch(e){le(e)}},I=(e,t)=>e&&e.then?e.then(t):t(),J=e=>e.classList.add("hydrated"),K=(e,t,l)=>{if(t.W){e.watchers&&(t.A=e.watchers);const n=Object.entries(t.W),o=e.prototype;if(n.map((([e,[n]])=>{31&n||2&l&&32&n?Object.defineProperty(o,e,{get(){return((e,t)=>Y(this).F.get(t))(0,e)},set(l){((e,t,l,n)=>{const o=Y(e),s=o.j,i=o.F.get(t),r=o.t,c=o.O;if(l=((e,t)=>null==e||h(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,n.W[t][0]),!(8&r&&void 0!==i||l===i)&&(o.F.set(t,l),c)){if(n.A&&128&r){const e=n.A[t];e&&e.map((e=>{try{c[e](l,i,t)}catch(e){le(e,s)}}))}2==(18&r)&&q(o,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0}):1&l&&64&n&&Object.defineProperty(o,e,{value(...t){const l=Y(this);return l.H.then((()=>l.O[e](...t)))}})})),1&l){const l=new Map;o.attributeChangedCallback=function(e,t,n){c.jmp((()=>{const t=l.get(e);this.hasOwnProperty(t)&&(n=this[t],delete this[t]),this[t]=(null!==n||"boolean"!=typeof this[t])&&n}))},e.observedAttributes=n.filter((([e,t])=>15&t[0])).map((([e,n])=>{const o=n[1]||e;return l.set(o,e),512&n[0]&&t.P.push([e,o]),o}))}}return e},Q=(e,t={})=>{const l=[],n=t.exclude||[],o=i.customElements,s=r.head,f=s.querySelector("meta[charset]"),u=r.createElement("style"),$=[];let y,h=!0;Object.assign(c,t),c.l=new URL(t.resourcesUrl||"./",r.baseURI).href,e.map((e=>e[1].map((t=>{const s={t:t[0],o:t[1],W:t[2],N:t[3]};s.W=t[2],s.P=[],s.A={};const i=s.o,f=class extends HTMLElement{constructor(e){super(e),ee(e=this,s)}connectedCallback(){y&&(clearTimeout(y),y=null),h?$.push(this):c.jmp((()=>(e=>{if(0==(1&c.t)){const t=Y(e),l=t.C,n=()=>{};if(!(1&t.t)){t.t|=1,12&l.t&&(e=>{const t=e["s-cr"]=r.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let l=e;for(;l=l.parentNode||l.host;)if(l["s-p"]){U(t,t.M=l);break}}l.W&&Object.entries(l.W).map((([t,[l]])=>{if(31&l&&e.hasOwnProperty(t)){const l=e[t];delete e[t],e[t]=l}})),(async(e,t,l,n,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=oe(l)).then){const e=()=>{};o=await o,e()}o.isProxied||(l.A=o.watchers,K(o,l,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){le(e)}t.t&=-9,t.t|=128,e()}if(o.style){let e=o.style;const t=d(l);if(!se.has(t)){const n=()=>{};((e,t,l)=>{let n=se.get(e);a&&l?(n=n||new CSSStyleSheet,n.replace(t)):n=t,se.set(e,n)})(t,e,!!(1&l.t)),n()}}}const s=t.M,i=()=>q(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,l)}n()}})(this)))}disconnectedCallback(){c.jmp((()=>{}))}componentOnReady(){return Y(this).U}};s.q=e[0],n.includes(i)||o.get(i)||(l.push(i),o.define(i,K(f,s,1)))})))),u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles",""),s.insertBefore(u,f?f.nextSibling:s.firstChild),h=!1,$.length?$.map((e=>e.connectedCallback())):c.jmp((()=>y=setTimeout(B,30)))},X=new WeakMap,Y=e=>X.get(e),Z=(e,t)=>X.set(t.O=e,t),ee=(e,t)=>{const l={t:0,j:e,C:t,F:new Map};return l.H=new Promise((e=>l.L=e)),l.U=new Promise((e=>l.T=e)),e["s-p"]=[],e["s-rc"]=[],X.set(e,l)},te=(e,t)=>t in e,le=(e,t)=>(0,console.error)(e,t),ne=new Map,oe=e=>{const t=e.o.replace(/-/g,"_"),l=e.q,n=ne.get(l);return n?n[t]:import(`./${l}.entry.js`).then((e=>(ne.set(l,e),e[t])),le)},se=new Map,ie=[],re=[],ce=(e,t)=>l=>{e.push(l),s||(s=!0,t&&4&c.t?ue(ae):c.raf(ae))},fe=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){le(e)}e.length=0},ae=()=>{fe(ie),fe(re),(s=ie.length>0)&&c.raf(ae)},ue=e=>f().then(e),$e=ce(re,!0);export{b as H,Q as b,H as c,F as g,p as h,f as p,Z as r}
@@ -1 +1 @@
1
- import{p as s,b as e}from"./p-9f9af3e0.js";(()=>{const e=import.meta.url,a={};return""!==e&&(a.resourcesUrl=new URL(".",e).href),s(a)})().then((s=>e([["p-840f0daa",[[0,"salla-login"],[4,"salla-modal",{error:[4],success:[4],visible:[516],subTitle:[1,"sub-title"],icon:[1]}]]],["p-1abaafe4",[[4,"salla-currency-language",{show:[64],hide:[64]}]]],["p-b134c95d",[[4,"salla-search",{searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"],searchTerm:[32],results:[32],fetchStatus:[32],showResult:[32],showModal:[32]}]]]],s)));
1
+ import{p as e,b as s}from"./p-d1ef2268.js";(()=>{const s=import.meta.url,o={};return""!==s&&(o.resourcesUrl=new URL(".",s).href),e(o)})().then((e=>s([["p-4cc11ee2",[[4,"salla-localization",{show:[64],hide:[64]}]]],["p-60f0446f",[[0,"order-rating",{order:[8]}]]],["p-baeca520",[[4,"salla-search",{searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"],searchTerm:[32],results:[32],fetchStatus:[32],showResult:[32],showModal:[32]}]]],["p-b72e6cfa",[[4,"salla-button",{kind:[513],loading:[516],load:[64],stop:[64],disable:[64],enable:[64]}]]],["p-b490f9e0",[[4,"multi-warehouse",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}],[0,"salla-login"],[4,"salla-modal",{error:[4],success:[4],isClosable:[1028,"is-closable"],modalWidth:[1,"modal-width"],visible:[516],subTitle:[1,"sub-title"],icon:[1],show:[64],hide:[64]}]]]],e)));
@@ -0,0 +1,23 @@
1
+ export declare class MultiWarehouse {
2
+ open: boolean;
3
+ selected: number;
4
+ isOpenedBefore: string;
5
+ position: string;
6
+ displayAs: string;
7
+ browseProductsFrom: string;
8
+ branches: any[];
9
+ current: number;
10
+ private modal;
11
+ host: HTMLElement;
12
+ constructor();
13
+ show(): Promise<HTMLElement>;
14
+ hide(): Promise<HTMLElement>;
15
+ private currentBranch;
16
+ private statusColor;
17
+ private isChoiceable;
18
+ private formTitle;
19
+ private handelChange;
20
+ private handleSubmit;
21
+ render(): any;
22
+ componentDidRender(): void;
23
+ }
@@ -0,0 +1,16 @@
1
+ export declare class OrderRating {
2
+ stars: Number[];
3
+ order: any;
4
+ ratingChain: Promise<void>;
5
+ render(): any;
6
+ renderProductsRating(): any;
7
+ renderStoreRating(): any;
8
+ renderShippingRating(): any;
9
+ getStarsRating(): any;
10
+ initiateRating(): void;
11
+ sendRating(): Promise<void>;
12
+ sendFeedback(type: any, formsData: any): void;
13
+ ratingValidation(): void;
14
+ highlightSelectedStars(): void;
15
+ starsRating(): void;
16
+ }
@@ -0,0 +1,15 @@
1
+ export declare class SallaButton {
2
+ constructor();
3
+ host: HTMLElement;
4
+ kind: string;
5
+ loading: boolean;
6
+ load(): Promise<HTMLElement>;
7
+ stop(): Promise<HTMLElement>;
8
+ disable(): Promise<void>;
9
+ enable(): Promise<void>;
10
+ private hostAttributes;
11
+ private btn;
12
+ handleVisible(newKind: string, oldKind: string): void;
13
+ handleLoading(newVal: boolean): void;
14
+ render(): any;
15
+ }
@@ -0,0 +1,10 @@
1
+ export declare class SallaLocalization {
2
+ constructor();
3
+ private modal;
4
+ private btn;
5
+ host: HTMLElement;
6
+ show(): Promise<HTMLElement>;
7
+ hide(): Promise<HTMLElement>;
8
+ private submit;
9
+ render(): any;
10
+ }