@ppg_pl/pallete 0.0.6 → 2.0.0
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 +9 -1
- package/dist/cjs/{index-160fcb6c.js → index-53e78fc8.js} +3 -1
- package/dist/cjs/index-53e78fc8.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/my-backdrop_8.cjs.entry.js +527 -261
- package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
- package/dist/cjs/pallete.cjs.js +2 -2
- package/dist/collection/components/api/index.js +4 -2
- package/dist/collection/components/api/index.js.map +1 -1
- package/dist/collection/components/api/services.js +31 -64
- package/dist/collection/components/api/services.js.map +1 -1
- package/dist/collection/components/my-colorinfo/my-colorinfo.js +6 -4
- package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
- package/dist/collection/components/my-loader/my-loader.css +1 -1
- package/dist/collection/components/my-modal/my-modal.js +65 -47
- package/dist/collection/components/my-modal/my-modal.js.map +1 -1
- package/dist/collection/components/my-search/my-search.js +28 -2
- package/dist/collection/components/my-search/my-search.js.map +1 -1
- package/dist/collection/components/my-slider/index.js +5 -8
- package/dist/collection/components/my-slider/index.js.map +1 -1
- package/dist/collection/types.js.map +1 -1
- package/dist/components/index2.js +25 -3
- package/dist/components/index2.js.map +1 -1
- package/dist/components/my-colorinfo2.js +4 -3
- package/dist/components/my-colorinfo2.js.map +1 -1
- package/dist/components/my-loader2.js +1 -1
- package/dist/components/my-loader2.js.map +1 -1
- package/dist/components/my-modal2.js +482 -256
- package/dist/components/my-modal2.js.map +1 -1
- package/dist/components/my-search2.js +20 -3
- package/dist/components/my-search2.js.map +1 -1
- package/dist/esm/{index-943c259f.js → index-b0145abf.js} +3 -1
- package/dist/esm/index-b0145abf.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/my-backdrop_8.entry.js +527 -261
- package/dist/esm/my-backdrop_8.entry.js.map +1 -1
- package/dist/esm/pallete.js +3 -3
- package/dist/pallete/p-037cfde2.entry.js +2 -0
- package/dist/pallete/p-037cfde2.entry.js.map +1 -0
- package/dist/pallete/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
- package/dist/pallete/p-c6a049a2.js.map +1 -0
- package/dist/pallete/pallete.esm.js +1 -1
- package/dist/pallete/pallete.esm.js.map +1 -1
- package/dist/types/components/api/index.d.ts +2 -1
- package/dist/types/components/api/services.d.ts +3 -3
- package/dist/types/components/my-modal/my-modal.d.ts +1 -0
- package/dist/types/components/my-search/my-search.d.ts +2 -0
- package/dist/types/components/my-slider/index.d.ts +2 -2
- package/dist/types/components.d.ts +5 -4
- package/dist/types/types.d.ts +35 -24
- package/package.json +5 -5
- package/www/build/p-037cfde2.entry.js +2 -0
- package/www/build/p-037cfde2.entry.js.map +1 -0
- package/www/build/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
- package/www/build/p-c6a049a2.js.map +1 -0
- package/www/build/pallete.esm.js +1 -1
- package/www/build/pallete.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/index-160fcb6c.js.map +0 -1
- package/dist/esm/index-943c259f.js.map +0 -1
- package/dist/pallete/p-9a7eff4f.entry.js +0 -2
- package/dist/pallete/p-9a7eff4f.entry.js.map +0 -1
- package/dist/pallete/p-c77aaa54.js.map +0 -1
- package/www/build/p-825a7d1d.js +0 -163
- package/www/build/p-9a7eff4f.entry.js +0 -2
- package/www/build/p-9a7eff4f.entry.js.map +0 -1
- package/www/build/p-c77aaa54.js.map +0 -1
- package/www/build/p-fd390eef.css +0 -3
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h, getAssetPath } from '@stencil/core/internal/client';
|
|
2
|
+
import { b as ApiService, A as APIURL, a as accessToken, d as defineCustomElement$1 } from './index2.js';
|
|
2
3
|
import { s as setDataLayer } from './gtmUtils.js';
|
|
3
4
|
import { d as defineCustomElement$5 } from './my-colorbox2.js';
|
|
4
5
|
import { d as defineCustomElement$4 } from './my-colorinfo2.js';
|
|
5
6
|
import { d as defineCustomElement$3 } from './my-loader2.js';
|
|
6
7
|
import { d as defineCustomElement$2 } from './my-search2.js';
|
|
7
|
-
import { d as defineCustomElement$1 } from './index2.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
/** @type {import('.')} */
|
|
10
|
+
var esErrors = Error;
|
|
11
|
+
|
|
12
|
+
/** @type {import('./eval')} */
|
|
13
|
+
var _eval = EvalError;
|
|
14
|
+
|
|
15
|
+
/** @type {import('./range')} */
|
|
16
|
+
var range = RangeError;
|
|
17
|
+
|
|
18
|
+
/** @type {import('./ref')} */
|
|
19
|
+
var ref = ReferenceError;
|
|
20
|
+
|
|
21
|
+
/** @type {import('./syntax')} */
|
|
22
|
+
var syntax = SyntaxError;
|
|
23
|
+
|
|
24
|
+
/** @type {import('./type')} */
|
|
25
|
+
var type = TypeError;
|
|
26
|
+
|
|
27
|
+
/** @type {import('./uri')} */
|
|
28
|
+
var uri = URIError;
|
|
28
29
|
|
|
29
30
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
30
31
|
var shams = function hasSymbols() {
|
|
@@ -79,46 +80,92 @@ var hasSymbols$1 = function hasNativeSymbols() {
|
|
|
79
80
|
return shams();
|
|
80
81
|
};
|
|
81
82
|
|
|
83
|
+
var test = {
|
|
84
|
+
__proto__: null,
|
|
85
|
+
foo: {}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var $Object = Object;
|
|
89
|
+
|
|
90
|
+
/** @type {import('.')} */
|
|
91
|
+
var hasProto$1 = function hasProto() {
|
|
92
|
+
// @ts-expect-error: TS errors on an inherited property for some reason
|
|
93
|
+
return { __proto__: test }.foo === test.foo
|
|
94
|
+
&& !(test instanceof $Object);
|
|
95
|
+
};
|
|
96
|
+
|
|
82
97
|
/* eslint no-invalid-this: 1 */
|
|
83
98
|
|
|
84
99
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
85
|
-
var slice = Array.prototype.slice;
|
|
86
100
|
var toStr$1 = Object.prototype.toString;
|
|
101
|
+
var max = Math.max;
|
|
87
102
|
var funcType = '[object Function]';
|
|
88
103
|
|
|
104
|
+
var concatty = function concatty(a, b) {
|
|
105
|
+
var arr = [];
|
|
106
|
+
|
|
107
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
108
|
+
arr[i] = a[i];
|
|
109
|
+
}
|
|
110
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
111
|
+
arr[j + a.length] = b[j];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return arr;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var slicy = function slicy(arrLike, offset) {
|
|
118
|
+
var arr = [];
|
|
119
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
120
|
+
arr[j] = arrLike[i];
|
|
121
|
+
}
|
|
122
|
+
return arr;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var joiny = function (arr, joiner) {
|
|
126
|
+
var str = '';
|
|
127
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
128
|
+
str += arr[i];
|
|
129
|
+
if (i + 1 < arr.length) {
|
|
130
|
+
str += joiner;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return str;
|
|
134
|
+
};
|
|
135
|
+
|
|
89
136
|
var implementation = function bind(that) {
|
|
90
137
|
var target = this;
|
|
91
|
-
if (typeof target !== 'function' || toStr$1.
|
|
138
|
+
if (typeof target !== 'function' || toStr$1.apply(target) !== funcType) {
|
|
92
139
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
93
140
|
}
|
|
94
|
-
var args =
|
|
141
|
+
var args = slicy(arguments, 1);
|
|
95
142
|
|
|
96
143
|
var bound;
|
|
97
144
|
var binder = function () {
|
|
98
145
|
if (this instanceof bound) {
|
|
99
146
|
var result = target.apply(
|
|
100
147
|
this,
|
|
101
|
-
args
|
|
148
|
+
concatty(args, arguments)
|
|
102
149
|
);
|
|
103
150
|
if (Object(result) === result) {
|
|
104
151
|
return result;
|
|
105
152
|
}
|
|
106
153
|
return this;
|
|
107
|
-
} else {
|
|
108
|
-
return target.apply(
|
|
109
|
-
that,
|
|
110
|
-
args.concat(slice.call(arguments))
|
|
111
|
-
);
|
|
112
154
|
}
|
|
155
|
+
return target.apply(
|
|
156
|
+
that,
|
|
157
|
+
concatty(args, arguments)
|
|
158
|
+
);
|
|
159
|
+
|
|
113
160
|
};
|
|
114
161
|
|
|
115
|
-
var boundLength =
|
|
162
|
+
var boundLength = max(0, target.length - args.length);
|
|
116
163
|
var boundArgs = [];
|
|
117
164
|
for (var i = 0; i < boundLength; i++) {
|
|
118
|
-
boundArgs
|
|
165
|
+
boundArgs[i] = '$' + i;
|
|
119
166
|
}
|
|
120
167
|
|
|
121
|
-
bound = Function('binder', 'return function (' + boundArgs
|
|
168
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
122
169
|
|
|
123
170
|
if (target.prototype) {
|
|
124
171
|
var Empty = function Empty() {};
|
|
@@ -132,13 +179,24 @@ var implementation = function bind(that) {
|
|
|
132
179
|
|
|
133
180
|
var functionBind = Function.prototype.bind || implementation;
|
|
134
181
|
|
|
135
|
-
var
|
|
182
|
+
var call = Function.prototype.call;
|
|
183
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
/** @type {import('.')} */
|
|
187
|
+
var hasown = functionBind.call(call, $hasOwn);
|
|
136
188
|
|
|
137
189
|
var undefined$1;
|
|
138
190
|
|
|
139
|
-
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
140
199
|
var $Function = Function;
|
|
141
|
-
var $TypeError$1 = TypeError;
|
|
142
200
|
|
|
143
201
|
// eslint-disable-next-line consistent-return
|
|
144
202
|
var getEvalledConstructor = function (expressionSyntax) {
|
|
@@ -147,19 +205,19 @@ var getEvalledConstructor = function (expressionSyntax) {
|
|
|
147
205
|
} catch (e) {}
|
|
148
206
|
};
|
|
149
207
|
|
|
150
|
-
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
208
|
+
var $gOPD$1 = Object.getOwnPropertyDescriptor;
|
|
151
209
|
|
|
152
210
|
var throwTypeError = function () {
|
|
153
|
-
throw new
|
|
211
|
+
throw new type();
|
|
154
212
|
};
|
|
155
|
-
var ThrowTypeError = $gOPD
|
|
213
|
+
var ThrowTypeError = $gOPD$1
|
|
156
214
|
? (function () {
|
|
157
215
|
try {
|
|
158
216
|
return throwTypeError;
|
|
159
217
|
} catch (calleeThrows) {
|
|
160
218
|
try {
|
|
161
219
|
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
162
|
-
return $gOPD(arguments, 'callee').get;
|
|
220
|
+
return $gOPD$1(arguments, 'callee').get;
|
|
163
221
|
} catch (gOPDthrows) {
|
|
164
222
|
return throwTypeError;
|
|
165
223
|
}
|
|
@@ -168,18 +226,24 @@ var ThrowTypeError = $gOPD
|
|
|
168
226
|
: throwTypeError;
|
|
169
227
|
|
|
170
228
|
var hasSymbols = hasSymbols$1();
|
|
229
|
+
var hasProto = hasProto$1();
|
|
171
230
|
|
|
172
|
-
var getProto = Object.getPrototypeOf ||
|
|
231
|
+
var getProto = Object.getPrototypeOf || (
|
|
232
|
+
hasProto
|
|
233
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
234
|
+
: null
|
|
235
|
+
);
|
|
173
236
|
|
|
174
237
|
var needsEval = {};
|
|
175
238
|
|
|
176
|
-
var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
|
|
239
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
177
240
|
|
|
178
241
|
var INTRINSICS = {
|
|
242
|
+
__proto__: null,
|
|
179
243
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
180
244
|
'%Array%': Array,
|
|
181
245
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
182
|
-
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
246
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
183
247
|
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
184
248
|
'%AsyncFunction%': needsEval,
|
|
185
249
|
'%AsyncGenerator%': needsEval,
|
|
@@ -196,9 +260,9 @@ var INTRINSICS = {
|
|
|
196
260
|
'%decodeURIComponent%': decodeURIComponent,
|
|
197
261
|
'%encodeURI%': encodeURI,
|
|
198
262
|
'%encodeURIComponent%': encodeURIComponent,
|
|
199
|
-
'%Error%':
|
|
263
|
+
'%Error%': esErrors,
|
|
200
264
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
201
|
-
'%EvalError%':
|
|
265
|
+
'%EvalError%': _eval,
|
|
202
266
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
203
267
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
204
268
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
@@ -209,10 +273,10 @@ var INTRINSICS = {
|
|
|
209
273
|
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
210
274
|
'%isFinite%': isFinite,
|
|
211
275
|
'%isNaN%': isNaN,
|
|
212
|
-
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
276
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
213
277
|
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
214
278
|
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
215
|
-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
279
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
216
280
|
'%Math%': Math,
|
|
217
281
|
'%Number%': Number,
|
|
218
282
|
'%Object%': Object,
|
|
@@ -220,25 +284,25 @@ var INTRINSICS = {
|
|
|
220
284
|
'%parseInt%': parseInt,
|
|
221
285
|
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
222
286
|
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
223
|
-
'%RangeError%':
|
|
224
|
-
'%ReferenceError%':
|
|
287
|
+
'%RangeError%': range,
|
|
288
|
+
'%ReferenceError%': ref,
|
|
225
289
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
226
290
|
'%RegExp%': RegExp,
|
|
227
291
|
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
228
|
-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
292
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
229
293
|
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
230
294
|
'%String%': String,
|
|
231
|
-
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
295
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
232
296
|
'%Symbol%': hasSymbols ? Symbol : undefined$1,
|
|
233
|
-
'%SyntaxError%':
|
|
297
|
+
'%SyntaxError%': syntax,
|
|
234
298
|
'%ThrowTypeError%': ThrowTypeError,
|
|
235
299
|
'%TypedArray%': TypedArray,
|
|
236
|
-
'%TypeError%':
|
|
300
|
+
'%TypeError%': type,
|
|
237
301
|
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
238
302
|
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
239
303
|
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
240
304
|
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
241
|
-
'%URIError%':
|
|
305
|
+
'%URIError%': uri,
|
|
242
306
|
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
243
307
|
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
244
308
|
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
@@ -259,7 +323,7 @@ var doEval = function doEval(name) {
|
|
|
259
323
|
}
|
|
260
324
|
} else if (name === '%AsyncIteratorPrototype%') {
|
|
261
325
|
var gen = doEval('%AsyncGenerator%');
|
|
262
|
-
if (gen) {
|
|
326
|
+
if (gen && getProto) {
|
|
263
327
|
value = getProto(gen.prototype);
|
|
264
328
|
}
|
|
265
329
|
}
|
|
@@ -270,6 +334,7 @@ var doEval = function doEval(name) {
|
|
|
270
334
|
};
|
|
271
335
|
|
|
272
336
|
var LEGACY_ALIASES = {
|
|
337
|
+
__proto__: null,
|
|
273
338
|
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
274
339
|
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
275
340
|
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
@@ -338,9 +403,9 @@ var stringToPath = function stringToPath(string) {
|
|
|
338
403
|
var first = $strSlice(string, 0, 1);
|
|
339
404
|
var last = $strSlice(string, -1);
|
|
340
405
|
if (first === '%' && last !== '%') {
|
|
341
|
-
throw new
|
|
406
|
+
throw new syntax('invalid intrinsic syntax, expected closing `%`');
|
|
342
407
|
} else if (last === '%' && first !== '%') {
|
|
343
|
-
throw new
|
|
408
|
+
throw new syntax('invalid intrinsic syntax, expected opening `%`');
|
|
344
409
|
}
|
|
345
410
|
var result = [];
|
|
346
411
|
$replace$1(string, rePropName, function (match, number, quote, subString) {
|
|
@@ -353,18 +418,18 @@ var stringToPath = function stringToPath(string) {
|
|
|
353
418
|
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
354
419
|
var intrinsicName = name;
|
|
355
420
|
var alias;
|
|
356
|
-
if (
|
|
421
|
+
if (hasown(LEGACY_ALIASES, intrinsicName)) {
|
|
357
422
|
alias = LEGACY_ALIASES[intrinsicName];
|
|
358
423
|
intrinsicName = '%' + alias[0] + '%';
|
|
359
424
|
}
|
|
360
425
|
|
|
361
|
-
if (
|
|
426
|
+
if (hasown(INTRINSICS, intrinsicName)) {
|
|
362
427
|
var value = INTRINSICS[intrinsicName];
|
|
363
428
|
if (value === needsEval) {
|
|
364
429
|
value = doEval(intrinsicName);
|
|
365
430
|
}
|
|
366
431
|
if (typeof value === 'undefined' && !allowMissing) {
|
|
367
|
-
throw new
|
|
432
|
+
throw new type('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
368
433
|
}
|
|
369
434
|
|
|
370
435
|
return {
|
|
@@ -374,19 +439,19 @@ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
|
374
439
|
};
|
|
375
440
|
}
|
|
376
441
|
|
|
377
|
-
throw new
|
|
442
|
+
throw new syntax('intrinsic ' + name + ' does not exist!');
|
|
378
443
|
};
|
|
379
444
|
|
|
380
445
|
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
381
446
|
if (typeof name !== 'string' || name.length === 0) {
|
|
382
|
-
throw new
|
|
447
|
+
throw new type('intrinsic name must be a non-empty string');
|
|
383
448
|
}
|
|
384
449
|
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
385
|
-
throw new
|
|
450
|
+
throw new type('"allowMissing" argument must be a boolean');
|
|
386
451
|
}
|
|
387
452
|
|
|
388
453
|
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
389
|
-
throw new
|
|
454
|
+
throw new syntax('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
390
455
|
}
|
|
391
456
|
var parts = stringToPath(name);
|
|
392
457
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
@@ -413,7 +478,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
413
478
|
)
|
|
414
479
|
&& first !== last
|
|
415
480
|
) {
|
|
416
|
-
throw new
|
|
481
|
+
throw new syntax('property names with quotes must have matching quotes');
|
|
417
482
|
}
|
|
418
483
|
if (part === 'constructor' || !isOwn) {
|
|
419
484
|
skipFurtherCaching = true;
|
|
@@ -422,17 +487,17 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
422
487
|
intrinsicBaseName += '.' + part;
|
|
423
488
|
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
424
489
|
|
|
425
|
-
if (
|
|
490
|
+
if (hasown(INTRINSICS, intrinsicRealName)) {
|
|
426
491
|
value = INTRINSICS[intrinsicRealName];
|
|
427
492
|
} else if (value != null) {
|
|
428
493
|
if (!(part in value)) {
|
|
429
494
|
if (!allowMissing) {
|
|
430
|
-
throw new
|
|
495
|
+
throw new type('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
431
496
|
}
|
|
432
497
|
return void undefined$1;
|
|
433
498
|
}
|
|
434
|
-
if ($gOPD && (i + 1) >= parts.length) {
|
|
435
|
-
var desc = $gOPD(value, part);
|
|
499
|
+
if ($gOPD$1 && (i + 1) >= parts.length) {
|
|
500
|
+
var desc = $gOPD$1(value, part);
|
|
436
501
|
isOwn = !!desc;
|
|
437
502
|
|
|
438
503
|
// By convention, when a data property is converted to an accessor
|
|
@@ -448,7 +513,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
448
513
|
value = value[part];
|
|
449
514
|
}
|
|
450
515
|
} else {
|
|
451
|
-
isOwn =
|
|
516
|
+
isOwn = hasown(value, part);
|
|
452
517
|
value = value[part];
|
|
453
518
|
}
|
|
454
519
|
|
|
@@ -460,6 +525,8 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
460
525
|
return value;
|
|
461
526
|
};
|
|
462
527
|
|
|
528
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
529
|
+
|
|
463
530
|
function createCommonjsModule(fn, basedir, module) {
|
|
464
531
|
return module = {
|
|
465
532
|
path: basedir,
|
|
@@ -489,50 +556,170 @@ function commonjsRequire () {
|
|
|
489
556
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
490
557
|
}
|
|
491
558
|
|
|
559
|
+
/** @type {import('.')} */
|
|
560
|
+
var $defineProperty = getIntrinsic('%Object.defineProperty%', true) || false;
|
|
561
|
+
if ($defineProperty) {
|
|
562
|
+
try {
|
|
563
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
564
|
+
} catch (e) {
|
|
565
|
+
// IE 8 has a broken defineProperty
|
|
566
|
+
$defineProperty = false;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
var esDefineProperty = $defineProperty;
|
|
571
|
+
|
|
572
|
+
var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
573
|
+
|
|
574
|
+
if ($gOPD) {
|
|
575
|
+
try {
|
|
576
|
+
$gOPD([], 'length');
|
|
577
|
+
} catch (e) {
|
|
578
|
+
// IE 8 has a broken gOPD
|
|
579
|
+
$gOPD = null;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
var gopd = $gOPD;
|
|
584
|
+
|
|
585
|
+
/** @type {import('.')} */
|
|
586
|
+
var defineDataProperty = function defineDataProperty(
|
|
587
|
+
obj,
|
|
588
|
+
property,
|
|
589
|
+
value
|
|
590
|
+
) {
|
|
591
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
592
|
+
throw new type('`obj` must be an object or a function`');
|
|
593
|
+
}
|
|
594
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
595
|
+
throw new type('`property` must be a string or a symbol`');
|
|
596
|
+
}
|
|
597
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
598
|
+
throw new type('`nonEnumerable`, if provided, must be a boolean or null');
|
|
599
|
+
}
|
|
600
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
601
|
+
throw new type('`nonWritable`, if provided, must be a boolean or null');
|
|
602
|
+
}
|
|
603
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
604
|
+
throw new type('`nonConfigurable`, if provided, must be a boolean or null');
|
|
605
|
+
}
|
|
606
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
607
|
+
throw new type('`loose`, if provided, must be a boolean');
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
611
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
612
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
613
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
614
|
+
|
|
615
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
616
|
+
var desc = !!gopd && gopd(obj, property);
|
|
617
|
+
|
|
618
|
+
if (esDefineProperty) {
|
|
619
|
+
esDefineProperty(obj, property, {
|
|
620
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
621
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
622
|
+
value: value,
|
|
623
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
624
|
+
});
|
|
625
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
626
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
627
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
628
|
+
} else {
|
|
629
|
+
throw new syntax('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
634
|
+
return !!esDefineProperty;
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
638
|
+
// node v0.6 has a bug where array lengths can be Set but not Defined
|
|
639
|
+
if (!esDefineProperty) {
|
|
640
|
+
return null;
|
|
641
|
+
}
|
|
642
|
+
try {
|
|
643
|
+
return esDefineProperty([], 'length', { value: 1 }).length !== 1;
|
|
644
|
+
} catch (e) {
|
|
645
|
+
// In Firefox 4-22, defining length on an array throws an exception.
|
|
646
|
+
return true;
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
var hasPropertyDescriptors_1 = hasPropertyDescriptors;
|
|
651
|
+
|
|
652
|
+
var hasDescriptors = hasPropertyDescriptors_1();
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
var $floor$1 = getIntrinsic('%Math.floor%');
|
|
657
|
+
|
|
658
|
+
/** @type {import('.')} */
|
|
659
|
+
var setFunctionLength = function setFunctionLength(fn, length) {
|
|
660
|
+
if (typeof fn !== 'function') {
|
|
661
|
+
throw new type('`fn` is not a function');
|
|
662
|
+
}
|
|
663
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
|
|
664
|
+
throw new type('`length` must be a positive 32-bit integer');
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
668
|
+
|
|
669
|
+
var functionLengthIsConfigurable = true;
|
|
670
|
+
var functionLengthIsWritable = true;
|
|
671
|
+
if ('length' in fn && gopd) {
|
|
672
|
+
var desc = gopd(fn, 'length');
|
|
673
|
+
if (desc && !desc.configurable) {
|
|
674
|
+
functionLengthIsConfigurable = false;
|
|
675
|
+
}
|
|
676
|
+
if (desc && !desc.writable) {
|
|
677
|
+
functionLengthIsWritable = false;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
682
|
+
if (hasDescriptors) {
|
|
683
|
+
defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
684
|
+
} else {
|
|
685
|
+
defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return fn;
|
|
689
|
+
};
|
|
690
|
+
|
|
492
691
|
var callBind = createCommonjsModule(function (module) {
|
|
493
692
|
|
|
494
693
|
|
|
495
694
|
|
|
496
695
|
|
|
696
|
+
|
|
697
|
+
|
|
497
698
|
var $apply = getIntrinsic('%Function.prototype.apply%');
|
|
498
699
|
var $call = getIntrinsic('%Function.prototype.call%');
|
|
499
700
|
var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
|
|
500
701
|
|
|
501
|
-
var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
502
|
-
var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
|
|
503
|
-
var $max = getIntrinsic('%Math.max%');
|
|
504
702
|
|
|
505
|
-
|
|
506
|
-
try {
|
|
507
|
-
$defineProperty({}, 'a', { value: 1 });
|
|
508
|
-
} catch (e) {
|
|
509
|
-
// IE 8 has a broken defineProperty
|
|
510
|
-
$defineProperty = null;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
703
|
+
var $max = getIntrinsic('%Math.max%');
|
|
513
704
|
|
|
514
705
|
module.exports = function callBind(originalFunction) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
var desc = $gOPD(func, 'length');
|
|
518
|
-
if (desc.configurable) {
|
|
519
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
520
|
-
$defineProperty(
|
|
521
|
-
func,
|
|
522
|
-
'length',
|
|
523
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
524
|
-
);
|
|
525
|
-
}
|
|
706
|
+
if (typeof originalFunction !== 'function') {
|
|
707
|
+
throw new type('a function is required');
|
|
526
708
|
}
|
|
527
|
-
|
|
709
|
+
var func = $reflectApply(functionBind, $call, arguments);
|
|
710
|
+
return setFunctionLength(
|
|
711
|
+
func,
|
|
712
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
713
|
+
true
|
|
714
|
+
);
|
|
528
715
|
};
|
|
529
716
|
|
|
530
717
|
var applyBind = function applyBind() {
|
|
531
718
|
return $reflectApply(functionBind, $apply, arguments);
|
|
532
719
|
};
|
|
533
720
|
|
|
534
|
-
if (
|
|
535
|
-
|
|
721
|
+
if (esDefineProperty) {
|
|
722
|
+
esDefineProperty(module.exports, 'apply', { value: applyBind });
|
|
536
723
|
} else {
|
|
537
724
|
module.exports.apply = applyBind;
|
|
538
725
|
}
|
|
@@ -551,8 +738,8 @@ var callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
|
551
738
|
const _nodeResolve_empty = {};
|
|
552
739
|
|
|
553
740
|
const _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
|
|
554
|
-
|
|
555
|
-
|
|
741
|
+
__proto__: null,
|
|
742
|
+
'default': _nodeResolve_empty
|
|
556
743
|
});
|
|
557
744
|
|
|
558
745
|
const utilInspect = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
|
|
@@ -798,6 +985,14 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
798
985
|
if (isString(obj)) {
|
|
799
986
|
return markBoxed(inspect(String(obj)));
|
|
800
987
|
}
|
|
988
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
989
|
+
/* eslint-env browser */
|
|
990
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
991
|
+
return '{ [object Window] }';
|
|
992
|
+
}
|
|
993
|
+
if (obj === commonjsGlobal) {
|
|
994
|
+
return '{ [object globalThis] }';
|
|
995
|
+
}
|
|
801
996
|
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
802
997
|
var ys = arrObjKeys(obj, inspect);
|
|
803
998
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
@@ -1074,7 +1269,6 @@ function arrObjKeys(obj, inspect) {
|
|
|
1074
1269
|
return xs;
|
|
1075
1270
|
}
|
|
1076
1271
|
|
|
1077
|
-
var $TypeError = getIntrinsic('%TypeError%');
|
|
1078
1272
|
var $WeakMap = getIntrinsic('%WeakMap%', true);
|
|
1079
1273
|
var $Map = getIntrinsic('%Map%', true);
|
|
1080
1274
|
|
|
@@ -1086,53 +1280,62 @@ var $mapSet = callBound('Map.prototype.set', true);
|
|
|
1086
1280
|
var $mapHas = callBound('Map.prototype.has', true);
|
|
1087
1281
|
|
|
1088
1282
|
/*
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
* used nodes can be accessed relatively quickly.
|
|
1095
|
-
*/
|
|
1283
|
+
* This function traverses the list returning the node corresponding to the given key.
|
|
1284
|
+
*
|
|
1285
|
+
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
|
|
1286
|
+
*/
|
|
1287
|
+
/** @type {import('.').listGetNode} */
|
|
1096
1288
|
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
1097
|
-
|
|
1289
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
1290
|
+
var prev = list;
|
|
1291
|
+
/** @type {(typeof list)['next']} */
|
|
1292
|
+
var curr;
|
|
1293
|
+
for (; (curr = prev.next) !== null; prev = curr) {
|
|
1098
1294
|
if (curr.key === key) {
|
|
1099
1295
|
prev.next = curr.next;
|
|
1100
|
-
|
|
1296
|
+
// eslint-disable-next-line no-extra-parens
|
|
1297
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
|
|
1101
1298
|
list.next = curr; // eslint-disable-line no-param-reassign
|
|
1102
1299
|
return curr;
|
|
1103
1300
|
}
|
|
1104
1301
|
}
|
|
1105
1302
|
};
|
|
1106
1303
|
|
|
1304
|
+
/** @type {import('.').listGet} */
|
|
1107
1305
|
var listGet = function (objects, key) {
|
|
1108
1306
|
var node = listGetNode(objects, key);
|
|
1109
1307
|
return node && node.value;
|
|
1110
1308
|
};
|
|
1309
|
+
/** @type {import('.').listSet} */
|
|
1111
1310
|
var listSet = function (objects, key, value) {
|
|
1112
1311
|
var node = listGetNode(objects, key);
|
|
1113
1312
|
if (node) {
|
|
1114
1313
|
node.value = value;
|
|
1115
1314
|
} else {
|
|
1116
1315
|
// Prepend the new node to the beginning of the list
|
|
1117
|
-
objects.next = { // eslint-disable-line no-param-reassign
|
|
1316
|
+
objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
|
|
1118
1317
|
key: key,
|
|
1119
1318
|
next: objects.next,
|
|
1120
1319
|
value: value
|
|
1121
|
-
};
|
|
1320
|
+
});
|
|
1122
1321
|
}
|
|
1123
1322
|
};
|
|
1323
|
+
/** @type {import('.').listHas} */
|
|
1124
1324
|
var listHas = function (objects, key) {
|
|
1125
1325
|
return !!listGetNode(objects, key);
|
|
1126
1326
|
};
|
|
1127
1327
|
|
|
1328
|
+
/** @type {import('.')} */
|
|
1128
1329
|
var sideChannel = function getSideChannel() {
|
|
1129
|
-
var $wm;
|
|
1130
|
-
var $m;
|
|
1131
|
-
var $o;
|
|
1330
|
+
/** @type {WeakMap<object, unknown>} */ var $wm;
|
|
1331
|
+
/** @type {Map<object, unknown>} */ var $m;
|
|
1332
|
+
/** @type {import('.').RootNode<unknown>} */ var $o;
|
|
1333
|
+
|
|
1334
|
+
/** @type {import('.').Channel} */
|
|
1132
1335
|
var channel = {
|
|
1133
1336
|
assert: function (key) {
|
|
1134
1337
|
if (!channel.has(key)) {
|
|
1135
|
-
throw new
|
|
1338
|
+
throw new type('Side channel does not contain ' + objectInspect(key));
|
|
1136
1339
|
}
|
|
1137
1340
|
},
|
|
1138
1341
|
get: function (key) { // eslint-disable-line consistent-return
|
|
@@ -1179,11 +1382,7 @@ var sideChannel = function getSideChannel() {
|
|
|
1179
1382
|
$mapSet($m, key, value);
|
|
1180
1383
|
} else {
|
|
1181
1384
|
if (!$o) {
|
|
1182
|
-
|
|
1183
|
-
* Initialize the linked list as an empty node, so that we don't have
|
|
1184
|
-
* to special-case handling of the first node: we can always refer to
|
|
1185
|
-
* it as (previous node).next, instead of something like (list).head
|
|
1186
|
-
*/
|
|
1385
|
+
// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
|
|
1187
1386
|
$o = { key: {}, next: null };
|
|
1188
1387
|
}
|
|
1189
1388
|
listSet($o, key, value);
|
|
@@ -1491,10 +1690,13 @@ var defaultFormat = formats['default'];
|
|
|
1491
1690
|
var defaults$1 = {
|
|
1492
1691
|
addQueryPrefix: false,
|
|
1493
1692
|
allowDots: false,
|
|
1693
|
+
allowEmptyArrays: false,
|
|
1694
|
+
arrayFormat: 'indices',
|
|
1494
1695
|
charset: 'utf-8',
|
|
1495
1696
|
charsetSentinel: false,
|
|
1496
1697
|
delimiter: '&',
|
|
1497
1698
|
encode: true,
|
|
1699
|
+
encodeDotInKeys: false,
|
|
1498
1700
|
encoder: utils.encode,
|
|
1499
1701
|
encodeValuesOnly: false,
|
|
1500
1702
|
format: defaultFormat,
|
|
@@ -1523,8 +1725,10 @@ var stringify = function stringify(
|
|
|
1523
1725
|
prefix,
|
|
1524
1726
|
generateArrayPrefix,
|
|
1525
1727
|
commaRoundTrip,
|
|
1728
|
+
allowEmptyArrays,
|
|
1526
1729
|
strictNullHandling,
|
|
1527
1730
|
skipNulls,
|
|
1731
|
+
encodeDotInKeys,
|
|
1528
1732
|
encoder,
|
|
1529
1733
|
filter,
|
|
1530
1734
|
sort,
|
|
@@ -1606,7 +1810,13 @@ var stringify = function stringify(
|
|
|
1606
1810
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
1607
1811
|
}
|
|
1608
1812
|
|
|
1609
|
-
var
|
|
1813
|
+
var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
|
|
1814
|
+
|
|
1815
|
+
var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
1816
|
+
|
|
1817
|
+
if (allowEmptyArrays && isArray$1(obj) && obj.length === 0) {
|
|
1818
|
+
return adjustedPrefix + '[]';
|
|
1819
|
+
}
|
|
1610
1820
|
|
|
1611
1821
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
1612
1822
|
var key = objKeys[j];
|
|
@@ -1616,9 +1826,10 @@ var stringify = function stringify(
|
|
|
1616
1826
|
continue;
|
|
1617
1827
|
}
|
|
1618
1828
|
|
|
1829
|
+
var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
|
|
1619
1830
|
var keyPrefix = isArray$1(obj)
|
|
1620
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix,
|
|
1621
|
-
: adjustedPrefix + (allowDots ? '.' +
|
|
1831
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
1832
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
1622
1833
|
|
|
1623
1834
|
sideChannel$1.set(object, step);
|
|
1624
1835
|
var valueSideChannel = sideChannel();
|
|
@@ -1628,8 +1839,10 @@ var stringify = function stringify(
|
|
|
1628
1839
|
keyPrefix,
|
|
1629
1840
|
generateArrayPrefix,
|
|
1630
1841
|
commaRoundTrip,
|
|
1842
|
+
allowEmptyArrays,
|
|
1631
1843
|
strictNullHandling,
|
|
1632
1844
|
skipNulls,
|
|
1845
|
+
encodeDotInKeys,
|
|
1633
1846
|
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
|
|
1634
1847
|
filter,
|
|
1635
1848
|
sort,
|
|
@@ -1651,6 +1864,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1651
1864
|
return defaults$1;
|
|
1652
1865
|
}
|
|
1653
1866
|
|
|
1867
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
1868
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
1872
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1654
1875
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
1655
1876
|
throw new TypeError('Encoder has to be a function.');
|
|
1656
1877
|
}
|
|
@@ -1674,13 +1895,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1674
1895
|
filter = opts.filter;
|
|
1675
1896
|
}
|
|
1676
1897
|
|
|
1898
|
+
var arrayFormat;
|
|
1899
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
1900
|
+
arrayFormat = opts.arrayFormat;
|
|
1901
|
+
} else if ('indices' in opts) {
|
|
1902
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
1903
|
+
} else {
|
|
1904
|
+
arrayFormat = defaults$1.arrayFormat;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
1908
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
|
|
1912
|
+
|
|
1677
1913
|
return {
|
|
1678
1914
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
|
|
1679
|
-
allowDots:
|
|
1915
|
+
allowDots: allowDots,
|
|
1916
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
|
|
1917
|
+
arrayFormat: arrayFormat,
|
|
1680
1918
|
charset: charset,
|
|
1681
1919
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
1920
|
+
commaRoundTrip: opts.commaRoundTrip,
|
|
1682
1921
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
|
|
1683
1922
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
|
|
1923
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults$1.encodeDotInKeys,
|
|
1684
1924
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
|
|
1685
1925
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
|
|
1686
1926
|
filter: filter,
|
|
@@ -1714,20 +1954,8 @@ var stringify_1 = function (object, opts) {
|
|
|
1714
1954
|
return '';
|
|
1715
1955
|
}
|
|
1716
1956
|
|
|
1717
|
-
var arrayFormat;
|
|
1718
|
-
|
|
1719
|
-
arrayFormat = opts.arrayFormat;
|
|
1720
|
-
} else if (opts && 'indices' in opts) {
|
|
1721
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
1722
|
-
} else {
|
|
1723
|
-
arrayFormat = 'indices';
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
1727
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
1728
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
1729
|
-
}
|
|
1730
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
1957
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
1958
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
1731
1959
|
|
|
1732
1960
|
if (!objKeys) {
|
|
1733
1961
|
objKeys = Object.keys(obj);
|
|
@@ -1749,8 +1977,10 @@ var stringify_1 = function (object, opts) {
|
|
|
1749
1977
|
key,
|
|
1750
1978
|
generateArrayPrefix,
|
|
1751
1979
|
commaRoundTrip,
|
|
1980
|
+
options.allowEmptyArrays,
|
|
1752
1981
|
options.strictNullHandling,
|
|
1753
1982
|
options.skipNulls,
|
|
1983
|
+
options.encodeDotInKeys,
|
|
1754
1984
|
options.encode ? options.encoder : null,
|
|
1755
1985
|
options.filter,
|
|
1756
1986
|
options.sort,
|
|
@@ -1785,15 +2015,18 @@ var isArray = Array.isArray;
|
|
|
1785
2015
|
|
|
1786
2016
|
var defaults = {
|
|
1787
2017
|
allowDots: false,
|
|
2018
|
+
allowEmptyArrays: false,
|
|
1788
2019
|
allowPrototypes: false,
|
|
1789
2020
|
allowSparse: false,
|
|
1790
2021
|
arrayLimit: 20,
|
|
1791
2022
|
charset: 'utf-8',
|
|
1792
2023
|
charsetSentinel: false,
|
|
1793
2024
|
comma: false,
|
|
2025
|
+
decodeDotInKeys: true,
|
|
1794
2026
|
decoder: utils.decode,
|
|
1795
2027
|
delimiter: '&',
|
|
1796
2028
|
depth: 5,
|
|
2029
|
+
duplicates: 'combine',
|
|
1797
2030
|
ignoreQueryPrefix: false,
|
|
1798
2031
|
interpretNumericEntities: false,
|
|
1799
2032
|
parameterLimit: 1000,
|
|
@@ -1827,7 +2060,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
|
1827
2060
|
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
1828
2061
|
|
|
1829
2062
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
1830
|
-
var obj = {};
|
|
2063
|
+
var obj = { __proto__: null };
|
|
2064
|
+
|
|
1831
2065
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
1832
2066
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
1833
2067
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
@@ -1880,9 +2114,10 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
1880
2114
|
val = isArray(val) ? [val] : val;
|
|
1881
2115
|
}
|
|
1882
2116
|
|
|
1883
|
-
|
|
2117
|
+
var existing = has.call(obj, key);
|
|
2118
|
+
if (existing && options.duplicates === 'combine') {
|
|
1884
2119
|
obj[key] = utils.combine(obj[key], val);
|
|
1885
|
-
} else {
|
|
2120
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
1886
2121
|
obj[key] = val;
|
|
1887
2122
|
}
|
|
1888
2123
|
}
|
|
@@ -1898,24 +2133,25 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
1898
2133
|
var root = chain[i];
|
|
1899
2134
|
|
|
1900
2135
|
if (root === '[]' && options.parseArrays) {
|
|
1901
|
-
obj = [].concat(leaf);
|
|
2136
|
+
obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf);
|
|
1902
2137
|
} else {
|
|
1903
2138
|
obj = options.plainObjects ? Object.create(null) : {};
|
|
1904
2139
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
1905
|
-
var
|
|
1906
|
-
|
|
2140
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
2141
|
+
var index = parseInt(decodedRoot, 10);
|
|
2142
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
1907
2143
|
obj = { 0: leaf };
|
|
1908
2144
|
} else if (
|
|
1909
2145
|
!isNaN(index)
|
|
1910
|
-
&& root !==
|
|
1911
|
-
&& String(index) ===
|
|
2146
|
+
&& root !== decodedRoot
|
|
2147
|
+
&& String(index) === decodedRoot
|
|
1912
2148
|
&& index >= 0
|
|
1913
2149
|
&& (options.parseArrays && index <= options.arrayLimit)
|
|
1914
2150
|
) {
|
|
1915
2151
|
obj = [];
|
|
1916
2152
|
obj[index] = leaf;
|
|
1917
|
-
} else if (
|
|
1918
|
-
obj[
|
|
2153
|
+
} else if (decodedRoot !== '__proto__') {
|
|
2154
|
+
obj[decodedRoot] = leaf;
|
|
1919
2155
|
}
|
|
1920
2156
|
}
|
|
1921
2157
|
|
|
@@ -1984,7 +2220,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
1984
2220
|
return defaults;
|
|
1985
2221
|
}
|
|
1986
2222
|
|
|
1987
|
-
if (
|
|
2223
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
2224
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
2228
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
1988
2232
|
throw new TypeError('Decoder has to be a function.');
|
|
1989
2233
|
}
|
|
1990
2234
|
|
|
@@ -1993,18 +2237,29 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
1993
2237
|
}
|
|
1994
2238
|
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
1995
2239
|
|
|
2240
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
2241
|
+
|
|
2242
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
2243
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
2247
|
+
|
|
1996
2248
|
return {
|
|
1997
|
-
allowDots:
|
|
2249
|
+
allowDots: allowDots,
|
|
2250
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
1998
2251
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
1999
2252
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
2000
2253
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
2001
2254
|
charset: charset,
|
|
2002
2255
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2003
2256
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
2257
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
2004
2258
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
2005
2259
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2006
2260
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2007
2261
|
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
2262
|
+
duplicates: duplicates,
|
|
2008
2263
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2009
2264
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2010
2265
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
@@ -2046,85 +2301,52 @@ var lib = {
|
|
|
2046
2301
|
stringify: stringify_1
|
|
2047
2302
|
};
|
|
2048
2303
|
|
|
2304
|
+
const limit = 100;
|
|
2049
2305
|
const fetchProductColorsQuery = (id, page) => lib.stringify({
|
|
2050
|
-
|
|
2306
|
+
fields: ['*', 'products.*'].join(','),
|
|
2307
|
+
filter: {
|
|
2051
2308
|
products: {
|
|
2052
|
-
|
|
2053
|
-
|
|
2309
|
+
Product_id: {
|
|
2310
|
+
_eq: id,
|
|
2054
2311
|
},
|
|
2055
2312
|
},
|
|
2056
2313
|
},
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
page: page || 1,
|
|
2061
|
-
pageSize: 100,
|
|
2062
|
-
},
|
|
2314
|
+
meta: '*',
|
|
2315
|
+
page: page || 1,
|
|
2316
|
+
limit,
|
|
2063
2317
|
}, {
|
|
2064
|
-
encodeValuesOnly: true,
|
|
2318
|
+
encodeValuesOnly: true,
|
|
2065
2319
|
});
|
|
2066
|
-
const fetchCategoryColorsQuery = (
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2320
|
+
const fetchCategoryColorsQuery = (id, page) => lib.stringify({
|
|
2321
|
+
fields: ['*', 'Category.*', 'products.*'].join(','),
|
|
2322
|
+
filter: {
|
|
2323
|
+
Category: {
|
|
2324
|
+
Category_id: {
|
|
2325
|
+
_eq: id,
|
|
2071
2326
|
},
|
|
2072
2327
|
},
|
|
2073
2328
|
},
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
page: 1,
|
|
2078
|
-
pageSize: 100,
|
|
2079
|
-
},
|
|
2329
|
+
meta: '*',
|
|
2330
|
+
page: page || 1,
|
|
2331
|
+
limit,
|
|
2080
2332
|
}, {
|
|
2081
|
-
encodeValuesOnly: true,
|
|
2333
|
+
encodeValuesOnly: true,
|
|
2082
2334
|
});
|
|
2083
|
-
const fetchColorByNumber = (
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
number: {
|
|
2090
|
-
$contains: colorNumber,
|
|
2091
|
-
},
|
|
2092
|
-
},
|
|
2093
|
-
{
|
|
2094
|
-
products: {
|
|
2095
|
-
id: {
|
|
2096
|
-
$eq: productId,
|
|
2097
|
-
},
|
|
2098
|
-
},
|
|
2099
|
-
},
|
|
2100
|
-
],
|
|
2335
|
+
const fetchColorByNumber = (id, colorNumber) => lib.stringify({
|
|
2336
|
+
fields: ['*', 'Category.*'].join(','),
|
|
2337
|
+
filter: {
|
|
2338
|
+
Category: {
|
|
2339
|
+
Category_id: {
|
|
2340
|
+
_eq: id,
|
|
2101
2341
|
},
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
$contains: colorNumber,
|
|
2107
|
-
},
|
|
2108
|
-
},
|
|
2109
|
-
{
|
|
2110
|
-
products: {
|
|
2111
|
-
id: {
|
|
2112
|
-
$eq: productId,
|
|
2113
|
-
},
|
|
2114
|
-
},
|
|
2115
|
-
},
|
|
2116
|
-
],
|
|
2117
|
-
},
|
|
2118
|
-
],
|
|
2119
|
-
},
|
|
2120
|
-
sort: ['position:asc'],
|
|
2121
|
-
populate: ['image', 'category', 'product', 'links', 'links.shop'],
|
|
2122
|
-
pagination: {
|
|
2123
|
-
page: 1,
|
|
2124
|
-
pageSize: 100,
|
|
2342
|
+
},
|
|
2343
|
+
number: {
|
|
2344
|
+
_contains: colorNumber,
|
|
2345
|
+
},
|
|
2125
2346
|
},
|
|
2347
|
+
meta: '*',
|
|
2126
2348
|
}, {
|
|
2127
|
-
encodeValuesOnly: true,
|
|
2349
|
+
encodeValuesOnly: true,
|
|
2128
2350
|
});
|
|
2129
2351
|
|
|
2130
2352
|
const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:35px 40px;max-height:calc(100vh - 100px);overflow-y:auto}@media (max-width: 1024px){.my-modal{padding:80px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal>img{width:300px;object-fit:cover}@media (max-width: 768px){.my-modal>img{width:200px}}.my-modal__close{position:absolute;right:20px;top:20px;background:transparent;border:none}.my-modal__close>img{width:45px;height:45px;object-fit:cover;cursor:pointer}@media (max-width: 1024px){.my-modal__close{top:65px}}.my-modal__see-more{font-size:22px;margin-bottom:27px;display:flex;justify-content:center;align-items:center}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}@media (max-width: 1024px){.my-modal__wrapper .boxes__list{justify-content:center}}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content{margin:0 auto}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;text-transform:capitalize;margin-bottom:7px;color:#232323}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info .divider{margin:10px 0px}}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:row;justify-content:flex-start}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-image{margin:0 auto;margin-bottom:10px}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product>div{flex-direction:column}}.my-modal__wrapper .boxes__box-content__slider{width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}.my-modal .button,.my-modal a{background-color:#fff;font-size:16px;box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.1);border-radius:22.5px;padding:15px 30px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer}.my-modal .button:hover,.my-modal a:hover{color:#fff;background-color:#232323}.my-modal .button.inverse,.my-modal a.inverse{background-color:#232323;color:#fff}.my-modal .button.inverse:hover,.my-modal a.inverse:hover{color:#232323;background-color:#fff}@media (max-width: 1024px){.my-modal .button,.my-modal a{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.my-modal .button,.my-modal a{margin:0 auto}}.my-modal>.button{margin:10px auto}";
|
|
@@ -2133,6 +2355,7 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2133
2355
|
constructor() {
|
|
2134
2356
|
super();
|
|
2135
2357
|
this.__registerHost();
|
|
2358
|
+
this.clearSearchText = createEvent(this, "clearSearchText", 7);
|
|
2136
2359
|
this.close = createEvent(this, "close", 7);
|
|
2137
2360
|
this.readyToCLose = createEvent(this, "readyToCLose", 7);
|
|
2138
2361
|
this.boxDesktopWidth = 130;
|
|
@@ -2188,10 +2411,18 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2188
2411
|
};
|
|
2189
2412
|
this.fetchProductData = async () => {
|
|
2190
2413
|
try {
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2414
|
+
const shopResponse = await ApiService.getData(`items/Shop?filter[name][_eq]=${this.shop}`);
|
|
2415
|
+
const shop = shopResponse === null || shopResponse === void 0 ? void 0 : shopResponse.data[0];
|
|
2416
|
+
if (shop.id) {
|
|
2417
|
+
const response = await ApiService.getData(`items/Product?filter[name][_eq]=${this.product}&fields=*,images.*,Shop.*,Category.*.*.*.*`);
|
|
2418
|
+
const product = response === null || response === void 0 ? void 0 : response.data[0];
|
|
2419
|
+
if (product) {
|
|
2420
|
+
if (product.Shop.find((s) => s.Shop_id === shop.id)) {
|
|
2421
|
+
this.data = Object.assign(Object.assign({}, response.data[0]), { id: response.data[0].id });
|
|
2422
|
+
}
|
|
2423
|
+
else {
|
|
2424
|
+
return null;
|
|
2425
|
+
}
|
|
2195
2426
|
}
|
|
2196
2427
|
}
|
|
2197
2428
|
}
|
|
@@ -2202,17 +2433,16 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2202
2433
|
this.preloader = false;
|
|
2203
2434
|
}
|
|
2204
2435
|
};
|
|
2205
|
-
// TODO:
|
|
2206
2436
|
this.fetchProductColors = async (id, page) => {
|
|
2207
2437
|
this.loading = true;
|
|
2208
2438
|
try {
|
|
2209
|
-
const response = await ApiService.getData(`
|
|
2439
|
+
const response = await ApiService.getData(`items/Color?${fetchProductColorsQuery(id, page)}`);
|
|
2210
2440
|
if (response) {
|
|
2211
2441
|
this.colors = {
|
|
2212
2442
|
list: response &&
|
|
2213
2443
|
response.data &&
|
|
2214
|
-
response.data.map((item) => (Object.assign({
|
|
2215
|
-
pagination: response.meta
|
|
2444
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2445
|
+
pagination: response.meta,
|
|
2216
2446
|
};
|
|
2217
2447
|
}
|
|
2218
2448
|
}
|
|
@@ -2223,16 +2453,16 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2223
2453
|
this.loading = false;
|
|
2224
2454
|
}
|
|
2225
2455
|
};
|
|
2226
|
-
this.fetchCategoryColors = async (
|
|
2456
|
+
this.fetchCategoryColors = async (id, page) => {
|
|
2227
2457
|
this.loading = true;
|
|
2228
2458
|
try {
|
|
2229
|
-
const response = await ApiService.getData(`
|
|
2459
|
+
const response = await ApiService.getData(`items/Color?${fetchCategoryColorsQuery(id, page)}`);
|
|
2230
2460
|
if (response) {
|
|
2231
2461
|
this.colors = {
|
|
2232
2462
|
list: response &&
|
|
2233
2463
|
response.data &&
|
|
2234
|
-
response.data.map((item) => (Object.assign({
|
|
2235
|
-
pagination: response.meta
|
|
2464
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2465
|
+
pagination: response.meta,
|
|
2236
2466
|
};
|
|
2237
2467
|
}
|
|
2238
2468
|
}
|
|
@@ -2243,29 +2473,21 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2243
2473
|
this.loading = false;
|
|
2244
2474
|
}
|
|
2245
2475
|
};
|
|
2246
|
-
// private onIntersection = async (entries: any) => {
|
|
2247
|
-
// console.log(entries[0]);
|
|
2248
|
-
// if (entries[0].intersectionRatio === 0) {
|
|
2249
|
-
// console.log('d');
|
|
2250
|
-
// }
|
|
2251
|
-
// };
|
|
2252
|
-
// private handleObserve = () => {
|
|
2253
|
-
// console.log(this.modalEl.shadowRoot);
|
|
2254
|
-
// const boxesList: any = (this.modalEl as any).querySelector('.my-modal__wrapper');
|
|
2255
|
-
// console.log(boxesList);
|
|
2256
|
-
// if (boxesList) {
|
|
2257
|
-
// this.observer = new IntersectionObserver(this.onIntersection);
|
|
2258
|
-
// this.observer.observe(boxesList);
|
|
2259
|
-
// }
|
|
2260
|
-
// };
|
|
2261
2476
|
this.onPage = (page) => {
|
|
2262
|
-
|
|
2477
|
+
if (this.data) {
|
|
2478
|
+
if (this.selectedCategory) {
|
|
2479
|
+
this.fetchCategoryColors(this.selectedCategory, page);
|
|
2480
|
+
}
|
|
2481
|
+
else {
|
|
2482
|
+
this.fetchProductColors(String(this.data.id), page);
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2263
2485
|
this.page = page;
|
|
2264
2486
|
this.currentColor = null;
|
|
2265
2487
|
this.currentIndex = null;
|
|
2266
2488
|
};
|
|
2267
2489
|
this.handleCategoryClick = (color) => {
|
|
2268
|
-
if (this.selectedCategory && color && this.selectedCategory
|
|
2490
|
+
if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
|
|
2269
2491
|
this.data && this.fetchProductColors(String(this.data.id));
|
|
2270
2492
|
this.selectedCategory = null;
|
|
2271
2493
|
}
|
|
@@ -2274,6 +2496,7 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2274
2496
|
this.selectedCategory = color;
|
|
2275
2497
|
}
|
|
2276
2498
|
this.currentColor = null;
|
|
2499
|
+
this.clearSearchText.emit();
|
|
2277
2500
|
};
|
|
2278
2501
|
this.shop = undefined;
|
|
2279
2502
|
this.product = undefined;
|
|
@@ -2299,9 +2522,9 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2299
2522
|
this.infoBoxWidth = newValue * this.boxWidth;
|
|
2300
2523
|
}
|
|
2301
2524
|
watchPropHandler(newValue) {
|
|
2302
|
-
if (newValue.
|
|
2525
|
+
if (newValue.Category.length > 0) {
|
|
2303
2526
|
this.showRange = true;
|
|
2304
|
-
this.handleCategoryClick(newValue.
|
|
2527
|
+
this.handleCategoryClick(newValue.Category[0].Category_id.id);
|
|
2305
2528
|
}
|
|
2306
2529
|
else {
|
|
2307
2530
|
this.fetchProductColors(String(newValue.id));
|
|
@@ -2325,21 +2548,23 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2325
2548
|
this.displayForMobile();
|
|
2326
2549
|
}
|
|
2327
2550
|
async searchColorsHandler(event) {
|
|
2328
|
-
|
|
2551
|
+
this.loading = true;
|
|
2552
|
+
this.currentColor = null;
|
|
2329
2553
|
// if search is empty set to first category to not showing whole product colors
|
|
2330
2554
|
if (event.detail === '') {
|
|
2331
|
-
this.handleCategoryClick(
|
|
2555
|
+
this.handleCategoryClick(this.selectedCategory);
|
|
2556
|
+
this.loading = true;
|
|
2332
2557
|
}
|
|
2333
2558
|
try {
|
|
2334
2559
|
if (this.data && this.data.id && event.detail !== '') {
|
|
2335
|
-
this.selectedCategory
|
|
2336
|
-
const response = await ApiService.getData(`colors?${fetchColorByNumber(Number(this.data.id), event.detail)}`);
|
|
2560
|
+
const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);
|
|
2337
2561
|
if (response) {
|
|
2338
2562
|
this.colors = {
|
|
2339
|
-
list: response &&
|
|
2563
|
+
list: (response &&
|
|
2340
2564
|
response.data &&
|
|
2341
|
-
response.data.map((item) => (Object.assign({
|
|
2342
|
-
|
|
2565
|
+
response.data.map((item) => (Object.assign({}, item)))) ||
|
|
2566
|
+
[],
|
|
2567
|
+
pagination: response.meta,
|
|
2343
2568
|
};
|
|
2344
2569
|
}
|
|
2345
2570
|
}
|
|
@@ -2347,6 +2572,9 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2347
2572
|
catch (error) {
|
|
2348
2573
|
console.error(error);
|
|
2349
2574
|
}
|
|
2575
|
+
finally {
|
|
2576
|
+
this.loading = false;
|
|
2577
|
+
}
|
|
2350
2578
|
}
|
|
2351
2579
|
componentWillLoad() {
|
|
2352
2580
|
this.preloader = true;
|
|
@@ -2358,11 +2586,9 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2358
2586
|
this.colorTimer();
|
|
2359
2587
|
}
|
|
2360
2588
|
render() {
|
|
2361
|
-
var _a, _b, _c, _d
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
return (h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c), color: c.attributes.hex, name: c.attributes.name, shop: this.shop, product: this.product, isCategoryActive: ((_a = this.selectedCategory) === null || _a === void 0 ? void 0 : _a.id) === c.id }));
|
|
2365
|
-
})), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2589
|
+
var _a, _b, _c, _d;
|
|
2590
|
+
console.log(this.colors);
|
|
2591
|
+
return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && (h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription)), this.showRange && (h("div", { class: 'categories' }, this.data && h("my-search", { productId: Number((_c = this.data) === null || _c === void 0 ? void 0 : _c.id), isMobile: this.isMobile }), h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_d = this.data) === null || _d === void 0 ? void 0 : _d.Category.map((c) => (h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c.Category_id.id), color: c.Category_id.hex, name: c.Category_id.category_name, shop: this.shop, product: this.product, isCategoryActive: this.selectedCategory === c.Category_id.id })))), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2366
2592
|
var _a;
|
|
2367
2593
|
return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
|
|
2368
2594
|
var _a;
|
|
@@ -2381,10 +2607,10 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2381
2607
|
];
|
|
2382
2608
|
}, color: c.hex, name: c.name, isActive: ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) === c.id, shop: this.shop, product: this.product }));
|
|
2383
2609
|
})), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth }))));
|
|
2384
|
-
})) : (h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.
|
|
2610
|
+
})) : (h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.filter_count > limit && (h("div", { class: 'pagination' }, Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
|
|
2385
2611
|
e.preventDefault();
|
|
2386
2612
|
this.onPage(i + 1);
|
|
2387
|
-
}, key: `#${i + 1
|
|
2613
|
+
}, key: `#${i + 1}` }, i + 1)))))))), !this.preloader && this.isMobile && (h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
|
|
2388
2614
|
}
|
|
2389
2615
|
static get assetsDirs() { return ["assets"]; }
|
|
2390
2616
|
get modalEl() { return this; }
|