wcz-test 6.24.6 → 6.24.7
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.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { c } from "react/compiler-runtime";
|
|
2
2
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
-
import saveAs from "file-saver";
|
|
4
3
|
import { useState } from "react";
|
|
5
4
|
import { uuidv7 } from "uuidv7";
|
|
6
5
|
import z__default from "zod";
|
|
@@ -8,6 +7,83 @@ import { F as FileMetaSchema } from "./FileMeta-G1oT3mYK.js";
|
|
|
8
7
|
import { t as toKebabCase, h as httpClient } from "./utils-MD9YwOtu.js";
|
|
9
8
|
import { c as clientEnv } from "./env-gsqZ6zZD.js";
|
|
10
9
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
10
|
+
var FileSaver_min$1 = { exports: {} };
|
|
11
|
+
var FileSaver_min = FileSaver_min$1.exports;
|
|
12
|
+
var hasRequiredFileSaver_min;
|
|
13
|
+
function requireFileSaver_min() {
|
|
14
|
+
if (hasRequiredFileSaver_min) return FileSaver_min$1.exports;
|
|
15
|
+
hasRequiredFileSaver_min = 1;
|
|
16
|
+
(function(module, exports$1) {
|
|
17
|
+
(function(a, b) {
|
|
18
|
+
b();
|
|
19
|
+
})(FileSaver_min, function() {
|
|
20
|
+
function b(a2, b2) {
|
|
21
|
+
return "undefined" == typeof b2 ? b2 = { autoBom: false } : "object" != typeof b2 && (console.warn("Deprecated: Expected third argument to be a object"), b2 = { autoBom: !b2 }), b2.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a2.type) ? new Blob(["\uFEFF", a2], { type: a2.type }) : a2;
|
|
22
|
+
}
|
|
23
|
+
function c2(a2, b2, c3) {
|
|
24
|
+
var d2 = new XMLHttpRequest();
|
|
25
|
+
d2.open("GET", a2), d2.responseType = "blob", d2.onload = function() {
|
|
26
|
+
g(d2.response, b2, c3);
|
|
27
|
+
}, d2.onerror = function() {
|
|
28
|
+
console.error("could not download file");
|
|
29
|
+
}, d2.send();
|
|
30
|
+
}
|
|
31
|
+
function d(a2) {
|
|
32
|
+
var b2 = new XMLHttpRequest();
|
|
33
|
+
b2.open("HEAD", a2, false);
|
|
34
|
+
try {
|
|
35
|
+
b2.send();
|
|
36
|
+
} catch (a3) {
|
|
37
|
+
}
|
|
38
|
+
return 200 <= b2.status && 299 >= b2.status;
|
|
39
|
+
}
|
|
40
|
+
function e(a2) {
|
|
41
|
+
try {
|
|
42
|
+
a2.dispatchEvent(new MouseEvent("click"));
|
|
43
|
+
} catch (c3) {
|
|
44
|
+
var b2 = document.createEvent("MouseEvents");
|
|
45
|
+
b2.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a2.dispatchEvent(b2);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var f = "object" == typeof window && window.window === window ? window : "object" == typeof self && self.self === self ? self : "object" == typeof commonjsGlobal && commonjsGlobal.global === commonjsGlobal ? commonjsGlobal : void 0, a = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g = f.saveAs || ("object" != typeof window || window !== f ? function() {
|
|
49
|
+
} : "download" in HTMLAnchorElement.prototype && !a ? function(b2, g2, h) {
|
|
50
|
+
var i = f.URL || f.webkitURL, j = document.createElement("a");
|
|
51
|
+
g2 = g2 || b2.name || "download", j.download = g2, j.rel = "noopener", "string" == typeof b2 ? (j.href = b2, j.origin === location.origin ? e(j) : d(j.href) ? c2(b2, g2, h) : e(j, j.target = "_blank")) : (j.href = i.createObjectURL(b2), setTimeout(function() {
|
|
52
|
+
i.revokeObjectURL(j.href);
|
|
53
|
+
}, 4e4), setTimeout(function() {
|
|
54
|
+
e(j);
|
|
55
|
+
}, 0));
|
|
56
|
+
} : "msSaveOrOpenBlob" in navigator ? function(f2, g2, h) {
|
|
57
|
+
if (g2 = g2 || f2.name || "download", "string" != typeof f2) navigator.msSaveOrOpenBlob(b(f2, h), g2);
|
|
58
|
+
else if (d(f2)) c2(f2, g2, h);
|
|
59
|
+
else {
|
|
60
|
+
var i = document.createElement("a");
|
|
61
|
+
i.href = f2, i.target = "_blank", setTimeout(function() {
|
|
62
|
+
e(i);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
} : function(b2, d2, e2, g2) {
|
|
66
|
+
if (g2 = g2 || open("", "_blank"), g2 && (g2.document.title = g2.document.body.innerText = "downloading..."), "string" == typeof b2) return c2(b2, d2, e2);
|
|
67
|
+
var h = "application/octet-stream" === b2.type, i = /constructor/i.test(f.HTMLElement) || f.safari, j = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
68
|
+
if ((j || h && i || a) && "undefined" != typeof FileReader) {
|
|
69
|
+
var k = new FileReader();
|
|
70
|
+
k.onloadend = function() {
|
|
71
|
+
var a2 = k.result;
|
|
72
|
+
a2 = j ? a2 : a2.replace(/^data:[^;]*;/, "data:attachment/file;"), g2 ? g2.location.href = a2 : location = a2, g2 = null;
|
|
73
|
+
}, k.readAsDataURL(b2);
|
|
74
|
+
} else {
|
|
75
|
+
var l = f.URL || f.webkitURL, m = l.createObjectURL(b2);
|
|
76
|
+
g2 ? g2.location = m : location.href = m, g2 = null, setTimeout(function() {
|
|
77
|
+
l.revokeObjectURL(m);
|
|
78
|
+
}, 4e4);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
f.saveAs = g.saveAs = g, module.exports = g;
|
|
82
|
+
});
|
|
83
|
+
})(FileSaver_min$1);
|
|
84
|
+
return FileSaver_min$1.exports;
|
|
85
|
+
}
|
|
86
|
+
var FileSaver_minExports = requireFileSaver_min();
|
|
11
87
|
function _typeof$8(o) {
|
|
12
88
|
"@babel/helpers - typeof";
|
|
13
89
|
return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -477,8 +553,8 @@ function requireUrlParse() {
|
|
|
477
553
|
else if (typeof commonjsGlobal !== "undefined") globalVar = commonjsGlobal;
|
|
478
554
|
else if (typeof self !== "undefined") globalVar = self;
|
|
479
555
|
else globalVar = {};
|
|
480
|
-
var
|
|
481
|
-
loc = loc ||
|
|
556
|
+
var location2 = globalVar.location || {};
|
|
557
|
+
loc = loc || location2;
|
|
482
558
|
var finaldestination = {}, type = typeof loc, key;
|
|
483
559
|
if ("blob:" === loc.protocol) {
|
|
484
560
|
finaldestination = new Url(unescape(loc.pathname), {});
|
|
@@ -499,10 +575,10 @@ function requireUrlParse() {
|
|
|
499
575
|
function isSpecial(scheme) {
|
|
500
576
|
return scheme === "file:" || scheme === "ftp:" || scheme === "http:" || scheme === "https:" || scheme === "ws:" || scheme === "wss:";
|
|
501
577
|
}
|
|
502
|
-
function extractProtocol(address,
|
|
578
|
+
function extractProtocol(address, location2) {
|
|
503
579
|
address = trimLeft(address);
|
|
504
580
|
address = address.replace(CRHTLF, "");
|
|
505
|
-
|
|
581
|
+
location2 = location2 || {};
|
|
506
582
|
var match = protocolre.exec(address);
|
|
507
583
|
var protocol = match[1] ? match[1].toLowerCase() : "";
|
|
508
584
|
var forwardSlashes = !!match[2];
|
|
@@ -535,7 +611,7 @@ function requireUrlParse() {
|
|
|
535
611
|
if (forwardSlashes) {
|
|
536
612
|
rest = rest.slice(2);
|
|
537
613
|
}
|
|
538
|
-
} else if (slashesCount >= 2 && isSpecial(
|
|
614
|
+
} else if (slashesCount >= 2 && isSpecial(location2.protocol)) {
|
|
539
615
|
rest = match[4];
|
|
540
616
|
}
|
|
541
617
|
return {
|
|
@@ -564,23 +640,23 @@ function requireUrlParse() {
|
|
|
564
640
|
if (last === "." || last === "..") path.push("");
|
|
565
641
|
return path.join("/");
|
|
566
642
|
}
|
|
567
|
-
function Url(address,
|
|
643
|
+
function Url(address, location2, parser) {
|
|
568
644
|
address = trimLeft(address);
|
|
569
645
|
address = address.replace(CRHTLF, "");
|
|
570
646
|
if (!(this instanceof Url)) {
|
|
571
|
-
return new Url(address,
|
|
647
|
+
return new Url(address, location2, parser);
|
|
572
648
|
}
|
|
573
|
-
var relative, extracted, parse, instruction, index, key, instructions = rules.slice(), type = typeof
|
|
649
|
+
var relative, extracted, parse, instruction, index, key, instructions = rules.slice(), type = typeof location2, url = this, i = 0;
|
|
574
650
|
if ("object" !== type && "string" !== type) {
|
|
575
|
-
parser =
|
|
576
|
-
|
|
651
|
+
parser = location2;
|
|
652
|
+
location2 = null;
|
|
577
653
|
}
|
|
578
654
|
if (parser && "function" !== typeof parser) parser = qs.parse;
|
|
579
|
-
|
|
580
|
-
extracted = extractProtocol(address || "",
|
|
655
|
+
location2 = lolcation(location2);
|
|
656
|
+
extracted = extractProtocol(address || "", location2);
|
|
581
657
|
relative = !extracted.protocol && !extracted.slashes;
|
|
582
|
-
url.slashes = extracted.slashes || relative &&
|
|
583
|
-
url.protocol = extracted.protocol ||
|
|
658
|
+
url.slashes = extracted.slashes || relative && location2.slashes;
|
|
659
|
+
url.protocol = extracted.protocol || location2.protocol || "";
|
|
584
660
|
address = extracted.rest;
|
|
585
661
|
if (extracted.protocol === "file:" && (extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || !extracted.slashes && (extracted.protocol || extracted.slashesCount < 2 || !isSpecial(url.protocol))) {
|
|
586
662
|
instructions[3] = [/(.*)/, "pathname"];
|
|
@@ -610,12 +686,12 @@ function requireUrlParse() {
|
|
|
610
686
|
url[key] = index[1];
|
|
611
687
|
address = address.slice(0, index.index);
|
|
612
688
|
}
|
|
613
|
-
url[key] = url[key] || (relative && instruction[3] ?
|
|
689
|
+
url[key] = url[key] || (relative && instruction[3] ? location2[key] || "" : "");
|
|
614
690
|
if (instruction[4]) url[key] = url[key].toLowerCase();
|
|
615
691
|
}
|
|
616
692
|
if (parser) url.query = parser(url.query);
|
|
617
|
-
if (relative &&
|
|
618
|
-
url.pathname = resolve(url.pathname,
|
|
693
|
+
if (relative && location2.slashes && url.pathname.charAt(0) !== "/" && (url.pathname !== "" || location2.pathname !== "")) {
|
|
694
|
+
url.pathname = resolve(url.pathname, location2.pathname);
|
|
619
695
|
}
|
|
620
696
|
if (url.pathname.charAt(0) !== "/" && isSpecial(url.protocol)) {
|
|
621
697
|
url.pathname = "/" + url.pathname;
|
|
@@ -1394,12 +1470,12 @@ var BaseUpload = /* @__PURE__ */ (function() {
|
|
|
1394
1470
|
_this3._emitHttpError(req, res, "tus: unexpected response while creating upload");
|
|
1395
1471
|
return;
|
|
1396
1472
|
}
|
|
1397
|
-
var
|
|
1398
|
-
if (
|
|
1473
|
+
var location2 = res.getHeader("Location");
|
|
1474
|
+
if (location2 == null) {
|
|
1399
1475
|
_this3._emitHttpError(req, res, "tus: invalid or missing Location header");
|
|
1400
1476
|
return;
|
|
1401
1477
|
}
|
|
1402
|
-
_this3.url = resolveUrl(_this3.options.endpoint,
|
|
1478
|
+
_this3.url = resolveUrl(_this3.options.endpoint, location2);
|
|
1403
1479
|
log("Created upload at ".concat(_this3.url));
|
|
1404
1480
|
_this3._emitSuccess(res);
|
|
1405
1481
|
})["catch"](function(err) {
|
|
@@ -1590,12 +1666,12 @@ var BaseUpload = /* @__PURE__ */ (function() {
|
|
|
1590
1666
|
_this6._emitHttpError(req, res, "tus: unexpected response while creating upload");
|
|
1591
1667
|
return;
|
|
1592
1668
|
}
|
|
1593
|
-
var
|
|
1594
|
-
if (
|
|
1669
|
+
var location2 = res.getHeader("Location");
|
|
1670
|
+
if (location2 == null) {
|
|
1595
1671
|
_this6._emitHttpError(req, res, "tus: invalid or missing Location header");
|
|
1596
1672
|
return;
|
|
1597
1673
|
}
|
|
1598
|
-
_this6.url = resolveUrl(_this6.options.endpoint,
|
|
1674
|
+
_this6.url = resolveUrl(_this6.options.endpoint, location2);
|
|
1599
1675
|
log("Created upload at ".concat(_this6.url));
|
|
1600
1676
|
if (typeof _this6.options.onUploadUrlAvailable === "function") {
|
|
1601
1677
|
_this6.options.onUploadUrlAvailable();
|
|
@@ -3421,7 +3497,7 @@ function _temp7(meta) {
|
|
|
3421
3497
|
}).then(_temp6);
|
|
3422
3498
|
}
|
|
3423
3499
|
function _temp8(data, variables) {
|
|
3424
|
-
return
|
|
3500
|
+
return FileSaver_minExports(data, `${variables.fileName}.${variables.fileExtension}`);
|
|
3425
3501
|
}
|
|
3426
3502
|
function _temp9(request) {
|
|
3427
3503
|
return request.data;
|
|
@@ -3475,4 +3551,4 @@ export {
|
|
|
3475
3551
|
useUploadFile as h,
|
|
3476
3552
|
useGetFileMetas as u
|
|
3477
3553
|
};
|
|
3478
|
-
//# sourceMappingURL=FileHooks-
|
|
3554
|
+
//# sourceMappingURL=FileHooks-DCnXvUtq.js.map
|