fds-vue-core 2.1.21 → 2.1.22
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/fds-vue-core.cjs.js +2947 -375
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.css +1 -1
- package/dist/fds-vue-core.es.js +2948 -376
- package/dist/fds-vue-core.es.js.map +1 -1
- package/package.json +3 -1
- package/src/components/Blocks/FdsBlockExpander/FdsBlockExpander.vue +16 -7
- package/src/components/Blocks/FdsBlockExpander/types.ts +3 -0
- package/src/components/Buttons/FdsButtonDownload/FdsButtonDownload.vue +11 -54
- package/src/components/FdsSearchSelect/types.ts +5 -4
- package/src/components/FdsSticker/FdsSticker.vue +1 -1
- package/src/components/Form/FdsCheckbox/FdsCheckbox.vue +7 -5
- package/src/components/Form/FdsCheckbox/types.ts +6 -10
- package/src/components/Form/FdsInput/FdsInput.vue +16 -7
- package/src/components/Form/FdsInput/types.ts +8 -18
- package/src/components/Form/FdsRadio/FdsRadio.vue +0 -1
- package/src/components/Form/FdsRadio/types.ts +5 -10
- package/src/components/Form/FdsSelect/types.ts +6 -9
- package/src/components/Form/FdsTextarea/types.ts +5 -9
- package/src/composables/useDownload.ts +77 -0
- package/src/index.ts +2 -1
- package/src/.DS_Store +0 -0
package/dist/fds-vue-core.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useSlots, computed, Comment, defineComponent, createElementBlock, openBlock, normalizeStyle, useAttrs, mergeProps, createBlock, ref, watch, createCommentVNode, normalizeClass, createElementVNode, unref, createVNode, toDisplayString, renderSlot, withDirectives,
|
|
1
|
+
import { useSlots, computed, Comment, defineComponent, createElementBlock, openBlock, normalizeStyle, useAttrs, mergeProps, createBlock, ref, watch, createCommentVNode, normalizeClass, createElementVNode, unref, createVNode, toDisplayString, renderSlot, withDirectives, withCtx, createTextVNode, vShow, resolveDynamicComponent, onMounted, nextTick, onBeforeUnmount, Teleport, withModifiers, mergeModels, useModel, Fragment, renderList, withKeys, reactive, vModelCheckbox, vModelRadio, inject, resolveComponent, Transition, watchEffect, provide, vModelSelect, getCurrentInstance } from "vue";
|
|
2
2
|
function useHasSlot(name = "default") {
|
|
3
3
|
const slots = useSlots();
|
|
4
4
|
return computed(() => {
|
|
@@ -766,7 +766,52 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
768
|
});
|
|
769
|
-
const _hoisted_1$n =
|
|
769
|
+
const _hoisted_1$n = ["aria-live"];
|
|
770
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
771
|
+
__name: "FdsSticker",
|
|
772
|
+
props: {
|
|
773
|
+
variant: { default: "blue" },
|
|
774
|
+
bullet: { type: Boolean, default: false },
|
|
775
|
+
ariaLive: { default: void 0 }
|
|
776
|
+
},
|
|
777
|
+
setup(__props) {
|
|
778
|
+
const props = __props;
|
|
779
|
+
const stickerClasses = computed(() => [
|
|
780
|
+
"inline-block font-bold text-sm leading-[18px] tracking-normal py-0.5 px-3 rounded-xl border border-transparent whitespace-nowrap max-w-full",
|
|
781
|
+
props.bullet ? "text-base! bg-transparent flex-wrap justify-start items-baseline text-base font-normal text-gray-700 border-transparent p-0! mr-3" : "",
|
|
782
|
+
// Variant colors
|
|
783
|
+
props.variant === "blue" && !props.bullet && "bg-blue-600 text-white",
|
|
784
|
+
props.variant === "green" && !props.bullet && "bg-green-700 text-white",
|
|
785
|
+
props.variant === "red" && !props.bullet && "bg-red-600 text-white",
|
|
786
|
+
props.variant === "yellow" && !props.bullet && "bg-yellow-200 text-gray-700 border-yellow-300",
|
|
787
|
+
props.variant === "gray" && !props.bullet && "bg-gray-200 text-gray-700 border-gray-300!",
|
|
788
|
+
props.variant === "t_blue" && !props.bullet && "bg-blue_t-100 text-gray-700 border-blue_t-200!"
|
|
789
|
+
]);
|
|
790
|
+
const bulletDotClasses = computed(() => [
|
|
791
|
+
"inline-block w-3 h-3 rounded-full mr-1.5",
|
|
792
|
+
// Bullet dot colors
|
|
793
|
+
props.variant === "blue" && "bg-blue-600",
|
|
794
|
+
props.variant === "green" && "bg-green-700",
|
|
795
|
+
props.variant === "red" && "bg-red-600",
|
|
796
|
+
props.variant === "yellow" && "bg-yellow-200 border border-yellow-300",
|
|
797
|
+
props.variant === "gray" && "bg-gray-400",
|
|
798
|
+
props.variant === "t_blue" && "bg-blue-200 border border-blue-300"
|
|
799
|
+
]);
|
|
800
|
+
return (_ctx, _cache) => {
|
|
801
|
+
return openBlock(), createElementBlock("span", {
|
|
802
|
+
class: normalizeClass(stickerClasses.value),
|
|
803
|
+
"aria-live": __props.ariaLive
|
|
804
|
+
}, [
|
|
805
|
+
__props.bullet ? (openBlock(), createElementBlock("span", {
|
|
806
|
+
key: 0,
|
|
807
|
+
class: normalizeClass(bulletDotClasses.value)
|
|
808
|
+
}, null, 2)) : createCommentVNode("", true),
|
|
809
|
+
renderSlot(_ctx.$slots, "default")
|
|
810
|
+
], 10, _hoisted_1$n);
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
const _hoisted_1$m = { class: "w-full flex justify-between items-start" };
|
|
770
815
|
const _hoisted_2$h = { class: "inline-flex items-center" };
|
|
771
816
|
const _hoisted_3$9 = {
|
|
772
817
|
key: 0,
|
|
@@ -778,7 +823,7 @@ const _hoisted_5$7 = {
|
|
|
778
823
|
class: "w-full flex mt-2"
|
|
779
824
|
};
|
|
780
825
|
const _hoisted_6$4 = ["aria-hidden"];
|
|
781
|
-
const _sfc_main$
|
|
826
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
782
827
|
...{
|
|
783
828
|
inheritAttrs: false
|
|
784
829
|
},
|
|
@@ -788,7 +833,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
788
833
|
label: { default: "" },
|
|
789
834
|
open: { type: Boolean, default: false },
|
|
790
835
|
preIcon: { default: void 0 },
|
|
791
|
-
id: { default: void 0 }
|
|
836
|
+
id: { default: void 0 },
|
|
837
|
+
stickerColor: { default: void 0 },
|
|
838
|
+
stickerText: { default: void 0 }
|
|
792
839
|
},
|
|
793
840
|
emits: ["toggle"],
|
|
794
841
|
setup(__props, { emit: __emit }) {
|
|
@@ -816,8 +863,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
816
863
|
const headerClasses = computed(() => [
|
|
817
864
|
"flex w-full flex-col text-left bg-white text-blue-600 rounded-2xl p-[calc(1rem-2px)] border-2 border-white transition-colors border-2 border-white hover:border-blue-500 active:bg-blue_t-100 active:border-white focus-visible:border-blue-500 focus-visible:border-dashed focus-visible:outline-0",
|
|
818
865
|
props.disabled ? "cursor-not-allowed hover:border-2 hover:border-transparent active:bg-white" : "cursor-pointer",
|
|
819
|
-
isOpen.value ? "rounded-b-none" : "rounded-b-2xl"
|
|
820
|
-
hasExtraRowSlot.value ? "" : ""
|
|
866
|
+
isOpen.value ? "rounded-b-none" : "rounded-b-2xl"
|
|
821
867
|
]);
|
|
822
868
|
const buttonRowClasses = computed(() => ["flex justify-between items-start w-full", hasExtraRowSlot.value ? "" : ""]);
|
|
823
869
|
function handleToggle() {
|
|
@@ -837,7 +883,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
837
883
|
createElementVNode("span", {
|
|
838
884
|
class: normalizeClass(buttonRowClasses.value)
|
|
839
885
|
}, [
|
|
840
|
-
createElementVNode("span", _hoisted_1$
|
|
886
|
+
createElementVNode("span", _hoisted_1$m, [
|
|
841
887
|
createElementVNode("span", _hoisted_2$h, [
|
|
842
888
|
__props.preIcon ? (openBlock(), createElementBlock("span", _hoisted_3$9, [
|
|
843
889
|
createVNode(_sfc_main$w, {
|
|
@@ -852,11 +898,22 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
852
898
|
}, toDisplayString(__props.label), 3)
|
|
853
899
|
])
|
|
854
900
|
]),
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
901
|
+
createElementVNode("span", null, [
|
|
902
|
+
__props.stickerText && __props.stickerColor ? (openBlock(), createBlock(_sfc_main$s, {
|
|
903
|
+
key: 0,
|
|
904
|
+
variant: __props.stickerColor
|
|
905
|
+
}, {
|
|
906
|
+
default: withCtx(() => [
|
|
907
|
+
createTextVNode(toDisplayString(__props.stickerText), 1)
|
|
908
|
+
]),
|
|
909
|
+
_: 1
|
|
910
|
+
}, 8, ["variant"])) : createCommentVNode("", true),
|
|
911
|
+
createVNode(_sfc_main$w, {
|
|
912
|
+
name: "arrowDown",
|
|
913
|
+
size: 24,
|
|
914
|
+
class: normalizeClass(["ml-4 transition-transform duration-200 fill-blue-500 min-w-6 min-h-6", { "rotate-180": isOpen.value, "fill-gray-500": __props.disabled }])
|
|
915
|
+
}, null, 8, ["class"])
|
|
916
|
+
])
|
|
860
917
|
])
|
|
861
918
|
], 2),
|
|
862
919
|
unref(hasExtraRowSlot) && !isOpen.value ? (openBlock(), createElementBlock("span", _hoisted_5$7, [
|
|
@@ -875,7 +932,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
875
932
|
};
|
|
876
933
|
}
|
|
877
934
|
});
|
|
878
|
-
const _hoisted_1$
|
|
935
|
+
const _hoisted_1$l = ["id"];
|
|
879
936
|
const _hoisted_2$g = {
|
|
880
937
|
key: 0,
|
|
881
938
|
class: "flex items-start gap-4"
|
|
@@ -900,7 +957,7 @@ const _hoisted_13$1 = { class: "flex items-start gap-3" };
|
|
|
900
957
|
const _hoisted_14 = { class: "mb-0-last-child" };
|
|
901
958
|
const smallIconSize = 24;
|
|
902
959
|
const largeIconSize = 48;
|
|
903
|
-
const _sfc_main$
|
|
960
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
904
961
|
__name: "FdsBlockInfo",
|
|
905
962
|
props: {
|
|
906
963
|
heading: { default: void 0 },
|
|
@@ -968,16 +1025,16 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
968
1025
|
renderSlot(_ctx.$slots, "default")
|
|
969
1026
|
])
|
|
970
1027
|
]))
|
|
971
|
-
], 10, _hoisted_1$
|
|
1028
|
+
], 10, _hoisted_1$l);
|
|
972
1029
|
};
|
|
973
1030
|
}
|
|
974
1031
|
});
|
|
975
|
-
const _hoisted_1$
|
|
1032
|
+
const _hoisted_1$k = { class: "mb-0-last-child" };
|
|
976
1033
|
const _hoisted_2$f = {
|
|
977
1034
|
key: 0,
|
|
978
1035
|
class: "flex items-end"
|
|
979
1036
|
};
|
|
980
|
-
const _sfc_main$
|
|
1037
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
981
1038
|
...{
|
|
982
1039
|
inheritAttrs: false
|
|
983
1040
|
},
|
|
@@ -1085,7 +1142,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1085
1142
|
createElementVNode("div", {
|
|
1086
1143
|
class: normalizeClass(slotWrapperClasses.value)
|
|
1087
1144
|
}, [
|
|
1088
|
-
createElementVNode("div", _hoisted_1$
|
|
1145
|
+
createElementVNode("div", _hoisted_1$k, [
|
|
1089
1146
|
renderSlot(_ctx.$slots, "default")
|
|
1090
1147
|
]),
|
|
1091
1148
|
unref(hasStickerSlot) ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
|
|
@@ -1106,8 +1163,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1106
1163
|
};
|
|
1107
1164
|
}
|
|
1108
1165
|
});
|
|
1109
|
-
const _hoisted_1$
|
|
1110
|
-
const _sfc_main$
|
|
1166
|
+
const _hoisted_1$j = ["aria-label"];
|
|
1167
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
1111
1168
|
__name: "FdsSpinner",
|
|
1112
1169
|
props: {
|
|
1113
1170
|
size: { default: "48px" },
|
|
@@ -1179,14 +1236,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1179
1236
|
key: 0,
|
|
1180
1237
|
class: normalizeClass(__props.labelPosition === "bottom" ? "font-bold" : "")
|
|
1181
1238
|
}, toDisplayString(__props.label), 3)) : createCommentVNode("", true)
|
|
1182
|
-
], 10, _hoisted_1$
|
|
1239
|
+
], 10, _hoisted_1$j);
|
|
1183
1240
|
};
|
|
1184
1241
|
}
|
|
1185
1242
|
});
|
|
1186
|
-
const _hoisted_1$
|
|
1243
|
+
const _hoisted_1$i = ["aria-disabled"];
|
|
1187
1244
|
const _hoisted_2$e = { class: "pt-0.5" };
|
|
1188
1245
|
const elBase$2 = "box-border appearance-none inline-flex items-start justify-center w-fit cursor-pointer shadow-none p-0.5 text-base select-none m-0 rounded-md text-left align-start no-underline transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
1189
|
-
const _sfc_main$
|
|
1246
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
1190
1247
|
...{
|
|
1191
1248
|
inheritAttrs: false
|
|
1192
1249
|
},
|
|
@@ -1243,136 +1300,2759 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1243
1300
|
}
|
|
1244
1301
|
emit("click", ev);
|
|
1245
1302
|
};
|
|
1246
|
-
const linkAttrs = computed(() => {
|
|
1247
|
-
if (props.as === "a") return { href: props.href };
|
|
1248
|
-
if (props.as === "router-link") return { to: props.href };
|
|
1249
|
-
return {};
|
|
1303
|
+
const linkAttrs = computed(() => {
|
|
1304
|
+
if (props.as === "a") return { href: props.href };
|
|
1305
|
+
if (props.as === "router-link") return { to: props.href };
|
|
1306
|
+
return {};
|
|
1307
|
+
});
|
|
1308
|
+
const componentAttrs = computed(() => ({
|
|
1309
|
+
...linkAttrs.value,
|
|
1310
|
+
...attrs
|
|
1311
|
+
}));
|
|
1312
|
+
return (_ctx, _cache) => {
|
|
1313
|
+
return openBlock(), createElementBlock("div", {
|
|
1314
|
+
class: normalizeClass(rootClasses.value),
|
|
1315
|
+
"aria-disabled": __props.disabled ? "true" : void 0
|
|
1316
|
+
}, [
|
|
1317
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps(componentAttrs.value, {
|
|
1318
|
+
type: __props.as === "button" ? __props.type : void 0,
|
|
1319
|
+
disabled: __props.as === "button" ? __props.disabled : void 0,
|
|
1320
|
+
target: __props.as === "a" ? __props.target : void 0,
|
|
1321
|
+
rel: __props.as === "a" ? __props.rel : void 0,
|
|
1322
|
+
class: buttonClasses.value,
|
|
1323
|
+
onClick
|
|
1324
|
+
}), {
|
|
1325
|
+
default: withCtx(() => [
|
|
1326
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1327
|
+
key: 0,
|
|
1328
|
+
class: "mr-2",
|
|
1329
|
+
size: "24px",
|
|
1330
|
+
color: "inherit"
|
|
1331
|
+
})) : __props.icon ? (openBlock(), createElementBlock("span", {
|
|
1332
|
+
key: 1,
|
|
1333
|
+
class: normalizeClass(iconOrderClasses.value),
|
|
1334
|
+
"aria-hidden": "true"
|
|
1335
|
+
}, [
|
|
1336
|
+
createVNode(_sfc_main$w, {
|
|
1337
|
+
class: normalizeClass(iconFillClass2.value),
|
|
1338
|
+
name: __props.icon,
|
|
1339
|
+
size: 24
|
|
1340
|
+
}, null, 8, ["class", "name"])
|
|
1341
|
+
], 2)) : createCommentVNode("", true),
|
|
1342
|
+
createElementVNode("span", _hoisted_2$e, toDisplayString(__props.text), 1)
|
|
1343
|
+
]),
|
|
1344
|
+
_: 1
|
|
1345
|
+
}, 16, ["type", "disabled", "target", "rel", "class"]))
|
|
1346
|
+
], 10, _hoisted_1$i);
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
1349
|
+
});
|
|
1350
|
+
const _hoisted_1$h = {
|
|
1351
|
+
key: 0,
|
|
1352
|
+
class: "flex items-center gap-2 h-7"
|
|
1353
|
+
};
|
|
1354
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
1355
|
+
__name: "FdsButtonCopy",
|
|
1356
|
+
props: {
|
|
1357
|
+
value: { default: "" },
|
|
1358
|
+
targetId: {},
|
|
1359
|
+
label: { default: "Kopiera" },
|
|
1360
|
+
copiedLabel: { default: "Kopierat!" },
|
|
1361
|
+
timeoutMs: { default: 800 },
|
|
1362
|
+
disabled: { type: Boolean, default: false },
|
|
1363
|
+
onClick: {}
|
|
1364
|
+
},
|
|
1365
|
+
emits: ["click"],
|
|
1366
|
+
setup(__props) {
|
|
1367
|
+
const props = __props;
|
|
1368
|
+
const isCopied = ref(false);
|
|
1369
|
+
let resetTimer = null;
|
|
1370
|
+
async function copyToClipboard(text) {
|
|
1371
|
+
try {
|
|
1372
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
1373
|
+
await navigator.clipboard.writeText(text);
|
|
1374
|
+
return true;
|
|
1375
|
+
}
|
|
1376
|
+
} catch {
|
|
1377
|
+
}
|
|
1378
|
+
const textarea = document.createElement("textarea");
|
|
1379
|
+
textarea.value = text;
|
|
1380
|
+
textarea.style.position = "fixed";
|
|
1381
|
+
textarea.style.opacity = "0";
|
|
1382
|
+
document.body.appendChild(textarea);
|
|
1383
|
+
textarea.focus();
|
|
1384
|
+
textarea.select();
|
|
1385
|
+
let ok = false;
|
|
1386
|
+
try {
|
|
1387
|
+
ok = document.execCommand("copy");
|
|
1388
|
+
} catch {
|
|
1389
|
+
ok = false;
|
|
1390
|
+
}
|
|
1391
|
+
document.body.removeChild(textarea);
|
|
1392
|
+
return ok;
|
|
1393
|
+
}
|
|
1394
|
+
async function onClick() {
|
|
1395
|
+
if (props.disabled) return;
|
|
1396
|
+
let textToCopy = props.value;
|
|
1397
|
+
if (props.targetId) {
|
|
1398
|
+
const el = document.getElementById(props.targetId);
|
|
1399
|
+
if (el) {
|
|
1400
|
+
textToCopy = el.innerText || el.textContent || "";
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
if (!textToCopy) return;
|
|
1404
|
+
const ok = await copyToClipboard(textToCopy);
|
|
1405
|
+
if (!ok) return;
|
|
1406
|
+
isCopied.value = true;
|
|
1407
|
+
if (resetTimer) clearTimeout(resetTimer);
|
|
1408
|
+
resetTimer = setTimeout(() => isCopied.value = false, props.timeoutMs);
|
|
1409
|
+
}
|
|
1410
|
+
onMounted(() => {
|
|
1411
|
+
if (resetTimer) {
|
|
1412
|
+
clearTimeout(resetTimer);
|
|
1413
|
+
resetTimer = null;
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1416
|
+
return (_ctx, _cache) => {
|
|
1417
|
+
return isCopied.value ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
1418
|
+
createVNode(_sfc_main$w, { name: "bigSuccess" }),
|
|
1419
|
+
createElementVNode("span", null, toDisplayString(props.copiedLabel), 1)
|
|
1420
|
+
])) : (openBlock(), createBlock(_sfc_main$n, {
|
|
1421
|
+
key: 1,
|
|
1422
|
+
type: "button",
|
|
1423
|
+
disabled: props.disabled,
|
|
1424
|
+
icon: "copy",
|
|
1425
|
+
text: isCopied.value ? props.copiedLabel : props.label,
|
|
1426
|
+
onClick
|
|
1427
|
+
}, null, 8, ["disabled", "text"]));
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
function bind(fn, thisArg) {
|
|
1432
|
+
return function wrap() {
|
|
1433
|
+
return fn.apply(thisArg, arguments);
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
const { toString } = Object.prototype;
|
|
1437
|
+
const { getPrototypeOf } = Object;
|
|
1438
|
+
const { iterator, toStringTag } = Symbol;
|
|
1439
|
+
const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
1440
|
+
const str = toString.call(thing);
|
|
1441
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
1442
|
+
})(/* @__PURE__ */ Object.create(null));
|
|
1443
|
+
const kindOfTest = (type) => {
|
|
1444
|
+
type = type.toLowerCase();
|
|
1445
|
+
return (thing) => kindOf(thing) === type;
|
|
1446
|
+
};
|
|
1447
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
1448
|
+
const { isArray } = Array;
|
|
1449
|
+
const isUndefined = typeOfTest("undefined");
|
|
1450
|
+
function isBuffer(val) {
|
|
1451
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
1452
|
+
}
|
|
1453
|
+
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
1454
|
+
function isArrayBufferView(val) {
|
|
1455
|
+
let result;
|
|
1456
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
1457
|
+
result = ArrayBuffer.isView(val);
|
|
1458
|
+
} else {
|
|
1459
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
1460
|
+
}
|
|
1461
|
+
return result;
|
|
1462
|
+
}
|
|
1463
|
+
const isString$1 = typeOfTest("string");
|
|
1464
|
+
const isFunction$1 = typeOfTest("function");
|
|
1465
|
+
const isNumber = typeOfTest("number");
|
|
1466
|
+
const isObject$1 = (thing) => thing !== null && typeof thing === "object";
|
|
1467
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
1468
|
+
const isPlainObject = (val) => {
|
|
1469
|
+
if (kindOf(val) !== "object") {
|
|
1470
|
+
return false;
|
|
1471
|
+
}
|
|
1472
|
+
const prototype2 = getPrototypeOf(val);
|
|
1473
|
+
return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
|
|
1474
|
+
};
|
|
1475
|
+
const isEmptyObject = (val) => {
|
|
1476
|
+
if (!isObject$1(val) || isBuffer(val)) {
|
|
1477
|
+
return false;
|
|
1478
|
+
}
|
|
1479
|
+
try {
|
|
1480
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
1481
|
+
} catch (e) {
|
|
1482
|
+
return false;
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
const isDate = kindOfTest("Date");
|
|
1486
|
+
const isFile = kindOfTest("File");
|
|
1487
|
+
const isBlob = kindOfTest("Blob");
|
|
1488
|
+
const isFileList = kindOfTest("FileList");
|
|
1489
|
+
const isStream = (val) => isObject$1(val) && isFunction$1(val.pipe);
|
|
1490
|
+
const isFormData = (thing) => {
|
|
1491
|
+
let kind;
|
|
1492
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
1493
|
+
kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
|
|
1494
|
+
};
|
|
1495
|
+
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
1496
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
1497
|
+
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1498
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
1499
|
+
if (obj === null || typeof obj === "undefined") {
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
let i;
|
|
1503
|
+
let l;
|
|
1504
|
+
if (typeof obj !== "object") {
|
|
1505
|
+
obj = [obj];
|
|
1506
|
+
}
|
|
1507
|
+
if (isArray(obj)) {
|
|
1508
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
1509
|
+
fn.call(null, obj[i], i, obj);
|
|
1510
|
+
}
|
|
1511
|
+
} else {
|
|
1512
|
+
if (isBuffer(obj)) {
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
1516
|
+
const len = keys.length;
|
|
1517
|
+
let key;
|
|
1518
|
+
for (i = 0; i < len; i++) {
|
|
1519
|
+
key = keys[i];
|
|
1520
|
+
fn.call(null, obj[key], key, obj);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
function findKey(obj, key) {
|
|
1525
|
+
if (isBuffer(obj)) {
|
|
1526
|
+
return null;
|
|
1527
|
+
}
|
|
1528
|
+
key = key.toLowerCase();
|
|
1529
|
+
const keys = Object.keys(obj);
|
|
1530
|
+
let i = keys.length;
|
|
1531
|
+
let _key;
|
|
1532
|
+
while (i-- > 0) {
|
|
1533
|
+
_key = keys[i];
|
|
1534
|
+
if (key === _key.toLowerCase()) {
|
|
1535
|
+
return _key;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
return null;
|
|
1539
|
+
}
|
|
1540
|
+
const _global = (() => {
|
|
1541
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
1542
|
+
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
1543
|
+
})();
|
|
1544
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
1545
|
+
function merge() {
|
|
1546
|
+
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
1547
|
+
const result = {};
|
|
1548
|
+
const assignValue = (val, key) => {
|
|
1549
|
+
const targetKey = caseless && findKey(result, key) || key;
|
|
1550
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
1551
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
1552
|
+
} else if (isPlainObject(val)) {
|
|
1553
|
+
result[targetKey] = merge({}, val);
|
|
1554
|
+
} else if (isArray(val)) {
|
|
1555
|
+
result[targetKey] = val.slice();
|
|
1556
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
1557
|
+
result[targetKey] = val;
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1560
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
1561
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
1562
|
+
}
|
|
1563
|
+
return result;
|
|
1564
|
+
}
|
|
1565
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
1566
|
+
forEach(b, (val, key) => {
|
|
1567
|
+
if (thisArg && isFunction$1(val)) {
|
|
1568
|
+
a[key] = bind(val, thisArg);
|
|
1569
|
+
} else {
|
|
1570
|
+
a[key] = val;
|
|
1571
|
+
}
|
|
1572
|
+
}, { allOwnKeys });
|
|
1573
|
+
return a;
|
|
1574
|
+
};
|
|
1575
|
+
const stripBOM = (content) => {
|
|
1576
|
+
if (content.charCodeAt(0) === 65279) {
|
|
1577
|
+
content = content.slice(1);
|
|
1578
|
+
}
|
|
1579
|
+
return content;
|
|
1580
|
+
};
|
|
1581
|
+
const inherits = (constructor, superConstructor, props, descriptors2) => {
|
|
1582
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
|
|
1583
|
+
constructor.prototype.constructor = constructor;
|
|
1584
|
+
Object.defineProperty(constructor, "super", {
|
|
1585
|
+
value: superConstructor.prototype
|
|
1586
|
+
});
|
|
1587
|
+
props && Object.assign(constructor.prototype, props);
|
|
1588
|
+
};
|
|
1589
|
+
const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
|
|
1590
|
+
let props;
|
|
1591
|
+
let i;
|
|
1592
|
+
let prop;
|
|
1593
|
+
const merged = {};
|
|
1594
|
+
destObj = destObj || {};
|
|
1595
|
+
if (sourceObj == null) return destObj;
|
|
1596
|
+
do {
|
|
1597
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
1598
|
+
i = props.length;
|
|
1599
|
+
while (i-- > 0) {
|
|
1600
|
+
prop = props[i];
|
|
1601
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
1602
|
+
destObj[prop] = sourceObj[prop];
|
|
1603
|
+
merged[prop] = true;
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
|
|
1607
|
+
} while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
1608
|
+
return destObj;
|
|
1609
|
+
};
|
|
1610
|
+
const endsWith = (str, searchString, position) => {
|
|
1611
|
+
str = String(str);
|
|
1612
|
+
if (position === void 0 || position > str.length) {
|
|
1613
|
+
position = str.length;
|
|
1614
|
+
}
|
|
1615
|
+
position -= searchString.length;
|
|
1616
|
+
const lastIndex = str.indexOf(searchString, position);
|
|
1617
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
1618
|
+
};
|
|
1619
|
+
const toArray = (thing) => {
|
|
1620
|
+
if (!thing) return null;
|
|
1621
|
+
if (isArray(thing)) return thing;
|
|
1622
|
+
let i = thing.length;
|
|
1623
|
+
if (!isNumber(i)) return null;
|
|
1624
|
+
const arr = new Array(i);
|
|
1625
|
+
while (i-- > 0) {
|
|
1626
|
+
arr[i] = thing[i];
|
|
1627
|
+
}
|
|
1628
|
+
return arr;
|
|
1629
|
+
};
|
|
1630
|
+
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
1631
|
+
return (thing) => {
|
|
1632
|
+
return TypedArray && thing instanceof TypedArray;
|
|
1633
|
+
};
|
|
1634
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
1635
|
+
const forEachEntry = (obj, fn) => {
|
|
1636
|
+
const generator = obj && obj[iterator];
|
|
1637
|
+
const _iterator = generator.call(obj);
|
|
1638
|
+
let result;
|
|
1639
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
1640
|
+
const pair = result.value;
|
|
1641
|
+
fn.call(obj, pair[0], pair[1]);
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
const matchAll = (regExp, str) => {
|
|
1645
|
+
let matches;
|
|
1646
|
+
const arr = [];
|
|
1647
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
1648
|
+
arr.push(matches);
|
|
1649
|
+
}
|
|
1650
|
+
return arr;
|
|
1651
|
+
};
|
|
1652
|
+
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
1653
|
+
const toCamelCase = (str) => {
|
|
1654
|
+
return str.toLowerCase().replace(
|
|
1655
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
1656
|
+
function replacer(m, p1, p2) {
|
|
1657
|
+
return p1.toUpperCase() + p2;
|
|
1658
|
+
}
|
|
1659
|
+
);
|
|
1660
|
+
};
|
|
1661
|
+
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
1662
|
+
const isRegExp = kindOfTest("RegExp");
|
|
1663
|
+
const reduceDescriptors = (obj, reducer) => {
|
|
1664
|
+
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
1665
|
+
const reducedDescriptors = {};
|
|
1666
|
+
forEach(descriptors2, (descriptor, name) => {
|
|
1667
|
+
let ret;
|
|
1668
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
1669
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
1670
|
+
}
|
|
1671
|
+
});
|
|
1672
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
1673
|
+
};
|
|
1674
|
+
const freezeMethods = (obj) => {
|
|
1675
|
+
reduceDescriptors(obj, (descriptor, name) => {
|
|
1676
|
+
if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
1677
|
+
return false;
|
|
1678
|
+
}
|
|
1679
|
+
const value = obj[name];
|
|
1680
|
+
if (!isFunction$1(value)) return;
|
|
1681
|
+
descriptor.enumerable = false;
|
|
1682
|
+
if ("writable" in descriptor) {
|
|
1683
|
+
descriptor.writable = false;
|
|
1684
|
+
return;
|
|
1685
|
+
}
|
|
1686
|
+
if (!descriptor.set) {
|
|
1687
|
+
descriptor.set = () => {
|
|
1688
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
};
|
|
1693
|
+
const toObjectSet = (arrayOrString, delimiter) => {
|
|
1694
|
+
const obj = {};
|
|
1695
|
+
const define = (arr) => {
|
|
1696
|
+
arr.forEach((value) => {
|
|
1697
|
+
obj[value] = true;
|
|
1698
|
+
});
|
|
1699
|
+
};
|
|
1700
|
+
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
1701
|
+
return obj;
|
|
1702
|
+
};
|
|
1703
|
+
const noop = () => {
|
|
1704
|
+
};
|
|
1705
|
+
const toFiniteNumber = (value, defaultValue) => {
|
|
1706
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
1707
|
+
};
|
|
1708
|
+
function isSpecCompliantForm(thing) {
|
|
1709
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
1710
|
+
}
|
|
1711
|
+
const toJSONObject = (obj) => {
|
|
1712
|
+
const stack = new Array(10);
|
|
1713
|
+
const visit = (source, i) => {
|
|
1714
|
+
if (isObject$1(source)) {
|
|
1715
|
+
if (stack.indexOf(source) >= 0) {
|
|
1716
|
+
return;
|
|
1717
|
+
}
|
|
1718
|
+
if (isBuffer(source)) {
|
|
1719
|
+
return source;
|
|
1720
|
+
}
|
|
1721
|
+
if (!("toJSON" in source)) {
|
|
1722
|
+
stack[i] = source;
|
|
1723
|
+
const target = isArray(source) ? [] : {};
|
|
1724
|
+
forEach(source, (value, key) => {
|
|
1725
|
+
const reducedValue = visit(value, i + 1);
|
|
1726
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
1727
|
+
});
|
|
1728
|
+
stack[i] = void 0;
|
|
1729
|
+
return target;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
return source;
|
|
1733
|
+
};
|
|
1734
|
+
return visit(obj, 0);
|
|
1735
|
+
};
|
|
1736
|
+
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
1737
|
+
const isThenable = (thing) => thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
1738
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
1739
|
+
if (setImmediateSupported) {
|
|
1740
|
+
return setImmediate;
|
|
1741
|
+
}
|
|
1742
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
1743
|
+
_global.addEventListener("message", ({ source, data }) => {
|
|
1744
|
+
if (source === _global && data === token) {
|
|
1745
|
+
callbacks.length && callbacks.shift()();
|
|
1746
|
+
}
|
|
1747
|
+
}, false);
|
|
1748
|
+
return (cb) => {
|
|
1749
|
+
callbacks.push(cb);
|
|
1750
|
+
_global.postMessage(token, "*");
|
|
1751
|
+
};
|
|
1752
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
1753
|
+
})(
|
|
1754
|
+
typeof setImmediate === "function",
|
|
1755
|
+
isFunction$1(_global.postMessage)
|
|
1756
|
+
);
|
|
1757
|
+
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
1758
|
+
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
1759
|
+
const utils$1 = {
|
|
1760
|
+
isArray,
|
|
1761
|
+
isArrayBuffer,
|
|
1762
|
+
isBuffer,
|
|
1763
|
+
isFormData,
|
|
1764
|
+
isArrayBufferView,
|
|
1765
|
+
isString: isString$1,
|
|
1766
|
+
isNumber,
|
|
1767
|
+
isBoolean,
|
|
1768
|
+
isObject: isObject$1,
|
|
1769
|
+
isPlainObject,
|
|
1770
|
+
isEmptyObject,
|
|
1771
|
+
isReadableStream,
|
|
1772
|
+
isRequest,
|
|
1773
|
+
isResponse,
|
|
1774
|
+
isHeaders,
|
|
1775
|
+
isUndefined,
|
|
1776
|
+
isDate,
|
|
1777
|
+
isFile,
|
|
1778
|
+
isBlob,
|
|
1779
|
+
isRegExp,
|
|
1780
|
+
isFunction: isFunction$1,
|
|
1781
|
+
isStream,
|
|
1782
|
+
isURLSearchParams,
|
|
1783
|
+
isTypedArray,
|
|
1784
|
+
isFileList,
|
|
1785
|
+
forEach,
|
|
1786
|
+
merge,
|
|
1787
|
+
extend,
|
|
1788
|
+
trim,
|
|
1789
|
+
stripBOM,
|
|
1790
|
+
inherits,
|
|
1791
|
+
toFlatObject,
|
|
1792
|
+
kindOf,
|
|
1793
|
+
kindOfTest,
|
|
1794
|
+
endsWith,
|
|
1795
|
+
toArray,
|
|
1796
|
+
forEachEntry,
|
|
1797
|
+
matchAll,
|
|
1798
|
+
isHTMLForm,
|
|
1799
|
+
hasOwnProperty,
|
|
1800
|
+
hasOwnProp: hasOwnProperty,
|
|
1801
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1802
|
+
reduceDescriptors,
|
|
1803
|
+
freezeMethods,
|
|
1804
|
+
toObjectSet,
|
|
1805
|
+
toCamelCase,
|
|
1806
|
+
noop,
|
|
1807
|
+
toFiniteNumber,
|
|
1808
|
+
findKey,
|
|
1809
|
+
global: _global,
|
|
1810
|
+
isContextDefined,
|
|
1811
|
+
isSpecCompliantForm,
|
|
1812
|
+
toJSONObject,
|
|
1813
|
+
isAsyncFn,
|
|
1814
|
+
isThenable,
|
|
1815
|
+
setImmediate: _setImmediate,
|
|
1816
|
+
asap,
|
|
1817
|
+
isIterable
|
|
1818
|
+
};
|
|
1819
|
+
function AxiosError$1(message, code, config, request, response) {
|
|
1820
|
+
Error.call(this);
|
|
1821
|
+
if (Error.captureStackTrace) {
|
|
1822
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1823
|
+
} else {
|
|
1824
|
+
this.stack = new Error().stack;
|
|
1825
|
+
}
|
|
1826
|
+
this.message = message;
|
|
1827
|
+
this.name = "AxiosError";
|
|
1828
|
+
code && (this.code = code);
|
|
1829
|
+
config && (this.config = config);
|
|
1830
|
+
request && (this.request = request);
|
|
1831
|
+
if (response) {
|
|
1832
|
+
this.response = response;
|
|
1833
|
+
this.status = response.status ? response.status : null;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
utils$1.inherits(AxiosError$1, Error, {
|
|
1837
|
+
toJSON: function toJSON() {
|
|
1838
|
+
return {
|
|
1839
|
+
// Standard
|
|
1840
|
+
message: this.message,
|
|
1841
|
+
name: this.name,
|
|
1842
|
+
// Microsoft
|
|
1843
|
+
description: this.description,
|
|
1844
|
+
number: this.number,
|
|
1845
|
+
// Mozilla
|
|
1846
|
+
fileName: this.fileName,
|
|
1847
|
+
lineNumber: this.lineNumber,
|
|
1848
|
+
columnNumber: this.columnNumber,
|
|
1849
|
+
stack: this.stack,
|
|
1850
|
+
// Axios
|
|
1851
|
+
config: utils$1.toJSONObject(this.config),
|
|
1852
|
+
code: this.code,
|
|
1853
|
+
status: this.status
|
|
1854
|
+
};
|
|
1855
|
+
}
|
|
1856
|
+
});
|
|
1857
|
+
const prototype$1 = AxiosError$1.prototype;
|
|
1858
|
+
const descriptors = {};
|
|
1859
|
+
[
|
|
1860
|
+
"ERR_BAD_OPTION_VALUE",
|
|
1861
|
+
"ERR_BAD_OPTION",
|
|
1862
|
+
"ECONNABORTED",
|
|
1863
|
+
"ETIMEDOUT",
|
|
1864
|
+
"ERR_NETWORK",
|
|
1865
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1866
|
+
"ERR_DEPRECATED",
|
|
1867
|
+
"ERR_BAD_RESPONSE",
|
|
1868
|
+
"ERR_BAD_REQUEST",
|
|
1869
|
+
"ERR_CANCELED",
|
|
1870
|
+
"ERR_NOT_SUPPORT",
|
|
1871
|
+
"ERR_INVALID_URL"
|
|
1872
|
+
// eslint-disable-next-line func-names
|
|
1873
|
+
].forEach((code) => {
|
|
1874
|
+
descriptors[code] = { value: code };
|
|
1875
|
+
});
|
|
1876
|
+
Object.defineProperties(AxiosError$1, descriptors);
|
|
1877
|
+
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
|
|
1878
|
+
AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
1879
|
+
const axiosError = Object.create(prototype$1);
|
|
1880
|
+
utils$1.toFlatObject(error, axiosError, function filter2(obj) {
|
|
1881
|
+
return obj !== Error.prototype;
|
|
1882
|
+
}, (prop) => {
|
|
1883
|
+
return prop !== "isAxiosError";
|
|
1884
|
+
});
|
|
1885
|
+
const msg = error && error.message ? error.message : "Error";
|
|
1886
|
+
const errCode = code == null && error ? error.code : code;
|
|
1887
|
+
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
1888
|
+
if (error && axiosError.cause == null) {
|
|
1889
|
+
Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
|
|
1890
|
+
}
|
|
1891
|
+
axiosError.name = error && error.name || "Error";
|
|
1892
|
+
customProps && Object.assign(axiosError, customProps);
|
|
1893
|
+
return axiosError;
|
|
1894
|
+
};
|
|
1895
|
+
const httpAdapter = null;
|
|
1896
|
+
function isVisitable(thing) {
|
|
1897
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
1898
|
+
}
|
|
1899
|
+
function removeBrackets(key) {
|
|
1900
|
+
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
1901
|
+
}
|
|
1902
|
+
function renderKey(path, key, dots) {
|
|
1903
|
+
if (!path) return key;
|
|
1904
|
+
return path.concat(key).map(function each(token, i) {
|
|
1905
|
+
token = removeBrackets(token);
|
|
1906
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
1907
|
+
}).join(dots ? "." : "");
|
|
1908
|
+
}
|
|
1909
|
+
function isFlatArray(arr) {
|
|
1910
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
1911
|
+
}
|
|
1912
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
1913
|
+
return /^is[A-Z]/.test(prop);
|
|
1914
|
+
});
|
|
1915
|
+
function toFormData$1(obj, formData, options) {
|
|
1916
|
+
if (!utils$1.isObject(obj)) {
|
|
1917
|
+
throw new TypeError("target must be an object");
|
|
1918
|
+
}
|
|
1919
|
+
formData = formData || new FormData();
|
|
1920
|
+
options = utils$1.toFlatObject(options, {
|
|
1921
|
+
metaTokens: true,
|
|
1922
|
+
dots: false,
|
|
1923
|
+
indexes: false
|
|
1924
|
+
}, false, function defined(option, source) {
|
|
1925
|
+
return !utils$1.isUndefined(source[option]);
|
|
1926
|
+
});
|
|
1927
|
+
const metaTokens = options.metaTokens;
|
|
1928
|
+
const visitor = options.visitor || defaultVisitor;
|
|
1929
|
+
const dots = options.dots;
|
|
1930
|
+
const indexes = options.indexes;
|
|
1931
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
1932
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1933
|
+
if (!utils$1.isFunction(visitor)) {
|
|
1934
|
+
throw new TypeError("visitor must be a function");
|
|
1935
|
+
}
|
|
1936
|
+
function convertValue(value) {
|
|
1937
|
+
if (value === null) return "";
|
|
1938
|
+
if (utils$1.isDate(value)) {
|
|
1939
|
+
return value.toISOString();
|
|
1940
|
+
}
|
|
1941
|
+
if (utils$1.isBoolean(value)) {
|
|
1942
|
+
return value.toString();
|
|
1943
|
+
}
|
|
1944
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
1945
|
+
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
1946
|
+
}
|
|
1947
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
1948
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
1949
|
+
}
|
|
1950
|
+
return value;
|
|
1951
|
+
}
|
|
1952
|
+
function defaultVisitor(value, key, path) {
|
|
1953
|
+
let arr = value;
|
|
1954
|
+
if (value && !path && typeof value === "object") {
|
|
1955
|
+
if (utils$1.endsWith(key, "{}")) {
|
|
1956
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
1957
|
+
value = JSON.stringify(value);
|
|
1958
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
1959
|
+
key = removeBrackets(key);
|
|
1960
|
+
arr.forEach(function each(el, index) {
|
|
1961
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
1962
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1963
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
1964
|
+
convertValue(el)
|
|
1965
|
+
);
|
|
1966
|
+
});
|
|
1967
|
+
return false;
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
if (isVisitable(value)) {
|
|
1971
|
+
return true;
|
|
1972
|
+
}
|
|
1973
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
1974
|
+
return false;
|
|
1975
|
+
}
|
|
1976
|
+
const stack = [];
|
|
1977
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
1978
|
+
defaultVisitor,
|
|
1979
|
+
convertValue,
|
|
1980
|
+
isVisitable
|
|
1981
|
+
});
|
|
1982
|
+
function build(value, path) {
|
|
1983
|
+
if (utils$1.isUndefined(value)) return;
|
|
1984
|
+
if (stack.indexOf(value) !== -1) {
|
|
1985
|
+
throw Error("Circular reference detected in " + path.join("."));
|
|
1986
|
+
}
|
|
1987
|
+
stack.push(value);
|
|
1988
|
+
utils$1.forEach(value, function each(el, key) {
|
|
1989
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
|
1990
|
+
formData,
|
|
1991
|
+
el,
|
|
1992
|
+
utils$1.isString(key) ? key.trim() : key,
|
|
1993
|
+
path,
|
|
1994
|
+
exposedHelpers
|
|
1995
|
+
);
|
|
1996
|
+
if (result === true) {
|
|
1997
|
+
build(el, path ? path.concat(key) : [key]);
|
|
1998
|
+
}
|
|
1999
|
+
});
|
|
2000
|
+
stack.pop();
|
|
2001
|
+
}
|
|
2002
|
+
if (!utils$1.isObject(obj)) {
|
|
2003
|
+
throw new TypeError("data must be an object");
|
|
2004
|
+
}
|
|
2005
|
+
build(obj);
|
|
2006
|
+
return formData;
|
|
2007
|
+
}
|
|
2008
|
+
function encode$1(str) {
|
|
2009
|
+
const charMap = {
|
|
2010
|
+
"!": "%21",
|
|
2011
|
+
"'": "%27",
|
|
2012
|
+
"(": "%28",
|
|
2013
|
+
")": "%29",
|
|
2014
|
+
"~": "%7E",
|
|
2015
|
+
"%20": "+",
|
|
2016
|
+
"%00": "\0"
|
|
2017
|
+
};
|
|
2018
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
2019
|
+
return charMap[match];
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
function AxiosURLSearchParams(params, options) {
|
|
2023
|
+
this._pairs = [];
|
|
2024
|
+
params && toFormData$1(params, this, options);
|
|
2025
|
+
}
|
|
2026
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
2027
|
+
prototype.append = function append(name, value) {
|
|
2028
|
+
this._pairs.push([name, value]);
|
|
2029
|
+
};
|
|
2030
|
+
prototype.toString = function toString2(encoder) {
|
|
2031
|
+
const _encode = encoder ? function(value) {
|
|
2032
|
+
return encoder.call(this, value, encode$1);
|
|
2033
|
+
} : encode$1;
|
|
2034
|
+
return this._pairs.map(function each(pair) {
|
|
2035
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
2036
|
+
}, "").join("&");
|
|
2037
|
+
};
|
|
2038
|
+
function encode(val) {
|
|
2039
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
2040
|
+
}
|
|
2041
|
+
function buildURL(url, params, options) {
|
|
2042
|
+
if (!params) {
|
|
2043
|
+
return url;
|
|
2044
|
+
}
|
|
2045
|
+
const _encode = options && options.encode || encode;
|
|
2046
|
+
if (utils$1.isFunction(options)) {
|
|
2047
|
+
options = {
|
|
2048
|
+
serialize: options
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
const serializeFn = options && options.serialize;
|
|
2052
|
+
let serializedParams;
|
|
2053
|
+
if (serializeFn) {
|
|
2054
|
+
serializedParams = serializeFn(params, options);
|
|
2055
|
+
} else {
|
|
2056
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
|
|
2057
|
+
}
|
|
2058
|
+
if (serializedParams) {
|
|
2059
|
+
const hashmarkIndex = url.indexOf("#");
|
|
2060
|
+
if (hashmarkIndex !== -1) {
|
|
2061
|
+
url = url.slice(0, hashmarkIndex);
|
|
2062
|
+
}
|
|
2063
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2064
|
+
}
|
|
2065
|
+
return url;
|
|
2066
|
+
}
|
|
2067
|
+
class InterceptorManager {
|
|
2068
|
+
constructor() {
|
|
2069
|
+
this.handlers = [];
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* Add a new interceptor to the stack
|
|
2073
|
+
*
|
|
2074
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
2075
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
2076
|
+
*
|
|
2077
|
+
* @return {Number} An ID used to remove interceptor later
|
|
2078
|
+
*/
|
|
2079
|
+
use(fulfilled, rejected, options) {
|
|
2080
|
+
this.handlers.push({
|
|
2081
|
+
fulfilled,
|
|
2082
|
+
rejected,
|
|
2083
|
+
synchronous: options ? options.synchronous : false,
|
|
2084
|
+
runWhen: options ? options.runWhen : null
|
|
2085
|
+
});
|
|
2086
|
+
return this.handlers.length - 1;
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Remove an interceptor from the stack
|
|
2090
|
+
*
|
|
2091
|
+
* @param {Number} id The ID that was returned by `use`
|
|
2092
|
+
*
|
|
2093
|
+
* @returns {void}
|
|
2094
|
+
*/
|
|
2095
|
+
eject(id) {
|
|
2096
|
+
if (this.handlers[id]) {
|
|
2097
|
+
this.handlers[id] = null;
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* Clear all interceptors from the stack
|
|
2102
|
+
*
|
|
2103
|
+
* @returns {void}
|
|
2104
|
+
*/
|
|
2105
|
+
clear() {
|
|
2106
|
+
if (this.handlers) {
|
|
2107
|
+
this.handlers = [];
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Iterate over all the registered interceptors
|
|
2112
|
+
*
|
|
2113
|
+
* This method is particularly useful for skipping over any
|
|
2114
|
+
* interceptors that may have become `null` calling `eject`.
|
|
2115
|
+
*
|
|
2116
|
+
* @param {Function} fn The function to call for each interceptor
|
|
2117
|
+
*
|
|
2118
|
+
* @returns {void}
|
|
2119
|
+
*/
|
|
2120
|
+
forEach(fn) {
|
|
2121
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
2122
|
+
if (h !== null) {
|
|
2123
|
+
fn(h);
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
const transitionalDefaults = {
|
|
2129
|
+
silentJSONParsing: true,
|
|
2130
|
+
forcedJSONParsing: true,
|
|
2131
|
+
clarifyTimeoutError: false
|
|
2132
|
+
};
|
|
2133
|
+
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
2134
|
+
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
2135
|
+
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
|
|
2136
|
+
const platform$1 = {
|
|
2137
|
+
isBrowser: true,
|
|
2138
|
+
classes: {
|
|
2139
|
+
URLSearchParams: URLSearchParams$1,
|
|
2140
|
+
FormData: FormData$1,
|
|
2141
|
+
Blob: Blob$1
|
|
2142
|
+
},
|
|
2143
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
2144
|
+
};
|
|
2145
|
+
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2146
|
+
const _navigator = typeof navigator === "object" && navigator || void 0;
|
|
2147
|
+
const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
2148
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
2149
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
2150
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
2151
|
+
})();
|
|
2152
|
+
const origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
2153
|
+
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2154
|
+
__proto__: null,
|
|
2155
|
+
hasBrowserEnv,
|
|
2156
|
+
hasStandardBrowserEnv,
|
|
2157
|
+
hasStandardBrowserWebWorkerEnv,
|
|
2158
|
+
navigator: _navigator,
|
|
2159
|
+
origin
|
|
2160
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2161
|
+
const platform = {
|
|
2162
|
+
...utils,
|
|
2163
|
+
...platform$1
|
|
2164
|
+
};
|
|
2165
|
+
function toURLEncodedForm(data, options) {
|
|
2166
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
2167
|
+
visitor: function(value, key, path, helpers) {
|
|
2168
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
2169
|
+
this.append(key, value.toString("base64"));
|
|
2170
|
+
return false;
|
|
2171
|
+
}
|
|
2172
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
2173
|
+
},
|
|
2174
|
+
...options
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
function parsePropPath(name) {
|
|
2178
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
2179
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
function arrayToObject(arr) {
|
|
2183
|
+
const obj = {};
|
|
2184
|
+
const keys = Object.keys(arr);
|
|
2185
|
+
let i;
|
|
2186
|
+
const len = keys.length;
|
|
2187
|
+
let key;
|
|
2188
|
+
for (i = 0; i < len; i++) {
|
|
2189
|
+
key = keys[i];
|
|
2190
|
+
obj[key] = arr[key];
|
|
2191
|
+
}
|
|
2192
|
+
return obj;
|
|
2193
|
+
}
|
|
2194
|
+
function formDataToJSON(formData) {
|
|
2195
|
+
function buildPath(path, value, target, index) {
|
|
2196
|
+
let name = path[index++];
|
|
2197
|
+
if (name === "__proto__") return true;
|
|
2198
|
+
const isNumericKey = Number.isFinite(+name);
|
|
2199
|
+
const isLast = index >= path.length;
|
|
2200
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
2201
|
+
if (isLast) {
|
|
2202
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
2203
|
+
target[name] = [target[name], value];
|
|
2204
|
+
} else {
|
|
2205
|
+
target[name] = value;
|
|
2206
|
+
}
|
|
2207
|
+
return !isNumericKey;
|
|
2208
|
+
}
|
|
2209
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
2210
|
+
target[name] = [];
|
|
2211
|
+
}
|
|
2212
|
+
const result = buildPath(path, value, target[name], index);
|
|
2213
|
+
if (result && utils$1.isArray(target[name])) {
|
|
2214
|
+
target[name] = arrayToObject(target[name]);
|
|
2215
|
+
}
|
|
2216
|
+
return !isNumericKey;
|
|
2217
|
+
}
|
|
2218
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
2219
|
+
const obj = {};
|
|
2220
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
2221
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
2222
|
+
});
|
|
2223
|
+
return obj;
|
|
2224
|
+
}
|
|
2225
|
+
return null;
|
|
2226
|
+
}
|
|
2227
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
2228
|
+
if (utils$1.isString(rawValue)) {
|
|
2229
|
+
try {
|
|
2230
|
+
(parser || JSON.parse)(rawValue);
|
|
2231
|
+
return utils$1.trim(rawValue);
|
|
2232
|
+
} catch (e) {
|
|
2233
|
+
if (e.name !== "SyntaxError") {
|
|
2234
|
+
throw e;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
2239
|
+
}
|
|
2240
|
+
const defaults = {
|
|
2241
|
+
transitional: transitionalDefaults,
|
|
2242
|
+
adapter: ["xhr", "http", "fetch"],
|
|
2243
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
2244
|
+
const contentType = headers.getContentType() || "";
|
|
2245
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
2246
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
2247
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
2248
|
+
data = new FormData(data);
|
|
2249
|
+
}
|
|
2250
|
+
const isFormData2 = utils$1.isFormData(data);
|
|
2251
|
+
if (isFormData2) {
|
|
2252
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
2253
|
+
}
|
|
2254
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
|
|
2255
|
+
return data;
|
|
2256
|
+
}
|
|
2257
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
2258
|
+
return data.buffer;
|
|
2259
|
+
}
|
|
2260
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
2261
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
2262
|
+
return data.toString();
|
|
2263
|
+
}
|
|
2264
|
+
let isFileList2;
|
|
2265
|
+
if (isObjectPayload) {
|
|
2266
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
2267
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
2268
|
+
}
|
|
2269
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
2270
|
+
const _FormData = this.env && this.env.FormData;
|
|
2271
|
+
return toFormData$1(
|
|
2272
|
+
isFileList2 ? { "files[]": data } : data,
|
|
2273
|
+
_FormData && new _FormData(),
|
|
2274
|
+
this.formSerializer
|
|
2275
|
+
);
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
2279
|
+
headers.setContentType("application/json", false);
|
|
2280
|
+
return stringifySafely(data);
|
|
2281
|
+
}
|
|
2282
|
+
return data;
|
|
2283
|
+
}],
|
|
2284
|
+
transformResponse: [function transformResponse(data) {
|
|
2285
|
+
const transitional2 = this.transitional || defaults.transitional;
|
|
2286
|
+
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2287
|
+
const JSONRequested = this.responseType === "json";
|
|
2288
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
2289
|
+
return data;
|
|
2290
|
+
}
|
|
2291
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
2292
|
+
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2293
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
2294
|
+
try {
|
|
2295
|
+
return JSON.parse(data, this.parseReviver);
|
|
2296
|
+
} catch (e) {
|
|
2297
|
+
if (strictJSONParsing) {
|
|
2298
|
+
if (e.name === "SyntaxError") {
|
|
2299
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
2300
|
+
}
|
|
2301
|
+
throw e;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
return data;
|
|
2306
|
+
}],
|
|
2307
|
+
/**
|
|
2308
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2309
|
+
* timeout is not created.
|
|
2310
|
+
*/
|
|
2311
|
+
timeout: 0,
|
|
2312
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
2313
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2314
|
+
maxContentLength: -1,
|
|
2315
|
+
maxBodyLength: -1,
|
|
2316
|
+
env: {
|
|
2317
|
+
FormData: platform.classes.FormData,
|
|
2318
|
+
Blob: platform.classes.Blob
|
|
2319
|
+
},
|
|
2320
|
+
validateStatus: function validateStatus(status) {
|
|
2321
|
+
return status >= 200 && status < 300;
|
|
2322
|
+
},
|
|
2323
|
+
headers: {
|
|
2324
|
+
common: {
|
|
2325
|
+
"Accept": "application/json, text/plain, */*",
|
|
2326
|
+
"Content-Type": void 0
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
};
|
|
2330
|
+
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
2331
|
+
defaults.headers[method] = {};
|
|
2332
|
+
});
|
|
2333
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
2334
|
+
"age",
|
|
2335
|
+
"authorization",
|
|
2336
|
+
"content-length",
|
|
2337
|
+
"content-type",
|
|
2338
|
+
"etag",
|
|
2339
|
+
"expires",
|
|
2340
|
+
"from",
|
|
2341
|
+
"host",
|
|
2342
|
+
"if-modified-since",
|
|
2343
|
+
"if-unmodified-since",
|
|
2344
|
+
"last-modified",
|
|
2345
|
+
"location",
|
|
2346
|
+
"max-forwards",
|
|
2347
|
+
"proxy-authorization",
|
|
2348
|
+
"referer",
|
|
2349
|
+
"retry-after",
|
|
2350
|
+
"user-agent"
|
|
2351
|
+
]);
|
|
2352
|
+
const parseHeaders = (rawHeaders) => {
|
|
2353
|
+
const parsed = {};
|
|
2354
|
+
let key;
|
|
2355
|
+
let val;
|
|
2356
|
+
let i;
|
|
2357
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
2358
|
+
i = line.indexOf(":");
|
|
2359
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
2360
|
+
val = line.substring(i + 1).trim();
|
|
2361
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
2362
|
+
return;
|
|
2363
|
+
}
|
|
2364
|
+
if (key === "set-cookie") {
|
|
2365
|
+
if (parsed[key]) {
|
|
2366
|
+
parsed[key].push(val);
|
|
2367
|
+
} else {
|
|
2368
|
+
parsed[key] = [val];
|
|
2369
|
+
}
|
|
2370
|
+
} else {
|
|
2371
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
return parsed;
|
|
2375
|
+
};
|
|
2376
|
+
const $internals = /* @__PURE__ */ Symbol("internals");
|
|
2377
|
+
function normalizeHeader(header) {
|
|
2378
|
+
return header && String(header).trim().toLowerCase();
|
|
2379
|
+
}
|
|
2380
|
+
function normalizeValue(value) {
|
|
2381
|
+
if (value === false || value == null) {
|
|
2382
|
+
return value;
|
|
2383
|
+
}
|
|
2384
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
2385
|
+
}
|
|
2386
|
+
function parseTokens(str) {
|
|
2387
|
+
const tokens = /* @__PURE__ */ Object.create(null);
|
|
2388
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
2389
|
+
let match;
|
|
2390
|
+
while (match = tokensRE.exec(str)) {
|
|
2391
|
+
tokens[match[1]] = match[2];
|
|
2392
|
+
}
|
|
2393
|
+
return tokens;
|
|
2394
|
+
}
|
|
2395
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
2396
|
+
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
|
|
2397
|
+
if (utils$1.isFunction(filter2)) {
|
|
2398
|
+
return filter2.call(this, value, header);
|
|
2399
|
+
}
|
|
2400
|
+
if (isHeaderNameFilter) {
|
|
2401
|
+
value = header;
|
|
2402
|
+
}
|
|
2403
|
+
if (!utils$1.isString(value)) return;
|
|
2404
|
+
if (utils$1.isString(filter2)) {
|
|
2405
|
+
return value.indexOf(filter2) !== -1;
|
|
2406
|
+
}
|
|
2407
|
+
if (utils$1.isRegExp(filter2)) {
|
|
2408
|
+
return filter2.test(value);
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
function formatHeader(header) {
|
|
2412
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
2413
|
+
return char.toUpperCase() + str;
|
|
2414
|
+
});
|
|
2415
|
+
}
|
|
2416
|
+
function buildAccessors(obj, header) {
|
|
2417
|
+
const accessorName = utils$1.toCamelCase(" " + header);
|
|
2418
|
+
["get", "set", "has"].forEach((methodName) => {
|
|
2419
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
2420
|
+
value: function(arg1, arg2, arg3) {
|
|
2421
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
2422
|
+
},
|
|
2423
|
+
configurable: true
|
|
2424
|
+
});
|
|
2425
|
+
});
|
|
2426
|
+
}
|
|
2427
|
+
let AxiosHeaders$1 = class AxiosHeaders {
|
|
2428
|
+
constructor(headers) {
|
|
2429
|
+
headers && this.set(headers);
|
|
2430
|
+
}
|
|
2431
|
+
set(header, valueOrRewrite, rewrite) {
|
|
2432
|
+
const self2 = this;
|
|
2433
|
+
function setHeader(_value, _header, _rewrite) {
|
|
2434
|
+
const lHeader = normalizeHeader(_header);
|
|
2435
|
+
if (!lHeader) {
|
|
2436
|
+
throw new Error("header name must be a non-empty string");
|
|
2437
|
+
}
|
|
2438
|
+
const key = utils$1.findKey(self2, lHeader);
|
|
2439
|
+
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
2440
|
+
self2[key || _header] = normalizeValue(_value);
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
2444
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
2445
|
+
setHeaders(header, valueOrRewrite);
|
|
2446
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2447
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
2448
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
2449
|
+
let obj = {}, dest, key;
|
|
2450
|
+
for (const entry of header) {
|
|
2451
|
+
if (!utils$1.isArray(entry)) {
|
|
2452
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
2453
|
+
}
|
|
2454
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
2455
|
+
}
|
|
2456
|
+
setHeaders(obj, valueOrRewrite);
|
|
2457
|
+
} else {
|
|
2458
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2459
|
+
}
|
|
2460
|
+
return this;
|
|
2461
|
+
}
|
|
2462
|
+
get(header, parser) {
|
|
2463
|
+
header = normalizeHeader(header);
|
|
2464
|
+
if (header) {
|
|
2465
|
+
const key = utils$1.findKey(this, header);
|
|
2466
|
+
if (key) {
|
|
2467
|
+
const value = this[key];
|
|
2468
|
+
if (!parser) {
|
|
2469
|
+
return value;
|
|
2470
|
+
}
|
|
2471
|
+
if (parser === true) {
|
|
2472
|
+
return parseTokens(value);
|
|
2473
|
+
}
|
|
2474
|
+
if (utils$1.isFunction(parser)) {
|
|
2475
|
+
return parser.call(this, value, key);
|
|
2476
|
+
}
|
|
2477
|
+
if (utils$1.isRegExp(parser)) {
|
|
2478
|
+
return parser.exec(value);
|
|
2479
|
+
}
|
|
2480
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
has(header, matcher) {
|
|
2485
|
+
header = normalizeHeader(header);
|
|
2486
|
+
if (header) {
|
|
2487
|
+
const key = utils$1.findKey(this, header);
|
|
2488
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
2489
|
+
}
|
|
2490
|
+
return false;
|
|
2491
|
+
}
|
|
2492
|
+
delete(header, matcher) {
|
|
2493
|
+
const self2 = this;
|
|
2494
|
+
let deleted = false;
|
|
2495
|
+
function deleteHeader(_header) {
|
|
2496
|
+
_header = normalizeHeader(_header);
|
|
2497
|
+
if (_header) {
|
|
2498
|
+
const key = utils$1.findKey(self2, _header);
|
|
2499
|
+
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
2500
|
+
delete self2[key];
|
|
2501
|
+
deleted = true;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
if (utils$1.isArray(header)) {
|
|
2506
|
+
header.forEach(deleteHeader);
|
|
2507
|
+
} else {
|
|
2508
|
+
deleteHeader(header);
|
|
2509
|
+
}
|
|
2510
|
+
return deleted;
|
|
2511
|
+
}
|
|
2512
|
+
clear(matcher) {
|
|
2513
|
+
const keys = Object.keys(this);
|
|
2514
|
+
let i = keys.length;
|
|
2515
|
+
let deleted = false;
|
|
2516
|
+
while (i--) {
|
|
2517
|
+
const key = keys[i];
|
|
2518
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
2519
|
+
delete this[key];
|
|
2520
|
+
deleted = true;
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
return deleted;
|
|
2524
|
+
}
|
|
2525
|
+
normalize(format) {
|
|
2526
|
+
const self2 = this;
|
|
2527
|
+
const headers = {};
|
|
2528
|
+
utils$1.forEach(this, (value, header) => {
|
|
2529
|
+
const key = utils$1.findKey(headers, header);
|
|
2530
|
+
if (key) {
|
|
2531
|
+
self2[key] = normalizeValue(value);
|
|
2532
|
+
delete self2[header];
|
|
2533
|
+
return;
|
|
2534
|
+
}
|
|
2535
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
2536
|
+
if (normalized !== header) {
|
|
2537
|
+
delete self2[header];
|
|
2538
|
+
}
|
|
2539
|
+
self2[normalized] = normalizeValue(value);
|
|
2540
|
+
headers[normalized] = true;
|
|
2541
|
+
});
|
|
2542
|
+
return this;
|
|
2543
|
+
}
|
|
2544
|
+
concat(...targets) {
|
|
2545
|
+
return this.constructor.concat(this, ...targets);
|
|
2546
|
+
}
|
|
2547
|
+
toJSON(asStrings) {
|
|
2548
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
2549
|
+
utils$1.forEach(this, (value, header) => {
|
|
2550
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
2551
|
+
});
|
|
2552
|
+
return obj;
|
|
2553
|
+
}
|
|
2554
|
+
[Symbol.iterator]() {
|
|
2555
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
2556
|
+
}
|
|
2557
|
+
toString() {
|
|
2558
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
2559
|
+
}
|
|
2560
|
+
getSetCookie() {
|
|
2561
|
+
return this.get("set-cookie") || [];
|
|
2562
|
+
}
|
|
2563
|
+
get [Symbol.toStringTag]() {
|
|
2564
|
+
return "AxiosHeaders";
|
|
2565
|
+
}
|
|
2566
|
+
static from(thing) {
|
|
2567
|
+
return thing instanceof this ? thing : new this(thing);
|
|
2568
|
+
}
|
|
2569
|
+
static concat(first, ...targets) {
|
|
2570
|
+
const computed2 = new this(first);
|
|
2571
|
+
targets.forEach((target) => computed2.set(target));
|
|
2572
|
+
return computed2;
|
|
2573
|
+
}
|
|
2574
|
+
static accessor(header) {
|
|
2575
|
+
const internals = this[$internals] = this[$internals] = {
|
|
2576
|
+
accessors: {}
|
|
2577
|
+
};
|
|
2578
|
+
const accessors = internals.accessors;
|
|
2579
|
+
const prototype2 = this.prototype;
|
|
2580
|
+
function defineAccessor(_header) {
|
|
2581
|
+
const lHeader = normalizeHeader(_header);
|
|
2582
|
+
if (!accessors[lHeader]) {
|
|
2583
|
+
buildAccessors(prototype2, _header);
|
|
2584
|
+
accessors[lHeader] = true;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
2588
|
+
return this;
|
|
2589
|
+
}
|
|
2590
|
+
};
|
|
2591
|
+
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
2592
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
2593
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
2594
|
+
return {
|
|
2595
|
+
get: () => value,
|
|
2596
|
+
set(headerValue) {
|
|
2597
|
+
this[mapped] = headerValue;
|
|
2598
|
+
}
|
|
2599
|
+
};
|
|
2600
|
+
});
|
|
2601
|
+
utils$1.freezeMethods(AxiosHeaders$1);
|
|
2602
|
+
function transformData(fns, response) {
|
|
2603
|
+
const config = this || defaults;
|
|
2604
|
+
const context = response || config;
|
|
2605
|
+
const headers = AxiosHeaders$1.from(context.headers);
|
|
2606
|
+
let data = context.data;
|
|
2607
|
+
utils$1.forEach(fns, function transform(fn) {
|
|
2608
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
2609
|
+
});
|
|
2610
|
+
headers.normalize();
|
|
2611
|
+
return data;
|
|
2612
|
+
}
|
|
2613
|
+
function isCancel$1(value) {
|
|
2614
|
+
return !!(value && value.__CANCEL__);
|
|
2615
|
+
}
|
|
2616
|
+
function CanceledError$1(message, config, request) {
|
|
2617
|
+
AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
|
|
2618
|
+
this.name = "CanceledError";
|
|
2619
|
+
}
|
|
2620
|
+
utils$1.inherits(CanceledError$1, AxiosError$1, {
|
|
2621
|
+
__CANCEL__: true
|
|
2622
|
+
});
|
|
2623
|
+
function settle(resolve, reject, response) {
|
|
2624
|
+
const validateStatus2 = response.config.validateStatus;
|
|
2625
|
+
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
2626
|
+
resolve(response);
|
|
2627
|
+
} else {
|
|
2628
|
+
reject(new AxiosError$1(
|
|
2629
|
+
"Request failed with status code " + response.status,
|
|
2630
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
2631
|
+
response.config,
|
|
2632
|
+
response.request,
|
|
2633
|
+
response
|
|
2634
|
+
));
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
function parseProtocol(url) {
|
|
2638
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
2639
|
+
return match && match[1] || "";
|
|
2640
|
+
}
|
|
2641
|
+
function speedometer(samplesCount, min) {
|
|
2642
|
+
samplesCount = samplesCount || 10;
|
|
2643
|
+
const bytes = new Array(samplesCount);
|
|
2644
|
+
const timestamps = new Array(samplesCount);
|
|
2645
|
+
let head = 0;
|
|
2646
|
+
let tail = 0;
|
|
2647
|
+
let firstSampleTS;
|
|
2648
|
+
min = min !== void 0 ? min : 1e3;
|
|
2649
|
+
return function push(chunkLength) {
|
|
2650
|
+
const now = Date.now();
|
|
2651
|
+
const startedAt = timestamps[tail];
|
|
2652
|
+
if (!firstSampleTS) {
|
|
2653
|
+
firstSampleTS = now;
|
|
2654
|
+
}
|
|
2655
|
+
bytes[head] = chunkLength;
|
|
2656
|
+
timestamps[head] = now;
|
|
2657
|
+
let i = tail;
|
|
2658
|
+
let bytesCount = 0;
|
|
2659
|
+
while (i !== head) {
|
|
2660
|
+
bytesCount += bytes[i++];
|
|
2661
|
+
i = i % samplesCount;
|
|
2662
|
+
}
|
|
2663
|
+
head = (head + 1) % samplesCount;
|
|
2664
|
+
if (head === tail) {
|
|
2665
|
+
tail = (tail + 1) % samplesCount;
|
|
2666
|
+
}
|
|
2667
|
+
if (now - firstSampleTS < min) {
|
|
2668
|
+
return;
|
|
2669
|
+
}
|
|
2670
|
+
const passed = startedAt && now - startedAt;
|
|
2671
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
2672
|
+
};
|
|
2673
|
+
}
|
|
2674
|
+
function throttle(fn, freq) {
|
|
2675
|
+
let timestamp = 0;
|
|
2676
|
+
let threshold = 1e3 / freq;
|
|
2677
|
+
let lastArgs;
|
|
2678
|
+
let timer;
|
|
2679
|
+
const invoke = (args, now = Date.now()) => {
|
|
2680
|
+
timestamp = now;
|
|
2681
|
+
lastArgs = null;
|
|
2682
|
+
if (timer) {
|
|
2683
|
+
clearTimeout(timer);
|
|
2684
|
+
timer = null;
|
|
2685
|
+
}
|
|
2686
|
+
fn(...args);
|
|
2687
|
+
};
|
|
2688
|
+
const throttled = (...args) => {
|
|
2689
|
+
const now = Date.now();
|
|
2690
|
+
const passed = now - timestamp;
|
|
2691
|
+
if (passed >= threshold) {
|
|
2692
|
+
invoke(args, now);
|
|
2693
|
+
} else {
|
|
2694
|
+
lastArgs = args;
|
|
2695
|
+
if (!timer) {
|
|
2696
|
+
timer = setTimeout(() => {
|
|
2697
|
+
timer = null;
|
|
2698
|
+
invoke(lastArgs);
|
|
2699
|
+
}, threshold - passed);
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
};
|
|
2703
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
2704
|
+
return [throttled, flush];
|
|
2705
|
+
}
|
|
2706
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
2707
|
+
let bytesNotified = 0;
|
|
2708
|
+
const _speedometer = speedometer(50, 250);
|
|
2709
|
+
return throttle((e) => {
|
|
2710
|
+
const loaded = e.loaded;
|
|
2711
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
2712
|
+
const progressBytes = loaded - bytesNotified;
|
|
2713
|
+
const rate = _speedometer(progressBytes);
|
|
2714
|
+
const inRange = loaded <= total;
|
|
2715
|
+
bytesNotified = loaded;
|
|
2716
|
+
const data = {
|
|
2717
|
+
loaded,
|
|
2718
|
+
total,
|
|
2719
|
+
progress: total ? loaded / total : void 0,
|
|
2720
|
+
bytes: progressBytes,
|
|
2721
|
+
rate: rate ? rate : void 0,
|
|
2722
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
2723
|
+
event: e,
|
|
2724
|
+
lengthComputable: total != null,
|
|
2725
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
2726
|
+
};
|
|
2727
|
+
listener(data);
|
|
2728
|
+
}, freq);
|
|
2729
|
+
};
|
|
2730
|
+
const progressEventDecorator = (total, throttled) => {
|
|
2731
|
+
const lengthComputable = total != null;
|
|
2732
|
+
return [(loaded) => throttled[0]({
|
|
2733
|
+
lengthComputable,
|
|
2734
|
+
total,
|
|
2735
|
+
loaded
|
|
2736
|
+
}), throttled[1]];
|
|
2737
|
+
};
|
|
2738
|
+
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
2739
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
|
|
2740
|
+
url = new URL(url, platform.origin);
|
|
2741
|
+
return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
|
|
2742
|
+
})(
|
|
2743
|
+
new URL(platform.origin),
|
|
2744
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
2745
|
+
) : () => true;
|
|
2746
|
+
const cookies = platform.hasStandardBrowserEnv ? (
|
|
2747
|
+
// Standard browser envs support document.cookie
|
|
2748
|
+
{
|
|
2749
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
2750
|
+
if (typeof document === "undefined") return;
|
|
2751
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
2752
|
+
if (utils$1.isNumber(expires)) {
|
|
2753
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
2754
|
+
}
|
|
2755
|
+
if (utils$1.isString(path)) {
|
|
2756
|
+
cookie.push(`path=${path}`);
|
|
2757
|
+
}
|
|
2758
|
+
if (utils$1.isString(domain)) {
|
|
2759
|
+
cookie.push(`domain=${domain}`);
|
|
2760
|
+
}
|
|
2761
|
+
if (secure === true) {
|
|
2762
|
+
cookie.push("secure");
|
|
2763
|
+
}
|
|
2764
|
+
if (utils$1.isString(sameSite)) {
|
|
2765
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
2766
|
+
}
|
|
2767
|
+
document.cookie = cookie.join("; ");
|
|
2768
|
+
},
|
|
2769
|
+
read(name) {
|
|
2770
|
+
if (typeof document === "undefined") return null;
|
|
2771
|
+
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
2772
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
2773
|
+
},
|
|
2774
|
+
remove(name) {
|
|
2775
|
+
this.write(name, "", Date.now() - 864e5, "/");
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
) : (
|
|
2779
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
2780
|
+
{
|
|
2781
|
+
write() {
|
|
2782
|
+
},
|
|
2783
|
+
read() {
|
|
2784
|
+
return null;
|
|
2785
|
+
},
|
|
2786
|
+
remove() {
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
);
|
|
2790
|
+
function isAbsoluteURL(url) {
|
|
2791
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
2792
|
+
}
|
|
2793
|
+
function combineURLs(baseURL, relativeURL) {
|
|
2794
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2795
|
+
}
|
|
2796
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2797
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2798
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
2799
|
+
return combineURLs(baseURL, requestedURL);
|
|
2800
|
+
}
|
|
2801
|
+
return requestedURL;
|
|
2802
|
+
}
|
|
2803
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
2804
|
+
function mergeConfig$1(config1, config2) {
|
|
2805
|
+
config2 = config2 || {};
|
|
2806
|
+
const config = {};
|
|
2807
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
2808
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2809
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
2810
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
2811
|
+
return utils$1.merge({}, source);
|
|
2812
|
+
} else if (utils$1.isArray(source)) {
|
|
2813
|
+
return source.slice();
|
|
2814
|
+
}
|
|
2815
|
+
return source;
|
|
2816
|
+
}
|
|
2817
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
2818
|
+
if (!utils$1.isUndefined(b)) {
|
|
2819
|
+
return getMergedValue(a, b, prop, caseless);
|
|
2820
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2821
|
+
return getMergedValue(void 0, a, prop, caseless);
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
function valueFromConfig2(a, b) {
|
|
2825
|
+
if (!utils$1.isUndefined(b)) {
|
|
2826
|
+
return getMergedValue(void 0, b);
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
function defaultToConfig2(a, b) {
|
|
2830
|
+
if (!utils$1.isUndefined(b)) {
|
|
2831
|
+
return getMergedValue(void 0, b);
|
|
2832
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2833
|
+
return getMergedValue(void 0, a);
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
function mergeDirectKeys(a, b, prop) {
|
|
2837
|
+
if (prop in config2) {
|
|
2838
|
+
return getMergedValue(a, b);
|
|
2839
|
+
} else if (prop in config1) {
|
|
2840
|
+
return getMergedValue(void 0, a);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
const mergeMap = {
|
|
2844
|
+
url: valueFromConfig2,
|
|
2845
|
+
method: valueFromConfig2,
|
|
2846
|
+
data: valueFromConfig2,
|
|
2847
|
+
baseURL: defaultToConfig2,
|
|
2848
|
+
transformRequest: defaultToConfig2,
|
|
2849
|
+
transformResponse: defaultToConfig2,
|
|
2850
|
+
paramsSerializer: defaultToConfig2,
|
|
2851
|
+
timeout: defaultToConfig2,
|
|
2852
|
+
timeoutMessage: defaultToConfig2,
|
|
2853
|
+
withCredentials: defaultToConfig2,
|
|
2854
|
+
withXSRFToken: defaultToConfig2,
|
|
2855
|
+
adapter: defaultToConfig2,
|
|
2856
|
+
responseType: defaultToConfig2,
|
|
2857
|
+
xsrfCookieName: defaultToConfig2,
|
|
2858
|
+
xsrfHeaderName: defaultToConfig2,
|
|
2859
|
+
onUploadProgress: defaultToConfig2,
|
|
2860
|
+
onDownloadProgress: defaultToConfig2,
|
|
2861
|
+
decompress: defaultToConfig2,
|
|
2862
|
+
maxContentLength: defaultToConfig2,
|
|
2863
|
+
maxBodyLength: defaultToConfig2,
|
|
2864
|
+
beforeRedirect: defaultToConfig2,
|
|
2865
|
+
transport: defaultToConfig2,
|
|
2866
|
+
httpAgent: defaultToConfig2,
|
|
2867
|
+
httpsAgent: defaultToConfig2,
|
|
2868
|
+
cancelToken: defaultToConfig2,
|
|
2869
|
+
socketPath: defaultToConfig2,
|
|
2870
|
+
responseEncoding: defaultToConfig2,
|
|
2871
|
+
validateStatus: mergeDirectKeys,
|
|
2872
|
+
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
2873
|
+
};
|
|
2874
|
+
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
2875
|
+
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
2876
|
+
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
2877
|
+
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
2878
|
+
});
|
|
2879
|
+
return config;
|
|
2880
|
+
}
|
|
2881
|
+
const resolveConfig = (config) => {
|
|
2882
|
+
const newConfig = mergeConfig$1({}, config);
|
|
2883
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
2884
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2885
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
2886
|
+
if (auth) {
|
|
2887
|
+
headers.set(
|
|
2888
|
+
"Authorization",
|
|
2889
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
2890
|
+
);
|
|
2891
|
+
}
|
|
2892
|
+
if (utils$1.isFormData(data)) {
|
|
2893
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
2894
|
+
headers.setContentType(void 0);
|
|
2895
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
2896
|
+
const formHeaders = data.getHeaders();
|
|
2897
|
+
const allowedHeaders = ["content-type", "content-length"];
|
|
2898
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
2899
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
2900
|
+
headers.set(key, val);
|
|
2901
|
+
}
|
|
2902
|
+
});
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
if (platform.hasStandardBrowserEnv) {
|
|
2906
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
2907
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
|
|
2908
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
2909
|
+
if (xsrfValue) {
|
|
2910
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
return newConfig;
|
|
2915
|
+
};
|
|
2916
|
+
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
2917
|
+
const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
2918
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2919
|
+
const _config = resolveConfig(config);
|
|
2920
|
+
let requestData = _config.data;
|
|
2921
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
2922
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
2923
|
+
let onCanceled;
|
|
2924
|
+
let uploadThrottled, downloadThrottled;
|
|
2925
|
+
let flushUpload, flushDownload;
|
|
2926
|
+
function done() {
|
|
2927
|
+
flushUpload && flushUpload();
|
|
2928
|
+
flushDownload && flushDownload();
|
|
2929
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
2930
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
2931
|
+
}
|
|
2932
|
+
let request = new XMLHttpRequest();
|
|
2933
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
2934
|
+
request.timeout = _config.timeout;
|
|
2935
|
+
function onloadend() {
|
|
2936
|
+
if (!request) {
|
|
2937
|
+
return;
|
|
2938
|
+
}
|
|
2939
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
2940
|
+
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
2941
|
+
);
|
|
2942
|
+
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
2943
|
+
const response = {
|
|
2944
|
+
data: responseData,
|
|
2945
|
+
status: request.status,
|
|
2946
|
+
statusText: request.statusText,
|
|
2947
|
+
headers: responseHeaders,
|
|
2948
|
+
config,
|
|
2949
|
+
request
|
|
2950
|
+
};
|
|
2951
|
+
settle(function _resolve(value) {
|
|
2952
|
+
resolve(value);
|
|
2953
|
+
done();
|
|
2954
|
+
}, function _reject(err) {
|
|
2955
|
+
reject(err);
|
|
2956
|
+
done();
|
|
2957
|
+
}, response);
|
|
2958
|
+
request = null;
|
|
2959
|
+
}
|
|
2960
|
+
if ("onloadend" in request) {
|
|
2961
|
+
request.onloadend = onloadend;
|
|
2962
|
+
} else {
|
|
2963
|
+
request.onreadystatechange = function handleLoad() {
|
|
2964
|
+
if (!request || request.readyState !== 4) {
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
2968
|
+
return;
|
|
2969
|
+
}
|
|
2970
|
+
setTimeout(onloadend);
|
|
2971
|
+
};
|
|
2972
|
+
}
|
|
2973
|
+
request.onabort = function handleAbort() {
|
|
2974
|
+
if (!request) {
|
|
2975
|
+
return;
|
|
2976
|
+
}
|
|
2977
|
+
reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
|
|
2978
|
+
request = null;
|
|
2979
|
+
};
|
|
2980
|
+
request.onerror = function handleError(event) {
|
|
2981
|
+
const msg = event && event.message ? event.message : "Network Error";
|
|
2982
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
2983
|
+
err.event = event || null;
|
|
2984
|
+
reject(err);
|
|
2985
|
+
request = null;
|
|
2986
|
+
};
|
|
2987
|
+
request.ontimeout = function handleTimeout() {
|
|
2988
|
+
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
2989
|
+
const transitional2 = _config.transitional || transitionalDefaults;
|
|
2990
|
+
if (_config.timeoutErrorMessage) {
|
|
2991
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
2992
|
+
}
|
|
2993
|
+
reject(new AxiosError$1(
|
|
2994
|
+
timeoutErrorMessage,
|
|
2995
|
+
transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2996
|
+
config,
|
|
2997
|
+
request
|
|
2998
|
+
));
|
|
2999
|
+
request = null;
|
|
3000
|
+
};
|
|
3001
|
+
requestData === void 0 && requestHeaders.setContentType(null);
|
|
3002
|
+
if ("setRequestHeader" in request) {
|
|
3003
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
3004
|
+
request.setRequestHeader(key, val);
|
|
3005
|
+
});
|
|
3006
|
+
}
|
|
3007
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
3008
|
+
request.withCredentials = !!_config.withCredentials;
|
|
3009
|
+
}
|
|
3010
|
+
if (responseType && responseType !== "json") {
|
|
3011
|
+
request.responseType = _config.responseType;
|
|
3012
|
+
}
|
|
3013
|
+
if (onDownloadProgress) {
|
|
3014
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
3015
|
+
request.addEventListener("progress", downloadThrottled);
|
|
3016
|
+
}
|
|
3017
|
+
if (onUploadProgress && request.upload) {
|
|
3018
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
3019
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
3020
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
3021
|
+
}
|
|
3022
|
+
if (_config.cancelToken || _config.signal) {
|
|
3023
|
+
onCanceled = (cancel) => {
|
|
3024
|
+
if (!request) {
|
|
3025
|
+
return;
|
|
3026
|
+
}
|
|
3027
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
3028
|
+
request.abort();
|
|
3029
|
+
request = null;
|
|
3030
|
+
};
|
|
3031
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
3032
|
+
if (_config.signal) {
|
|
3033
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
const protocol = parseProtocol(_config.url);
|
|
3037
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
3038
|
+
reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
|
|
3039
|
+
return;
|
|
3040
|
+
}
|
|
3041
|
+
request.send(requestData || null);
|
|
3042
|
+
});
|
|
3043
|
+
};
|
|
3044
|
+
const composeSignals = (signals, timeout) => {
|
|
3045
|
+
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
3046
|
+
if (timeout || length) {
|
|
3047
|
+
let controller = new AbortController();
|
|
3048
|
+
let aborted;
|
|
3049
|
+
const onabort = function(reason) {
|
|
3050
|
+
if (!aborted) {
|
|
3051
|
+
aborted = true;
|
|
3052
|
+
unsubscribe();
|
|
3053
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
3054
|
+
controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
|
|
3055
|
+
}
|
|
3056
|
+
};
|
|
3057
|
+
let timer = timeout && setTimeout(() => {
|
|
3058
|
+
timer = null;
|
|
3059
|
+
onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
3060
|
+
}, timeout);
|
|
3061
|
+
const unsubscribe = () => {
|
|
3062
|
+
if (signals) {
|
|
3063
|
+
timer && clearTimeout(timer);
|
|
3064
|
+
timer = null;
|
|
3065
|
+
signals.forEach((signal2) => {
|
|
3066
|
+
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
3067
|
+
});
|
|
3068
|
+
signals = null;
|
|
3069
|
+
}
|
|
3070
|
+
};
|
|
3071
|
+
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
3072
|
+
const { signal } = controller;
|
|
3073
|
+
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
3074
|
+
return signal;
|
|
3075
|
+
}
|
|
3076
|
+
};
|
|
3077
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
3078
|
+
let len = chunk.byteLength;
|
|
3079
|
+
if (len < chunkSize) {
|
|
3080
|
+
yield chunk;
|
|
3081
|
+
return;
|
|
3082
|
+
}
|
|
3083
|
+
let pos = 0;
|
|
3084
|
+
let end;
|
|
3085
|
+
while (pos < len) {
|
|
3086
|
+
end = pos + chunkSize;
|
|
3087
|
+
yield chunk.slice(pos, end);
|
|
3088
|
+
pos = end;
|
|
3089
|
+
}
|
|
3090
|
+
};
|
|
3091
|
+
const readBytes = async function* (iterable, chunkSize) {
|
|
3092
|
+
for await (const chunk of readStream(iterable)) {
|
|
3093
|
+
yield* streamChunk(chunk, chunkSize);
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
const readStream = async function* (stream) {
|
|
3097
|
+
if (stream[Symbol.asyncIterator]) {
|
|
3098
|
+
yield* stream;
|
|
3099
|
+
return;
|
|
3100
|
+
}
|
|
3101
|
+
const reader = stream.getReader();
|
|
3102
|
+
try {
|
|
3103
|
+
for (; ; ) {
|
|
3104
|
+
const { done, value } = await reader.read();
|
|
3105
|
+
if (done) {
|
|
3106
|
+
break;
|
|
3107
|
+
}
|
|
3108
|
+
yield value;
|
|
3109
|
+
}
|
|
3110
|
+
} finally {
|
|
3111
|
+
await reader.cancel();
|
|
3112
|
+
}
|
|
3113
|
+
};
|
|
3114
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
3115
|
+
const iterator2 = readBytes(stream, chunkSize);
|
|
3116
|
+
let bytes = 0;
|
|
3117
|
+
let done;
|
|
3118
|
+
let _onFinish = (e) => {
|
|
3119
|
+
if (!done) {
|
|
3120
|
+
done = true;
|
|
3121
|
+
onFinish && onFinish(e);
|
|
3122
|
+
}
|
|
3123
|
+
};
|
|
3124
|
+
return new ReadableStream({
|
|
3125
|
+
async pull(controller) {
|
|
3126
|
+
try {
|
|
3127
|
+
const { done: done2, value } = await iterator2.next();
|
|
3128
|
+
if (done2) {
|
|
3129
|
+
_onFinish();
|
|
3130
|
+
controller.close();
|
|
3131
|
+
return;
|
|
3132
|
+
}
|
|
3133
|
+
let len = value.byteLength;
|
|
3134
|
+
if (onProgress) {
|
|
3135
|
+
let loadedBytes = bytes += len;
|
|
3136
|
+
onProgress(loadedBytes);
|
|
3137
|
+
}
|
|
3138
|
+
controller.enqueue(new Uint8Array(value));
|
|
3139
|
+
} catch (err) {
|
|
3140
|
+
_onFinish(err);
|
|
3141
|
+
throw err;
|
|
3142
|
+
}
|
|
3143
|
+
},
|
|
3144
|
+
cancel(reason) {
|
|
3145
|
+
_onFinish(reason);
|
|
3146
|
+
return iterator2.return();
|
|
3147
|
+
}
|
|
3148
|
+
}, {
|
|
3149
|
+
highWaterMark: 2
|
|
3150
|
+
});
|
|
3151
|
+
};
|
|
3152
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
3153
|
+
const { isFunction } = utils$1;
|
|
3154
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
3155
|
+
Request,
|
|
3156
|
+
Response
|
|
3157
|
+
}))(utils$1.global);
|
|
3158
|
+
const {
|
|
3159
|
+
ReadableStream: ReadableStream$1,
|
|
3160
|
+
TextEncoder
|
|
3161
|
+
} = utils$1.global;
|
|
3162
|
+
const test = (fn, ...args) => {
|
|
3163
|
+
try {
|
|
3164
|
+
return !!fn(...args);
|
|
3165
|
+
} catch (e) {
|
|
3166
|
+
return false;
|
|
3167
|
+
}
|
|
3168
|
+
};
|
|
3169
|
+
const factory = (env) => {
|
|
3170
|
+
env = utils$1.merge.call({
|
|
3171
|
+
skipUndefined: true
|
|
3172
|
+
}, globalFetchAPI, env);
|
|
3173
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
3174
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
3175
|
+
const isRequestSupported = isFunction(Request);
|
|
3176
|
+
const isResponseSupported = isFunction(Response);
|
|
3177
|
+
if (!isFetchSupported) {
|
|
3178
|
+
return false;
|
|
3179
|
+
}
|
|
3180
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
3181
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
3182
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
3183
|
+
let duplexAccessed = false;
|
|
3184
|
+
const hasContentType = new Request(platform.origin, {
|
|
3185
|
+
body: new ReadableStream$1(),
|
|
3186
|
+
method: "POST",
|
|
3187
|
+
get duplex() {
|
|
3188
|
+
duplexAccessed = true;
|
|
3189
|
+
return "half";
|
|
3190
|
+
}
|
|
3191
|
+
}).headers.has("Content-Type");
|
|
3192
|
+
return duplexAccessed && !hasContentType;
|
|
3193
|
+
});
|
|
3194
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
|
|
3195
|
+
const resolvers = {
|
|
3196
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
3197
|
+
};
|
|
3198
|
+
isFetchSupported && (() => {
|
|
3199
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
3200
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
3201
|
+
let method = res && res[type];
|
|
3202
|
+
if (method) {
|
|
3203
|
+
return method.call(res);
|
|
3204
|
+
}
|
|
3205
|
+
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
3206
|
+
});
|
|
3207
|
+
});
|
|
3208
|
+
})();
|
|
3209
|
+
const getBodyLength = async (body) => {
|
|
3210
|
+
if (body == null) {
|
|
3211
|
+
return 0;
|
|
3212
|
+
}
|
|
3213
|
+
if (utils$1.isBlob(body)) {
|
|
3214
|
+
return body.size;
|
|
3215
|
+
}
|
|
3216
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
3217
|
+
const _request = new Request(platform.origin, {
|
|
3218
|
+
method: "POST",
|
|
3219
|
+
body
|
|
3220
|
+
});
|
|
3221
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
3222
|
+
}
|
|
3223
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
3224
|
+
return body.byteLength;
|
|
3225
|
+
}
|
|
3226
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
3227
|
+
body = body + "";
|
|
3228
|
+
}
|
|
3229
|
+
if (utils$1.isString(body)) {
|
|
3230
|
+
return (await encodeText(body)).byteLength;
|
|
3231
|
+
}
|
|
3232
|
+
};
|
|
3233
|
+
const resolveBodyLength = async (headers, body) => {
|
|
3234
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
3235
|
+
return length == null ? getBodyLength(body) : length;
|
|
3236
|
+
};
|
|
3237
|
+
return async (config) => {
|
|
3238
|
+
let {
|
|
3239
|
+
url,
|
|
3240
|
+
method,
|
|
3241
|
+
data,
|
|
3242
|
+
signal,
|
|
3243
|
+
cancelToken,
|
|
3244
|
+
timeout,
|
|
3245
|
+
onDownloadProgress,
|
|
3246
|
+
onUploadProgress,
|
|
3247
|
+
responseType,
|
|
3248
|
+
headers,
|
|
3249
|
+
withCredentials = "same-origin",
|
|
3250
|
+
fetchOptions
|
|
3251
|
+
} = resolveConfig(config);
|
|
3252
|
+
let _fetch = envFetch || fetch;
|
|
3253
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
3254
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
3255
|
+
let request = null;
|
|
3256
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
3257
|
+
composedSignal.unsubscribe();
|
|
3258
|
+
});
|
|
3259
|
+
let requestContentLength;
|
|
3260
|
+
try {
|
|
3261
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
3262
|
+
let _request = new Request(url, {
|
|
3263
|
+
method: "POST",
|
|
3264
|
+
body: data,
|
|
3265
|
+
duplex: "half"
|
|
3266
|
+
});
|
|
3267
|
+
let contentTypeHeader;
|
|
3268
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
3269
|
+
headers.setContentType(contentTypeHeader);
|
|
3270
|
+
}
|
|
3271
|
+
if (_request.body) {
|
|
3272
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
3273
|
+
requestContentLength,
|
|
3274
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
3275
|
+
);
|
|
3276
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
if (!utils$1.isString(withCredentials)) {
|
|
3280
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
3281
|
+
}
|
|
3282
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
3283
|
+
const resolvedOptions = {
|
|
3284
|
+
...fetchOptions,
|
|
3285
|
+
signal: composedSignal,
|
|
3286
|
+
method: method.toUpperCase(),
|
|
3287
|
+
headers: headers.normalize().toJSON(),
|
|
3288
|
+
body: data,
|
|
3289
|
+
duplex: "half",
|
|
3290
|
+
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
3291
|
+
};
|
|
3292
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
3293
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
3294
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
3295
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
3296
|
+
const options = {};
|
|
3297
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
3298
|
+
options[prop] = response[prop];
|
|
3299
|
+
});
|
|
3300
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
3301
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
3302
|
+
responseContentLength,
|
|
3303
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
3304
|
+
) || [];
|
|
3305
|
+
response = new Response(
|
|
3306
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
3307
|
+
flush && flush();
|
|
3308
|
+
unsubscribe && unsubscribe();
|
|
3309
|
+
}),
|
|
3310
|
+
options
|
|
3311
|
+
);
|
|
3312
|
+
}
|
|
3313
|
+
responseType = responseType || "text";
|
|
3314
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
|
|
3315
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3316
|
+
return await new Promise((resolve, reject) => {
|
|
3317
|
+
settle(resolve, reject, {
|
|
3318
|
+
data: responseData,
|
|
3319
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
3320
|
+
status: response.status,
|
|
3321
|
+
statusText: response.statusText,
|
|
3322
|
+
config,
|
|
3323
|
+
request
|
|
3324
|
+
});
|
|
3325
|
+
});
|
|
3326
|
+
} catch (err) {
|
|
3327
|
+
unsubscribe && unsubscribe();
|
|
3328
|
+
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
3329
|
+
throw Object.assign(
|
|
3330
|
+
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
|
|
3331
|
+
{
|
|
3332
|
+
cause: err.cause || err
|
|
3333
|
+
}
|
|
3334
|
+
);
|
|
3335
|
+
}
|
|
3336
|
+
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
3337
|
+
}
|
|
3338
|
+
};
|
|
3339
|
+
};
|
|
3340
|
+
const seedCache = /* @__PURE__ */ new Map();
|
|
3341
|
+
const getFetch = (config) => {
|
|
3342
|
+
let env = config && config.env || {};
|
|
3343
|
+
const { fetch: fetch2, Request, Response } = env;
|
|
3344
|
+
const seeds = [
|
|
3345
|
+
Request,
|
|
3346
|
+
Response,
|
|
3347
|
+
fetch2
|
|
3348
|
+
];
|
|
3349
|
+
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
3350
|
+
while (i--) {
|
|
3351
|
+
seed = seeds[i];
|
|
3352
|
+
target = map.get(seed);
|
|
3353
|
+
target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
|
|
3354
|
+
map = target;
|
|
3355
|
+
}
|
|
3356
|
+
return target;
|
|
3357
|
+
};
|
|
3358
|
+
getFetch();
|
|
3359
|
+
const knownAdapters = {
|
|
3360
|
+
http: httpAdapter,
|
|
3361
|
+
xhr: xhrAdapter,
|
|
3362
|
+
fetch: {
|
|
3363
|
+
get: getFetch
|
|
3364
|
+
}
|
|
3365
|
+
};
|
|
3366
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
3367
|
+
if (fn) {
|
|
3368
|
+
try {
|
|
3369
|
+
Object.defineProperty(fn, "name", { value });
|
|
3370
|
+
} catch (e) {
|
|
3371
|
+
}
|
|
3372
|
+
Object.defineProperty(fn, "adapterName", { value });
|
|
3373
|
+
}
|
|
3374
|
+
});
|
|
3375
|
+
const renderReason = (reason) => `- ${reason}`;
|
|
3376
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
3377
|
+
function getAdapter$1(adapters2, config) {
|
|
3378
|
+
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
3379
|
+
const { length } = adapters2;
|
|
3380
|
+
let nameOrAdapter;
|
|
3381
|
+
let adapter;
|
|
3382
|
+
const rejectedReasons = {};
|
|
3383
|
+
for (let i = 0; i < length; i++) {
|
|
3384
|
+
nameOrAdapter = adapters2[i];
|
|
3385
|
+
let id;
|
|
3386
|
+
adapter = nameOrAdapter;
|
|
3387
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
3388
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
3389
|
+
if (adapter === void 0) {
|
|
3390
|
+
throw new AxiosError$1(`Unknown adapter '${id}'`);
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3394
|
+
break;
|
|
3395
|
+
}
|
|
3396
|
+
rejectedReasons[id || "#" + i] = adapter;
|
|
3397
|
+
}
|
|
3398
|
+
if (!adapter) {
|
|
3399
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
3400
|
+
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
3401
|
+
);
|
|
3402
|
+
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
3403
|
+
throw new AxiosError$1(
|
|
3404
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
3405
|
+
"ERR_NOT_SUPPORT"
|
|
3406
|
+
);
|
|
3407
|
+
}
|
|
3408
|
+
return adapter;
|
|
3409
|
+
}
|
|
3410
|
+
const adapters = {
|
|
3411
|
+
/**
|
|
3412
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
3413
|
+
* @type {Function}
|
|
3414
|
+
*/
|
|
3415
|
+
getAdapter: getAdapter$1,
|
|
3416
|
+
/**
|
|
3417
|
+
* Exposes all known adapters
|
|
3418
|
+
* @type {Object<string, Function|Object>}
|
|
3419
|
+
*/
|
|
3420
|
+
adapters: knownAdapters
|
|
3421
|
+
};
|
|
3422
|
+
function throwIfCancellationRequested(config) {
|
|
3423
|
+
if (config.cancelToken) {
|
|
3424
|
+
config.cancelToken.throwIfRequested();
|
|
3425
|
+
}
|
|
3426
|
+
if (config.signal && config.signal.aborted) {
|
|
3427
|
+
throw new CanceledError$1(null, config);
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
function dispatchRequest(config) {
|
|
3431
|
+
throwIfCancellationRequested(config);
|
|
3432
|
+
config.headers = AxiosHeaders$1.from(config.headers);
|
|
3433
|
+
config.data = transformData.call(
|
|
3434
|
+
config,
|
|
3435
|
+
config.transformRequest
|
|
3436
|
+
);
|
|
3437
|
+
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
3438
|
+
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
3439
|
+
}
|
|
3440
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
3441
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
3442
|
+
throwIfCancellationRequested(config);
|
|
3443
|
+
response.data = transformData.call(
|
|
3444
|
+
config,
|
|
3445
|
+
config.transformResponse,
|
|
3446
|
+
response
|
|
3447
|
+
);
|
|
3448
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
3449
|
+
return response;
|
|
3450
|
+
}, function onAdapterRejection(reason) {
|
|
3451
|
+
if (!isCancel$1(reason)) {
|
|
3452
|
+
throwIfCancellationRequested(config);
|
|
3453
|
+
if (reason && reason.response) {
|
|
3454
|
+
reason.response.data = transformData.call(
|
|
3455
|
+
config,
|
|
3456
|
+
config.transformResponse,
|
|
3457
|
+
reason.response
|
|
3458
|
+
);
|
|
3459
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
return Promise.reject(reason);
|
|
3463
|
+
});
|
|
3464
|
+
}
|
|
3465
|
+
const VERSION$1 = "1.13.2";
|
|
3466
|
+
const validators$1 = {};
|
|
3467
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
3468
|
+
validators$1[type] = function validator2(thing) {
|
|
3469
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
3470
|
+
};
|
|
3471
|
+
});
|
|
3472
|
+
const deprecatedWarnings = {};
|
|
3473
|
+
validators$1.transitional = function transitional(validator2, version, message) {
|
|
3474
|
+
function formatMessage(opt, desc) {
|
|
3475
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
3476
|
+
}
|
|
3477
|
+
return (value, opt, opts) => {
|
|
3478
|
+
if (validator2 === false) {
|
|
3479
|
+
throw new AxiosError$1(
|
|
3480
|
+
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
3481
|
+
AxiosError$1.ERR_DEPRECATED
|
|
3482
|
+
);
|
|
3483
|
+
}
|
|
3484
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
3485
|
+
deprecatedWarnings[opt] = true;
|
|
3486
|
+
console.warn(
|
|
3487
|
+
formatMessage(
|
|
3488
|
+
opt,
|
|
3489
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
3490
|
+
)
|
|
3491
|
+
);
|
|
3492
|
+
}
|
|
3493
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
3494
|
+
};
|
|
3495
|
+
};
|
|
3496
|
+
validators$1.spelling = function spelling(correctSpelling) {
|
|
3497
|
+
return (value, opt) => {
|
|
3498
|
+
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
3499
|
+
return true;
|
|
3500
|
+
};
|
|
3501
|
+
};
|
|
3502
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
3503
|
+
if (typeof options !== "object") {
|
|
3504
|
+
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
3505
|
+
}
|
|
3506
|
+
const keys = Object.keys(options);
|
|
3507
|
+
let i = keys.length;
|
|
3508
|
+
while (i-- > 0) {
|
|
3509
|
+
const opt = keys[i];
|
|
3510
|
+
const validator2 = schema[opt];
|
|
3511
|
+
if (validator2) {
|
|
3512
|
+
const value = options[opt];
|
|
3513
|
+
const result = value === void 0 || validator2(value, opt, options);
|
|
3514
|
+
if (result !== true) {
|
|
3515
|
+
throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
3516
|
+
}
|
|
3517
|
+
continue;
|
|
3518
|
+
}
|
|
3519
|
+
if (allowUnknown !== true) {
|
|
3520
|
+
throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
}
|
|
3524
|
+
const validator = {
|
|
3525
|
+
assertOptions,
|
|
3526
|
+
validators: validators$1
|
|
3527
|
+
};
|
|
3528
|
+
const validators = validator.validators;
|
|
3529
|
+
let Axios$1 = class Axios {
|
|
3530
|
+
constructor(instanceConfig) {
|
|
3531
|
+
this.defaults = instanceConfig || {};
|
|
3532
|
+
this.interceptors = {
|
|
3533
|
+
request: new InterceptorManager(),
|
|
3534
|
+
response: new InterceptorManager()
|
|
3535
|
+
};
|
|
3536
|
+
}
|
|
3537
|
+
/**
|
|
3538
|
+
* Dispatch a request
|
|
3539
|
+
*
|
|
3540
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
3541
|
+
* @param {?Object} config
|
|
3542
|
+
*
|
|
3543
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
3544
|
+
*/
|
|
3545
|
+
async request(configOrUrl, config) {
|
|
3546
|
+
try {
|
|
3547
|
+
return await this._request(configOrUrl, config);
|
|
3548
|
+
} catch (err) {
|
|
3549
|
+
if (err instanceof Error) {
|
|
3550
|
+
let dummy = {};
|
|
3551
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
3552
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
3553
|
+
try {
|
|
3554
|
+
if (!err.stack) {
|
|
3555
|
+
err.stack = stack;
|
|
3556
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
3557
|
+
err.stack += "\n" + stack;
|
|
3558
|
+
}
|
|
3559
|
+
} catch (e) {
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
throw err;
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
_request(configOrUrl, config) {
|
|
3566
|
+
if (typeof configOrUrl === "string") {
|
|
3567
|
+
config = config || {};
|
|
3568
|
+
config.url = configOrUrl;
|
|
3569
|
+
} else {
|
|
3570
|
+
config = configOrUrl || {};
|
|
3571
|
+
}
|
|
3572
|
+
config = mergeConfig$1(this.defaults, config);
|
|
3573
|
+
const { transitional: transitional2, paramsSerializer, headers } = config;
|
|
3574
|
+
if (transitional2 !== void 0) {
|
|
3575
|
+
validator.assertOptions(transitional2, {
|
|
3576
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
3577
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
3578
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
3579
|
+
}, false);
|
|
3580
|
+
}
|
|
3581
|
+
if (paramsSerializer != null) {
|
|
3582
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
3583
|
+
config.paramsSerializer = {
|
|
3584
|
+
serialize: paramsSerializer
|
|
3585
|
+
};
|
|
3586
|
+
} else {
|
|
3587
|
+
validator.assertOptions(paramsSerializer, {
|
|
3588
|
+
encode: validators.function,
|
|
3589
|
+
serialize: validators.function
|
|
3590
|
+
}, true);
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
if (config.allowAbsoluteUrls !== void 0) ;
|
|
3594
|
+
else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
3595
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
3596
|
+
} else {
|
|
3597
|
+
config.allowAbsoluteUrls = true;
|
|
3598
|
+
}
|
|
3599
|
+
validator.assertOptions(config, {
|
|
3600
|
+
baseUrl: validators.spelling("baseURL"),
|
|
3601
|
+
withXsrfToken: validators.spelling("withXSRFToken")
|
|
3602
|
+
}, true);
|
|
3603
|
+
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
3604
|
+
let contextHeaders = headers && utils$1.merge(
|
|
3605
|
+
headers.common,
|
|
3606
|
+
headers[config.method]
|
|
3607
|
+
);
|
|
3608
|
+
headers && utils$1.forEach(
|
|
3609
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
3610
|
+
(method) => {
|
|
3611
|
+
delete headers[method];
|
|
3612
|
+
}
|
|
3613
|
+
);
|
|
3614
|
+
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
3615
|
+
const requestInterceptorChain = [];
|
|
3616
|
+
let synchronousRequestInterceptors = true;
|
|
3617
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
3618
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
3619
|
+
return;
|
|
3620
|
+
}
|
|
3621
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
3622
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
3623
|
+
});
|
|
3624
|
+
const responseInterceptorChain = [];
|
|
3625
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
3626
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3627
|
+
});
|
|
3628
|
+
let promise;
|
|
3629
|
+
let i = 0;
|
|
3630
|
+
let len;
|
|
3631
|
+
if (!synchronousRequestInterceptors) {
|
|
3632
|
+
const chain = [dispatchRequest.bind(this), void 0];
|
|
3633
|
+
chain.unshift(...requestInterceptorChain);
|
|
3634
|
+
chain.push(...responseInterceptorChain);
|
|
3635
|
+
len = chain.length;
|
|
3636
|
+
promise = Promise.resolve(config);
|
|
3637
|
+
while (i < len) {
|
|
3638
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
3639
|
+
}
|
|
3640
|
+
return promise;
|
|
3641
|
+
}
|
|
3642
|
+
len = requestInterceptorChain.length;
|
|
3643
|
+
let newConfig = config;
|
|
3644
|
+
while (i < len) {
|
|
3645
|
+
const onFulfilled = requestInterceptorChain[i++];
|
|
3646
|
+
const onRejected = requestInterceptorChain[i++];
|
|
3647
|
+
try {
|
|
3648
|
+
newConfig = onFulfilled(newConfig);
|
|
3649
|
+
} catch (error) {
|
|
3650
|
+
onRejected.call(this, error);
|
|
3651
|
+
break;
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
try {
|
|
3655
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
3656
|
+
} catch (error) {
|
|
3657
|
+
return Promise.reject(error);
|
|
3658
|
+
}
|
|
3659
|
+
i = 0;
|
|
3660
|
+
len = responseInterceptorChain.length;
|
|
3661
|
+
while (i < len) {
|
|
3662
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
3663
|
+
}
|
|
3664
|
+
return promise;
|
|
3665
|
+
}
|
|
3666
|
+
getUri(config) {
|
|
3667
|
+
config = mergeConfig$1(this.defaults, config);
|
|
3668
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
3669
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
3670
|
+
}
|
|
3671
|
+
};
|
|
3672
|
+
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
3673
|
+
Axios$1.prototype[method] = function(url, config) {
|
|
3674
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
3675
|
+
method,
|
|
3676
|
+
url,
|
|
3677
|
+
data: (config || {}).data
|
|
3678
|
+
}));
|
|
3679
|
+
};
|
|
3680
|
+
});
|
|
3681
|
+
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
3682
|
+
function generateHTTPMethod(isForm) {
|
|
3683
|
+
return function httpMethod(url, data, config) {
|
|
3684
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
3685
|
+
method,
|
|
3686
|
+
headers: isForm ? {
|
|
3687
|
+
"Content-Type": "multipart/form-data"
|
|
3688
|
+
} : {},
|
|
3689
|
+
url,
|
|
3690
|
+
data
|
|
3691
|
+
}));
|
|
3692
|
+
};
|
|
3693
|
+
}
|
|
3694
|
+
Axios$1.prototype[method] = generateHTTPMethod();
|
|
3695
|
+
Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
3696
|
+
});
|
|
3697
|
+
let CancelToken$1 = class CancelToken {
|
|
3698
|
+
constructor(executor) {
|
|
3699
|
+
if (typeof executor !== "function") {
|
|
3700
|
+
throw new TypeError("executor must be a function.");
|
|
3701
|
+
}
|
|
3702
|
+
let resolvePromise;
|
|
3703
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
3704
|
+
resolvePromise = resolve;
|
|
3705
|
+
});
|
|
3706
|
+
const token = this;
|
|
3707
|
+
this.promise.then((cancel) => {
|
|
3708
|
+
if (!token._listeners) return;
|
|
3709
|
+
let i = token._listeners.length;
|
|
3710
|
+
while (i-- > 0) {
|
|
3711
|
+
token._listeners[i](cancel);
|
|
3712
|
+
}
|
|
3713
|
+
token._listeners = null;
|
|
3714
|
+
});
|
|
3715
|
+
this.promise.then = (onfulfilled) => {
|
|
3716
|
+
let _resolve;
|
|
3717
|
+
const promise = new Promise((resolve) => {
|
|
3718
|
+
token.subscribe(resolve);
|
|
3719
|
+
_resolve = resolve;
|
|
3720
|
+
}).then(onfulfilled);
|
|
3721
|
+
promise.cancel = function reject() {
|
|
3722
|
+
token.unsubscribe(_resolve);
|
|
3723
|
+
};
|
|
3724
|
+
return promise;
|
|
3725
|
+
};
|
|
3726
|
+
executor(function cancel(message, config, request) {
|
|
3727
|
+
if (token.reason) {
|
|
3728
|
+
return;
|
|
3729
|
+
}
|
|
3730
|
+
token.reason = new CanceledError$1(message, config, request);
|
|
3731
|
+
resolvePromise(token.reason);
|
|
3732
|
+
});
|
|
3733
|
+
}
|
|
3734
|
+
/**
|
|
3735
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
3736
|
+
*/
|
|
3737
|
+
throwIfRequested() {
|
|
3738
|
+
if (this.reason) {
|
|
3739
|
+
throw this.reason;
|
|
3740
|
+
}
|
|
3741
|
+
}
|
|
3742
|
+
/**
|
|
3743
|
+
* Subscribe to the cancel signal
|
|
3744
|
+
*/
|
|
3745
|
+
subscribe(listener) {
|
|
3746
|
+
if (this.reason) {
|
|
3747
|
+
listener(this.reason);
|
|
3748
|
+
return;
|
|
3749
|
+
}
|
|
3750
|
+
if (this._listeners) {
|
|
3751
|
+
this._listeners.push(listener);
|
|
3752
|
+
} else {
|
|
3753
|
+
this._listeners = [listener];
|
|
3754
|
+
}
|
|
3755
|
+
}
|
|
3756
|
+
/**
|
|
3757
|
+
* Unsubscribe from the cancel signal
|
|
3758
|
+
*/
|
|
3759
|
+
unsubscribe(listener) {
|
|
3760
|
+
if (!this._listeners) {
|
|
3761
|
+
return;
|
|
3762
|
+
}
|
|
3763
|
+
const index = this._listeners.indexOf(listener);
|
|
3764
|
+
if (index !== -1) {
|
|
3765
|
+
this._listeners.splice(index, 1);
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
toAbortSignal() {
|
|
3769
|
+
const controller = new AbortController();
|
|
3770
|
+
const abort = (err) => {
|
|
3771
|
+
controller.abort(err);
|
|
3772
|
+
};
|
|
3773
|
+
this.subscribe(abort);
|
|
3774
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
3775
|
+
return controller.signal;
|
|
3776
|
+
}
|
|
3777
|
+
/**
|
|
3778
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
3779
|
+
* cancels the `CancelToken`.
|
|
3780
|
+
*/
|
|
3781
|
+
static source() {
|
|
3782
|
+
let cancel;
|
|
3783
|
+
const token = new CancelToken(function executor(c) {
|
|
3784
|
+
cancel = c;
|
|
1250
3785
|
});
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
}));
|
|
1255
|
-
return (_ctx, _cache) => {
|
|
1256
|
-
return openBlock(), createElementBlock("div", {
|
|
1257
|
-
class: normalizeClass(rootClasses.value),
|
|
1258
|
-
"aria-disabled": __props.disabled ? "true" : void 0
|
|
1259
|
-
}, [
|
|
1260
|
-
(openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps(componentAttrs.value, {
|
|
1261
|
-
type: __props.as === "button" ? __props.type : void 0,
|
|
1262
|
-
disabled: __props.as === "button" ? __props.disabled : void 0,
|
|
1263
|
-
target: __props.as === "a" ? __props.target : void 0,
|
|
1264
|
-
rel: __props.as === "a" ? __props.rel : void 0,
|
|
1265
|
-
class: buttonClasses.value,
|
|
1266
|
-
onClick
|
|
1267
|
-
}), {
|
|
1268
|
-
default: withCtx(() => [
|
|
1269
|
-
__props.loading ? (openBlock(), createBlock(_sfc_main$p, {
|
|
1270
|
-
key: 0,
|
|
1271
|
-
class: "mr-2",
|
|
1272
|
-
size: "24px",
|
|
1273
|
-
color: "inherit"
|
|
1274
|
-
})) : __props.icon ? (openBlock(), createElementBlock("span", {
|
|
1275
|
-
key: 1,
|
|
1276
|
-
class: normalizeClass(iconOrderClasses.value),
|
|
1277
|
-
"aria-hidden": "true"
|
|
1278
|
-
}, [
|
|
1279
|
-
createVNode(_sfc_main$w, {
|
|
1280
|
-
class: normalizeClass(iconFillClass2.value),
|
|
1281
|
-
name: __props.icon,
|
|
1282
|
-
size: 24
|
|
1283
|
-
}, null, 8, ["class", "name"])
|
|
1284
|
-
], 2)) : createCommentVNode("", true),
|
|
1285
|
-
createElementVNode("span", _hoisted_2$e, toDisplayString(__props.text), 1)
|
|
1286
|
-
]),
|
|
1287
|
-
_: 1
|
|
1288
|
-
}, 16, ["type", "disabled", "target", "rel", "class"]))
|
|
1289
|
-
], 10, _hoisted_1$j);
|
|
3786
|
+
return {
|
|
3787
|
+
token,
|
|
3788
|
+
cancel
|
|
1290
3789
|
};
|
|
1291
3790
|
}
|
|
3791
|
+
};
|
|
3792
|
+
function spread$1(callback) {
|
|
3793
|
+
return function wrap(arr) {
|
|
3794
|
+
return callback.apply(null, arr);
|
|
3795
|
+
};
|
|
3796
|
+
}
|
|
3797
|
+
function isAxiosError$1(payload) {
|
|
3798
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
3799
|
+
}
|
|
3800
|
+
const HttpStatusCode$1 = {
|
|
3801
|
+
Continue: 100,
|
|
3802
|
+
SwitchingProtocols: 101,
|
|
3803
|
+
Processing: 102,
|
|
3804
|
+
EarlyHints: 103,
|
|
3805
|
+
Ok: 200,
|
|
3806
|
+
Created: 201,
|
|
3807
|
+
Accepted: 202,
|
|
3808
|
+
NonAuthoritativeInformation: 203,
|
|
3809
|
+
NoContent: 204,
|
|
3810
|
+
ResetContent: 205,
|
|
3811
|
+
PartialContent: 206,
|
|
3812
|
+
MultiStatus: 207,
|
|
3813
|
+
AlreadyReported: 208,
|
|
3814
|
+
ImUsed: 226,
|
|
3815
|
+
MultipleChoices: 300,
|
|
3816
|
+
MovedPermanently: 301,
|
|
3817
|
+
Found: 302,
|
|
3818
|
+
SeeOther: 303,
|
|
3819
|
+
NotModified: 304,
|
|
3820
|
+
UseProxy: 305,
|
|
3821
|
+
Unused: 306,
|
|
3822
|
+
TemporaryRedirect: 307,
|
|
3823
|
+
PermanentRedirect: 308,
|
|
3824
|
+
BadRequest: 400,
|
|
3825
|
+
Unauthorized: 401,
|
|
3826
|
+
PaymentRequired: 402,
|
|
3827
|
+
Forbidden: 403,
|
|
3828
|
+
NotFound: 404,
|
|
3829
|
+
MethodNotAllowed: 405,
|
|
3830
|
+
NotAcceptable: 406,
|
|
3831
|
+
ProxyAuthenticationRequired: 407,
|
|
3832
|
+
RequestTimeout: 408,
|
|
3833
|
+
Conflict: 409,
|
|
3834
|
+
Gone: 410,
|
|
3835
|
+
LengthRequired: 411,
|
|
3836
|
+
PreconditionFailed: 412,
|
|
3837
|
+
PayloadTooLarge: 413,
|
|
3838
|
+
UriTooLong: 414,
|
|
3839
|
+
UnsupportedMediaType: 415,
|
|
3840
|
+
RangeNotSatisfiable: 416,
|
|
3841
|
+
ExpectationFailed: 417,
|
|
3842
|
+
ImATeapot: 418,
|
|
3843
|
+
MisdirectedRequest: 421,
|
|
3844
|
+
UnprocessableEntity: 422,
|
|
3845
|
+
Locked: 423,
|
|
3846
|
+
FailedDependency: 424,
|
|
3847
|
+
TooEarly: 425,
|
|
3848
|
+
UpgradeRequired: 426,
|
|
3849
|
+
PreconditionRequired: 428,
|
|
3850
|
+
TooManyRequests: 429,
|
|
3851
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
3852
|
+
UnavailableForLegalReasons: 451,
|
|
3853
|
+
InternalServerError: 500,
|
|
3854
|
+
NotImplemented: 501,
|
|
3855
|
+
BadGateway: 502,
|
|
3856
|
+
ServiceUnavailable: 503,
|
|
3857
|
+
GatewayTimeout: 504,
|
|
3858
|
+
HttpVersionNotSupported: 505,
|
|
3859
|
+
VariantAlsoNegotiates: 506,
|
|
3860
|
+
InsufficientStorage: 507,
|
|
3861
|
+
LoopDetected: 508,
|
|
3862
|
+
NotExtended: 510,
|
|
3863
|
+
NetworkAuthenticationRequired: 511,
|
|
3864
|
+
WebServerIsDown: 521,
|
|
3865
|
+
ConnectionTimedOut: 522,
|
|
3866
|
+
OriginIsUnreachable: 523,
|
|
3867
|
+
TimeoutOccurred: 524,
|
|
3868
|
+
SslHandshakeFailed: 525,
|
|
3869
|
+
InvalidSslCertificate: 526
|
|
3870
|
+
};
|
|
3871
|
+
Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
|
|
3872
|
+
HttpStatusCode$1[value] = key;
|
|
1292
3873
|
});
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
3874
|
+
function createInstance(defaultConfig) {
|
|
3875
|
+
const context = new Axios$1(defaultConfig);
|
|
3876
|
+
const instance = bind(Axios$1.prototype.request, context);
|
|
3877
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
3878
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
3879
|
+
instance.create = function create(instanceConfig) {
|
|
3880
|
+
return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
|
|
3881
|
+
};
|
|
3882
|
+
return instance;
|
|
3883
|
+
}
|
|
3884
|
+
const axios = createInstance(defaults);
|
|
3885
|
+
axios.Axios = Axios$1;
|
|
3886
|
+
axios.CanceledError = CanceledError$1;
|
|
3887
|
+
axios.CancelToken = CancelToken$1;
|
|
3888
|
+
axios.isCancel = isCancel$1;
|
|
3889
|
+
axios.VERSION = VERSION$1;
|
|
3890
|
+
axios.toFormData = toFormData$1;
|
|
3891
|
+
axios.AxiosError = AxiosError$1;
|
|
3892
|
+
axios.Cancel = axios.CanceledError;
|
|
3893
|
+
axios.all = function all(promises) {
|
|
3894
|
+
return Promise.all(promises);
|
|
1296
3895
|
};
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
3896
|
+
axios.spread = spread$1;
|
|
3897
|
+
axios.isAxiosError = isAxiosError$1;
|
|
3898
|
+
axios.mergeConfig = mergeConfig$1;
|
|
3899
|
+
axios.AxiosHeaders = AxiosHeaders$1;
|
|
3900
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
3901
|
+
axios.getAdapter = adapters.getAdapter;
|
|
3902
|
+
axios.HttpStatusCode = HttpStatusCode$1;
|
|
3903
|
+
axios.default = axios;
|
|
3904
|
+
const {
|
|
3905
|
+
Axios: Axios2,
|
|
3906
|
+
AxiosError,
|
|
3907
|
+
CanceledError,
|
|
3908
|
+
isCancel,
|
|
3909
|
+
CancelToken: CancelToken2,
|
|
3910
|
+
VERSION,
|
|
3911
|
+
all: all2,
|
|
3912
|
+
Cancel,
|
|
3913
|
+
isAxiosError,
|
|
3914
|
+
spread,
|
|
3915
|
+
toFormData,
|
|
3916
|
+
AxiosHeaders: AxiosHeaders2,
|
|
3917
|
+
HttpStatusCode,
|
|
3918
|
+
formToJSON,
|
|
3919
|
+
getAdapter,
|
|
3920
|
+
mergeConfig
|
|
3921
|
+
} = axios;
|
|
3922
|
+
const HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
3923
|
+
const NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g;
|
|
3924
|
+
const QESC_REGEXP = /\\([\u0000-\u007f])/g;
|
|
3925
|
+
const PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g;
|
|
3926
|
+
const EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/;
|
|
3927
|
+
const DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;
|
|
3928
|
+
function decodefield(str) {
|
|
3929
|
+
const match = EXT_VALUE_REGEXP.exec(str);
|
|
3930
|
+
if (!match) {
|
|
3931
|
+
throw new TypeError("invalid extended field value");
|
|
3932
|
+
}
|
|
3933
|
+
const charset = match[1].toLowerCase();
|
|
3934
|
+
const encoded = match[2];
|
|
3935
|
+
let value;
|
|
3936
|
+
switch (charset) {
|
|
3937
|
+
case "iso-8859-1":
|
|
3938
|
+
value = getlatin1(encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode));
|
|
3939
|
+
break;
|
|
3940
|
+
case "utf-8":
|
|
1314
3941
|
try {
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
}
|
|
1319
|
-
} catch {
|
|
3942
|
+
value = decodeURIComponent(encoded);
|
|
3943
|
+
} catch (_a) {
|
|
3944
|
+
throw new TypeError("invalid encoded utf-8");
|
|
1320
3945
|
}
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
3946
|
+
break;
|
|
3947
|
+
default:
|
|
3948
|
+
throw new TypeError("unsupported charset in extended field");
|
|
3949
|
+
}
|
|
3950
|
+
return value;
|
|
3951
|
+
}
|
|
3952
|
+
function getlatin1(val) {
|
|
3953
|
+
return String(val).replace(NON_LATIN1_REGEXP, "?");
|
|
3954
|
+
}
|
|
3955
|
+
function parse(string) {
|
|
3956
|
+
if (!string || typeof string !== "string") {
|
|
3957
|
+
throw new TypeError("argument string is required");
|
|
3958
|
+
}
|
|
3959
|
+
let match = DISPOSITION_TYPE_REGEXP.exec(string);
|
|
3960
|
+
if (!match) {
|
|
3961
|
+
throw new TypeError("invalid type format");
|
|
3962
|
+
}
|
|
3963
|
+
let index = match[0].length;
|
|
3964
|
+
const type = match[1].toLowerCase();
|
|
3965
|
+
let key;
|
|
3966
|
+
const names = [];
|
|
3967
|
+
const params = {};
|
|
3968
|
+
let value;
|
|
3969
|
+
index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ";" ? index - 1 : index;
|
|
3970
|
+
while (match = PARAM_REGEXP.exec(string)) {
|
|
3971
|
+
if (match.index !== index) {
|
|
3972
|
+
throw new TypeError("invalid parameter format");
|
|
3973
|
+
}
|
|
3974
|
+
index += match[0].length;
|
|
3975
|
+
key = match[1].toLowerCase();
|
|
3976
|
+
value = match[2];
|
|
3977
|
+
if (names.indexOf(key) !== -1) {
|
|
3978
|
+
throw new TypeError("invalid duplicate parameter");
|
|
3979
|
+
}
|
|
3980
|
+
names.push(key);
|
|
3981
|
+
if (key.indexOf("*") + 1 === key.length) {
|
|
3982
|
+
key = key.slice(0, -1);
|
|
3983
|
+
value = decodefield(value);
|
|
3984
|
+
params[key] = value;
|
|
3985
|
+
continue;
|
|
3986
|
+
}
|
|
3987
|
+
if (typeof params[key] === "string") {
|
|
3988
|
+
continue;
|
|
3989
|
+
}
|
|
3990
|
+
if (value[0] === '"') {
|
|
3991
|
+
value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1");
|
|
3992
|
+
}
|
|
3993
|
+
params[key] = value;
|
|
3994
|
+
}
|
|
3995
|
+
if (index !== -1 && index !== string.length) {
|
|
3996
|
+
throw new TypeError("invalid parameter format");
|
|
3997
|
+
}
|
|
3998
|
+
return { type, parameters: params };
|
|
3999
|
+
}
|
|
4000
|
+
function pdecode(str, hex) {
|
|
4001
|
+
return String.fromCharCode(parseInt(hex, 16));
|
|
4002
|
+
}
|
|
4003
|
+
function useDownload() {
|
|
4004
|
+
const isDownloading = ref(false);
|
|
4005
|
+
const downloadFile = async (url, filename, token, headers) => {
|
|
4006
|
+
if (isDownloading.value) return;
|
|
4007
|
+
try {
|
|
4008
|
+
isDownloading.value = true;
|
|
4009
|
+
const requestHeaders = { ...headers };
|
|
4010
|
+
if (token && !requestHeaders.Authorization) {
|
|
4011
|
+
requestHeaders.Authorization = `Bearer ${token}`;
|
|
1333
4012
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
4013
|
+
const response = await axios.get(url, {
|
|
4014
|
+
responseType: "blob",
|
|
4015
|
+
...Object.keys(requestHeaders).length > 0 && { headers: requestHeaders }
|
|
4016
|
+
});
|
|
4017
|
+
const blob = new Blob([response.data], { type: response.data.type });
|
|
4018
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
4019
|
+
let finalFilename = filename;
|
|
4020
|
+
const contentDisposition = response.headers["content-disposition"] || response.headers["Content-Disposition"];
|
|
4021
|
+
if (contentDisposition) {
|
|
4022
|
+
try {
|
|
4023
|
+
const parsed = parse(contentDisposition);
|
|
4024
|
+
if (parsed.parameters?.filename) {
|
|
4025
|
+
finalFilename = decodeURIComponent(parsed.parameters.filename.replace(/\+/g, "%20"));
|
|
4026
|
+
}
|
|
4027
|
+
} catch {
|
|
1344
4028
|
}
|
|
1345
4029
|
}
|
|
1346
|
-
if (!
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
4030
|
+
if (!finalFilename) {
|
|
4031
|
+
finalFilename = url.substring(url.lastIndexOf("/") + 1) || "download";
|
|
4032
|
+
}
|
|
4033
|
+
const link = document.createElement("a");
|
|
4034
|
+
link.href = blobUrl;
|
|
4035
|
+
link.download = finalFilename;
|
|
4036
|
+
document.body.appendChild(link);
|
|
4037
|
+
link.click();
|
|
4038
|
+
setTimeout(() => {
|
|
4039
|
+
document.body.removeChild(link);
|
|
4040
|
+
URL.revokeObjectURL(blobUrl);
|
|
4041
|
+
}, 100);
|
|
4042
|
+
} catch (error) {
|
|
4043
|
+
console.error("Download failed:", error);
|
|
4044
|
+
throw error;
|
|
4045
|
+
} finally {
|
|
4046
|
+
isDownloading.value = false;
|
|
1352
4047
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
createVNode(_sfc_main$w, { name: "bigSuccess" }),
|
|
1362
|
-
createElementVNode("span", null, toDisplayString(props.copiedLabel), 1)
|
|
1363
|
-
])) : (openBlock(), createBlock(_sfc_main$o, {
|
|
1364
|
-
key: 1,
|
|
1365
|
-
type: "button",
|
|
1366
|
-
disabled: props.disabled,
|
|
1367
|
-
icon: "copy",
|
|
1368
|
-
text: isCopied.value ? props.copiedLabel : props.label,
|
|
1369
|
-
onClick
|
|
1370
|
-
}, null, 8, ["disabled", "text"]));
|
|
1371
|
-
};
|
|
1372
|
-
}
|
|
1373
|
-
});
|
|
1374
|
-
const _hoisted_1$h = ["disabled", "aria-disabled"];
|
|
1375
|
-
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
4048
|
+
};
|
|
4049
|
+
return {
|
|
4050
|
+
downloadFile,
|
|
4051
|
+
isDownloading
|
|
4052
|
+
};
|
|
4053
|
+
}
|
|
4054
|
+
const _hoisted_1$g = ["disabled", "aria-disabled"];
|
|
4055
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
1376
4056
|
__name: "FdsButtonDownload",
|
|
1377
4057
|
props: {
|
|
1378
4058
|
loading: { type: Boolean, default: false },
|
|
@@ -1387,7 +4067,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1387
4067
|
setup(__props, { emit: __emit }) {
|
|
1388
4068
|
const props = __props;
|
|
1389
4069
|
const emit = __emit;
|
|
1390
|
-
const isDownloading =
|
|
4070
|
+
const { downloadFile, isDownloading } = useDownload();
|
|
1391
4071
|
const elBase2 = computed(() => [
|
|
1392
4072
|
"inline-block transition-opacity duration-200 text-left",
|
|
1393
4073
|
"box-border appearance-none inline-flex items-center justify-center shadow-none p-0.5 text-base",
|
|
@@ -1408,7 +4088,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1408
4088
|
isDownloading.value ? "cursor-not-allowed text-gray-500" : "cursor-pointer text-blue-600"
|
|
1409
4089
|
]);
|
|
1410
4090
|
const iconFillClass2 = computed(() => isDownloading.value || props.disabled ? "fill-gray-500" : "fill-blue-500");
|
|
1411
|
-
async
|
|
4091
|
+
const handleDownload = async (ev) => {
|
|
1412
4092
|
if (props.disabled || props.loading || isDownloading.value) {
|
|
1413
4093
|
ev.preventDefault();
|
|
1414
4094
|
return;
|
|
@@ -1418,48 +4098,17 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1418
4098
|
return;
|
|
1419
4099
|
}
|
|
1420
4100
|
ev.preventDefault();
|
|
1421
|
-
isDownloading.value = true;
|
|
1422
4101
|
const options = props.downloadOptions;
|
|
1423
|
-
const
|
|
1424
|
-
|
|
4102
|
+
const headers = {};
|
|
4103
|
+
headers[options.headerAuthKey || "Authorization"] = `${options.headerAuthValuePrefix || "Bearer "}${options.token}`;
|
|
1425
4104
|
if (options.accept) {
|
|
1426
|
-
|
|
4105
|
+
headers.Accept = options.accept;
|
|
1427
4106
|
}
|
|
1428
4107
|
try {
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
if (!response.ok) {
|
|
1434
|
-
throw new Error(`Download failed: ${response.status} ${response.statusText}`);
|
|
1435
|
-
}
|
|
1436
|
-
const blob = await response.blob();
|
|
1437
|
-
const url = URL.createObjectURL(blob);
|
|
1438
|
-
const link = document.createElement("a");
|
|
1439
|
-
link.href = url;
|
|
1440
|
-
const contentDisposition = response.headers.get("content-disposition");
|
|
1441
|
-
let fileName = props.href.substring(props.href.lastIndexOf("/") + 1);
|
|
1442
|
-
if (contentDisposition) {
|
|
1443
|
-
const fileNameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
|
|
1444
|
-
if (fileNameMatch && fileNameMatch[1]) {
|
|
1445
|
-
fileName = fileNameMatch[1].replace(/['"]/g, "");
|
|
1446
|
-
fileName = fileName.replace(/\+/g, "%20");
|
|
1447
|
-
fileName = decodeURIComponent(fileName);
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
link.setAttribute("download", fileName);
|
|
1451
|
-
document.body.appendChild(link);
|
|
1452
|
-
link.dispatchEvent(
|
|
1453
|
-
new MouseEvent("click", {
|
|
1454
|
-
bubbles: true,
|
|
1455
|
-
cancelable: true,
|
|
1456
|
-
view: window
|
|
1457
|
-
})
|
|
1458
|
-
);
|
|
1459
|
-
setTimeout(() => {
|
|
1460
|
-
document.body.removeChild(link);
|
|
1461
|
-
URL.revokeObjectURL(url);
|
|
1462
|
-
}, 100);
|
|
4108
|
+
const url = props.href;
|
|
4109
|
+
const filename = void 0;
|
|
4110
|
+
const token = void 0;
|
|
4111
|
+
await downloadFile(url, filename, token, headers);
|
|
1463
4112
|
if (options.onFinishCallback) {
|
|
1464
4113
|
options.onFinishCallback();
|
|
1465
4114
|
}
|
|
@@ -1469,10 +4118,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1469
4118
|
} else {
|
|
1470
4119
|
throw error;
|
|
1471
4120
|
}
|
|
1472
|
-
} finally {
|
|
1473
|
-
isDownloading.value = false;
|
|
1474
4121
|
}
|
|
1475
|
-
}
|
|
4122
|
+
};
|
|
1476
4123
|
const onClick = (ev) => {
|
|
1477
4124
|
if (props.downloadOptions) {
|
|
1478
4125
|
handleDownload(ev);
|
|
@@ -1487,7 +4134,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1487
4134
|
return (_ctx, _cache) => {
|
|
1488
4135
|
return openBlock(), createElementBlock("button", {
|
|
1489
4136
|
class: normalizeClass(buttonClasses.value),
|
|
1490
|
-
disabled: __props.disabled || __props.loading || isDownloading
|
|
4137
|
+
disabled: __props.disabled || __props.loading || unref(isDownloading),
|
|
1491
4138
|
type: "button",
|
|
1492
4139
|
onClick,
|
|
1493
4140
|
"aria-disabled": __props.disabled ? "true" : void 0
|
|
@@ -1503,16 +4150,16 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1503
4150
|
}, null, 8, ["class"])
|
|
1504
4151
|
], 2),
|
|
1505
4152
|
createTextVNode(" " + toDisplayString(__props.text), 1)
|
|
1506
|
-
], 10, _hoisted_1$
|
|
4153
|
+
], 10, _hoisted_1$g);
|
|
1507
4154
|
};
|
|
1508
4155
|
}
|
|
1509
4156
|
});
|
|
1510
|
-
const _hoisted_1$
|
|
4157
|
+
const _hoisted_1$f = ["aria-disabled"];
|
|
1511
4158
|
const _hoisted_2$d = { key: 2 };
|
|
1512
4159
|
const elBase$1 = "box-border appearance-none inline-flex items-center justify-center cursor-pointer select-none w-full min-h-0 min-w-12 m-0 rounded-lg text-center align-middle whitespace-nowrap no-underline shadow-[0_2px_4px_rgba(12,72,153,0.12)] transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
1513
4160
|
const variantClasses$1 = "bg-red-600 border border-red-700 text-white hover:bg-red-700 active:bg-red-800 active:border-red-800";
|
|
1514
4161
|
const iconFillClass$1 = "fill-white";
|
|
1515
|
-
const _sfc_main$
|
|
4162
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
1516
4163
|
__name: "FdsButtonPrimary",
|
|
1517
4164
|
props: {
|
|
1518
4165
|
text: {},
|
|
@@ -1583,7 +4230,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
1583
4230
|
onClick
|
|
1584
4231
|
}), {
|
|
1585
4232
|
default: withCtx(() => [
|
|
1586
|
-
__props.loading ? (openBlock(), createBlock(_sfc_main$
|
|
4233
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1587
4234
|
key: 0,
|
|
1588
4235
|
size: "24px",
|
|
1589
4236
|
color: "inherit"
|
|
@@ -1602,16 +4249,16 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
1602
4249
|
]),
|
|
1603
4250
|
_: 1
|
|
1604
4251
|
}, 16, ["type", "disabled", "class"]))
|
|
1605
|
-
], 10, _hoisted_1$
|
|
4252
|
+
], 10, _hoisted_1$f);
|
|
1606
4253
|
};
|
|
1607
4254
|
}
|
|
1608
4255
|
});
|
|
1609
|
-
const _hoisted_1$
|
|
4256
|
+
const _hoisted_1$e = ["aria-disabled"];
|
|
1610
4257
|
const _hoisted_2$c = { key: 2 };
|
|
1611
4258
|
const elBase = "box-border appearance-none inline-flex items-center justify-center cursor-pointer select-none w-full min-h-0 min-w-12 m-0 rounded-lg text-center align-middle whitespace-nowrap no-underline shadow-[0_2px_4px_rgba(12,72,153,0.12)] transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
1612
4259
|
const variantClasses = "bg-white border-2 border-blue-500 text-blue-600 hover:border-blue-600 active:bg-blue-600 active:border-blue-600 active:text-white";
|
|
1613
4260
|
const iconFillClass = "fill-blue-500";
|
|
1614
|
-
const _sfc_main$
|
|
4261
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
1615
4262
|
__name: "FdsButtonSecondary",
|
|
1616
4263
|
props: {
|
|
1617
4264
|
text: {},
|
|
@@ -1682,7 +4329,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
1682
4329
|
onClick
|
|
1683
4330
|
}), {
|
|
1684
4331
|
default: withCtx(() => [
|
|
1685
|
-
__props.loading ? (openBlock(), createBlock(_sfc_main$
|
|
4332
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1686
4333
|
key: 0,
|
|
1687
4334
|
size: "24px",
|
|
1688
4335
|
color: "inherit"
|
|
@@ -1701,13 +4348,13 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
1701
4348
|
]),
|
|
1702
4349
|
_: 1
|
|
1703
4350
|
}, 16, ["type", "disabled", "class"]))
|
|
1704
|
-
], 10, _hoisted_1$
|
|
4351
|
+
], 10, _hoisted_1$e);
|
|
1705
4352
|
};
|
|
1706
4353
|
}
|
|
1707
4354
|
});
|
|
1708
|
-
const _hoisted_1$
|
|
4355
|
+
const _hoisted_1$d = { class: "flex justify-between mb-4" };
|
|
1709
4356
|
const _hoisted_2$b = { class: "mb-0-last-child" };
|
|
1710
|
-
const _sfc_main$
|
|
4357
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
1711
4358
|
__name: "FdsModal",
|
|
1712
4359
|
props: {
|
|
1713
4360
|
open: { type: Boolean, default: false },
|
|
@@ -1886,7 +4533,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
1886
4533
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
1887
4534
|
}, ["stop"]))
|
|
1888
4535
|
}, [
|
|
1889
|
-
createElementVNode("div", _hoisted_1$
|
|
4536
|
+
createElementVNode("div", _hoisted_1$d, [
|
|
1890
4537
|
createElementVNode("h3", {
|
|
1891
4538
|
tabindex: "-1",
|
|
1892
4539
|
class: normalizeClass(headerTitleClasses.value)
|
|
@@ -5092,47 +7739,34 @@ try {
|
|
|
5092
7739
|
globalThis.IMask = IMask;
|
|
5093
7740
|
} catch {
|
|
5094
7741
|
}
|
|
5095
|
-
const _hoisted_1$
|
|
7742
|
+
const _hoisted_1$c = ["for"];
|
|
5096
7743
|
const _hoisted_2$a = { class: "relative" };
|
|
5097
|
-
const _hoisted_3$7 = ["id", "type", "disabled", "required", "value", "aria-invalid"];
|
|
7744
|
+
const _hoisted_3$7 = ["id", "type", "disabled", "required", "value", "aria-invalid", "maxlength"];
|
|
5098
7745
|
const _hoisted_4$6 = {
|
|
5099
7746
|
key: 0,
|
|
5100
7747
|
class: "text-red-600 font-bold mt-1"
|
|
5101
7748
|
};
|
|
5102
|
-
const _sfc_main$
|
|
7749
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
5103
7750
|
...{
|
|
5104
7751
|
inheritAttrs: false
|
|
5105
7752
|
},
|
|
5106
7753
|
__name: "FdsInput",
|
|
5107
7754
|
props: /* @__PURE__ */ mergeModels({
|
|
5108
|
-
value: { default: void 0 },
|
|
5109
7755
|
label: { default: void 0 },
|
|
5110
|
-
|
|
7756
|
+
meta: { default: void 0 },
|
|
5111
7757
|
valid: { type: [Boolean, null], default: void 0 },
|
|
5112
7758
|
optional: { type: Boolean, default: false },
|
|
5113
7759
|
invalidMessage: {},
|
|
5114
|
-
required: { type: Boolean, default: false },
|
|
5115
7760
|
labelLeft: { type: Boolean, default: false },
|
|
5116
|
-
meta: { default: void 0 },
|
|
5117
|
-
type: { default: "text" },
|
|
5118
7761
|
clearButton: { type: Boolean, default: false },
|
|
5119
|
-
name: {},
|
|
5120
|
-
id: { default: void 0 },
|
|
5121
7762
|
passwordLabels: { default: void 0 },
|
|
5122
7763
|
locale: {},
|
|
5123
|
-
size: {},
|
|
5124
|
-
maxlength: {},
|
|
5125
7764
|
mask: { default: void 0 },
|
|
5126
|
-
maskOptions: { default: void 0 },
|
|
5127
7765
|
modelValue: {},
|
|
5128
|
-
modelModifiers: { default: () => ({}) },
|
|
5129
7766
|
onClearInput: {},
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
onChange: {},
|
|
5134
|
-
autocomplete: {},
|
|
5135
|
-
dataTestid: {}
|
|
7767
|
+
maskOptions: { default: void 0 },
|
|
7768
|
+
modelModifiers: { default: () => ({}) },
|
|
7769
|
+
value: { default: void 0 }
|
|
5136
7770
|
}, {
|
|
5137
7771
|
"modelValue": { default: void 0, required: false },
|
|
5138
7772
|
"modelModifiers": {}
|
|
@@ -5156,20 +7790,26 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5156
7790
|
const showPasswordToggle = computed(() => isPasswordType.value && internalValue.value.length > 0);
|
|
5157
7791
|
const wrapperClass = computed(() => attrs.class);
|
|
5158
7792
|
const inputClasses = computed(() => [
|
|
5159
|
-
"block
|
|
7793
|
+
"block rounded-md border border-gray-500 px-3 py-[calc(0.75rem-1px)]",
|
|
7794
|
+
props.maxlength ? "" : "w-full",
|
|
5160
7795
|
"focus:outline-2 focus:outline-blue-500 -outline-offset-2 focus:border-transparent",
|
|
5161
7796
|
props.disabled ? "outline-dashed outline-2 outline-gray-400 cursor-not-allowed border-transparent" : "bg-white",
|
|
5162
7797
|
isInvalid.value && "outline-2 outline-red-600"
|
|
5163
7798
|
]);
|
|
7799
|
+
const inputStyle = computed(() => {
|
|
7800
|
+
if (props.maxlength) {
|
|
7801
|
+
return {
|
|
7802
|
+
width: `calc(${props.maxlength}ch + 1.5rem + 0.25rem)`,
|
|
7803
|
+
maxWidth: "100%"
|
|
7804
|
+
};
|
|
7805
|
+
}
|
|
7806
|
+
return {};
|
|
7807
|
+
});
|
|
5164
7808
|
const validationIconClasses = computed(() => [
|
|
5165
7809
|
"absolute flex gap-2 right-4 top-1/2 -translate-y-1/2 flex items-center justify-end"
|
|
5166
7810
|
]);
|
|
5167
7811
|
const internalValue = computed({
|
|
5168
|
-
get: () =>
|
|
5169
|
-
// If modelValue is explicitly set (via v-model), use it
|
|
5170
|
-
// Otherwise fall back to value prop
|
|
5171
|
-
modelValue.value !== void 0 ? modelValue.value : props.value ?? ""
|
|
5172
|
-
),
|
|
7812
|
+
get: () => modelValue.value !== void 0 ? modelValue.value : props.value ?? "",
|
|
5173
7813
|
set: (newValue) => {
|
|
5174
7814
|
if (modelValue.value !== void 0) {
|
|
5175
7815
|
modelValue.value = newValue;
|
|
@@ -5270,7 +7910,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5270
7910
|
key: 0,
|
|
5271
7911
|
for: inputId.value,
|
|
5272
7912
|
class: normalizeClass(["block font-bold text-gray-900 cursor-pointer", { "mb-0": __props.meta, "mb-1": !__props.meta }])
|
|
5273
|
-
}, toDisplayString(__props.label), 11, _hoisted_1$
|
|
7913
|
+
}, toDisplayString(__props.label), 11, _hoisted_1$c)) : createCommentVNode("", true),
|
|
5274
7914
|
__props.meta ? (openBlock(), createElementBlock("div", {
|
|
5275
7915
|
key: 1,
|
|
5276
7916
|
class: normalizeClass(["font-thin", { "mb-1": !__props.labelLeft }])
|
|
@@ -5284,13 +7924,15 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5284
7924
|
ref_key: "inputRef",
|
|
5285
7925
|
ref: inputRef,
|
|
5286
7926
|
id: inputId.value,
|
|
5287
|
-
type: isPasswordType.value ? showPassword.value ? "text" : "password" :
|
|
5288
|
-
disabled:
|
|
5289
|
-
required:
|
|
7927
|
+
type: isPasswordType.value ? showPassword.value ? "text" : "password" : _ctx.type,
|
|
7928
|
+
disabled: _ctx.disabled,
|
|
7929
|
+
required: _ctx.required,
|
|
5290
7930
|
value: internalValue.value,
|
|
5291
7931
|
"aria-invalid": __props.valid === false ? "true" : void 0,
|
|
5292
|
-
class: inputClasses.value
|
|
7932
|
+
class: inputClasses.value,
|
|
7933
|
+
style: inputStyle.value
|
|
5293
7934
|
}, inputAttrs.value, {
|
|
7935
|
+
maxlength: _ctx.maxlength,
|
|
5294
7936
|
onInput: handleInputChange,
|
|
5295
7937
|
onChange: handleInputChange,
|
|
5296
7938
|
onBlur: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("blur", $event)),
|
|
@@ -5311,11 +7953,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5311
7953
|
key: 1,
|
|
5312
7954
|
name: "bigSuccess"
|
|
5313
7955
|
})) : createCommentVNode("", true),
|
|
5314
|
-
__props.clearButton && !!internalValue.value && !
|
|
7956
|
+
__props.clearButton && !!internalValue.value && !_ctx.disabled ? (openBlock(), createBlock(_sfc_main$v, mergeProps({
|
|
5315
7957
|
key: 2,
|
|
5316
7958
|
icon: "cross"
|
|
5317
7959
|
}, { "aria-label": clearButtonLabel.value }, { onClick: onClear }), null, 16)) : createCommentVNode("", true),
|
|
5318
|
-
showPasswordToggle.value ? (openBlock(), createBlock(_sfc_main$
|
|
7960
|
+
showPasswordToggle.value ? (openBlock(), createBlock(_sfc_main$n, {
|
|
5319
7961
|
key: 3,
|
|
5320
7962
|
icon: showPassword.value ? "viewOff" : "viewOn",
|
|
5321
7963
|
text: "",
|
|
@@ -5330,12 +7972,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5330
7972
|
};
|
|
5331
7973
|
}
|
|
5332
7974
|
});
|
|
5333
|
-
const _hoisted_1$
|
|
7975
|
+
const _hoisted_1$b = ["id"];
|
|
5334
7976
|
const _hoisted_2$9 = { class: "flex items-center justify-start gap-1 w-[100px]" };
|
|
5335
7977
|
const _hoisted_3$6 = { class: "flex items-center justify-center w-auto gap-2 order-0 sm:order-0" };
|
|
5336
7978
|
const _hoisted_4$5 = { class: "whitespace-nowrap" };
|
|
5337
7979
|
const _hoisted_5$5 = { class: "flex items-center justify-end gap-1 order-2 sm:order-0 w-[100px]" };
|
|
5338
|
-
const _sfc_main$
|
|
7980
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
5339
7981
|
__name: "FdsPagination",
|
|
5340
7982
|
props: {
|
|
5341
7983
|
id: { default: void 0 },
|
|
@@ -5419,7 +8061,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5419
8061
|
id: inputId.value
|
|
5420
8062
|
}, [
|
|
5421
8063
|
createElementVNode("div", _hoisted_2$9, [
|
|
5422
|
-
__props.loading && loadingIndicator.value === "start" ? (openBlock(), createBlock(_sfc_main$
|
|
8064
|
+
__props.loading && loadingIndicator.value === "start" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
5423
8065
|
key: 0,
|
|
5424
8066
|
size: "32px",
|
|
5425
8067
|
color: "blue"
|
|
@@ -5430,7 +8072,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5430
8072
|
class: [{ "hidden!": __props.current === 1 }, "w-8 h-8 sm:w-12 sm:h-12"],
|
|
5431
8073
|
onClick: _cache[0] || (_cache[0] = ($event) => handlePagination("start"))
|
|
5432
8074
|
}), null, 16, ["disabled", "class"])),
|
|
5433
|
-
__props.loading && loadingIndicator.value === "prev" ? (openBlock(), createBlock(_sfc_main$
|
|
8075
|
+
__props.loading && loadingIndicator.value === "prev" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
5434
8076
|
key: 2,
|
|
5435
8077
|
size: "24px",
|
|
5436
8078
|
color: "blue"
|
|
@@ -5443,14 +8085,14 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5443
8085
|
}), null, 16, ["disabled", "class"]))
|
|
5444
8086
|
]),
|
|
5445
8087
|
createElementVNode("div", _hoisted_3$6, [
|
|
5446
|
-
__props.loading && loadingIndicator.value === "input" ? (openBlock(), createBlock(_sfc_main$
|
|
8088
|
+
__props.loading && loadingIndicator.value === "input" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
5447
8089
|
key: 0,
|
|
5448
8090
|
size: "24px",
|
|
5449
8091
|
color: "blue",
|
|
5450
8092
|
label: "Laddar",
|
|
5451
8093
|
"label-position": "right"
|
|
5452
8094
|
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
5453
|
-
createVNode(_sfc_main$
|
|
8095
|
+
createVNode(_sfc_main$h, {
|
|
5454
8096
|
value: inputValue.value,
|
|
5455
8097
|
type: "text",
|
|
5456
8098
|
size: __props.max.toString().length,
|
|
@@ -5462,7 +8104,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5462
8104
|
], 64))
|
|
5463
8105
|
]),
|
|
5464
8106
|
createElementVNode("div", _hoisted_5$5, [
|
|
5465
|
-
__props.loading && loadingIndicator.value === "next" ? (openBlock(), createBlock(_sfc_main$
|
|
8107
|
+
__props.loading && loadingIndicator.value === "next" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
5466
8108
|
key: 0,
|
|
5467
8109
|
size: "24px",
|
|
5468
8110
|
color: "blue"
|
|
@@ -5475,7 +8117,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5475
8117
|
class: [{ "hidden!": __props.current === __props.max }, "w-8 h-8 sm:w-12 sm:h-12"],
|
|
5476
8118
|
onClick: _cache[2] || (_cache[2] = ($event) => handlePagination("next"))
|
|
5477
8119
|
}), null, 16, ["disabled", "class"])),
|
|
5478
|
-
__props.loading && loadingIndicator.value === "end" ? (openBlock(), createBlock(_sfc_main$
|
|
8120
|
+
__props.loading && loadingIndicator.value === "end" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
5479
8121
|
key: 2,
|
|
5480
8122
|
size: "24px",
|
|
5481
8123
|
color: "blue"
|
|
@@ -5489,7 +8131,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5489
8131
|
onClick: _cache[3] || (_cache[3] = ($event) => handlePagination("end"))
|
|
5490
8132
|
}), null, 16, ["disabled", "class"]))
|
|
5491
8133
|
])
|
|
5492
|
-
], 8, _hoisted_1$
|
|
8134
|
+
], 8, _hoisted_1$b);
|
|
5493
8135
|
};
|
|
5494
8136
|
}
|
|
5495
8137
|
});
|
|
@@ -5532,7 +8174,7 @@ function useIsPid(value) {
|
|
|
5532
8174
|
isPid
|
|
5533
8175
|
};
|
|
5534
8176
|
}
|
|
5535
|
-
const _hoisted_1$
|
|
8177
|
+
const _hoisted_1$a = { class: "relative block" };
|
|
5536
8178
|
const _hoisted_2$8 = {
|
|
5537
8179
|
key: 0,
|
|
5538
8180
|
class: "relative"
|
|
@@ -5560,7 +8202,7 @@ const _hoisted_12 = {
|
|
|
5560
8202
|
class: "block m-0 list-none p-0"
|
|
5561
8203
|
};
|
|
5562
8204
|
const _hoisted_13 = { class: "p-4" };
|
|
5563
|
-
const _sfc_main$
|
|
8205
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
5564
8206
|
__name: "FdsSearchSelect",
|
|
5565
8207
|
props: {
|
|
5566
8208
|
items: { default: () => [] },
|
|
@@ -5937,10 +8579,10 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5937
8579
|
ref: componentRef,
|
|
5938
8580
|
class: "fds-search-select block mb-6"
|
|
5939
8581
|
}, [
|
|
5940
|
-
createElementVNode("div", _hoisted_1$
|
|
8582
|
+
createElementVNode("div", _hoisted_1$a, [
|
|
5941
8583
|
!singleItemName.value.length ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
5942
8584
|
createElementVNode("div", _hoisted_3$5, [
|
|
5943
|
-
createVNode(_sfc_main$
|
|
8585
|
+
createVNode(_sfc_main$h, {
|
|
5944
8586
|
label: __props.label,
|
|
5945
8587
|
meta: __props.meta ?? void 0,
|
|
5946
8588
|
labelLeft: __props.labelLeft,
|
|
@@ -5978,7 +8620,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5978
8620
|
"aria-controls": "select-dropdown"
|
|
5979
8621
|
}, [
|
|
5980
8622
|
__props.loading ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
|
|
5981
|
-
createVNode(_sfc_main$
|
|
8623
|
+
createVNode(_sfc_main$o, {
|
|
5982
8624
|
color: "blue",
|
|
5983
8625
|
size: "48px"
|
|
5984
8626
|
})
|
|
@@ -6022,7 +8664,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6022
8664
|
], 42, _hoisted_9$2);
|
|
6023
8665
|
}), 128))
|
|
6024
8666
|
], 32),
|
|
6025
|
-
__props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (openBlock(), createBlock(_sfc_main$
|
|
8667
|
+
__props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (openBlock(), createBlock(_sfc_main$g, {
|
|
6026
8668
|
key: 2,
|
|
6027
8669
|
current: __props.page,
|
|
6028
8670
|
max: totalPages.value,
|
|
@@ -6038,51 +8680,6 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6038
8680
|
};
|
|
6039
8681
|
}
|
|
6040
8682
|
});
|
|
6041
|
-
const _hoisted_1$a = ["aria-live"];
|
|
6042
|
-
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
6043
|
-
__name: "FdsSticker",
|
|
6044
|
-
props: {
|
|
6045
|
-
variant: { default: "blue" },
|
|
6046
|
-
bullet: { type: Boolean, default: false },
|
|
6047
|
-
ariaLive: { default: void 0 }
|
|
6048
|
-
},
|
|
6049
|
-
setup(__props) {
|
|
6050
|
-
const props = __props;
|
|
6051
|
-
const stickerClasses = computed(() => [
|
|
6052
|
-
"inline-block font-bold text-sm leading-[18px] tracking-normal py-0.5 px-3 rounded-xl border border-transparent whitespace-nowrap max-w-full",
|
|
6053
|
-
props.bullet ? "text-base! bg-transparent flex-wrap justify-start items-baseline text-base font-normal text-gray-700 border-transparent p-0 mr-3" : "",
|
|
6054
|
-
// Variant colors
|
|
6055
|
-
props.variant === "blue" && !props.bullet && "bg-blue-600 text-white",
|
|
6056
|
-
props.variant === "green" && !props.bullet && "bg-green-700 text-white",
|
|
6057
|
-
props.variant === "red" && !props.bullet && "bg-red-600 text-white",
|
|
6058
|
-
props.variant === "yellow" && !props.bullet && "bg-yellow-200 text-gray-700 border-yellow-300",
|
|
6059
|
-
props.variant === "gray" && !props.bullet && "bg-gray-200 text-gray-700 border-gray-300!",
|
|
6060
|
-
props.variant === "t_blue" && !props.bullet && "bg-blue_t-100 text-gray-700 border-blue_t-200!"
|
|
6061
|
-
]);
|
|
6062
|
-
const bulletDotClasses = computed(() => [
|
|
6063
|
-
"inline-block w-3 h-3 rounded-full mr-1.5",
|
|
6064
|
-
// Bullet dot colors
|
|
6065
|
-
props.variant === "blue" && "bg-blue-600",
|
|
6066
|
-
props.variant === "green" && "bg-green-700",
|
|
6067
|
-
props.variant === "red" && "bg-red-600",
|
|
6068
|
-
props.variant === "yellow" && "bg-yellow-200 border border-yellow-300",
|
|
6069
|
-
props.variant === "gray" && "bg-gray-400",
|
|
6070
|
-
props.variant === "t_blue" && "bg-blue-200 border border-blue-300"
|
|
6071
|
-
]);
|
|
6072
|
-
return (_ctx, _cache) => {
|
|
6073
|
-
return openBlock(), createElementBlock("span", {
|
|
6074
|
-
class: normalizeClass(stickerClasses.value),
|
|
6075
|
-
"aria-live": __props.ariaLive
|
|
6076
|
-
}, [
|
|
6077
|
-
__props.bullet ? (openBlock(), createElementBlock("span", {
|
|
6078
|
-
key: 0,
|
|
6079
|
-
class: normalizeClass(bulletDotClasses.value)
|
|
6080
|
-
}, null, 2)) : createCommentVNode("", true),
|
|
6081
|
-
renderSlot(_ctx.$slots, "default")
|
|
6082
|
-
], 10, _hoisted_1$a);
|
|
6083
|
-
};
|
|
6084
|
-
}
|
|
6085
|
-
});
|
|
6086
8683
|
const getTitleFromProperties = (node, titleTemplate) => {
|
|
6087
8684
|
if (!titleTemplate) {
|
|
6088
8685
|
return node.title;
|
|
@@ -6492,17 +9089,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6492
9089
|
__name: "FdsCheckbox",
|
|
6493
9090
|
props: /* @__PURE__ */ mergeModels({
|
|
6494
9091
|
label: { default: void 0 },
|
|
6495
|
-
checked: { type: Boolean, default: false },
|
|
6496
9092
|
indeterminate: { type: Boolean, default: false },
|
|
6497
|
-
disabled: { type: Boolean, default: false },
|
|
6498
|
-
value: { default: void 0 },
|
|
6499
|
-
name: { default: void 0 },
|
|
6500
|
-
id: { default: void 0 },
|
|
6501
|
-
required: { type: Boolean, default: false },
|
|
6502
9093
|
modelValue: { type: [Boolean, Array] },
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
dataTestid: {}
|
|
9094
|
+
checked: { type: Boolean, default: false },
|
|
9095
|
+
value: { default: void 0 }
|
|
6506
9096
|
}, {
|
|
6507
9097
|
"modelValue": { type: [Boolean, Array], ...{
|
|
6508
9098
|
default: void 0,
|
|
@@ -6533,12 +9123,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6533
9123
|
const internalChecked = computed({
|
|
6534
9124
|
get: () => {
|
|
6535
9125
|
if (modelValue.value === void 0) {
|
|
6536
|
-
return props.checked;
|
|
9126
|
+
return props.checked ?? false;
|
|
6537
9127
|
}
|
|
6538
9128
|
if (Array.isArray(modelValue.value)) {
|
|
6539
|
-
|
|
9129
|
+
const val = props.value;
|
|
9130
|
+
if (val === void 0) return false;
|
|
9131
|
+
return modelValue.value.includes(val);
|
|
6540
9132
|
}
|
|
6541
|
-
return modelValue.value;
|
|
9133
|
+
return Boolean(modelValue.value);
|
|
6542
9134
|
},
|
|
6543
9135
|
set: (checked) => {
|
|
6544
9136
|
if (modelValue.value === void 0) {
|
|
@@ -6596,15 +9188,15 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6596
9188
|
}, [
|
|
6597
9189
|
createElementVNode("label", mergeProps({
|
|
6598
9190
|
for: inputId.value,
|
|
6599
|
-
class: [innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9191
|
+
class: [innerWrapperClasses.value, { "cursor-not-allowed": _ctx.disabled }]
|
|
6600
9192
|
}, _ctx.$attrs), [
|
|
6601
9193
|
withDirectives(createElementVNode("input", {
|
|
6602
9194
|
id: inputId.value,
|
|
6603
|
-
name:
|
|
9195
|
+
name: _ctx.name,
|
|
6604
9196
|
value: __props.value,
|
|
6605
9197
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalChecked.value = $event),
|
|
6606
|
-
disabled:
|
|
6607
|
-
required:
|
|
9198
|
+
disabled: _ctx.disabled,
|
|
9199
|
+
required: _ctx.required,
|
|
6608
9200
|
type: "checkbox",
|
|
6609
9201
|
class: normalizeClass([checkboxClasses.value])
|
|
6610
9202
|
}, null, 10, _hoisted_2$7), [
|
|
@@ -6612,7 +9204,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6612
9204
|
]),
|
|
6613
9205
|
unref(hasLabelSlot) || __props.label ? (openBlock(), createElementBlock("span", {
|
|
6614
9206
|
key: 0,
|
|
6615
|
-
class: normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9207
|
+
class: normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": _ctx.disabled }])
|
|
6616
9208
|
}, [
|
|
6617
9209
|
unref(hasLabelSlot) ? renderSlot(_ctx.$slots, "default", { key: 0 }) : __props.label ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
6618
9210
|
createTextVNode(toDisplayString(__props.label), 1)
|
|
@@ -6632,17 +9224,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6632
9224
|
__name: "FdsRadio",
|
|
6633
9225
|
props: /* @__PURE__ */ mergeModels({
|
|
6634
9226
|
label: { default: void 0 },
|
|
6635
|
-
checked: { type: Boolean, default: false },
|
|
6636
|
-
disabled: { type: Boolean, default: false },
|
|
6637
|
-
value: { default: void 0 },
|
|
6638
|
-
name: { default: void 0 },
|
|
6639
|
-
id: { default: void 0 },
|
|
6640
|
-
required: { type: Boolean, default: false },
|
|
6641
9227
|
modelValue: {},
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
onChange: {},
|
|
6645
|
-
onInput: {}
|
|
9228
|
+
checked: { type: Boolean, default: false },
|
|
9229
|
+
value: { default: void 0 }
|
|
6646
9230
|
}, {
|
|
6647
9231
|
"modelValue": { default: void 0, required: false },
|
|
6648
9232
|
"modelModifiers": {}
|
|
@@ -6686,15 +9270,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6686
9270
|
}, [
|
|
6687
9271
|
createElementVNode("label", {
|
|
6688
9272
|
for: inputId.value,
|
|
6689
|
-
class: normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9273
|
+
class: normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed": _ctx.disabled }])
|
|
6690
9274
|
}, [
|
|
6691
9275
|
withDirectives(createElementVNode("input", mergeProps(inputAttrs.value, {
|
|
6692
9276
|
id: inputId.value,
|
|
6693
|
-
name:
|
|
9277
|
+
name: _ctx.name,
|
|
6694
9278
|
value: __props.value,
|
|
6695
9279
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => radioModel.value = $event),
|
|
6696
|
-
disabled:
|
|
6697
|
-
required:
|
|
9280
|
+
disabled: _ctx.disabled,
|
|
9281
|
+
required: _ctx.required,
|
|
6698
9282
|
type: "radio",
|
|
6699
9283
|
class: [inputClasses.value, "m-[2px]"]
|
|
6700
9284
|
}), null, 16, _hoisted_2$6), [
|
|
@@ -6702,7 +9286,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6702
9286
|
]),
|
|
6703
9287
|
unref(hasLabelSlot) || __props.label ? (openBlock(), createElementBlock("span", {
|
|
6704
9288
|
key: 0,
|
|
6705
|
-
class: normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9289
|
+
class: normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": _ctx.disabled }])
|
|
6706
9290
|
}, [
|
|
6707
9291
|
unref(hasLabelSlot) ? renderSlot(_ctx.$slots, "default", { key: 0 }) : __props.label ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
6708
9292
|
createTextVNode(toDisplayString(__props.label), 1)
|
|
@@ -7198,7 +9782,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
7198
9782
|
ref: searchContainerRef,
|
|
7199
9783
|
class: "pb-4"
|
|
7200
9784
|
}, [
|
|
7201
|
-
createVNode(_sfc_main$
|
|
9785
|
+
createVNode(_sfc_main$h, {
|
|
7202
9786
|
value: unref(treeState)?.searchTerm?.value ?? "",
|
|
7203
9787
|
onInput: _cache[0] || (_cache[0] = ($event) => unref(treeState)?.setSearchTerm($event.target.value)),
|
|
7204
9788
|
class: "w-full",
|
|
@@ -7335,7 +9919,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7335
9919
|
class: normalizeClass([contentClasses.value, { open: isOpen.value }]),
|
|
7336
9920
|
style: normalizeStyle({ maxWidth: `${containerWidth.value}px` })
|
|
7337
9921
|
}, toDisplayString(__props.content), 7)),
|
|
7338
|
-
shouldShowButton.value ? (openBlock(), createBlock(_sfc_main$
|
|
9922
|
+
shouldShowButton.value ? (openBlock(), createBlock(_sfc_main$n, {
|
|
7339
9923
|
key: 2,
|
|
7340
9924
|
icon: isOpen.value ? "arrowUp" : "arrowDown",
|
|
7341
9925
|
iconPos: "right",
|
|
@@ -7368,20 +9952,14 @@ const _hoisted_9 = {
|
|
|
7368
9952
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
7369
9953
|
__name: "FdsSelect",
|
|
7370
9954
|
props: /* @__PURE__ */ mergeModels({
|
|
7371
|
-
value: { default: void 0 },
|
|
7372
9955
|
label: { default: void 0 },
|
|
7373
|
-
modelValue: {},
|
|
7374
9956
|
meta: { default: void 0 },
|
|
7375
|
-
disabled: { type: Boolean, default: false },
|
|
7376
9957
|
optional: { type: Boolean, default: false },
|
|
7377
9958
|
valid: { type: [Boolean, null], default: void 0 },
|
|
7378
9959
|
invalidMessage: { default: void 0 },
|
|
7379
|
-
name: { default: void 0 },
|
|
7380
|
-
id: { default: void 0 },
|
|
7381
|
-
placeholder: { default: void 0 },
|
|
7382
9960
|
options: { default: void 0 },
|
|
7383
|
-
|
|
7384
|
-
|
|
9961
|
+
modelValue: {},
|
|
9962
|
+
value: { default: void 0 }
|
|
7385
9963
|
}, {
|
|
7386
9964
|
"modelValue": { default: void 0, required: false },
|
|
7387
9965
|
"modelModifiers": {}
|
|
@@ -7430,8 +10008,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
7430
10008
|
createElementVNode("div", _hoisted_4$2, [
|
|
7431
10009
|
withDirectives(createElementVNode("select", mergeProps({
|
|
7432
10010
|
id: selectId.value,
|
|
7433
|
-
name:
|
|
7434
|
-
disabled:
|
|
10011
|
+
name: _ctx.name || void 0,
|
|
10012
|
+
disabled: _ctx.disabled,
|
|
7435
10013
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalValue.value = $event),
|
|
7436
10014
|
"aria-invalid": __props.valid === false ? "true" : void 0,
|
|
7437
10015
|
class: selectClasses.value
|
|
@@ -7439,7 +10017,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
7439
10017
|
onChange: handleChange,
|
|
7440
10018
|
onInput: _cache[1] || (_cache[1] = (e) => emit("input", e))
|
|
7441
10019
|
}), [
|
|
7442
|
-
|
|
10020
|
+
_ctx.placeholder && !hasDefaultSlot.value ? (openBlock(), createElementBlock("option", _hoisted_6, toDisplayString(_ctx.placeholder), 1)) : createCommentVNode("", true),
|
|
7443
10021
|
!hasDefaultSlot.value && __props.options ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.options, (option) => {
|
|
7444
10022
|
return openBlock(), createElementBlock("option", {
|
|
7445
10023
|
key: option.value,
|
|
@@ -7455,9 +10033,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
7455
10033
|
name: "arrowDown",
|
|
7456
10034
|
size: 24,
|
|
7457
10035
|
class: normalizeClass({
|
|
7458
|
-
"fill-gray-500":
|
|
7459
|
-
"fill-red-500": isInvalid.value && !
|
|
7460
|
-
"fill-blue-500": !
|
|
10036
|
+
"fill-gray-500": _ctx.disabled,
|
|
10037
|
+
"fill-red-500": isInvalid.value && !_ctx.disabled,
|
|
10038
|
+
"fill-blue-500": !_ctx.disabled && !isInvalid.value
|
|
7461
10039
|
})
|
|
7462
10040
|
}, null, 8, ["class"])
|
|
7463
10041
|
])
|
|
@@ -7484,21 +10062,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7484
10062
|
},
|
|
7485
10063
|
__name: "FdsTextarea",
|
|
7486
10064
|
props: /* @__PURE__ */ mergeModels({
|
|
7487
|
-
value: { default: void 0 },
|
|
7488
10065
|
label: { default: void 0 },
|
|
7489
10066
|
meta: { default: void 0 },
|
|
7490
|
-
disabled: { type: Boolean, default: false },
|
|
7491
10067
|
optional: { type: Boolean, default: false },
|
|
7492
10068
|
valid: { type: [Boolean, null], default: void 0 },
|
|
7493
10069
|
invalidMessage: {},
|
|
7494
|
-
rows: { default: 4 },
|
|
7495
|
-
name: {},
|
|
7496
|
-
id: { default: void 0 },
|
|
7497
10070
|
modelValue: {},
|
|
7498
10071
|
modelModifiers: { default: () => ({}) },
|
|
7499
|
-
|
|
7500
|
-
onChange: {},
|
|
7501
|
-
onInput: {}
|
|
10072
|
+
value: { default: void 0 }
|
|
7502
10073
|
}, {
|
|
7503
10074
|
"modelValue": { default: void 0, required: false },
|
|
7504
10075
|
"modelModifiers": {}
|
|
@@ -7906,7 +10477,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
7906
10477
|
};
|
|
7907
10478
|
return (_ctx, _cache) => {
|
|
7908
10479
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
7909
|
-
__props.loading ? (openBlock(), createBlock(_sfc_main$
|
|
10480
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$o, {
|
|
7910
10481
|
key: 0,
|
|
7911
10482
|
size: "24px",
|
|
7912
10483
|
color: "blue",
|
|
@@ -7933,32 +10504,32 @@ const FdsSeparator = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_ren
|
|
|
7933
10504
|
const FdsVueCorePlugin = {
|
|
7934
10505
|
install(app) {
|
|
7935
10506
|
app.component("FdsTreeView", _sfc_main$a);
|
|
7936
|
-
app.component("FdsButtonPrimary", _sfc_main$
|
|
7937
|
-
app.component("FdsButtonSecondary", _sfc_main$
|
|
7938
|
-
app.component("FdsButtonMinor", _sfc_main$
|
|
10507
|
+
app.component("FdsButtonPrimary", _sfc_main$k);
|
|
10508
|
+
app.component("FdsButtonSecondary", _sfc_main$j);
|
|
10509
|
+
app.component("FdsButtonMinor", _sfc_main$n);
|
|
7939
10510
|
app.component("FdsButtonIcon", _sfc_main$v);
|
|
7940
|
-
app.component("FdsButtonCopy", _sfc_main$
|
|
7941
|
-
app.component("FdsButtonDownload", _sfc_main$
|
|
10511
|
+
app.component("FdsButtonCopy", _sfc_main$m);
|
|
10512
|
+
app.component("FdsButtonDownload", _sfc_main$l);
|
|
7942
10513
|
app.component("FdsIcon", _sfc_main$w);
|
|
7943
|
-
app.component("FdsSpinner", _sfc_main$
|
|
10514
|
+
app.component("FdsSpinner", _sfc_main$o);
|
|
7944
10515
|
app.component("FdsRadio", _sfc_main$d);
|
|
7945
10516
|
app.component("FdsCheckbox", _sfc_main$e);
|
|
7946
10517
|
app.component("FdsTextarea", _sfc_main$7);
|
|
7947
10518
|
app.component("FdsSelect", _sfc_main$8);
|
|
7948
10519
|
app.component("FdsTable", _sfc_main$6);
|
|
7949
10520
|
app.component("FdsTableHead", _sfc_main$5);
|
|
7950
|
-
app.component("FdsInput", _sfc_main$
|
|
10521
|
+
app.component("FdsInput", _sfc_main$h);
|
|
7951
10522
|
app.component("FdsBlockContent", _sfc_main$t);
|
|
7952
|
-
app.component("FdsBlockInfo", _sfc_main$
|
|
10523
|
+
app.component("FdsBlockInfo", _sfc_main$q);
|
|
7953
10524
|
app.component("FdsBlockAlert", _sfc_main$u);
|
|
7954
|
-
app.component("FdsBlockExpander", _sfc_main$
|
|
7955
|
-
app.component("FdsBlockLink", _sfc_main$
|
|
7956
|
-
app.component("FdsSticker", _sfc_main$
|
|
10525
|
+
app.component("FdsBlockExpander", _sfc_main$r);
|
|
10526
|
+
app.component("FdsBlockLink", _sfc_main$p);
|
|
10527
|
+
app.component("FdsSticker", _sfc_main$s);
|
|
7957
10528
|
app.component("FdsTabs", _sfc_main$4);
|
|
7958
10529
|
app.component("FdsTabsItem", _sfc_main$3);
|
|
7959
|
-
app.component("FdsModal", _sfc_main$
|
|
7960
|
-
app.component("FdsPagination", _sfc_main$
|
|
7961
|
-
app.component("FdsSearchSelect", _sfc_main$
|
|
10530
|
+
app.component("FdsModal", _sfc_main$i);
|
|
10531
|
+
app.component("FdsPagination", _sfc_main$g);
|
|
10532
|
+
app.component("FdsSearchSelect", _sfc_main$f);
|
|
7962
10533
|
app.component("FdsTruncatedText", _sfc_main$9);
|
|
7963
10534
|
app.component("FdsHeading", _sfc_main$2);
|
|
7964
10535
|
app.component("FdsSeparator", FdsSeparator);
|
|
@@ -7969,28 +10540,28 @@ const FdsVueCorePlugin = {
|
|
|
7969
10540
|
export {
|
|
7970
10541
|
_sfc_main$u as FdsBlockAlert,
|
|
7971
10542
|
_sfc_main$t as FdsBlockContent,
|
|
7972
|
-
_sfc_main$
|
|
7973
|
-
_sfc_main$
|
|
7974
|
-
_sfc_main$
|
|
7975
|
-
_sfc_main$
|
|
7976
|
-
_sfc_main$
|
|
10543
|
+
_sfc_main$r as FdsBlockExpander,
|
|
10544
|
+
_sfc_main$q as FdsBlockInfo,
|
|
10545
|
+
_sfc_main$p as FdsBlockLink,
|
|
10546
|
+
_sfc_main$m as FdsButtonCopy,
|
|
10547
|
+
_sfc_main$l as FdsButtonDownload,
|
|
7977
10548
|
_sfc_main$v as FdsButtonIcon,
|
|
7978
|
-
_sfc_main$
|
|
7979
|
-
_sfc_main$
|
|
7980
|
-
_sfc_main$
|
|
10549
|
+
_sfc_main$n as FdsButtonMinor,
|
|
10550
|
+
_sfc_main$k as FdsButtonPrimary,
|
|
10551
|
+
_sfc_main$j as FdsButtonSecondary,
|
|
7981
10552
|
_sfc_main$e as FdsCheckbox,
|
|
7982
10553
|
_sfc_main$2 as FdsHeading,
|
|
7983
10554
|
_sfc_main$w as FdsIcon,
|
|
7984
|
-
_sfc_main$
|
|
10555
|
+
_sfc_main$h as FdsInput,
|
|
7985
10556
|
_sfc_main$1 as FdsListHeading,
|
|
7986
|
-
_sfc_main$
|
|
7987
|
-
_sfc_main$
|
|
10557
|
+
_sfc_main$i as FdsModal,
|
|
10558
|
+
_sfc_main$g as FdsPagination,
|
|
7988
10559
|
_sfc_main$d as FdsRadio,
|
|
7989
|
-
_sfc_main$
|
|
10560
|
+
_sfc_main$f as FdsSearchSelect,
|
|
7990
10561
|
_sfc_main$8 as FdsSelect,
|
|
7991
10562
|
FdsSeparator,
|
|
7992
|
-
_sfc_main$
|
|
7993
|
-
_sfc_main$
|
|
10563
|
+
_sfc_main$o as FdsSpinner,
|
|
10564
|
+
_sfc_main$s as FdsSticker,
|
|
7994
10565
|
_sfc_main$6 as FdsTable,
|
|
7995
10566
|
_sfc_main$5 as FdsTableHead,
|
|
7996
10567
|
_sfc_main$4 as FdsTabs,
|
|
@@ -8002,6 +10573,7 @@ export {
|
|
|
8002
10573
|
FdsVueCorePlugin as default,
|
|
8003
10574
|
isPidString,
|
|
8004
10575
|
useBoldQuery,
|
|
10576
|
+
useDownload,
|
|
8005
10577
|
useIsPid,
|
|
8006
10578
|
useTreeState
|
|
8007
10579
|
};
|