druware-components 0.1.1

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.
@@ -0,0 +1,4164 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const _export_sfc = (sfc, props) => {
5
+ const target = sfc.__vccOpts || sfc;
6
+ for (const [key, val] of props) {
7
+ target[key] = val;
8
+ }
9
+ return target;
10
+ };
11
+ const _sfc_main$1 = {
12
+ data: function() {
13
+ return {
14
+ currentCount: 0
15
+ };
16
+ },
17
+ props: {
18
+ icon: {
19
+ type: String,
20
+ default: null
21
+ },
22
+ iconFamily: {
23
+ type: String,
24
+ default: "fa"
25
+ },
26
+ count: {
27
+ type: Number,
28
+ default: 0
29
+ },
30
+ label: {
31
+ type: String,
32
+ default: null
33
+ },
34
+ iconStyle: {
35
+ type: String,
36
+ default: "has-text-info"
37
+ },
38
+ card: {
39
+ type: Boolean,
40
+ default: false
41
+ }
42
+ },
43
+ computed: {
44
+ cardClass() {
45
+ return (this.card ? "card " : "") + "animated-count";
46
+ }
47
+ },
48
+ methods: {
49
+ async setCount(value) {
50
+ var increment = Math.round(value / 10);
51
+ while (this.currentCount < value) {
52
+ this.currentCount += increment;
53
+ await new Promise((resolve) => setTimeout(resolve, 25));
54
+ }
55
+ this.currentCount = value;
56
+ }
57
+ },
58
+ watch: {
59
+ count(to, from) {
60
+ if (to === from) return;
61
+ this.setCount(to);
62
+ return;
63
+ }
64
+ },
65
+ mounted() {
66
+ this.setCount(this.count);
67
+ }
68
+ };
69
+ const _hoisted_1$1 = {
70
+ key: 0,
71
+ class: "icon-badge"
72
+ };
73
+ const _hoisted_2$1 = { class: "count" };
74
+ const _hoisted_3$1 = { class: "label" };
75
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
76
+ return vue.openBlock(), vue.createElementBlock("div", {
77
+ class: vue.normalizeClass($options.cardClass)
78
+ }, [
79
+ $props.icon != null ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
80
+ vue.createElementVNode("span", {
81
+ class: vue.normalizeClass("icon is-large " + $props.iconStyle)
82
+ }, [
83
+ vue.createElementVNode("i", {
84
+ class: vue.normalizeClass($props.iconFamily + " " + $props.icon),
85
+ "aria-hidden": "true"
86
+ }, null, 2)
87
+ ], 2)
88
+ ])) : vue.createCommentVNode("", true),
89
+ vue.createElementVNode("div", _hoisted_2$1, vue.toDisplayString(_ctx.currentCount), 1),
90
+ vue.createElementVNode("div", _hoisted_3$1, vue.toDisplayString($props.label), 1)
91
+ ], 2);
92
+ }
93
+ const AnimatedCount = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-0827a913"]]);
94
+ const isBrowser = typeof document !== "undefined";
95
+ const noop$1 = () => {
96
+ };
97
+ const isArray$1 = Array.isArray;
98
+ function warn$1(msg) {
99
+ const args = Array.from(arguments).slice(1);
100
+ console.warn.apply(console, ["[Vue Router warn]: " + msg].concat(args));
101
+ }
102
+ function isSameRouteRecord(a, b2) {
103
+ return (a.aliasOf || a) === (b2.aliasOf || b2);
104
+ }
105
+ function isSameRouteLocationParams(a, b2) {
106
+ if (Object.keys(a).length !== Object.keys(b2).length) return false;
107
+ for (var key in a) if (!isSameRouteLocationParamsValue(a[key], b2[key])) return false;
108
+ return true;
109
+ }
110
+ function isSameRouteLocationParamsValue(a, b2) {
111
+ return isArray$1(a) ? isEquivalentArray(a, b2) : isArray$1(b2) ? isEquivalentArray(b2, a) : a?.valueOf() === b2?.valueOf();
112
+ }
113
+ function isEquivalentArray(a, b2) {
114
+ return isArray$1(b2) ? a.length === b2.length && a.every((value, i) => value === b2[i]) : a.length === 1 && a[0] === b2;
115
+ }
116
+ function isRouteLocation(route) {
117
+ return typeof route === "string" || route && typeof route === "object";
118
+ }
119
+ /* @__PURE__ */ Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
120
+ /* @__PURE__ */ Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
121
+ /* @__PURE__ */ Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
122
+ const routerKey = /* @__PURE__ */ Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
123
+ const routeLocationKey = /* @__PURE__ */ Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
124
+ /* @__PURE__ */ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
125
+ function useLink(props) {
126
+ const router = vue.inject(routerKey);
127
+ const currentRoute = vue.inject(routeLocationKey);
128
+ let hasPrevious = false;
129
+ let previousTo = null;
130
+ const route = vue.computed(() => {
131
+ const to = vue.unref(props.to);
132
+ if (process.env.NODE_ENV !== "production" && (!hasPrevious || to !== previousTo)) {
133
+ if (!isRouteLocation(to)) if (hasPrevious) warn$1(`Invalid value for prop "to" in useLink()
134
+ - to:`, to, `
135
+ - previous to:`, previousTo, `
136
+ - props:`, props);
137
+ else warn$1(`Invalid value for prop "to" in useLink()
138
+ - to:`, to, `
139
+ - props:`, props);
140
+ previousTo = to;
141
+ hasPrevious = true;
142
+ }
143
+ return router.resolve(to);
144
+ });
145
+ const activeRecordIndex = vue.computed(() => {
146
+ const { matched } = route.value;
147
+ const { length } = matched;
148
+ const routeMatched = matched[length - 1];
149
+ const currentMatched = currentRoute.matched;
150
+ if (!routeMatched || !currentMatched.length) return -1;
151
+ const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
152
+ if (index > -1) return index;
153
+ const parentRecordPath = getOriginalPath(matched[length - 2]);
154
+ return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
155
+ });
156
+ const isActive = vue.computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
157
+ const isExactActive = vue.computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
158
+ function navigate(e = {}) {
159
+ if (guardEvent(e)) {
160
+ const p = router[vue.unref(props.replace) ? "replace" : "push"](vue.unref(props.to)).catch(noop$1);
161
+ if (props.viewTransition && typeof document !== "undefined" && "startViewTransition" in document) document.startViewTransition(() => p);
162
+ return p;
163
+ }
164
+ return Promise.resolve();
165
+ }
166
+ if ((process.env.NODE_ENV !== "production" || false) && isBrowser) {
167
+ const instance = vue.getCurrentInstance();
168
+ if (instance) {
169
+ const linkContextDevtools = {
170
+ route: route.value,
171
+ isActive: isActive.value,
172
+ isExactActive: isExactActive.value,
173
+ error: null
174
+ };
175
+ instance.__vrl_devtools = instance.__vrl_devtools || [];
176
+ instance.__vrl_devtools.push(linkContextDevtools);
177
+ vue.watchEffect(() => {
178
+ linkContextDevtools.route = route.value;
179
+ linkContextDevtools.isActive = isActive.value;
180
+ linkContextDevtools.isExactActive = isExactActive.value;
181
+ linkContextDevtools.error = isRouteLocation(vue.unref(props.to)) ? null : 'Invalid "to" value';
182
+ }, { flush: "post" });
183
+ }
184
+ }
185
+ return {
186
+ route,
187
+ href: vue.computed(() => route.value.href),
188
+ isActive,
189
+ isExactActive,
190
+ navigate
191
+ };
192
+ }
193
+ function preferSingleVNode(vnodes) {
194
+ return vnodes.length === 1 ? vnodes[0] : vnodes;
195
+ }
196
+ const RouterLinkImpl = /* @__PURE__ */ vue.defineComponent({
197
+ name: "RouterLink",
198
+ compatConfig: { MODE: 3 },
199
+ props: {
200
+ to: {
201
+ type: [String, Object],
202
+ required: true
203
+ },
204
+ replace: Boolean,
205
+ activeClass: String,
206
+ exactActiveClass: String,
207
+ custom: Boolean,
208
+ ariaCurrentValue: {
209
+ type: String,
210
+ default: "page"
211
+ },
212
+ viewTransition: Boolean
213
+ },
214
+ useLink,
215
+ setup(props, { slots }) {
216
+ const link = vue.reactive(useLink(props));
217
+ const { options } = vue.inject(routerKey);
218
+ const elClass = vue.computed(() => ({
219
+ [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
220
+ [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
221
+ }));
222
+ return () => {
223
+ const children = slots.default && preferSingleVNode(slots.default(link));
224
+ return props.custom ? children : vue.h("a", {
225
+ "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
226
+ href: link.href,
227
+ onClick: link.navigate,
228
+ class: elClass.value
229
+ }, children);
230
+ };
231
+ }
232
+ });
233
+ const RouterLink = RouterLinkImpl;
234
+ function guardEvent(e) {
235
+ if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
236
+ if (e.defaultPrevented) return;
237
+ if (e.button !== void 0 && e.button !== 0) return;
238
+ if (e.currentTarget && e.currentTarget.getAttribute) {
239
+ const target = e.currentTarget.getAttribute("target");
240
+ if (/\b_blank\b/i.test(target)) return;
241
+ }
242
+ if (e.preventDefault) e.preventDefault();
243
+ return true;
244
+ }
245
+ function includesParams(outer, inner) {
246
+ for (const key in inner) {
247
+ const innerValue = inner[key];
248
+ const outerValue = outer[key];
249
+ if (typeof innerValue === "string") {
250
+ if (innerValue !== outerValue) return false;
251
+ } else if (!isArray$1(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value.valueOf() !== outerValue[i].valueOf())) return false;
252
+ }
253
+ return true;
254
+ }
255
+ function getOriginalPath(record) {
256
+ return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
257
+ }
258
+ const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
259
+ function L() {
260
+ return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
261
+ }
262
+ var T = L();
263
+ function Z(u3) {
264
+ T = u3;
265
+ }
266
+ var C = { exec: () => null };
267
+ function k(u3, e = "") {
268
+ let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
269
+ let s = typeof i == "string" ? i : i.source;
270
+ return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
271
+ }, getRegex: () => new RegExp(t, e) };
272
+ return n;
273
+ }
274
+ var me = (() => {
275
+ try {
276
+ return !!new RegExp("(?<=1)(?<!1)");
277
+ } catch {
278
+ return false;
279
+ }
280
+ })(), m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u3) => new RegExp(`^( {0,3}${u3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}#`), htmlBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}<(?:[a-z].*>|!--)`, "i") }, xe = /^(?:[ \t]*(?:\n|$))+/, be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = /(?:[*+-]|\d{1,9}[.)])/, re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Oe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, we = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ye = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Se = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex(), U = { blockquote: $e, code: be, def: ye, fences: Re, heading: Te, hr: I, html: Se, lheading: se, list: Pe, newline: xe, paragraph: ie, table: C, text: we }, te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), _e = { ...U, lheading: Oe, table: te, paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, Le = { ...U, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: C, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
281
+ ]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ae = /[^\s\p{P}\p{S}]/u, Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), le = /(?!~)[\p{P}\p{S}]/u, Ie = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, Be = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", me ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, qe = k(ue, "u").replace(/punct/g, D).getRegex(), ve = k(ue, "u").replace(/punct/g, le).getRegex(), pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex(), He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex(), Ze = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex(), Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), Ne = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Qe = k(j).replace("(?:-->|$)", "-->").getRegex(), Fe = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex(), he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = { _backpedal: C, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: oe, code: ze, del: C, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ue, tag: Fe, text: Ae, url: C }, Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, G = { ...W, emStrongRDelimAst: He, emStrongLDelim: ve, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() }, We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, E = { normal: U, gfm: _e, pedantic: Le }, M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
282
+ var Xe = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ke = (u3) => Xe[u3];
283
+ function w(u3, e) {
284
+ if (e) {
285
+ if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ke);
286
+ } else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ke);
287
+ return u3;
288
+ }
289
+ function X(u3) {
290
+ try {
291
+ u3 = encodeURI(u3).replace(m.percentDecode, "%");
292
+ } catch {
293
+ return null;
294
+ }
295
+ return u3;
296
+ }
297
+ function J(u3, e) {
298
+ let t = u3.replace(m.findPipe, (i, s, a) => {
299
+ let o = false, l = s;
300
+ for (; --l >= 0 && a[l] === "\\"; ) o = !o;
301
+ return o ? "|" : " |";
302
+ }), n = t.split(m.splitPipe), r = 0;
303
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
304
+ else for (; n.length < e; ) n.push("");
305
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
306
+ return n;
307
+ }
308
+ function z(u3, e, t) {
309
+ let n = u3.length;
310
+ if (n === 0) return "";
311
+ let r = 0;
312
+ for (; r < n; ) {
313
+ let i = u3.charAt(n - r - 1);
314
+ if (i === e && true) r++;
315
+ else break;
316
+ }
317
+ return u3.slice(0, n - r);
318
+ }
319
+ function de(u3, e) {
320
+ if (u3.indexOf(e[1]) === -1) return -1;
321
+ let t = 0;
322
+ for (let n = 0; n < u3.length; n++) if (u3[n] === "\\") n++;
323
+ else if (u3[n] === e[0]) t++;
324
+ else if (u3[n] === e[1] && (t--, t < 0)) return n;
325
+ return t > 0 ? -2 : -1;
326
+ }
327
+ function ge(u3, e, t, n, r) {
328
+ let i = e.href, s = e.title || null, a = u3[1].replace(r.other.outputLinkReplace, "$1");
329
+ n.state.inLink = true;
330
+ let o = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
331
+ return n.state.inLink = false, o;
332
+ }
333
+ function Je(u3, e, t) {
334
+ let n = u3.match(t.other.indentCodeCompensation);
335
+ if (n === null) return e;
336
+ let r = n[1];
337
+ return e.split(`
338
+ `).map((i) => {
339
+ let s = i.match(t.other.beginningSpace);
340
+ if (s === null) return i;
341
+ let [a] = s;
342
+ return a.length >= r.length ? i.slice(r.length) : i;
343
+ }).join(`
344
+ `);
345
+ }
346
+ var y = class {
347
+ options;
348
+ rules;
349
+ lexer;
350
+ constructor(e) {
351
+ this.options = e || T;
352
+ }
353
+ space(e) {
354
+ let t = this.rules.block.newline.exec(e);
355
+ if (t && t[0].length > 0) return { type: "space", raw: t[0] };
356
+ }
357
+ code(e) {
358
+ let t = this.rules.block.code.exec(e);
359
+ if (t) {
360
+ let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
361
+ return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
362
+ `) };
363
+ }
364
+ }
365
+ fences(e) {
366
+ let t = this.rules.block.fences.exec(e);
367
+ if (t) {
368
+ let n = t[0], r = Je(n, t[3] || "", this.rules);
369
+ return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
370
+ }
371
+ }
372
+ heading(e) {
373
+ let t = this.rules.block.heading.exec(e);
374
+ if (t) {
375
+ let n = t[2].trim();
376
+ if (this.rules.other.endingHash.test(n)) {
377
+ let r = z(n, "#");
378
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
379
+ }
380
+ return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
381
+ }
382
+ }
383
+ hr(e) {
384
+ let t = this.rules.block.hr.exec(e);
385
+ if (t) return { type: "hr", raw: z(t[0], `
386
+ `) };
387
+ }
388
+ blockquote(e) {
389
+ let t = this.rules.block.blockquote.exec(e);
390
+ if (t) {
391
+ let n = z(t[0], `
392
+ `).split(`
393
+ `), r = "", i = "", s = [];
394
+ for (; n.length > 0; ) {
395
+ let a = false, o = [], l;
396
+ for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) o.push(n[l]), a = true;
397
+ else if (!a) o.push(n[l]);
398
+ else break;
399
+ n = n.slice(l);
400
+ let p = o.join(`
401
+ `), c = p.replace(this.rules.other.blockquoteSetextReplace, `
402
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
403
+ r = r ? `${r}
404
+ ${p}` : p, i = i ? `${i}
405
+ ${c}` : c;
406
+ let g = this.lexer.state.top;
407
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
408
+ let h = s.at(-1);
409
+ if (h?.type === "code") break;
410
+ if (h?.type === "blockquote") {
411
+ let R = h, f = R.raw + `
412
+ ` + n.join(`
413
+ `), O = this.blockquote(f);
414
+ s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
415
+ break;
416
+ } else if (h?.type === "list") {
417
+ let R = h, f = R.raw + `
418
+ ` + n.join(`
419
+ `), O = this.list(f);
420
+ s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
421
+ `);
422
+ continue;
423
+ }
424
+ }
425
+ return { type: "blockquote", raw: r, tokens: s, text: i };
426
+ }
427
+ }
428
+ list(e) {
429
+ let t = this.rules.block.list.exec(e);
430
+ if (t) {
431
+ let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
432
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
433
+ let s = this.rules.other.listItemRegex(n), a = false;
434
+ for (; e; ) {
435
+ let l = false, p = "", c = "";
436
+ if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
437
+ p = t[0], e = e.substring(p.length);
438
+ let g = t[2].split(`
439
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h = e.split(`
440
+ `, 1)[0], R = !g.trim(), f = 0;
441
+ if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
442
+ `, e = e.substring(h.length + 1), l = true), !l) {
443
+ let O = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
444
+ for (; e; ) {
445
+ let H = e.split(`
446
+ `, 1)[0], A;
447
+ if (h = H, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), Y.test(h) || ee.test(h) || fe.test(h) || O.test(h) || V.test(h)) break;
448
+ if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
449
+ ` + A.slice(f);
450
+ else {
451
+ if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g)) break;
452
+ c += `
453
+ ` + h;
454
+ }
455
+ !R && !h.trim() && (R = true), p += H + `
456
+ `, e = e.substring(H.length + 1), g = A.slice(f);
457
+ }
458
+ }
459
+ i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
460
+ }
461
+ let o = i.items.at(-1);
462
+ if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
463
+ else return;
464
+ i.raw = i.raw.trimEnd();
465
+ for (let l of i.items) {
466
+ if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
467
+ if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
468
+ l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
469
+ for (let c = this.lexer.inlineQueue.length - 1; c >= 0; c--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
470
+ this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
471
+ break;
472
+ }
473
+ }
474
+ let p = this.rules.other.listTaskCheckbox.exec(l.raw);
475
+ if (p) {
476
+ let c = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
477
+ l.checked = c.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = c.raw + l.tokens[0].raw, l.tokens[0].text = c.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(c)) : l.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : l.tokens.unshift(c);
478
+ }
479
+ }
480
+ if (!i.loose) {
481
+ let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
482
+ i.loose = c;
483
+ }
484
+ }
485
+ if (i.loose) for (let l of i.items) {
486
+ l.loose = true;
487
+ for (let p of l.tokens) p.type === "text" && (p.type = "paragraph");
488
+ }
489
+ return i;
490
+ }
491
+ }
492
+ html(e) {
493
+ let t = this.rules.block.html.exec(e);
494
+ if (t) return { type: "html", block: true, raw: t[0], pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: t[0] };
495
+ }
496
+ def(e) {
497
+ let t = this.rules.block.def.exec(e);
498
+ if (t) {
499
+ let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
500
+ return { type: "def", tag: n, raw: t[0], href: r, title: i };
501
+ }
502
+ }
503
+ table(e) {
504
+ let t = this.rules.block.table.exec(e);
505
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
506
+ let n = J(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
507
+ `) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
508
+ if (n.length === r.length) {
509
+ for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
510
+ for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
511
+ for (let a of i) s.rows.push(J(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
512
+ return s;
513
+ }
514
+ }
515
+ lheading(e) {
516
+ let t = this.rules.block.lheading.exec(e);
517
+ if (t) return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: t[1], tokens: this.lexer.inline(t[1]) };
518
+ }
519
+ paragraph(e) {
520
+ let t = this.rules.block.paragraph.exec(e);
521
+ if (t) {
522
+ let n = t[1].charAt(t[1].length - 1) === `
523
+ ` ? t[1].slice(0, -1) : t[1];
524
+ return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
525
+ }
526
+ }
527
+ text(e) {
528
+ let t = this.rules.block.text.exec(e);
529
+ if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
530
+ }
531
+ escape(e) {
532
+ let t = this.rules.inline.escape.exec(e);
533
+ if (t) return { type: "escape", raw: t[0], text: t[1] };
534
+ }
535
+ tag(e) {
536
+ let t = this.rules.inline.tag.exec(e);
537
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
538
+ }
539
+ link(e) {
540
+ let t = this.rules.inline.link.exec(e);
541
+ if (t) {
542
+ let n = t[2].trim();
543
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
544
+ if (!this.rules.other.endAngleBracket.test(n)) return;
545
+ let s = z(n.slice(0, -1), "\\");
546
+ if ((n.length - s.length) % 2 === 0) return;
547
+ } else {
548
+ let s = de(t[2], "()");
549
+ if (s === -2) return;
550
+ if (s > -1) {
551
+ let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
552
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
553
+ }
554
+ }
555
+ let r = t[2], i = "";
556
+ if (this.options.pedantic) {
557
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
558
+ s && (r = s[1], i = s[3]);
559
+ } else i = t[3] ? t[3].slice(1, -1) : "";
560
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ge(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
561
+ }
562
+ }
563
+ reflink(e, t) {
564
+ let n;
565
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
566
+ let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[r.toLowerCase()];
567
+ if (!i) {
568
+ let s = n[0].charAt(0);
569
+ return { type: "text", raw: s, text: s };
570
+ }
571
+ return ge(n, i, n[0], this.lexer, this.rules);
572
+ }
573
+ }
574
+ emStrong(e, t, n = "") {
575
+ let r = this.rules.inline.emStrongLDelim.exec(e);
576
+ if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
577
+ if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
578
+ let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
579
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
580
+ if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
581
+ if (o = [...a].length, r[3] || r[4]) {
582
+ l += o;
583
+ continue;
584
+ } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
585
+ p += o;
586
+ continue;
587
+ }
588
+ if (l -= o, l > 0) continue;
589
+ o = Math.min(o, o + l + p);
590
+ let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
591
+ if (Math.min(s, o) % 2) {
592
+ let f = h.slice(1, -1);
593
+ return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
594
+ }
595
+ let R = h.slice(2, -2);
596
+ return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
597
+ }
598
+ }
599
+ }
600
+ codespan(e) {
601
+ let t = this.rules.inline.code.exec(e);
602
+ if (t) {
603
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
604
+ return r && i && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
605
+ }
606
+ }
607
+ br(e) {
608
+ let t = this.rules.inline.br.exec(e);
609
+ if (t) return { type: "br", raw: t[0] };
610
+ }
611
+ del(e) {
612
+ let t = this.rules.inline.del.exec(e);
613
+ if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
614
+ }
615
+ autolink(e) {
616
+ let t = this.rules.inline.autolink.exec(e);
617
+ if (t) {
618
+ let n, r;
619
+ return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
620
+ }
621
+ }
622
+ url(e) {
623
+ let t;
624
+ if (t = this.rules.inline.url.exec(e)) {
625
+ let n, r;
626
+ if (t[2] === "@") n = t[0], r = "mailto:" + n;
627
+ else {
628
+ let i;
629
+ do
630
+ i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
631
+ while (i !== t[0]);
632
+ n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
633
+ }
634
+ return { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
635
+ }
636
+ }
637
+ inlineText(e) {
638
+ let t = this.rules.inline.text.exec(e);
639
+ if (t) {
640
+ let n = this.lexer.state.inRawBlock;
641
+ return { type: "text", raw: t[0], text: t[0], escaped: n };
642
+ }
643
+ }
644
+ };
645
+ var x = class u {
646
+ tokens;
647
+ options;
648
+ state;
649
+ inlineQueue;
650
+ tokenizer;
651
+ constructor(e) {
652
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
653
+ let t = { other: m, block: E.normal, inline: M.normal };
654
+ this.options.pedantic ? (t.block = E.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
655
+ }
656
+ static get rules() {
657
+ return { block: E, inline: M };
658
+ }
659
+ static lex(e, t) {
660
+ return new u(t).lex(e);
661
+ }
662
+ static lexInline(e, t) {
663
+ return new u(t).inlineTokens(e);
664
+ }
665
+ lex(e) {
666
+ e = e.replace(m.carriageReturn, `
667
+ `), this.blockTokens(e, this.tokens);
668
+ for (let t = 0; t < this.inlineQueue.length; t++) {
669
+ let n = this.inlineQueue[t];
670
+ this.inlineTokens(n.src, n.tokens);
671
+ }
672
+ return this.inlineQueue = [], this.tokens;
673
+ }
674
+ blockTokens(e, t = [], n = false) {
675
+ for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
676
+ let r;
677
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
678
+ if (r = this.tokenizer.space(e)) {
679
+ e = e.substring(r.raw.length);
680
+ let s = t.at(-1);
681
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
682
+ ` : t.push(r);
683
+ continue;
684
+ }
685
+ if (r = this.tokenizer.code(e)) {
686
+ e = e.substring(r.raw.length);
687
+ let s = t.at(-1);
688
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
689
+ `) ? "" : `
690
+ `) + r.raw, s.text += `
691
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
692
+ continue;
693
+ }
694
+ if (r = this.tokenizer.fences(e)) {
695
+ e = e.substring(r.raw.length), t.push(r);
696
+ continue;
697
+ }
698
+ if (r = this.tokenizer.heading(e)) {
699
+ e = e.substring(r.raw.length), t.push(r);
700
+ continue;
701
+ }
702
+ if (r = this.tokenizer.hr(e)) {
703
+ e = e.substring(r.raw.length), t.push(r);
704
+ continue;
705
+ }
706
+ if (r = this.tokenizer.blockquote(e)) {
707
+ e = e.substring(r.raw.length), t.push(r);
708
+ continue;
709
+ }
710
+ if (r = this.tokenizer.list(e)) {
711
+ e = e.substring(r.raw.length), t.push(r);
712
+ continue;
713
+ }
714
+ if (r = this.tokenizer.html(e)) {
715
+ e = e.substring(r.raw.length), t.push(r);
716
+ continue;
717
+ }
718
+ if (r = this.tokenizer.def(e)) {
719
+ e = e.substring(r.raw.length);
720
+ let s = t.at(-1);
721
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
722
+ `) ? "" : `
723
+ `) + r.raw, s.text += `
724
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
725
+ continue;
726
+ }
727
+ if (r = this.tokenizer.table(e)) {
728
+ e = e.substring(r.raw.length), t.push(r);
729
+ continue;
730
+ }
731
+ if (r = this.tokenizer.lheading(e)) {
732
+ e = e.substring(r.raw.length), t.push(r);
733
+ continue;
734
+ }
735
+ let i = e;
736
+ if (this.options.extensions?.startBlock) {
737
+ let s = 1 / 0, a = e.slice(1), o;
738
+ this.options.extensions.startBlock.forEach((l) => {
739
+ o = l.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
740
+ }), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
741
+ }
742
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
743
+ let s = t.at(-1);
744
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
745
+ `) ? "" : `
746
+ `) + r.raw, s.text += `
747
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
748
+ continue;
749
+ }
750
+ if (r = this.tokenizer.text(e)) {
751
+ e = e.substring(r.raw.length);
752
+ let s = t.at(-1);
753
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
754
+ `) ? "" : `
755
+ `) + r.raw, s.text += `
756
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
757
+ continue;
758
+ }
759
+ if (e) {
760
+ let s = "Infinite loop on byte: " + e.charCodeAt(0);
761
+ if (this.options.silent) {
762
+ console.error(s);
763
+ break;
764
+ } else throw new Error(s);
765
+ }
766
+ }
767
+ return this.state.top = true, t;
768
+ }
769
+ inline(e, t = []) {
770
+ return this.inlineQueue.push({ src: e, tokens: t }), t;
771
+ }
772
+ inlineTokens(e, t = []) {
773
+ let n = e, r = null;
774
+ if (this.tokens.links) {
775
+ let o = Object.keys(this.tokens.links);
776
+ if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
777
+ }
778
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
779
+ let i;
780
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
781
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
782
+ let s = false, a = "";
783
+ for (; e; ) {
784
+ s || (a = ""), s = false;
785
+ let o;
786
+ if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
787
+ if (o = this.tokenizer.escape(e)) {
788
+ e = e.substring(o.raw.length), t.push(o);
789
+ continue;
790
+ }
791
+ if (o = this.tokenizer.tag(e)) {
792
+ e = e.substring(o.raw.length), t.push(o);
793
+ continue;
794
+ }
795
+ if (o = this.tokenizer.link(e)) {
796
+ e = e.substring(o.raw.length), t.push(o);
797
+ continue;
798
+ }
799
+ if (o = this.tokenizer.reflink(e, this.tokens.links)) {
800
+ e = e.substring(o.raw.length);
801
+ let p = t.at(-1);
802
+ o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
803
+ continue;
804
+ }
805
+ if (o = this.tokenizer.emStrong(e, n, a)) {
806
+ e = e.substring(o.raw.length), t.push(o);
807
+ continue;
808
+ }
809
+ if (o = this.tokenizer.codespan(e)) {
810
+ e = e.substring(o.raw.length), t.push(o);
811
+ continue;
812
+ }
813
+ if (o = this.tokenizer.br(e)) {
814
+ e = e.substring(o.raw.length), t.push(o);
815
+ continue;
816
+ }
817
+ if (o = this.tokenizer.del(e)) {
818
+ e = e.substring(o.raw.length), t.push(o);
819
+ continue;
820
+ }
821
+ if (o = this.tokenizer.autolink(e)) {
822
+ e = e.substring(o.raw.length), t.push(o);
823
+ continue;
824
+ }
825
+ if (!this.state.inLink && (o = this.tokenizer.url(e))) {
826
+ e = e.substring(o.raw.length), t.push(o);
827
+ continue;
828
+ }
829
+ let l = e;
830
+ if (this.options.extensions?.startInline) {
831
+ let p = 1 / 0, c = e.slice(1), g;
832
+ this.options.extensions.startInline.forEach((h) => {
833
+ g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
834
+ }), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
835
+ }
836
+ if (o = this.tokenizer.inlineText(l)) {
837
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
838
+ let p = t.at(-1);
839
+ p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
840
+ continue;
841
+ }
842
+ if (e) {
843
+ let p = "Infinite loop on byte: " + e.charCodeAt(0);
844
+ if (this.options.silent) {
845
+ console.error(p);
846
+ break;
847
+ } else throw new Error(p);
848
+ }
849
+ }
850
+ return t;
851
+ }
852
+ };
853
+ var P = class {
854
+ options;
855
+ parser;
856
+ constructor(e) {
857
+ this.options = e || T;
858
+ }
859
+ space(e) {
860
+ return "";
861
+ }
862
+ code({ text: e, lang: t, escaped: n }) {
863
+ let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
864
+ `;
865
+ return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
866
+ ` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
867
+ `;
868
+ }
869
+ blockquote({ tokens: e }) {
870
+ return `<blockquote>
871
+ ${this.parser.parse(e)}</blockquote>
872
+ `;
873
+ }
874
+ html({ text: e }) {
875
+ return e;
876
+ }
877
+ def(e) {
878
+ return "";
879
+ }
880
+ heading({ tokens: e, depth: t }) {
881
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
882
+ `;
883
+ }
884
+ hr(e) {
885
+ return `<hr>
886
+ `;
887
+ }
888
+ list(e) {
889
+ let t = e.ordered, n = e.start, r = "";
890
+ for (let a = 0; a < e.items.length; a++) {
891
+ let o = e.items[a];
892
+ r += this.listitem(o);
893
+ }
894
+ let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
895
+ return "<" + i + s + `>
896
+ ` + r + "</" + i + `>
897
+ `;
898
+ }
899
+ listitem(e) {
900
+ return `<li>${this.parser.parse(e.tokens)}</li>
901
+ `;
902
+ }
903
+ checkbox({ checked: e }) {
904
+ return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
905
+ }
906
+ paragraph({ tokens: e }) {
907
+ return `<p>${this.parser.parseInline(e)}</p>
908
+ `;
909
+ }
910
+ table(e) {
911
+ let t = "", n = "";
912
+ for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
913
+ t += this.tablerow({ text: n });
914
+ let r = "";
915
+ for (let i = 0; i < e.rows.length; i++) {
916
+ let s = e.rows[i];
917
+ n = "";
918
+ for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
919
+ r += this.tablerow({ text: n });
920
+ }
921
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
922
+ <thead>
923
+ ` + t + `</thead>
924
+ ` + r + `</table>
925
+ `;
926
+ }
927
+ tablerow({ text: e }) {
928
+ return `<tr>
929
+ ${e}</tr>
930
+ `;
931
+ }
932
+ tablecell(e) {
933
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
934
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
935
+ `;
936
+ }
937
+ strong({ tokens: e }) {
938
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
939
+ }
940
+ em({ tokens: e }) {
941
+ return `<em>${this.parser.parseInline(e)}</em>`;
942
+ }
943
+ codespan({ text: e }) {
944
+ return `<code>${w(e, true)}</code>`;
945
+ }
946
+ br(e) {
947
+ return "<br>";
948
+ }
949
+ del({ tokens: e }) {
950
+ return `<del>${this.parser.parseInline(e)}</del>`;
951
+ }
952
+ link({ href: e, title: t, tokens: n }) {
953
+ let r = this.parser.parseInline(n), i = X(e);
954
+ if (i === null) return r;
955
+ e = i;
956
+ let s = '<a href="' + e + '"';
957
+ return t && (s += ' title="' + w(t) + '"'), s += ">" + r + "</a>", s;
958
+ }
959
+ image({ href: e, title: t, text: n, tokens: r }) {
960
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
961
+ let i = X(e);
962
+ if (i === null) return w(n);
963
+ e = i;
964
+ let s = `<img src="${e}" alt="${n}"`;
965
+ return t && (s += ` title="${w(t)}"`), s += ">", s;
966
+ }
967
+ text(e) {
968
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
969
+ }
970
+ };
971
+ var $ = class {
972
+ strong({ text: e }) {
973
+ return e;
974
+ }
975
+ em({ text: e }) {
976
+ return e;
977
+ }
978
+ codespan({ text: e }) {
979
+ return e;
980
+ }
981
+ del({ text: e }) {
982
+ return e;
983
+ }
984
+ html({ text: e }) {
985
+ return e;
986
+ }
987
+ text({ text: e }) {
988
+ return e;
989
+ }
990
+ link({ text: e }) {
991
+ return "" + e;
992
+ }
993
+ image({ text: e }) {
994
+ return "" + e;
995
+ }
996
+ br() {
997
+ return "";
998
+ }
999
+ checkbox({ raw: e }) {
1000
+ return e;
1001
+ }
1002
+ };
1003
+ var b = class u2 {
1004
+ options;
1005
+ renderer;
1006
+ textRenderer;
1007
+ constructor(e) {
1008
+ this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
1009
+ }
1010
+ static parse(e, t) {
1011
+ return new u2(t).parse(e);
1012
+ }
1013
+ static parseInline(e, t) {
1014
+ return new u2(t).parseInline(e);
1015
+ }
1016
+ parse(e) {
1017
+ let t = "";
1018
+ for (let n = 0; n < e.length; n++) {
1019
+ let r = e[n];
1020
+ if (this.options.extensions?.renderers?.[r.type]) {
1021
+ let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
1022
+ if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
1023
+ t += a || "";
1024
+ continue;
1025
+ }
1026
+ }
1027
+ let i = r;
1028
+ switch (i.type) {
1029
+ case "space": {
1030
+ t += this.renderer.space(i);
1031
+ break;
1032
+ }
1033
+ case "hr": {
1034
+ t += this.renderer.hr(i);
1035
+ break;
1036
+ }
1037
+ case "heading": {
1038
+ t += this.renderer.heading(i);
1039
+ break;
1040
+ }
1041
+ case "code": {
1042
+ t += this.renderer.code(i);
1043
+ break;
1044
+ }
1045
+ case "table": {
1046
+ t += this.renderer.table(i);
1047
+ break;
1048
+ }
1049
+ case "blockquote": {
1050
+ t += this.renderer.blockquote(i);
1051
+ break;
1052
+ }
1053
+ case "list": {
1054
+ t += this.renderer.list(i);
1055
+ break;
1056
+ }
1057
+ case "checkbox": {
1058
+ t += this.renderer.checkbox(i);
1059
+ break;
1060
+ }
1061
+ case "html": {
1062
+ t += this.renderer.html(i);
1063
+ break;
1064
+ }
1065
+ case "def": {
1066
+ t += this.renderer.def(i);
1067
+ break;
1068
+ }
1069
+ case "paragraph": {
1070
+ t += this.renderer.paragraph(i);
1071
+ break;
1072
+ }
1073
+ case "text": {
1074
+ t += this.renderer.text(i);
1075
+ break;
1076
+ }
1077
+ default: {
1078
+ let s = 'Token with "' + i.type + '" type was not found.';
1079
+ if (this.options.silent) return console.error(s), "";
1080
+ throw new Error(s);
1081
+ }
1082
+ }
1083
+ }
1084
+ return t;
1085
+ }
1086
+ parseInline(e, t = this.renderer) {
1087
+ let n = "";
1088
+ for (let r = 0; r < e.length; r++) {
1089
+ let i = e[r];
1090
+ if (this.options.extensions?.renderers?.[i.type]) {
1091
+ let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1092
+ if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
1093
+ n += a || "";
1094
+ continue;
1095
+ }
1096
+ }
1097
+ let s = i;
1098
+ switch (s.type) {
1099
+ case "escape": {
1100
+ n += t.text(s);
1101
+ break;
1102
+ }
1103
+ case "html": {
1104
+ n += t.html(s);
1105
+ break;
1106
+ }
1107
+ case "link": {
1108
+ n += t.link(s);
1109
+ break;
1110
+ }
1111
+ case "image": {
1112
+ n += t.image(s);
1113
+ break;
1114
+ }
1115
+ case "checkbox": {
1116
+ n += t.checkbox(s);
1117
+ break;
1118
+ }
1119
+ case "strong": {
1120
+ n += t.strong(s);
1121
+ break;
1122
+ }
1123
+ case "em": {
1124
+ n += t.em(s);
1125
+ break;
1126
+ }
1127
+ case "codespan": {
1128
+ n += t.codespan(s);
1129
+ break;
1130
+ }
1131
+ case "br": {
1132
+ n += t.br(s);
1133
+ break;
1134
+ }
1135
+ case "del": {
1136
+ n += t.del(s);
1137
+ break;
1138
+ }
1139
+ case "text": {
1140
+ n += t.text(s);
1141
+ break;
1142
+ }
1143
+ default: {
1144
+ let a = 'Token with "' + s.type + '" type was not found.';
1145
+ if (this.options.silent) return console.error(a), "";
1146
+ throw new Error(a);
1147
+ }
1148
+ }
1149
+ }
1150
+ return n;
1151
+ }
1152
+ };
1153
+ var S = class {
1154
+ options;
1155
+ block;
1156
+ constructor(e) {
1157
+ this.options = e || T;
1158
+ }
1159
+ static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
1160
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
1161
+ preprocess(e) {
1162
+ return e;
1163
+ }
1164
+ postprocess(e) {
1165
+ return e;
1166
+ }
1167
+ processAllTokens(e) {
1168
+ return e;
1169
+ }
1170
+ emStrongMask(e) {
1171
+ return e;
1172
+ }
1173
+ provideLexer() {
1174
+ return this.block ? x.lex : x.lexInline;
1175
+ }
1176
+ provideParser() {
1177
+ return this.block ? b.parse : b.parseInline;
1178
+ }
1179
+ };
1180
+ var B = class {
1181
+ defaults = L();
1182
+ options = this.setOptions;
1183
+ parse = this.parseMarkdown(true);
1184
+ parseInline = this.parseMarkdown(false);
1185
+ Parser = b;
1186
+ Renderer = P;
1187
+ TextRenderer = $;
1188
+ Lexer = x;
1189
+ Tokenizer = y;
1190
+ Hooks = S;
1191
+ constructor(...e) {
1192
+ this.use(...e);
1193
+ }
1194
+ walkTokens(e, t) {
1195
+ let n = [];
1196
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1197
+ case "table": {
1198
+ let i = r;
1199
+ for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
1200
+ for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
1201
+ break;
1202
+ }
1203
+ case "list": {
1204
+ let i = r;
1205
+ n = n.concat(this.walkTokens(i.items, t));
1206
+ break;
1207
+ }
1208
+ default: {
1209
+ let i = r;
1210
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
1211
+ let a = i[s].flat(1 / 0);
1212
+ n = n.concat(this.walkTokens(a, t));
1213
+ }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
1214
+ }
1215
+ }
1216
+ return n;
1217
+ }
1218
+ use(...e) {
1219
+ let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
1220
+ return e.forEach((n) => {
1221
+ let r = { ...n };
1222
+ if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
1223
+ if (!i.name) throw new Error("extension name required");
1224
+ if ("renderer" in i) {
1225
+ let s = t.renderers[i.name];
1226
+ s ? t.renderers[i.name] = function(...a) {
1227
+ let o = i.renderer.apply(this, a);
1228
+ return o === false && (o = s.apply(this, a)), o;
1229
+ } : t.renderers[i.name] = i.renderer;
1230
+ }
1231
+ if ("tokenizer" in i) {
1232
+ if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1233
+ let s = t[i.level];
1234
+ s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
1235
+ }
1236
+ "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1237
+ }), r.extensions = t), n.renderer) {
1238
+ let i = this.defaults.renderer || new P(this.defaults);
1239
+ for (let s in n.renderer) {
1240
+ if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
1241
+ if (["options", "parser"].includes(s)) continue;
1242
+ let a = s, o = n.renderer[a], l = i[a];
1243
+ i[a] = (...p) => {
1244
+ let c = o.apply(i, p);
1245
+ return c === false && (c = l.apply(i, p)), c || "";
1246
+ };
1247
+ }
1248
+ r.renderer = i;
1249
+ }
1250
+ if (n.tokenizer) {
1251
+ let i = this.defaults.tokenizer || new y(this.defaults);
1252
+ for (let s in n.tokenizer) {
1253
+ if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
1254
+ if (["options", "rules", "lexer"].includes(s)) continue;
1255
+ let a = s, o = n.tokenizer[a], l = i[a];
1256
+ i[a] = (...p) => {
1257
+ let c = o.apply(i, p);
1258
+ return c === false && (c = l.apply(i, p)), c;
1259
+ };
1260
+ }
1261
+ r.tokenizer = i;
1262
+ }
1263
+ if (n.hooks) {
1264
+ let i = this.defaults.hooks || new S();
1265
+ for (let s in n.hooks) {
1266
+ if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
1267
+ if (["options", "block"].includes(s)) continue;
1268
+ let a = s, o = n.hooks[a], l = i[a];
1269
+ S.passThroughHooks.has(s) ? i[a] = (p) => {
1270
+ if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
1271
+ let g = await o.call(i, p);
1272
+ return l.call(i, g);
1273
+ })();
1274
+ let c = o.call(i, p);
1275
+ return l.call(i, c);
1276
+ } : i[a] = (...p) => {
1277
+ if (this.defaults.async) return (async () => {
1278
+ let g = await o.apply(i, p);
1279
+ return g === false && (g = await l.apply(i, p)), g;
1280
+ })();
1281
+ let c = o.apply(i, p);
1282
+ return c === false && (c = l.apply(i, p)), c;
1283
+ };
1284
+ }
1285
+ r.hooks = i;
1286
+ }
1287
+ if (n.walkTokens) {
1288
+ let i = this.defaults.walkTokens, s = n.walkTokens;
1289
+ r.walkTokens = function(a) {
1290
+ let o = [];
1291
+ return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
1292
+ };
1293
+ }
1294
+ this.defaults = { ...this.defaults, ...r };
1295
+ }), this;
1296
+ }
1297
+ setOptions(e) {
1298
+ return this.defaults = { ...this.defaults, ...e }, this;
1299
+ }
1300
+ lexer(e, t) {
1301
+ return x.lex(e, t ?? this.defaults);
1302
+ }
1303
+ parser(e, t) {
1304
+ return b.parse(e, t ?? this.defaults);
1305
+ }
1306
+ parseMarkdown(e) {
1307
+ return (n, r) => {
1308
+ let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
1309
+ if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1310
+ if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
1311
+ if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1312
+ if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
1313
+ let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
1314
+ s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1315
+ let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
1316
+ return s.hooks ? await s.hooks.postprocess(h) : h;
1317
+ })().catch(a);
1318
+ try {
1319
+ s.hooks && (n = s.hooks.preprocess(n));
1320
+ let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
1321
+ s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
1322
+ let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
1323
+ return s.hooks && (c = s.hooks.postprocess(c)), c;
1324
+ } catch (o) {
1325
+ return a(o);
1326
+ }
1327
+ };
1328
+ }
1329
+ onError(e, t) {
1330
+ return (n) => {
1331
+ if (n.message += `
1332
+ Please report this to https://github.com/markedjs/marked.`, e) {
1333
+ let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
1334
+ return t ? Promise.resolve(r) : r;
1335
+ }
1336
+ if (t) return Promise.reject(n);
1337
+ throw n;
1338
+ };
1339
+ }
1340
+ };
1341
+ var _ = new B();
1342
+ function d(u3, e) {
1343
+ return _.parse(u3, e);
1344
+ }
1345
+ d.options = d.setOptions = function(u3) {
1346
+ return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
1347
+ };
1348
+ d.getDefaults = L;
1349
+ d.defaults = T;
1350
+ d.use = function(...u3) {
1351
+ return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
1352
+ };
1353
+ d.walkTokens = function(u3, e) {
1354
+ return _.walkTokens(u3, e);
1355
+ };
1356
+ d.parseInline = _.parseInline;
1357
+ d.Parser = b;
1358
+ d.parser = b.parse;
1359
+ d.Renderer = P;
1360
+ d.TextRenderer = $;
1361
+ d.Lexer = x;
1362
+ d.lexer = x.lex;
1363
+ d.Tokenizer = y;
1364
+ d.Hooks = S;
1365
+ d.parse = d;
1366
+ d.options;
1367
+ d.setOptions;
1368
+ d.use;
1369
+ d.walkTokens;
1370
+ d.parseInline;
1371
+ b.parse;
1372
+ x.lex;
1373
+ const _sfc_main = {
1374
+ name: "NewsArticleView",
1375
+ props: {
1376
+ article: {
1377
+ type: Object,
1378
+ default: null
1379
+ },
1380
+ summary: {
1381
+ type: Boolean,
1382
+ default: false
1383
+ },
1384
+ route: {
1385
+ type: String,
1386
+ default: ""
1387
+ },
1388
+ enableComments: {
1389
+ type: Boolean,
1390
+ default: false
1391
+ },
1392
+ enableDisqus: {
1393
+ type: Boolean,
1394
+ default: false
1395
+ },
1396
+ enableLikes: {
1397
+ type: Boolean,
1398
+ default: false
1399
+ },
1400
+ disableTags: {
1401
+ type: Boolean,
1402
+ default: false
1403
+ },
1404
+ disableByLine: {
1405
+ type: Boolean,
1406
+ default: false
1407
+ },
1408
+ disableDates: {
1409
+ type: Boolean,
1410
+ default: false
1411
+ },
1412
+ showIcon: {
1413
+ type: Boolean,
1414
+ default: false
1415
+ },
1416
+ url: {
1417
+ type: String,
1418
+ default: ""
1419
+ },
1420
+ disqusShortname: {
1421
+ type: String,
1422
+ default: null
1423
+ }
1424
+ },
1425
+ components: {
1426
+ RouterLink
1427
+ },
1428
+ methods: {
1429
+ showDisqusThread() {
1430
+ let d2 = document, s = d2.createElement("script");
1431
+ s.src = "https://" + this.disqusShortname + ".disqus.com/embed.js";
1432
+ s.setAttribute("data-timestamp", +/* @__PURE__ */ new Date());
1433
+ (d2.head || d2.body).appendChild(s);
1434
+ },
1435
+ formatDate(str) {
1436
+ let d2 = new Date(str);
1437
+ return d2.toLocaleDateString("en-US") + " " + d2.toLocaleTimeString("en-US");
1438
+ },
1439
+ compileMarkdown(str) {
1440
+ return d(str);
1441
+ }
1442
+ },
1443
+ mounted() {
1444
+ if (this.enableDisqus && this.disqusShortname !== null) {
1445
+ this.showDisqusThread();
1446
+ }
1447
+ }
1448
+ };
1449
+ const _hoisted_1 = { class: "new-article-view" };
1450
+ const _hoisted_2 = {
1451
+ key: 0,
1452
+ class: "media mt-1 mb-3"
1453
+ };
1454
+ const _hoisted_3 = {
1455
+ key: 0,
1456
+ class: "media-left"
1457
+ };
1458
+ const _hoisted_4 = { class: "image is-64x64" };
1459
+ const _hoisted_5 = ["src"];
1460
+ const _hoisted_6 = ["src"];
1461
+ const _hoisted_7 = {
1462
+ key: 2,
1463
+ src: "https://bulma.io/assets/images/placeholders/128x128.png"
1464
+ };
1465
+ const _hoisted_8 = { class: "media-content" };
1466
+ const _hoisted_9 = { class: "content" };
1467
+ const _hoisted_10 = ["innerHTML"];
1468
+ const _hoisted_11 = { class: "level is-mobile mt-2" };
1469
+ const _hoisted_12 = { class: "level-left" };
1470
+ const _hoisted_13 = { key: 0 };
1471
+ const _hoisted_14 = { key: 0 };
1472
+ const _hoisted_15 = { class: "level-right" };
1473
+ const _hoisted_16 = { key: 0 };
1474
+ const _hoisted_17 = { class: "tag m-1" };
1475
+ const _hoisted_18 = ["href"];
1476
+ const _hoisted_19 = {
1477
+ key: 0,
1478
+ id: "disqus_thread"
1479
+ };
1480
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1481
+ const _component_router_link = vue.resolveComponent("router-link");
1482
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
1483
+ $props.article != null ? (vue.openBlock(), vue.createElementBlock("article", _hoisted_2, [
1484
+ $props.showIcon ? (vue.openBlock(), vue.createElementBlock("figure", _hoisted_3, [
1485
+ vue.createElementVNode("p", _hoisted_4, [
1486
+ vue.createVNode(_component_router_link, { to: $props.route }, {
1487
+ default: vue.withCtx(() => [
1488
+ $props.article.iconImage != null ? (vue.openBlock(), vue.createElementBlock("img", {
1489
+ key: 0,
1490
+ src: $props.article.iconImage
1491
+ }, null, 8, _hoisted_5)) : $props.article.iconId != null ? (vue.openBlock(), vue.createElementBlock("img", {
1492
+ key: 1,
1493
+ src: "/api/asset/" + $props.article.iconId
1494
+ }, null, 8, _hoisted_6)) : (vue.openBlock(), vue.createElementBlock("img", _hoisted_7))
1495
+ ]),
1496
+ _: 1
1497
+ }, 8, ["to"])
1498
+ ])
1499
+ ])) : vue.createCommentVNode("", true),
1500
+ vue.createElementVNode("div", _hoisted_8, [
1501
+ vue.createElementVNode("div", _hoisted_9, [
1502
+ vue.createVNode(_component_router_link, { to: $props.route }, {
1503
+ default: vue.withCtx(() => [
1504
+ vue.createElementVNode("h3", {
1505
+ class: vue.normalizeClass("title mb-2 " + (_ctx.small ? "is-5" : "is-4"))
1506
+ }, vue.toDisplayString($props.article.title), 3)
1507
+ ]),
1508
+ _: 1
1509
+ }, 8, ["to"]),
1510
+ vue.createElementVNode("span", {
1511
+ innerHTML: $options.compileMarkdown($props.summary ? $props.article.summary : $props.article.body)
1512
+ }, null, 8, _hoisted_10),
1513
+ vue.createElementVNode("div", _hoisted_11, [
1514
+ vue.createElementVNode("div", _hoisted_12, [
1515
+ !$props.disableByLine ? (vue.openBlock(), vue.createElementBlock("strong", _hoisted_13, [
1516
+ vue.createTextVNode(vue.toDisplayString($props.article.byLine) + " @ ", 1),
1517
+ !$props.disableDates ? (vue.openBlock(), vue.createElementBlock("small", _hoisted_14, vue.toDisplayString($options.formatDate($props.article.posted)), 1)) : vue.createCommentVNode("", true)
1518
+ ])) : vue.createCommentVNode("", true)
1519
+ ]),
1520
+ vue.createElementVNode("div", _hoisted_15, [
1521
+ !$props.disableTags ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_16, [
1522
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.article.tags, (tag) => {
1523
+ return vue.openBlock(), vue.createElementBlock("span", {
1524
+ key: $props.article.tags.indexOf(tag)
1525
+ }, [
1526
+ vue.createElementVNode("span", _hoisted_17, vue.toDisplayString(tag), 1)
1527
+ ]);
1528
+ }), 128))
1529
+ ])) : vue.createCommentVNode("", true),
1530
+ $props.summary && $props.url !== "" ? (vue.openBlock(), vue.createElementBlock("a", {
1531
+ key: 1,
1532
+ href: $props.url,
1533
+ class: "level-item"
1534
+ }, [..._cache[0] || (_cache[0] = [
1535
+ vue.createElementVNode("span", { class: "icon is-medium" }, [
1536
+ vue.createElementVNode("i", { class: "fa fa-search" })
1537
+ ], -1)
1538
+ ])], 8, _hoisted_18)) : $props.summary && $props.route !== "" ? (vue.openBlock(), vue.createBlock(_component_router_link, {
1539
+ key: 2,
1540
+ to: $props.route,
1541
+ class: "level-item"
1542
+ }, {
1543
+ default: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
1544
+ vue.createElementVNode("span", { class: "icon is-medium" }, [
1545
+ vue.createElementVNode("i", { class: "fa fa-search" })
1546
+ ], -1)
1547
+ ])]),
1548
+ _: 1
1549
+ }, 8, ["to"])) : vue.createCommentVNode("", true)
1550
+ ])
1551
+ ])
1552
+ ]),
1553
+ $props.enableDisqus ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19)) : vue.createCommentVNode("", true)
1554
+ ])
1555
+ ])) : vue.createCommentVNode("", true)
1556
+ ]);
1557
+ }
1558
+ const ArticleView = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-b6905e0a"]]);
1559
+ function bind(fn, thisArg) {
1560
+ return function wrap() {
1561
+ return fn.apply(thisArg, arguments);
1562
+ };
1563
+ }
1564
+ const { toString } = Object.prototype;
1565
+ const { getPrototypeOf } = Object;
1566
+ const { iterator, toStringTag } = Symbol;
1567
+ const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
1568
+ const str = toString.call(thing);
1569
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
1570
+ })(/* @__PURE__ */ Object.create(null));
1571
+ const kindOfTest = (type) => {
1572
+ type = type.toLowerCase();
1573
+ return (thing) => kindOf(thing) === type;
1574
+ };
1575
+ const typeOfTest = (type) => (thing) => typeof thing === type;
1576
+ const { isArray } = Array;
1577
+ const isUndefined = typeOfTest("undefined");
1578
+ function isBuffer(val) {
1579
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
1580
+ }
1581
+ const isArrayBuffer = kindOfTest("ArrayBuffer");
1582
+ function isArrayBufferView(val) {
1583
+ let result;
1584
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
1585
+ result = ArrayBuffer.isView(val);
1586
+ } else {
1587
+ result = val && val.buffer && isArrayBuffer(val.buffer);
1588
+ }
1589
+ return result;
1590
+ }
1591
+ const isString = typeOfTest("string");
1592
+ const isFunction$1 = typeOfTest("function");
1593
+ const isNumber = typeOfTest("number");
1594
+ const isObject = (thing) => thing !== null && typeof thing === "object";
1595
+ const isBoolean = (thing) => thing === true || thing === false;
1596
+ const isPlainObject = (val) => {
1597
+ if (kindOf(val) !== "object") {
1598
+ return false;
1599
+ }
1600
+ const prototype2 = getPrototypeOf(val);
1601
+ return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
1602
+ };
1603
+ const isEmptyObject = (val) => {
1604
+ if (!isObject(val) || isBuffer(val)) {
1605
+ return false;
1606
+ }
1607
+ try {
1608
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
1609
+ } catch (e) {
1610
+ return false;
1611
+ }
1612
+ };
1613
+ const isDate = kindOfTest("Date");
1614
+ const isFile = kindOfTest("File");
1615
+ const isBlob = kindOfTest("Blob");
1616
+ const isFileList = kindOfTest("FileList");
1617
+ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
1618
+ const isFormData = (thing) => {
1619
+ let kind;
1620
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
1621
+ kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
1622
+ };
1623
+ const isURLSearchParams = kindOfTest("URLSearchParams");
1624
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
1625
+ const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1626
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
1627
+ if (obj === null || typeof obj === "undefined") {
1628
+ return;
1629
+ }
1630
+ let i;
1631
+ let l;
1632
+ if (typeof obj !== "object") {
1633
+ obj = [obj];
1634
+ }
1635
+ if (isArray(obj)) {
1636
+ for (i = 0, l = obj.length; i < l; i++) {
1637
+ fn.call(null, obj[i], i, obj);
1638
+ }
1639
+ } else {
1640
+ if (isBuffer(obj)) {
1641
+ return;
1642
+ }
1643
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
1644
+ const len = keys.length;
1645
+ let key;
1646
+ for (i = 0; i < len; i++) {
1647
+ key = keys[i];
1648
+ fn.call(null, obj[key], key, obj);
1649
+ }
1650
+ }
1651
+ }
1652
+ function findKey(obj, key) {
1653
+ if (isBuffer(obj)) {
1654
+ return null;
1655
+ }
1656
+ key = key.toLowerCase();
1657
+ const keys = Object.keys(obj);
1658
+ let i = keys.length;
1659
+ let _key;
1660
+ while (i-- > 0) {
1661
+ _key = keys[i];
1662
+ if (key === _key.toLowerCase()) {
1663
+ return _key;
1664
+ }
1665
+ }
1666
+ return null;
1667
+ }
1668
+ const _global = (() => {
1669
+ if (typeof globalThis !== "undefined") return globalThis;
1670
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
1671
+ })();
1672
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
1673
+ function merge() {
1674
+ const { caseless, skipUndefined } = isContextDefined(this) && this || {};
1675
+ const result = {};
1676
+ const assignValue = (val, key) => {
1677
+ const targetKey = caseless && findKey(result, key) || key;
1678
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
1679
+ result[targetKey] = merge(result[targetKey], val);
1680
+ } else if (isPlainObject(val)) {
1681
+ result[targetKey] = merge({}, val);
1682
+ } else if (isArray(val)) {
1683
+ result[targetKey] = val.slice();
1684
+ } else if (!skipUndefined || !isUndefined(val)) {
1685
+ result[targetKey] = val;
1686
+ }
1687
+ };
1688
+ for (let i = 0, l = arguments.length; i < l; i++) {
1689
+ arguments[i] && forEach(arguments[i], assignValue);
1690
+ }
1691
+ return result;
1692
+ }
1693
+ const extend = (a, b2, thisArg, { allOwnKeys } = {}) => {
1694
+ forEach(b2, (val, key) => {
1695
+ if (thisArg && isFunction$1(val)) {
1696
+ a[key] = bind(val, thisArg);
1697
+ } else {
1698
+ a[key] = val;
1699
+ }
1700
+ }, { allOwnKeys });
1701
+ return a;
1702
+ };
1703
+ const stripBOM = (content2) => {
1704
+ if (content2.charCodeAt(0) === 65279) {
1705
+ content2 = content2.slice(1);
1706
+ }
1707
+ return content2;
1708
+ };
1709
+ const inherits = (constructor, superConstructor, props, descriptors2) => {
1710
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
1711
+ constructor.prototype.constructor = constructor;
1712
+ Object.defineProperty(constructor, "super", {
1713
+ value: superConstructor.prototype
1714
+ });
1715
+ props && Object.assign(constructor.prototype, props);
1716
+ };
1717
+ const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
1718
+ let props;
1719
+ let i;
1720
+ let prop;
1721
+ const merged = {};
1722
+ destObj = destObj || {};
1723
+ if (sourceObj == null) return destObj;
1724
+ do {
1725
+ props = Object.getOwnPropertyNames(sourceObj);
1726
+ i = props.length;
1727
+ while (i-- > 0) {
1728
+ prop = props[i];
1729
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
1730
+ destObj[prop] = sourceObj[prop];
1731
+ merged[prop] = true;
1732
+ }
1733
+ }
1734
+ sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
1735
+ } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
1736
+ return destObj;
1737
+ };
1738
+ const endsWith = (str, searchString, position) => {
1739
+ str = String(str);
1740
+ if (position === void 0 || position > str.length) {
1741
+ position = str.length;
1742
+ }
1743
+ position -= searchString.length;
1744
+ const lastIndex = str.indexOf(searchString, position);
1745
+ return lastIndex !== -1 && lastIndex === position;
1746
+ };
1747
+ const toArray = (thing) => {
1748
+ if (!thing) return null;
1749
+ if (isArray(thing)) return thing;
1750
+ let i = thing.length;
1751
+ if (!isNumber(i)) return null;
1752
+ const arr = new Array(i);
1753
+ while (i-- > 0) {
1754
+ arr[i] = thing[i];
1755
+ }
1756
+ return arr;
1757
+ };
1758
+ const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
1759
+ return (thing) => {
1760
+ return TypedArray && thing instanceof TypedArray;
1761
+ };
1762
+ })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
1763
+ const forEachEntry = (obj, fn) => {
1764
+ const generator = obj && obj[iterator];
1765
+ const _iterator = generator.call(obj);
1766
+ let result;
1767
+ while ((result = _iterator.next()) && !result.done) {
1768
+ const pair = result.value;
1769
+ fn.call(obj, pair[0], pair[1]);
1770
+ }
1771
+ };
1772
+ const matchAll = (regExp, str) => {
1773
+ let matches;
1774
+ const arr = [];
1775
+ while ((matches = regExp.exec(str)) !== null) {
1776
+ arr.push(matches);
1777
+ }
1778
+ return arr;
1779
+ };
1780
+ const isHTMLForm = kindOfTest("HTMLFormElement");
1781
+ const toCamelCase = (str) => {
1782
+ return str.toLowerCase().replace(
1783
+ /[-_\s]([a-z\d])(\w*)/g,
1784
+ function replacer(m2, p1, p2) {
1785
+ return p1.toUpperCase() + p2;
1786
+ }
1787
+ );
1788
+ };
1789
+ const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
1790
+ const isRegExp = kindOfTest("RegExp");
1791
+ const reduceDescriptors = (obj, reducer) => {
1792
+ const descriptors2 = Object.getOwnPropertyDescriptors(obj);
1793
+ const reducedDescriptors = {};
1794
+ forEach(descriptors2, (descriptor, name) => {
1795
+ let ret;
1796
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
1797
+ reducedDescriptors[name] = ret || descriptor;
1798
+ }
1799
+ });
1800
+ Object.defineProperties(obj, reducedDescriptors);
1801
+ };
1802
+ const freezeMethods = (obj) => {
1803
+ reduceDescriptors(obj, (descriptor, name) => {
1804
+ if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
1805
+ return false;
1806
+ }
1807
+ const value = obj[name];
1808
+ if (!isFunction$1(value)) return;
1809
+ descriptor.enumerable = false;
1810
+ if ("writable" in descriptor) {
1811
+ descriptor.writable = false;
1812
+ return;
1813
+ }
1814
+ if (!descriptor.set) {
1815
+ descriptor.set = () => {
1816
+ throw Error("Can not rewrite read-only method '" + name + "'");
1817
+ };
1818
+ }
1819
+ });
1820
+ };
1821
+ const toObjectSet = (arrayOrString, delimiter) => {
1822
+ const obj = {};
1823
+ const define = (arr) => {
1824
+ arr.forEach((value) => {
1825
+ obj[value] = true;
1826
+ });
1827
+ };
1828
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
1829
+ return obj;
1830
+ };
1831
+ const noop = () => {
1832
+ };
1833
+ const toFiniteNumber = (value, defaultValue) => {
1834
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
1835
+ };
1836
+ function isSpecCompliantForm(thing) {
1837
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
1838
+ }
1839
+ const toJSONObject = (obj) => {
1840
+ const stack = new Array(10);
1841
+ const visit = (source, i) => {
1842
+ if (isObject(source)) {
1843
+ if (stack.indexOf(source) >= 0) {
1844
+ return;
1845
+ }
1846
+ if (isBuffer(source)) {
1847
+ return source;
1848
+ }
1849
+ if (!("toJSON" in source)) {
1850
+ stack[i] = source;
1851
+ const target = isArray(source) ? [] : {};
1852
+ forEach(source, (value, key) => {
1853
+ const reducedValue = visit(value, i + 1);
1854
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
1855
+ });
1856
+ stack[i] = void 0;
1857
+ return target;
1858
+ }
1859
+ }
1860
+ return source;
1861
+ };
1862
+ return visit(obj, 0);
1863
+ };
1864
+ const isAsyncFn = kindOfTest("AsyncFunction");
1865
+ const isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
1866
+ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
1867
+ if (setImmediateSupported) {
1868
+ return setImmediate;
1869
+ }
1870
+ return postMessageSupported ? ((token, callbacks) => {
1871
+ _global.addEventListener("message", ({ source, data }) => {
1872
+ if (source === _global && data === token) {
1873
+ callbacks.length && callbacks.shift()();
1874
+ }
1875
+ }, false);
1876
+ return (cb) => {
1877
+ callbacks.push(cb);
1878
+ _global.postMessage(token, "*");
1879
+ };
1880
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
1881
+ })(
1882
+ typeof setImmediate === "function",
1883
+ isFunction$1(_global.postMessage)
1884
+ );
1885
+ const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
1886
+ const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
1887
+ const utils$1 = {
1888
+ isArray,
1889
+ isArrayBuffer,
1890
+ isBuffer,
1891
+ isFormData,
1892
+ isArrayBufferView,
1893
+ isString,
1894
+ isNumber,
1895
+ isBoolean,
1896
+ isObject,
1897
+ isPlainObject,
1898
+ isEmptyObject,
1899
+ isReadableStream,
1900
+ isRequest,
1901
+ isResponse,
1902
+ isHeaders,
1903
+ isUndefined,
1904
+ isDate,
1905
+ isFile,
1906
+ isBlob,
1907
+ isRegExp,
1908
+ isFunction: isFunction$1,
1909
+ isStream,
1910
+ isURLSearchParams,
1911
+ isTypedArray,
1912
+ isFileList,
1913
+ forEach,
1914
+ merge,
1915
+ extend,
1916
+ trim,
1917
+ stripBOM,
1918
+ inherits,
1919
+ toFlatObject,
1920
+ kindOf,
1921
+ kindOfTest,
1922
+ endsWith,
1923
+ toArray,
1924
+ forEachEntry,
1925
+ matchAll,
1926
+ isHTMLForm,
1927
+ hasOwnProperty,
1928
+ hasOwnProp: hasOwnProperty,
1929
+ // an alias to avoid ESLint no-prototype-builtins detection
1930
+ reduceDescriptors,
1931
+ freezeMethods,
1932
+ toObjectSet,
1933
+ toCamelCase,
1934
+ noop,
1935
+ toFiniteNumber,
1936
+ findKey,
1937
+ global: _global,
1938
+ isContextDefined,
1939
+ isSpecCompliantForm,
1940
+ toJSONObject,
1941
+ isAsyncFn,
1942
+ isThenable,
1943
+ setImmediate: _setImmediate,
1944
+ asap,
1945
+ isIterable
1946
+ };
1947
+ function AxiosError$1(message, code, config, request, response) {
1948
+ Error.call(this);
1949
+ if (Error.captureStackTrace) {
1950
+ Error.captureStackTrace(this, this.constructor);
1951
+ } else {
1952
+ this.stack = new Error().stack;
1953
+ }
1954
+ this.message = message;
1955
+ this.name = "AxiosError";
1956
+ code && (this.code = code);
1957
+ config && (this.config = config);
1958
+ request && (this.request = request);
1959
+ if (response) {
1960
+ this.response = response;
1961
+ this.status = response.status ? response.status : null;
1962
+ }
1963
+ }
1964
+ utils$1.inherits(AxiosError$1, Error, {
1965
+ toJSON: function toJSON() {
1966
+ return {
1967
+ // Standard
1968
+ message: this.message,
1969
+ name: this.name,
1970
+ // Microsoft
1971
+ description: this.description,
1972
+ number: this.number,
1973
+ // Mozilla
1974
+ fileName: this.fileName,
1975
+ lineNumber: this.lineNumber,
1976
+ columnNumber: this.columnNumber,
1977
+ stack: this.stack,
1978
+ // Axios
1979
+ config: utils$1.toJSONObject(this.config),
1980
+ code: this.code,
1981
+ status: this.status
1982
+ };
1983
+ }
1984
+ });
1985
+ const prototype$1 = AxiosError$1.prototype;
1986
+ const descriptors = {};
1987
+ [
1988
+ "ERR_BAD_OPTION_VALUE",
1989
+ "ERR_BAD_OPTION",
1990
+ "ECONNABORTED",
1991
+ "ETIMEDOUT",
1992
+ "ERR_NETWORK",
1993
+ "ERR_FR_TOO_MANY_REDIRECTS",
1994
+ "ERR_DEPRECATED",
1995
+ "ERR_BAD_RESPONSE",
1996
+ "ERR_BAD_REQUEST",
1997
+ "ERR_CANCELED",
1998
+ "ERR_NOT_SUPPORT",
1999
+ "ERR_INVALID_URL"
2000
+ // eslint-disable-next-line func-names
2001
+ ].forEach((code) => {
2002
+ descriptors[code] = { value: code };
2003
+ });
2004
+ Object.defineProperties(AxiosError$1, descriptors);
2005
+ Object.defineProperty(prototype$1, "isAxiosError", { value: true });
2006
+ AxiosError$1.from = (error, code, config, request, response, customProps) => {
2007
+ const axiosError = Object.create(prototype$1);
2008
+ utils$1.toFlatObject(error, axiosError, function filter2(obj) {
2009
+ return obj !== Error.prototype;
2010
+ }, (prop) => {
2011
+ return prop !== "isAxiosError";
2012
+ });
2013
+ const msg = error && error.message ? error.message : "Error";
2014
+ const errCode = code == null && error ? error.code : code;
2015
+ AxiosError$1.call(axiosError, msg, errCode, config, request, response);
2016
+ if (error && axiosError.cause == null) {
2017
+ Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
2018
+ }
2019
+ axiosError.name = error && error.name || "Error";
2020
+ customProps && Object.assign(axiosError, customProps);
2021
+ return axiosError;
2022
+ };
2023
+ const httpAdapter = null;
2024
+ function isVisitable(thing) {
2025
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
2026
+ }
2027
+ function removeBrackets(key) {
2028
+ return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
2029
+ }
2030
+ function renderKey(path, key, dots) {
2031
+ if (!path) return key;
2032
+ return path.concat(key).map(function each(token, i) {
2033
+ token = removeBrackets(token);
2034
+ return !dots && i ? "[" + token + "]" : token;
2035
+ }).join(dots ? "." : "");
2036
+ }
2037
+ function isFlatArray(arr) {
2038
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
2039
+ }
2040
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
2041
+ return /^is[A-Z]/.test(prop);
2042
+ });
2043
+ function toFormData$1(obj, formData, options) {
2044
+ if (!utils$1.isObject(obj)) {
2045
+ throw new TypeError("target must be an object");
2046
+ }
2047
+ formData = formData || new FormData();
2048
+ options = utils$1.toFlatObject(options, {
2049
+ metaTokens: true,
2050
+ dots: false,
2051
+ indexes: false
2052
+ }, false, function defined(option, source) {
2053
+ return !utils$1.isUndefined(source[option]);
2054
+ });
2055
+ const metaTokens = options.metaTokens;
2056
+ const visitor = options.visitor || defaultVisitor;
2057
+ const dots = options.dots;
2058
+ const indexes = options.indexes;
2059
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
2060
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
2061
+ if (!utils$1.isFunction(visitor)) {
2062
+ throw new TypeError("visitor must be a function");
2063
+ }
2064
+ function convertValue(value) {
2065
+ if (value === null) return "";
2066
+ if (utils$1.isDate(value)) {
2067
+ return value.toISOString();
2068
+ }
2069
+ if (utils$1.isBoolean(value)) {
2070
+ return value.toString();
2071
+ }
2072
+ if (!useBlob && utils$1.isBlob(value)) {
2073
+ throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
2074
+ }
2075
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
2076
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
2077
+ }
2078
+ return value;
2079
+ }
2080
+ function defaultVisitor(value, key, path) {
2081
+ let arr = value;
2082
+ if (value && !path && typeof value === "object") {
2083
+ if (utils$1.endsWith(key, "{}")) {
2084
+ key = metaTokens ? key : key.slice(0, -2);
2085
+ value = JSON.stringify(value);
2086
+ } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
2087
+ key = removeBrackets(key);
2088
+ arr.forEach(function each(el, index) {
2089
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
2090
+ // eslint-disable-next-line no-nested-ternary
2091
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
2092
+ convertValue(el)
2093
+ );
2094
+ });
2095
+ return false;
2096
+ }
2097
+ }
2098
+ if (isVisitable(value)) {
2099
+ return true;
2100
+ }
2101
+ formData.append(renderKey(path, key, dots), convertValue(value));
2102
+ return false;
2103
+ }
2104
+ const stack = [];
2105
+ const exposedHelpers = Object.assign(predicates, {
2106
+ defaultVisitor,
2107
+ convertValue,
2108
+ isVisitable
2109
+ });
2110
+ function build(value, path) {
2111
+ if (utils$1.isUndefined(value)) return;
2112
+ if (stack.indexOf(value) !== -1) {
2113
+ throw Error("Circular reference detected in " + path.join("."));
2114
+ }
2115
+ stack.push(value);
2116
+ utils$1.forEach(value, function each(el, key) {
2117
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
2118
+ formData,
2119
+ el,
2120
+ utils$1.isString(key) ? key.trim() : key,
2121
+ path,
2122
+ exposedHelpers
2123
+ );
2124
+ if (result === true) {
2125
+ build(el, path ? path.concat(key) : [key]);
2126
+ }
2127
+ });
2128
+ stack.pop();
2129
+ }
2130
+ if (!utils$1.isObject(obj)) {
2131
+ throw new TypeError("data must be an object");
2132
+ }
2133
+ build(obj);
2134
+ return formData;
2135
+ }
2136
+ function encode$1(str) {
2137
+ const charMap = {
2138
+ "!": "%21",
2139
+ "'": "%27",
2140
+ "(": "%28",
2141
+ ")": "%29",
2142
+ "~": "%7E",
2143
+ "%20": "+",
2144
+ "%00": "\0"
2145
+ };
2146
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
2147
+ return charMap[match];
2148
+ });
2149
+ }
2150
+ function AxiosURLSearchParams(params, options) {
2151
+ this._pairs = [];
2152
+ params && toFormData$1(params, this, options);
2153
+ }
2154
+ const prototype = AxiosURLSearchParams.prototype;
2155
+ prototype.append = function append(name, value) {
2156
+ this._pairs.push([name, value]);
2157
+ };
2158
+ prototype.toString = function toString2(encoder) {
2159
+ const _encode = encoder ? function(value) {
2160
+ return encoder.call(this, value, encode$1);
2161
+ } : encode$1;
2162
+ return this._pairs.map(function each(pair) {
2163
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
2164
+ }, "").join("&");
2165
+ };
2166
+ function encode(val) {
2167
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
2168
+ }
2169
+ function buildURL(url, params, options) {
2170
+ if (!params) {
2171
+ return url;
2172
+ }
2173
+ const _encode = options && options.encode || encode;
2174
+ if (utils$1.isFunction(options)) {
2175
+ options = {
2176
+ serialize: options
2177
+ };
2178
+ }
2179
+ const serializeFn = options && options.serialize;
2180
+ let serializedParams;
2181
+ if (serializeFn) {
2182
+ serializedParams = serializeFn(params, options);
2183
+ } else {
2184
+ serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
2185
+ }
2186
+ if (serializedParams) {
2187
+ const hashmarkIndex = url.indexOf("#");
2188
+ if (hashmarkIndex !== -1) {
2189
+ url = url.slice(0, hashmarkIndex);
2190
+ }
2191
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
2192
+ }
2193
+ return url;
2194
+ }
2195
+ class InterceptorManager {
2196
+ constructor() {
2197
+ this.handlers = [];
2198
+ }
2199
+ /**
2200
+ * Add a new interceptor to the stack
2201
+ *
2202
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
2203
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
2204
+ *
2205
+ * @return {Number} An ID used to remove interceptor later
2206
+ */
2207
+ use(fulfilled, rejected, options) {
2208
+ this.handlers.push({
2209
+ fulfilled,
2210
+ rejected,
2211
+ synchronous: options ? options.synchronous : false,
2212
+ runWhen: options ? options.runWhen : null
2213
+ });
2214
+ return this.handlers.length - 1;
2215
+ }
2216
+ /**
2217
+ * Remove an interceptor from the stack
2218
+ *
2219
+ * @param {Number} id The ID that was returned by `use`
2220
+ *
2221
+ * @returns {void}
2222
+ */
2223
+ eject(id) {
2224
+ if (this.handlers[id]) {
2225
+ this.handlers[id] = null;
2226
+ }
2227
+ }
2228
+ /**
2229
+ * Clear all interceptors from the stack
2230
+ *
2231
+ * @returns {void}
2232
+ */
2233
+ clear() {
2234
+ if (this.handlers) {
2235
+ this.handlers = [];
2236
+ }
2237
+ }
2238
+ /**
2239
+ * Iterate over all the registered interceptors
2240
+ *
2241
+ * This method is particularly useful for skipping over any
2242
+ * interceptors that may have become `null` calling `eject`.
2243
+ *
2244
+ * @param {Function} fn The function to call for each interceptor
2245
+ *
2246
+ * @returns {void}
2247
+ */
2248
+ forEach(fn) {
2249
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
2250
+ if (h !== null) {
2251
+ fn(h);
2252
+ }
2253
+ });
2254
+ }
2255
+ }
2256
+ const transitionalDefaults = {
2257
+ silentJSONParsing: true,
2258
+ forcedJSONParsing: true,
2259
+ clarifyTimeoutError: false
2260
+ };
2261
+ const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
2262
+ const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
2263
+ const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
2264
+ const platform$1 = {
2265
+ isBrowser: true,
2266
+ classes: {
2267
+ URLSearchParams: URLSearchParams$1,
2268
+ FormData: FormData$1,
2269
+ Blob: Blob$1
2270
+ },
2271
+ protocols: ["http", "https", "file", "blob", "url", "data"]
2272
+ };
2273
+ const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
2274
+ const _navigator = typeof navigator === "object" && navigator || void 0;
2275
+ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
2276
+ const hasStandardBrowserWebWorkerEnv = (() => {
2277
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
2278
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
2279
+ })();
2280
+ const origin = hasBrowserEnv && window.location.href || "http://localhost";
2281
+ const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2282
+ __proto__: null,
2283
+ hasBrowserEnv,
2284
+ hasStandardBrowserEnv,
2285
+ hasStandardBrowserWebWorkerEnv,
2286
+ navigator: _navigator,
2287
+ origin
2288
+ }, Symbol.toStringTag, { value: "Module" }));
2289
+ const platform = {
2290
+ ...utils,
2291
+ ...platform$1
2292
+ };
2293
+ function toURLEncodedForm(data, options) {
2294
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
2295
+ visitor: function(value, key, path, helpers) {
2296
+ if (platform.isNode && utils$1.isBuffer(value)) {
2297
+ this.append(key, value.toString("base64"));
2298
+ return false;
2299
+ }
2300
+ return helpers.defaultVisitor.apply(this, arguments);
2301
+ },
2302
+ ...options
2303
+ });
2304
+ }
2305
+ function parsePropPath(name) {
2306
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
2307
+ return match[0] === "[]" ? "" : match[1] || match[0];
2308
+ });
2309
+ }
2310
+ function arrayToObject(arr) {
2311
+ const obj = {};
2312
+ const keys = Object.keys(arr);
2313
+ let i;
2314
+ const len = keys.length;
2315
+ let key;
2316
+ for (i = 0; i < len; i++) {
2317
+ key = keys[i];
2318
+ obj[key] = arr[key];
2319
+ }
2320
+ return obj;
2321
+ }
2322
+ function formDataToJSON(formData) {
2323
+ function buildPath(path, value, target, index) {
2324
+ let name = path[index++];
2325
+ if (name === "__proto__") return true;
2326
+ const isNumericKey = Number.isFinite(+name);
2327
+ const isLast = index >= path.length;
2328
+ name = !name && utils$1.isArray(target) ? target.length : name;
2329
+ if (isLast) {
2330
+ if (utils$1.hasOwnProp(target, name)) {
2331
+ target[name] = [target[name], value];
2332
+ } else {
2333
+ target[name] = value;
2334
+ }
2335
+ return !isNumericKey;
2336
+ }
2337
+ if (!target[name] || !utils$1.isObject(target[name])) {
2338
+ target[name] = [];
2339
+ }
2340
+ const result = buildPath(path, value, target[name], index);
2341
+ if (result && utils$1.isArray(target[name])) {
2342
+ target[name] = arrayToObject(target[name]);
2343
+ }
2344
+ return !isNumericKey;
2345
+ }
2346
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
2347
+ const obj = {};
2348
+ utils$1.forEachEntry(formData, (name, value) => {
2349
+ buildPath(parsePropPath(name), value, obj, 0);
2350
+ });
2351
+ return obj;
2352
+ }
2353
+ return null;
2354
+ }
2355
+ function stringifySafely(rawValue, parser, encoder) {
2356
+ if (utils$1.isString(rawValue)) {
2357
+ try {
2358
+ (parser || JSON.parse)(rawValue);
2359
+ return utils$1.trim(rawValue);
2360
+ } catch (e) {
2361
+ if (e.name !== "SyntaxError") {
2362
+ throw e;
2363
+ }
2364
+ }
2365
+ }
2366
+ return (encoder || JSON.stringify)(rawValue);
2367
+ }
2368
+ const defaults = {
2369
+ transitional: transitionalDefaults,
2370
+ adapter: ["xhr", "http", "fetch"],
2371
+ transformRequest: [function transformRequest(data, headers) {
2372
+ const contentType = headers.getContentType() || "";
2373
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
2374
+ const isObjectPayload = utils$1.isObject(data);
2375
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
2376
+ data = new FormData(data);
2377
+ }
2378
+ const isFormData2 = utils$1.isFormData(data);
2379
+ if (isFormData2) {
2380
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2381
+ }
2382
+ 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)) {
2383
+ return data;
2384
+ }
2385
+ if (utils$1.isArrayBufferView(data)) {
2386
+ return data.buffer;
2387
+ }
2388
+ if (utils$1.isURLSearchParams(data)) {
2389
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
2390
+ return data.toString();
2391
+ }
2392
+ let isFileList2;
2393
+ if (isObjectPayload) {
2394
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
2395
+ return toURLEncodedForm(data, this.formSerializer).toString();
2396
+ }
2397
+ if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
2398
+ const _FormData = this.env && this.env.FormData;
2399
+ return toFormData$1(
2400
+ isFileList2 ? { "files[]": data } : data,
2401
+ _FormData && new _FormData(),
2402
+ this.formSerializer
2403
+ );
2404
+ }
2405
+ }
2406
+ if (isObjectPayload || hasJSONContentType) {
2407
+ headers.setContentType("application/json", false);
2408
+ return stringifySafely(data);
2409
+ }
2410
+ return data;
2411
+ }],
2412
+ transformResponse: [function transformResponse(data) {
2413
+ const transitional2 = this.transitional || defaults.transitional;
2414
+ const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
2415
+ const JSONRequested = this.responseType === "json";
2416
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
2417
+ return data;
2418
+ }
2419
+ if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
2420
+ const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
2421
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
2422
+ try {
2423
+ return JSON.parse(data, this.parseReviver);
2424
+ } catch (e) {
2425
+ if (strictJSONParsing) {
2426
+ if (e.name === "SyntaxError") {
2427
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
2428
+ }
2429
+ throw e;
2430
+ }
2431
+ }
2432
+ }
2433
+ return data;
2434
+ }],
2435
+ /**
2436
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
2437
+ * timeout is not created.
2438
+ */
2439
+ timeout: 0,
2440
+ xsrfCookieName: "XSRF-TOKEN",
2441
+ xsrfHeaderName: "X-XSRF-TOKEN",
2442
+ maxContentLength: -1,
2443
+ maxBodyLength: -1,
2444
+ env: {
2445
+ FormData: platform.classes.FormData,
2446
+ Blob: platform.classes.Blob
2447
+ },
2448
+ validateStatus: function validateStatus(status) {
2449
+ return status >= 200 && status < 300;
2450
+ },
2451
+ headers: {
2452
+ common: {
2453
+ "Accept": "application/json, text/plain, */*",
2454
+ "Content-Type": void 0
2455
+ }
2456
+ }
2457
+ };
2458
+ utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
2459
+ defaults.headers[method] = {};
2460
+ });
2461
+ const ignoreDuplicateOf = utils$1.toObjectSet([
2462
+ "age",
2463
+ "authorization",
2464
+ "content-length",
2465
+ "content-type",
2466
+ "etag",
2467
+ "expires",
2468
+ "from",
2469
+ "host",
2470
+ "if-modified-since",
2471
+ "if-unmodified-since",
2472
+ "last-modified",
2473
+ "location",
2474
+ "max-forwards",
2475
+ "proxy-authorization",
2476
+ "referer",
2477
+ "retry-after",
2478
+ "user-agent"
2479
+ ]);
2480
+ const parseHeaders = (rawHeaders) => {
2481
+ const parsed = {};
2482
+ let key;
2483
+ let val;
2484
+ let i;
2485
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
2486
+ i = line.indexOf(":");
2487
+ key = line.substring(0, i).trim().toLowerCase();
2488
+ val = line.substring(i + 1).trim();
2489
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
2490
+ return;
2491
+ }
2492
+ if (key === "set-cookie") {
2493
+ if (parsed[key]) {
2494
+ parsed[key].push(val);
2495
+ } else {
2496
+ parsed[key] = [val];
2497
+ }
2498
+ } else {
2499
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
2500
+ }
2501
+ });
2502
+ return parsed;
2503
+ };
2504
+ const $internals = /* @__PURE__ */ Symbol("internals");
2505
+ function normalizeHeader(header) {
2506
+ return header && String(header).trim().toLowerCase();
2507
+ }
2508
+ function normalizeValue(value) {
2509
+ if (value === false || value == null) {
2510
+ return value;
2511
+ }
2512
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
2513
+ }
2514
+ function parseTokens(str) {
2515
+ const tokens = /* @__PURE__ */ Object.create(null);
2516
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2517
+ let match;
2518
+ while (match = tokensRE.exec(str)) {
2519
+ tokens[match[1]] = match[2];
2520
+ }
2521
+ return tokens;
2522
+ }
2523
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
2524
+ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
2525
+ if (utils$1.isFunction(filter2)) {
2526
+ return filter2.call(this, value, header);
2527
+ }
2528
+ if (isHeaderNameFilter) {
2529
+ value = header;
2530
+ }
2531
+ if (!utils$1.isString(value)) return;
2532
+ if (utils$1.isString(filter2)) {
2533
+ return value.indexOf(filter2) !== -1;
2534
+ }
2535
+ if (utils$1.isRegExp(filter2)) {
2536
+ return filter2.test(value);
2537
+ }
2538
+ }
2539
+ function formatHeader(header) {
2540
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char, str) => {
2541
+ return char.toUpperCase() + str;
2542
+ });
2543
+ }
2544
+ function buildAccessors(obj, header) {
2545
+ const accessorName = utils$1.toCamelCase(" " + header);
2546
+ ["get", "set", "has"].forEach((methodName) => {
2547
+ Object.defineProperty(obj, methodName + accessorName, {
2548
+ value: function(arg1, arg2, arg3) {
2549
+ return this[methodName].call(this, header, arg1, arg2, arg3);
2550
+ },
2551
+ configurable: true
2552
+ });
2553
+ });
2554
+ }
2555
+ let AxiosHeaders$1 = class AxiosHeaders {
2556
+ constructor(headers) {
2557
+ headers && this.set(headers);
2558
+ }
2559
+ set(header, valueOrRewrite, rewrite) {
2560
+ const self2 = this;
2561
+ function setHeader(_value, _header, _rewrite) {
2562
+ const lHeader = normalizeHeader(_header);
2563
+ if (!lHeader) {
2564
+ throw new Error("header name must be a non-empty string");
2565
+ }
2566
+ const key = utils$1.findKey(self2, lHeader);
2567
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
2568
+ self2[key || _header] = normalizeValue(_value);
2569
+ }
2570
+ }
2571
+ const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2572
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
2573
+ setHeaders(header, valueOrRewrite);
2574
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2575
+ setHeaders(parseHeaders(header), valueOrRewrite);
2576
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
2577
+ let obj = {}, dest, key;
2578
+ for (const entry of header) {
2579
+ if (!utils$1.isArray(entry)) {
2580
+ throw TypeError("Object iterator must return a key-value pair");
2581
+ }
2582
+ obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
2583
+ }
2584
+ setHeaders(obj, valueOrRewrite);
2585
+ } else {
2586
+ header != null && setHeader(valueOrRewrite, header, rewrite);
2587
+ }
2588
+ return this;
2589
+ }
2590
+ get(header, parser) {
2591
+ header = normalizeHeader(header);
2592
+ if (header) {
2593
+ const key = utils$1.findKey(this, header);
2594
+ if (key) {
2595
+ const value = this[key];
2596
+ if (!parser) {
2597
+ return value;
2598
+ }
2599
+ if (parser === true) {
2600
+ return parseTokens(value);
2601
+ }
2602
+ if (utils$1.isFunction(parser)) {
2603
+ return parser.call(this, value, key);
2604
+ }
2605
+ if (utils$1.isRegExp(parser)) {
2606
+ return parser.exec(value);
2607
+ }
2608
+ throw new TypeError("parser must be boolean|regexp|function");
2609
+ }
2610
+ }
2611
+ }
2612
+ has(header, matcher) {
2613
+ header = normalizeHeader(header);
2614
+ if (header) {
2615
+ const key = utils$1.findKey(this, header);
2616
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
2617
+ }
2618
+ return false;
2619
+ }
2620
+ delete(header, matcher) {
2621
+ const self2 = this;
2622
+ let deleted = false;
2623
+ function deleteHeader(_header) {
2624
+ _header = normalizeHeader(_header);
2625
+ if (_header) {
2626
+ const key = utils$1.findKey(self2, _header);
2627
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
2628
+ delete self2[key];
2629
+ deleted = true;
2630
+ }
2631
+ }
2632
+ }
2633
+ if (utils$1.isArray(header)) {
2634
+ header.forEach(deleteHeader);
2635
+ } else {
2636
+ deleteHeader(header);
2637
+ }
2638
+ return deleted;
2639
+ }
2640
+ clear(matcher) {
2641
+ const keys = Object.keys(this);
2642
+ let i = keys.length;
2643
+ let deleted = false;
2644
+ while (i--) {
2645
+ const key = keys[i];
2646
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
2647
+ delete this[key];
2648
+ deleted = true;
2649
+ }
2650
+ }
2651
+ return deleted;
2652
+ }
2653
+ normalize(format) {
2654
+ const self2 = this;
2655
+ const headers = {};
2656
+ utils$1.forEach(this, (value, header) => {
2657
+ const key = utils$1.findKey(headers, header);
2658
+ if (key) {
2659
+ self2[key] = normalizeValue(value);
2660
+ delete self2[header];
2661
+ return;
2662
+ }
2663
+ const normalized = format ? formatHeader(header) : String(header).trim();
2664
+ if (normalized !== header) {
2665
+ delete self2[header];
2666
+ }
2667
+ self2[normalized] = normalizeValue(value);
2668
+ headers[normalized] = true;
2669
+ });
2670
+ return this;
2671
+ }
2672
+ concat(...targets) {
2673
+ return this.constructor.concat(this, ...targets);
2674
+ }
2675
+ toJSON(asStrings) {
2676
+ const obj = /* @__PURE__ */ Object.create(null);
2677
+ utils$1.forEach(this, (value, header) => {
2678
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
2679
+ });
2680
+ return obj;
2681
+ }
2682
+ [Symbol.iterator]() {
2683
+ return Object.entries(this.toJSON())[Symbol.iterator]();
2684
+ }
2685
+ toString() {
2686
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
2687
+ }
2688
+ getSetCookie() {
2689
+ return this.get("set-cookie") || [];
2690
+ }
2691
+ get [Symbol.toStringTag]() {
2692
+ return "AxiosHeaders";
2693
+ }
2694
+ static from(thing) {
2695
+ return thing instanceof this ? thing : new this(thing);
2696
+ }
2697
+ static concat(first, ...targets) {
2698
+ const computed = new this(first);
2699
+ targets.forEach((target) => computed.set(target));
2700
+ return computed;
2701
+ }
2702
+ static accessor(header) {
2703
+ const internals = this[$internals] = this[$internals] = {
2704
+ accessors: {}
2705
+ };
2706
+ const accessors = internals.accessors;
2707
+ const prototype2 = this.prototype;
2708
+ function defineAccessor(_header) {
2709
+ const lHeader = normalizeHeader(_header);
2710
+ if (!accessors[lHeader]) {
2711
+ buildAccessors(prototype2, _header);
2712
+ accessors[lHeader] = true;
2713
+ }
2714
+ }
2715
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2716
+ return this;
2717
+ }
2718
+ };
2719
+ AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2720
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
2721
+ let mapped = key[0].toUpperCase() + key.slice(1);
2722
+ return {
2723
+ get: () => value,
2724
+ set(headerValue) {
2725
+ this[mapped] = headerValue;
2726
+ }
2727
+ };
2728
+ });
2729
+ utils$1.freezeMethods(AxiosHeaders$1);
2730
+ function transformData(fns, response) {
2731
+ const config = this || defaults;
2732
+ const context = response || config;
2733
+ const headers = AxiosHeaders$1.from(context.headers);
2734
+ let data = context.data;
2735
+ utils$1.forEach(fns, function transform(fn) {
2736
+ data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
2737
+ });
2738
+ headers.normalize();
2739
+ return data;
2740
+ }
2741
+ function isCancel$1(value) {
2742
+ return !!(value && value.__CANCEL__);
2743
+ }
2744
+ function CanceledError$1(message, config, request) {
2745
+ AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
2746
+ this.name = "CanceledError";
2747
+ }
2748
+ utils$1.inherits(CanceledError$1, AxiosError$1, {
2749
+ __CANCEL__: true
2750
+ });
2751
+ function settle(resolve, reject, response) {
2752
+ const validateStatus2 = response.config.validateStatus;
2753
+ if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
2754
+ resolve(response);
2755
+ } else {
2756
+ reject(new AxiosError$1(
2757
+ "Request failed with status code " + response.status,
2758
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2759
+ response.config,
2760
+ response.request,
2761
+ response
2762
+ ));
2763
+ }
2764
+ }
2765
+ function parseProtocol(url) {
2766
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2767
+ return match && match[1] || "";
2768
+ }
2769
+ function speedometer(samplesCount, min) {
2770
+ samplesCount = samplesCount || 10;
2771
+ const bytes = new Array(samplesCount);
2772
+ const timestamps = new Array(samplesCount);
2773
+ let head = 0;
2774
+ let tail = 0;
2775
+ let firstSampleTS;
2776
+ min = min !== void 0 ? min : 1e3;
2777
+ return function push(chunkLength) {
2778
+ const now = Date.now();
2779
+ const startedAt = timestamps[tail];
2780
+ if (!firstSampleTS) {
2781
+ firstSampleTS = now;
2782
+ }
2783
+ bytes[head] = chunkLength;
2784
+ timestamps[head] = now;
2785
+ let i = tail;
2786
+ let bytesCount = 0;
2787
+ while (i !== head) {
2788
+ bytesCount += bytes[i++];
2789
+ i = i % samplesCount;
2790
+ }
2791
+ head = (head + 1) % samplesCount;
2792
+ if (head === tail) {
2793
+ tail = (tail + 1) % samplesCount;
2794
+ }
2795
+ if (now - firstSampleTS < min) {
2796
+ return;
2797
+ }
2798
+ const passed = startedAt && now - startedAt;
2799
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
2800
+ };
2801
+ }
2802
+ function throttle(fn, freq) {
2803
+ let timestamp = 0;
2804
+ let threshold = 1e3 / freq;
2805
+ let lastArgs;
2806
+ let timer;
2807
+ const invoke = (args, now = Date.now()) => {
2808
+ timestamp = now;
2809
+ lastArgs = null;
2810
+ if (timer) {
2811
+ clearTimeout(timer);
2812
+ timer = null;
2813
+ }
2814
+ fn(...args);
2815
+ };
2816
+ const throttled = (...args) => {
2817
+ const now = Date.now();
2818
+ const passed = now - timestamp;
2819
+ if (passed >= threshold) {
2820
+ invoke(args, now);
2821
+ } else {
2822
+ lastArgs = args;
2823
+ if (!timer) {
2824
+ timer = setTimeout(() => {
2825
+ timer = null;
2826
+ invoke(lastArgs);
2827
+ }, threshold - passed);
2828
+ }
2829
+ }
2830
+ };
2831
+ const flush = () => lastArgs && invoke(lastArgs);
2832
+ return [throttled, flush];
2833
+ }
2834
+ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2835
+ let bytesNotified = 0;
2836
+ const _speedometer = speedometer(50, 250);
2837
+ return throttle((e) => {
2838
+ const loaded = e.loaded;
2839
+ const total = e.lengthComputable ? e.total : void 0;
2840
+ const progressBytes = loaded - bytesNotified;
2841
+ const rate = _speedometer(progressBytes);
2842
+ const inRange = loaded <= total;
2843
+ bytesNotified = loaded;
2844
+ const data = {
2845
+ loaded,
2846
+ total,
2847
+ progress: total ? loaded / total : void 0,
2848
+ bytes: progressBytes,
2849
+ rate: rate ? rate : void 0,
2850
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
2851
+ event: e,
2852
+ lengthComputable: total != null,
2853
+ [isDownloadStream ? "download" : "upload"]: true
2854
+ };
2855
+ listener(data);
2856
+ }, freq);
2857
+ };
2858
+ const progressEventDecorator = (total, throttled) => {
2859
+ const lengthComputable = total != null;
2860
+ return [(loaded) => throttled[0]({
2861
+ lengthComputable,
2862
+ total,
2863
+ loaded
2864
+ }), throttled[1]];
2865
+ };
2866
+ const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
2867
+ const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
2868
+ url = new URL(url, platform.origin);
2869
+ return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
2870
+ })(
2871
+ new URL(platform.origin),
2872
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
2873
+ ) : () => true;
2874
+ const cookies = platform.hasStandardBrowserEnv ? (
2875
+ // Standard browser envs support document.cookie
2876
+ {
2877
+ write(name, value, expires, path, domain, secure, sameSite) {
2878
+ if (typeof document === "undefined") return;
2879
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
2880
+ if (utils$1.isNumber(expires)) {
2881
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
2882
+ }
2883
+ if (utils$1.isString(path)) {
2884
+ cookie.push(`path=${path}`);
2885
+ }
2886
+ if (utils$1.isString(domain)) {
2887
+ cookie.push(`domain=${domain}`);
2888
+ }
2889
+ if (secure === true) {
2890
+ cookie.push("secure");
2891
+ }
2892
+ if (utils$1.isString(sameSite)) {
2893
+ cookie.push(`SameSite=${sameSite}`);
2894
+ }
2895
+ document.cookie = cookie.join("; ");
2896
+ },
2897
+ read(name) {
2898
+ if (typeof document === "undefined") return null;
2899
+ const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
2900
+ return match ? decodeURIComponent(match[1]) : null;
2901
+ },
2902
+ remove(name) {
2903
+ this.write(name, "", Date.now() - 864e5, "/");
2904
+ }
2905
+ }
2906
+ ) : (
2907
+ // Non-standard browser env (web workers, react-native) lack needed support.
2908
+ {
2909
+ write() {
2910
+ },
2911
+ read() {
2912
+ return null;
2913
+ },
2914
+ remove() {
2915
+ }
2916
+ }
2917
+ );
2918
+ function isAbsoluteURL(url) {
2919
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2920
+ }
2921
+ function combineURLs(baseURL, relativeURL) {
2922
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
2923
+ }
2924
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2925
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
2926
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
2927
+ return combineURLs(baseURL, requestedURL);
2928
+ }
2929
+ return requestedURL;
2930
+ }
2931
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
2932
+ function mergeConfig$1(config1, config2) {
2933
+ config2 = config2 || {};
2934
+ const config = {};
2935
+ function getMergedValue(target, source, prop, caseless) {
2936
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2937
+ return utils$1.merge.call({ caseless }, target, source);
2938
+ } else if (utils$1.isPlainObject(source)) {
2939
+ return utils$1.merge({}, source);
2940
+ } else if (utils$1.isArray(source)) {
2941
+ return source.slice();
2942
+ }
2943
+ return source;
2944
+ }
2945
+ function mergeDeepProperties(a, b2, prop, caseless) {
2946
+ if (!utils$1.isUndefined(b2)) {
2947
+ return getMergedValue(a, b2, prop, caseless);
2948
+ } else if (!utils$1.isUndefined(a)) {
2949
+ return getMergedValue(void 0, a, prop, caseless);
2950
+ }
2951
+ }
2952
+ function valueFromConfig2(a, b2) {
2953
+ if (!utils$1.isUndefined(b2)) {
2954
+ return getMergedValue(void 0, b2);
2955
+ }
2956
+ }
2957
+ function defaultToConfig2(a, b2) {
2958
+ if (!utils$1.isUndefined(b2)) {
2959
+ return getMergedValue(void 0, b2);
2960
+ } else if (!utils$1.isUndefined(a)) {
2961
+ return getMergedValue(void 0, a);
2962
+ }
2963
+ }
2964
+ function mergeDirectKeys(a, b2, prop) {
2965
+ if (prop in config2) {
2966
+ return getMergedValue(a, b2);
2967
+ } else if (prop in config1) {
2968
+ return getMergedValue(void 0, a);
2969
+ }
2970
+ }
2971
+ const mergeMap = {
2972
+ url: valueFromConfig2,
2973
+ method: valueFromConfig2,
2974
+ data: valueFromConfig2,
2975
+ baseURL: defaultToConfig2,
2976
+ transformRequest: defaultToConfig2,
2977
+ transformResponse: defaultToConfig2,
2978
+ paramsSerializer: defaultToConfig2,
2979
+ timeout: defaultToConfig2,
2980
+ timeoutMessage: defaultToConfig2,
2981
+ withCredentials: defaultToConfig2,
2982
+ withXSRFToken: defaultToConfig2,
2983
+ adapter: defaultToConfig2,
2984
+ responseType: defaultToConfig2,
2985
+ xsrfCookieName: defaultToConfig2,
2986
+ xsrfHeaderName: defaultToConfig2,
2987
+ onUploadProgress: defaultToConfig2,
2988
+ onDownloadProgress: defaultToConfig2,
2989
+ decompress: defaultToConfig2,
2990
+ maxContentLength: defaultToConfig2,
2991
+ maxBodyLength: defaultToConfig2,
2992
+ beforeRedirect: defaultToConfig2,
2993
+ transport: defaultToConfig2,
2994
+ httpAgent: defaultToConfig2,
2995
+ httpsAgent: defaultToConfig2,
2996
+ cancelToken: defaultToConfig2,
2997
+ socketPath: defaultToConfig2,
2998
+ responseEncoding: defaultToConfig2,
2999
+ validateStatus: mergeDirectKeys,
3000
+ headers: (a, b2, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b2), prop, true)
3001
+ };
3002
+ utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
3003
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
3004
+ const configValue = merge2(config1[prop], config2[prop], prop);
3005
+ utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
3006
+ });
3007
+ return config;
3008
+ }
3009
+ const resolveConfig = (config) => {
3010
+ const newConfig = mergeConfig$1({}, config);
3011
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
3012
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
3013
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
3014
+ if (auth) {
3015
+ headers.set(
3016
+ "Authorization",
3017
+ "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
3018
+ );
3019
+ }
3020
+ if (utils$1.isFormData(data)) {
3021
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
3022
+ headers.setContentType(void 0);
3023
+ } else if (utils$1.isFunction(data.getHeaders)) {
3024
+ const formHeaders = data.getHeaders();
3025
+ const allowedHeaders = ["content-type", "content-length"];
3026
+ Object.entries(formHeaders).forEach(([key, val]) => {
3027
+ if (allowedHeaders.includes(key.toLowerCase())) {
3028
+ headers.set(key, val);
3029
+ }
3030
+ });
3031
+ }
3032
+ }
3033
+ if (platform.hasStandardBrowserEnv) {
3034
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
3035
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
3036
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
3037
+ if (xsrfValue) {
3038
+ headers.set(xsrfHeaderName, xsrfValue);
3039
+ }
3040
+ }
3041
+ }
3042
+ return newConfig;
3043
+ };
3044
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
3045
+ const xhrAdapter = isXHRAdapterSupported && function(config) {
3046
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
3047
+ const _config = resolveConfig(config);
3048
+ let requestData = _config.data;
3049
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
3050
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
3051
+ let onCanceled;
3052
+ let uploadThrottled, downloadThrottled;
3053
+ let flushUpload, flushDownload;
3054
+ function done() {
3055
+ flushUpload && flushUpload();
3056
+ flushDownload && flushDownload();
3057
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
3058
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
3059
+ }
3060
+ let request = new XMLHttpRequest();
3061
+ request.open(_config.method.toUpperCase(), _config.url, true);
3062
+ request.timeout = _config.timeout;
3063
+ function onloadend() {
3064
+ if (!request) {
3065
+ return;
3066
+ }
3067
+ const responseHeaders = AxiosHeaders$1.from(
3068
+ "getAllResponseHeaders" in request && request.getAllResponseHeaders()
3069
+ );
3070
+ const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
3071
+ const response = {
3072
+ data: responseData,
3073
+ status: request.status,
3074
+ statusText: request.statusText,
3075
+ headers: responseHeaders,
3076
+ config,
3077
+ request
3078
+ };
3079
+ settle(function _resolve(value) {
3080
+ resolve(value);
3081
+ done();
3082
+ }, function _reject(err) {
3083
+ reject(err);
3084
+ done();
3085
+ }, response);
3086
+ request = null;
3087
+ }
3088
+ if ("onloadend" in request) {
3089
+ request.onloadend = onloadend;
3090
+ } else {
3091
+ request.onreadystatechange = function handleLoad() {
3092
+ if (!request || request.readyState !== 4) {
3093
+ return;
3094
+ }
3095
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
3096
+ return;
3097
+ }
3098
+ setTimeout(onloadend);
3099
+ };
3100
+ }
3101
+ request.onabort = function handleAbort() {
3102
+ if (!request) {
3103
+ return;
3104
+ }
3105
+ reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
3106
+ request = null;
3107
+ };
3108
+ request.onerror = function handleError(event) {
3109
+ const msg = event && event.message ? event.message : "Network Error";
3110
+ const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
3111
+ err.event = event || null;
3112
+ reject(err);
3113
+ request = null;
3114
+ };
3115
+ request.ontimeout = function handleTimeout() {
3116
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
3117
+ const transitional2 = _config.transitional || transitionalDefaults;
3118
+ if (_config.timeoutErrorMessage) {
3119
+ timeoutErrorMessage = _config.timeoutErrorMessage;
3120
+ }
3121
+ reject(new AxiosError$1(
3122
+ timeoutErrorMessage,
3123
+ transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
3124
+ config,
3125
+ request
3126
+ ));
3127
+ request = null;
3128
+ };
3129
+ requestData === void 0 && requestHeaders.setContentType(null);
3130
+ if ("setRequestHeader" in request) {
3131
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
3132
+ request.setRequestHeader(key, val);
3133
+ });
3134
+ }
3135
+ if (!utils$1.isUndefined(_config.withCredentials)) {
3136
+ request.withCredentials = !!_config.withCredentials;
3137
+ }
3138
+ if (responseType && responseType !== "json") {
3139
+ request.responseType = _config.responseType;
3140
+ }
3141
+ if (onDownloadProgress) {
3142
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
3143
+ request.addEventListener("progress", downloadThrottled);
3144
+ }
3145
+ if (onUploadProgress && request.upload) {
3146
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
3147
+ request.upload.addEventListener("progress", uploadThrottled);
3148
+ request.upload.addEventListener("loadend", flushUpload);
3149
+ }
3150
+ if (_config.cancelToken || _config.signal) {
3151
+ onCanceled = (cancel) => {
3152
+ if (!request) {
3153
+ return;
3154
+ }
3155
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
3156
+ request.abort();
3157
+ request = null;
3158
+ };
3159
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
3160
+ if (_config.signal) {
3161
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
3162
+ }
3163
+ }
3164
+ const protocol = parseProtocol(_config.url);
3165
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
3166
+ reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
3167
+ return;
3168
+ }
3169
+ request.send(requestData || null);
3170
+ });
3171
+ };
3172
+ const composeSignals = (signals, timeout) => {
3173
+ const { length } = signals = signals ? signals.filter(Boolean) : [];
3174
+ if (timeout || length) {
3175
+ let controller = new AbortController();
3176
+ let aborted;
3177
+ const onabort = function(reason) {
3178
+ if (!aborted) {
3179
+ aborted = true;
3180
+ unsubscribe();
3181
+ const err = reason instanceof Error ? reason : this.reason;
3182
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
3183
+ }
3184
+ };
3185
+ let timer = timeout && setTimeout(() => {
3186
+ timer = null;
3187
+ onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
3188
+ }, timeout);
3189
+ const unsubscribe = () => {
3190
+ if (signals) {
3191
+ timer && clearTimeout(timer);
3192
+ timer = null;
3193
+ signals.forEach((signal2) => {
3194
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
3195
+ });
3196
+ signals = null;
3197
+ }
3198
+ };
3199
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
3200
+ const { signal } = controller;
3201
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
3202
+ return signal;
3203
+ }
3204
+ };
3205
+ const streamChunk = function* (chunk, chunkSize) {
3206
+ let len = chunk.byteLength;
3207
+ if (len < chunkSize) {
3208
+ yield chunk;
3209
+ return;
3210
+ }
3211
+ let pos = 0;
3212
+ let end;
3213
+ while (pos < len) {
3214
+ end = pos + chunkSize;
3215
+ yield chunk.slice(pos, end);
3216
+ pos = end;
3217
+ }
3218
+ };
3219
+ const readBytes = async function* (iterable, chunkSize) {
3220
+ for await (const chunk of readStream(iterable)) {
3221
+ yield* streamChunk(chunk, chunkSize);
3222
+ }
3223
+ };
3224
+ const readStream = async function* (stream) {
3225
+ if (stream[Symbol.asyncIterator]) {
3226
+ yield* stream;
3227
+ return;
3228
+ }
3229
+ const reader = stream.getReader();
3230
+ try {
3231
+ for (; ; ) {
3232
+ const { done, value } = await reader.read();
3233
+ if (done) {
3234
+ break;
3235
+ }
3236
+ yield value;
3237
+ }
3238
+ } finally {
3239
+ await reader.cancel();
3240
+ }
3241
+ };
3242
+ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
3243
+ const iterator2 = readBytes(stream, chunkSize);
3244
+ let bytes = 0;
3245
+ let done;
3246
+ let _onFinish = (e) => {
3247
+ if (!done) {
3248
+ done = true;
3249
+ onFinish && onFinish(e);
3250
+ }
3251
+ };
3252
+ return new ReadableStream({
3253
+ async pull(controller) {
3254
+ try {
3255
+ const { done: done2, value } = await iterator2.next();
3256
+ if (done2) {
3257
+ _onFinish();
3258
+ controller.close();
3259
+ return;
3260
+ }
3261
+ let len = value.byteLength;
3262
+ if (onProgress) {
3263
+ let loadedBytes = bytes += len;
3264
+ onProgress(loadedBytes);
3265
+ }
3266
+ controller.enqueue(new Uint8Array(value));
3267
+ } catch (err) {
3268
+ _onFinish(err);
3269
+ throw err;
3270
+ }
3271
+ },
3272
+ cancel(reason) {
3273
+ _onFinish(reason);
3274
+ return iterator2.return();
3275
+ }
3276
+ }, {
3277
+ highWaterMark: 2
3278
+ });
3279
+ };
3280
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
3281
+ const { isFunction } = utils$1;
3282
+ const globalFetchAPI = (({ Request, Response }) => ({
3283
+ Request,
3284
+ Response
3285
+ }))(utils$1.global);
3286
+ const {
3287
+ ReadableStream: ReadableStream$1,
3288
+ TextEncoder
3289
+ } = utils$1.global;
3290
+ const test = (fn, ...args) => {
3291
+ try {
3292
+ return !!fn(...args);
3293
+ } catch (e) {
3294
+ return false;
3295
+ }
3296
+ };
3297
+ const factory = (env) => {
3298
+ env = utils$1.merge.call({
3299
+ skipUndefined: true
3300
+ }, globalFetchAPI, env);
3301
+ const { fetch: envFetch, Request, Response } = env;
3302
+ const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
3303
+ const isRequestSupported = isFunction(Request);
3304
+ const isResponseSupported = isFunction(Response);
3305
+ if (!isFetchSupported) {
3306
+ return false;
3307
+ }
3308
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
3309
+ const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
3310
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
3311
+ let duplexAccessed = false;
3312
+ const hasContentType = new Request(platform.origin, {
3313
+ body: new ReadableStream$1(),
3314
+ method: "POST",
3315
+ get duplex() {
3316
+ duplexAccessed = true;
3317
+ return "half";
3318
+ }
3319
+ }).headers.has("Content-Type");
3320
+ return duplexAccessed && !hasContentType;
3321
+ });
3322
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
3323
+ const resolvers = {
3324
+ stream: supportsResponseStream && ((res) => res.body)
3325
+ };
3326
+ isFetchSupported && (() => {
3327
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
3328
+ !resolvers[type] && (resolvers[type] = (res, config) => {
3329
+ let method = res && res[type];
3330
+ if (method) {
3331
+ return method.call(res);
3332
+ }
3333
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
3334
+ });
3335
+ });
3336
+ })();
3337
+ const getBodyLength = async (body) => {
3338
+ if (body == null) {
3339
+ return 0;
3340
+ }
3341
+ if (utils$1.isBlob(body)) {
3342
+ return body.size;
3343
+ }
3344
+ if (utils$1.isSpecCompliantForm(body)) {
3345
+ const _request = new Request(platform.origin, {
3346
+ method: "POST",
3347
+ body
3348
+ });
3349
+ return (await _request.arrayBuffer()).byteLength;
3350
+ }
3351
+ if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
3352
+ return body.byteLength;
3353
+ }
3354
+ if (utils$1.isURLSearchParams(body)) {
3355
+ body = body + "";
3356
+ }
3357
+ if (utils$1.isString(body)) {
3358
+ return (await encodeText(body)).byteLength;
3359
+ }
3360
+ };
3361
+ const resolveBodyLength = async (headers, body) => {
3362
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
3363
+ return length == null ? getBodyLength(body) : length;
3364
+ };
3365
+ return async (config) => {
3366
+ let {
3367
+ url,
3368
+ method,
3369
+ data,
3370
+ signal,
3371
+ cancelToken,
3372
+ timeout,
3373
+ onDownloadProgress,
3374
+ onUploadProgress,
3375
+ responseType,
3376
+ headers,
3377
+ withCredentials = "same-origin",
3378
+ fetchOptions
3379
+ } = resolveConfig(config);
3380
+ let _fetch = envFetch || fetch;
3381
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
3382
+ let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
3383
+ let request = null;
3384
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
3385
+ composedSignal.unsubscribe();
3386
+ });
3387
+ let requestContentLength;
3388
+ try {
3389
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
3390
+ let _request = new Request(url, {
3391
+ method: "POST",
3392
+ body: data,
3393
+ duplex: "half"
3394
+ });
3395
+ let contentTypeHeader;
3396
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
3397
+ headers.setContentType(contentTypeHeader);
3398
+ }
3399
+ if (_request.body) {
3400
+ const [onProgress, flush] = progressEventDecorator(
3401
+ requestContentLength,
3402
+ progressEventReducer(asyncDecorator(onUploadProgress))
3403
+ );
3404
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
3405
+ }
3406
+ }
3407
+ if (!utils$1.isString(withCredentials)) {
3408
+ withCredentials = withCredentials ? "include" : "omit";
3409
+ }
3410
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
3411
+ const resolvedOptions = {
3412
+ ...fetchOptions,
3413
+ signal: composedSignal,
3414
+ method: method.toUpperCase(),
3415
+ headers: headers.normalize().toJSON(),
3416
+ body: data,
3417
+ duplex: "half",
3418
+ credentials: isCredentialsSupported ? withCredentials : void 0
3419
+ };
3420
+ request = isRequestSupported && new Request(url, resolvedOptions);
3421
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
3422
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
3423
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
3424
+ const options = {};
3425
+ ["status", "statusText", "headers"].forEach((prop) => {
3426
+ options[prop] = response[prop];
3427
+ });
3428
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
3429
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
3430
+ responseContentLength,
3431
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
3432
+ ) || [];
3433
+ response = new Response(
3434
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
3435
+ flush && flush();
3436
+ unsubscribe && unsubscribe();
3437
+ }),
3438
+ options
3439
+ );
3440
+ }
3441
+ responseType = responseType || "text";
3442
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
3443
+ !isStreamResponse && unsubscribe && unsubscribe();
3444
+ return await new Promise((resolve, reject) => {
3445
+ settle(resolve, reject, {
3446
+ data: responseData,
3447
+ headers: AxiosHeaders$1.from(response.headers),
3448
+ status: response.status,
3449
+ statusText: response.statusText,
3450
+ config,
3451
+ request
3452
+ });
3453
+ });
3454
+ } catch (err) {
3455
+ unsubscribe && unsubscribe();
3456
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
3457
+ throw Object.assign(
3458
+ new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
3459
+ {
3460
+ cause: err.cause || err
3461
+ }
3462
+ );
3463
+ }
3464
+ throw AxiosError$1.from(err, err && err.code, config, request);
3465
+ }
3466
+ };
3467
+ };
3468
+ const seedCache = /* @__PURE__ */ new Map();
3469
+ const getFetch = (config) => {
3470
+ let env = config && config.env || {};
3471
+ const { fetch: fetch2, Request, Response } = env;
3472
+ const seeds = [
3473
+ Request,
3474
+ Response,
3475
+ fetch2
3476
+ ];
3477
+ let len = seeds.length, i = len, seed, target, map = seedCache;
3478
+ while (i--) {
3479
+ seed = seeds[i];
3480
+ target = map.get(seed);
3481
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
3482
+ map = target;
3483
+ }
3484
+ return target;
3485
+ };
3486
+ getFetch();
3487
+ const knownAdapters = {
3488
+ http: httpAdapter,
3489
+ xhr: xhrAdapter,
3490
+ fetch: {
3491
+ get: getFetch
3492
+ }
3493
+ };
3494
+ utils$1.forEach(knownAdapters, (fn, value) => {
3495
+ if (fn) {
3496
+ try {
3497
+ Object.defineProperty(fn, "name", { value });
3498
+ } catch (e) {
3499
+ }
3500
+ Object.defineProperty(fn, "adapterName", { value });
3501
+ }
3502
+ });
3503
+ const renderReason = (reason) => `- ${reason}`;
3504
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
3505
+ function getAdapter$1(adapters2, config) {
3506
+ adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
3507
+ const { length } = adapters2;
3508
+ let nameOrAdapter;
3509
+ let adapter;
3510
+ const rejectedReasons = {};
3511
+ for (let i = 0; i < length; i++) {
3512
+ nameOrAdapter = adapters2[i];
3513
+ let id;
3514
+ adapter = nameOrAdapter;
3515
+ if (!isResolvedHandle(nameOrAdapter)) {
3516
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3517
+ if (adapter === void 0) {
3518
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
3519
+ }
3520
+ }
3521
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
3522
+ break;
3523
+ }
3524
+ rejectedReasons[id || "#" + i] = adapter;
3525
+ }
3526
+ if (!adapter) {
3527
+ const reasons = Object.entries(rejectedReasons).map(
3528
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
3529
+ );
3530
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
3531
+ throw new AxiosError$1(
3532
+ `There is no suitable adapter to dispatch the request ` + s,
3533
+ "ERR_NOT_SUPPORT"
3534
+ );
3535
+ }
3536
+ return adapter;
3537
+ }
3538
+ const adapters = {
3539
+ /**
3540
+ * Resolve an adapter from a list of adapter names or functions.
3541
+ * @type {Function}
3542
+ */
3543
+ getAdapter: getAdapter$1,
3544
+ /**
3545
+ * Exposes all known adapters
3546
+ * @type {Object<string, Function|Object>}
3547
+ */
3548
+ adapters: knownAdapters
3549
+ };
3550
+ function throwIfCancellationRequested(config) {
3551
+ if (config.cancelToken) {
3552
+ config.cancelToken.throwIfRequested();
3553
+ }
3554
+ if (config.signal && config.signal.aborted) {
3555
+ throw new CanceledError$1(null, config);
3556
+ }
3557
+ }
3558
+ function dispatchRequest(config) {
3559
+ throwIfCancellationRequested(config);
3560
+ config.headers = AxiosHeaders$1.from(config.headers);
3561
+ config.data = transformData.call(
3562
+ config,
3563
+ config.transformRequest
3564
+ );
3565
+ if (["post", "put", "patch"].indexOf(config.method) !== -1) {
3566
+ config.headers.setContentType("application/x-www-form-urlencoded", false);
3567
+ }
3568
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
3569
+ return adapter(config).then(function onAdapterResolution(response) {
3570
+ throwIfCancellationRequested(config);
3571
+ response.data = transformData.call(
3572
+ config,
3573
+ config.transformResponse,
3574
+ response
3575
+ );
3576
+ response.headers = AxiosHeaders$1.from(response.headers);
3577
+ return response;
3578
+ }, function onAdapterRejection(reason) {
3579
+ if (!isCancel$1(reason)) {
3580
+ throwIfCancellationRequested(config);
3581
+ if (reason && reason.response) {
3582
+ reason.response.data = transformData.call(
3583
+ config,
3584
+ config.transformResponse,
3585
+ reason.response
3586
+ );
3587
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
3588
+ }
3589
+ }
3590
+ return Promise.reject(reason);
3591
+ });
3592
+ }
3593
+ const VERSION$1 = "1.13.2";
3594
+ const validators$1 = {};
3595
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
3596
+ validators$1[type] = function validator2(thing) {
3597
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
3598
+ };
3599
+ });
3600
+ const deprecatedWarnings = {};
3601
+ validators$1.transitional = function transitional(validator2, version, message) {
3602
+ function formatMessage(opt, desc) {
3603
+ return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
3604
+ }
3605
+ return (value, opt, opts) => {
3606
+ if (validator2 === false) {
3607
+ throw new AxiosError$1(
3608
+ formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
3609
+ AxiosError$1.ERR_DEPRECATED
3610
+ );
3611
+ }
3612
+ if (version && !deprecatedWarnings[opt]) {
3613
+ deprecatedWarnings[opt] = true;
3614
+ console.warn(
3615
+ formatMessage(
3616
+ opt,
3617
+ " has been deprecated since v" + version + " and will be removed in the near future"
3618
+ )
3619
+ );
3620
+ }
3621
+ return validator2 ? validator2(value, opt, opts) : true;
3622
+ };
3623
+ };
3624
+ validators$1.spelling = function spelling(correctSpelling) {
3625
+ return (value, opt) => {
3626
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
3627
+ return true;
3628
+ };
3629
+ };
3630
+ function assertOptions(options, schema, allowUnknown) {
3631
+ if (typeof options !== "object") {
3632
+ throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
3633
+ }
3634
+ const keys = Object.keys(options);
3635
+ let i = keys.length;
3636
+ while (i-- > 0) {
3637
+ const opt = keys[i];
3638
+ const validator2 = schema[opt];
3639
+ if (validator2) {
3640
+ const value = options[opt];
3641
+ const result = value === void 0 || validator2(value, opt, options);
3642
+ if (result !== true) {
3643
+ throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3644
+ }
3645
+ continue;
3646
+ }
3647
+ if (allowUnknown !== true) {
3648
+ throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
3649
+ }
3650
+ }
3651
+ }
3652
+ const validator = {
3653
+ assertOptions,
3654
+ validators: validators$1
3655
+ };
3656
+ const validators = validator.validators;
3657
+ let Axios$1 = class Axios {
3658
+ constructor(instanceConfig) {
3659
+ this.defaults = instanceConfig || {};
3660
+ this.interceptors = {
3661
+ request: new InterceptorManager(),
3662
+ response: new InterceptorManager()
3663
+ };
3664
+ }
3665
+ /**
3666
+ * Dispatch a request
3667
+ *
3668
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3669
+ * @param {?Object} config
3670
+ *
3671
+ * @returns {Promise} The Promise to be fulfilled
3672
+ */
3673
+ async request(configOrUrl, config) {
3674
+ try {
3675
+ return await this._request(configOrUrl, config);
3676
+ } catch (err) {
3677
+ if (err instanceof Error) {
3678
+ let dummy = {};
3679
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
3680
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
3681
+ try {
3682
+ if (!err.stack) {
3683
+ err.stack = stack;
3684
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
3685
+ err.stack += "\n" + stack;
3686
+ }
3687
+ } catch (e) {
3688
+ }
3689
+ }
3690
+ throw err;
3691
+ }
3692
+ }
3693
+ _request(configOrUrl, config) {
3694
+ if (typeof configOrUrl === "string") {
3695
+ config = config || {};
3696
+ config.url = configOrUrl;
3697
+ } else {
3698
+ config = configOrUrl || {};
3699
+ }
3700
+ config = mergeConfig$1(this.defaults, config);
3701
+ const { transitional: transitional2, paramsSerializer, headers } = config;
3702
+ if (transitional2 !== void 0) {
3703
+ validator.assertOptions(transitional2, {
3704
+ silentJSONParsing: validators.transitional(validators.boolean),
3705
+ forcedJSONParsing: validators.transitional(validators.boolean),
3706
+ clarifyTimeoutError: validators.transitional(validators.boolean)
3707
+ }, false);
3708
+ }
3709
+ if (paramsSerializer != null) {
3710
+ if (utils$1.isFunction(paramsSerializer)) {
3711
+ config.paramsSerializer = {
3712
+ serialize: paramsSerializer
3713
+ };
3714
+ } else {
3715
+ validator.assertOptions(paramsSerializer, {
3716
+ encode: validators.function,
3717
+ serialize: validators.function
3718
+ }, true);
3719
+ }
3720
+ }
3721
+ if (config.allowAbsoluteUrls !== void 0) ;
3722
+ else if (this.defaults.allowAbsoluteUrls !== void 0) {
3723
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3724
+ } else {
3725
+ config.allowAbsoluteUrls = true;
3726
+ }
3727
+ validator.assertOptions(config, {
3728
+ baseUrl: validators.spelling("baseURL"),
3729
+ withXsrfToken: validators.spelling("withXSRFToken")
3730
+ }, true);
3731
+ config.method = (config.method || this.defaults.method || "get").toLowerCase();
3732
+ let contextHeaders = headers && utils$1.merge(
3733
+ headers.common,
3734
+ headers[config.method]
3735
+ );
3736
+ headers && utils$1.forEach(
3737
+ ["delete", "get", "head", "post", "put", "patch", "common"],
3738
+ (method) => {
3739
+ delete headers[method];
3740
+ }
3741
+ );
3742
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
3743
+ const requestInterceptorChain = [];
3744
+ let synchronousRequestInterceptors = true;
3745
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3746
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
3747
+ return;
3748
+ }
3749
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3750
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3751
+ });
3752
+ const responseInterceptorChain = [];
3753
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3754
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3755
+ });
3756
+ let promise;
3757
+ let i = 0;
3758
+ let len;
3759
+ if (!synchronousRequestInterceptors) {
3760
+ const chain = [dispatchRequest.bind(this), void 0];
3761
+ chain.unshift(...requestInterceptorChain);
3762
+ chain.push(...responseInterceptorChain);
3763
+ len = chain.length;
3764
+ promise = Promise.resolve(config);
3765
+ while (i < len) {
3766
+ promise = promise.then(chain[i++], chain[i++]);
3767
+ }
3768
+ return promise;
3769
+ }
3770
+ len = requestInterceptorChain.length;
3771
+ let newConfig = config;
3772
+ while (i < len) {
3773
+ const onFulfilled = requestInterceptorChain[i++];
3774
+ const onRejected = requestInterceptorChain[i++];
3775
+ try {
3776
+ newConfig = onFulfilled(newConfig);
3777
+ } catch (error) {
3778
+ onRejected.call(this, error);
3779
+ break;
3780
+ }
3781
+ }
3782
+ try {
3783
+ promise = dispatchRequest.call(this, newConfig);
3784
+ } catch (error) {
3785
+ return Promise.reject(error);
3786
+ }
3787
+ i = 0;
3788
+ len = responseInterceptorChain.length;
3789
+ while (i < len) {
3790
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3791
+ }
3792
+ return promise;
3793
+ }
3794
+ getUri(config) {
3795
+ config = mergeConfig$1(this.defaults, config);
3796
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3797
+ return buildURL(fullPath, config.params, config.paramsSerializer);
3798
+ }
3799
+ };
3800
+ utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
3801
+ Axios$1.prototype[method] = function(url, config) {
3802
+ return this.request(mergeConfig$1(config || {}, {
3803
+ method,
3804
+ url,
3805
+ data: (config || {}).data
3806
+ }));
3807
+ };
3808
+ });
3809
+ utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
3810
+ function generateHTTPMethod(isForm) {
3811
+ return function httpMethod(url, data, config) {
3812
+ return this.request(mergeConfig$1(config || {}, {
3813
+ method,
3814
+ headers: isForm ? {
3815
+ "Content-Type": "multipart/form-data"
3816
+ } : {},
3817
+ url,
3818
+ data
3819
+ }));
3820
+ };
3821
+ }
3822
+ Axios$1.prototype[method] = generateHTTPMethod();
3823
+ Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
3824
+ });
3825
+ let CancelToken$1 = class CancelToken {
3826
+ constructor(executor) {
3827
+ if (typeof executor !== "function") {
3828
+ throw new TypeError("executor must be a function.");
3829
+ }
3830
+ let resolvePromise;
3831
+ this.promise = new Promise(function promiseExecutor(resolve) {
3832
+ resolvePromise = resolve;
3833
+ });
3834
+ const token = this;
3835
+ this.promise.then((cancel) => {
3836
+ if (!token._listeners) return;
3837
+ let i = token._listeners.length;
3838
+ while (i-- > 0) {
3839
+ token._listeners[i](cancel);
3840
+ }
3841
+ token._listeners = null;
3842
+ });
3843
+ this.promise.then = (onfulfilled) => {
3844
+ let _resolve;
3845
+ const promise = new Promise((resolve) => {
3846
+ token.subscribe(resolve);
3847
+ _resolve = resolve;
3848
+ }).then(onfulfilled);
3849
+ promise.cancel = function reject() {
3850
+ token.unsubscribe(_resolve);
3851
+ };
3852
+ return promise;
3853
+ };
3854
+ executor(function cancel(message, config, request) {
3855
+ if (token.reason) {
3856
+ return;
3857
+ }
3858
+ token.reason = new CanceledError$1(message, config, request);
3859
+ resolvePromise(token.reason);
3860
+ });
3861
+ }
3862
+ /**
3863
+ * Throws a `CanceledError` if cancellation has been requested.
3864
+ */
3865
+ throwIfRequested() {
3866
+ if (this.reason) {
3867
+ throw this.reason;
3868
+ }
3869
+ }
3870
+ /**
3871
+ * Subscribe to the cancel signal
3872
+ */
3873
+ subscribe(listener) {
3874
+ if (this.reason) {
3875
+ listener(this.reason);
3876
+ return;
3877
+ }
3878
+ if (this._listeners) {
3879
+ this._listeners.push(listener);
3880
+ } else {
3881
+ this._listeners = [listener];
3882
+ }
3883
+ }
3884
+ /**
3885
+ * Unsubscribe from the cancel signal
3886
+ */
3887
+ unsubscribe(listener) {
3888
+ if (!this._listeners) {
3889
+ return;
3890
+ }
3891
+ const index = this._listeners.indexOf(listener);
3892
+ if (index !== -1) {
3893
+ this._listeners.splice(index, 1);
3894
+ }
3895
+ }
3896
+ toAbortSignal() {
3897
+ const controller = new AbortController();
3898
+ const abort = (err) => {
3899
+ controller.abort(err);
3900
+ };
3901
+ this.subscribe(abort);
3902
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
3903
+ return controller.signal;
3904
+ }
3905
+ /**
3906
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3907
+ * cancels the `CancelToken`.
3908
+ */
3909
+ static source() {
3910
+ let cancel;
3911
+ const token = new CancelToken(function executor(c) {
3912
+ cancel = c;
3913
+ });
3914
+ return {
3915
+ token,
3916
+ cancel
3917
+ };
3918
+ }
3919
+ };
3920
+ function spread$1(callback) {
3921
+ return function wrap(arr) {
3922
+ return callback.apply(null, arr);
3923
+ };
3924
+ }
3925
+ function isAxiosError$1(payload) {
3926
+ return utils$1.isObject(payload) && payload.isAxiosError === true;
3927
+ }
3928
+ const HttpStatusCode$1 = {
3929
+ Continue: 100,
3930
+ SwitchingProtocols: 101,
3931
+ Processing: 102,
3932
+ EarlyHints: 103,
3933
+ Ok: 200,
3934
+ Created: 201,
3935
+ Accepted: 202,
3936
+ NonAuthoritativeInformation: 203,
3937
+ NoContent: 204,
3938
+ ResetContent: 205,
3939
+ PartialContent: 206,
3940
+ MultiStatus: 207,
3941
+ AlreadyReported: 208,
3942
+ ImUsed: 226,
3943
+ MultipleChoices: 300,
3944
+ MovedPermanently: 301,
3945
+ Found: 302,
3946
+ SeeOther: 303,
3947
+ NotModified: 304,
3948
+ UseProxy: 305,
3949
+ Unused: 306,
3950
+ TemporaryRedirect: 307,
3951
+ PermanentRedirect: 308,
3952
+ BadRequest: 400,
3953
+ Unauthorized: 401,
3954
+ PaymentRequired: 402,
3955
+ Forbidden: 403,
3956
+ NotFound: 404,
3957
+ MethodNotAllowed: 405,
3958
+ NotAcceptable: 406,
3959
+ ProxyAuthenticationRequired: 407,
3960
+ RequestTimeout: 408,
3961
+ Conflict: 409,
3962
+ Gone: 410,
3963
+ LengthRequired: 411,
3964
+ PreconditionFailed: 412,
3965
+ PayloadTooLarge: 413,
3966
+ UriTooLong: 414,
3967
+ UnsupportedMediaType: 415,
3968
+ RangeNotSatisfiable: 416,
3969
+ ExpectationFailed: 417,
3970
+ ImATeapot: 418,
3971
+ MisdirectedRequest: 421,
3972
+ UnprocessableEntity: 422,
3973
+ Locked: 423,
3974
+ FailedDependency: 424,
3975
+ TooEarly: 425,
3976
+ UpgradeRequired: 426,
3977
+ PreconditionRequired: 428,
3978
+ TooManyRequests: 429,
3979
+ RequestHeaderFieldsTooLarge: 431,
3980
+ UnavailableForLegalReasons: 451,
3981
+ InternalServerError: 500,
3982
+ NotImplemented: 501,
3983
+ BadGateway: 502,
3984
+ ServiceUnavailable: 503,
3985
+ GatewayTimeout: 504,
3986
+ HttpVersionNotSupported: 505,
3987
+ VariantAlsoNegotiates: 506,
3988
+ InsufficientStorage: 507,
3989
+ LoopDetected: 508,
3990
+ NotExtended: 510,
3991
+ NetworkAuthenticationRequired: 511,
3992
+ WebServerIsDown: 521,
3993
+ ConnectionTimedOut: 522,
3994
+ OriginIsUnreachable: 523,
3995
+ TimeoutOccurred: 524,
3996
+ SslHandshakeFailed: 525,
3997
+ InvalidSslCertificate: 526
3998
+ };
3999
+ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
4000
+ HttpStatusCode$1[value] = key;
4001
+ });
4002
+ function createInstance(defaultConfig) {
4003
+ const context = new Axios$1(defaultConfig);
4004
+ const instance = bind(Axios$1.prototype.request, context);
4005
+ utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
4006
+ utils$1.extend(instance, context, null, { allOwnKeys: true });
4007
+ instance.create = function create(instanceConfig) {
4008
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
4009
+ };
4010
+ return instance;
4011
+ }
4012
+ const axios = createInstance(defaults);
4013
+ axios.Axios = Axios$1;
4014
+ axios.CanceledError = CanceledError$1;
4015
+ axios.CancelToken = CancelToken$1;
4016
+ axios.isCancel = isCancel$1;
4017
+ axios.VERSION = VERSION$1;
4018
+ axios.toFormData = toFormData$1;
4019
+ axios.AxiosError = AxiosError$1;
4020
+ axios.Cancel = axios.CanceledError;
4021
+ axios.all = function all(promises) {
4022
+ return Promise.all(promises);
4023
+ };
4024
+ axios.spread = spread$1;
4025
+ axios.isAxiosError = isAxiosError$1;
4026
+ axios.mergeConfig = mergeConfig$1;
4027
+ axios.AxiosHeaders = AxiosHeaders$1;
4028
+ axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
4029
+ axios.getAdapter = adapters.getAdapter;
4030
+ axios.HttpStatusCode = HttpStatusCode$1;
4031
+ axios.default = axios;
4032
+ const {
4033
+ Axios: Axios2,
4034
+ AxiosError,
4035
+ CanceledError,
4036
+ isCancel,
4037
+ CancelToken: CancelToken2,
4038
+ VERSION,
4039
+ all: all2,
4040
+ Cancel,
4041
+ isAxiosError,
4042
+ spread,
4043
+ toFormData,
4044
+ AxiosHeaders: AxiosHeaders2,
4045
+ HttpStatusCode,
4046
+ formToJSON,
4047
+ getAdapter,
4048
+ mergeConfig
4049
+ } = axios;
4050
+ const trusteeStats = {
4051
+ activeCaseCount: 0,
4052
+ opendLast30: 0,
4053
+ closedLast30: 0,
4054
+ docketNext30: 0
4055
+ };
4056
+ const api = {
4057
+ name: "api",
4058
+ models: {
4059
+ trustee: {
4060
+ stats: trusteeStats
4061
+ }
4062
+ },
4063
+ url: {
4064
+ profile: "316F7A82-BC60-46A4-B584-019CD3608B87",
4065
+ base: {
4066
+ tag: "/api/tag/",
4067
+ trustee: "/api/trustee/",
4068
+ calendar: "/api/calendar/",
4069
+ case: "/api/case/",
4070
+ creditor: "/api/creditor/",
4071
+ employer: "/api/employer/"
4072
+ },
4073
+ authentication: {
4074
+ login: "/api/login/",
4075
+ user: "/api/user/",
4076
+ status: "/api/profile/",
4077
+ register: "/api/register/"
4078
+ }
4079
+ },
4080
+ list: function(url, obj, onComplete, onError, page = 0, count = 100) {
4081
+ axios.get(url + "?page=" + page + "&count=" + count).then((response) => {
4082
+ if (response.status == 200) {
4083
+ onComplete(obj, response.data);
4084
+ return;
4085
+ }
4086
+ onError(obj, response.message);
4087
+ }).catch((error) => onError(obj, error));
4088
+ },
4089
+ getUrl: function(url, obj, onComplete, onError) {
4090
+ axios.get(url).then((response) => {
4091
+ if (response.status == 200) {
4092
+ onComplete(obj, response.data);
4093
+ return;
4094
+ }
4095
+ onError(obj, response.statusText);
4096
+ }).catch((error) => onError(obj, error));
4097
+ },
4098
+ get: function(url, obj, id, onComplete, onError) {
4099
+ axios.get(url + id).then((response) => {
4100
+ if (response.status == 200) {
4101
+ onComplete(obj, response.data);
4102
+ return;
4103
+ }
4104
+ onError(obj, response.statusText);
4105
+ }).catch((error) => onError(obj, error));
4106
+ },
4107
+ post: function(url, obj, model, onComplete, onError) {
4108
+ axios.post(url, model).then((response) => {
4109
+ if (response.status == 200) {
4110
+ onComplete(obj, response.data);
4111
+ return;
4112
+ }
4113
+ if (response.status == 400) {
4114
+ onError(obj, response.response);
4115
+ return;
4116
+ }
4117
+ onError(obj, response.statusText);
4118
+ }).catch((error) => onError(obj, error));
4119
+ },
4120
+ put: function(url, obj, id, model, onComplete, onError) {
4121
+ axios.put(url + id, model).then((response) => {
4122
+ if (response.status == 200) {
4123
+ onComplete(obj, response.data);
4124
+ return;
4125
+ }
4126
+ if (response.status == 400) {
4127
+ onError(obj, response);
4128
+ return;
4129
+ }
4130
+ onError(obj, response.statusText);
4131
+ }).catch((error) => onError(obj, error));
4132
+ },
4133
+ delete: function(url, obj, id, onComplete, onError) {
4134
+ axios.delete(url + id).then((response) => {
4135
+ if (response.status == 200) {
4136
+ onComplete(obj, response.data);
4137
+ return;
4138
+ }
4139
+ onError(obj, response.statusText);
4140
+ }).catch((error) => onError(obj, error));
4141
+ },
4142
+ model: function(url, obj, onComplete, onError) {
4143
+ axios.get(url + "model").then((response) => {
4144
+ if (response.status == 200) {
4145
+ onComplete(obj, response.data);
4146
+ return;
4147
+ }
4148
+ onError(obj, response.statusText);
4149
+ }).catch((error) => onError(obj, error));
4150
+ }
4151
+ };
4152
+ const content = {
4153
+ name: "content",
4154
+ assets: "/api/assets/",
4155
+ assetTypes: "/api/assettype/",
4156
+ documents: "/api/document/",
4157
+ news: "/api/news/",
4158
+ products: "/api/product/",
4159
+ tags: "/api/tag/"
4160
+ };
4161
+ exports.AnimatedCount = AnimatedCount;
4162
+ exports.ArticleView = ArticleView;
4163
+ exports.api = api;
4164
+ exports.content = content;