@vritti/quantum-ui 0.2.5 → 0.2.6
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/dist/Button2.js +2 -1
- package/dist/Button2.js.map +1 -1
- package/dist/Checkbox.js +3 -5
- package/dist/Checkbox.js.map +1 -1
- package/dist/DatePicker.js +416 -139
- package/dist/DatePicker.js.map +1 -1
- package/dist/Form.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/Label.js.map +1 -1
- package/dist/OTPField.js +1 -1
- package/dist/OTPField.js.map +1 -1
- package/dist/PasswordField.js +3 -3
- package/dist/PasswordField.js.map +1 -1
- package/dist/PhoneField.js +23 -7
- package/dist/PhoneField.js.map +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Spinner.js.map +1 -1
- package/dist/ThemeToggle.js +2 -2
- package/dist/ThemeToggle.js.map +1 -1
- package/dist/axios.js +125 -56
- package/dist/axios.js.map +1 -1
- package/dist/components/Progress.js +61 -2
- package/dist/components/Progress.js.map +1 -1
- package/dist/createLucideIcon.js +4 -4
- package/dist/createLucideIcon.js.map +1 -1
- package/dist/field.js +2 -36
- package/dist/field.js.map +1 -1
- package/dist/index2.js +130 -54
- package/dist/index2.js.map +1 -1
- package/dist/index3.js +1 -103
- package/dist/index3.js.map +1 -1
- package/dist/index4.js +36 -35
- package/dist/index4.js.map +1 -1
- package/dist/index5.js +303 -3
- package/dist/index5.js.map +1 -1
- package/dist/utils.js +229 -150
- package/dist/utils.js.map +1 -1
- package/package.json +28 -28
- package/dist/index6.js +0 -246
- package/dist/index6.js.map +0 -1
package/dist/Spinner.js
CHANGED
|
@@ -3,7 +3,7 @@ import { c as cn } from './utils.js';
|
|
|
3
3
|
import { c as createLucideIcon } from './createLucideIcon.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @license lucide-react v0.
|
|
6
|
+
* @license lucide-react v0.562.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
package/dist/Spinner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.js","sources":["../node_modules/.pnpm/lucide-react@0.
|
|
1
|
+
{"version":3,"file":"Spinner.js","sources":["../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/loader-circle.js","../shadcn/shadcnSpinner/Spinner.tsx","../lib/components/Spinner/Spinner.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]];\nconst LoaderCircle = createLucideIcon(\"loader-circle\", __iconNode);\n\nexport { __iconNode, LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","import { Loader2Icon } from 'lucide-react';\n\nimport { cn } from '../utils';\n\nfunction Spinner({ className, ...props }: React.ComponentProps<'svg'>) {\n return (\n <Loader2Icon\n role=\"status\"\n aria-label=\"Loading\"\n className={cn('size-4 animate-spin', className)}\n {...props}\n />\n );\n}\n\nexport { Spinner };\n","// Spinner molecule - wrapper around shadcn Spinner\nimport { Spinner as ShadcnSpinner } from '../../../shadcn/shadcnSpinner';\n\nexport const Spinner = ShadcnSpinner;\n"],"names":["Spinner","Loader2Icon","ShadcnSpinner"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,6BAA6B,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClF,MAAM,YAAY,GAAG,gBAAgB,CAAC,eAAe,EAAE,UAAU,CAAC;;ACNlE,SAASA,SAAA,CAAQ,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACrE,EAAA,uBACE,GAAA;AAAA,IAACC,YAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,YAAA,EAAW,SAAA;AAAA,MACX,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA;AAAA,MAC7C,GAAG;AAAA;AAAA,GACN;AAEJ;;ACVO,MAAM,OAAA,GAAUC;;;;","x_google_ignoreList":[0]}
|
package/dist/ThemeToggle.js
CHANGED
|
@@ -4,7 +4,7 @@ import { B as Button } from './Button.js';
|
|
|
4
4
|
import { c as createLucideIcon } from './createLucideIcon.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @license lucide-react v0.
|
|
7
|
+
* @license lucide-react v0.562.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -23,7 +23,7 @@ const __iconNode$1 = [
|
|
|
23
23
|
const Moon = createLucideIcon("moon", __iconNode$1);
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* @license lucide-react v0.
|
|
26
|
+
* @license lucide-react v0.562.0 - ISC
|
|
27
27
|
*
|
|
28
28
|
* This source code is licensed under the ISC license.
|
|
29
29
|
* See the LICENSE file in the root directory of this source tree.
|
package/dist/ThemeToggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeToggle.js","sources":["../node_modules/.pnpm/lucide-react@0.
|
|
1
|
+
{"version":3,"file":"ThemeToggle.js","sources":["../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/moon.js","../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/sun.js","../lib/components/ThemeToggle/ThemeToggle.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",\n key: \"kfwtm\"\n }\n ]\n];\nconst Moon = createLucideIcon(\"moon\", __iconNode);\n\nexport { __iconNode, Moon as default };\n//# sourceMappingURL=moon.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }],\n [\"path\", { d: \"M12 2v2\", key: \"tus03m\" }],\n [\"path\", { d: \"M12 20v2\", key: \"1lh1kg\" }],\n [\"path\", { d: \"m4.93 4.93 1.41 1.41\", key: \"149t6j\" }],\n [\"path\", { d: \"m17.66 17.66 1.41 1.41\", key: \"ptbguv\" }],\n [\"path\", { d: \"M2 12h2\", key: \"1t8f8n\" }],\n [\"path\", { d: \"M20 12h2\", key: \"1q8mjw\" }],\n [\"path\", { d: \"m6.34 17.66-1.41 1.41\", key: \"1m8zz5\" }],\n [\"path\", { d: \"m19.07 4.93-1.41 1.41\", key: \"1shlcs\" }]\n];\nconst Sun = createLucideIcon(\"sun\", __iconNode);\n\nexport { __iconNode, Sun as default };\n//# sourceMappingURL=sun.js.map\n","import { Moon, Sun } from 'lucide-react';\nimport type React from 'react';\nimport { useLayoutEffect, useState } from 'react';\nimport { Button } from '../Button/Button';\n\nexport interface ThemeToggleProps {\n /**\n * Custom className for the toggle button\n */\n className?: string;\n\n /**\n * Size of the toggle button\n */\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport const ThemeToggle: React.FC<ThemeToggleProps> = ({ className, size = 'md' }) => {\n const [isDarkMode, setIsDarkMode] = useState(false);\n\n useLayoutEffect(() => {\n // Check for saved theme preference or system preference\n const savedTheme = localStorage.getItem('theme');\n const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;\n const shouldUseDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);\n\n setIsDarkMode(shouldUseDark);\n document.documentElement.classList.toggle('dark', shouldUseDark);\n }, []);\n\n const toggleTheme = () => {\n const newDarkMode = !isDarkMode;\n setIsDarkMode(newDarkMode);\n\n // Update DOM and localStorage\n document.documentElement.classList.toggle('dark', newDarkMode);\n localStorage.setItem('theme', newDarkMode ? 'dark' : 'light');\n };\n\n return (\n <Button\n variant=\"ghost\"\n size={size === 'md' ? 'default' : size}\n onClick={toggleTheme}\n className={`text-foreground ${className}`}\n aria-label={`Switch to ${isDarkMode ? 'light' : 'dark'} theme`}\n >\n <Sun\n className={`h-4 w-4 transition-all ${isDarkMode ? 'scale-0 -rotate-90' : 'scale-100 rotate-0'}`}\n aria-hidden\n />\n <Moon\n className={`absolute h-4 w-4 transition-all ${isDarkMode ? 'scale-100 rotate-0' : 'scale-0 rotate-90'}`}\n aria-hidden\n />\n </Button>\n );\n};\n"],"names":["__iconNode"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG;AACnB,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,gHAAgH;AACzH,MAAM,GAAG,EAAE;AACX;AACA;AACA,CAAC;AACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,EAAEA,YAAU,CAAC;;AClBjD;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3D,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3C,EAAE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
|
|
72
|
+
* Create a bound version of a function with a specified `this` context
|
|
73
|
+
*
|
|
74
|
+
* @param {Function} fn - The function to bind
|
|
75
|
+
* @param {*} thisArg - The value to be passed as the `this` parameter
|
|
76
|
+
* @returns {Function} A new function that will call the original function with the specified `this` context
|
|
77
|
+
*/
|
|
71
78
|
function bind(fn, thisArg) {
|
|
72
79
|
return function wrap() {
|
|
73
80
|
return fn.apply(thisArg, arguments);
|
|
@@ -1320,7 +1327,7 @@ class InterceptorManager {
|
|
|
1320
1327
|
*
|
|
1321
1328
|
* @param {Number} id The ID that was returned by `use`
|
|
1322
1329
|
*
|
|
1323
|
-
* @returns {
|
|
1330
|
+
* @returns {void}
|
|
1324
1331
|
*/
|
|
1325
1332
|
eject(id) {
|
|
1326
1333
|
if (this.handlers[id]) {
|
|
@@ -2280,27 +2287,38 @@ const cookies = platform.hasStandardBrowserEnv ?
|
|
|
2280
2287
|
|
|
2281
2288
|
// Standard browser envs support document.cookie
|
|
2282
2289
|
{
|
|
2283
|
-
write(name, value, expires, path, domain, secure) {
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
|
2287
|
-
|
|
2288
|
-
utils$1.isString(path) && cookie.push('path=' + path);
|
|
2290
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
2291
|
+
if (typeof document === 'undefined') return;
|
|
2289
2292
|
|
|
2290
|
-
|
|
2293
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
2291
2294
|
|
|
2292
|
-
|
|
2295
|
+
if (utils$1.isNumber(expires)) {
|
|
2296
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
2297
|
+
}
|
|
2298
|
+
if (utils$1.isString(path)) {
|
|
2299
|
+
cookie.push(`path=${path}`);
|
|
2300
|
+
}
|
|
2301
|
+
if (utils$1.isString(domain)) {
|
|
2302
|
+
cookie.push(`domain=${domain}`);
|
|
2303
|
+
}
|
|
2304
|
+
if (secure === true) {
|
|
2305
|
+
cookie.push('secure');
|
|
2306
|
+
}
|
|
2307
|
+
if (utils$1.isString(sameSite)) {
|
|
2308
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
2309
|
+
}
|
|
2293
2310
|
|
|
2294
2311
|
document.cookie = cookie.join('; ');
|
|
2295
2312
|
},
|
|
2296
2313
|
|
|
2297
2314
|
read(name) {
|
|
2298
|
-
|
|
2299
|
-
|
|
2315
|
+
if (typeof document === 'undefined') return null;
|
|
2316
|
+
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
2317
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
2300
2318
|
},
|
|
2301
2319
|
|
|
2302
2320
|
remove(name) {
|
|
2303
|
-
this.write(name, '', Date.now() - 86400000);
|
|
2321
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
2304
2322
|
}
|
|
2305
2323
|
}
|
|
2306
2324
|
|
|
@@ -2389,11 +2407,11 @@ function mergeConfig$1(config1, config2) {
|
|
|
2389
2407
|
}
|
|
2390
2408
|
|
|
2391
2409
|
// eslint-disable-next-line consistent-return
|
|
2392
|
-
function mergeDeepProperties(a, b, prop
|
|
2410
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
2393
2411
|
if (!utils$1.isUndefined(b)) {
|
|
2394
|
-
return getMergedValue(a, b, prop
|
|
2412
|
+
return getMergedValue(a, b, prop, caseless);
|
|
2395
2413
|
} else if (!utils$1.isUndefined(a)) {
|
|
2396
|
-
return getMergedValue(undefined, a, prop
|
|
2414
|
+
return getMergedValue(undefined, a, prop, caseless);
|
|
2397
2415
|
}
|
|
2398
2416
|
}
|
|
2399
2417
|
|
|
@@ -2451,7 +2469,7 @@ function mergeConfig$1(config1, config2) {
|
|
|
2451
2469
|
socketPath: defaultToConfig2,
|
|
2452
2470
|
responseEncoding: defaultToConfig2,
|
|
2453
2471
|
validateStatus: mergeDirectKeys,
|
|
2454
|
-
headers: (a, b
|
|
2472
|
+
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
2455
2473
|
};
|
|
2456
2474
|
|
|
2457
2475
|
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
@@ -3089,7 +3107,7 @@ const factory = (env) => {
|
|
|
3089
3107
|
const seedCache = new Map();
|
|
3090
3108
|
|
|
3091
3109
|
const getFetch = (config) => {
|
|
3092
|
-
let env = config
|
|
3110
|
+
let env = (config && config.env) || {};
|
|
3093
3111
|
const {fetch, Request, Response} = env;
|
|
3094
3112
|
const seeds = [
|
|
3095
3113
|
Request, Response, fetch
|
|
@@ -3112,6 +3130,15 @@ const getFetch = (config) => {
|
|
|
3112
3130
|
|
|
3113
3131
|
getFetch();
|
|
3114
3132
|
|
|
3133
|
+
/**
|
|
3134
|
+
* Known adapters mapping.
|
|
3135
|
+
* Provides environment-specific adapters for Axios:
|
|
3136
|
+
* - `http` for Node.js
|
|
3137
|
+
* - `xhr` for browsers
|
|
3138
|
+
* - `fetch` for fetch API-based requests
|
|
3139
|
+
*
|
|
3140
|
+
* @type {Object<string, Function|Object>}
|
|
3141
|
+
*/
|
|
3115
3142
|
const knownAdapters = {
|
|
3116
3143
|
http: httpAdapter,
|
|
3117
3144
|
xhr: xhrAdapter,
|
|
@@ -3120,71 +3147,107 @@ const knownAdapters = {
|
|
|
3120
3147
|
}
|
|
3121
3148
|
};
|
|
3122
3149
|
|
|
3150
|
+
// Assign adapter names for easier debugging and identification
|
|
3123
3151
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
3124
3152
|
if (fn) {
|
|
3125
3153
|
try {
|
|
3126
|
-
Object.defineProperty(fn, 'name', {value});
|
|
3154
|
+
Object.defineProperty(fn, 'name', { value });
|
|
3127
3155
|
} catch (e) {
|
|
3128
3156
|
// eslint-disable-next-line no-empty
|
|
3129
3157
|
}
|
|
3130
|
-
Object.defineProperty(fn, 'adapterName', {value});
|
|
3158
|
+
Object.defineProperty(fn, 'adapterName', { value });
|
|
3131
3159
|
}
|
|
3132
3160
|
});
|
|
3133
3161
|
|
|
3162
|
+
/**
|
|
3163
|
+
* Render a rejection reason string for unknown or unsupported adapters
|
|
3164
|
+
*
|
|
3165
|
+
* @param {string} reason
|
|
3166
|
+
* @returns {string}
|
|
3167
|
+
*/
|
|
3134
3168
|
const renderReason = (reason) => `- ${reason}`;
|
|
3135
3169
|
|
|
3170
|
+
/**
|
|
3171
|
+
* Check if the adapter is resolved (function, null, or false)
|
|
3172
|
+
*
|
|
3173
|
+
* @param {Function|null|false} adapter
|
|
3174
|
+
* @returns {boolean}
|
|
3175
|
+
*/
|
|
3136
3176
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
3137
3177
|
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3178
|
+
/**
|
|
3179
|
+
* Get the first suitable adapter from the provided list.
|
|
3180
|
+
* Tries each adapter in order until a supported one is found.
|
|
3181
|
+
* Throws an AxiosError if no adapter is suitable.
|
|
3182
|
+
*
|
|
3183
|
+
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
3184
|
+
* @param {Object} config - Axios request configuration
|
|
3185
|
+
* @throws {AxiosError} If no suitable adapter is available
|
|
3186
|
+
* @returns {Function} The resolved adapter function
|
|
3187
|
+
*/
|
|
3188
|
+
function getAdapter$1(adapters, config) {
|
|
3189
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
3141
3190
|
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3191
|
+
const { length } = adapters;
|
|
3192
|
+
let nameOrAdapter;
|
|
3193
|
+
let adapter;
|
|
3145
3194
|
|
|
3146
|
-
|
|
3195
|
+
const rejectedReasons = {};
|
|
3147
3196
|
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3197
|
+
for (let i = 0; i < length; i++) {
|
|
3198
|
+
nameOrAdapter = adapters[i];
|
|
3199
|
+
let id;
|
|
3151
3200
|
|
|
3152
|
-
|
|
3201
|
+
adapter = nameOrAdapter;
|
|
3153
3202
|
|
|
3154
|
-
|
|
3155
|
-
|
|
3203
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
3204
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
3156
3205
|
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
}
|
|
3160
|
-
}
|
|
3161
|
-
|
|
3162
|
-
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3163
|
-
break;
|
|
3206
|
+
if (adapter === undefined) {
|
|
3207
|
+
throw new AxiosError$1(`Unknown adapter '${id}'`);
|
|
3164
3208
|
}
|
|
3209
|
+
}
|
|
3165
3210
|
|
|
3166
|
-
|
|
3211
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3212
|
+
break;
|
|
3167
3213
|
}
|
|
3168
3214
|
|
|
3169
|
-
|
|
3215
|
+
rejectedReasons[id || '#' + i] = adapter;
|
|
3216
|
+
}
|
|
3170
3217
|
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
)
|
|
3218
|
+
if (!adapter) {
|
|
3219
|
+
const reasons = Object.entries(rejectedReasons)
|
|
3220
|
+
.map(([id, state]) => `adapter ${id} ` +
|
|
3221
|
+
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
3222
|
+
);
|
|
3175
3223
|
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3224
|
+
let s = length ?
|
|
3225
|
+
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
|
|
3226
|
+
'as no adapter specified';
|
|
3179
3227
|
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3228
|
+
throw new AxiosError$1(
|
|
3229
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
3230
|
+
'ERR_NOT_SUPPORT'
|
|
3231
|
+
);
|
|
3232
|
+
}
|
|
3185
3233
|
|
|
3186
|
-
|
|
3187
|
-
|
|
3234
|
+
return adapter;
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
/**
|
|
3238
|
+
* Exports Axios adapters and utility to resolve an adapter
|
|
3239
|
+
*/
|
|
3240
|
+
const adapters = {
|
|
3241
|
+
/**
|
|
3242
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
3243
|
+
* @type {Function}
|
|
3244
|
+
*/
|
|
3245
|
+
getAdapter: getAdapter$1,
|
|
3246
|
+
|
|
3247
|
+
/**
|
|
3248
|
+
* Exposes all known adapters
|
|
3249
|
+
* @type {Object<string, Function|Object>}
|
|
3250
|
+
*/
|
|
3188
3251
|
adapters: knownAdapters
|
|
3189
3252
|
};
|
|
3190
3253
|
|
|
@@ -3261,7 +3324,7 @@ function dispatchRequest(config) {
|
|
|
3261
3324
|
});
|
|
3262
3325
|
}
|
|
3263
3326
|
|
|
3264
|
-
const VERSION$1 = "1.
|
|
3327
|
+
const VERSION$1 = "1.13.2";
|
|
3265
3328
|
|
|
3266
3329
|
const validators$1 = {};
|
|
3267
3330
|
|
|
@@ -3816,6 +3879,12 @@ const HttpStatusCode$1 = {
|
|
|
3816
3879
|
LoopDetected: 508,
|
|
3817
3880
|
NotExtended: 510,
|
|
3818
3881
|
NetworkAuthenticationRequired: 511,
|
|
3882
|
+
WebServerIsDown: 521,
|
|
3883
|
+
ConnectionTimedOut: 522,
|
|
3884
|
+
OriginIsUnreachable: 523,
|
|
3885
|
+
TimeoutOccurred: 524,
|
|
3886
|
+
SslHandshakeFailed: 525,
|
|
3887
|
+
InvalidSslCertificate: 526,
|
|
3819
3888
|
};
|
|
3820
3889
|
|
|
3821
3890
|
Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
|