septor-store-react 0.0.3 → 0.0.4

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 CHANGED
@@ -108,11 +108,12 @@ setBearerToken({ token: "abc123", expiresIn: 3600 });
108
108
  Installation
109
109
  npm install zustand axios
110
110
 
111
- 📁 Usage
111
+ ### Usage
112
112
  Import the store
113
113
  import usePomZStore from "septor-store-react";
114
114
 
115
- 🧠 Basic Example
115
+ ### Basic Example
116
+ ````
116
117
  import { useEffect } from "react";
117
118
  import usePomZStore from "septor-store-react";
118
119
  // stateKey: remember this should be an id
@@ -135,15 +136,16 @@ export default function Users() {
135
136
  if (loading) return <p>Loading...</p>;
136
137
 
137
138
  return <p>Users loaded</p>;
138
- }
139
+ }```
139
140
 
140
- 🧩 Store State
141
+ ### Store State
141
142
  Name Description
142
143
  loading Global loading flag
143
144
  stateValue Object holding all stored data
144
145
  checkQueriesInQue Tracks active API requests
145
146
  isThereAnyDataChangeInAform Tracks form/data changes
146
- 🛠 Available Functions
147
+ ### Available Functions
148
+ ```
147
149
  setStateValue(key, value)
148
150
 
149
151
  Store any value globally.
@@ -171,7 +173,7 @@ validateLength({ a: 1 }); // 1
171
173
  import usePomZStore from "septor-store-react";
172
174
  const { stateGeneratorApi } = usePomZStore();
173
175
 
174
- 🌐 API Handling
176
+ API Handling
175
177
  stateGeneratorApi(config, onData)
176
178
 
177
179
  This is the main function you’ll use to fetch API data.
@@ -191,28 +193,30 @@ stateGeneratorApi(
191
193
  console.log("Received data:", data);
192
194
  }
193
195
  );
194
-
195
- Configuration Options
196
+ ```
197
+ ### Configuration Options
196
198
  Option Description
197
199
  stateKey Where data is stored
198
200
  req Axios request config
199
201
  reload Force API reload
200
202
  time Delay before reload (seconds)
201
203
  mStore.mUse Enable sessionStorage
202
- 💾 Session Storage Cache
204
+ ### Session Storage Cache
203
205
 
204
206
  Enable caching like this:
205
-
207
+ ```
206
208
  stateGeneratorApi({
207
209
  stateKey: "orders",
208
210
  req: { url: "/orders" },
209
211
  mStore: { mUse: true },
210
212
  });
213
+ ````
211
214
 
212
215
 
213
- let use the state in other file
214
- import usePomZStore from "septor-store-react";
216
+ ### let use the state in other file
217
+ ```import usePomZStore from "septor-store-react";
215
218
  const store = usePomZStore();
219
+ ```
216
220
  store.orders
217
221
 
218
222
 
package/dist/index.js CHANGED
@@ -4,24 +4,24 @@ function Qe(e, t) {
4
4
  return e.apply(t, arguments);
5
5
  };
6
6
  }
7
- const { toString: gt } = Object.prototype, { getPrototypeOf: Se } = Object, { iterator: oe, toStringTag: Xe } = Symbol, ie = /* @__PURE__ */ ((e) => (t) => {
8
- const n = gt.call(t);
7
+ const { toString: St } = Object.prototype, { getPrototypeOf: Se } = Object, { iterator: oe, toStringTag: Xe } = Symbol, ie = /* @__PURE__ */ ((e) => (t) => {
8
+ const n = St.call(t);
9
9
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
10
10
  })(/* @__PURE__ */ Object.create(null)), k = (e) => (e = e.toLowerCase(), (t) => ie(t) === e), ae = (e) => (t) => typeof t === e, { isArray: q } = Array, $ = ae("undefined");
11
11
  function W(e) {
12
12
  return e !== null && !$(e) && e.constructor !== null && !$(e.constructor) && T(e.constructor.isBuffer) && e.constructor.isBuffer(e);
13
13
  }
14
14
  const Ke = k("ArrayBuffer");
15
- function St(e) {
15
+ function Et(e) {
16
16
  let t;
17
17
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ke(e.buffer), t;
18
18
  }
19
- const Et = ae("string"), T = ae("function"), Ge = ae("number"), v = (e) => e !== null && typeof e == "object", Rt = (e) => e === !0 || e === !1, te = (e) => {
19
+ const Rt = ae("string"), T = ae("function"), Ge = ae("number"), v = (e) => e !== null && typeof e == "object", Ot = (e) => e === !0 || e === !1, te = (e) => {
20
20
  if (ie(e) !== "object")
21
21
  return !1;
22
22
  const t = Se(e);
23
23
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Xe in e) && !(oe in e);
24
- }, Ot = (e) => {
24
+ }, Tt = (e) => {
25
25
  if (!v(e) || W(e))
26
26
  return !1;
27
27
  try {
@@ -29,11 +29,11 @@ const Et = ae("string"), T = ae("function"), Ge = ae("number"), v = (e) => e !==
29
29
  } catch {
30
30
  return !1;
31
31
  }
32
- }, Tt = k("Date"), At = k("File"), Ct = k("Blob"), xt = k("FileList"), Nt = (e) => v(e) && T(e.pipe), kt = (e) => {
32
+ }, At = k("Date"), Ct = k("File"), xt = k("Blob"), Nt = k("FileList"), kt = (e) => v(e) && T(e.pipe), Pt = (e) => {
33
33
  let t;
34
34
  return e && (typeof FormData == "function" && e instanceof FormData || T(e.append) && ((t = ie(e)) === "formdata" || // detect form-data instance
35
35
  t === "object" && T(e.toString) && e.toString() === "[object FormData]"));
36
- }, Pt = k("URLSearchParams"), [Ft, Ut, Lt, _t] = ["ReadableStream", "Request", "Response", "Headers"].map(k), Bt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
36
+ }, Ft = k("URLSearchParams"), [Ut, Lt, _t, Bt] = ["ReadableStream", "Request", "Response", "Headers"].map(k), Dt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
37
37
  function Q(e, t, { allOwnKeys: n = !1 } = {}) {
38
38
  if (e === null || typeof e > "u")
39
39
  return;
@@ -71,13 +71,13 @@ function me() {
71
71
  arguments[s] && Q(arguments[s], r);
72
72
  return n;
73
73
  }
74
- const Dt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, i) => {
74
+ const jt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, i) => {
75
75
  n && T(s) ? e[i] = Qe(s, n) : e[i] = s;
76
- }, { allOwnKeys: r }), e), jt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), It = (e, t, n, r) => {
76
+ }, { allOwnKeys: r }), e), It = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ht = (e, t, n, r) => {
77
77
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
78
78
  value: t.prototype
79
79
  }), n && Object.assign(e.prototype, n);
80
- }, Ht = (e, t, n, r) => {
80
+ }, $t = (e, t, n, r) => {
81
81
  let s, i, o;
82
82
  const c = {};
83
83
  if (t = t || {}, e == null) return t;
@@ -87,11 +87,11 @@ const Dt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, i) => {
87
87
  e = n !== !1 && Se(e);
88
88
  } while (e && (!n || n(e, t)) && e !== Object.prototype);
89
89
  return t;
90
- }, $t = (e, t, n) => {
90
+ }, Mt = (e, t, n) => {
91
91
  e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
92
92
  const r = e.indexOf(t, n);
93
93
  return r !== -1 && r === n;
94
- }, Mt = (e) => {
94
+ }, qt = (e) => {
95
95
  if (!e) return null;
96
96
  if (q(e)) return e;
97
97
  let t = e.length;
@@ -100,31 +100,31 @@ const Dt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, i) => {
100
100
  for (; t-- > 0; )
101
101
  n[t] = e[t];
102
102
  return n;
103
- }, qt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Se(Uint8Array)), Vt = (e, t) => {
103
+ }, Vt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Se(Uint8Array)), zt = (e, t) => {
104
104
  const r = (e && e[oe]).call(e);
105
105
  let s;
106
106
  for (; (s = r.next()) && !s.done; ) {
107
107
  const i = s.value;
108
108
  t.call(e, i[0], i[1]);
109
109
  }
110
- }, zt = (e, t) => {
110
+ }, Jt = (e, t) => {
111
111
  let n;
112
112
  const r = [];
113
113
  for (; (n = e.exec(t)) !== null; )
114
114
  r.push(n);
115
115
  return r;
116
- }, Jt = k("HTMLFormElement"), Wt = (e) => e.toLowerCase().replace(
116
+ }, Wt = k("HTMLFormElement"), vt = (e) => e.toLowerCase().replace(
117
117
  /[-_\s]([a-z\d])(\w*)/g,
118
118
  function(n, r, s) {
119
119
  return r.toUpperCase() + s;
120
120
  }
121
- ), Pe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), vt = k("RegExp"), et = (e, t) => {
121
+ ), Pe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Qt = k("RegExp"), et = (e, t) => {
122
122
  const n = Object.getOwnPropertyDescriptors(e), r = {};
123
123
  Q(n, (s, i) => {
124
124
  let o;
125
125
  (o = t(s, i, e)) !== !1 && (r[i] = o || s);
126
126
  }), Object.defineProperties(e, r);
127
- }, Qt = (e) => {
127
+ }, Xt = (e) => {
128
128
  et(e, (t, n) => {
129
129
  if (T(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
130
130
  return !1;
@@ -139,19 +139,19 @@ const Dt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, i) => {
139
139
  });
140
140
  }
141
141
  });
142
- }, Xt = (e, t) => {
142
+ }, Kt = (e, t) => {
143
143
  const n = {}, r = (s) => {
144
144
  s.forEach((i) => {
145
145
  n[i] = !0;
146
146
  });
147
147
  };
148
148
  return q(e) ? r(e) : r(String(e).split(t)), n;
149
- }, Kt = () => {
150
- }, Gt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
151
- function Zt(e) {
149
+ }, Gt = () => {
150
+ }, Zt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
151
+ function Yt(e) {
152
152
  return !!(e && T(e.append) && e[Xe] === "FormData" && e[oe]);
153
153
  }
154
- const Yt = (e) => {
154
+ const en = (e) => {
155
155
  const t = new Array(10), n = (r, s) => {
156
156
  if (v(r)) {
157
157
  if (t.indexOf(r) >= 0)
@@ -170,72 +170,72 @@ const Yt = (e) => {
170
170
  return r;
171
171
  };
172
172
  return n(e, 0);
173
- }, en = k("AsyncFunction"), tn = (e) => e && (v(e) || T(e)) && T(e.then) && T(e.catch), tt = ((e, t) => e ? setImmediate : t ? ((n, r) => (D.addEventListener("message", ({ source: s, data: i }) => {
173
+ }, tn = k("AsyncFunction"), nn = (e) => e && (v(e) || T(e)) && T(e.then) && T(e.catch), tt = ((e, t) => e ? setImmediate : t ? ((n, r) => (D.addEventListener("message", ({ source: s, data: i }) => {
174
174
  s === D && i === n && r.length && r.shift()();
175
175
  }, !1), (s) => {
176
176
  r.push(s), D.postMessage(n, "*");
177
177
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
178
178
  typeof setImmediate == "function",
179
179
  T(D.postMessage)
180
- ), nn = typeof queueMicrotask < "u" ? queueMicrotask.bind(D) : typeof process < "u" && process.nextTick || tt, rn = (e) => e != null && T(e[oe]), a = {
180
+ ), rn = typeof queueMicrotask < "u" ? queueMicrotask.bind(D) : typeof process < "u" && process.nextTick || tt, sn = (e) => e != null && T(e[oe]), a = {
181
181
  isArray: q,
182
182
  isArrayBuffer: Ke,
183
183
  isBuffer: W,
184
- isFormData: kt,
185
- isArrayBufferView: St,
186
- isString: Et,
184
+ isFormData: Pt,
185
+ isArrayBufferView: Et,
186
+ isString: Rt,
187
187
  isNumber: Ge,
188
- isBoolean: Rt,
188
+ isBoolean: Ot,
189
189
  isObject: v,
190
190
  isPlainObject: te,
191
- isEmptyObject: Ot,
192
- isReadableStream: Ft,
193
- isRequest: Ut,
194
- isResponse: Lt,
195
- isHeaders: _t,
191
+ isEmptyObject: Tt,
192
+ isReadableStream: Ut,
193
+ isRequest: Lt,
194
+ isResponse: _t,
195
+ isHeaders: Bt,
196
196
  isUndefined: $,
197
- isDate: Tt,
198
- isFile: At,
199
- isBlob: Ct,
200
- isRegExp: vt,
197
+ isDate: At,
198
+ isFile: Ct,
199
+ isBlob: xt,
200
+ isRegExp: Qt,
201
201
  isFunction: T,
202
- isStream: Nt,
203
- isURLSearchParams: Pt,
204
- isTypedArray: qt,
205
- isFileList: xt,
202
+ isStream: kt,
203
+ isURLSearchParams: Ft,
204
+ isTypedArray: Vt,
205
+ isFileList: Nt,
206
206
  forEach: Q,
207
207
  merge: me,
208
- extend: Dt,
209
- trim: Bt,
210
- stripBOM: jt,
211
- inherits: It,
212
- toFlatObject: Ht,
208
+ extend: jt,
209
+ trim: Dt,
210
+ stripBOM: It,
211
+ inherits: Ht,
212
+ toFlatObject: $t,
213
213
  kindOf: ie,
214
214
  kindOfTest: k,
215
- endsWith: $t,
216
- toArray: Mt,
217
- forEachEntry: Vt,
218
- matchAll: zt,
219
- isHTMLForm: Jt,
215
+ endsWith: Mt,
216
+ toArray: qt,
217
+ forEachEntry: zt,
218
+ matchAll: Jt,
219
+ isHTMLForm: Wt,
220
220
  hasOwnProperty: Pe,
221
221
  hasOwnProp: Pe,
222
222
  // an alias to avoid ESLint no-prototype-builtins detection
223
223
  reduceDescriptors: et,
224
- freezeMethods: Qt,
225
- toObjectSet: Xt,
226
- toCamelCase: Wt,
227
- noop: Kt,
228
- toFiniteNumber: Gt,
224
+ freezeMethods: Xt,
225
+ toObjectSet: Kt,
226
+ toCamelCase: vt,
227
+ noop: Gt,
228
+ toFiniteNumber: Zt,
229
229
  findKey: Ze,
230
230
  global: D,
231
231
  isContextDefined: Ye,
232
- isSpecCompliantForm: Zt,
233
- toJSONObject: Yt,
234
- isAsyncFn: en,
235
- isThenable: tn,
232
+ isSpecCompliantForm: Yt,
233
+ toJSONObject: en,
234
+ isAsyncFn: tn,
235
+ isThenable: nn,
236
236
  setImmediate: tt,
237
- asap: nn,
238
- isIterable: rn
237
+ asap: rn,
238
+ isIterable: sn
239
239
  };
240
240
  function y(e, t, n, r, s) {
241
241
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
@@ -289,7 +289,7 @@ y.from = (e, t, n, r, s, i) => {
289
289
  const c = e && e.message ? e.message : "Error", f = t == null && e ? e.code : t;
290
290
  return y.call(o, c, f, n, r, s), e && o.cause == null && Object.defineProperty(o, "cause", { value: e, configurable: !0 }), o.name = e && e.name || "Error", i && Object.assign(o, i), o;
291
291
  };
292
- const sn = null;
292
+ const on = null;
293
293
  function ye(e) {
294
294
  return a.isPlainObject(e) || a.isArray(e);
295
295
  }
@@ -301,10 +301,10 @@ function Fe(e, t, n) {
301
301
  return s = st(s), !n && i ? "[" + s + "]" : s;
302
302
  }).join(n ? "." : "") : t;
303
303
  }
304
- function on(e) {
304
+ function an(e) {
305
305
  return a.isArray(e) && !e.some(ye);
306
306
  }
307
- const an = a.toFlatObject(a, {}, null, function(t) {
307
+ const cn = a.toFlatObject(a, {}, null, function(t) {
308
308
  return /^is[A-Z]/.test(t);
309
309
  });
310
310
  function ce(e, t, n) {
@@ -335,7 +335,7 @@ function ce(e, t, n) {
335
335
  if (d && !h && typeof d == "object") {
336
336
  if (a.endsWith(m, "{}"))
337
337
  m = r ? m : m.slice(0, -2), d = JSON.stringify(d);
338
- else if (a.isArray(d) && on(d) || (a.isFileList(d) || a.endsWith(m, "[]")) && (S = a.toArray(d)))
338
+ else if (a.isArray(d) && an(d) || (a.isFileList(d) || a.endsWith(m, "[]")) && (S = a.toArray(d)))
339
339
  return m = st(m), S.forEach(function(E, O) {
340
340
  !(a.isUndefined(E) || E === null) && t.append(
341
341
  // eslint-disable-next-line no-nested-ternary
@@ -346,7 +346,7 @@ function ce(e, t, n) {
346
346
  }
347
347
  return ye(d) ? !0 : (t.append(Fe(h, m, i), l(d)), !1);
348
348
  }
349
- const p = [], b = Object.assign(an, {
349
+ const p = [], b = Object.assign(cn, {
350
350
  defaultVisitor: u,
351
351
  convertValue: l,
352
352
  isVisitable: ye
@@ -399,13 +399,13 @@ ot.toString = function(t) {
399
399
  return n(s[0]) + "=" + n(s[1]);
400
400
  }, "").join("&");
401
401
  };
402
- function cn(e) {
402
+ function ln(e) {
403
403
  return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
404
404
  }
405
405
  function it(e, t, n) {
406
406
  if (!t)
407
407
  return e;
408
- const r = n && n.encode || cn;
408
+ const r = n && n.encode || ln;
409
409
  a.isFunction(n) && (n = {
410
410
  serialize: n
411
411
  });
@@ -475,27 +475,27 @@ const at = {
475
475
  silentJSONParsing: !0,
476
476
  forcedJSONParsing: !0,
477
477
  clarifyTimeoutError: !1
478
- }, ln = typeof URLSearchParams < "u" ? URLSearchParams : Ee, un = typeof FormData < "u" ? FormData : null, fn = typeof Blob < "u" ? Blob : null, dn = {
478
+ }, un = typeof URLSearchParams < "u" ? URLSearchParams : Ee, fn = typeof FormData < "u" ? FormData : null, dn = typeof Blob < "u" ? Blob : null, pn = {
479
479
  isBrowser: !0,
480
480
  classes: {
481
- URLSearchParams: ln,
482
- FormData: un,
483
- Blob: fn
481
+ URLSearchParams: un,
482
+ FormData: fn,
483
+ Blob: dn
484
484
  },
485
485
  protocols: ["http", "https", "file", "blob", "url", "data"]
486
- }, Re = typeof window < "u" && typeof document < "u", be = typeof navigator == "object" && navigator || void 0, pn = Re && (!be || ["ReactNative", "NativeScript", "NS"].indexOf(be.product) < 0), hn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
487
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", mn = Re && window.location.href || "http://localhost", yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
486
+ }, Re = typeof window < "u" && typeof document < "u", be = typeof navigator == "object" && navigator || void 0, hn = Re && (!be || ["ReactNative", "NativeScript", "NS"].indexOf(be.product) < 0), mn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
487
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", yn = Re && window.location.href || "http://localhost", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
488
488
  __proto__: null,
489
489
  hasBrowserEnv: Re,
490
- hasStandardBrowserEnv: pn,
491
- hasStandardBrowserWebWorkerEnv: hn,
490
+ hasStandardBrowserEnv: hn,
491
+ hasStandardBrowserWebWorkerEnv: mn,
492
492
  navigator: be,
493
- origin: mn
493
+ origin: yn
494
494
  }, Symbol.toStringTag, { value: "Module" })), R = {
495
- ...yn,
496
- ...dn
495
+ ...bn,
496
+ ...pn
497
497
  };
498
- function bn(e, t) {
498
+ function wn(e, t) {
499
499
  return ce(e, new R.classes.URLSearchParams(), {
500
500
  visitor: function(n, r, s, i) {
501
501
  return R.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
@@ -503,10 +503,10 @@ function bn(e, t) {
503
503
  ...t
504
504
  });
505
505
  }
506
- function wn(e) {
506
+ function gn(e) {
507
507
  return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
508
508
  }
509
- function gn(e) {
509
+ function Sn(e) {
510
510
  const t = {}, n = Object.keys(e);
511
511
  let r;
512
512
  const s = n.length;
@@ -520,17 +520,17 @@ function ct(e) {
520
520
  let o = n[i++];
521
521
  if (o === "__proto__") return !0;
522
522
  const c = Number.isFinite(+o), f = i >= n.length;
523
- return o = !o && a.isArray(s) ? s.length : o, f ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] = gn(s[o])), !c);
523
+ return o = !o && a.isArray(s) ? s.length : o, f ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] = Sn(s[o])), !c);
524
524
  }
525
525
  if (a.isFormData(e) && a.isFunction(e.entries)) {
526
526
  const n = {};
527
527
  return a.forEachEntry(e, (r, s) => {
528
- t(wn(r), s, n, 0);
528
+ t(gn(r), s, n, 0);
529
529
  }), n;
530
530
  }
531
531
  return null;
532
532
  }
533
- function Sn(e, t, n) {
533
+ function En(e, t, n) {
534
534
  if (a.isString(e))
535
535
  try {
536
536
  return (t || JSON.parse)(e), a.trim(e);
@@ -556,7 +556,7 @@ const X = {
556
556
  let c;
557
557
  if (i) {
558
558
  if (r.indexOf("application/x-www-form-urlencoded") > -1)
559
- return bn(t, this.formSerializer).toString();
559
+ return wn(t, this.formSerializer).toString();
560
560
  if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
561
561
  const f = this.env && this.env.FormData;
562
562
  return ce(
@@ -566,7 +566,7 @@ const X = {
566
566
  );
567
567
  }
568
568
  }
569
- return i || s ? (n.setContentType("application/json", !1), Sn(t)) : t;
569
+ return i || s ? (n.setContentType("application/json", !1), En(t)) : t;
570
570
  }],
571
571
  transformResponse: [function(t) {
572
572
  const n = this.transitional || X.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
@@ -609,7 +609,7 @@ const X = {
609
609
  a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
610
610
  X.headers[e] = {};
611
611
  });
612
- const En = a.toObjectSet([
612
+ const Rn = a.toObjectSet([
613
613
  "age",
614
614
  "authorization",
615
615
  "content-length",
@@ -627,12 +627,12 @@ const En = a.toObjectSet([
627
627
  "referer",
628
628
  "retry-after",
629
629
  "user-agent"
630
- ]), Rn = (e) => {
630
+ ]), On = (e) => {
631
631
  const t = {};
632
632
  let n, r, s;
633
633
  return e && e.split(`
634
634
  `).forEach(function(o) {
635
- s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && En[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
635
+ s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && Rn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
636
636
  }), t;
637
637
  }, _e = /* @__PURE__ */ Symbol("internals");
638
638
  function J(e) {
@@ -641,14 +641,14 @@ function J(e) {
641
641
  function ne(e) {
642
642
  return e === !1 || e == null ? e : a.isArray(e) ? e.map(ne) : String(e);
643
643
  }
644
- function On(e) {
644
+ function Tn(e) {
645
645
  const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
646
646
  let r;
647
647
  for (; r = n.exec(e); )
648
648
  t[r[1]] = r[2];
649
649
  return t;
650
650
  }
651
- const Tn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
651
+ const An = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
652
652
  function de(e, t, n, r, s) {
653
653
  if (a.isFunction(r))
654
654
  return r.call(this, t, n);
@@ -659,10 +659,10 @@ function de(e, t, n, r, s) {
659
659
  return r.test(t);
660
660
  }
661
661
  }
662
- function An(e) {
662
+ function Cn(e) {
663
663
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
664
664
  }
665
- function Cn(e, t) {
665
+ function xn(e, t) {
666
666
  const n = a.toCamelCase(" " + t);
667
667
  ["get", "set", "has"].forEach((r) => {
668
668
  Object.defineProperty(e, r + n, {
@@ -689,8 +689,8 @@ let A = class {
689
689
  const o = (c, f) => a.forEach(c, (l, u) => i(l, u, f));
690
690
  if (a.isPlainObject(t) || t instanceof this.constructor)
691
691
  o(t, n);
692
- else if (a.isString(t) && (t = t.trim()) && !Tn(t))
693
- o(Rn(t), n);
692
+ else if (a.isString(t) && (t = t.trim()) && !An(t))
693
+ o(On(t), n);
694
694
  else if (a.isObject(t) && a.isIterable(t)) {
695
695
  let c = {}, f, l;
696
696
  for (const u of t) {
@@ -711,7 +711,7 @@ let A = class {
711
711
  if (!n)
712
712
  return s;
713
713
  if (n === !0)
714
- return On(s);
714
+ return Tn(s);
715
715
  if (a.isFunction(n))
716
716
  return n.call(this, s, r);
717
717
  if (a.isRegExp(n))
@@ -755,7 +755,7 @@ let A = class {
755
755
  n[o] = ne(s), delete n[i];
756
756
  return;
757
757
  }
758
- const c = t ? An(i) : String(i).trim();
758
+ const c = t ? Cn(i) : String(i).trim();
759
759
  c !== i && delete n[i], n[c] = ne(s), r[c] = !0;
760
760
  }), this;
761
761
  }
@@ -794,7 +794,7 @@ let A = class {
794
794
  }).accessors, s = this.prototype;
795
795
  function i(o) {
796
796
  const c = J(o);
797
- r[c] || (Cn(s, o), r[c] = !0);
797
+ r[c] || (xn(s, o), r[c] = !0);
798
798
  }
799
799
  return a.isArray(t) ? t.forEach(i) : i(t), this;
800
800
  }
@@ -836,11 +836,11 @@ function ut(e, t, n) {
836
836
  n
837
837
  ));
838
838
  }
839
- function xn(e) {
839
+ function Nn(e) {
840
840
  const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
841
841
  return t && t[1] || "";
842
842
  }
843
- function Nn(e, t) {
843
+ function kn(e, t) {
844
844
  e = e || 10;
845
845
  const n = new Array(e), r = new Array(e);
846
846
  let s = 0, i = 0, o;
@@ -856,7 +856,7 @@ function Nn(e, t) {
856
856
  return w ? Math.round(b * 1e3 / w) : void 0;
857
857
  };
858
858
  }
859
- function kn(e, t) {
859
+ function Pn(e, t) {
860
860
  let n = 0, r = 1e3 / t, s, i;
861
861
  const o = (l, u = Date.now()) => {
862
862
  n = u, s = null, i && (clearTimeout(i), i = null), e(...l);
@@ -870,8 +870,8 @@ function kn(e, t) {
870
870
  }
871
871
  const se = (e, t, n = 3) => {
872
872
  let r = 0;
873
- const s = Nn(50, 250);
874
- return kn((i) => {
873
+ const s = kn(50, 250);
874
+ return Pn((i) => {
875
875
  const o = i.loaded, c = i.lengthComputable ? i.total : void 0, f = o - r, l = s(f), u = o <= c;
876
876
  r = o;
877
877
  const p = {
@@ -894,10 +894,10 @@ const se = (e, t, n = 3) => {
894
894
  total: e,
895
895
  loaded: r
896
896
  }), t[1]];
897
- }, De = (e) => (...t) => a.asap(() => e(...t)), Pn = R.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, R.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
897
+ }, De = (e) => (...t) => a.asap(() => e(...t)), Fn = R.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, R.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
898
898
  new URL(R.origin),
899
899
  R.navigator && /(msie|trident)/i.test(R.navigator.userAgent)
900
- ) : () => !0, Fn = R.hasStandardBrowserEnv ? (
900
+ ) : () => !0, Un = R.hasStandardBrowserEnv ? (
901
901
  // Standard browser envs support document.cookie
902
902
  {
903
903
  write(e, t, n, r, s, i, o) {
@@ -926,15 +926,15 @@ const se = (e, t, n = 3) => {
926
926
  }
927
927
  }
928
928
  );
929
- function Un(e) {
929
+ function Ln(e) {
930
930
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
931
931
  }
932
- function Ln(e, t) {
932
+ function _n(e, t) {
933
933
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
934
934
  }
935
935
  function ft(e, t, n) {
936
- let r = !Un(t);
937
- return e && (r || n == !1) ? Ln(e, t) : t;
936
+ let r = !Ln(t);
937
+ return e && (r || n == !1) ? _n(e, t) : t;
938
938
  }
939
939
  const je = (e) => e instanceof A ? { ...e } : e;
940
940
  function I(e, t) {
@@ -1017,12 +1017,12 @@ const dt = (e) => {
1017
1017
  });
1018
1018
  }
1019
1019
  }
1020
- if (R.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Pn(t.url))) {
1021
- const f = s && i && Fn.read(i);
1020
+ if (R.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Fn(t.url))) {
1021
+ const f = s && i && Un.read(i);
1022
1022
  f && o.set(s, f);
1023
1023
  }
1024
1024
  return t;
1025
- }, _n = typeof XMLHttpRequest < "u", Bn = _n && function(e) {
1025
+ }, Bn = typeof XMLHttpRequest < "u", Dn = Bn && function(e) {
1026
1026
  return new Promise(function(n, r) {
1027
1027
  const s = dt(e);
1028
1028
  let i = s.data;
@@ -1073,14 +1073,14 @@ const dt = (e) => {
1073
1073
  }), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), l && ([b, d] = se(l, !0), h.addEventListener("progress", b)), f && h.upload && ([p, w] = se(f), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", w)), (s.cancelToken || s.signal) && (u = (E) => {
1074
1074
  h && (r(!E || E.type ? new V(null, e, h) : E), h.abort(), h = null);
1075
1075
  }, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
1076
- const C = xn(s.url);
1076
+ const C = Nn(s.url);
1077
1077
  if (C && R.protocols.indexOf(C) === -1) {
1078
1078
  r(new y("Unsupported protocol " + C + ":", y.ERR_BAD_REQUEST, e));
1079
1079
  return;
1080
1080
  }
1081
1081
  h.send(i || null);
1082
1082
  });
1083
- }, Dn = (e, t) => {
1083
+ }, jn = (e, t) => {
1084
1084
  const { length: n } = e = e ? e.filter(Boolean) : [];
1085
1085
  if (t || n) {
1086
1086
  let r = new AbortController(), s;
@@ -1103,7 +1103,7 @@ const dt = (e) => {
1103
1103
  const { signal: f } = r;
1104
1104
  return f.unsubscribe = () => a.asap(c), f;
1105
1105
  }
1106
- }, jn = function* (e, t) {
1106
+ }, In = function* (e, t) {
1107
1107
  let n = e.byteLength;
1108
1108
  if (n < t) {
1109
1109
  yield e;
@@ -1112,10 +1112,10 @@ const dt = (e) => {
1112
1112
  let r = 0, s;
1113
1113
  for (; r < n; )
1114
1114
  s = r + t, yield e.slice(r, s), r = s;
1115
- }, In = async function* (e, t) {
1116
- for await (const n of Hn(e))
1117
- yield* jn(n, t);
1118
- }, Hn = async function* (e) {
1115
+ }, Hn = async function* (e, t) {
1116
+ for await (const n of $n(e))
1117
+ yield* In(n, t);
1118
+ }, $n = async function* (e) {
1119
1119
  if (e[Symbol.asyncIterator]) {
1120
1120
  yield* e;
1121
1121
  return;
@@ -1132,7 +1132,7 @@ const dt = (e) => {
1132
1132
  await t.cancel();
1133
1133
  }
1134
1134
  }, Ie = (e, t, n, r) => {
1135
- const s = In(e, t);
1135
+ const s = Hn(e, t);
1136
1136
  let i = 0, o, c = (f) => {
1137
1137
  o || (o = !0, r && r(f));
1138
1138
  };
@@ -1160,7 +1160,7 @@ const dt = (e) => {
1160
1160
  }, {
1161
1161
  highWaterMark: 2
1162
1162
  });
1163
- }, He = 64 * 1024, { isFunction: ee } = a, $n = (({ Request: e, Response: t }) => ({
1163
+ }, He = 64 * 1024, { isFunction: ee } = a, Mn = (({ Request: e, Response: t }) => ({
1164
1164
  Request: e,
1165
1165
  Response: t
1166
1166
  }))(a.global), {
@@ -1172,10 +1172,10 @@ const dt = (e) => {
1172
1172
  } catch {
1173
1173
  return !1;
1174
1174
  }
1175
- }, Mn = (e) => {
1175
+ }, qn = (e) => {
1176
1176
  e = a.merge.call({
1177
1177
  skipUndefined: !0
1178
- }, $n, e);
1178
+ }, Mn, e);
1179
1179
  const { fetch: t, Request: n, Response: r } = e, s = t ? ee(t) : typeof fetch == "function", i = ee(n), o = ee(r);
1180
1180
  if (!s)
1181
1181
  return !1;
@@ -1234,7 +1234,7 @@ const dt = (e) => {
1234
1234
  fetchOptions: Te
1235
1235
  } = dt(d), Ae = t || fetch;
1236
1236
  x = x ? (x + "").toLowerCase() : "text";
1237
- let G = Dn([C, E && E.toAbortSignal()], O), z = null;
1237
+ let G = jn([C, E && E.toAbortSignal()], O), z = null;
1238
1238
  const B = G && G.unsubscribe && (() => {
1239
1239
  G.unsubscribe();
1240
1240
  });
@@ -1284,10 +1284,10 @@ const dt = (e) => {
1284
1284
  );
1285
1285
  }
1286
1286
  x = x || "text";
1287
- let wt = await p[a.findKey(p, x) || "text"](U, d);
1287
+ let gt = await p[a.findKey(p, x) || "text"](U, d);
1288
1288
  return !Ne && B && B(), await new Promise((L, H) => {
1289
1289
  ut(L, H, {
1290
- data: wt,
1290
+ data: gt,
1291
1291
  headers: A.from(U.headers),
1292
1292
  status: U.status,
1293
1293
  statusText: U.statusText,
@@ -1304,22 +1304,22 @@ const dt = (e) => {
1304
1304
  ) : y.from(P, P && P.code, d, z);
1305
1305
  }
1306
1306
  };
1307
- }, qn = /* @__PURE__ */ new Map(), pt = (e) => {
1307
+ }, Vn = /* @__PURE__ */ new Map(), pt = (e) => {
1308
1308
  let t = e && e.env || {};
1309
1309
  const { fetch: n, Request: r, Response: s } = t, i = [
1310
1310
  r,
1311
1311
  s,
1312
1312
  n
1313
1313
  ];
1314
- let o = i.length, c = o, f, l, u = qn;
1314
+ let o = i.length, c = o, f, l, u = Vn;
1315
1315
  for (; c--; )
1316
- f = i[c], l = u.get(f), l === void 0 && u.set(f, l = c ? /* @__PURE__ */ new Map() : Mn(t)), u = l;
1316
+ f = i[c], l = u.get(f), l === void 0 && u.set(f, l = c ? /* @__PURE__ */ new Map() : qn(t)), u = l;
1317
1317
  return l;
1318
1318
  };
1319
1319
  pt();
1320
1320
  const Oe = {
1321
- http: sn,
1322
- xhr: Bn,
1321
+ http: on,
1322
+ xhr: Dn,
1323
1323
  fetch: {
1324
1324
  get: pt
1325
1325
  }
@@ -1333,8 +1333,8 @@ a.forEach(Oe, (e, t) => {
1333
1333
  Object.defineProperty(e, "adapterName", { value: t });
1334
1334
  }
1335
1335
  });
1336
- const Ve = (e) => `- ${e}`, Vn = (e) => a.isFunction(e) || e === null || e === !1;
1337
- function zn(e, t) {
1336
+ const Ve = (e) => `- ${e}`, zn = (e) => a.isFunction(e) || e === null || e === !1;
1337
+ function Jn(e, t) {
1338
1338
  e = a.isArray(e) ? e : [e];
1339
1339
  const { length: n } = e;
1340
1340
  let r, s;
@@ -1342,7 +1342,7 @@ function zn(e, t) {
1342
1342
  for (let o = 0; o < n; o++) {
1343
1343
  r = e[o];
1344
1344
  let c;
1345
- if (s = r, !Vn(r) && (s = Oe[(c = String(r)).toLowerCase()], s === void 0))
1345
+ if (s = r, !zn(r) && (s = Oe[(c = String(r)).toLowerCase()], s === void 0))
1346
1346
  throw new y(`Unknown adapter '${c}'`);
1347
1347
  if (s && (a.isFunction(s) || (s = s.get(t))))
1348
1348
  break;
@@ -1367,7 +1367,7 @@ const ht = {
1367
1367
  * Resolve an adapter from a list of adapter names or functions.
1368
1368
  * @type {Function}
1369
1369
  */
1370
- getAdapter: zn,
1370
+ getAdapter: Jn,
1371
1371
  /**
1372
1372
  * Exposes all known adapters
1373
1373
  * @type {Object<string, Function|Object>}
@@ -1424,7 +1424,7 @@ le.transitional = function(t, n, r) {
1424
1424
  le.spelling = function(t) {
1425
1425
  return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1426
1426
  };
1427
- function Jn(e, t, n) {
1427
+ function Wn(e, t, n) {
1428
1428
  if (typeof e != "object")
1429
1429
  throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
1430
1430
  const r = Object.keys(e);
@@ -1442,7 +1442,7 @@ function Jn(e, t, n) {
1442
1442
  }
1443
1443
  }
1444
1444
  const re = {
1445
- assertOptions: Jn,
1445
+ assertOptions: Wn,
1446
1446
  validators: le
1447
1447
  }, F = re.validators;
1448
1448
  let j = class {
@@ -1569,7 +1569,7 @@ a.forEach(["post", "put", "patch"], function(t) {
1569
1569
  }
1570
1570
  j.prototype[t] = n(), j.prototype[t + "Form"] = n(!0);
1571
1571
  });
1572
- let Wn = class yt {
1572
+ let vn = class yt {
1573
1573
  constructor(t) {
1574
1574
  if (typeof t != "function")
1575
1575
  throw new TypeError("executor must be a function.");
@@ -1642,12 +1642,12 @@ let Wn = class yt {
1642
1642
  };
1643
1643
  }
1644
1644
  };
1645
- function vn(e) {
1645
+ function Qn(e) {
1646
1646
  return function(n) {
1647
1647
  return e.apply(null, n);
1648
1648
  };
1649
1649
  }
1650
- function Qn(e) {
1650
+ function Xn(e) {
1651
1651
  return a.isObject(e) && e.isAxiosError === !0;
1652
1652
  }
1653
1653
  const we = {
@@ -1733,7 +1733,7 @@ function bt(e) {
1733
1733
  const g = bt(X);
1734
1734
  g.Axios = j;
1735
1735
  g.CanceledError = V;
1736
- g.CancelToken = Wn;
1736
+ g.CancelToken = vn;
1737
1737
  g.isCancel = lt;
1738
1738
  g.VERSION = mt;
1739
1739
  g.toFormData = ce;
@@ -1742,8 +1742,8 @@ g.Cancel = g.CanceledError;
1742
1742
  g.all = function(t) {
1743
1743
  return Promise.all(t);
1744
1744
  };
1745
- g.spread = vn;
1746
- g.isAxiosError = Qn;
1745
+ g.spread = Qn;
1746
+ g.isAxiosError = Xn;
1747
1747
  g.mergeConfig = I;
1748
1748
  g.AxiosHeaders = A;
1749
1749
  g.formToJSON = (e) => ct(a.isHTMLForm(e) ? new FormData(e) : e);
@@ -1751,34 +1751,35 @@ g.getAdapter = ht.getAdapter;
1751
1751
  g.HttpStatusCode = we;
1752
1752
  g.default = g;
1753
1753
  const {
1754
- Axios: cr,
1755
- AxiosError: lr,
1756
- CanceledError: ur,
1757
- isCancel: fr,
1758
- CancelToken: dr,
1759
- VERSION: pr,
1760
- all: hr,
1761
- Cancel: mr,
1762
- isAxiosError: yr,
1763
- spread: br,
1764
- toFormData: wr,
1765
- AxiosHeaders: gr,
1766
- HttpStatusCode: Sr,
1767
- formToJSON: Er,
1768
- getAdapter: Rr,
1769
- mergeConfig: Or
1770
- } = g, Xn = {
1754
+ Axios: lr,
1755
+ AxiosError: ur,
1756
+ CanceledError: fr,
1757
+ isCancel: dr,
1758
+ CancelToken: pr,
1759
+ VERSION: hr,
1760
+ all: mr,
1761
+ Cancel: yr,
1762
+ isAxiosError: br,
1763
+ spread: wr,
1764
+ toFormData: gr,
1765
+ AxiosHeaders: Sr,
1766
+ HttpStatusCode: Er,
1767
+ formToJSON: Rr,
1768
+ getAdapter: Or,
1769
+ mergeConfig: Tr
1770
+ } = g, Kn = {
1771
1771
  abortController: new AbortController()
1772
1772
  };
1773
- let ge = "";
1774
- const Tr = (e) => {
1775
- e.backendURL && (ge = e.backendURL, M.defaults.baseURL = ge);
1773
+ let ge = "", wt = {};
1774
+ const Ar = (e) => {
1775
+ e.backendURL && (ge = e.backendURL, M.defaults.baseURL = ge), e?.axiosCreate && (wt = e.axiosCreate);
1776
1776
  }, M = g.create({
1777
1777
  baseURL: ge,
1778
- signal: Xn.abortController.signal
1778
+ signal: Kn.abortController.signal,
1779
1779
  // Signal that is assiciated with any request to be made with this axios instance
1780
- }), Kn = (e) => {
1781
- const t = Zn(), n = t?.token ?? null, r = t?.expiresIn ?? null;
1780
+ ...wt ?? {}
1781
+ }), Gn = (e) => {
1782
+ const t = Yn(), n = t?.token ?? null, r = t?.expiresIn ?? null;
1782
1783
  if (r) {
1783
1784
  const s = t?.timestamp ?? null, i = Date.now();
1784
1785
  if (r && i - s > r * 1e3)
@@ -1796,15 +1797,15 @@ M.interceptors.response.use(
1796
1797
  (e) => (console.log("Error.....", e), e.response?.status, Promise.reject(e))
1797
1798
  );
1798
1799
  M.interceptors.request.use(
1799
- Kn,
1800
+ Gn,
1800
1801
  (e) => Promise.reject(e)
1801
1802
  );
1802
- const Ar = async ({ url: e, method: t, data: n }) => {
1803
+ const Cr = async ({ url: e, method: t, data: n }) => {
1803
1804
  let r = n ?? {};
1804
1805
  try {
1805
1806
  let s = null;
1806
1807
  if (t.toLowerCase() === "get") {
1807
- const o = Gn(r ?? {});
1808
+ const o = Zn(r ?? {});
1808
1809
  s = await M.get(`${e}${o}`);
1809
1810
  } else
1810
1811
  s = await M.post(e, r);
@@ -1812,7 +1813,7 @@ const Ar = async ({ url: e, method: t, data: n }) => {
1812
1813
  } catch (s) {
1813
1814
  return console.error(s), { success: !1, error: s };
1814
1815
  }
1815
- }, Gn = (e = {}) => {
1816
+ }, Zn = (e = {}) => {
1816
1817
  try {
1817
1818
  let t = "?";
1818
1819
  for (let n in e)
@@ -1828,13 +1829,13 @@ const Ar = async ({ url: e, method: t, data: n }) => {
1828
1829
  console.error(t);
1829
1830
  }
1830
1831
  };
1831
- function Cr(e = { token: null }) {
1832
+ function xr(e = { token: null }) {
1832
1833
  if (typeof e != "object" || e === null || Array.isArray(e))
1833
1834
  throw new TypeError("setBearerToken expects an object {token} with a 'token' property.");
1834
1835
  const t = { token: null, ...e, timestamp: Date.now() };
1835
1836
  localStorage.setItem("logginToken", JSON.stringify(t));
1836
1837
  }
1837
- function Zn() {
1838
+ function Yn() {
1838
1839
  const e = localStorage.getItem("logginToken");
1839
1840
  try {
1840
1841
  return e ? JSON.parse(e) : null;
@@ -1852,8 +1853,8 @@ const We = (e) => {
1852
1853
  }
1853
1854
  }, s = () => t, c = { setState: r, getState: s, getInitialState: () => f, subscribe: (l) => (n.add(l), () => n.delete(l)) }, f = t = e(r, s, c);
1854
1855
  return c;
1855
- }, Yn = ((e) => e ? We(e) : We), er = (e) => e;
1856
- function tr(e, t = er) {
1856
+ }, er = ((e) => e ? We(e) : We), tr = (e) => e;
1857
+ function nr(e, t = tr) {
1857
1858
  const n = Y.useSyncExternalStore(
1858
1859
  e.subscribe,
1859
1860
  Y.useCallback(() => t(e.getState()), [e, t]),
@@ -1862,9 +1863,9 @@ function tr(e, t = er) {
1862
1863
  return Y.useDebugValue(n), n;
1863
1864
  }
1864
1865
  const ve = (e) => {
1865
- const t = Yn(e), n = (r) => tr(t, r);
1866
+ const t = er(e), n = (r) => nr(t, r);
1866
1867
  return Object.assign(n, t), n;
1867
- }, nr = ((e) => e ? ve(e) : ve), rr = nr((e, t) => ({
1868
+ }, rr = ((e) => e ? ve(e) : ve), sr = rr((e, t) => ({
1868
1869
  loading: !1,
1869
1870
  stateValue: {},
1870
1871
  checkQueriesInQue: {},
@@ -1940,16 +1941,16 @@ const ve = (e) => {
1940
1941
  t().cleareQueApi(l), f && f([]), console.error(u);
1941
1942
  }
1942
1943
  }
1943
- })), sr = rr;
1944
- function xr() {
1945
- return sr();
1944
+ })), or = sr;
1945
+ function Nr() {
1946
+ return or();
1946
1947
  }
1947
1948
  export {
1948
- sr as Store,
1949
- xr as default,
1950
- Gn as generateParams,
1951
- Zn as getBearerToken,
1952
- Tr as setBaseURL,
1953
- Cr as setBearerToken,
1954
- Ar as useFetch
1949
+ or as Store,
1950
+ Nr as default,
1951
+ Zn as generateParams,
1952
+ Yn as getBearerToken,
1953
+ Ar as setBaseURL,
1954
+ xr as setBearerToken,
1955
+ Cr as useFetch
1955
1956
  };
@@ -1,6 +1,6 @@
1
- (function(C,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],L):(C=typeof globalThis<"u"?globalThis:C||self,L(C["septor-store-react"]={},C.React))})(this,(function(C,L){"use strict";var fe=typeof document<"u"?document.currentScript:null;function Ce(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ot}=Object.prototype,{getPrototypeOf:de}=Object,{iterator:Z,toStringTag:xe}=Symbol,Y=(e=>t=>{const n=Ot.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Y(t)===e),ee=e=>t=>typeof t===e,{isArray:M}=Array,q=ee("undefined");function v(e){return e!==null&&!q(e)&&e.constructor!==null&&!q(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ne=P("ArrayBuffer");function Tt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ne(e.buffer),t}const At=ee("string"),O=ee("function"),Pe=ee("number"),W=e=>e!==null&&typeof e=="object",Ct=e=>e===!0||e===!1,te=e=>{if(Y(e)!=="object")return!1;const t=de(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(xe in e)&&!(Z in e)},xt=e=>{if(!W(e)||v(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Nt=P("Date"),Pt=P("File"),kt=P("Blob"),Ft=P("FileList"),Ut=e=>W(e)&&O(e.pipe),Lt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=Y(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},_t=P("URLSearchParams"),[Bt,Dt,jt,It]=["ReadableStream","Request","Response","Headers"].map(P),Ht=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),M(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(v(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function ke(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const D=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fe=e=>!q(e)&&e!==D;function pe(){const{caseless:e,skipUndefined:t}=Fe(this)&&this||{},n={},r=(s,i)=>{const o=e&&ke(n,i)||i;te(n[o])&&te(s)?n[o]=pe(n[o],s):te(s)?n[o]=pe({},s):M(s)?n[o]=s.slice():(!t||!q(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Q(arguments[s],r);return n}const $t=(e,t,n,{allOwnKeys:r}={})=>(Q(t,(s,i)=>{n&&O(s)?e[i]=Ce(s,n):e[i]=s},{allOwnKeys:r}),e),Mt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Vt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&de(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Jt=e=>{if(!e)return null;if(M(e))return e;let t=e.length;if(!Pe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},vt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&de(Uint8Array)),Wt=(e,t)=>{const r=(e&&e[Z]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Qt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Xt=P("HTMLFormElement"),Kt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ue=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Gt=P("RegExp"),Le=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Q(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},Zt=e=>{Le(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Yt=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return M(e)?r(e):r(String(e).split(t)),n},en=()=>{},tn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function nn(e){return!!(e&&O(e.append)&&e[xe]==="FormData"&&e[Z])}const rn=e=>{const t=new Array(10),n=(r,s)=>{if(W(r)){if(t.indexOf(r)>=0)return;if(v(r))return r;if(!("toJSON"in r)){t[s]=r;const i=M(r)?[]:{};return Q(r,(o,c)=>{const f=n(o,s+1);!q(f)&&(i[c]=f)}),t[s]=void 0,i}}return r};return n(e,0)},sn=P("AsyncFunction"),on=e=>e&&(W(e)||O(e))&&O(e.then)&&O(e.catch),_e=((e,t)=>e?setImmediate:t?((n,r)=>(D.addEventListener("message",({source:s,data:i})=>{s===D&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),D.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(D.postMessage)),an=typeof queueMicrotask<"u"?queueMicrotask.bind(D):typeof process<"u"&&process.nextTick||_e,a={isArray:M,isArrayBuffer:Ne,isBuffer:v,isFormData:Lt,isArrayBufferView:Tt,isString:At,isNumber:Pe,isBoolean:Ct,isObject:W,isPlainObject:te,isEmptyObject:xt,isReadableStream:Bt,isRequest:Dt,isResponse:jt,isHeaders:It,isUndefined:q,isDate:Nt,isFile:Pt,isBlob:kt,isRegExp:Gt,isFunction:O,isStream:Ut,isURLSearchParams:_t,isTypedArray:vt,isFileList:Ft,forEach:Q,merge:pe,extend:$t,trim:Ht,stripBOM:Mt,inherits:qt,toFlatObject:Vt,kindOf:Y,kindOfTest:P,endsWith:zt,toArray:Jt,forEachEntry:Wt,matchAll:Qt,isHTMLForm:Xt,hasOwnProperty:Ue,hasOwnProp:Ue,reduceDescriptors:Le,freezeMethods:Zt,toObjectSet:Yt,toCamelCase:Kt,noop:en,toFiniteNumber:tn,findKey:ke,global:D,isContextDefined:Fe,isSpecCompliantForm:nn,toJSONObject:rn,isAsyncFn:sn,isThenable:on,setImmediate:_e,asap:an,isIterable:e=>e!=null&&O(e[Z])};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Be=y.prototype,De={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{De[e]={value:e}}),Object.defineProperties(y,De),Object.defineProperty(Be,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(Be);a.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return y.call(o,c,f,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const cn=null;function he(e){return a.isPlainObject(e)||a.isArray(e)}function je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,i){return s=je(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function ln(e){return a.isArray(e)&&!e.some(he)}const un=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ne(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,m,h){let g=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&ln(d)||(a.isFileList(d)||a.endsWith(m,"[]"))&&(g=a.toArray(d)))return m=je(m),g.forEach(function(E,A){!(a.isUndefined(E)||E===null)&&t.append(o===!0?Ie([m],A,i):o===null?m:m+"[]",l(E))}),!1}return he(d)?!0:(t.append(Ie(h,m,i),l(d)),!1)}const p=[],b=Object.assign(un,{defaultVisitor:u,convertValue:l,isVisitable:he});function w(d,m){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),a.forEach(d,function(g,x){(!(a.isUndefined(g)||g===null)&&s.call(t,g,a.isString(x)?x.trim():x,m,b))===!0&&w(g,m?m.concat(x):[x])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function He(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function me(e,t){this._pairs=[],e&&ne(e,this,t)}const $e=me.prototype;$e.append=function(t,n){this._pairs.push([t,n])},$e.toString=function(t){const n=t?function(r){return t.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function fn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Me(e,t,n){if(!t)return e;const r=n&&n.encode||fn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new me(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ye=typeof window<"u"&&typeof document<"u",be=typeof navigator=="object"&&navigator||void 0,pn=ye&&(!be||["ReactNative","NativeScript","NS"].indexOf(be.product)<0),hn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",mn=ye&&window.location.href||"http://localhost",R={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ye,hasStandardBrowserEnv:pn,hasStandardBrowserWebWorkerEnv:hn,navigator:be,origin:mn},Symbol.toStringTag,{value:"Module"})),...dn};function yn(e,t){return ne(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,i){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function bn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ze(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=wn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(bn(r),s,n,0)}),n}return null}function Sn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X={transitional:Ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return yn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ne(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Sn(t)):t}],transformResponse:[function(t){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{X.headers[e]={}});const gn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),En=e=>{const t={};let n,r,s;return e&&e.split(`
2
- `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&gn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Je=Symbol("internals");function K(e){return e&&String(e).trim().toLowerCase()}function re(e){return e===!1||e==null?e:a.isArray(e)?e.map(re):String(e)}function Rn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const On=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function we(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Tn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function An(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let T=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,f,l){const u=K(f);if(!u)throw new Error("header name must be a non-empty string");const p=a.findKey(s,u);(!p||s[p]===void 0||l===!0||l===void 0&&s[p]!==!1)&&(s[p||f]=re(c))}const o=(c,f)=>a.forEach(c,(l,u)=>i(l,u,f));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!On(t))o(En(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(f=c[l])?a.isArray(f)?[...f,u[1]]:[f,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=K(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Rn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=K(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||we(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=K(o),o){const c=a.findKey(r,o);c&&(!n||we(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||we(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=re(s),delete n[i];return}const c=t?Tn(i):String(i).trim();c!==i&&delete n[i],n[c]=re(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Je]=this[Je]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=K(o);r[c]||(An(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(T.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(T);function Se(e,t){const n=this||X,r=t||n,s=T.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ve(e){return!!(e&&e.__CANCEL__)}function V(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(V,y,{__CANCEL__:!0});function We(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),u=r[i];o||(o=l),n[s]=f,r[s]=l;let p=i,b=0;for(;p!==s;)b+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const w=u&&l-u;return w?Math.round(b*1e3/w):void 0}}function Nn(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),p=u-n;p>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-p)))},()=>s&&o(s)]}const se=(e,t,n=3)=>{let r=0;const s=xn(50,250);return Nn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-r,l=s(f),u=o<=c;r=o;const p={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Qe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xe=e=>(...t)=>a.asap(()=>e(...t)),Pn=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,kn=R.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Fn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t,n){let r=!Fn(t);return e&&(r||n==!1)?Un(e,t):t}const Ge=e=>e instanceof T?{...e}:e;function j(e,t){t=t||{};const n={};function r(l,u,p,b){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:b},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,p,b){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,p,b)}else return r(l,u,p,b)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,p){if(p in t)return r(l,u);if(p in e)return r(void 0,l)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,p)=>s(Ge(l),Ge(u),p,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const p=f[u]||s,b=p(e[u],t[u],u);a.isUndefined(b)&&p!==c||(n[u]=b)}),n}const Ze=e=>{const t=j({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=T.from(o),t.url=Me(Ke(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,p])=>{l.includes(u.toLowerCase())&&o.set(u,p)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Pn(t.url))){const f=s&&i&&kn.read(i);f&&o.set(s,f)}return t},Ln=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Ze(e);let i=s.data;const o=T.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,p,b,w,d;function m(){w&&w(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function g(){if(!h)return;const E=T.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:E,config:e,request:h};We(function(N){n(N),m()},function(N){r(N),m()},k),h=null}"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(g)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(A){const k=A&&A.message?A.message:"Network Error",H=new y(k,y.ERR_NETWORK,e,h);H.event=A||null,r(H),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||Ve;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new y(A,k.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(A,k){h.setRequestHeader(k,A)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),l&&([b,d]=se(l,!0),h.addEventListener("progress",b)),f&&h.upload&&([p,w]=se(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(u=E=>{h&&(r(!E||E.type?new V(null,e,h):E),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=Cn(s.url);if(x&&R.protocols.indexOf(x)===-1){r(new y("Unsupported protocol "+x+":",y.ERR_BAD_REQUEST,e));return}h.send(i||null)})},_n=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof y?u:new V(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Bn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Dn=async function*(e,t){for await(const n of jn(e))yield*Bn(n,t)},jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ye=(e,t,n,r)=>{const s=Dn(e,t);let i=0,o,c=f=>{o||(o=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let p=u.byteLength;if(n){let b=i+=p;n(b)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},et=64*1024,{isFunction:oe}=a,In=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:tt,TextEncoder:nt}=a.global,rt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Hn=e=>{e=a.merge.call({skipUndefined:!0},In,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",i=oe(n),o=oe(r);if(!s)return!1;const c=s&&oe(tt),f=s&&(typeof nt=="function"?(d=>m=>d.encode(m))(new nt):async d=>new Uint8Array(await new n(d).arrayBuffer())),l=i&&c&&rt(()=>{let d=!1;const m=new n(R.origin,{body:new tt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),u=o&&c&&rt(()=>a.isReadableStream(new r("").body)),p={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(m,h)=>{let g=m&&m[d];if(g)return g.call(m);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,h)})});const b=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(R.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},w=async(d,m)=>{const h=a.toFiniteNumber(d.getContentLength());return h??b(m)};return async d=>{let{url:m,method:h,data:g,signal:x,cancelToken:E,timeout:A,onDownloadProgress:k,onUploadProgress:H,responseType:N,headers:Te,withCredentials:ce="same-origin",fetchOptions:yt}=Ze(d),bt=t||fetch;N=N?(N+"").toLowerCase():"text";let le=_n([x,E&&E.toAbortSignal()],A),G=null;const $=le&&le.unsubscribe&&(()=>{le.unsubscribe()});let wt;try{if(H&&l&&h!=="get"&&h!=="head"&&(wt=await w(Te,g))!==0){let B=new n(m,{method:"POST",body:g,duplex:"half"}),J;if(a.isFormData(g)&&(J=B.headers.get("content-type"))&&Te.setContentType(J),B.body){const[Ae,ue]=Qe(wt,se(Xe(H)));g=Ye(B.body,et,Ae,ue)}}a.isString(ce)||(ce=ce?"include":"omit");const U=i&&"credentials"in n.prototype,St={...yt,signal:le,method:h.toUpperCase(),headers:Te.normalize().toJSON(),body:g,duplex:"half",credentials:U?ce:void 0};G=i&&new n(m,St);let _=await(i?bt(G,yt):bt(m,St));const gt=u&&(N==="stream"||N==="response");if(u&&(k||gt&&$)){const B={};["status","statusText","headers"].forEach(Et=>{B[Et]=_[Et]});const J=a.toFiniteNumber(_.headers.get("content-length")),[Ae,ue]=k&&Qe(J,se(Xe(k),!0))||[];_=new r(Ye(_.body,et,Ae,()=>{ue&&ue(),$&&$()}),B)}N=N||"text";let nr=await p[a.findKey(p,N)||"text"](_,d);return!gt&&$&&$(),await new Promise((B,J)=>{We(B,J,{data:nr,headers:T.from(_.headers),status:_.status,statusText:_.statusText,config:d,request:G})})}catch(U){throw $&&$(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,G),{cause:U.cause||U}):y.from(U,U&&U.code,d,G)}}},$n=new Map,st=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,f,l,u=$n;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:Hn(t)),u=l;return l};st();const ge={http:cn,xhr:Ln,fetch:{get:st}};a.forEach(ge,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ot=e=>`- ${e}`,Mn=e=>a.isFunction(e)||e===null||e===!1;function qn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!Mn(r)&&(s=ge[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
1
+ (function(C,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],L):(C=typeof globalThis<"u"?globalThis:C||self,L(C["septor-store-react"]={},C.React))})(this,(function(C,L){"use strict";var fe=typeof document<"u"?document.currentScript:null;function Ce(e,t){return function(){return e.apply(t,arguments)}}const{toString:Tt}=Object.prototype,{getPrototypeOf:de}=Object,{iterator:Z,toStringTag:xe}=Symbol,Y=(e=>t=>{const n=Tt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Y(t)===e),ee=e=>t=>typeof t===e,{isArray:M}=Array,q=ee("undefined");function v(e){return e!==null&&!q(e)&&e.constructor!==null&&!q(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ne=P("ArrayBuffer");function At(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ne(e.buffer),t}const Ct=ee("string"),O=ee("function"),Pe=ee("number"),W=e=>e!==null&&typeof e=="object",xt=e=>e===!0||e===!1,te=e=>{if(Y(e)!=="object")return!1;const t=de(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(xe in e)&&!(Z in e)},Nt=e=>{if(!W(e)||v(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pt=P("Date"),kt=P("File"),Ft=P("Blob"),Ut=P("FileList"),Lt=e=>W(e)&&O(e.pipe),_t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=Y(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Bt=P("URLSearchParams"),[Dt,jt,It,Ht]=["ReadableStream","Request","Response","Headers"].map(P),$t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),M(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(v(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function ke(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const D=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fe=e=>!q(e)&&e!==D;function pe(){const{caseless:e,skipUndefined:t}=Fe(this)&&this||{},n={},r=(s,i)=>{const o=e&&ke(n,i)||i;te(n[o])&&te(s)?n[o]=pe(n[o],s):te(s)?n[o]=pe({},s):M(s)?n[o]=s.slice():(!t||!q(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Q(arguments[s],r);return n}const Mt=(e,t,n,{allOwnKeys:r}={})=>(Q(t,(s,i)=>{n&&O(s)?e[i]=Ce(s,n):e[i]=s},{allOwnKeys:r}),e),qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},zt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&de(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Jt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},vt=e=>{if(!e)return null;if(M(e))return e;let t=e.length;if(!Pe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&de(Uint8Array)),Qt=(e,t)=>{const r=(e&&e[Z]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Xt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Kt=P("HTMLFormElement"),Gt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ue=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Zt=P("RegExp"),Le=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Q(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},Yt=e=>{Le(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},en=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return M(e)?r(e):r(String(e).split(t)),n},tn=()=>{},nn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function rn(e){return!!(e&&O(e.append)&&e[xe]==="FormData"&&e[Z])}const sn=e=>{const t=new Array(10),n=(r,s)=>{if(W(r)){if(t.indexOf(r)>=0)return;if(v(r))return r;if(!("toJSON"in r)){t[s]=r;const i=M(r)?[]:{};return Q(r,(o,c)=>{const f=n(o,s+1);!q(f)&&(i[c]=f)}),t[s]=void 0,i}}return r};return n(e,0)},on=P("AsyncFunction"),an=e=>e&&(W(e)||O(e))&&O(e.then)&&O(e.catch),_e=((e,t)=>e?setImmediate:t?((n,r)=>(D.addEventListener("message",({source:s,data:i})=>{s===D&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),D.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(D.postMessage)),cn=typeof queueMicrotask<"u"?queueMicrotask.bind(D):typeof process<"u"&&process.nextTick||_e,a={isArray:M,isArrayBuffer:Ne,isBuffer:v,isFormData:_t,isArrayBufferView:At,isString:Ct,isNumber:Pe,isBoolean:xt,isObject:W,isPlainObject:te,isEmptyObject:Nt,isReadableStream:Dt,isRequest:jt,isResponse:It,isHeaders:Ht,isUndefined:q,isDate:Pt,isFile:kt,isBlob:Ft,isRegExp:Zt,isFunction:O,isStream:Lt,isURLSearchParams:Bt,isTypedArray:Wt,isFileList:Ut,forEach:Q,merge:pe,extend:Mt,trim:$t,stripBOM:qt,inherits:Vt,toFlatObject:zt,kindOf:Y,kindOfTest:P,endsWith:Jt,toArray:vt,forEachEntry:Qt,matchAll:Xt,isHTMLForm:Kt,hasOwnProperty:Ue,hasOwnProp:Ue,reduceDescriptors:Le,freezeMethods:Yt,toObjectSet:en,toCamelCase:Gt,noop:tn,toFiniteNumber:nn,findKey:ke,global:D,isContextDefined:Fe,isSpecCompliantForm:rn,toJSONObject:sn,isAsyncFn:on,isThenable:an,setImmediate:_e,asap:cn,isIterable:e=>e!=null&&O(e[Z])};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Be=y.prototype,De={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{De[e]={value:e}}),Object.defineProperties(y,De),Object.defineProperty(Be,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(Be);a.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return y.call(o,c,f,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const ln=null;function he(e){return a.isPlainObject(e)||a.isArray(e)}function je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,i){return s=je(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function un(e){return a.isArray(e)&&!e.some(he)}const fn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ne(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,m,h){let g=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&un(d)||(a.isFileList(d)||a.endsWith(m,"[]"))&&(g=a.toArray(d)))return m=je(m),g.forEach(function(E,A){!(a.isUndefined(E)||E===null)&&t.append(o===!0?Ie([m],A,i):o===null?m:m+"[]",l(E))}),!1}return he(d)?!0:(t.append(Ie(h,m,i),l(d)),!1)}const p=[],b=Object.assign(fn,{defaultVisitor:u,convertValue:l,isVisitable:he});function w(d,m){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),a.forEach(d,function(g,x){(!(a.isUndefined(g)||g===null)&&s.call(t,g,a.isString(x)?x.trim():x,m,b))===!0&&w(g,m?m.concat(x):[x])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function He(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function me(e,t){this._pairs=[],e&&ne(e,this,t)}const $e=me.prototype;$e.append=function(t,n){this._pairs.push([t,n])},$e.toString=function(t){const n=t?function(r){return t.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function dn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Me(e,t,n){if(!t)return e;const r=n&&n.encode||dn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new me(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ye=typeof window<"u"&&typeof document<"u",be=typeof navigator=="object"&&navigator||void 0,hn=ye&&(!be||["ReactNative","NativeScript","NS"].indexOf(be.product)<0),mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yn=ye&&window.location.href||"http://localhost",R={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ye,hasStandardBrowserEnv:hn,hasStandardBrowserWebWorkerEnv:mn,navigator:be,origin:yn},Symbol.toStringTag,{value:"Module"})),...pn};function bn(e,t){return ne(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,i){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function wn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ze(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Sn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(wn(r),s,n,0)}),n}return null}function gn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X={transitional:Ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return bn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ne(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),gn(t)):t}],transformResponse:[function(t){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{X.headers[e]={}});const En=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rn=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&En[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Je=Symbol("internals");function K(e){return e&&String(e).trim().toLowerCase()}function re(e){return e===!1||e==null?e:a.isArray(e)?e.map(re):String(e)}function On(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Tn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function we(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function An(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Cn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let T=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,f,l){const u=K(f);if(!u)throw new Error("header name must be a non-empty string");const p=a.findKey(s,u);(!p||s[p]===void 0||l===!0||l===void 0&&s[p]!==!1)&&(s[p||f]=re(c))}const o=(c,f)=>a.forEach(c,(l,u)=>i(l,u,f));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Tn(t))o(Rn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(f=c[l])?a.isArray(f)?[...f,u[1]]:[f,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=K(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return On(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=K(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||we(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=K(o),o){const c=a.findKey(r,o);c&&(!n||we(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||we(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=re(s),delete n[i];return}const c=t?An(i):String(i).trim();c!==i&&delete n[i],n[c]=re(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Je]=this[Je]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=K(o);r[c]||(Cn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(T.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(T);function Se(e,t){const n=this||X,r=t||n,s=T.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ve(e){return!!(e&&e.__CANCEL__)}function V(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(V,y,{__CANCEL__:!0});function We(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Nn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),u=r[i];o||(o=l),n[s]=f,r[s]=l;let p=i,b=0;for(;p!==s;)b+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const w=u&&l-u;return w?Math.round(b*1e3/w):void 0}}function Pn(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),p=u-n;p>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-p)))},()=>s&&o(s)]}const se=(e,t,n=3)=>{let r=0;const s=Nn(50,250);return Pn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-r,l=s(f),u=o<=c;r=o;const p={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Qe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xe=e=>(...t)=>a.asap(()=>e(...t)),kn=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Fn=R.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Un(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ln(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t,n){let r=!Un(t);return e&&(r||n==!1)?Ln(e,t):t}const Ge=e=>e instanceof T?{...e}:e;function j(e,t){t=t||{};const n={};function r(l,u,p,b){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:b},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,p,b){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,p,b)}else return r(l,u,p,b)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,p){if(p in t)return r(l,u);if(p in e)return r(void 0,l)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,p)=>s(Ge(l),Ge(u),p,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const p=f[u]||s,b=p(e[u],t[u],u);a.isUndefined(b)&&p!==c||(n[u]=b)}),n}const Ze=e=>{const t=j({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=T.from(o),t.url=Me(Ke(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,p])=>{l.includes(u.toLowerCase())&&o.set(u,p)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&kn(t.url))){const f=s&&i&&Fn.read(i);f&&o.set(s,f)}return t},_n=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Ze(e);let i=s.data;const o=T.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,p,b,w,d;function m(){w&&w(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function g(){if(!h)return;const E=T.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:E,config:e,request:h};We(function(N){n(N),m()},function(N){r(N),m()},k),h=null}"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(g)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(A){const k=A&&A.message?A.message:"Network Error",H=new y(k,y.ERR_NETWORK,e,h);H.event=A||null,r(H),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||Ve;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new y(A,k.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(A,k){h.setRequestHeader(k,A)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),l&&([b,d]=se(l,!0),h.addEventListener("progress",b)),f&&h.upload&&([p,w]=se(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(u=E=>{h&&(r(!E||E.type?new V(null,e,h):E),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=xn(s.url);if(x&&R.protocols.indexOf(x)===-1){r(new y("Unsupported protocol "+x+":",y.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Bn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof y?u:new V(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Dn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},jn=async function*(e,t){for await(const n of In(e))yield*Dn(n,t)},In=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ye=(e,t,n,r)=>{const s=jn(e,t);let i=0,o,c=f=>{o||(o=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let p=u.byteLength;if(n){let b=i+=p;n(b)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},et=64*1024,{isFunction:oe}=a,Hn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:tt,TextEncoder:nt}=a.global,rt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$n=e=>{e=a.merge.call({skipUndefined:!0},Hn,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",i=oe(n),o=oe(r);if(!s)return!1;const c=s&&oe(tt),f=s&&(typeof nt=="function"?(d=>m=>d.encode(m))(new nt):async d=>new Uint8Array(await new n(d).arrayBuffer())),l=i&&c&&rt(()=>{let d=!1;const m=new n(R.origin,{body:new tt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),u=o&&c&&rt(()=>a.isReadableStream(new r("").body)),p={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(m,h)=>{let g=m&&m[d];if(g)return g.call(m);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,h)})});const b=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(R.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},w=async(d,m)=>{const h=a.toFiniteNumber(d.getContentLength());return h??b(m)};return async d=>{let{url:m,method:h,data:g,signal:x,cancelToken:E,timeout:A,onDownloadProgress:k,onUploadProgress:H,responseType:N,headers:Te,withCredentials:ce="same-origin",fetchOptions:bt}=Ze(d),wt=t||fetch;N=N?(N+"").toLowerCase():"text";let le=Bn([x,E&&E.toAbortSignal()],A),G=null;const $=le&&le.unsubscribe&&(()=>{le.unsubscribe()});let St;try{if(H&&l&&h!=="get"&&h!=="head"&&(St=await w(Te,g))!==0){let B=new n(m,{method:"POST",body:g,duplex:"half"}),J;if(a.isFormData(g)&&(J=B.headers.get("content-type"))&&Te.setContentType(J),B.body){const[Ae,ue]=Qe(St,se(Xe(H)));g=Ye(B.body,et,Ae,ue)}}a.isString(ce)||(ce=ce?"include":"omit");const U=i&&"credentials"in n.prototype,gt={...bt,signal:le,method:h.toUpperCase(),headers:Te.normalize().toJSON(),body:g,duplex:"half",credentials:U?ce:void 0};G=i&&new n(m,gt);let _=await(i?wt(G,bt):wt(m,gt));const Et=u&&(N==="stream"||N==="response");if(u&&(k||Et&&$)){const B={};["status","statusText","headers"].forEach(Rt=>{B[Rt]=_[Rt]});const J=a.toFiniteNumber(_.headers.get("content-length")),[Ae,ue]=k&&Qe(J,se(Xe(k),!0))||[];_=new r(Ye(_.body,et,Ae,()=>{ue&&ue(),$&&$()}),B)}N=N||"text";let rr=await p[a.findKey(p,N)||"text"](_,d);return!Et&&$&&$(),await new Promise((B,J)=>{We(B,J,{data:rr,headers:T.from(_.headers),status:_.status,statusText:_.statusText,config:d,request:G})})}catch(U){throw $&&$(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,G),{cause:U.cause||U}):y.from(U,U&&U.code,d,G)}}},Mn=new Map,st=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,f,l,u=Mn;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:$n(t)),u=l;return l};st();const ge={http:ln,xhr:_n,fetch:{get:st}};a.forEach(ge,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ot=e=>`- ${e}`,qn=e=>a.isFunction(e)||e===null||e===!1;function Vn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!qn(r)&&(s=ge[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
4
4
  `+o.map(ot).join(`
5
- `):" "+ot(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const it={getAdapter:qn,adapters:ge};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new V(null,e)}function at(e){return Ee(e),e.headers=T.from(e.headers),e.data=Se.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),it.getAdapter(e.adapter||X.adapter,e)(e).then(function(r){return Ee(e),r.data=Se.call(e,e.transformResponse,r),r.headers=T.from(r.headers),r},function(r){return ve(r)||(Ee(e),r&&r.response&&(r.response.data=Se.call(e,e.transformResponse,r.response),r.response.headers=T.from(r.response.headers))),Promise.reject(r)})}const ct="1.13.2",ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ie[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const lt={};ie.transitional=function(t,n,r){function s(i,o){return"[Axios v"+ct+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new y(s(o," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!lt[o]&&(lt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},ie.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Vn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],f=c===void 0||o(c,i,e);if(f!==!0)throw new y("option "+i+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const ae={assertOptions:Vn,validators:ie},F=ae.validators;let I=class{constructor(t){this.defaults=t||{},this.interceptors={request:new qe,response:new qe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ae.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=T.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,p=0,b;if(!f){const d=[at.bind(this),void 0];for(d.unshift(...c),d.push(...l),b=d.length,u=Promise.resolve(n);p<b;)u=u.then(d[p++],d[p++]);return u}b=c.length;let w=n;for(;p<b;){const d=c[p++],m=c[p++];try{w=d(w)}catch(h){m.call(this,h);break}}try{u=at.call(this,w)}catch(d){return Promise.reject(d)}for(p=0,b=l.length;p<b;)u=u.then(l[p++],l[p++]);return u}getUri(t){t=j(this.defaults,t);const n=Ke(t.baseURL,t.url,t.allowAbsoluteUrls);return Me(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(n,r){return this.request(j(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(j(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}I.prototype[t]=n(),I.prototype[t+"Form"]=n(!0)});let zn=class Rt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new V(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Rt(function(s){t=s}),cancel:t}}};function Jn(e){return function(n){return e.apply(null,n)}}function vn(e){return a.isObject(e)&&e.isAxiosError===!0}const Re={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Re).forEach(([e,t])=>{Re[t]=e});function ut(e){const t=new I(e),n=Ce(I.prototype.request,t);return a.extend(n,I.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ut(j(e,s))},n}const S=ut(X);S.Axios=I,S.CanceledError=V,S.CancelToken=zn,S.isCancel=ve,S.VERSION=ct,S.toFormData=ne,S.AxiosError=y,S.Cancel=S.CanceledError,S.all=function(t){return Promise.all(t)},S.spread=Jn,S.isAxiosError=vn,S.mergeConfig=j,S.AxiosHeaders=T,S.formToJSON=e=>ze(a.isHTMLForm(e)?new FormData(e):e),S.getAdapter=it.getAdapter,S.HttpStatusCode=Re,S.default=S;const{Axios:lr,AxiosError:ur,CanceledError:fr,isCancel:dr,CancelToken:pr,VERSION:hr,all:mr,Cancel:yr,isAxiosError:br,spread:wr,toFormData:Sr,AxiosHeaders:gr,HttpStatusCode:Er,formToJSON:Rr,getAdapter:Or,mergeConfig:Tr}=S,Wn={abortController:new AbortController};let Oe=(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:fe&&fe.tagName.toUpperCase()==="SCRIPT"&&fe.src||new URL("index.umd.cjs",document.baseURI).href}<"u","");const Qn=e=>{e.backendURL&&(Oe=e.backendURL,z.defaults.baseURL=Oe)},z=S.create({baseURL:Oe,signal:Wn.abortController.signal}),Xn=e=>{const t=dt(),n=t?.token??null,r=t?.expiresIn??null;if(r){const s=t?.timestamp??null,i=Date.now();if(r&&i-s>r*1e3)return console.warn("Token has expired."),localStorage.removeItem("logginToken"),null}if(e.headers={...e.headers},n&&(e.headers.Authorization=`Bearer ${n}`),e.data instanceof FormData){const s=e.data;e.data=s}else e.data&&(e.data={...e.data??{}});return e};z.interceptors.response.use(e=>e,e=>(console.log("Error.....",e),e.response?.status,Promise.reject(e))),z.interceptors.request.use(Xn,e=>Promise.reject(e));const Kn=async({url:e,method:t,data:n})=>{let r=n??{};try{let s=null;if(t.toLowerCase()==="get"){const o=ft(r??{});s=await z.get(`${e}${o}`)}else s=await z.post(e,r);return s?.data??{Empty:"Empty"}}catch(s){return console.error(s),{success:!1,error:s}}},ft=(e={})=>{try{let t="?";for(let n in e)if(Object.hasOwnProperty.call(e,n)&&e[n])if(Array.isArray(e[n])){const r=e[n];for(const s of r)t+=`${n}[]=${s}&`}else t+=`${n}=${e[n]}&`;return t.slice(0,-1)}catch(t){console.error(t)}};function Gn(e={token:null}){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("setBearerToken expects an object {token} with a 'token' property.");const t={token:null,...e,timestamp:Date.now()};localStorage.setItem("logginToken",JSON.stringify(t))}function dt(){const e=localStorage.getItem("logginToken");try{return e?JSON.parse(e):null}catch(t){return console.error("Invalid token format in localStorage:",t),null}}const pt=e=>{let t;const n=new Set,r=(l,u)=>{const p=typeof l=="function"?l(t):l;if(!Object.is(p,t)){const b=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(w=>w(t,b))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>f,subscribe:l=>(n.add(l),()=>n.delete(l))},f=t=e(r,s,c);return c},Zn=(e=>e?pt(e):pt),Yn=e=>e;function er(e,t=Yn){const n=L.useSyncExternalStore(e.subscribe,L.useCallback(()=>t(e.getState()),[e,t]),L.useCallback(()=>t(e.getInitialState()),[e,t]));return L.useDebugValue(n),n}const ht=e=>{const t=Zn(e),n=r=>er(t,r);return Object.assign(n,t),n},mt=(e=>e?ht(e):ht)((e,t)=>({loading:!1,stateValue:{},checkQueriesInQue:{},isThereAnyDataChangeInAform:!1,setStateValue:(n,r)=>e(s=>({stateValue:{...s.stateValue,[n]:r}})),getStateItem:n=>t().stateValue[n],sleep:n=>new Promise(r=>setTimeout(r,n)),validateLength:n=>Array.isArray(n)?n.length:typeof n=="object"?Object.keys(n).length:0,callApiData:async(n,r,s,i=!1,o=!1)=>{const{checkQueriesInQue:c}=t();if(t().getStateItem("checkQueriesInQue")?.[r]){console.warn(`************************************* dont call this api again ${s.url} 🛩️ *************************************`,s);return}t().setStateValue("loading",!0),t().setStateValue("checkQueriesInQue",{...c,[r]:r});const f=await z(s);return f?.status==200?(e({[n]:f?.data}),t().setStateValue(n,f?.data),o&&sessionStorage.setItem(n,JSON.stringify(f?.data))):console.error(f),t().cleareQueApi(r),e({loading:!1}),f},cleareQueApi:n=>{const s={...t().stateValue.checkQueriesInQue||{}};delete s[n],t().setStateValue("checkQueriesInQue",s)},complatedTheCall:async(n,r,s,i,o,c,f)=>{const l=await n.callApiData(r,s,i,o,c);return l?.status==200?(f&&f(l?.data),l?.data):(f&&f([]),l?.data)},stateGeneratorApi:async({reload:n,stateKey:r,req:s,time:i=0,paginated:o=!1,mStore:c={}},f)=>{e({[r]:[]});const l=JSON.stringify(s);try{const u=c?.mUse,p=t();if(e({loading:!0}),u){const w=JSON.parse(sessionStorage.getItem(r)||"{}");if(p.validateLength(w)&&(f&&f(w),e({[r]:w}),t().setStateValue(r,w),console.log(w),!n))return w}const b=p?.[r]??t().getStateItem(r);return p.validateLength(b)&&f&&f(b),n&&i>0&&setTimeout(()=>{t().complatedTheCall(p,r,l,s,o,u,f)},i*1e3),await t().complatedTheCall(p,r,l,s,o,u,f)}catch(u){t().cleareQueApi(l),f&&f([]),console.error(u)}}}));function tr(){return mt()}C.Store=mt,C.default=tr,C.generateParams=ft,C.getBearerToken=dt,C.setBaseURL=Qn,C.setBearerToken=Gn,C.useFetch=Kn,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
5
+ `):" "+ot(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const it={getAdapter:Vn,adapters:ge};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new V(null,e)}function at(e){return Ee(e),e.headers=T.from(e.headers),e.data=Se.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),it.getAdapter(e.adapter||X.adapter,e)(e).then(function(r){return Ee(e),r.data=Se.call(e,e.transformResponse,r),r.headers=T.from(r.headers),r},function(r){return ve(r)||(Ee(e),r&&r.response&&(r.response.data=Se.call(e,e.transformResponse,r.response),r.response.headers=T.from(r.response.headers))),Promise.reject(r)})}const ct="1.13.2",ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ie[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const lt={};ie.transitional=function(t,n,r){function s(i,o){return"[Axios v"+ct+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new y(s(o," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!lt[o]&&(lt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},ie.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function zn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],f=c===void 0||o(c,i,e);if(f!==!0)throw new y("option "+i+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const ae={assertOptions:zn,validators:ie},F=ae.validators;let I=class{constructor(t){this.defaults=t||{},this.interceptors={request:new qe,response:new qe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ae.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=T.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,p=0,b;if(!f){const d=[at.bind(this),void 0];for(d.unshift(...c),d.push(...l),b=d.length,u=Promise.resolve(n);p<b;)u=u.then(d[p++],d[p++]);return u}b=c.length;let w=n;for(;p<b;){const d=c[p++],m=c[p++];try{w=d(w)}catch(h){m.call(this,h);break}}try{u=at.call(this,w)}catch(d){return Promise.reject(d)}for(p=0,b=l.length;p<b;)u=u.then(l[p++],l[p++]);return u}getUri(t){t=j(this.defaults,t);const n=Ke(t.baseURL,t.url,t.allowAbsoluteUrls);return Me(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(n,r){return this.request(j(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(j(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}I.prototype[t]=n(),I.prototype[t+"Form"]=n(!0)});let Jn=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new V(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function vn(e){return function(n){return e.apply(null,n)}}function Wn(e){return a.isObject(e)&&e.isAxiosError===!0}const Re={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Re).forEach(([e,t])=>{Re[t]=e});function ut(e){const t=new I(e),n=Ce(I.prototype.request,t);return a.extend(n,I.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ut(j(e,s))},n}const S=ut(X);S.Axios=I,S.CanceledError=V,S.CancelToken=Jn,S.isCancel=ve,S.VERSION=ct,S.toFormData=ne,S.AxiosError=y,S.Cancel=S.CanceledError,S.all=function(t){return Promise.all(t)},S.spread=vn,S.isAxiosError=Wn,S.mergeConfig=j,S.AxiosHeaders=T,S.formToJSON=e=>ze(a.isHTMLForm(e)?new FormData(e):e),S.getAdapter=it.getAdapter,S.HttpStatusCode=Re,S.default=S;const{Axios:ur,AxiosError:fr,CanceledError:dr,isCancel:pr,CancelToken:hr,VERSION:mr,all:yr,Cancel:br,isAxiosError:wr,spread:Sr,toFormData:gr,AxiosHeaders:Er,HttpStatusCode:Rr,formToJSON:Or,getAdapter:Tr,mergeConfig:Ar}=S,Qn={abortController:new AbortController};let Oe=(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:fe&&fe.tagName.toUpperCase()==="SCRIPT"&&fe.src||new URL("index.umd.cjs",document.baseURI).href}<"u",""),ft={};const Xn=e=>{e.backendURL&&(Oe=e.backendURL,z.defaults.baseURL=Oe),e?.axiosCreate&&(ft=e.axiosCreate)},z=S.create({baseURL:Oe,signal:Qn.abortController.signal,...ft??{}}),Kn=e=>{const t=pt(),n=t?.token??null,r=t?.expiresIn??null;if(r){const s=t?.timestamp??null,i=Date.now();if(r&&i-s>r*1e3)return console.warn("Token has expired."),localStorage.removeItem("logginToken"),null}if(e.headers={...e.headers},n&&(e.headers.Authorization=`Bearer ${n}`),e.data instanceof FormData){const s=e.data;e.data=s}else e.data&&(e.data={...e.data??{}});return e};z.interceptors.response.use(e=>e,e=>(console.log("Error.....",e),e.response?.status,Promise.reject(e))),z.interceptors.request.use(Kn,e=>Promise.reject(e));const Gn=async({url:e,method:t,data:n})=>{let r=n??{};try{let s=null;if(t.toLowerCase()==="get"){const o=dt(r??{});s=await z.get(`${e}${o}`)}else s=await z.post(e,r);return s?.data??{Empty:"Empty"}}catch(s){return console.error(s),{success:!1,error:s}}},dt=(e={})=>{try{let t="?";for(let n in e)if(Object.hasOwnProperty.call(e,n)&&e[n])if(Array.isArray(e[n])){const r=e[n];for(const s of r)t+=`${n}[]=${s}&`}else t+=`${n}=${e[n]}&`;return t.slice(0,-1)}catch(t){console.error(t)}};function Zn(e={token:null}){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("setBearerToken expects an object {token} with a 'token' property.");const t={token:null,...e,timestamp:Date.now()};localStorage.setItem("logginToken",JSON.stringify(t))}function pt(){const e=localStorage.getItem("logginToken");try{return e?JSON.parse(e):null}catch(t){return console.error("Invalid token format in localStorage:",t),null}}const ht=e=>{let t;const n=new Set,r=(l,u)=>{const p=typeof l=="function"?l(t):l;if(!Object.is(p,t)){const b=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(w=>w(t,b))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>f,subscribe:l=>(n.add(l),()=>n.delete(l))},f=t=e(r,s,c);return c},Yn=(e=>e?ht(e):ht),er=e=>e;function tr(e,t=er){const n=L.useSyncExternalStore(e.subscribe,L.useCallback(()=>t(e.getState()),[e,t]),L.useCallback(()=>t(e.getInitialState()),[e,t]));return L.useDebugValue(n),n}const mt=e=>{const t=Yn(e),n=r=>tr(t,r);return Object.assign(n,t),n},yt=(e=>e?mt(e):mt)((e,t)=>({loading:!1,stateValue:{},checkQueriesInQue:{},isThereAnyDataChangeInAform:!1,setStateValue:(n,r)=>e(s=>({stateValue:{...s.stateValue,[n]:r}})),getStateItem:n=>t().stateValue[n],sleep:n=>new Promise(r=>setTimeout(r,n)),validateLength:n=>Array.isArray(n)?n.length:typeof n=="object"?Object.keys(n).length:0,callApiData:async(n,r,s,i=!1,o=!1)=>{const{checkQueriesInQue:c}=t();if(t().getStateItem("checkQueriesInQue")?.[r]){console.warn(`************************************* dont call this api again ${s.url} 🛩️ *************************************`,s);return}t().setStateValue("loading",!0),t().setStateValue("checkQueriesInQue",{...c,[r]:r});const f=await z(s);return f?.status==200?(e({[n]:f?.data}),t().setStateValue(n,f?.data),o&&sessionStorage.setItem(n,JSON.stringify(f?.data))):console.error(f),t().cleareQueApi(r),e({loading:!1}),f},cleareQueApi:n=>{const s={...t().stateValue.checkQueriesInQue||{}};delete s[n],t().setStateValue("checkQueriesInQue",s)},complatedTheCall:async(n,r,s,i,o,c,f)=>{const l=await n.callApiData(r,s,i,o,c);return l?.status==200?(f&&f(l?.data),l?.data):(f&&f([]),l?.data)},stateGeneratorApi:async({reload:n,stateKey:r,req:s,time:i=0,paginated:o=!1,mStore:c={}},f)=>{e({[r]:[]});const l=JSON.stringify(s);try{const u=c?.mUse,p=t();if(e({loading:!0}),u){const w=JSON.parse(sessionStorage.getItem(r)||"{}");if(p.validateLength(w)&&(f&&f(w),e({[r]:w}),t().setStateValue(r,w),console.log(w),!n))return w}const b=p?.[r]??t().getStateItem(r);return p.validateLength(b)&&f&&f(b),n&&i>0&&setTimeout(()=>{t().complatedTheCall(p,r,l,s,o,u,f)},i*1e3),await t().complatedTheCall(p,r,l,s,o,u,f)}catch(u){t().cleareQueApi(l),f&&f([]),console.error(u)}}}));function nr(){return yt()}C.Store=yt,C.default=nr,C.generateParams=dt,C.getBearerToken=pt,C.setBaseURL=Xn,C.setBearerToken=Zn,C.useFetch=Gn,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "septor-store-react",
3
3
  "description": "PomStore is a lightweight, flexible global state & API store for React. It simplifies data fetching, caching, and shared state management—without Redux or heavy boilerplate. Built for real-world React apps that need fast data access, request de-duplication, and cache-first loading. PomStore is built on top of Zustand, a lightweight state management library for React.",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
- "files": [
9
+ "files": [
10
10
  "dist"
11
11
  ],
12
12
  "scripts": {
@@ -31,8 +31,8 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "vite": "^7.3.1",
34
- "@vitejs/plugin-react": "^5.1.2",
35
- "typescript": "^5.9.3"
34
+ "@vitejs/plugin-react": "^5.1.2",
35
+ "typescript": "^5.9.3"
36
36
  },
37
37
  "keywords": [
38
38
  "zustand",