easyorders 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -93
- package/dist/bin/cli.js +12 -5
- package/dist/template/theme/config.json +113 -95
- package/dist/template/theme/home-sections/Tilted-Scrolling-Marque/config.json +107 -0
- package/dist/template/theme/home-sections/Tilted-Scrolling-Marque/template.liquid +171 -0
- package/dist/template/theme/home-sections/category-mosaic/config.json +89 -4
- package/dist/template/theme/home-sections/category-mosaic/template.liquid +84 -69
- package/dist/template/theme/home-sections/different-hero/config.json +199 -0
- package/dist/template/theme/home-sections/different-hero/template.liquid +219 -0
- package/dist/template/theme/home-sections/editorial-feature/config.json +27 -1
- package/dist/template/theme/home-sections/editorial-feature/template.liquid +11 -10
- package/dist/template/theme/home-sections/newsletter-luxe/config.json +28 -2
- package/dist/template/theme/home-sections/newsletter-luxe/template.liquid +19 -13
- package/dist/template/theme/home-sections/runway-hero/config.json +87 -30
- package/dist/template/theme/home-sections/runway-hero/template.liquid +59 -29
- package/dist/template/theme/home-sections/shop-the-look/config.json +93 -1
- package/dist/template/theme/home-sections/shop-the-look/template.liquid +41 -19
- package/dist/template/theme/home-sections/slider-before-after/config.json +213 -0
- package/dist/template/theme/home-sections/slider-before-after/template.liquid +336 -0
- package/dist/template/theme/home-sections/test-hero-allbird/config.json +130 -0
- package/dist/template/theme/home-sections/test-hero-allbird/template.liquid +149 -0
- package/dist/template/theme/home-sections/trust-promise/config.json +76 -2
- package/dist/template/theme/home-sections/trust-promise/template.liquid +119 -96
- package/dist/template/theme/home-sections/zoom-parallax/config.json +48 -0
- package/dist/template/theme/home-sections/zoom-parallax/template.liquid +135 -0
- package/dist/template/theme/product-data-schema.json +27 -0
- package/dist/template/theme/schema.json +136 -151
- package/dist/template/theme/script.js +1095 -586
- package/dist/template/theme/sections/breadcrumbs.liquid +17 -17
- package/dist/template/theme/sections/categories.liquid +26 -10
- package/dist/template/theme/sections/fake-counter.liquid +27 -27
- package/dist/template/theme/sections/fake-stock.liquid +6 -6
- package/dist/template/theme/sections/fake-visitor.liquid +6 -6
- package/dist/template/theme/sections/featured-products.liquid +143 -110
- package/dist/template/theme/sections/fixed-buy-button.liquid +51 -46
- package/dist/template/theme/sections/footer.liquid +128 -129
- package/dist/template/theme/sections/gallery.liquid +65 -61
- package/dist/template/theme/sections/header.liquid +232 -152
- package/dist/template/theme/sections/home-products-grid.liquid +167 -109
- package/dist/template/theme/sections/list-products.liquid +136 -93
- package/dist/template/theme/sections/order-invoice.liquid +102 -154
- package/dist/template/theme/sections/product-description.liquid +40 -30
- package/dist/template/theme/sections/product-details.liquid +48 -63
- package/dist/template/theme/sections/products-grid.liquid +134 -86
- package/dist/template/theme/sections/related-products.liquid +152 -88
- package/dist/template/theme/sections/reviews.liquid +70 -55
- package/dist/template/theme/sections/slider.liquid +43 -43
- package/dist/template/theme/sections/thanks.liquid +33 -33
- package/dist/template/theme/style.css +5617 -3923
- package/dist/template/theme/theme-data.json +26 -9
- package/package.json +40 -40
|
@@ -1,586 +1,1095 @@
|
|
|
1
|
-
!(function () {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
window.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
e.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
e.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
t
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
t.
|
|
372
|
-
t
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
"
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
.
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
.
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
1
|
+
!(function () {
|
|
2
|
+
var EO_STORE_API_FALLBACK = "https://api.easy-orders.net/api/v1";
|
|
3
|
+
function e() {
|
|
4
|
+
var e = document.querySelector(".ab-header");
|
|
5
|
+
if (e && !e.dataset.scrollInit) {
|
|
6
|
+
e.dataset.scrollInit = "1";
|
|
7
|
+
var t = window.scrollY;
|
|
8
|
+
window.addEventListener(
|
|
9
|
+
"scroll",
|
|
10
|
+
function () {
|
|
11
|
+
var a = window.scrollY;
|
|
12
|
+
Math.abs(a - t) < 5 ||
|
|
13
|
+
(a > t && a > 100
|
|
14
|
+
? e.classList.add("ab-hidden")
|
|
15
|
+
: e.classList.remove("ab-hidden"),
|
|
16
|
+
(t = a));
|
|
17
|
+
},
|
|
18
|
+
{ passive: !0 }
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function t() {
|
|
23
|
+
var e = document.getElementById("eo-menu-btn"),
|
|
24
|
+
t = document.getElementById("eo-mobile-menu"),
|
|
25
|
+
a = document.getElementById("eo-mobile-overlay"),
|
|
26
|
+
n = document.getElementById("eo-mobile-close");
|
|
27
|
+
function r() {
|
|
28
|
+
t.classList.remove("ab-open"),
|
|
29
|
+
a && a.classList.remove("ab-open"),
|
|
30
|
+
(document.body.style.overflow = "");
|
|
31
|
+
}
|
|
32
|
+
e &&
|
|
33
|
+
t &&
|
|
34
|
+
!e.dataset.menuInit &&
|
|
35
|
+
((e.dataset.menuInit = "1"),
|
|
36
|
+
e.addEventListener("click", function () {
|
|
37
|
+
t.classList.add("ab-open"),
|
|
38
|
+
a && a.classList.add("ab-open"),
|
|
39
|
+
(document.body.style.overflow = "hidden");
|
|
40
|
+
}),
|
|
41
|
+
n && n.addEventListener("click", r),
|
|
42
|
+
a && a.addEventListener("click", r),
|
|
43
|
+
t.querySelectorAll(".ab-mobile-nav > a").forEach(function (e) {
|
|
44
|
+
e.addEventListener("click", r);
|
|
45
|
+
}),
|
|
46
|
+
t.querySelectorAll(".ab-mobile-accordion-panel a").forEach(function (e) {
|
|
47
|
+
e.addEventListener("click", r);
|
|
48
|
+
}),
|
|
49
|
+
t.querySelectorAll(".ab-mobile-accordion-trigger").forEach(function (e) {
|
|
50
|
+
e.dataset.accordionInit ||
|
|
51
|
+
((e.dataset.accordionInit = "1"),
|
|
52
|
+
e.addEventListener("click", function () {
|
|
53
|
+
var a = e.closest(".ab-mobile-accordion");
|
|
54
|
+
if (a) {
|
|
55
|
+
var n = a.classList.contains("ab-open");
|
|
56
|
+
t.querySelectorAll(".ab-mobile-accordion.ab-open").forEach(function (e) {
|
|
57
|
+
e !== a && e.classList.remove("ab-open");
|
|
58
|
+
}),
|
|
59
|
+
a.classList.toggle("ab-open", !n);
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
function a() {
|
|
65
|
+
document.querySelectorAll(".ab-plist").forEach(function (e) {
|
|
66
|
+
if (!e.dataset.scrollArrowInit) {
|
|
67
|
+
e.dataset.scrollArrowInit = "1";
|
|
68
|
+
var t = e.querySelector(".ab-plist-track"),
|
|
69
|
+
a = e.querySelector(".ab-plist-prev"),
|
|
70
|
+
n = e.querySelector(".ab-plist-next");
|
|
71
|
+
t &&
|
|
72
|
+
(a &&
|
|
73
|
+
a.addEventListener("click", function () {
|
|
74
|
+
t.scrollBy({ left: -r(), behavior: "smooth" });
|
|
75
|
+
}),
|
|
76
|
+
n &&
|
|
77
|
+
n.addEventListener("click", function () {
|
|
78
|
+
t.scrollBy({ left: r(), behavior: "smooth" });
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
function r() {
|
|
82
|
+
var e = t.querySelector(".ab-plist-card");
|
|
83
|
+
if (!e) return 0.8 * t.clientWidth;
|
|
84
|
+
var a = getComputedStyle(t),
|
|
85
|
+
n = parseFloat(a.gap) || 16;
|
|
86
|
+
return e.offsetWidth + n;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function n() {
|
|
91
|
+
document.querySelectorAll(".ab-slider").forEach(function (e) {
|
|
92
|
+
if (!e.dataset.sliderInit) {
|
|
93
|
+
e.dataset.sliderInit = "1";
|
|
94
|
+
var t = e.querySelectorAll(".ab-slider-slide");
|
|
95
|
+
if (!(t.length < 2)) {
|
|
96
|
+
var a = e.querySelector(".ab-slider-progress-bar"),
|
|
97
|
+
n = e.querySelector(".ab-slider-pause"),
|
|
98
|
+
r = parseInt(e.dataset.autoplay) || 5e3,
|
|
99
|
+
o = 0,
|
|
100
|
+
i = !1,
|
|
101
|
+
c = 0,
|
|
102
|
+
l = null;
|
|
103
|
+
n &&
|
|
104
|
+
n.addEventListener("click", function () {
|
|
105
|
+
i
|
|
106
|
+
? d()
|
|
107
|
+
: ((i = !0), e.classList.add("ab-paused"), l && cancelAnimationFrame(l));
|
|
108
|
+
}),
|
|
109
|
+
d();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function s(e) {
|
|
113
|
+
if (!i) {
|
|
114
|
+
var n,
|
|
115
|
+
d = e - c,
|
|
116
|
+
u = Math.min((d / r) * 100, 100);
|
|
117
|
+
a && (a.style.width = u + "%"),
|
|
118
|
+
d >= r &&
|
|
119
|
+
((n = o + 1),
|
|
120
|
+
t[o].classList.remove("ab-active"),
|
|
121
|
+
(o = n % t.length),
|
|
122
|
+
t[o].classList.add("ab-active"),
|
|
123
|
+
(c = performance.now())),
|
|
124
|
+
(l = requestAnimationFrame(s));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function d() {
|
|
128
|
+
(i = !1),
|
|
129
|
+
e.classList.remove("ab-paused"),
|
|
130
|
+
(c = performance.now()),
|
|
131
|
+
(l = requestAnimationFrame(s));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function r() {
|
|
136
|
+
var e = document.querySelectorAll(".ab-reveal:not(.ab-observed)");
|
|
137
|
+
if (e.length) {
|
|
138
|
+
var t = new IntersectionObserver(
|
|
139
|
+
function (e) {
|
|
140
|
+
e.forEach(function (e) {
|
|
141
|
+
e.isIntersecting &&
|
|
142
|
+
(e.target.classList.add("ab-visible"), t.unobserve(e.target));
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
{ threshold: 0.1 }
|
|
146
|
+
);
|
|
147
|
+
e.forEach(function (e) {
|
|
148
|
+
e.classList.add("ab-observed"), t.observe(e);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function runwayAnim() {
|
|
153
|
+
document.querySelectorAll("[data-section-anim]:not(.ab-anim-init)").forEach(function (h) {
|
|
154
|
+
h.classList.add("ab-anim-init");
|
|
155
|
+
if (!("IntersectionObserver" in window)) {
|
|
156
|
+
h.classList.add("ab-anim-visible");
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
var io = new IntersectionObserver(function (entries) {
|
|
160
|
+
entries.forEach(function (entry) {
|
|
161
|
+
if (entry.isIntersecting) {
|
|
162
|
+
entry.target.classList.add("ab-anim-visible");
|
|
163
|
+
io.unobserve(entry.target);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}, { threshold: 0.15 });
|
|
167
|
+
io.observe(h);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function o() {
|
|
171
|
+
document.querySelectorAll(".ab-gallery").forEach(function (el) {
|
|
172
|
+
if (el.dataset.galleryInit) return;
|
|
173
|
+
el.dataset.galleryInit = "1";
|
|
174
|
+
var track = el.querySelector("[data-gallery-track]"),
|
|
175
|
+
slides = el.querySelectorAll(".ab-gallery-slide"),
|
|
176
|
+
dots = el.querySelectorAll(".ab-gallery-dot"),
|
|
177
|
+
srcs = [];
|
|
178
|
+
slides.forEach(function (s) {
|
|
179
|
+
if (s.dataset.src) srcs.push(s.dataset.src);
|
|
180
|
+
});
|
|
181
|
+
document.querySelectorAll("body > .ab-lightbox").forEach(function (e) {
|
|
182
|
+
e.remove();
|
|
183
|
+
});
|
|
184
|
+
var lb = el.querySelector("[data-lightbox]");
|
|
185
|
+
if (lb) document.body.appendChild(lb);
|
|
186
|
+
var lbImg = lb && lb.querySelector("[data-lightbox-img]"),
|
|
187
|
+
lbVideo = lb && lb.querySelector("[data-lightbox-video]"),
|
|
188
|
+
lbCnt = lb && lb.querySelector("[data-lightbox-counter]"),
|
|
189
|
+
idx = 0;
|
|
190
|
+
function isVideoSrc(u) {
|
|
191
|
+
if (!u) return false;
|
|
192
|
+
var p = u.split("?")[0].toLowerCase();
|
|
193
|
+
return p.endsWith(".mp4") || p.endsWith(".webm") || p.endsWith(".ogg");
|
|
194
|
+
}
|
|
195
|
+
function stopLbVideo() {
|
|
196
|
+
if (!lbVideo) return;
|
|
197
|
+
lbVideo.pause();
|
|
198
|
+
lbVideo.removeAttribute("src");
|
|
199
|
+
lbVideo.load();
|
|
200
|
+
lbVideo.style.display = "none";
|
|
201
|
+
}
|
|
202
|
+
function show(i) {
|
|
203
|
+
if (!srcs.length) return;
|
|
204
|
+
idx = ((i % srcs.length) + srcs.length) % srcs.length;
|
|
205
|
+
var url = srcs[idx];
|
|
206
|
+
if (isVideoSrc(url)) {
|
|
207
|
+
if (lbImg) { lbImg.removeAttribute("src"); lbImg.style.display = "none"; }
|
|
208
|
+
if (lbVideo) { lbVideo.style.display = "block"; lbVideo.src = url; lbVideo.play().catch(function(){}); }
|
|
209
|
+
} else {
|
|
210
|
+
stopLbVideo();
|
|
211
|
+
if (lbImg) { lbImg.style.display = ""; lbImg.src = url; }
|
|
212
|
+
}
|
|
213
|
+
if (lbCnt) lbCnt.textContent = idx + 1 + " / " + srcs.length;
|
|
214
|
+
}
|
|
215
|
+
slides.forEach(function (s) {
|
|
216
|
+
s.addEventListener("click", function () {
|
|
217
|
+
if (!lb) return;
|
|
218
|
+
var v = s.querySelector("video");
|
|
219
|
+
if (v) v.pause();
|
|
220
|
+
show(Number(s.dataset.slideIndex) || 0);
|
|
221
|
+
lb.classList.add("ab-open");
|
|
222
|
+
document.body.style.overflow = "hidden";
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
if (lb)
|
|
226
|
+
lb.addEventListener("click", function (e) {
|
|
227
|
+
var t = e.target;
|
|
228
|
+
if (t.closest("[data-lightbox-close]")) {
|
|
229
|
+
stopLbVideo();
|
|
230
|
+
lb.classList.remove("ab-open");
|
|
231
|
+
document.body.style.overflow = "";
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (t.closest("[data-lightbox-prev]")) show(idx - 1);
|
|
235
|
+
else if (t.closest("[data-lightbox-next]")) show(idx + 1);
|
|
236
|
+
});
|
|
237
|
+
dots.forEach(function (d) {
|
|
238
|
+
d.addEventListener("click", function () {
|
|
239
|
+
var i = Number(d.dataset.dotIndex) || 0,
|
|
240
|
+
s = slides[i];
|
|
241
|
+
if (track && s)
|
|
242
|
+
track.scrollTo({ left: s.offsetLeft, behavior: "smooth" });
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
if (track && dots.length) {
|
|
246
|
+
var ticking = false;
|
|
247
|
+
track.addEventListener(
|
|
248
|
+
"scroll",
|
|
249
|
+
function () {
|
|
250
|
+
if (ticking) return;
|
|
251
|
+
ticking = true;
|
|
252
|
+
requestAnimationFrame(function () {
|
|
253
|
+
ticking = false;
|
|
254
|
+
var w = track.clientWidth;
|
|
255
|
+
if (!w) return;
|
|
256
|
+
var i = Math.round(track.scrollLeft / w);
|
|
257
|
+
dots.forEach(function (d, j) {
|
|
258
|
+
d.classList.toggle("ab-active", j === i);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
{ passive: true }
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function i() {
|
|
268
|
+
document.querySelectorAll(".ab-reviews").forEach(function (e) {
|
|
269
|
+
e.getAttribute("data-reviews-init") ||
|
|
270
|
+
(e.setAttribute("data-reviews-init", "1"),
|
|
271
|
+
e.querySelectorAll("[data-review-comment]").forEach(function (e) {
|
|
272
|
+
var t = document.createElement("button");
|
|
273
|
+
(t.className = "ab-review-read-more"),
|
|
274
|
+
(t.type = "button"),
|
|
275
|
+
(t.textContent = "...Read more"),
|
|
276
|
+
e.parentNode.insertBefore(t, e.nextSibling),
|
|
277
|
+
requestAnimationFrame(function () {
|
|
278
|
+
e.scrollHeight > e.clientHeight + 2 && t.classList.add("ab-visible");
|
|
279
|
+
}),
|
|
280
|
+
t.addEventListener("click", function () {
|
|
281
|
+
e.classList.contains("ab-review-expanded")
|
|
282
|
+
? (e.classList.remove("ab-review-expanded"),
|
|
283
|
+
(t.textContent = "...Read more"))
|
|
284
|
+
: (e.classList.add("ab-review-expanded"), (t.textContent = "Show less"));
|
|
285
|
+
});
|
|
286
|
+
}));
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
function c() {
|
|
290
|
+
for (
|
|
291
|
+
var e = document.querySelectorAll(".ab-fake-counter"), t = 0;
|
|
292
|
+
t < e.length;
|
|
293
|
+
t++
|
|
294
|
+
) {
|
|
295
|
+
var a = e[t];
|
|
296
|
+
a.dataset.counterInit ||
|
|
297
|
+
((a.dataset.counterInit = "1"),
|
|
298
|
+
(function (e) {
|
|
299
|
+
var t = e.dataset.productId || "",
|
|
300
|
+
a = 36e5 * (parseFloat(e.dataset.hours) || 1);
|
|
301
|
+
try {
|
|
302
|
+
var n = localStorage.getItem("counter-" + t);
|
|
303
|
+
n && Number(n) > 36e4 && (a = Number(n));
|
|
304
|
+
} catch (e) {}
|
|
305
|
+
var r = Date.now() + a,
|
|
306
|
+
o = e.querySelector('[data-unit="days"]'),
|
|
307
|
+
i = e.querySelector('[data-unit="hours"]'),
|
|
308
|
+
c = e.querySelector('[data-unit="minutes"]'),
|
|
309
|
+
l = e.querySelector('[data-unit="seconds"]');
|
|
310
|
+
function s(e) {
|
|
311
|
+
return e < 10 ? "0" + e : String(e);
|
|
312
|
+
}
|
|
313
|
+
!(function e() {
|
|
314
|
+
var a = Math.max(0, r - Date.now()),
|
|
315
|
+
n = Math.floor(a / 1e3),
|
|
316
|
+
d = Math.floor(n / 86400);
|
|
317
|
+
n -= 86400 * d;
|
|
318
|
+
var u = Math.floor(n / 3600);
|
|
319
|
+
n -= 3600 * u;
|
|
320
|
+
var v = Math.floor(n / 60);
|
|
321
|
+
(n -= 60 * v),
|
|
322
|
+
o && (o.textContent = s(d)),
|
|
323
|
+
i && (i.textContent = s(u)),
|
|
324
|
+
c && (c.textContent = s(v)),
|
|
325
|
+
l && (l.textContent = s(n));
|
|
326
|
+
try {
|
|
327
|
+
localStorage.setItem("counter-" + t, String(a));
|
|
328
|
+
} catch (e) {}
|
|
329
|
+
a > 0 &&
|
|
330
|
+
requestAnimationFrame(function () {
|
|
331
|
+
setTimeout(e, 1e3);
|
|
332
|
+
});
|
|
333
|
+
})();
|
|
334
|
+
})(a));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function l() {
|
|
338
|
+
for (
|
|
339
|
+
var e = document.querySelectorAll(".ab-fake-visitor"), t = 0;
|
|
340
|
+
t < e.length;
|
|
341
|
+
t++
|
|
342
|
+
) {
|
|
343
|
+
var a = e[t];
|
|
344
|
+
a.dataset.visitorInit ||
|
|
345
|
+
((a.dataset.visitorInit = "1"),
|
|
346
|
+
(function (e) {
|
|
347
|
+
var t = parseInt(e.dataset.min, 10) || 10,
|
|
348
|
+
a = parseInt(e.dataset.max, 10) || 50,
|
|
349
|
+
n = e.querySelector(".ab-fv-count");
|
|
350
|
+
function r() {
|
|
351
|
+
return Math.floor(Math.random() * (a - t + 1)) + t;
|
|
352
|
+
}
|
|
353
|
+
n &&
|
|
354
|
+
((n.textContent = String(r())),
|
|
355
|
+
setInterval(function () {
|
|
356
|
+
n.textContent = String(r());
|
|
357
|
+
}, 3e3));
|
|
358
|
+
})(a));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function s() {
|
|
362
|
+
for (
|
|
363
|
+
var e = document.querySelectorAll(".lq-desc-accordion"), t = 0;
|
|
364
|
+
t < e.length;
|
|
365
|
+
t++
|
|
366
|
+
) {
|
|
367
|
+
var a = e[t];
|
|
368
|
+
a.dataset.descInit ||
|
|
369
|
+
((a.dataset.descInit = "1"),
|
|
370
|
+
a.addEventListener("click", function (e) {
|
|
371
|
+
var t = e.target.closest(".lq-desc-toggle");
|
|
372
|
+
if (t) {
|
|
373
|
+
var a = t.parentElement,
|
|
374
|
+
n = a.querySelector(".lq-desc-panel");
|
|
375
|
+
if (n)
|
|
376
|
+
"true" === a.getAttribute("data-open")
|
|
377
|
+
? (a.removeAttribute("data-open"),
|
|
378
|
+
t.setAttribute("aria-expanded", "false"),
|
|
379
|
+
(n.style.display = "none"))
|
|
380
|
+
: (a.setAttribute("data-open", "true"),
|
|
381
|
+
t.setAttribute("aria-expanded", "true"),
|
|
382
|
+
(n.style.display = "block"));
|
|
383
|
+
}
|
|
384
|
+
}));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function u() {
|
|
388
|
+
document
|
|
389
|
+
.querySelectorAll('.ab-announce[data-ann-type="slider"]')
|
|
390
|
+
.forEach(function (e) {
|
|
391
|
+
if (!e.dataset.annSliderInit) {
|
|
392
|
+
e.dataset.annSliderInit = "1";
|
|
393
|
+
var t = e.querySelectorAll(".ab-ann-slide");
|
|
394
|
+
if (t.length < 2) return;
|
|
395
|
+
var a = 0;
|
|
396
|
+
setInterval(function () {
|
|
397
|
+
var n = t[a],
|
|
398
|
+
next = (a + 1) % t.length;
|
|
399
|
+
n.classList.remove("ab-active");
|
|
400
|
+
n.classList.add("ab-exit-left");
|
|
401
|
+
t[next].classList.add("ab-active");
|
|
402
|
+
setTimeout(function () {
|
|
403
|
+
n.classList.remove("ab-exit-left");
|
|
404
|
+
}, 500);
|
|
405
|
+
a = next;
|
|
406
|
+
}, 3e3);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
function v() {
|
|
411
|
+
document.querySelectorAll(".ab-ann-marquee").forEach(function (e) {
|
|
412
|
+
if (!e.dataset.marqueeInit) {
|
|
413
|
+
e.dataset.marqueeInit = "1";
|
|
414
|
+
var t = e.querySelector(".ab-ann-marquee-track");
|
|
415
|
+
if (!t) return;
|
|
416
|
+
var isArabic = !!e.closest(".ab-announce--arabic");
|
|
417
|
+
var a = t.innerHTML,
|
|
418
|
+
n = t.scrollWidth,
|
|
419
|
+
r = e.offsetWidth;
|
|
420
|
+
if (n < 1) return;
|
|
421
|
+
var o = Math.ceil((2 * r) / n);
|
|
422
|
+
if (o < 2) o = 2;
|
|
423
|
+
t.innerHTML = "";
|
|
424
|
+
for (var i = 0; i < o; i++) t.insertAdjacentHTML("beforeend", a);
|
|
425
|
+
var c = t.scrollWidth / o,
|
|
426
|
+
l = Math.max(c / 40, 5);
|
|
427
|
+
t.style.setProperty("--marquee-dur", l + "s"),
|
|
428
|
+
t.style.setProperty("--marquee-offset", (isArabic ? c : -c) + "px"),
|
|
429
|
+
t.classList.add("ab-running");
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
function w() {
|
|
434
|
+
document.querySelectorAll(".ab-comparison-slider").forEach(function (slider) {
|
|
435
|
+
if (slider.dataset.compInit) return;
|
|
436
|
+
slider.dataset.compInit = "1";
|
|
437
|
+
var range = slider.querySelector(".ab-comp-range"),
|
|
438
|
+
before = slider.querySelector(".ab-before-image"),
|
|
439
|
+
handle = slider.querySelector(".ab-comp-handle");
|
|
440
|
+
if (!range || !before || !handle) return;
|
|
441
|
+
range.style.pointerEvents = "none";
|
|
442
|
+
function setPosition(val) {
|
|
443
|
+
var t = Math.max(0, Math.min(100, Number(val) || 0));
|
|
444
|
+
range.value = String(t);
|
|
445
|
+
before.style.clipPath = "inset(0 " + (100 - t) + "% 0 0)";
|
|
446
|
+
handle.style.left = t + "%";
|
|
447
|
+
handle.style.top = "";
|
|
448
|
+
handle.style.transform = "translateX(-50%)";
|
|
449
|
+
}
|
|
450
|
+
setPosition(Number(range.value) || 50);
|
|
451
|
+
range.addEventListener("input", function (ev) {
|
|
452
|
+
setPosition(ev.target.value);
|
|
453
|
+
});
|
|
454
|
+
function updateFromClient(clientX, clientY) {
|
|
455
|
+
var rect = slider.getBoundingClientRect();
|
|
456
|
+
if (rect.width <= 0 || rect.height <= 0) return;
|
|
457
|
+
var t = ((clientX - rect.left) / rect.width) * 100;
|
|
458
|
+
setPosition(t);
|
|
459
|
+
}
|
|
460
|
+
var dragPid = null;
|
|
461
|
+
handle.addEventListener("pointerdown", function (ev) {
|
|
462
|
+
if (ev.pointerType === "mouse" && ev.button !== 0) return;
|
|
463
|
+
dragPid = ev.pointerId;
|
|
464
|
+
try {
|
|
465
|
+
slider.setPointerCapture(ev.pointerId);
|
|
466
|
+
} catch (err) {}
|
|
467
|
+
updateFromClient(ev.clientX, ev.clientY);
|
|
468
|
+
});
|
|
469
|
+
slider.addEventListener("pointermove", function (ev) {
|
|
470
|
+
if (dragPid !== ev.pointerId) return;
|
|
471
|
+
updateFromClient(ev.clientX, ev.clientY);
|
|
472
|
+
});
|
|
473
|
+
function endDrag(ev) {
|
|
474
|
+
if (dragPid !== ev.pointerId) return;
|
|
475
|
+
try {
|
|
476
|
+
slider.releasePointerCapture(ev.pointerId);
|
|
477
|
+
} catch (err) {}
|
|
478
|
+
dragPid = null;
|
|
479
|
+
}
|
|
480
|
+
slider.addEventListener("pointerup", endDrag);
|
|
481
|
+
slider.addEventListener("pointercancel", endDrag);
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
function moveStockToAccordion() {
|
|
485
|
+
const stockElement = document.querySelector('.ab-fake-visitor');
|
|
486
|
+
const accordionElement = document.querySelector('.mt-5.flex.flex-col.flex-col-reverse.gap-3');
|
|
487
|
+
|
|
488
|
+
// غيرنا previous لـ next عشان نتأكد إنه مش موجود "بعد" العنصر بالفعل
|
|
489
|
+
if (stockElement && accordionElement && !accordionElement.nextElementSibling?.classList.contains('stock-moved')) {
|
|
490
|
+
|
|
491
|
+
stockElement.classList.add('stock-moved');
|
|
492
|
+
|
|
493
|
+
// الدالة دي بتحط العنصر بعد الـ accordionElement مباشرة
|
|
494
|
+
accordionElement.after(stockElement);
|
|
495
|
+
|
|
496
|
+
stockElement.style.marginTop = '8px';
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
function restructureCartCounter() {
|
|
500
|
+
document.querySelectorAll('.cart-item-quantity-counter').forEach((container) => {
|
|
501
|
+
if (container.querySelector('.qty-box-wrapper')) return;
|
|
502
|
+
const deleteBtn = container.querySelector('button.ms-2');
|
|
503
|
+
if (!deleteBtn) return;
|
|
504
|
+
const qtyWrapper = document.createElement('div');
|
|
505
|
+
qtyWrapper.className = 'qty-box-wrapper';
|
|
506
|
+
Array.from(container.childNodes).forEach(node => {
|
|
507
|
+
if (node !== deleteBtn) {
|
|
508
|
+
qtyWrapper.appendChild(node);
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
container.innerHTML = '';
|
|
512
|
+
container.appendChild(qtyWrapper);
|
|
513
|
+
container.appendChild(deleteBtn);
|
|
514
|
+
container.classList.add('flex-split-layout');
|
|
515
|
+
deleteBtn.classList.add('custom-trash-btn');
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
function syncArabicUiDirection() {
|
|
519
|
+
const el = document.getElementById("__NEXT_DATA__");
|
|
520
|
+
let lang = "en";
|
|
521
|
+
if (el) {
|
|
522
|
+
try {
|
|
523
|
+
const data = JSON.parse(el.textContent);
|
|
524
|
+
lang =
|
|
525
|
+
data?.props?.pageProps?.appSettings?.lang ||
|
|
526
|
+
data?.props?.pageProps?.locale ||
|
|
527
|
+
"en";
|
|
528
|
+
} catch (e) {}
|
|
529
|
+
}
|
|
530
|
+
lang = String(lang || "en")
|
|
531
|
+
.toLowerCase()
|
|
532
|
+
.split("-")[0];
|
|
533
|
+
const isArabic = lang === "ar";
|
|
534
|
+
document.documentElement.classList.toggle("ab-lang-ar", isArabic);
|
|
535
|
+
if (document.body) {
|
|
536
|
+
document.body.classList.toggle("ab-lang-ar", isArabic);
|
|
537
|
+
}
|
|
538
|
+
document.querySelectorAll(".ab-pd-star-half").forEach((star) => {
|
|
539
|
+
star.style.transform = isArabic ? "scaleX(-1)" : "";
|
|
540
|
+
star.style.transformOrigin = isArabic ? "center" : "";
|
|
541
|
+
});
|
|
542
|
+
document.querySelectorAll(".ab-footer-subscribe-btn svg").forEach((icon) => {
|
|
543
|
+
icon.style.transform = isArabic ? "scaleX(-1)" : "";
|
|
544
|
+
icon.style.transformOrigin = isArabic ? "center" : "";
|
|
545
|
+
});
|
|
546
|
+
document.querySelectorAll(".ab-mobile-nav > a svg").forEach((icon) => {
|
|
547
|
+
icon.style.transform = isArabic ? "scaleX(-1)" : "";
|
|
548
|
+
icon.style.transformOrigin = isArabic ? "center" : "";
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
function updateReviewTitle() {
|
|
552
|
+
const el = document.getElementById('__NEXT_DATA__');
|
|
553
|
+
if (!el) return;
|
|
554
|
+
|
|
555
|
+
let lang = 'en';
|
|
556
|
+
try {
|
|
557
|
+
const data = JSON.parse(el.textContent);
|
|
558
|
+
lang =
|
|
559
|
+
data?.props?.pageProps?.appSettings?.lang ||
|
|
560
|
+
data?.props?.pageProps?.locale ||
|
|
561
|
+
'en';
|
|
562
|
+
} catch (e) {
|
|
563
|
+
console.error("Error parsing __NEXT_DATA__", e);
|
|
564
|
+
}
|
|
565
|
+
lang = String(lang || 'en').toLowerCase().split('-')[0];
|
|
566
|
+
|
|
567
|
+
const titles = {
|
|
568
|
+
'ar': 'آراء لعملائنا',
|
|
569
|
+
'fr': 'Véritables avis clients',
|
|
570
|
+
'es': 'Opiniones reales',
|
|
571
|
+
'en': 'Join our happy customers'
|
|
572
|
+
};
|
|
573
|
+
const verifiedLabels = {
|
|
574
|
+
'ar': 'مشتري موثّق',
|
|
575
|
+
'fr': 'Acheteur vérifié',
|
|
576
|
+
'es': 'Comprador verificado',
|
|
577
|
+
'en': 'Verified Buyer'
|
|
578
|
+
};
|
|
579
|
+
const addToCartLabels = {
|
|
580
|
+
'ar': 'أضف إلى السلة',
|
|
581
|
+
'fr': 'Ajouter au panier',
|
|
582
|
+
'es': 'Agregar al carrito',
|
|
583
|
+
'en': 'ADD TO CART'
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
const newTitle = titles[lang] || titles['en'];
|
|
587
|
+
const newVerifiedLabel = verifiedLabels[lang] || verifiedLabels['en'];
|
|
588
|
+
const newAddToCartLabel = addToCartLabels[lang] || addToCartLabels['en'];
|
|
589
|
+
const titleElement = document.querySelector('.ab-reviews-title');
|
|
590
|
+
if (titleElement && titleElement.innerText !== newTitle) {
|
|
591
|
+
titleElement.innerText = newTitle;
|
|
592
|
+
}
|
|
593
|
+
document.querySelectorAll('.verified-badge').forEach((badge) => {
|
|
594
|
+
if (badge.innerText !== newVerifiedLabel) {
|
|
595
|
+
badge.innerText = newVerifiedLabel;
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
document.querySelectorAll('.ab-pgrid-cta-label').forEach((label) => {
|
|
599
|
+
if (label.innerText !== newAddToCartLabel) {
|
|
600
|
+
label.innerText = newAddToCartLabel;
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
document.querySelectorAll('.ab-pgrid-cta').forEach((btn) => {
|
|
604
|
+
btn.setAttribute('aria-label', newAddToCartLabel);
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
function updateCartButtonText() {
|
|
608
|
+
const el = document.getElementById("__NEXT_DATA__");
|
|
609
|
+
let lang = "en";
|
|
610
|
+
if (el) {
|
|
611
|
+
try {
|
|
612
|
+
const data = JSON.parse(el.textContent);
|
|
613
|
+
lang =
|
|
614
|
+
data?.props?.pageProps?.appSettings?.lang ||
|
|
615
|
+
data?.props?.pageProps?.locale ||
|
|
616
|
+
"en";
|
|
617
|
+
} catch (e) {
|
|
618
|
+
console.error("Error parsing __NEXT_DATA__ for checkout locale", e);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
lang = String(lang || "en")
|
|
622
|
+
.toLowerCase()
|
|
623
|
+
.split("-")[0];
|
|
624
|
+
|
|
625
|
+
const cartLabels = {
|
|
626
|
+
ar: "إتمام الشراء",
|
|
627
|
+
en: "CHECK OUT",
|
|
628
|
+
fr: "Payer",
|
|
629
|
+
es: "Finalizar compra",
|
|
630
|
+
};
|
|
631
|
+
const shippingNotes = {
|
|
632
|
+
ar: "يتم احتساب الشحن والخصم عند إتمام الطلب.",
|
|
633
|
+
en: "Shipping and discount calculated at checkout.",
|
|
634
|
+
fr: "Frais de port et remise calculés au paiement.",
|
|
635
|
+
es: "Envío y descuento calculados al finalizar la compra.",
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
const cartText = cartLabels[lang] || cartLabels.en;
|
|
639
|
+
const shippingText = shippingNotes[lang] || shippingNotes.en;
|
|
640
|
+
|
|
641
|
+
const cartButton = document.querySelector(
|
|
642
|
+
".bg-white.shadow-xl button.bg-skin-primary"
|
|
643
|
+
);
|
|
644
|
+
if (cartButton && cartButton.innerText.trim() !== cartText) {
|
|
645
|
+
cartButton.innerText = cartText;
|
|
646
|
+
cartButton.setAttribute("data-translated", "true");
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
document.documentElement.style.setProperty(
|
|
650
|
+
"--ab-checkout-shipping-note",
|
|
651
|
+
JSON.stringify(shippingText)
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
function wrapVariants() {
|
|
655
|
+
// العثور على كل حاويات معلومات المنتج
|
|
656
|
+
const itemInfoContainers = document.querySelectorAll('[data-cart="item-info"]');
|
|
657
|
+
|
|
658
|
+
itemInfoContainers.forEach(container => {
|
|
659
|
+
// التحقق مما إذا كان قد تم التغليف بالفعل لمنع التكرار
|
|
660
|
+
if (container.querySelector('.variants-wrapper')) return;
|
|
661
|
+
|
|
662
|
+
// العثور على كل الـ variants داخل هذه الحاوية
|
|
663
|
+
const variants = container.querySelectorAll('[data-cart="item-variant"]');
|
|
664
|
+
|
|
665
|
+
if (variants.length > 0) {
|
|
666
|
+
// إنشاء الحاوية الجديدة
|
|
667
|
+
const wrapper = document.createElement('div');
|
|
668
|
+
wrapper.className = 'variants-wrapper';
|
|
669
|
+
|
|
670
|
+
// نقل الـ variants إلى الحاوية الجديدة
|
|
671
|
+
variants.forEach(variant => {
|
|
672
|
+
wrapper.appendChild(variant);
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
// إضافة الحاوية الجديدة داخل الـ item-info بعد الـ header
|
|
676
|
+
const header = container.querySelector('[data-cart="item-header"]');
|
|
677
|
+
if (header) {
|
|
678
|
+
header.after(wrapper);
|
|
679
|
+
} else {
|
|
680
|
+
container.prepend(wrapper);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
function filterProductByCategory() {
|
|
686
|
+
function b(el) {
|
|
687
|
+
var wrap = el.closest("[data-eo-api-base]");
|
|
688
|
+
if (wrap && wrap.getAttribute("data-eo-api-base")) {
|
|
689
|
+
return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
|
|
690
|
+
}
|
|
691
|
+
if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__) {
|
|
692
|
+
return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
|
|
693
|
+
}
|
|
694
|
+
return EO_STORE_API_FALLBACK;
|
|
695
|
+
}
|
|
696
|
+
document.querySelectorAll("a[data-eo-hs-cta]:not([data-eo-hs-cta-done])").forEach(function (a) {
|
|
697
|
+
var id = String(a.getAttribute("data-eo-hs-cta-id") || "").trim();
|
|
698
|
+
var entity = a.getAttribute("data-eo-hs-cta-entity") || "";
|
|
699
|
+
a.setAttribute("data-eo-hs-cta-done", "1");
|
|
700
|
+
if (!id) return;
|
|
701
|
+
var base = b(a);
|
|
702
|
+
var path =
|
|
703
|
+
entity === "categories"
|
|
704
|
+
? "categories"
|
|
705
|
+
: entity === "pages"
|
|
706
|
+
? "simple-pages"
|
|
707
|
+
: "products";
|
|
708
|
+
var url =
|
|
709
|
+
base.replace(/\/$/, "") +
|
|
710
|
+
"/" +
|
|
711
|
+
path +
|
|
712
|
+
"?filter=id||$in||" + id + "&limit=1";
|
|
713
|
+
fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
|
|
714
|
+
.then(function (res) {
|
|
715
|
+
return res.ok ? res.json() : Promise.reject(new Error(String(res.status)));
|
|
716
|
+
})
|
|
717
|
+
.then(function (body) {
|
|
718
|
+
var rows = Array.isArray(body) ? body : body && Array.isArray(body.data) ? body.data : [];
|
|
719
|
+
var row = rows[0];
|
|
720
|
+
if (!row) return;
|
|
721
|
+
var slug = row.slug || "";
|
|
722
|
+
if (entity === "categories" && slug) a.href = "/collections/" + encodeURIComponent(slug);
|
|
723
|
+
else if (entity === "pages" && slug) a.href = "/pages/" + encodeURIComponent(slug);
|
|
724
|
+
else if (entity === "products" && slug) a.href = "/products/" + encodeURIComponent(slug);
|
|
725
|
+
})
|
|
726
|
+
.catch(function () {});
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
filterProductByCategory();
|
|
730
|
+
|
|
731
|
+
var __eoHsCurrency = "";
|
|
732
|
+
function detectCurrency() {
|
|
733
|
+
if (__eoHsCurrency) return __eoHsCurrency;
|
|
734
|
+
try {
|
|
735
|
+
var nd = document.getElementById("__NEXT_DATA__");
|
|
736
|
+
if (nd) {
|
|
737
|
+
var j = JSON.parse(nd.textContent);
|
|
738
|
+
var s = j && j.props && j.props.pageProps && j.props.pageProps.appSettings;
|
|
739
|
+
if (s && s.currency_symbol) { __eoHsCurrency = s.currency_symbol; return __eoHsCurrency; }
|
|
740
|
+
}
|
|
741
|
+
} catch (e) {}
|
|
742
|
+
var priceEl = document.querySelector(".ab-pgrid-price, .ab-pd-price, .ab-plist-price, .ab-featured-price, .ab-price-old");
|
|
743
|
+
if (priceEl) {
|
|
744
|
+
var txt = (priceEl.textContent || "").replace(/[\d,.\s]/g, "").trim();
|
|
745
|
+
if (txt) { __eoHsCurrency = txt; return __eoHsCurrency; }
|
|
746
|
+
}
|
|
747
|
+
return "";
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
function fetchHsSectionProducts() {
|
|
751
|
+
function apiBase(el) {
|
|
752
|
+
var wrap = el.closest("[data-eo-api-base]");
|
|
753
|
+
if (wrap && wrap.getAttribute("data-eo-api-base"))
|
|
754
|
+
return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
|
|
755
|
+
if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__)
|
|
756
|
+
return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
|
|
757
|
+
return EO_STORE_API_FALLBACK;
|
|
758
|
+
}
|
|
759
|
+
var containers = document.querySelectorAll("[data-eo-hs-ids]:not([data-eo-hs-fetched])");
|
|
760
|
+
if (!containers.length) return;
|
|
761
|
+
var cur = detectCurrency();
|
|
762
|
+
containers.forEach(function (container) {
|
|
763
|
+
var ids = (container.getAttribute("data-eo-hs-ids") || "").trim();
|
|
764
|
+
if (!ids) return;
|
|
765
|
+
container.setAttribute("data-eo-hs-fetched", "1");
|
|
766
|
+
var mount = container.querySelector("[data-eo-hs-mount]");
|
|
767
|
+
if (!mount) return;
|
|
768
|
+
mount.classList.add("eo-hs-loading");
|
|
769
|
+
var base = apiBase(container);
|
|
770
|
+
var entity = container.getAttribute("data-eo-hs-entity") || "products";
|
|
771
|
+
var path = entity === "categories" ? "categories" : "products";
|
|
772
|
+
var url = base + "/" + path + "?filter=id||$in||" + ids + "&limit=20";
|
|
773
|
+
fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
|
|
774
|
+
.then(function (res) { return res.ok ? res.json() : Promise.reject(res.status); })
|
|
775
|
+
.then(function (body) {
|
|
776
|
+
var rows = Array.isArray(body) ? body : body && Array.isArray(body.data) ? body.data : [];
|
|
777
|
+
if (!rows.length) {
|
|
778
|
+
mount.innerHTML = '<p class="eo-hs-error">No products found.</p>';
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
var html = "";
|
|
782
|
+
rows.forEach(function (p) {
|
|
783
|
+
var slug = p.slug || "";
|
|
784
|
+
var name = p.name || "";
|
|
785
|
+
var thumb = p.thumb || (p.images && p.images[0]) || "";
|
|
786
|
+
var price = p.sale_price && p.sale_price < p.price ? p.sale_price : p.price || 0;
|
|
787
|
+
var oldPrice = p.sale_price && p.sale_price < p.price ? p.price : 0;
|
|
788
|
+
var currency = cur || p.currency || "";
|
|
789
|
+
var mediaHtml = thumb
|
|
790
|
+
? '<div class="eo-hs-card__media"><img src="' + thumb + '" alt="' + name.replace(/"/g, """) + '" loading="lazy" width="320" height="400" style="width:100%;height:100%;object-fit:cover;display:block;" /></div>'
|
|
791
|
+
: '<div class="eo-hs-card__media eo-hs-card__media--empty"></div>';
|
|
792
|
+
var priceHtml = '<span class="eo-hs-card__meta">';
|
|
793
|
+
if (oldPrice) {
|
|
794
|
+
priceHtml += '<del style="opacity:0.55;margin-inline-end:4px">' + oldPrice + " " + currency + "</del> ";
|
|
795
|
+
}
|
|
796
|
+
priceHtml += price + " " + currency + "</span>";
|
|
797
|
+
html +=
|
|
798
|
+
'<a class="eo-hs-card--product" href="/products/' + encodeURIComponent(slug) + '">' +
|
|
799
|
+
mediaHtml +
|
|
800
|
+
'<div class="eo-hs-card__body">' +
|
|
801
|
+
'<span class="eo-hs-card__title">' + name + "</span>" +
|
|
802
|
+
priceHtml +
|
|
803
|
+
"</div></a>";
|
|
804
|
+
});
|
|
805
|
+
mount.innerHTML = html;
|
|
806
|
+
mount.classList.remove("eo-hs-loading");
|
|
807
|
+
if (typeof initFormatPrices === "function") initFormatPrices();
|
|
808
|
+
})
|
|
809
|
+
.catch(function () {
|
|
810
|
+
mount.innerHTML = '<p class="eo-hs-error">Failed to load products.</p>';
|
|
811
|
+
mount.classList.remove("eo-hs-loading");
|
|
812
|
+
});
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
function initIOSHoverFix() {
|
|
816
|
+
if (!("ontouchstart" in window)) return;
|
|
817
|
+
document.querySelectorAll('.ab-pgrid-card:not([data-ios-fix]), .ab-plist-card:not([data-ios-fix]), .ab-featured-card:not([data-ios-fix]), .ab-pgrid-card-link:not([data-ios-fix])').forEach(function(card) {
|
|
818
|
+
card.dataset.iosFix = "1";
|
|
819
|
+
var isScrolling = false;
|
|
820
|
+
|
|
821
|
+
card.addEventListener("touchstart", function() {
|
|
822
|
+
isScrolling = false;
|
|
823
|
+
}, {passive: true});
|
|
824
|
+
|
|
825
|
+
card.addEventListener("touchmove", function() {
|
|
826
|
+
isScrolling = true;
|
|
827
|
+
}, {passive: true});
|
|
828
|
+
|
|
829
|
+
card.addEventListener("touchend", function(e) {
|
|
830
|
+
if (isScrolling) return;
|
|
831
|
+
if (!e.target.closest("button") && !e.target.closest(".ab-card-actions")) {
|
|
832
|
+
e.preventDefault();
|
|
833
|
+
var link = card.tagName === "A" ? card : card.querySelector("a[href]");
|
|
834
|
+
if (link && typeof link.click === "function") link.click();
|
|
835
|
+
else card.click();
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
function initZoomParallax() {
|
|
841
|
+
const sections = document.querySelectorAll('.zp-section:not([data-zp-init])');
|
|
842
|
+
sections.forEach(sec => {
|
|
843
|
+
sec.dataset.zpInit = '1';
|
|
844
|
+
|
|
845
|
+
const center = sec.querySelector('.zp-img-center');
|
|
846
|
+
const tl = sec.querySelector('.zp-img-tl');
|
|
847
|
+
const tr = sec.querySelector('.zp-img-tr');
|
|
848
|
+
const bl = sec.querySelector('.zp-img-bl');
|
|
849
|
+
const br = sec.querySelector('.zp-img-br');
|
|
850
|
+
|
|
851
|
+
let ticking = false;
|
|
852
|
+
|
|
853
|
+
function onScroll() {
|
|
854
|
+
const rect = sec.getBoundingClientRect();
|
|
855
|
+
const viewHeight = window.innerHeight;
|
|
856
|
+
|
|
857
|
+
let progress = -rect.top / (rect.height - viewHeight);
|
|
858
|
+
if (progress < 0) progress = 0;
|
|
859
|
+
if (progress > 1) progress = 1;
|
|
860
|
+
|
|
861
|
+
if (center) center.style.transform = `scale(${1 + progress * 3})`;
|
|
862
|
+
if (tl) tl.style.transform = `scale(${1 + progress * 4})`;
|
|
863
|
+
if (tr) tr.style.transform = `scale(${1 + progress * 5})`;
|
|
864
|
+
if (bl) bl.style.transform = `scale(${1 + progress * 7})`;
|
|
865
|
+
if (br) br.style.transform = `scale(${1 + progress * 8})`;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
window.addEventListener('scroll', () => {
|
|
869
|
+
if (!ticking) {
|
|
870
|
+
window.requestAnimationFrame(() => {
|
|
871
|
+
onScroll();
|
|
872
|
+
ticking = false;
|
|
873
|
+
});
|
|
874
|
+
ticking = true;
|
|
875
|
+
}
|
|
876
|
+
}, { passive: true });
|
|
877
|
+
|
|
878
|
+
onScroll();
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
initZoomParallax();
|
|
882
|
+
fetchHsSectionProducts();
|
|
883
|
+
initIOSHoverFix();
|
|
884
|
+
wrapVariants();
|
|
885
|
+
updateCartButtonText();
|
|
886
|
+
syncArabicUiDirection();
|
|
887
|
+
updateReviewTitle();
|
|
888
|
+
moveStockToAccordion();
|
|
889
|
+
restructureCartCounter();
|
|
890
|
+
e(),
|
|
891
|
+
t(),
|
|
892
|
+
a(),
|
|
893
|
+
n(),
|
|
894
|
+
r(),
|
|
895
|
+
runwayAnim(),
|
|
896
|
+
o(),
|
|
897
|
+
u(),
|
|
898
|
+
v(),
|
|
899
|
+
w(),
|
|
900
|
+
window.__abGalleryKeyInit ||
|
|
901
|
+
((window.__abGalleryKeyInit = !0),
|
|
902
|
+
document.addEventListener("keydown", function (e) {
|
|
903
|
+
var t = document.querySelector("body > .ab-lightbox.ab-open");
|
|
904
|
+
if (t) {
|
|
905
|
+
if ("Escape" === e.key) {
|
|
906
|
+
var vEl = t.querySelector("[data-lightbox-video]");
|
|
907
|
+
if (vEl) { vEl.pause(); vEl.removeAttribute("src"); vEl.load(); vEl.style.display = "none"; }
|
|
908
|
+
t.classList.remove("ab-open");
|
|
909
|
+
document.body.style.overflow = "";
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
if ("ArrowLeft" !== e.key)
|
|
913
|
+
if ("ArrowRight" !== e.key);
|
|
914
|
+
else {
|
|
915
|
+
var a = t.querySelector("[data-lightbox-next]");
|
|
916
|
+
a && a.click();
|
|
917
|
+
}
|
|
918
|
+
else {
|
|
919
|
+
var n = t.querySelector("[data-lightbox-prev]");
|
|
920
|
+
n && n.click();
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
})),
|
|
924
|
+
i(),
|
|
925
|
+
c(),
|
|
926
|
+
l(),
|
|
927
|
+
s(),
|
|
928
|
+
new MutationObserver(function () {
|
|
929
|
+
e(), t(), a(), n(), r(), runwayAnim(), o(), u(), v(), w(), i(), c(), l(), s();moveStockToAccordion();restructureCartCounter();syncArabicUiDirection();updateReviewTitle();updateCartButtonText();wrapVariants();filterProductByCategory();fetchHsSectionProducts();initIOSHoverFix();initZoomParallax();
|
|
930
|
+
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
931
|
+
})();
|
|
932
|
+
|
|
933
|
+
/* ── Fixed Buy Button: reveal after 10% scroll on mobile ── */
|
|
934
|
+
!(function () {
|
|
935
|
+
var MOBILE_MQ = "(max-width: 768px)";
|
|
936
|
+
var CLASS_SHOW = "show-btn";
|
|
937
|
+
var ticking = false;
|
|
938
|
+
|
|
939
|
+
function update() {
|
|
940
|
+
ticking = false;
|
|
941
|
+
var el = document.querySelector(".ab-fixed-buy");
|
|
942
|
+
if (!el) return;
|
|
943
|
+
|
|
944
|
+
if (!window.matchMedia(MOBILE_MQ).matches) {
|
|
945
|
+
el.classList.remove(CLASS_SHOW);
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
var doc = document.documentElement;
|
|
950
|
+
var scrollable = (doc.scrollHeight || document.body.scrollHeight) - window.innerHeight;
|
|
951
|
+
if (scrollable <= 0) {
|
|
952
|
+
el.classList.remove(CLASS_SHOW);
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
var y = window.pageYOffset || doc.scrollTop;
|
|
957
|
+
var threshold = scrollable * 0.3;
|
|
958
|
+
|
|
959
|
+
if (y > threshold) {
|
|
960
|
+
el.classList.add(CLASS_SHOW);
|
|
961
|
+
} else {
|
|
962
|
+
el.classList.remove(CLASS_SHOW);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
function onScroll() {
|
|
967
|
+
if (ticking) return;
|
|
968
|
+
ticking = true;
|
|
969
|
+
window.requestAnimationFrame(update);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
973
|
+
window.addEventListener("resize", onScroll, { passive: true });
|
|
974
|
+
window.addEventListener("load", update);
|
|
975
|
+
update();
|
|
976
|
+
})();
|
|
977
|
+
|
|
978
|
+
/* ── Footer details: mobile accordion, desktop/tablet always open ── */
|
|
979
|
+
!(function () {
|
|
980
|
+
var FOOTER_MQ = "(min-width: 768px)";
|
|
981
|
+
|
|
982
|
+
function syncFooterDetails() {
|
|
983
|
+
var isWide = window.matchMedia(FOOTER_MQ).matches,
|
|
984
|
+
items = document.querySelectorAll(".ab-footer .ab-footer-details");
|
|
985
|
+
if (!items.length) return !1;
|
|
986
|
+
items.forEach(function (el) {
|
|
987
|
+
if (isWide) el.setAttribute("open", "");
|
|
988
|
+
else el.removeAttribute("open");
|
|
989
|
+
});
|
|
990
|
+
return !0;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
function syncFooterWhenReady(attempt) {
|
|
994
|
+
if (syncFooterDetails()) return;
|
|
995
|
+
attempt < 40 &&
|
|
996
|
+
setTimeout(function () {
|
|
997
|
+
syncFooterWhenReady(attempt + 1);
|
|
998
|
+
}, 50);
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
if (document.readyState === "loading") {
|
|
1002
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
1003
|
+
syncFooterWhenReady(0);
|
|
1004
|
+
});
|
|
1005
|
+
} else {
|
|
1006
|
+
syncFooterWhenReady(0);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
window.addEventListener("load", function () {
|
|
1010
|
+
syncFooterWhenReady(0);
|
|
1011
|
+
});
|
|
1012
|
+
window.addEventListener("resize", syncFooterDetails, { passive: true });
|
|
1013
|
+
var mq = window.matchMedia(FOOTER_MQ);
|
|
1014
|
+
if (mq.addEventListener) mq.addEventListener("change", syncFooterDetails);
|
|
1015
|
+
else mq.onchange = syncFooterDetails;
|
|
1016
|
+
})();
|
|
1017
|
+
|
|
1018
|
+
const initFormatPrices = () => {
|
|
1019
|
+
const formatPrices = () => {
|
|
1020
|
+
const priceSelectors = [
|
|
1021
|
+
'.ab-price-old',
|
|
1022
|
+
'.ab-plist-price',
|
|
1023
|
+
'.ab-pgrid-price',
|
|
1024
|
+
'.ab-pd-price',
|
|
1025
|
+
'.ab-pd-price-old',
|
|
1026
|
+
'.ab-fixed-buy-price',
|
|
1027
|
+
'.ab-fixed-buy-price-old',
|
|
1028
|
+
'.ab-featured-price',
|
|
1029
|
+
'.eo-hs-card__meta',
|
|
1030
|
+
'.shop-the-look__pick-price',
|
|
1031
|
+
'.ab-invoice-item-unit-price',
|
|
1032
|
+
'.ab-invoice-item-total',
|
|
1033
|
+
'.ab-invoice-totals dd',
|
|
1034
|
+
'.total_price',
|
|
1035
|
+
'[data-cart="item-price"]',
|
|
1036
|
+
'[data-invoice="invoice-subtotal-value"]',
|
|
1037
|
+
'.shipping_cost',
|
|
1038
|
+
'[data-invoice="invoice-total-value"]',
|
|
1039
|
+
'p[class~="flex"][class*="text-gray-500"][class*="items-center"][class*="gap-0.5"]',
|
|
1040
|
+
'div[class~="flex"][class~="items-center"][class~="gap-2.5"][class*="mt-3"] span[class~="flex"][class~="items-center"][class~="gap-1"]',
|
|
1041
|
+
'div[class~="flex"][class~="items-center"][class~="gap-2.5"][class*="mt-3"] del[class~="flex"][class~="items-center"][class~="gap-1"]'
|
|
1042
|
+
].join(', ');
|
|
1043
|
+
|
|
1044
|
+
document.querySelectorAll(priceSelectors).forEach(el => {
|
|
1045
|
+
|
|
1046
|
+
const walkTextNodes = (node) => {
|
|
1047
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
1048
|
+
let text = node.textContent;
|
|
1049
|
+
const matches = text.match(/\d{4,}(\.\d+)?/g);
|
|
1050
|
+
if (matches) {
|
|
1051
|
+
let updated = false;
|
|
1052
|
+
matches.forEach(match => {
|
|
1053
|
+
const num = parseFloat(match);
|
|
1054
|
+
if (!isNaN(num)) {
|
|
1055
|
+
const formattedNum = num.toLocaleString('en-US');
|
|
1056
|
+
text = text.replace(match, formattedNum);
|
|
1057
|
+
updated = true;
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
if (updated) node.textContent = text;
|
|
1061
|
+
}
|
|
1062
|
+
} else if (node.nodeType === Node.ELEMENT_NODE) {
|
|
1063
|
+
node.childNodes.forEach(walkTextNodes);
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
walkTextNodes(el);
|
|
1068
|
+
});
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1071
|
+
formatPrices();
|
|
1072
|
+
|
|
1073
|
+
const observer = new MutationObserver((mutations) => {
|
|
1074
|
+
let shouldFormat = false;
|
|
1075
|
+
for (const m of mutations) {
|
|
1076
|
+
if (m.addedNodes.length > 0 || m.type === 'characterData') {
|
|
1077
|
+
shouldFormat = true;
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
if (shouldFormat) formatPrices();
|
|
1082
|
+
});
|
|
1083
|
+
|
|
1084
|
+
observer.observe(document.body, {
|
|
1085
|
+
childList: true,
|
|
1086
|
+
subtree: true,
|
|
1087
|
+
characterData: true
|
|
1088
|
+
});
|
|
1089
|
+
};
|
|
1090
|
+
|
|
1091
|
+
if (document.readyState === 'loading') {
|
|
1092
|
+
document.addEventListener('DOMContentLoaded', initFormatPrices);
|
|
1093
|
+
} else {
|
|
1094
|
+
initFormatPrices();
|
|
1095
|
+
}
|