CN POE Export

Export CN POE data.

目前為 2023-05-15 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name CN POE Export
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.1
  5. // @description Export CN POE data.
  6. // @author You
  7. // @match https://poe.game.qq.com/my-account
  8. // @match https://poe.game.qq.com/account/view-profile/*
  9. // @match https://poe.game.qq.com/forum
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=qq.com
  11. // @require https://cdn.jsdelivr.net/npm/cn-poe-translator@0.2.1/dist/translator.global.min.js
  12. // @require https://cdn.jsdelivr.net/npm/cn-poe-export-db@0.0.7/dist/db.global.js
  13. // @require https://cdn.jsdelivr.net/npm/pob-building-creater@0.0.7/dist/creater.global.js
  14. // @require https://cdn.jsdelivr.net/npm/pako@2.1.0/dist/pako_deflate.min.js
  15. // @require https://cdn.jsdelivr.net/npm/vue@3.3.2/dist/vue.global.min.js
  16. // @grant none
  17. // @license MIT
  18. // ==/UserScript==
  19.  
  20. (function(){
  21. const {computed, ref, reactive, onMounted, openBlock, createElementBlock, Fragment, createElementVNode, withDirectives, vModelText, unref, renderList, toDisplayString, vModelSelect, createCommentVNode, pushScopeId, popScopeId, createBlock, createApp } = Vue;
  22.  
  23. (function() {
  24. "use strict";
  25. try {
  26. if (typeof document != "undefined") {
  27. var elementStyle = document.createElement("style");
  28. elementStyle.appendChild(document.createTextNode("#exportContainer{\r\n position: fixed;\r\n bottom: 20px;\r\n left: 10px;\r\n z-index: 99999;\r\n}\n.line-container[data-v-5a132a30] {\r\n display: flex;\r\n margin: 3px 0;\r\n min-height: 25px;\n}\n.line-container select[data-v-5a132a30] {\r\n min-height: 25px;\r\n margin-right: 4px;\r\n min-width: 100px;\n}\n.line-container input[data-v-5a132a30] {\r\n margin-right: 4px;\n}"));
  29. document.head.appendChild(elementStyle);
  30. }
  31. } catch (e) {
  32. console.error("vite-plugin-css-injected-by-js", e);
  33. }
  34. })();
  35. (function polyfill() {
  36. const relList = document.createElement("link").relList;
  37. if (relList && relList.supports && relList.supports("modulepreload")) {
  38. return;
  39. }
  40. for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
  41. processPreload(link);
  42. }
  43. new MutationObserver((mutations) => {
  44. for (const mutation of mutations) {
  45. if (mutation.type !== "childList") {
  46. continue;
  47. }
  48. for (const node of mutation.addedNodes) {
  49. if (node.tagName === "LINK" && node.rel === "modulepreload")
  50. processPreload(node);
  51. }
  52. }
  53. }).observe(document, { childList: true, subtree: true });
  54. function getFetchOpts(link) {
  55. const fetchOpts = {};
  56. if (link.integrity)
  57. fetchOpts.integrity = link.integrity;
  58. if (link.referrerPolicy)
  59. fetchOpts.referrerPolicy = link.referrerPolicy;
  60. if (link.crossOrigin === "use-credentials")
  61. fetchOpts.credentials = "include";
  62. else if (link.crossOrigin === "anonymous")
  63. fetchOpts.credentials = "omit";
  64. else
  65. fetchOpts.credentials = "same-origin";
  66. return fetchOpts;
  67. }
  68. function processPreload(link) {
  69. if (link.ep)
  70. return;
  71. link.ep = true;
  72. const fetchOpts = getFetchOpts(link);
  73. fetch(link.href, fetchOpts);
  74. }
  75. })();
  76. const main = "";
  77. const version = "3.7.5";
  78. const VERSION$1 = version;
  79. const _hasatob = typeof atob === "function";
  80. const _hasbtoa = typeof btoa === "function";
  81. const _hasBuffer = typeof Buffer === "function";
  82. const _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0;
  83. const _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0;
  84. const b64ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  85. const b64chs = Array.prototype.slice.call(b64ch);
  86. const b64tab = ((a) => {
  87. let tab = {};
  88. a.forEach((c, i) => tab[c] = i);
  89. return tab;
  90. })(b64chs);
  91. const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
  92. const _fromCC = String.fromCharCode.bind(String);
  93. const _U8Afrom = typeof Uint8Array.from === "function" ? Uint8Array.from.bind(Uint8Array) : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
  94. const _mkUriSafe = (src) => src.replace(/=/g, "").replace(/[+\/]/g, (m0) => m0 == "+" ? "-" : "_");
  95. const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, "");
  96. const btoaPolyfill = (bin) => {
  97. let u32, c0, c1, c2, asc = "";
  98. const pad = bin.length % 3;
  99. for (let i = 0; i < bin.length; ) {
  100. if ((c0 = bin.charCodeAt(i++)) > 255 || (c1 = bin.charCodeAt(i++)) > 255 || (c2 = bin.charCodeAt(i++)) > 255)
  101. throw new TypeError("invalid character found");
  102. u32 = c0 << 16 | c1 << 8 | c2;
  103. asc += b64chs[u32 >> 18 & 63] + b64chs[u32 >> 12 & 63] + b64chs[u32 >> 6 & 63] + b64chs[u32 & 63];
  104. }
  105. return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
  106. };
  107. const _btoa = _hasbtoa ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill;
  108. const _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString("base64") : (u8a) => {
  109. const maxargs = 4096;
  110. let strs = [];
  111. for (let i = 0, l = u8a.length; i < l; i += maxargs) {
  112. strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
  113. }
  114. return _btoa(strs.join(""));
  115. };
  116. const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
  117. const cb_utob = (c) => {
  118. if (c.length < 2) {
  119. var cc = c.charCodeAt(0);
  120. return cc < 128 ? c : cc < 2048 ? _fromCC(192 | cc >>> 6) + _fromCC(128 | cc & 63) : _fromCC(224 | cc >>> 12 & 15) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);
  121. } else {
  122. var cc = 65536 + (c.charCodeAt(0) - 55296) * 1024 + (c.charCodeAt(1) - 56320);
  123. return _fromCC(240 | cc >>> 18 & 7) + _fromCC(128 | cc >>> 12 & 63) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);
  124. }
  125. };
  126. const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
  127. const utob = (u) => u.replace(re_utob, cb_utob);
  128. const _encode = _hasBuffer ? (s) => Buffer.from(s, "utf8").toString("base64") : _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));
  129. const encode$2 = (src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode(src)) : _encode(src);
  130. const encodeURI = (src) => encode$2(src, true);
  131. const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
  132. const cb_btou = (cccc) => {
  133. switch (cccc.length) {
  134. case 4:
  135. var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset = cp - 65536;
  136. return _fromCC((offset >>> 10) + 55296) + _fromCC((offset & 1023) + 56320);
  137. case 3:
  138. return _fromCC((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2));
  139. default:
  140. return _fromCC((31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1));
  141. }
  142. };
  143. const btou = (b) => b.replace(re_btou, cb_btou);
  144. const atobPolyfill = (asc) => {
  145. asc = asc.replace(/\s+/g, "");
  146. if (!b64re.test(asc))
  147. throw new TypeError("malformed base64.");
  148. asc += "==".slice(2 - (asc.length & 3));
  149. let u24, bin = "", r1, r2;
  150. for (let i = 0; i < asc.length; ) {
  151. u24 = b64tab[asc.charAt(i++)] << 18 | b64tab[asc.charAt(i++)] << 12 | (r1 = b64tab[asc.charAt(i++)]) << 6 | (r2 = b64tab[asc.charAt(i++)]);
  152. bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
  153. }
  154. return bin;
  155. };
  156. const _atob = _hasatob ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
  157. const _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
  158. const toUint8Array = (a) => _toUint8Array(_unURI(a));
  159. const _decode = _hasBuffer ? (a) => Buffer.from(a, "base64").toString("utf8") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
  160. const _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == "-" ? "+" : "/"));
  161. const decode = (src) => _decode(_unURI(src));
  162. const isValid = (src) => {
  163. if (typeof src !== "string")
  164. return false;
  165. const s = src.replace(/\s+/g, "").replace(/={0,2}$/, "");
  166. return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
  167. };
  168. const _noEnum = (v) => {
  169. return {
  170. value: v,
  171. enumerable: false,
  172. writable: true,
  173. configurable: true
  174. };
  175. };
  176. const extendString = function() {
  177. const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));
  178. _add("fromBase64", function() {
  179. return decode(this);
  180. });
  181. _add("toBase64", function(urlsafe) {
  182. return encode$2(this, urlsafe);
  183. });
  184. _add("toBase64URI", function() {
  185. return encode$2(this, true);
  186. });
  187. _add("toBase64URL", function() {
  188. return encode$2(this, true);
  189. });
  190. _add("toUint8Array", function() {
  191. return toUint8Array(this);
  192. });
  193. };
  194. const extendUint8Array = function() {
  195. const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
  196. _add("toBase64", function(urlsafe) {
  197. return fromUint8Array(this, urlsafe);
  198. });
  199. _add("toBase64URI", function() {
  200. return fromUint8Array(this, true);
  201. });
  202. _add("toBase64URL", function() {
  203. return fromUint8Array(this, true);
  204. });
  205. };
  206. const extendBuiltins = () => {
  207. extendString();
  208. extendUint8Array();
  209. };
  210. const gBase64 = {
  211. version,
  212. VERSION: VERSION$1,
  213. atob: _atob,
  214. atobPolyfill,
  215. btoa: _btoa,
  216. btoaPolyfill,
  217. fromBase64: decode,
  218. toBase64: encode$2,
  219. encode: encode$2,
  220. encodeURI,
  221. encodeURL: encodeURI,
  222. utob,
  223. btou,
  224. decode,
  225. isValid,
  226. fromUint8Array,
  227. toUint8Array,
  228. extendString,
  229. extendUint8Array,
  230. extendBuiltins
  231. };
  232. function bind(fn, thisArg) {
  233. return function wrap() {
  234. return fn.apply(thisArg, arguments);
  235. };
  236. }
  237. const { toString } = Object.prototype;
  238. const { getPrototypeOf } = Object;
  239. const kindOf = ((cache) => (thing) => {
  240. const str = toString.call(thing);
  241. return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
  242. })(/* @__PURE__ */ Object.create(null));
  243. const kindOfTest = (type) => {
  244. type = type.toLowerCase();
  245. return (thing) => kindOf(thing) === type;
  246. };
  247. const typeOfTest = (type) => (thing) => typeof thing === type;
  248. const { isArray } = Array;
  249. const isUndefined = typeOfTest("undefined");
  250. function isBuffer(val) {
  251. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
  252. }
  253. const isArrayBuffer = kindOfTest("ArrayBuffer");
  254. function isArrayBufferView(val) {
  255. let result;
  256. if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
  257. result = ArrayBuffer.isView(val);
  258. } else {
  259. result = val && val.buffer && isArrayBuffer(val.buffer);
  260. }
  261. return result;
  262. }
  263. const isString = typeOfTest("string");
  264. const isFunction = typeOfTest("function");
  265. const isNumber = typeOfTest("number");
  266. const isObject = (thing) => thing !== null && typeof thing === "object";
  267. const isBoolean = (thing) => thing === true || thing === false;
  268. const isPlainObject = (val) => {
  269. if (kindOf(val) !== "object") {
  270. return false;
  271. }
  272. const prototype2 = getPrototypeOf(val);
  273. return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
  274. };
  275. const isDate = kindOfTest("Date");
  276. const isFile = kindOfTest("File");
  277. const isBlob = kindOfTest("Blob");
  278. const isFileList = kindOfTest("FileList");
  279. const isStream = (val) => isObject(val) && isFunction(val.pipe);
  280. const isFormData = (thing) => {
  281. let kind;
  282. return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
  283. kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
  284. };
  285. const isURLSearchParams = kindOfTest("URLSearchParams");
  286. const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
  287. function forEach(obj, fn, { allOwnKeys = false } = {}) {
  288. if (obj === null || typeof obj === "undefined") {
  289. return;
  290. }
  291. let i;
  292. let l;
  293. if (typeof obj !== "object") {
  294. obj = [obj];
  295. }
  296. if (isArray(obj)) {
  297. for (i = 0, l = obj.length; i < l; i++) {
  298. fn.call(null, obj[i], i, obj);
  299. }
  300. } else {
  301. const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
  302. const len = keys.length;
  303. let key;
  304. for (i = 0; i < len; i++) {
  305. key = keys[i];
  306. fn.call(null, obj[key], key, obj);
  307. }
  308. }
  309. }
  310. function findKey(obj, key) {
  311. key = key.toLowerCase();
  312. const keys = Object.keys(obj);
  313. let i = keys.length;
  314. let _key;
  315. while (i-- > 0) {
  316. _key = keys[i];
  317. if (key === _key.toLowerCase()) {
  318. return _key;
  319. }
  320. }
  321. return null;
  322. }
  323. const _global = (() => {
  324. if (typeof globalThis !== "undefined")
  325. return globalThis;
  326. return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
  327. })();
  328. const isContextDefined = (context) => !isUndefined(context) && context !== _global;
  329. function merge() {
  330. const { caseless } = isContextDefined(this) && this || {};
  331. const result = {};
  332. const assignValue = (val, key) => {
  333. const targetKey = caseless && findKey(result, key) || key;
  334. if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
  335. result[targetKey] = merge(result[targetKey], val);
  336. } else if (isPlainObject(val)) {
  337. result[targetKey] = merge({}, val);
  338. } else if (isArray(val)) {
  339. result[targetKey] = val.slice();
  340. } else {
  341. result[targetKey] = val;
  342. }
  343. };
  344. for (let i = 0, l = arguments.length; i < l; i++) {
  345. arguments[i] && forEach(arguments[i], assignValue);
  346. }
  347. return result;
  348. }
  349. const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
  350. forEach(b, (val, key) => {
  351. if (thisArg && isFunction(val)) {
  352. a[key] = bind(val, thisArg);
  353. } else {
  354. a[key] = val;
  355. }
  356. }, { allOwnKeys });
  357. return a;
  358. };
  359. const stripBOM = (content) => {
  360. if (content.charCodeAt(0) === 65279) {
  361. content = content.slice(1);
  362. }
  363. return content;
  364. };
  365. const inherits = (constructor, superConstructor, props, descriptors2) => {
  366. constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
  367. constructor.prototype.constructor = constructor;
  368. Object.defineProperty(constructor, "super", {
  369. value: superConstructor.prototype
  370. });
  371. props && Object.assign(constructor.prototype, props);
  372. };
  373. const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
  374. let props;
  375. let i;
  376. let prop;
  377. const merged = {};
  378. destObj = destObj || {};
  379. if (sourceObj == null)
  380. return destObj;
  381. do {
  382. props = Object.getOwnPropertyNames(sourceObj);
  383. i = props.length;
  384. while (i-- > 0) {
  385. prop = props[i];
  386. if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
  387. destObj[prop] = sourceObj[prop];
  388. merged[prop] = true;
  389. }
  390. }
  391. sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
  392. } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
  393. return destObj;
  394. };
  395. const endsWith = (str, searchString, position) => {
  396. str = String(str);
  397. if (position === void 0 || position > str.length) {
  398. position = str.length;
  399. }
  400. position -= searchString.length;
  401. const lastIndex = str.indexOf(searchString, position);
  402. return lastIndex !== -1 && lastIndex === position;
  403. };
  404. const toArray = (thing) => {
  405. if (!thing)
  406. return null;
  407. if (isArray(thing))
  408. return thing;
  409. let i = thing.length;
  410. if (!isNumber(i))
  411. return null;
  412. const arr = new Array(i);
  413. while (i-- > 0) {
  414. arr[i] = thing[i];
  415. }
  416. return arr;
  417. };
  418. const isTypedArray = ((TypedArray) => {
  419. return (thing) => {
  420. return TypedArray && thing instanceof TypedArray;
  421. };
  422. })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
  423. const forEachEntry = (obj, fn) => {
  424. const generator = obj && obj[Symbol.iterator];
  425. const iterator = generator.call(obj);
  426. let result;
  427. while ((result = iterator.next()) && !result.done) {
  428. const pair = result.value;
  429. fn.call(obj, pair[0], pair[1]);
  430. }
  431. };
  432. const matchAll = (regExp, str) => {
  433. let matches;
  434. const arr = [];
  435. while ((matches = regExp.exec(str)) !== null) {
  436. arr.push(matches);
  437. }
  438. return arr;
  439. };
  440. const isHTMLForm = kindOfTest("HTMLFormElement");
  441. const toCamelCase = (str) => {
  442. return str.toLowerCase().replace(
  443. /[-_\s]([a-z\d])(\w*)/g,
  444. function replacer(m, p1, p2) {
  445. return p1.toUpperCase() + p2;
  446. }
  447. );
  448. };
  449. const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
  450. const isRegExp = kindOfTest("RegExp");
  451. const reduceDescriptors = (obj, reducer) => {
  452. const descriptors2 = Object.getOwnPropertyDescriptors(obj);
  453. const reducedDescriptors = {};
  454. forEach(descriptors2, (descriptor, name) => {
  455. if (reducer(descriptor, name, obj) !== false) {
  456. reducedDescriptors[name] = descriptor;
  457. }
  458. });
  459. Object.defineProperties(obj, reducedDescriptors);
  460. };
  461. const freezeMethods = (obj) => {
  462. reduceDescriptors(obj, (descriptor, name) => {
  463. if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
  464. return false;
  465. }
  466. const value = obj[name];
  467. if (!isFunction(value))
  468. return;
  469. descriptor.enumerable = false;
  470. if ("writable" in descriptor) {
  471. descriptor.writable = false;
  472. return;
  473. }
  474. if (!descriptor.set) {
  475. descriptor.set = () => {
  476. throw Error("Can not rewrite read-only method '" + name + "'");
  477. };
  478. }
  479. });
  480. };
  481. const toObjectSet = (arrayOrString, delimiter) => {
  482. const obj = {};
  483. const define = (arr) => {
  484. arr.forEach((value) => {
  485. obj[value] = true;
  486. });
  487. };
  488. isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  489. return obj;
  490. };
  491. const noop = () => {
  492. };
  493. const toFiniteNumber = (value, defaultValue) => {
  494. value = +value;
  495. return Number.isFinite(value) ? value : defaultValue;
  496. };
  497. const ALPHA = "abcdefghijklmnopqrstuvwxyz";
  498. const DIGIT = "0123456789";
  499. const ALPHABET = {
  500. DIGIT,
  501. ALPHA,
  502. ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
  503. };
  504. const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
  505. let str = "";
  506. const { length } = alphabet;
  507. while (size--) {
  508. str += alphabet[Math.random() * length | 0];
  509. }
  510. return str;
  511. };
  512. function isSpecCompliantForm(thing) {
  513. return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
  514. }
  515. const toJSONObject = (obj) => {
  516. const stack = new Array(10);
  517. const visit = (source, i) => {
  518. if (isObject(source)) {
  519. if (stack.indexOf(source) >= 0) {
  520. return;
  521. }
  522. if (!("toJSON" in source)) {
  523. stack[i] = source;
  524. const target = isArray(source) ? [] : {};
  525. forEach(source, (value, key) => {
  526. const reducedValue = visit(value, i + 1);
  527. !isUndefined(reducedValue) && (target[key] = reducedValue);
  528. });
  529. stack[i] = void 0;
  530. return target;
  531. }
  532. }
  533. return source;
  534. };
  535. return visit(obj, 0);
  536. };
  537. const isAsyncFn = kindOfTest("AsyncFunction");
  538. const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
  539. const utils = {
  540. isArray,
  541. isArrayBuffer,
  542. isBuffer,
  543. isFormData,
  544. isArrayBufferView,
  545. isString,
  546. isNumber,
  547. isBoolean,
  548. isObject,
  549. isPlainObject,
  550. isUndefined,
  551. isDate,
  552. isFile,
  553. isBlob,
  554. isRegExp,
  555. isFunction,
  556. isStream,
  557. isURLSearchParams,
  558. isTypedArray,
  559. isFileList,
  560. forEach,
  561. merge,
  562. extend,
  563. trim,
  564. stripBOM,
  565. inherits,
  566. toFlatObject,
  567. kindOf,
  568. kindOfTest,
  569. endsWith,
  570. toArray,
  571. forEachEntry,
  572. matchAll,
  573. isHTMLForm,
  574. hasOwnProperty,
  575. hasOwnProp: hasOwnProperty,
  576. // an alias to avoid ESLint no-prototype-builtins detection
  577. reduceDescriptors,
  578. freezeMethods,
  579. toObjectSet,
  580. toCamelCase,
  581. noop,
  582. toFiniteNumber,
  583. findKey,
  584. global: _global,
  585. isContextDefined,
  586. ALPHABET,
  587. generateString,
  588. isSpecCompliantForm,
  589. toJSONObject,
  590. isAsyncFn,
  591. isThenable
  592. };
  593. function AxiosError(message, code, config, request, response) {
  594. Error.call(this);
  595. if (Error.captureStackTrace) {
  596. Error.captureStackTrace(this, this.constructor);
  597. } else {
  598. this.stack = new Error().stack;
  599. }
  600. this.message = message;
  601. this.name = "AxiosError";
  602. code && (this.code = code);
  603. config && (this.config = config);
  604. request && (this.request = request);
  605. response && (this.response = response);
  606. }
  607. utils.inherits(AxiosError, Error, {
  608. toJSON: function toJSON() {
  609. return {
  610. // Standard
  611. message: this.message,
  612. name: this.name,
  613. // Microsoft
  614. description: this.description,
  615. number: this.number,
  616. // Mozilla
  617. fileName: this.fileName,
  618. lineNumber: this.lineNumber,
  619. columnNumber: this.columnNumber,
  620. stack: this.stack,
  621. // Axios
  622. config: utils.toJSONObject(this.config),
  623. code: this.code,
  624. status: this.response && this.response.status ? this.response.status : null
  625. };
  626. }
  627. });
  628. const prototype$1 = AxiosError.prototype;
  629. const descriptors = {};
  630. [
  631. "ERR_BAD_OPTION_VALUE",
  632. "ERR_BAD_OPTION",
  633. "ECONNABORTED",
  634. "ETIMEDOUT",
  635. "ERR_NETWORK",
  636. "ERR_FR_TOO_MANY_REDIRECTS",
  637. "ERR_DEPRECATED",
  638. "ERR_BAD_RESPONSE",
  639. "ERR_BAD_REQUEST",
  640. "ERR_CANCELED",
  641. "ERR_NOT_SUPPORT",
  642. "ERR_INVALID_URL"
  643. // eslint-disable-next-line func-names
  644. ].forEach((code) => {
  645. descriptors[code] = { value: code };
  646. });
  647. Object.defineProperties(AxiosError, descriptors);
  648. Object.defineProperty(prototype$1, "isAxiosError", { value: true });
  649. AxiosError.from = (error, code, config, request, response, customProps) => {
  650. const axiosError = Object.create(prototype$1);
  651. utils.toFlatObject(error, axiosError, function filter2(obj) {
  652. return obj !== Error.prototype;
  653. }, (prop) => {
  654. return prop !== "isAxiosError";
  655. });
  656. AxiosError.call(axiosError, error.message, code, config, request, response);
  657. axiosError.cause = error;
  658. axiosError.name = error.name;
  659. customProps && Object.assign(axiosError, customProps);
  660. return axiosError;
  661. };
  662. const httpAdapter = null;
  663. function isVisitable(thing) {
  664. return utils.isPlainObject(thing) || utils.isArray(thing);
  665. }
  666. function removeBrackets(key) {
  667. return utils.endsWith(key, "[]") ? key.slice(0, -2) : key;
  668. }
  669. function renderKey(path, key, dots) {
  670. if (!path)
  671. return key;
  672. return path.concat(key).map(function each(token, i) {
  673. token = removeBrackets(token);
  674. return !dots && i ? "[" + token + "]" : token;
  675. }).join(dots ? "." : "");
  676. }
  677. function isFlatArray(arr) {
  678. return utils.isArray(arr) && !arr.some(isVisitable);
  679. }
  680. const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
  681. return /^is[A-Z]/.test(prop);
  682. });
  683. function toFormData(obj, formData, options) {
  684. if (!utils.isObject(obj)) {
  685. throw new TypeError("target must be an object");
  686. }
  687. formData = formData || new FormData();
  688. options = utils.toFlatObject(options, {
  689. metaTokens: true,
  690. dots: false,
  691. indexes: false
  692. }, false, function defined(option, source) {
  693. return !utils.isUndefined(source[option]);
  694. });
  695. const metaTokens = options.metaTokens;
  696. const visitor = options.visitor || defaultVisitor;
  697. const dots = options.dots;
  698. const indexes = options.indexes;
  699. const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
  700. const useBlob = _Blob && utils.isSpecCompliantForm(formData);
  701. if (!utils.isFunction(visitor)) {
  702. throw new TypeError("visitor must be a function");
  703. }
  704. function convertValue(value) {
  705. if (value === null)
  706. return "";
  707. if (utils.isDate(value)) {
  708. return value.toISOString();
  709. }
  710. if (!useBlob && utils.isBlob(value)) {
  711. throw new AxiosError("Blob is not supported. Use a Buffer instead.");
  712. }
  713. if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
  714. return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
  715. }
  716. return value;
  717. }
  718. function defaultVisitor(value, key, path) {
  719. let arr = value;
  720. if (value && !path && typeof value === "object") {
  721. if (utils.endsWith(key, "{}")) {
  722. key = metaTokens ? key : key.slice(0, -2);
  723. value = JSON.stringify(value);
  724. } else if (utils.isArray(value) && isFlatArray(value) || (utils.isFileList(value) || utils.endsWith(key, "[]")) && (arr = utils.toArray(value))) {
  725. key = removeBrackets(key);
  726. arr.forEach(function each(el, index) {
  727. !(utils.isUndefined(el) || el === null) && formData.append(
  728. // eslint-disable-next-line no-nested-ternary
  729. indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
  730. convertValue(el)
  731. );
  732. });
  733. return false;
  734. }
  735. }
  736. if (isVisitable(value)) {
  737. return true;
  738. }
  739. formData.append(renderKey(path, key, dots), convertValue(value));
  740. return false;
  741. }
  742. const stack = [];
  743. const exposedHelpers = Object.assign(predicates, {
  744. defaultVisitor,
  745. convertValue,
  746. isVisitable
  747. });
  748. function build(value, path) {
  749. if (utils.isUndefined(value))
  750. return;
  751. if (stack.indexOf(value) !== -1) {
  752. throw Error("Circular reference detected in " + path.join("."));
  753. }
  754. stack.push(value);
  755. utils.forEach(value, function each(el, key) {
  756. const result = !(utils.isUndefined(el) || el === null) && visitor.call(
  757. formData,
  758. el,
  759. utils.isString(key) ? key.trim() : key,
  760. path,
  761. exposedHelpers
  762. );
  763. if (result === true) {
  764. build(el, path ? path.concat(key) : [key]);
  765. }
  766. });
  767. stack.pop();
  768. }
  769. if (!utils.isObject(obj)) {
  770. throw new TypeError("data must be an object");
  771. }
  772. build(obj);
  773. return formData;
  774. }
  775. function encode$1(str) {
  776. const charMap = {
  777. "!": "%21",
  778. "'": "%27",
  779. "(": "%28",
  780. ")": "%29",
  781. "~": "%7E",
  782. "%20": "+",
  783. "%00": "\0"
  784. };
  785. return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
  786. return charMap[match];
  787. });
  788. }
  789. function AxiosURLSearchParams(params, options) {
  790. this._pairs = [];
  791. params && toFormData(params, this, options);
  792. }
  793. const prototype = AxiosURLSearchParams.prototype;
  794. prototype.append = function append(name, value) {
  795. this._pairs.push([name, value]);
  796. };
  797. prototype.toString = function toString2(encoder) {
  798. const _encode2 = encoder ? function(value) {
  799. return encoder.call(this, value, encode$1);
  800. } : encode$1;
  801. return this._pairs.map(function each(pair) {
  802. return _encode2(pair[0]) + "=" + _encode2(pair[1]);
  803. }, "").join("&");
  804. };
  805. function encode(val) {
  806. return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
  807. }
  808. function buildURL(url, params, options) {
  809. if (!params) {
  810. return url;
  811. }
  812. const _encode2 = options && options.encode || encode;
  813. const serializeFn = options && options.serialize;
  814. let serializedParams;
  815. if (serializeFn) {
  816. serializedParams = serializeFn(params, options);
  817. } else {
  818. serializedParams = utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode2);
  819. }
  820. if (serializedParams) {
  821. const hashmarkIndex = url.indexOf("#");
  822. if (hashmarkIndex !== -1) {
  823. url = url.slice(0, hashmarkIndex);
  824. }
  825. url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  826. }
  827. return url;
  828. }
  829. class InterceptorManager {
  830. constructor() {
  831. this.handlers = [];
  832. }
  833. /**
  834. * Add a new interceptor to the stack
  835. *
  836. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  837. * @param {Function} rejected The function to handle `reject` for a `Promise`
  838. *
  839. * @return {Number} An ID used to remove interceptor later
  840. */
  841. use(fulfilled, rejected, options) {
  842. this.handlers.push({
  843. fulfilled,
  844. rejected,
  845. synchronous: options ? options.synchronous : false,
  846. runWhen: options ? options.runWhen : null
  847. });
  848. return this.handlers.length - 1;
  849. }
  850. /**
  851. * Remove an interceptor from the stack
  852. *
  853. * @param {Number} id The ID that was returned by `use`
  854. *
  855. * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
  856. */
  857. eject(id) {
  858. if (this.handlers[id]) {
  859. this.handlers[id] = null;
  860. }
  861. }
  862. /**
  863. * Clear all interceptors from the stack
  864. *
  865. * @returns {void}
  866. */
  867. clear() {
  868. if (this.handlers) {
  869. this.handlers = [];
  870. }
  871. }
  872. /**
  873. * Iterate over all the registered interceptors
  874. *
  875. * This method is particularly useful for skipping over any
  876. * interceptors that may have become `null` calling `eject`.
  877. *
  878. * @param {Function} fn The function to call for each interceptor
  879. *
  880. * @returns {void}
  881. */
  882. forEach(fn) {
  883. utils.forEach(this.handlers, function forEachHandler(h) {
  884. if (h !== null) {
  885. fn(h);
  886. }
  887. });
  888. }
  889. }
  890. const InterceptorManager$1 = InterceptorManager;
  891. const transitionalDefaults = {
  892. silentJSONParsing: true,
  893. forcedJSONParsing: true,
  894. clarifyTimeoutError: false
  895. };
  896. const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
  897. const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
  898. const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
  899. const isStandardBrowserEnv = (() => {
  900. let product;
  901. if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) {
  902. return false;
  903. }
  904. return typeof window !== "undefined" && typeof document !== "undefined";
  905. })();
  906. const isStandardBrowserWebWorkerEnv = (() => {
  907. return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
  908. self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
  909. })();
  910. const platform = {
  911. isBrowser: true,
  912. classes: {
  913. URLSearchParams: URLSearchParams$1,
  914. FormData: FormData$1,
  915. Blob: Blob$1
  916. },
  917. isStandardBrowserEnv,
  918. isStandardBrowserWebWorkerEnv,
  919. protocols: ["http", "https", "file", "blob", "url", "data"]
  920. };
  921. function toURLEncodedForm(data, options) {
  922. return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
  923. visitor: function(value, key, path, helpers) {
  924. if (platform.isNode && utils.isBuffer(value)) {
  925. this.append(key, value.toString("base64"));
  926. return false;
  927. }
  928. return helpers.defaultVisitor.apply(this, arguments);
  929. }
  930. }, options));
  931. }
  932. function parsePropPath(name) {
  933. return utils.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
  934. return match[0] === "[]" ? "" : match[1] || match[0];
  935. });
  936. }
  937. function arrayToObject(arr) {
  938. const obj = {};
  939. const keys = Object.keys(arr);
  940. let i;
  941. const len = keys.length;
  942. let key;
  943. for (i = 0; i < len; i++) {
  944. key = keys[i];
  945. obj[key] = arr[key];
  946. }
  947. return obj;
  948. }
  949. function formDataToJSON(formData) {
  950. function buildPath(path, value, target, index) {
  951. let name = path[index++];
  952. const isNumericKey = Number.isFinite(+name);
  953. const isLast = index >= path.length;
  954. name = !name && utils.isArray(target) ? target.length : name;
  955. if (isLast) {
  956. if (utils.hasOwnProp(target, name)) {
  957. target[name] = [target[name], value];
  958. } else {
  959. target[name] = value;
  960. }
  961. return !isNumericKey;
  962. }
  963. if (!target[name] || !utils.isObject(target[name])) {
  964. target[name] = [];
  965. }
  966. const result = buildPath(path, value, target[name], index);
  967. if (result && utils.isArray(target[name])) {
  968. target[name] = arrayToObject(target[name]);
  969. }
  970. return !isNumericKey;
  971. }
  972. if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
  973. const obj = {};
  974. utils.forEachEntry(formData, (name, value) => {
  975. buildPath(parsePropPath(name), value, obj, 0);
  976. });
  977. return obj;
  978. }
  979. return null;
  980. }
  981. const DEFAULT_CONTENT_TYPE = {
  982. "Content-Type": void 0
  983. };
  984. function stringifySafely(rawValue, parser, encoder) {
  985. if (utils.isString(rawValue)) {
  986. try {
  987. (parser || JSON.parse)(rawValue);
  988. return utils.trim(rawValue);
  989. } catch (e) {
  990. if (e.name !== "SyntaxError") {
  991. throw e;
  992. }
  993. }
  994. }
  995. return (encoder || JSON.stringify)(rawValue);
  996. }
  997. const defaults = {
  998. transitional: transitionalDefaults,
  999. adapter: ["xhr", "http"],
  1000. transformRequest: [function transformRequest(data, headers) {
  1001. const contentType = headers.getContentType() || "";
  1002. const hasJSONContentType = contentType.indexOf("application/json") > -1;
  1003. const isObjectPayload = utils.isObject(data);
  1004. if (isObjectPayload && utils.isHTMLForm(data)) {
  1005. data = new FormData(data);
  1006. }
  1007. const isFormData2 = utils.isFormData(data);
  1008. if (isFormData2) {
  1009. if (!hasJSONContentType) {
  1010. return data;
  1011. }
  1012. return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
  1013. }
  1014. if (utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
  1015. return data;
  1016. }
  1017. if (utils.isArrayBufferView(data)) {
  1018. return data.buffer;
  1019. }
  1020. if (utils.isURLSearchParams(data)) {
  1021. headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
  1022. return data.toString();
  1023. }
  1024. let isFileList2;
  1025. if (isObjectPayload) {
  1026. if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
  1027. return toURLEncodedForm(data, this.formSerializer).toString();
  1028. }
  1029. if ((isFileList2 = utils.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
  1030. const _FormData = this.env && this.env.FormData;
  1031. return toFormData(
  1032. isFileList2 ? { "files[]": data } : data,
  1033. _FormData && new _FormData(),
  1034. this.formSerializer
  1035. );
  1036. }
  1037. }
  1038. if (isObjectPayload || hasJSONContentType) {
  1039. headers.setContentType("application/json", false);
  1040. return stringifySafely(data);
  1041. }
  1042. return data;
  1043. }],
  1044. transformResponse: [function transformResponse(data) {
  1045. const transitional2 = this.transitional || defaults.transitional;
  1046. const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
  1047. const JSONRequested = this.responseType === "json";
  1048. if (data && utils.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
  1049. const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
  1050. const strictJSONParsing = !silentJSONParsing && JSONRequested;
  1051. try {
  1052. return JSON.parse(data);
  1053. } catch (e) {
  1054. if (strictJSONParsing) {
  1055. if (e.name === "SyntaxError") {
  1056. throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
  1057. }
  1058. throw e;
  1059. }
  1060. }
  1061. }
  1062. return data;
  1063. }],
  1064. /**
  1065. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  1066. * timeout is not created.
  1067. */
  1068. timeout: 0,
  1069. xsrfCookieName: "XSRF-TOKEN",
  1070. xsrfHeaderName: "X-XSRF-TOKEN",
  1071. maxContentLength: -1,
  1072. maxBodyLength: -1,
  1073. env: {
  1074. FormData: platform.classes.FormData,
  1075. Blob: platform.classes.Blob
  1076. },
  1077. validateStatus: function validateStatus(status) {
  1078. return status >= 200 && status < 300;
  1079. },
  1080. headers: {
  1081. common: {
  1082. "Accept": "application/json, text/plain, */*"
  1083. }
  1084. }
  1085. };
  1086. utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
  1087. defaults.headers[method] = {};
  1088. });
  1089. utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
  1090. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  1091. });
  1092. const defaults$1 = defaults;
  1093. const ignoreDuplicateOf = utils.toObjectSet([
  1094. "age",
  1095. "authorization",
  1096. "content-length",
  1097. "content-type",
  1098. "etag",
  1099. "expires",
  1100. "from",
  1101. "host",
  1102. "if-modified-since",
  1103. "if-unmodified-since",
  1104. "last-modified",
  1105. "location",
  1106. "max-forwards",
  1107. "proxy-authorization",
  1108. "referer",
  1109. "retry-after",
  1110. "user-agent"
  1111. ]);
  1112. const parseHeaders = (rawHeaders) => {
  1113. const parsed = {};
  1114. let key;
  1115. let val;
  1116. let i;
  1117. rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
  1118. i = line.indexOf(":");
  1119. key = line.substring(0, i).trim().toLowerCase();
  1120. val = line.substring(i + 1).trim();
  1121. if (!key || parsed[key] && ignoreDuplicateOf[key]) {
  1122. return;
  1123. }
  1124. if (key === "set-cookie") {
  1125. if (parsed[key]) {
  1126. parsed[key].push(val);
  1127. } else {
  1128. parsed[key] = [val];
  1129. }
  1130. } else {
  1131. parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
  1132. }
  1133. });
  1134. return parsed;
  1135. };
  1136. const $internals = Symbol("internals");
  1137. function normalizeHeader(header) {
  1138. return header && String(header).trim().toLowerCase();
  1139. }
  1140. function normalizeValue(value) {
  1141. if (value === false || value == null) {
  1142. return value;
  1143. }
  1144. return utils.isArray(value) ? value.map(normalizeValue) : String(value);
  1145. }
  1146. function parseTokens(str) {
  1147. const tokens = /* @__PURE__ */ Object.create(null);
  1148. const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  1149. let match;
  1150. while (match = tokensRE.exec(str)) {
  1151. tokens[match[1]] = match[2];
  1152. }
  1153. return tokens;
  1154. }
  1155. const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
  1156. function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
  1157. if (utils.isFunction(filter2)) {
  1158. return filter2.call(this, value, header);
  1159. }
  1160. if (isHeaderNameFilter) {
  1161. value = header;
  1162. }
  1163. if (!utils.isString(value))
  1164. return;
  1165. if (utils.isString(filter2)) {
  1166. return value.indexOf(filter2) !== -1;
  1167. }
  1168. if (utils.isRegExp(filter2)) {
  1169. return filter2.test(value);
  1170. }
  1171. }
  1172. function formatHeader(header) {
  1173. return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
  1174. return char.toUpperCase() + str;
  1175. });
  1176. }
  1177. function buildAccessors(obj, header) {
  1178. const accessorName = utils.toCamelCase(" " + header);
  1179. ["get", "set", "has"].forEach((methodName) => {
  1180. Object.defineProperty(obj, methodName + accessorName, {
  1181. value: function(arg1, arg2, arg3) {
  1182. return this[methodName].call(this, header, arg1, arg2, arg3);
  1183. },
  1184. configurable: true
  1185. });
  1186. });
  1187. }
  1188. class AxiosHeaders {
  1189. constructor(headers) {
  1190. headers && this.set(headers);
  1191. }
  1192. set(header, valueOrRewrite, rewrite) {
  1193. const self2 = this;
  1194. function setHeader(_value, _header, _rewrite) {
  1195. const lHeader = normalizeHeader(_header);
  1196. if (!lHeader) {
  1197. throw new Error("header name must be a non-empty string");
  1198. }
  1199. const key = utils.findKey(self2, lHeader);
  1200. if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
  1201. self2[key || _header] = normalizeValue(_value);
  1202. }
  1203. }
  1204. const setHeaders = (headers, _rewrite) => utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
  1205. if (utils.isPlainObject(header) || header instanceof this.constructor) {
  1206. setHeaders(header, valueOrRewrite);
  1207. } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
  1208. setHeaders(parseHeaders(header), valueOrRewrite);
  1209. } else {
  1210. header != null && setHeader(valueOrRewrite, header, rewrite);
  1211. }
  1212. return this;
  1213. }
  1214. get(header, parser) {
  1215. header = normalizeHeader(header);
  1216. if (header) {
  1217. const key = utils.findKey(this, header);
  1218. if (key) {
  1219. const value = this[key];
  1220. if (!parser) {
  1221. return value;
  1222. }
  1223. if (parser === true) {
  1224. return parseTokens(value);
  1225. }
  1226. if (utils.isFunction(parser)) {
  1227. return parser.call(this, value, key);
  1228. }
  1229. if (utils.isRegExp(parser)) {
  1230. return parser.exec(value);
  1231. }
  1232. throw new TypeError("parser must be boolean|regexp|function");
  1233. }
  1234. }
  1235. }
  1236. has(header, matcher) {
  1237. header = normalizeHeader(header);
  1238. if (header) {
  1239. const key = utils.findKey(this, header);
  1240. return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
  1241. }
  1242. return false;
  1243. }
  1244. delete(header, matcher) {
  1245. const self2 = this;
  1246. let deleted = false;
  1247. function deleteHeader(_header) {
  1248. _header = normalizeHeader(_header);
  1249. if (_header) {
  1250. const key = utils.findKey(self2, _header);
  1251. if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
  1252. delete self2[key];
  1253. deleted = true;
  1254. }
  1255. }
  1256. }
  1257. if (utils.isArray(header)) {
  1258. header.forEach(deleteHeader);
  1259. } else {
  1260. deleteHeader(header);
  1261. }
  1262. return deleted;
  1263. }
  1264. clear(matcher) {
  1265. const keys = Object.keys(this);
  1266. let i = keys.length;
  1267. let deleted = false;
  1268. while (i--) {
  1269. const key = keys[i];
  1270. if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
  1271. delete this[key];
  1272. deleted = true;
  1273. }
  1274. }
  1275. return deleted;
  1276. }
  1277. normalize(format) {
  1278. const self2 = this;
  1279. const headers = {};
  1280. utils.forEach(this, (value, header) => {
  1281. const key = utils.findKey(headers, header);
  1282. if (key) {
  1283. self2[key] = normalizeValue(value);
  1284. delete self2[header];
  1285. return;
  1286. }
  1287. const normalized = format ? formatHeader(header) : String(header).trim();
  1288. if (normalized !== header) {
  1289. delete self2[header];
  1290. }
  1291. self2[normalized] = normalizeValue(value);
  1292. headers[normalized] = true;
  1293. });
  1294. return this;
  1295. }
  1296. concat(...targets) {
  1297. return this.constructor.concat(this, ...targets);
  1298. }
  1299. toJSON(asStrings) {
  1300. const obj = /* @__PURE__ */ Object.create(null);
  1301. utils.forEach(this, (value, header) => {
  1302. value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(", ") : value);
  1303. });
  1304. return obj;
  1305. }
  1306. [Symbol.iterator]() {
  1307. return Object.entries(this.toJSON())[Symbol.iterator]();
  1308. }
  1309. toString() {
  1310. return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
  1311. }
  1312. get [Symbol.toStringTag]() {
  1313. return "AxiosHeaders";
  1314. }
  1315. static from(thing) {
  1316. return thing instanceof this ? thing : new this(thing);
  1317. }
  1318. static concat(first, ...targets) {
  1319. const computed2 = new this(first);
  1320. targets.forEach((target) => computed2.set(target));
  1321. return computed2;
  1322. }
  1323. static accessor(header) {
  1324. const internals = this[$internals] = this[$internals] = {
  1325. accessors: {}
  1326. };
  1327. const accessors = internals.accessors;
  1328. const prototype2 = this.prototype;
  1329. function defineAccessor(_header) {
  1330. const lHeader = normalizeHeader(_header);
  1331. if (!accessors[lHeader]) {
  1332. buildAccessors(prototype2, _header);
  1333. accessors[lHeader] = true;
  1334. }
  1335. }
  1336. utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
  1337. return this;
  1338. }
  1339. }
  1340. AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
  1341. utils.freezeMethods(AxiosHeaders.prototype);
  1342. utils.freezeMethods(AxiosHeaders);
  1343. const AxiosHeaders$1 = AxiosHeaders;
  1344. function transformData(fns, response) {
  1345. const config = this || defaults$1;
  1346. const context = response || config;
  1347. const headers = AxiosHeaders$1.from(context.headers);
  1348. let data = context.data;
  1349. utils.forEach(fns, function transform(fn) {
  1350. data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  1351. });
  1352. headers.normalize();
  1353. return data;
  1354. }
  1355. function isCancel(value) {
  1356. return !!(value && value.__CANCEL__);
  1357. }
  1358. function CanceledError(message, config, request) {
  1359. AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request);
  1360. this.name = "CanceledError";
  1361. }
  1362. utils.inherits(CanceledError, AxiosError, {
  1363. __CANCEL__: true
  1364. });
  1365. function settle(resolve, reject, response) {
  1366. const validateStatus2 = response.config.validateStatus;
  1367. if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
  1368. resolve(response);
  1369. } else {
  1370. reject(new AxiosError(
  1371. "Request failed with status code " + response.status,
  1372. [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
  1373. response.config,
  1374. response.request,
  1375. response
  1376. ));
  1377. }
  1378. }
  1379. const cookies = platform.isStandardBrowserEnv ? (
  1380. // Standard browser envs support document.cookie
  1381. function standardBrowserEnv() {
  1382. return {
  1383. write: function write(name, value, expires, path, domain, secure) {
  1384. const cookie = [];
  1385. cookie.push(name + "=" + encodeURIComponent(value));
  1386. if (utils.isNumber(expires)) {
  1387. cookie.push("expires=" + new Date(expires).toGMTString());
  1388. }
  1389. if (utils.isString(path)) {
  1390. cookie.push("path=" + path);
  1391. }
  1392. if (utils.isString(domain)) {
  1393. cookie.push("domain=" + domain);
  1394. }
  1395. if (secure === true) {
  1396. cookie.push("secure");
  1397. }
  1398. document.cookie = cookie.join("; ");
  1399. },
  1400. read: function read(name) {
  1401. const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
  1402. return match ? decodeURIComponent(match[3]) : null;
  1403. },
  1404. remove: function remove(name) {
  1405. this.write(name, "", Date.now() - 864e5);
  1406. }
  1407. };
  1408. }()
  1409. ) : (
  1410. // Non standard browser env (web workers, react-native) lack needed support.
  1411. function nonStandardBrowserEnv() {
  1412. return {
  1413. write: function write() {
  1414. },
  1415. read: function read() {
  1416. return null;
  1417. },
  1418. remove: function remove() {
  1419. }
  1420. };
  1421. }()
  1422. );
  1423. function isAbsoluteURL(url) {
  1424. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  1425. }
  1426. function combineURLs(baseURL, relativeURL) {
  1427. return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
  1428. }
  1429. function buildFullPath(baseURL, requestedURL) {
  1430. if (baseURL && !isAbsoluteURL(requestedURL)) {
  1431. return combineURLs(baseURL, requestedURL);
  1432. }
  1433. return requestedURL;
  1434. }
  1435. const isURLSameOrigin = platform.isStandardBrowserEnv ? (
  1436. // Standard browser envs have full support of the APIs needed to test
  1437. // whether the request URL is of the same origin as current location.
  1438. function standardBrowserEnv2() {
  1439. const msie = /(msie|trident)/i.test(navigator.userAgent);
  1440. const urlParsingNode = document.createElement("a");
  1441. let originURL;
  1442. function resolveURL(url) {
  1443. let href = url;
  1444. if (msie) {
  1445. urlParsingNode.setAttribute("href", href);
  1446. href = urlParsingNode.href;
  1447. }
  1448. urlParsingNode.setAttribute("href", href);
  1449. return {
  1450. href: urlParsingNode.href,
  1451. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
  1452. host: urlParsingNode.host,
  1453. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
  1454. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
  1455. hostname: urlParsingNode.hostname,
  1456. port: urlParsingNode.port,
  1457. pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
  1458. };
  1459. }
  1460. originURL = resolveURL(window.location.href);
  1461. return function isURLSameOrigin2(requestURL) {
  1462. const parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
  1463. return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
  1464. };
  1465. }()
  1466. ) : (
  1467. // Non standard browser envs (web workers, react-native) lack needed support.
  1468. function nonStandardBrowserEnv2() {
  1469. return function isURLSameOrigin2() {
  1470. return true;
  1471. };
  1472. }()
  1473. );
  1474. function parseProtocol(url) {
  1475. const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  1476. return match && match[1] || "";
  1477. }
  1478. function speedometer(samplesCount, min) {
  1479. samplesCount = samplesCount || 10;
  1480. const bytes = new Array(samplesCount);
  1481. const timestamps = new Array(samplesCount);
  1482. let head = 0;
  1483. let tail = 0;
  1484. let firstSampleTS;
  1485. min = min !== void 0 ? min : 1e3;
  1486. return function push(chunkLength) {
  1487. const now = Date.now();
  1488. const startedAt = timestamps[tail];
  1489. if (!firstSampleTS) {
  1490. firstSampleTS = now;
  1491. }
  1492. bytes[head] = chunkLength;
  1493. timestamps[head] = now;
  1494. let i = tail;
  1495. let bytesCount = 0;
  1496. while (i !== head) {
  1497. bytesCount += bytes[i++];
  1498. i = i % samplesCount;
  1499. }
  1500. head = (head + 1) % samplesCount;
  1501. if (head === tail) {
  1502. tail = (tail + 1) % samplesCount;
  1503. }
  1504. if (now - firstSampleTS < min) {
  1505. return;
  1506. }
  1507. const passed = startedAt && now - startedAt;
  1508. return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
  1509. };
  1510. }
  1511. function progressEventReducer(listener, isDownloadStream) {
  1512. let bytesNotified = 0;
  1513. const _speedometer = speedometer(50, 250);
  1514. return (e) => {
  1515. const loaded = e.loaded;
  1516. const total = e.lengthComputable ? e.total : void 0;
  1517. const progressBytes = loaded - bytesNotified;
  1518. const rate = _speedometer(progressBytes);
  1519. const inRange = loaded <= total;
  1520. bytesNotified = loaded;
  1521. const data = {
  1522. loaded,
  1523. total,
  1524. progress: total ? loaded / total : void 0,
  1525. bytes: progressBytes,
  1526. rate: rate ? rate : void 0,
  1527. estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
  1528. event: e
  1529. };
  1530. data[isDownloadStream ? "download" : "upload"] = true;
  1531. listener(data);
  1532. };
  1533. }
  1534. const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
  1535. const xhrAdapter = isXHRAdapterSupported && function(config) {
  1536. return new Promise(function dispatchXhrRequest(resolve, reject) {
  1537. let requestData = config.data;
  1538. const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
  1539. const responseType = config.responseType;
  1540. let onCanceled;
  1541. function done() {
  1542. if (config.cancelToken) {
  1543. config.cancelToken.unsubscribe(onCanceled);
  1544. }
  1545. if (config.signal) {
  1546. config.signal.removeEventListener("abort", onCanceled);
  1547. }
  1548. }
  1549. if (utils.isFormData(requestData)) {
  1550. if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
  1551. requestHeaders.setContentType(false);
  1552. } else {
  1553. requestHeaders.setContentType("multipart/form-data;", false);
  1554. }
  1555. }
  1556. let request = new XMLHttpRequest();
  1557. if (config.auth) {
  1558. const username = config.auth.username || "";
  1559. const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
  1560. requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
  1561. }
  1562. const fullPath = buildFullPath(config.baseURL, config.url);
  1563. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  1564. request.timeout = config.timeout;
  1565. function onloadend() {
  1566. if (!request) {
  1567. return;
  1568. }
  1569. const responseHeaders = AxiosHeaders$1.from(
  1570. "getAllResponseHeaders" in request && request.getAllResponseHeaders()
  1571. );
  1572. const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
  1573. const response = {
  1574. data: responseData,
  1575. status: request.status,
  1576. statusText: request.statusText,
  1577. headers: responseHeaders,
  1578. config,
  1579. request
  1580. };
  1581. settle(function _resolve(value) {
  1582. resolve(value);
  1583. done();
  1584. }, function _reject(err) {
  1585. reject(err);
  1586. done();
  1587. }, response);
  1588. request = null;
  1589. }
  1590. if ("onloadend" in request) {
  1591. request.onloadend = onloadend;
  1592. } else {
  1593. request.onreadystatechange = function handleLoad() {
  1594. if (!request || request.readyState !== 4) {
  1595. return;
  1596. }
  1597. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
  1598. return;
  1599. }
  1600. setTimeout(onloadend);
  1601. };
  1602. }
  1603. request.onabort = function handleAbort() {
  1604. if (!request) {
  1605. return;
  1606. }
  1607. reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
  1608. request = null;
  1609. };
  1610. request.onerror = function handleError() {
  1611. reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request));
  1612. request = null;
  1613. };
  1614. request.ontimeout = function handleTimeout() {
  1615. let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
  1616. const transitional2 = config.transitional || transitionalDefaults;
  1617. if (config.timeoutErrorMessage) {
  1618. timeoutErrorMessage = config.timeoutErrorMessage;
  1619. }
  1620. reject(new AxiosError(
  1621. timeoutErrorMessage,
  1622. transitional2.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
  1623. config,
  1624. request
  1625. ));
  1626. request = null;
  1627. };
  1628. if (platform.isStandardBrowserEnv) {
  1629. const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
  1630. if (xsrfValue) {
  1631. requestHeaders.set(config.xsrfHeaderName, xsrfValue);
  1632. }
  1633. }
  1634. requestData === void 0 && requestHeaders.setContentType(null);
  1635. if ("setRequestHeader" in request) {
  1636. utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
  1637. request.setRequestHeader(key, val);
  1638. });
  1639. }
  1640. if (!utils.isUndefined(config.withCredentials)) {
  1641. request.withCredentials = !!config.withCredentials;
  1642. }
  1643. if (responseType && responseType !== "json") {
  1644. request.responseType = config.responseType;
  1645. }
  1646. if (typeof config.onDownloadProgress === "function") {
  1647. request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
  1648. }
  1649. if (typeof config.onUploadProgress === "function" && request.upload) {
  1650. request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
  1651. }
  1652. if (config.cancelToken || config.signal) {
  1653. onCanceled = (cancel) => {
  1654. if (!request) {
  1655. return;
  1656. }
  1657. reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
  1658. request.abort();
  1659. request = null;
  1660. };
  1661. config.cancelToken && config.cancelToken.subscribe(onCanceled);
  1662. if (config.signal) {
  1663. config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
  1664. }
  1665. }
  1666. const protocol = parseProtocol(fullPath);
  1667. if (protocol && platform.protocols.indexOf(protocol) === -1) {
  1668. reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
  1669. return;
  1670. }
  1671. request.send(requestData || null);
  1672. });
  1673. };
  1674. const knownAdapters = {
  1675. http: httpAdapter,
  1676. xhr: xhrAdapter
  1677. };
  1678. utils.forEach(knownAdapters, (fn, value) => {
  1679. if (fn) {
  1680. try {
  1681. Object.defineProperty(fn, "name", { value });
  1682. } catch (e) {
  1683. }
  1684. Object.defineProperty(fn, "adapterName", { value });
  1685. }
  1686. });
  1687. const adapters = {
  1688. getAdapter: (adapters2) => {
  1689. adapters2 = utils.isArray(adapters2) ? adapters2 : [adapters2];
  1690. const { length } = adapters2;
  1691. let nameOrAdapter;
  1692. let adapter;
  1693. for (let i = 0; i < length; i++) {
  1694. nameOrAdapter = adapters2[i];
  1695. if (adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
  1696. break;
  1697. }
  1698. }
  1699. if (!adapter) {
  1700. if (adapter === false) {
  1701. throw new AxiosError(
  1702. `Adapter ${nameOrAdapter} is not supported by the environment`,
  1703. "ERR_NOT_SUPPORT"
  1704. );
  1705. }
  1706. throw new Error(
  1707. utils.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
  1708. );
  1709. }
  1710. if (!utils.isFunction(adapter)) {
  1711. throw new TypeError("adapter is not a function");
  1712. }
  1713. return adapter;
  1714. },
  1715. adapters: knownAdapters
  1716. };
  1717. function throwIfCancellationRequested(config) {
  1718. if (config.cancelToken) {
  1719. config.cancelToken.throwIfRequested();
  1720. }
  1721. if (config.signal && config.signal.aborted) {
  1722. throw new CanceledError(null, config);
  1723. }
  1724. }
  1725. function dispatchRequest(config) {
  1726. throwIfCancellationRequested(config);
  1727. config.headers = AxiosHeaders$1.from(config.headers);
  1728. config.data = transformData.call(
  1729. config,
  1730. config.transformRequest
  1731. );
  1732. if (["post", "put", "patch"].indexOf(config.method) !== -1) {
  1733. config.headers.setContentType("application/x-www-form-urlencoded", false);
  1734. }
  1735. const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
  1736. return adapter(config).then(function onAdapterResolution(response) {
  1737. throwIfCancellationRequested(config);
  1738. response.data = transformData.call(
  1739. config,
  1740. config.transformResponse,
  1741. response
  1742. );
  1743. response.headers = AxiosHeaders$1.from(response.headers);
  1744. return response;
  1745. }, function onAdapterRejection(reason) {
  1746. if (!isCancel(reason)) {
  1747. throwIfCancellationRequested(config);
  1748. if (reason && reason.response) {
  1749. reason.response.data = transformData.call(
  1750. config,
  1751. config.transformResponse,
  1752. reason.response
  1753. );
  1754. reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
  1755. }
  1756. }
  1757. return Promise.reject(reason);
  1758. });
  1759. }
  1760. const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
  1761. function mergeConfig(config1, config2) {
  1762. config2 = config2 || {};
  1763. const config = {};
  1764. function getMergedValue(target, source, caseless) {
  1765. if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
  1766. return utils.merge.call({ caseless }, target, source);
  1767. } else if (utils.isPlainObject(source)) {
  1768. return utils.merge({}, source);
  1769. } else if (utils.isArray(source)) {
  1770. return source.slice();
  1771. }
  1772. return source;
  1773. }
  1774. function mergeDeepProperties(a, b, caseless) {
  1775. if (!utils.isUndefined(b)) {
  1776. return getMergedValue(a, b, caseless);
  1777. } else if (!utils.isUndefined(a)) {
  1778. return getMergedValue(void 0, a, caseless);
  1779. }
  1780. }
  1781. function valueFromConfig2(a, b) {
  1782. if (!utils.isUndefined(b)) {
  1783. return getMergedValue(void 0, b);
  1784. }
  1785. }
  1786. function defaultToConfig2(a, b) {
  1787. if (!utils.isUndefined(b)) {
  1788. return getMergedValue(void 0, b);
  1789. } else if (!utils.isUndefined(a)) {
  1790. return getMergedValue(void 0, a);
  1791. }
  1792. }
  1793. function mergeDirectKeys(a, b, prop) {
  1794. if (prop in config2) {
  1795. return getMergedValue(a, b);
  1796. } else if (prop in config1) {
  1797. return getMergedValue(void 0, a);
  1798. }
  1799. }
  1800. const mergeMap = {
  1801. url: valueFromConfig2,
  1802. method: valueFromConfig2,
  1803. data: valueFromConfig2,
  1804. baseURL: defaultToConfig2,
  1805. transformRequest: defaultToConfig2,
  1806. transformResponse: defaultToConfig2,
  1807. paramsSerializer: defaultToConfig2,
  1808. timeout: defaultToConfig2,
  1809. timeoutMessage: defaultToConfig2,
  1810. withCredentials: defaultToConfig2,
  1811. adapter: defaultToConfig2,
  1812. responseType: defaultToConfig2,
  1813. xsrfCookieName: defaultToConfig2,
  1814. xsrfHeaderName: defaultToConfig2,
  1815. onUploadProgress: defaultToConfig2,
  1816. onDownloadProgress: defaultToConfig2,
  1817. decompress: defaultToConfig2,
  1818. maxContentLength: defaultToConfig2,
  1819. maxBodyLength: defaultToConfig2,
  1820. beforeRedirect: defaultToConfig2,
  1821. transport: defaultToConfig2,
  1822. httpAgent: defaultToConfig2,
  1823. httpsAgent: defaultToConfig2,
  1824. cancelToken: defaultToConfig2,
  1825. socketPath: defaultToConfig2,
  1826. responseEncoding: defaultToConfig2,
  1827. validateStatus: mergeDirectKeys,
  1828. headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
  1829. };
  1830. utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
  1831. const merge2 = mergeMap[prop] || mergeDeepProperties;
  1832. const configValue = merge2(config1[prop], config2[prop], prop);
  1833. utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
  1834. });
  1835. return config;
  1836. }
  1837. const VERSION = "1.4.0";
  1838. const validators$1 = {};
  1839. ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
  1840. validators$1[type] = function validator2(thing) {
  1841. return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
  1842. };
  1843. });
  1844. const deprecatedWarnings = {};
  1845. validators$1.transitional = function transitional(validator2, version2, message) {
  1846. function formatMessage(opt, desc) {
  1847. return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
  1848. }
  1849. return (value, opt, opts) => {
  1850. if (validator2 === false) {
  1851. throw new AxiosError(
  1852. formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")),
  1853. AxiosError.ERR_DEPRECATED
  1854. );
  1855. }
  1856. if (version2 && !deprecatedWarnings[opt]) {
  1857. deprecatedWarnings[opt] = true;
  1858. console.warn(
  1859. formatMessage(
  1860. opt,
  1861. " has been deprecated since v" + version2 + " and will be removed in the near future"
  1862. )
  1863. );
  1864. }
  1865. return validator2 ? validator2(value, opt, opts) : true;
  1866. };
  1867. };
  1868. function assertOptions(options, schema, allowUnknown) {
  1869. if (typeof options !== "object") {
  1870. throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
  1871. }
  1872. const keys = Object.keys(options);
  1873. let i = keys.length;
  1874. while (i-- > 0) {
  1875. const opt = keys[i];
  1876. const validator2 = schema[opt];
  1877. if (validator2) {
  1878. const value = options[opt];
  1879. const result = value === void 0 || validator2(value, opt, options);
  1880. if (result !== true) {
  1881. throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
  1882. }
  1883. continue;
  1884. }
  1885. if (allowUnknown !== true) {
  1886. throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
  1887. }
  1888. }
  1889. }
  1890. const validator = {
  1891. assertOptions,
  1892. validators: validators$1
  1893. };
  1894. const validators = validator.validators;
  1895. class Axios {
  1896. constructor(instanceConfig) {
  1897. this.defaults = instanceConfig;
  1898. this.interceptors = {
  1899. request: new InterceptorManager$1(),
  1900. response: new InterceptorManager$1()
  1901. };
  1902. }
  1903. /**
  1904. * Dispatch a request
  1905. *
  1906. * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
  1907. * @param {?Object} config
  1908. *
  1909. * @returns {Promise} The Promise to be fulfilled
  1910. */
  1911. request(configOrUrl, config) {
  1912. if (typeof configOrUrl === "string") {
  1913. config = config || {};
  1914. config.url = configOrUrl;
  1915. } else {
  1916. config = configOrUrl || {};
  1917. }
  1918. config = mergeConfig(this.defaults, config);
  1919. const { transitional: transitional2, paramsSerializer, headers } = config;
  1920. if (transitional2 !== void 0) {
  1921. validator.assertOptions(transitional2, {
  1922. silentJSONParsing: validators.transitional(validators.boolean),
  1923. forcedJSONParsing: validators.transitional(validators.boolean),
  1924. clarifyTimeoutError: validators.transitional(validators.boolean)
  1925. }, false);
  1926. }
  1927. if (paramsSerializer != null) {
  1928. if (utils.isFunction(paramsSerializer)) {
  1929. config.paramsSerializer = {
  1930. serialize: paramsSerializer
  1931. };
  1932. } else {
  1933. validator.assertOptions(paramsSerializer, {
  1934. encode: validators.function,
  1935. serialize: validators.function
  1936. }, true);
  1937. }
  1938. }
  1939. config.method = (config.method || this.defaults.method || "get").toLowerCase();
  1940. let contextHeaders;
  1941. contextHeaders = headers && utils.merge(
  1942. headers.common,
  1943. headers[config.method]
  1944. );
  1945. contextHeaders && utils.forEach(
  1946. ["delete", "get", "head", "post", "put", "patch", "common"],
  1947. (method) => {
  1948. delete headers[method];
  1949. }
  1950. );
  1951. config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
  1952. const requestInterceptorChain = [];
  1953. let synchronousRequestInterceptors = true;
  1954. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  1955. if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
  1956. return;
  1957. }
  1958. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  1959. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  1960. });
  1961. const responseInterceptorChain = [];
  1962. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  1963. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  1964. });
  1965. let promise;
  1966. let i = 0;
  1967. let len;
  1968. if (!synchronousRequestInterceptors) {
  1969. const chain = [dispatchRequest.bind(this), void 0];
  1970. chain.unshift.apply(chain, requestInterceptorChain);
  1971. chain.push.apply(chain, responseInterceptorChain);
  1972. len = chain.length;
  1973. promise = Promise.resolve(config);
  1974. while (i < len) {
  1975. promise = promise.then(chain[i++], chain[i++]);
  1976. }
  1977. return promise;
  1978. }
  1979. len = requestInterceptorChain.length;
  1980. let newConfig = config;
  1981. i = 0;
  1982. while (i < len) {
  1983. const onFulfilled = requestInterceptorChain[i++];
  1984. const onRejected = requestInterceptorChain[i++];
  1985. try {
  1986. newConfig = onFulfilled(newConfig);
  1987. } catch (error) {
  1988. onRejected.call(this, error);
  1989. break;
  1990. }
  1991. }
  1992. try {
  1993. promise = dispatchRequest.call(this, newConfig);
  1994. } catch (error) {
  1995. return Promise.reject(error);
  1996. }
  1997. i = 0;
  1998. len = responseInterceptorChain.length;
  1999. while (i < len) {
  2000. promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
  2001. }
  2002. return promise;
  2003. }
  2004. getUri(config) {
  2005. config = mergeConfig(this.defaults, config);
  2006. const fullPath = buildFullPath(config.baseURL, config.url);
  2007. return buildURL(fullPath, config.params, config.paramsSerializer);
  2008. }
  2009. }
  2010. utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
  2011. Axios.prototype[method] = function(url, config) {
  2012. return this.request(mergeConfig(config || {}, {
  2013. method,
  2014. url,
  2015. data: (config || {}).data
  2016. }));
  2017. };
  2018. });
  2019. utils.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
  2020. function generateHTTPMethod(isForm) {
  2021. return function httpMethod(url, data, config) {
  2022. return this.request(mergeConfig(config || {}, {
  2023. method,
  2024. headers: isForm ? {
  2025. "Content-Type": "multipart/form-data"
  2026. } : {},
  2027. url,
  2028. data
  2029. }));
  2030. };
  2031. }
  2032. Axios.prototype[method] = generateHTTPMethod();
  2033. Axios.prototype[method + "Form"] = generateHTTPMethod(true);
  2034. });
  2035. const Axios$1 = Axios;
  2036. class CancelToken {
  2037. constructor(executor) {
  2038. if (typeof executor !== "function") {
  2039. throw new TypeError("executor must be a function.");
  2040. }
  2041. let resolvePromise;
  2042. this.promise = new Promise(function promiseExecutor(resolve) {
  2043. resolvePromise = resolve;
  2044. });
  2045. const token = this;
  2046. this.promise.then((cancel) => {
  2047. if (!token._listeners)
  2048. return;
  2049. let i = token._listeners.length;
  2050. while (i-- > 0) {
  2051. token._listeners[i](cancel);
  2052. }
  2053. token._listeners = null;
  2054. });
  2055. this.promise.then = (onfulfilled) => {
  2056. let _resolve;
  2057. const promise = new Promise((resolve) => {
  2058. token.subscribe(resolve);
  2059. _resolve = resolve;
  2060. }).then(onfulfilled);
  2061. promise.cancel = function reject() {
  2062. token.unsubscribe(_resolve);
  2063. };
  2064. return promise;
  2065. };
  2066. executor(function cancel(message, config, request) {
  2067. if (token.reason) {
  2068. return;
  2069. }
  2070. token.reason = new CanceledError(message, config, request);
  2071. resolvePromise(token.reason);
  2072. });
  2073. }
  2074. /**
  2075. * Throws a `CanceledError` if cancellation has been requested.
  2076. */
  2077. throwIfRequested() {
  2078. if (this.reason) {
  2079. throw this.reason;
  2080. }
  2081. }
  2082. /**
  2083. * Subscribe to the cancel signal
  2084. */
  2085. subscribe(listener) {
  2086. if (this.reason) {
  2087. listener(this.reason);
  2088. return;
  2089. }
  2090. if (this._listeners) {
  2091. this._listeners.push(listener);
  2092. } else {
  2093. this._listeners = [listener];
  2094. }
  2095. }
  2096. /**
  2097. * Unsubscribe from the cancel signal
  2098. */
  2099. unsubscribe(listener) {
  2100. if (!this._listeners) {
  2101. return;
  2102. }
  2103. const index = this._listeners.indexOf(listener);
  2104. if (index !== -1) {
  2105. this._listeners.splice(index, 1);
  2106. }
  2107. }
  2108. /**
  2109. * Returns an object that contains a new `CancelToken` and a function that, when called,
  2110. * cancels the `CancelToken`.
  2111. */
  2112. static source() {
  2113. let cancel;
  2114. const token = new CancelToken(function executor(c) {
  2115. cancel = c;
  2116. });
  2117. return {
  2118. token,
  2119. cancel
  2120. };
  2121. }
  2122. }
  2123. const CancelToken$1 = CancelToken;
  2124. function spread(callback) {
  2125. return function wrap(arr) {
  2126. return callback.apply(null, arr);
  2127. };
  2128. }
  2129. function isAxiosError(payload) {
  2130. return utils.isObject(payload) && payload.isAxiosError === true;
  2131. }
  2132. const HttpStatusCode = {
  2133. Continue: 100,
  2134. SwitchingProtocols: 101,
  2135. Processing: 102,
  2136. EarlyHints: 103,
  2137. Ok: 200,
  2138. Created: 201,
  2139. Accepted: 202,
  2140. NonAuthoritativeInformation: 203,
  2141. NoContent: 204,
  2142. ResetContent: 205,
  2143. PartialContent: 206,
  2144. MultiStatus: 207,
  2145. AlreadyReported: 208,
  2146. ImUsed: 226,
  2147. MultipleChoices: 300,
  2148. MovedPermanently: 301,
  2149. Found: 302,
  2150. SeeOther: 303,
  2151. NotModified: 304,
  2152. UseProxy: 305,
  2153. Unused: 306,
  2154. TemporaryRedirect: 307,
  2155. PermanentRedirect: 308,
  2156. BadRequest: 400,
  2157. Unauthorized: 401,
  2158. PaymentRequired: 402,
  2159. Forbidden: 403,
  2160. NotFound: 404,
  2161. MethodNotAllowed: 405,
  2162. NotAcceptable: 406,
  2163. ProxyAuthenticationRequired: 407,
  2164. RequestTimeout: 408,
  2165. Conflict: 409,
  2166. Gone: 410,
  2167. LengthRequired: 411,
  2168. PreconditionFailed: 412,
  2169. PayloadTooLarge: 413,
  2170. UriTooLong: 414,
  2171. UnsupportedMediaType: 415,
  2172. RangeNotSatisfiable: 416,
  2173. ExpectationFailed: 417,
  2174. ImATeapot: 418,
  2175. MisdirectedRequest: 421,
  2176. UnprocessableEntity: 422,
  2177. Locked: 423,
  2178. FailedDependency: 424,
  2179. TooEarly: 425,
  2180. UpgradeRequired: 426,
  2181. PreconditionRequired: 428,
  2182. TooManyRequests: 429,
  2183. RequestHeaderFieldsTooLarge: 431,
  2184. UnavailableForLegalReasons: 451,
  2185. InternalServerError: 500,
  2186. NotImplemented: 501,
  2187. BadGateway: 502,
  2188. ServiceUnavailable: 503,
  2189. GatewayTimeout: 504,
  2190. HttpVersionNotSupported: 505,
  2191. VariantAlsoNegotiates: 506,
  2192. InsufficientStorage: 507,
  2193. LoopDetected: 508,
  2194. NotExtended: 510,
  2195. NetworkAuthenticationRequired: 511
  2196. };
  2197. Object.entries(HttpStatusCode).forEach(([key, value]) => {
  2198. HttpStatusCode[value] = key;
  2199. });
  2200. const HttpStatusCode$1 = HttpStatusCode;
  2201. function createInstance(defaultConfig) {
  2202. const context = new Axios$1(defaultConfig);
  2203. const instance = bind(Axios$1.prototype.request, context);
  2204. utils.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
  2205. utils.extend(instance, context, null, { allOwnKeys: true });
  2206. instance.create = function create(instanceConfig) {
  2207. return createInstance(mergeConfig(defaultConfig, instanceConfig));
  2208. };
  2209. return instance;
  2210. }
  2211. const axios = createInstance(defaults$1);
  2212. axios.Axios = Axios$1;
  2213. axios.CanceledError = CanceledError;
  2214. axios.CancelToken = CancelToken$1;
  2215. axios.isCancel = isCancel;
  2216. axios.VERSION = VERSION;
  2217. axios.toFormData = toFormData;
  2218. axios.AxiosError = AxiosError;
  2219. axios.Cancel = axios.CanceledError;
  2220. axios.all = function all(promises) {
  2221. return Promise.all(promises);
  2222. };
  2223. axios.spread = spread;
  2224. axios.isAxiosError = isAxiosError;
  2225. axios.mergeConfig = mergeConfig;
  2226. axios.AxiosHeaders = AxiosHeaders$1;
  2227. axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
  2228. axios.HttpStatusCode = HttpStatusCode$1;
  2229. axios.default = axios;
  2230. const axios$1 = axios;
  2231. const Panel_vue_vue_type_style_index_0_scoped_5a132a30_lang = "";
  2232. const _export_sfc = (sfc, props) => {
  2233. const target = sfc.__vccOpts || sfc;
  2234. for (const [key, val] of props) {
  2235. target[key] = val;
  2236. }
  2237. return target;
  2238. };
  2239. const _withScopeId = (n) => (pushScopeId("data-v-5a132a30"), n = n(), popScopeId(), n);
  2240. const _hoisted_1 = { class: "line-container" };
  2241. const _hoisted_2 = ["disabled"];
  2242. const _hoisted_3 = { class: "line-container" };
  2243. const _hoisted_4 = { key: 0 };
  2244. const _hoisted_5 = ["value"];
  2245. const _hoisted_6 = ["value"];
  2246. const _hoisted_7 = ["disabled"];
  2247. const _hoisted_8 = { key: 1 };
  2248. const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("select", { disabled: "" }, null, -1));
  2249. const _hoisted_10 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("select", { disabled: "" }, null, -1));
  2250. const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("button", { disabled: "" }, "导出", -1));
  2251. const _hoisted_12 = [
  2252. _hoisted_9,
  2253. _hoisted_10,
  2254. _hoisted_11
  2255. ];
  2256. const _hoisted_13 = { class: "line-container" };
  2257. const _hoisted_14 = ["value"];
  2258. const _hoisted_15 = ["disabled"];
  2259. const realm = "pc";
  2260. const _sfc_main$1 = {
  2261. __name: "Panel",
  2262. setup(__props) {
  2263. const accountName = ref("");
  2264. const characters = ref([]);
  2265. const leagues = ref([]);
  2266. const leagueMap = ref(/* @__PURE__ */ new Map());
  2267. const currLeague = ref("");
  2268. const currCharacters = ref([]);
  2269. const currCharacter = ref("");
  2270. const buildingCode = ref("");
  2271. const state = reactive({
  2272. accountName,
  2273. realm,
  2274. characters,
  2275. leagues,
  2276. leagueMap,
  2277. currLeague,
  2278. currCharacters,
  2279. currCharacter,
  2280. buildingCode
  2281. });
  2282. const getCharactersReady = computed(() => {
  2283. return Boolean(state.accountName);
  2284. });
  2285. const selectReady = computed(() => {
  2286. return state.characters.length > 0;
  2287. });
  2288. const exportReady = computed(() => {
  2289. return state.characters.length > 0 && Boolean(state.currCharacter);
  2290. });
  2291. function selectNewLeague() {
  2292. state.currCharacters = state.leagueMap.get(state.currLeague);
  2293. state.currCharacter = state.currCharacters[0].name;
  2294. }
  2295. function getCharacters() {
  2296. const url = "/character-window/get-characters";
  2297. const realm2 = state.realm;
  2298. const accountName2 = state.accountName;
  2299. let form = new URLSearchParams();
  2300. form.append("accountName", accountName2);
  2301. form.append("realm", realm2);
  2302. state.currLeague = "";
  2303. state.currCharacter = "";
  2304. axios$1.post(url, form).then((res) => {
  2305. const characters2 = res.data;
  2306. state.characters = characters2;
  2307. let leagueMap2 = /* @__PURE__ */ new Map();
  2308. for (const character of characters2) {
  2309. const leagueName = character.league;
  2310. let list = leagueMap2.get(leagueName);
  2311. if (list === void 0) {
  2312. list = [];
  2313. leagueMap2.set(leagueName, list);
  2314. }
  2315. list.push(character);
  2316. }
  2317. state.leagueMap = leagueMap2;
  2318. const leagues2 = Array.from(leagueMap2.keys());
  2319. state.leagues = leagues2;
  2320. if (leagues2.length > 0) {
  2321. state.currLeague = leagues2[0];
  2322. selectNewLeague();
  2323. }
  2324. }).catch((err) => {
  2325. state.leagues = [];
  2326. state.characters = [];
  2327. console.log(err);
  2328. alert(err);
  2329. });
  2330. }
  2331. async function getItems() {
  2332. const url = "/character-window/get-items";
  2333. const realm2 = state.realm;
  2334. const accountName2 = state.accountName;
  2335. const character = state.currCharacter;
  2336. let form = new URLSearchParams();
  2337. form.append("accountName", accountName2);
  2338. form.append("realm", realm2);
  2339. form.append("character", character);
  2340. const res = await axios$1.post(url, form);
  2341. return res.data;
  2342. }
  2343. async function getPassiveSkills() {
  2344. const url = "/character-window/get-passive-skills";
  2345. const realm2 = state.realm;
  2346. const accountName2 = state.accountName;
  2347. const character = state.currCharacter;
  2348. let params = new URLSearchParams();
  2349. params.append("accountName", accountName2);
  2350. params.append("realm", realm2);
  2351. params.append("character", character);
  2352. const res = await axios$1.get(url, { params });
  2353. return res.data;
  2354. }
  2355. const factory = CnPoeTranslator.newBasicTranslatorFactory(CnPoeExportDb);
  2356. const jsonTranslator = factory.getJsonTranslator();
  2357. async function exportBuilding() {
  2358. let items;
  2359. let passiveSkills;
  2360. try {
  2361. items = await getItems();
  2362. passiveSkills = await getPassiveSkills();
  2363. } catch (err) {
  2364. alert(`加载角色数据失败: ${err}`);
  2365. }
  2366. jsonTranslator.translateItems(items);
  2367. jsonTranslator.translatePassiveSkills(passiveSkills);
  2368. const building = BuildingCreater.transform(items, passiveSkills);
  2369. const compressed = window.pako.deflate(building.toString());
  2370. const code = gBase64.fromUint8Array(compressed).replaceAll("+", "-").replaceAll("/", "_");
  2371. state.buildingCode = code;
  2372. }
  2373. function copyBuildingCode() {
  2374. navigator.clipboard.writeText(state.buildingCode);
  2375. }
  2376. function getInitialAccountName() {
  2377. let pattern = new RegExp("/account/view-profile/([^/?]+)");
  2378. let match = pattern.exec(window.location.href);
  2379. if (match) {
  2380. return decodeURI(match[1]);
  2381. }
  2382. return "";
  2383. }
  2384. onMounted(() => {
  2385. state.accountName = getInitialAccountName();
  2386. });
  2387. return (_ctx, _cache) => {
  2388. return openBlock(), createElementBlock(Fragment, null, [
  2389. createElementVNode("span", _hoisted_1, [
  2390. withDirectives(createElementVNode("input", {
  2391. type: "text",
  2392. placeholder: "输入论坛账户名",
  2393. maxlength: "50",
  2394. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.accountName = $event)
  2395. }, null, 512), [
  2396. [
  2397. vModelText,
  2398. state.accountName,
  2399. void 0,
  2400. { trim: true }
  2401. ]
  2402. ]),
  2403. createElementVNode("button", {
  2404. onClick: getCharacters,
  2405. disabled: !getCharactersReady.value
  2406. }, "开始", 8, _hoisted_2)
  2407. ]),
  2408. createElementVNode("span", _hoisted_3, [
  2409. selectReady.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
  2410. selectReady.value ? withDirectives((openBlock(), createElementBlock("select", {
  2411. key: 0,
  2412. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.currLeague = $event),
  2413. onChange: selectNewLeague
  2414. }, [
  2415. (openBlock(true), createElementBlock(Fragment, null, renderList(leagues.value, (item) => {
  2416. return openBlock(), createElementBlock("option", {
  2417. key: item,
  2418. value: item
  2419. }, toDisplayString(item), 9, _hoisted_5);
  2420. }), 128))
  2421. ], 544)), [
  2422. [vModelSelect, state.currLeague]
  2423. ]) : createCommentVNode("", true),
  2424. selectReady.value ? withDirectives((openBlock(), createElementBlock("select", {
  2425. key: 1,
  2426. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.currCharacter = $event)
  2427. }, [
  2428. (openBlock(true), createElementBlock(Fragment, null, renderList(state.currCharacters, (item) => {
  2429. return openBlock(), createElementBlock("option", {
  2430. key: item.name,
  2431. value: item.name
  2432. }, toDisplayString(item.name) + "," + toDisplayString(item.level) + "," + toDisplayString(item.class), 9, _hoisted_6);
  2433. }), 128))
  2434. ], 512)), [
  2435. [vModelSelect, state.currCharacter]
  2436. ]) : createCommentVNode("", true),
  2437. selectReady.value ? (openBlock(), createElementBlock("button", {
  2438. key: 2,
  2439. disabled: !exportReady.value,
  2440. onClick: exportBuilding
  2441. }, "导出", 8, _hoisted_7)) : createCommentVNode("", true)
  2442. ])) : (openBlock(), createElementBlock("div", _hoisted_8, _hoisted_12))
  2443. ]),
  2444. createElementVNode("span", _hoisted_13, [
  2445. createElementVNode("input", {
  2446. disabled: "",
  2447. maxlength: "50",
  2448. value: state.buildingCode
  2449. }, null, 8, _hoisted_14),
  2450. createElementVNode("button", {
  2451. onClick: copyBuildingCode,
  2452. disabled: !state.buildingCode
  2453. }, "复制", 8, _hoisted_15)
  2454. ])
  2455. ], 64);
  2456. };
  2457. }
  2458. };
  2459. const Panel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-5a132a30"]]);
  2460. const _sfc_main = {
  2461. __name: "Exporter",
  2462. setup(__props) {
  2463. return (_ctx, _cache) => {
  2464. return openBlock(), createBlock(Panel);
  2465. };
  2466. }
  2467. };
  2468. const container = document.createElement("div");
  2469. container.id = "exportContainer";
  2470. document.body.appendChild(container);
  2471. createApp(_sfc_main).mount("#exportContainer");
  2472.  
  2473.  
  2474. })();