@instockng/storefront-ui 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/components/OrderConfirmation.d.ts.map +1 -1
  2. package/dist/components/ui/button.d.ts +1 -1
  3. package/dist/index10.mjs +3 -3
  4. package/dist/index100.mjs +33 -5
  5. package/dist/index101.mjs +31 -33
  6. package/dist/index102.mjs +26 -29
  7. package/dist/index103.mjs +59 -26
  8. package/dist/index104.mjs +3 -61
  9. package/dist/index105.mjs +2 -3
  10. package/dist/index106.mjs +2 -2
  11. package/dist/index107.mjs +17 -2
  12. package/dist/index108.mjs +11 -15
  13. package/dist/index109.mjs +6 -13
  14. package/dist/index11.mjs +2 -2
  15. package/dist/index110.mjs +30 -6
  16. package/dist/index13.mjs +1 -1
  17. package/dist/index17.mjs +2 -2
  18. package/dist/index18.mjs +12 -21
  19. package/dist/index20.mjs +4 -9
  20. package/dist/index21.mjs +1 -1
  21. package/dist/index28.mjs +11 -11
  22. package/dist/index29.mjs +1 -1
  23. package/dist/index30.mjs +1 -1
  24. package/dist/index31.mjs +1 -1
  25. package/dist/index32.mjs +1 -1
  26. package/dist/index33.mjs +1433 -4
  27. package/dist/index34.mjs +2 -1433
  28. package/dist/index35.mjs +57 -2
  29. package/dist/index36.mjs +48 -54
  30. package/dist/index37.mjs +33 -51
  31. package/dist/index38.mjs +15 -33
  32. package/dist/index39.mjs +2260 -12
  33. package/dist/index4.mjs +37 -37
  34. package/dist/index40.mjs +36 -2263
  35. package/dist/index41.mjs +44 -36
  36. package/dist/index42.mjs +99 -44
  37. package/dist/index43.mjs +97 -99
  38. package/dist/index44.mjs +47 -78
  39. package/dist/index45.mjs +54 -53
  40. package/dist/index46.mjs +63 -55
  41. package/dist/index47.mjs +56 -79
  42. package/dist/index48.mjs +57 -63
  43. package/dist/index49.mjs +15 -70
  44. package/dist/index50.mjs +14 -14
  45. package/dist/index51.mjs +59 -13
  46. package/dist/index52.mjs +99 -36
  47. package/dist/index53.mjs +97 -97
  48. package/dist/index54.mjs +4 -132
  49. package/dist/index58.mjs +2 -2
  50. package/dist/index59.mjs +234 -3
  51. package/dist/index60.mjs +6 -2
  52. package/dist/index61.mjs +133 -4
  53. package/dist/index62.mjs +64 -30
  54. package/dist/index63.mjs +84 -40
  55. package/dist/index64.mjs +23 -229
  56. package/dist/index65.mjs +8 -5
  57. package/dist/index66.mjs +66 -125
  58. package/dist/index67.mjs +3 -67
  59. package/dist/index68.mjs +2 -87
  60. package/dist/index69.mjs +78 -24
  61. package/dist/index70.mjs +52 -7
  62. package/dist/index71.mjs +5 -74
  63. package/dist/index72.mjs +4 -3
  64. package/dist/index73.mjs +179 -2
  65. package/dist/index74.mjs +49 -79
  66. package/dist/index75.mjs +68 -53
  67. package/dist/index76.mjs +34 -6
  68. package/dist/index77.mjs +42 -4
  69. package/dist/index78.mjs +3 -178
  70. package/dist/index79.mjs +2 -53
  71. package/dist/index80.mjs +21 -69
  72. package/dist/index81.mjs +54 -19
  73. package/dist/index82.mjs +28 -55
  74. package/dist/index83.mjs +5 -27
  75. package/dist/index84.mjs +51 -6
  76. package/dist/index85.mjs +5 -51
  77. package/dist/index86.mjs +12 -6
  78. package/dist/index87.mjs +7 -12
  79. package/dist/index88.mjs +27 -6
  80. package/dist/index89.mjs +2 -28
  81. package/dist/index90.mjs +70 -2
  82. package/dist/index91.mjs +164 -67
  83. package/dist/index92.mjs +28 -164
  84. package/dist/index93.mjs +10 -30
  85. package/dist/index94.mjs +3 -10
  86. package/dist/index95.mjs +3 -3
  87. package/dist/index96.mjs +13 -4
  88. package/dist/index97.mjs +7 -13
  89. package/dist/index98.mjs +12 -7
  90. package/dist/index99.mjs +4 -11
  91. package/dist/styles.css +1 -1
  92. package/package.json +11 -11
  93. package/src/components/OrderConfirmation.tsx +6 -1
  94. package/dist/index111.mjs +0 -33
  95. package/dist/test-utils/MockCartProvider.d.ts +0 -21
  96. package/dist/test-utils/MockCartProvider.d.ts.map +0 -1
package/dist/index54.mjs CHANGED
@@ -1,136 +1,8 @@
1
1
  'use client';
2
- import { useQueryClient as y, useMutation as v } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as m } from "./index61.mjs";
4
- import { createAdminRpcClients as u, authHeaders as l } from "./index21.mjs";
5
- import { queryKeys as o } from "./index26.mjs";
6
- import { useApiConfig as c } from "./index19.mjs";
7
- function p(t) {
8
- const { baseURL: s, authToken: i } = c();
9
- return m({
10
- queryKey: o.admin.deliveryZones.states.list(),
11
- queryFn: async () => {
12
- const e = await u(s).deliveryZones.states.$get({}, l(i));
13
- if (!e.ok) throw new Error(`Failed to fetch states: ${e.statusText}`);
14
- return e.json();
15
- },
16
- ...t
17
- });
18
- }
19
- function k(t) {
20
- const { baseURL: s, authToken: i } = c(), r = y();
21
- return v({
22
- mutationFn: async (e) => {
23
- const n = await u(s).deliveryZones.states.$post({ json: e }, l(i));
24
- if (!n.ok) throw new Error(`Failed to create state: ${n.statusText}`);
25
- return n.json();
26
- },
27
- onSuccess: () => {
28
- r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
29
- },
30
- ...t
31
- });
32
- }
33
- function F(t, s) {
34
- const { baseURL: i, authToken: r } = c(), e = y();
35
- return v({
36
- mutationFn: async (a) => {
37
- const d = await u(i).deliveryZones.states[":id"].$patch(
38
- { json: a, param: { id: t } },
39
- l(r)
40
- );
41
- if (!d.ok) throw new Error(`Failed to update state: ${d.statusText}`);
42
- return d.json();
43
- },
44
- onSuccess: () => {
45
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
46
- },
47
- ...s
48
- });
49
- }
50
- function T(t, s) {
51
- const { baseURL: i, authToken: r } = c(), e = y();
52
- return v({
53
- mutationFn: async () => {
54
- const n = await u(i).deliveryZones.states[":id"].$delete(
55
- { param: { id: t } },
56
- l(r)
57
- );
58
- if (!n.ok) throw new Error(`Failed to delete state: ${n.statusText}`);
59
- return n.json();
60
- },
61
- onSuccess: () => {
62
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
63
- },
64
- ...s
65
- });
66
- }
67
- function $(t, s) {
68
- const { baseURL: i, authToken: r } = c();
69
- return m({
70
- queryKey: o.admin.deliveryZones.zones.list(t),
71
- queryFn: async () => {
72
- const a = await u(i).deliveryZones.zones.$get({ query: t }, l(r));
73
- if (!a.ok) throw new Error(`Failed to fetch delivery zones: ${a.statusText}`);
74
- return a.json();
75
- },
76
- ...s
77
- });
78
- }
79
- function z(t) {
80
- const { baseURL: s, authToken: i } = c(), r = y();
81
- return v({
82
- mutationFn: async (e) => {
83
- const n = await u(s).deliveryZones.zones.$post({ json: e }, l(i));
84
- if (!n.ok) throw new Error(`Failed to create delivery zone: ${n.statusText}`);
85
- return n.json();
86
- },
87
- onSuccess: () => {
88
- r.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all }), r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
89
- },
90
- ...t
91
- });
92
- }
93
- function K(t, s) {
94
- const { baseURL: i, authToken: r } = c(), e = y();
95
- return v({
96
- mutationFn: async (a) => {
97
- const d = await u(i).deliveryZones.zones[":id"].$patch(
98
- { json: a, param: { id: t } },
99
- l(r)
100
- );
101
- if (!d.ok) throw new Error(`Failed to update delivery zone: ${d.statusText}`);
102
- return d.json();
103
- },
104
- onSuccess: () => {
105
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
106
- },
107
- ...s
108
- });
109
- }
110
- function j(t, s) {
111
- const { baseURL: i, authToken: r } = c(), e = y();
112
- return v({
113
- mutationFn: async () => {
114
- const n = await u(i).deliveryZones.zones[":id"].$delete(
115
- { param: { id: t } },
116
- l(r)
117
- );
118
- if (!n.ok) throw new Error(`Failed to delete delivery zone: ${n.statusText}`);
119
- return n.json();
120
- },
121
- onSuccess: () => {
122
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
123
- },
124
- ...s
125
- });
2
+ import { useQuery as e } from "@tanstack/react-query";
3
+ function n(r) {
4
+ return e(r);
126
5
  }
127
6
  export {
128
- z as useCreateDeliveryZone,
129
- k as useCreateState,
130
- j as useDeleteDeliveryZone,
131
- T as useDeleteState,
132
- $ as useListDeliveryZones,
133
- p as useListStates,
134
- K as useUpdateDeliveryZone,
135
- F as useUpdateState
7
+ n as useQueryUnwrapped
136
8
  };
package/dist/index58.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { getDefaultExportFromCjs as d } from "./index59.mjs";
3
- import { __module as v } from "./index60.mjs";
2
+ import { getDefaultExportFromCjs as d } from "./index78.mjs";
3
+ import { __module as v } from "./index79.mjs";
4
4
  v.exports = function(n) {
5
5
  return g(m(n), n);
6
6
  };
package/dist/index59.mjs CHANGED
@@ -1,7 +1,238 @@
1
1
  'use client';
2
- function e(t) {
3
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2
+ import R from "./index60.mjs";
3
+ const { toString: T } = Object.prototype, { getPrototypeOf: A } = Object, { iterator: g, toStringTag: S } = Symbol, F = /* @__PURE__ */ ((e) => (t) => {
4
+ const n = T.call(t);
5
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
6
+ })(/* @__PURE__ */ Object.create(null)), f = (e) => (e = e.toLowerCase(), (t) => F(t) === e), O = (e) => (t) => typeof t === e, { isArray: p } = Array, a = O("undefined");
7
+ function d(e) {
8
+ return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && c(e.constructor.isBuffer) && e.constructor.isBuffer(e);
4
9
  }
10
+ const B = f("ArrayBuffer");
11
+ function M(e) {
12
+ let t;
13
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && B(e.buffer), t;
14
+ }
15
+ const k = O("string"), c = O("function"), E = O("number"), y = (e) => e !== null && typeof e == "object", N = (e) => e === !0 || e === !1, w = (e) => {
16
+ if (F(e) !== "object")
17
+ return !1;
18
+ const t = A(e);
19
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(S in e) && !(g in e);
20
+ }, U = (e) => {
21
+ if (!y(e) || d(e))
22
+ return !1;
23
+ try {
24
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
25
+ } catch {
26
+ return !1;
27
+ }
28
+ }, I = f("Date"), V = f("File"), _ = f("Blob"), q = f("FileList"), H = (e) => y(e) && c(e.pipe), z = (e) => {
29
+ let t;
30
+ return e && (typeof FormData == "function" && e instanceof FormData || c(e.append) && ((t = F(e)) === "formdata" || // detect form-data instance
31
+ t === "object" && c(e.toString) && e.toString() === "[object FormData]"));
32
+ }, J = f("URLSearchParams"), [K, $, W, G] = ["ReadableStream", "Request", "Response", "Headers"].map(f), Q = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
33
+ function m(e, t, { allOwnKeys: n = !1 } = {}) {
34
+ if (e === null || typeof e > "u")
35
+ return;
36
+ let r, s;
37
+ if (typeof e != "object" && (e = [e]), p(e))
38
+ for (r = 0, s = e.length; r < s; r++)
39
+ t.call(null, e[r], r, e);
40
+ else {
41
+ if (d(e))
42
+ return;
43
+ const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
44
+ let l;
45
+ for (r = 0; r < i; r++)
46
+ l = o[r], t.call(null, e[l], l, e);
47
+ }
48
+ }
49
+ function P(e, t) {
50
+ if (d(e))
51
+ return null;
52
+ t = t.toLowerCase();
53
+ const n = Object.keys(e);
54
+ let r = n.length, s;
55
+ for (; r-- > 0; )
56
+ if (s = n[r], t === s.toLowerCase())
57
+ return s;
58
+ return null;
59
+ }
60
+ const u = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !a(e) && e !== u;
61
+ function h() {
62
+ const { caseless: e, skipUndefined: t } = L(this) && this || {}, n = {}, r = (s, o) => {
63
+ const i = e && P(n, o) || o;
64
+ w(n[i]) && w(s) ? n[i] = h(n[i], s) : w(s) ? n[i] = h({}, s) : p(s) ? n[i] = s.slice() : (!t || !a(s)) && (n[i] = s);
65
+ };
66
+ for (let s = 0, o = arguments.length; s < o; s++)
67
+ arguments[s] && m(arguments[s], r);
68
+ return n;
69
+ }
70
+ const X = (e, t, n, { allOwnKeys: r } = {}) => (m(t, (s, o) => {
71
+ n && c(s) ? e[o] = R(s, n) : e[o] = s;
72
+ }, { allOwnKeys: r }), e), Y = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Z = (e, t, n, r) => {
73
+ e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
74
+ value: t.prototype
75
+ }), n && Object.assign(e.prototype, n);
76
+ }, j = (e, t, n, r) => {
77
+ let s, o, i;
78
+ const l = {};
79
+ if (t = t || {}, e == null) return t;
80
+ do {
81
+ for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
82
+ i = s[o], (!r || r(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
83
+ e = n !== !1 && A(e);
84
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
85
+ return t;
86
+ }, v = (e, t, n) => {
87
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
88
+ const r = e.indexOf(t, n);
89
+ return r !== -1 && r === n;
90
+ }, ee = (e) => {
91
+ if (!e) return null;
92
+ if (p(e)) return e;
93
+ let t = e.length;
94
+ if (!E(t)) return null;
95
+ const n = new Array(t);
96
+ for (; t-- > 0; )
97
+ n[t] = e[t];
98
+ return n;
99
+ }, te = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && A(Uint8Array)), ne = (e, t) => {
100
+ const r = (e && e[g]).call(e);
101
+ let s;
102
+ for (; (s = r.next()) && !s.done; ) {
103
+ const o = s.value;
104
+ t.call(e, o[0], o[1]);
105
+ }
106
+ }, re = (e, t) => {
107
+ let n;
108
+ const r = [];
109
+ for (; (n = e.exec(t)) !== null; )
110
+ r.push(n);
111
+ return r;
112
+ }, se = f("HTMLFormElement"), oe = (e) => e.toLowerCase().replace(
113
+ /[-_\s]([a-z\d])(\w*)/g,
114
+ function(n, r, s) {
115
+ return r.toUpperCase() + s;
116
+ }
117
+ ), x = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ie = f("RegExp"), C = (e, t) => {
118
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
119
+ m(n, (s, o) => {
120
+ let i;
121
+ (i = t(s, o, e)) !== !1 && (r[o] = i || s);
122
+ }), Object.defineProperties(e, r);
123
+ }, ce = (e) => {
124
+ C(e, (t, n) => {
125
+ if (c(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
126
+ return !1;
127
+ const r = e[n];
128
+ if (c(r)) {
129
+ if (t.enumerable = !1, "writable" in t) {
130
+ t.writable = !1;
131
+ return;
132
+ }
133
+ t.set || (t.set = () => {
134
+ throw Error("Can not rewrite read-only method '" + n + "'");
135
+ });
136
+ }
137
+ });
138
+ }, fe = (e, t) => {
139
+ const n = {}, r = (s) => {
140
+ s.forEach((o) => {
141
+ n[o] = !0;
142
+ });
143
+ };
144
+ return p(e) ? r(e) : r(String(e).split(t)), n;
145
+ }, le = () => {
146
+ }, ue = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
147
+ function ae(e) {
148
+ return !!(e && c(e.append) && e[S] === "FormData" && e[g]);
149
+ }
150
+ const pe = (e) => {
151
+ const t = new Array(10), n = (r, s) => {
152
+ if (y(r)) {
153
+ if (t.indexOf(r) >= 0)
154
+ return;
155
+ if (d(r))
156
+ return r;
157
+ if (!("toJSON" in r)) {
158
+ t[s] = r;
159
+ const o = p(r) ? [] : {};
160
+ return m(r, (i, l) => {
161
+ const b = n(i, s + 1);
162
+ !a(b) && (o[l] = b);
163
+ }), t[s] = void 0, o;
164
+ }
165
+ }
166
+ return r;
167
+ };
168
+ return n(e, 0);
169
+ }, de = f("AsyncFunction"), ye = (e) => e && (y(e) || c(e)) && c(e.then) && c(e.catch), D = ((e, t) => e ? setImmediate : t ? ((n, r) => (u.addEventListener("message", ({ source: s, data: o }) => {
170
+ s === u && o === n && r.length && r.shift()();
171
+ }, !1), (s) => {
172
+ r.push(s), u.postMessage(n, "*");
173
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
174
+ typeof setImmediate == "function",
175
+ c(u.postMessage)
176
+ ), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || D, we = (e) => e != null && c(e[g]), Fe = {
177
+ isArray: p,
178
+ isArrayBuffer: B,
179
+ isBuffer: d,
180
+ isFormData: z,
181
+ isArrayBufferView: M,
182
+ isString: k,
183
+ isNumber: E,
184
+ isBoolean: N,
185
+ isObject: y,
186
+ isPlainObject: w,
187
+ isEmptyObject: U,
188
+ isReadableStream: K,
189
+ isRequest: $,
190
+ isResponse: W,
191
+ isHeaders: G,
192
+ isUndefined: a,
193
+ isDate: I,
194
+ isFile: V,
195
+ isBlob: _,
196
+ isRegExp: ie,
197
+ isFunction: c,
198
+ isStream: H,
199
+ isURLSearchParams: J,
200
+ isTypedArray: te,
201
+ isFileList: q,
202
+ forEach: m,
203
+ merge: h,
204
+ extend: X,
205
+ trim: Q,
206
+ stripBOM: Y,
207
+ inherits: Z,
208
+ toFlatObject: j,
209
+ kindOf: F,
210
+ kindOfTest: f,
211
+ endsWith: v,
212
+ toArray: ee,
213
+ forEachEntry: ne,
214
+ matchAll: re,
215
+ isHTMLForm: se,
216
+ hasOwnProperty: x,
217
+ hasOwnProp: x,
218
+ // an alias to avoid ESLint no-prototype-builtins detection
219
+ reduceDescriptors: C,
220
+ freezeMethods: ce,
221
+ toObjectSet: fe,
222
+ toCamelCase: oe,
223
+ noop: le,
224
+ toFiniteNumber: ue,
225
+ findKey: P,
226
+ global: u,
227
+ isContextDefined: L,
228
+ isSpecCompliantForm: ae,
229
+ toJSONObject: pe,
230
+ isAsyncFn: de,
231
+ isThenable: ye,
232
+ setImmediate: D,
233
+ asap: me,
234
+ isIterable: we
235
+ };
5
236
  export {
6
- e as getDefaultExportFromCjs
237
+ Fe as default
7
238
  };
package/dist/index60.mjs CHANGED
@@ -1,5 +1,9 @@
1
1
  'use client';
2
- var o = { exports: {} };
2
+ function u(n, r) {
3
+ return function() {
4
+ return n.apply(r, arguments);
5
+ };
6
+ }
3
7
  export {
4
- o as __module
8
+ u as default
5
9
  };
package/dist/index61.mjs CHANGED
@@ -1,8 +1,137 @@
1
1
  'use client';
2
- import { useQuery as e } from "@tanstack/react-query";
3
- function n(r) {
4
- return e(r);
2
+ import d from "./index59.mjs";
3
+ import U from "./index80.mjs";
4
+ import q from "./index81.mjs";
5
+ import R from "./index82.mjs";
6
+ import w from "./index62.mjs";
7
+ import A from "./index83.mjs";
8
+ import m from "./index84.mjs";
9
+ import T from "./index73.mjs";
10
+ const i = m.validators;
11
+ class k {
12
+ constructor(t) {
13
+ this.defaults = t || {}, this.interceptors = {
14
+ request: new q(),
15
+ response: new q()
16
+ };
17
+ }
18
+ /**
19
+ * Dispatch a request
20
+ *
21
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
22
+ * @param {?Object} config
23
+ *
24
+ * @returns {Promise} The Promise to be fulfilled
25
+ */
26
+ async request(t, e) {
27
+ try {
28
+ return await this._request(t, e);
29
+ } catch (r) {
30
+ if (r instanceof Error) {
31
+ let o = {};
32
+ Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
33
+ const s = o.stack ? o.stack.replace(/^.+\n/, "") : "";
34
+ try {
35
+ r.stack ? s && !String(r.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (r.stack += `
36
+ ` + s) : r.stack = s;
37
+ } catch {
38
+ }
39
+ }
40
+ throw r;
41
+ }
42
+ }
43
+ _request(t, e) {
44
+ typeof t == "string" ? (e = e || {}, e.url = t) : e = t || {}, e = w(this.defaults, e);
45
+ const { transitional: r, paramsSerializer: o, headers: s } = e;
46
+ r !== void 0 && m.assertOptions(r, {
47
+ silentJSONParsing: i.transitional(i.boolean),
48
+ forcedJSONParsing: i.transitional(i.boolean),
49
+ clarifyTimeoutError: i.transitional(i.boolean)
50
+ }, !1), o != null && (d.isFunction(o) ? e.paramsSerializer = {
51
+ serialize: o
52
+ } : m.assertOptions(o, {
53
+ encode: i.function,
54
+ serialize: i.function
55
+ }, !0)), e.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? e.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : e.allowAbsoluteUrls = !0), m.assertOptions(e, {
56
+ baseUrl: i.spelling("baseURL"),
57
+ withXsrfToken: i.spelling("withXSRFToken")
58
+ }, !0), e.method = (e.method || this.defaults.method || "get").toLowerCase();
59
+ let f = s && d.merge(
60
+ s.common,
61
+ s[e.method]
62
+ );
63
+ s && d.forEach(
64
+ ["delete", "get", "head", "post", "put", "patch", "common"],
65
+ (a) => {
66
+ delete s[a];
67
+ }
68
+ ), e.headers = T.concat(f, s);
69
+ const h = [];
70
+ let b = !0;
71
+ this.interceptors.request.forEach(function(n) {
72
+ typeof n.runWhen == "function" && n.runWhen(e) === !1 || (b = b && n.synchronous, h.unshift(n.fulfilled, n.rejected));
73
+ });
74
+ const c = [];
75
+ this.interceptors.response.forEach(function(n) {
76
+ c.push(n.fulfilled, n.rejected);
77
+ });
78
+ let u, l = 0, p;
79
+ if (!b) {
80
+ const a = [R.bind(this), void 0];
81
+ for (a.unshift(...h), a.push(...c), p = a.length, u = Promise.resolve(e); l < p; )
82
+ u = u.then(a[l++], a[l++]);
83
+ return u;
84
+ }
85
+ p = h.length;
86
+ let y = e;
87
+ for (; l < p; ) {
88
+ const a = h[l++], n = h[l++];
89
+ try {
90
+ y = a(y);
91
+ } catch (S) {
92
+ n.call(this, S);
93
+ break;
94
+ }
95
+ }
96
+ try {
97
+ u = R.call(this, y);
98
+ } catch (a) {
99
+ return Promise.reject(a);
100
+ }
101
+ for (l = 0, p = c.length; l < p; )
102
+ u = u.then(c[l++], c[l++]);
103
+ return u;
104
+ }
105
+ getUri(t) {
106
+ t = w(this.defaults, t);
107
+ const e = A(t.baseURL, t.url, t.allowAbsoluteUrls);
108
+ return U(e, t.params, t.paramsSerializer);
109
+ }
5
110
  }
111
+ d.forEach(["delete", "get", "head", "options"], function(t) {
112
+ k.prototype[t] = function(e, r) {
113
+ return this.request(w(r || {}, {
114
+ method: t,
115
+ url: e,
116
+ data: (r || {}).data
117
+ }));
118
+ };
119
+ });
120
+ d.forEach(["post", "put", "patch"], function(t) {
121
+ function e(r) {
122
+ return function(s, f, h) {
123
+ return this.request(w(h || {}, {
124
+ method: t,
125
+ headers: r ? {
126
+ "Content-Type": "multipart/form-data"
127
+ } : {},
128
+ url: s,
129
+ data: f
130
+ }));
131
+ };
132
+ }
133
+ k.prototype[t] = e(), k.prototype[t + "Form"] = e(!0);
134
+ });
6
135
  export {
7
- n as useQueryUnwrapped
136
+ k as default
8
137
  };
package/dist/index62.mjs CHANGED
@@ -1,37 +1,71 @@
1
1
  'use client';
2
- var a = (i, t, e = {}) => {
3
- let r = `${i}=${t}`;
4
- if (i.startsWith("__Secure-") && !e.secure)
5
- throw new Error("__Secure- Cookie must have Secure attributes");
6
- if (i.startsWith("__Host-")) {
7
- if (!e.secure)
8
- throw new Error("__Host- Cookie must have Secure attributes");
9
- if (e.path !== "/")
10
- throw new Error('__Host- Cookie must have Path attributes with "/"');
11
- if (e.domain)
12
- throw new Error("__Host- Cookie must not have Domain attributes");
2
+ import i from "./index59.mjs";
3
+ import h from "./index73.mjs";
4
+ const c = (s) => s instanceof h ? { ...s } : s;
5
+ function C(s, f) {
6
+ f = f || {};
7
+ const u = {};
8
+ function d(t, e, r, o) {
9
+ return i.isPlainObject(t) && i.isPlainObject(e) ? i.merge.call({ caseless: o }, t, e) : i.isPlainObject(e) ? i.merge({}, e) : i.isArray(e) ? e.slice() : e;
13
10
  }
14
- if (e && typeof e.maxAge == "number" && e.maxAge >= 0) {
15
- if (e.maxAge > 3456e4)
16
- throw new Error(
17
- "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration."
18
- );
19
- r += `; Max-Age=${e.maxAge | 0}`;
11
+ function l(t, e, r, o) {
12
+ if (i.isUndefined(e)) {
13
+ if (!i.isUndefined(t))
14
+ return d(void 0, t, r, o);
15
+ } else return d(t, e, r, o);
20
16
  }
21
- if (e.domain && e.prefix !== "host" && (r += `; Domain=${e.domain}`), e.path && (r += `; Path=${e.path}`), e.expires) {
22
- if (e.expires.getTime() - Date.now() > 3456e7)
23
- throw new Error(
24
- "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future."
25
- );
26
- r += `; Expires=${e.expires.toUTCString()}`;
17
+ function a(t, e) {
18
+ if (!i.isUndefined(e))
19
+ return d(void 0, e);
27
20
  }
28
- if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite && (r += `; SameSite=${e.sameSite.charAt(0).toUpperCase() + e.sameSite.slice(1)}`), e.priority && (r += `; Priority=${e.priority.charAt(0).toUpperCase() + e.priority.slice(1)}`), e.partitioned) {
29
- if (!e.secure)
30
- throw new Error("Partitioned Cookie must have Secure attributes");
31
- r += "; Partitioned";
21
+ function n(t, e) {
22
+ if (i.isUndefined(e)) {
23
+ if (!i.isUndefined(t))
24
+ return d(void 0, t);
25
+ } else return d(void 0, e);
32
26
  }
33
- return r;
34
- }, s = (i, t, e) => (t = encodeURIComponent(t), a(i, t, e));
27
+ function m(t, e, r) {
28
+ if (r in f)
29
+ return d(t, e);
30
+ if (r in s)
31
+ return d(void 0, t);
32
+ }
33
+ const g = {
34
+ url: a,
35
+ method: a,
36
+ data: a,
37
+ baseURL: n,
38
+ transformRequest: n,
39
+ transformResponse: n,
40
+ paramsSerializer: n,
41
+ timeout: n,
42
+ timeoutMessage: n,
43
+ withCredentials: n,
44
+ withXSRFToken: n,
45
+ adapter: n,
46
+ responseType: n,
47
+ xsrfCookieName: n,
48
+ xsrfHeaderName: n,
49
+ onUploadProgress: n,
50
+ onDownloadProgress: n,
51
+ decompress: n,
52
+ maxContentLength: n,
53
+ maxBodyLength: n,
54
+ beforeRedirect: n,
55
+ transport: n,
56
+ httpAgent: n,
57
+ httpsAgent: n,
58
+ cancelToken: n,
59
+ socketPath: n,
60
+ responseEncoding: n,
61
+ validateStatus: m,
62
+ headers: (t, e, r) => l(c(t), c(e), r, !0)
63
+ };
64
+ return i.forEach(Object.keys({ ...s, ...f }), function(e) {
65
+ const r = g[e] || l, o = r(s[e], f[e], e);
66
+ i.isUndefined(o) && r !== m || (u[e] = o);
67
+ }), u;
68
+ }
35
69
  export {
36
- s as serialize
70
+ C as default
37
71
  };