wcz-test 6.14.0 → 6.21.0

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.
Files changed (51) hide show
  1. package/dist/ApprovalStatus-C9HPyMiS.js.map +1 -1
  2. package/dist/DialogsContext-DMZRefiY.js +306 -0
  3. package/dist/DialogsContext-DMZRefiY.js.map +1 -0
  4. package/dist/DialogsHooks-DBK6rBoU.js +37 -0
  5. package/dist/DialogsHooks-DBK6rBoU.js.map +1 -0
  6. package/dist/FileHooks-BM2Oyvh6.js +194 -0
  7. package/dist/FileHooks-BM2Oyvh6.js.map +1 -0
  8. package/dist/FileMeta-G1oT3mYK.js.map +1 -1
  9. package/dist/{RouterListItemButton-Cx7rXEfm.js → RouterListItemButton-Vj6OoqkV.js} +4 -4
  10. package/dist/RouterListItemButton-Vj6OoqkV.js.map +1 -0
  11. package/dist/UseHook-DB7btKDE.js +11 -0
  12. package/dist/UseHook-DB7btKDE.js.map +1 -0
  13. package/dist/client.d.ts +6 -699
  14. package/dist/client.js +6 -4
  15. package/dist/client.js.map +1 -1
  16. package/dist/components.js +69 -3405
  17. package/dist/components.js.map +1 -1
  18. package/dist/hooks.d.ts +21 -2
  19. package/dist/hooks.js +37 -1040
  20. package/dist/hooks.js.map +1 -1
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +220 -542
  23. package/dist/index.js.map +1 -1
  24. package/dist/manifest.webmanifest +18 -18
  25. package/dist/models.d.ts +10 -19
  26. package/dist/models.js +4 -4
  27. package/dist/models.js.map +1 -1
  28. package/dist/queries.d.ts +6 -6
  29. package/dist/queries.js +2 -3
  30. package/dist/queries.js.map +1 -1
  31. package/dist/server.d.ts +1 -35
  32. package/dist/server.js +1 -78
  33. package/dist/server.js.map +1 -1
  34. package/dist/{utils-JYv9O0GI.js → utils-CKW5pi6k.js} +22 -2
  35. package/dist/utils-CKW5pi6k.js.map +1 -0
  36. package/dist/utils.d.ts +11 -0
  37. package/dist/utils.js +9 -0
  38. package/dist/utils.js.map +1 -0
  39. package/dist/vite.js +3 -0
  40. package/dist/vite.js.map +1 -1
  41. package/package.json +21 -20
  42. package/dist/DialogsHooks-BlUsVlfv.js +0 -39
  43. package/dist/DialogsHooks-BlUsVlfv.js.map +0 -1
  44. package/dist/FileHooks-41k6-RtZ.js +0 -3262
  45. package/dist/FileHooks-41k6-RtZ.js.map +0 -1
  46. package/dist/RouterListItemButton-Cx7rXEfm.js.map +0 -1
  47. package/dist/auth-client-o9U0_qmf.js +0 -79
  48. package/dist/auth-client-o9U0_qmf.js.map +0 -1
  49. package/dist/env-CoxTjaDr.js +0 -27
  50. package/dist/env-CoxTjaDr.js.map +0 -1
  51. package/dist/utils-JYv9O0GI.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovalStatus-C9HPyMiS.js","sources":["../src/models/approval/ApprovalStepResult.ts","../src/models/approval/ApprovalStatus.ts"],"sourcesContent":["import z from \"zod\";\r\n\r\nexport const ApprovalStepResult = z.enum([\r\n \"NotAvailable\",\r\n \"FutureApproval\",\r\n \"WaitingForApproval\",\r\n \"Approved\",\r\n \"Rejected\",\r\n \"Skipped\",\r\n \"Withdrawn\",\r\n \"Cancelled\"\r\n]);","import z from \"zod\";\r\n\r\nexport const ApprovalStatus = z.enum([\r\n \"WaitingForApproval\",\r\n \"Approved\",\r\n \"PartiallyApproved\",\r\n \"Rejected\",\r\n \"Withdrawn\",\r\n \"Cancelled\"\r\n]);"],"names":["z"],"mappings":";AAEO,MAAM,qBAAqBA,WAAE,KAAK;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;ACTM,MAAM,iBAAiBA,WAAE,KAAK;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;"}
1
+ {"version":3,"file":"ApprovalStatus-C9HPyMiS.js","sources":["../src/models/approval/ApprovalStepResult.ts","../src/models/approval/ApprovalStatus.ts"],"sourcesContent":["import z from \"zod\";\n\nexport const ApprovalStepResult = z.enum([\n \"NotAvailable\",\n \"FutureApproval\",\n \"WaitingForApproval\",\n \"Approved\",\n \"Rejected\",\n \"Skipped\",\n \"Withdrawn\",\n \"Cancelled\"\n]);","import z from \"zod\";\n\nexport const ApprovalStatus = z.enum([\n \"WaitingForApproval\",\n \"Approved\",\n \"PartiallyApproved\",\n \"Rejected\",\n \"Withdrawn\",\n \"Cancelled\"\n]);"],"names":["z"],"mappings":";AAEO,MAAM,qBAAqBA,WAAE,KAAK;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;ACTM,MAAM,iBAAiBA,WAAE,KAAK;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;"}
@@ -0,0 +1,306 @@
1
+ import React, { createContext } from "react";
2
+ var jsxRuntime = { exports: {} };
3
+ var reactJsxRuntime_production = {};
4
+ var hasRequiredReactJsxRuntime_production;
5
+ function requireReactJsxRuntime_production() {
6
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
7
+ hasRequiredReactJsxRuntime_production = 1;
8
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
9
+ function jsxProd(type, config, maybeKey) {
10
+ var key = null;
11
+ void 0 !== maybeKey && (key = "" + maybeKey);
12
+ void 0 !== config.key && (key = "" + config.key);
13
+ if ("key" in config) {
14
+ maybeKey = {};
15
+ for (var propName in config)
16
+ "key" !== propName && (maybeKey[propName] = config[propName]);
17
+ } else maybeKey = config;
18
+ config = maybeKey.ref;
19
+ return {
20
+ $$typeof: REACT_ELEMENT_TYPE,
21
+ type,
22
+ key,
23
+ ref: void 0 !== config ? config : null,
24
+ props: maybeKey
25
+ };
26
+ }
27
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
28
+ reactJsxRuntime_production.jsx = jsxProd;
29
+ reactJsxRuntime_production.jsxs = jsxProd;
30
+ return reactJsxRuntime_production;
31
+ }
32
+ var reactJsxRuntime_development = {};
33
+ var hasRequiredReactJsxRuntime_development;
34
+ function requireReactJsxRuntime_development() {
35
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
36
+ hasRequiredReactJsxRuntime_development = 1;
37
+ "production" !== process.env.NODE_ENV && (function() {
38
+ function getComponentNameFromType(type) {
39
+ if (null == type) return null;
40
+ if ("function" === typeof type)
41
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
42
+ if ("string" === typeof type) return type;
43
+ switch (type) {
44
+ case REACT_FRAGMENT_TYPE:
45
+ return "Fragment";
46
+ case REACT_PROFILER_TYPE:
47
+ return "Profiler";
48
+ case REACT_STRICT_MODE_TYPE:
49
+ return "StrictMode";
50
+ case REACT_SUSPENSE_TYPE:
51
+ return "Suspense";
52
+ case REACT_SUSPENSE_LIST_TYPE:
53
+ return "SuspenseList";
54
+ case REACT_ACTIVITY_TYPE:
55
+ return "Activity";
56
+ }
57
+ if ("object" === typeof type)
58
+ switch ("number" === typeof type.tag && console.error(
59
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
60
+ ), type.$$typeof) {
61
+ case REACT_PORTAL_TYPE:
62
+ return "Portal";
63
+ case REACT_CONTEXT_TYPE:
64
+ return type.displayName || "Context";
65
+ case REACT_CONSUMER_TYPE:
66
+ return (type._context.displayName || "Context") + ".Consumer";
67
+ case REACT_FORWARD_REF_TYPE:
68
+ var innerType = type.render;
69
+ type = type.displayName;
70
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
71
+ return type;
72
+ case REACT_MEMO_TYPE:
73
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
74
+ case REACT_LAZY_TYPE:
75
+ innerType = type._payload;
76
+ type = type._init;
77
+ try {
78
+ return getComponentNameFromType(type(innerType));
79
+ } catch (x) {
80
+ }
81
+ }
82
+ return null;
83
+ }
84
+ function testStringCoercion(value) {
85
+ return "" + value;
86
+ }
87
+ function checkKeyStringCoercion(value) {
88
+ try {
89
+ testStringCoercion(value);
90
+ var JSCompiler_inline_result = false;
91
+ } catch (e) {
92
+ JSCompiler_inline_result = true;
93
+ }
94
+ if (JSCompiler_inline_result) {
95
+ JSCompiler_inline_result = console;
96
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
97
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
98
+ JSCompiler_temp_const.call(
99
+ JSCompiler_inline_result,
100
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
101
+ JSCompiler_inline_result$jscomp$0
102
+ );
103
+ return testStringCoercion(value);
104
+ }
105
+ }
106
+ function getTaskName(type) {
107
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
108
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
109
+ return "<...>";
110
+ try {
111
+ var name = getComponentNameFromType(type);
112
+ return name ? "<" + name + ">" : "<...>";
113
+ } catch (x) {
114
+ return "<...>";
115
+ }
116
+ }
117
+ function getOwner() {
118
+ var dispatcher = ReactSharedInternals.A;
119
+ return null === dispatcher ? null : dispatcher.getOwner();
120
+ }
121
+ function UnknownOwner() {
122
+ return Error("react-stack-top-frame");
123
+ }
124
+ function hasValidKey(config) {
125
+ if (hasOwnProperty.call(config, "key")) {
126
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
127
+ if (getter && getter.isReactWarning) return false;
128
+ }
129
+ return void 0 !== config.key;
130
+ }
131
+ function defineKeyPropWarningGetter(props, displayName) {
132
+ function warnAboutAccessingKey() {
133
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
134
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
135
+ displayName
136
+ ));
137
+ }
138
+ warnAboutAccessingKey.isReactWarning = true;
139
+ Object.defineProperty(props, "key", {
140
+ get: warnAboutAccessingKey,
141
+ configurable: true
142
+ });
143
+ }
144
+ function elementRefGetterWithDeprecationWarning() {
145
+ var componentName = getComponentNameFromType(this.type);
146
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
147
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
148
+ ));
149
+ componentName = this.props.ref;
150
+ return void 0 !== componentName ? componentName : null;
151
+ }
152
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
153
+ var refProp = props.ref;
154
+ type = {
155
+ $$typeof: REACT_ELEMENT_TYPE,
156
+ type,
157
+ key,
158
+ props,
159
+ _owner: owner
160
+ };
161
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
162
+ enumerable: false,
163
+ get: elementRefGetterWithDeprecationWarning
164
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
165
+ type._store = {};
166
+ Object.defineProperty(type._store, "validated", {
167
+ configurable: false,
168
+ enumerable: false,
169
+ writable: true,
170
+ value: 0
171
+ });
172
+ Object.defineProperty(type, "_debugInfo", {
173
+ configurable: false,
174
+ enumerable: false,
175
+ writable: true,
176
+ value: null
177
+ });
178
+ Object.defineProperty(type, "_debugStack", {
179
+ configurable: false,
180
+ enumerable: false,
181
+ writable: true,
182
+ value: debugStack
183
+ });
184
+ Object.defineProperty(type, "_debugTask", {
185
+ configurable: false,
186
+ enumerable: false,
187
+ writable: true,
188
+ value: debugTask
189
+ });
190
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
191
+ return type;
192
+ }
193
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
194
+ var children = config.children;
195
+ if (void 0 !== children)
196
+ if (isStaticChildren)
197
+ if (isArrayImpl(children)) {
198
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
199
+ validateChildKeys(children[isStaticChildren]);
200
+ Object.freeze && Object.freeze(children);
201
+ } else
202
+ console.error(
203
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
204
+ );
205
+ else validateChildKeys(children);
206
+ if (hasOwnProperty.call(config, "key")) {
207
+ children = getComponentNameFromType(type);
208
+ var keys = Object.keys(config).filter(function(k) {
209
+ return "key" !== k;
210
+ });
211
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
212
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
213
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
214
+ isStaticChildren,
215
+ children,
216
+ keys,
217
+ children
218
+ ), didWarnAboutKeySpread[children + isStaticChildren] = true);
219
+ }
220
+ children = null;
221
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
222
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
223
+ if ("key" in config) {
224
+ maybeKey = {};
225
+ for (var propName in config)
226
+ "key" !== propName && (maybeKey[propName] = config[propName]);
227
+ } else maybeKey = config;
228
+ children && defineKeyPropWarningGetter(
229
+ maybeKey,
230
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
231
+ );
232
+ return ReactElement(
233
+ type,
234
+ children,
235
+ maybeKey,
236
+ getOwner(),
237
+ debugStack,
238
+ debugTask
239
+ );
240
+ }
241
+ function validateChildKeys(node) {
242
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
243
+ }
244
+ function isValidElement(object) {
245
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
246
+ }
247
+ var React$1 = React, REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
248
+ return null;
249
+ };
250
+ React$1 = {
251
+ react_stack_bottom_frame: function(callStackForError) {
252
+ return callStackForError();
253
+ }
254
+ };
255
+ var specialPropKeyWarningShown;
256
+ var didWarnAboutElementRef = {};
257
+ var unknownOwnerDebugStack = React$1.react_stack_bottom_frame.bind(
258
+ React$1,
259
+ UnknownOwner
260
+ )();
261
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
262
+ var didWarnAboutKeySpread = {};
263
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
264
+ reactJsxRuntime_development.jsx = function(type, config, maybeKey) {
265
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
266
+ return jsxDEVImpl(
267
+ type,
268
+ config,
269
+ maybeKey,
270
+ false,
271
+ trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
272
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
273
+ );
274
+ };
275
+ reactJsxRuntime_development.jsxs = function(type, config, maybeKey) {
276
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
277
+ return jsxDEVImpl(
278
+ type,
279
+ config,
280
+ maybeKey,
281
+ true,
282
+ trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
283
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
284
+ );
285
+ };
286
+ })();
287
+ return reactJsxRuntime_development;
288
+ }
289
+ var hasRequiredJsxRuntime;
290
+ function requireJsxRuntime() {
291
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
292
+ hasRequiredJsxRuntime = 1;
293
+ if (process.env.NODE_ENV === "production") {
294
+ jsxRuntime.exports = requireReactJsxRuntime_production();
295
+ } else {
296
+ jsxRuntime.exports = requireReactJsxRuntime_development();
297
+ }
298
+ return jsxRuntime.exports;
299
+ }
300
+ var jsxRuntimeExports = requireJsxRuntime();
301
+ const DialogsContext = createContext({});
302
+ export {
303
+ DialogsContext as D,
304
+ jsxRuntimeExports as j
305
+ };
306
+ //# sourceMappingURL=DialogsContext-DMZRefiY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogsContext-DMZRefiY.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/contexts/DialogsContext.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext } from \"react\";\nimport type { CloseDialog, OpenDialog } from \"../hooks/DialogsHooks\";\n\nexport interface DialogsContextValue {\n open: OpenDialog;\n close: CloseDialog;\n}\n\nexport const DialogsContext = createContext<DialogsContextValue>({} as DialogsContextValue);"],"names":["React","require$$0","jsxRuntimeModule","require$$1"],"mappings":";;;;;;;AAWA,MAAI,qBAAqB,OAAO,IAAI,4BAA4B,GAC9D,sBAAsB,OAAO,IAAI,gBAAgB;AACnD,WAAS,QAAQ,MAAM,QAAQ,UAAU;AACvC,QAAI,MAAM;AACV,eAAW,aAAa,MAAM,KAAK;AACnC,eAAW,OAAO,QAAQ,MAAM,KAAK,OAAO;AAC5C,QAAI,SAAS,QAAQ;AACnB,iBAAW,CAAA;AACX,eAAS,YAAY;AACnB,kBAAU,aAAa,SAAS,QAAQ,IAAI,OAAO,QAAQ;AAAA,IACjE,MAAS,YAAW;AAClB,aAAS,SAAS;AAClB,WAAO;AAAA,MACL,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,KAAK,WAAW,SAAS,SAAS;AAAA,MAClC,OAAO;AAAA;EAEX;AACA,6BAAA,WAAmB;AACnB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AAM,qBAAqB;AAC7B,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,mBACI,MAAM,uBAAuB,IAC7B;AAAA,QACJ,mBAAmB,WAAW,YAAY,IAAI,CAAC,IAAI;AAAA;IAE3D;AACI,gCAAA,OAAe,SAAU,MAAM,QAAQ,UAAU;AAC/C,UAAI,mBACF,MAAM,qBAAqB;AAC7B,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,mBACI,MAAM,uBAAuB,IAC7B;AAAA,QACJ,mBAAmB,WAAW,YAAY,IAAI,CAAC,IAAI;AAAA;IAE3D;AAAA,EACA,GAAG;;;;;;;AC7VH,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzCE,eAAA,UAAiBD,kCAAA;AAAA,EACnB,OAAO;AACLC,eAAA,UAAiBC,mCAAA;AAAA,EACnB;;;;ACEO,MAAM,iBAAiB,cAAmC,CAAA,CAAyB;","x_google_ignoreList":[0,1,2]}
@@ -0,0 +1,37 @@
1
+ import { D as DialogsContext, j as jsxRuntimeExports } from "./DialogsContext-DMZRefiY.js";
2
+ import { useEventCallback, Dialog, DialogTitle, DialogContent, DialogActions, Button } from "@mui/material";
3
+ import { useContext } from "react";
4
+ import { useTranslation } from "react-i18next";
5
+ function AlertDialog({ open, payload, onClose }) {
6
+ const { t } = useTranslation();
7
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), disableRestoreFocus: true, children: [
8
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Alert") }),
9
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContent, { children: payload.message }),
10
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogActions, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(), autoFocus: true, children: t("Layout.Dialog.Confirm") }) })
11
+ ] });
12
+ }
13
+ function ConfirmDialog({ open, payload, onClose }) {
14
+ const { t } = useTranslation();
15
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), disableRestoreFocus: true, children: [
16
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Confirm") }),
17
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContent, { children: payload.message }),
18
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogActions, { children: [
19
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(false), children: payload.cancelText ?? t("Layout.Dialog.Cancel") }),
20
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(true), autoFocus: true, children: t("Layout.Dialog.Confirm") })
21
+ ] })
22
+ ] });
23
+ }
24
+ function useDialogs() {
25
+ const { open, close } = useContext(DialogsContext);
26
+ const alert = useEventCallback(
27
+ (message, { ...options } = {}) => open(AlertDialog, { ...options, message })
28
+ );
29
+ const confirm = useEventCallback(
30
+ (message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
31
+ );
32
+ return { alert, confirm, open, close };
33
+ }
34
+ export {
35
+ useDialogs as u
36
+ };
37
+ //# sourceMappingURL=DialogsHooks-DBK6rBoU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogsHooks-DBK6rBoU.js","sources":["../src/hooks/DialogsHooks.tsx"],"sourcesContent":["import { Button, Dialog, DialogActions, DialogContent, DialogTitle, useEventCallback } from \"@mui/material\";\nimport { useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { DialogsContext } from \"../contexts/DialogsContext\";\nimport type { ReactNode } from \"react\";\n\nexport interface OpenDialogOptions<TResult> {\n onClose?: (result: TResult) => Promise<void>;\n}\n\nexport interface AlertOptions {\n title?: ReactNode;\n}\n\nexport interface ConfirmOptions {\n title?: ReactNode;\n cancelText?: ReactNode;\n}\n\nexport interface DialogProps<TPayload = undefined, TResult = void> {\n payload: TPayload;\n open: boolean;\n onClose: (result: TResult) => Promise<void>;\n}\n\nexport type OpenAlertDialog = (message: ReactNode, options?: AlertOptions) => Promise<void>;\n\nexport type OpenConfirmDialog = (message: ReactNode, options?: ConfirmOptions) => Promise<boolean>;\n\nexport type DialogComponent<TPayload, TResult> = React.ComponentType<DialogProps<TPayload, TResult>>;\n\nexport interface OpenDialog {\n <TPayload extends undefined, TResult>(Component: DialogComponent<TPayload, TResult>, payload?: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;\n <TPayload, TResult>(Component: DialogComponent<TPayload, TResult>, payload: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;\n}\n\nexport type CloseDialog = <TResult>(dialog: Promise<TResult>, result: TResult) => Promise<TResult>;\n\nexport interface AlertDialogPayload extends AlertOptions {\n message: ReactNode;\n}\n\nexport type AlertDialogProps = DialogProps<AlertDialogPayload, void>\n\nexport function AlertDialog({ open, payload, onClose }: Readonly<AlertDialogProps>) {\n const { t } = useTranslation();\n\n return (\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose()} disableRestoreFocus>\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Alert\")}</DialogTitle>\n <DialogContent>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose()} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\nexport interface ConfirmDialogPayload extends ConfirmOptions {\n message: ReactNode;\n}\n\nexport type ConfirmDialogProps = DialogProps<ConfirmDialogPayload, boolean>\n\nexport function ConfirmDialog({ open, payload, onClose }: Readonly<ConfirmDialogProps>) {\n const { t } = useTranslation();\n\n return (\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose(false)} disableRestoreFocus>\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Confirm\")}</DialogTitle>\n <DialogContent>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose(false)}>\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button onClick={() => onClose(true)} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\ninterface DialogHook {\n alert: OpenAlertDialog;\n confirm: OpenConfirmDialog;\n open: OpenDialog;\n close: CloseDialog;\n}\n\nexport function useDialogs(): DialogHook {\n const { open, close } = useContext(DialogsContext);\n\n const alert = useEventCallback<OpenAlertDialog>((message, { ...options } = {}) =>\n open(AlertDialog, { ...options, message }),\n );\n\n const confirm = useEventCallback<OpenConfirmDialog>((message, { ...options } = {}) =>\n open(ConfirmDialog, { ...options, message }),\n );\n\n return { alert, confirm, open, close };\n}\n"],"names":["jsxs","jsx"],"mappings":";;;;AA4CO,SAAS,YAAY,EAAE,MAAM,SAAS,WAAuC;AAChF,QAAM,EAAE,EAAA,IAAM,eAAA;AAEd,SACIA,kCAAAA,KAAC,QAAA,EAAO,UAAS,MAAK,WAAS,MAAC,MAAY,SAAS,MAAM,QAAA,GAAW,qBAAmB,MACrF,UAAA;AAAA,IAAAC,sCAAC,aAAA,EAAa,UAAA,QAAQ,SAAS,EAAE,qBAAqB,GAAE;AAAA,IACxDA,kCAAAA,IAAC,eAAA,EAAe,UAAA,QAAQ,QAAA,CAAQ;AAAA,IAChCA,kCAAAA,IAAC,eAAA,EACG,UAAAA,kCAAAA,IAAC,QAAA,EAAO,SAAS,MAAM,QAAA,GAAW,WAAS,MACtC,UAAA,EAAE,uBAAuB,GAC9B,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;AAQO,SAAS,cAAc,EAAE,MAAM,SAAS,WAAyC;AACpF,QAAM,EAAE,EAAA,IAAM,eAAA;AAEd,SACID,kCAAAA,KAAC,QAAA,EAAO,UAAS,MAAK,WAAS,MAAC,MAAY,SAAS,MAAM,QAAQ,KAAK,GAAG,qBAAmB,MAC1F,UAAA;AAAA,IAAAC,sCAAC,aAAA,EAAa,UAAA,QAAQ,SAAS,EAAE,uBAAuB,GAAE;AAAA,IAC1DA,kCAAAA,IAAC,eAAA,EAAe,UAAA,QAAQ,QAAA,CAAQ;AAAA,2CAC/B,eAAA,EACG,UAAA;AAAA,MAAAA,kCAAAA,IAAC,QAAA,EAAO,SAAS,MAAM,QAAQ,KAAK,GAC/B,UAAA,QAAQ,cAAc,EAAE,sBAAsB,EAAA,CACnD;AAAA,MACAA,kCAAAA,IAAC,QAAA,EAAO,SAAS,MAAM,QAAQ,IAAI,GAAG,WAAS,MAC1C,UAAA,EAAE,uBAAuB,EAAA,CAC9B;AAAA,IAAA,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;AASO,SAAS,aAAyB;AACrC,QAAM,EAAE,MAAM,UAAU,WAAW,cAAc;AAEjD,QAAM,QAAQ;AAAA,IAAkC,CAAC,SAAS,EAAE,GAAG,YAAY,CAAA,MACvE,KAAK,aAAa,EAAE,GAAG,SAAS,SAAS;AAAA,EAAA;AAG7C,QAAM,UAAU;AAAA,IAAoC,CAAC,SAAS,EAAE,GAAG,YAAY,CAAA,MAC3E,KAAK,eAAe,EAAE,GAAG,SAAS,SAAS;AAAA,EAAA;AAG/C,SAAO,EAAE,OAAO,SAAS,MAAM,MAAA;AACnC;"}
@@ -0,0 +1,194 @@
1
+ import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
2
+ import saveAs from "file-saver";
3
+ import { useState } from "react";
4
+ import { Upload } from "tus-js-client";
5
+ import { uuidv7 } from "uuidv7";
6
+ import z__default from "zod";
7
+ import { F as FileMetaSchema } from "./FileMeta-G1oT3mYK.js";
8
+ import { t as toKebabCase, h as httpClient, c as clientEnv } from "./utils-CKW5pi6k.js";
9
+ const QUERY_KEY = "file";
10
+ const HOUR = 1e3 * 60 * 60;
11
+ const APP_NAME = toKebabCase(clientEnv.VITE_APP_TITLE);
12
+ z__default.object({
13
+ appName: z__default.string().min(1).max(255).default(APP_NAME).optional(),
14
+ subId: z__default.uuid()
15
+ });
16
+ const useGetFileMetas = (params, options) => {
17
+ const queryParams = new URLSearchParams();
18
+ queryParams.append("appName", params.appName ?? APP_NAME);
19
+ queryParams.append("subId", params.subId);
20
+ return useQuery({
21
+ ...options,
22
+ queryKey: [QUERY_KEY, "meta", params.appName ?? APP_NAME, params.subId],
23
+ queryFn: ({ signal }) => httpClient.request({
24
+ url: `/${QUERY_KEY}/v1/meta?${queryParams.toString()}`,
25
+ method: "GET",
26
+ signal
27
+ }),
28
+ staleTime: HOUR,
29
+ gcTime: HOUR,
30
+ refetchOnWindowFocus: false
31
+ });
32
+ };
33
+ z__default.object({
34
+ appName: z__default.string().min(1).max(255).default(APP_NAME).optional(),
35
+ meta: FileMetaSchema.nullish()
36
+ });
37
+ const useGetFileThumbnail = (params, options) => {
38
+ const queryParams = new URLSearchParams();
39
+ queryParams.append("appName", params.appName ?? APP_NAME);
40
+ queryParams.append("id", params.meta?.id ?? "");
41
+ return useQuery({
42
+ ...options,
43
+ queryKey: [QUERY_KEY, "thumbnail", params.appName ?? APP_NAME, params.meta?.id],
44
+ queryFn: ({ signal }) => httpClient.request({
45
+ url: `/${QUERY_KEY}/v1/thumbnail?${queryParams.toString()}`,
46
+ method: "GET",
47
+ signal,
48
+ responseType: "blob"
49
+ }),
50
+ select: (data) => URL.createObjectURL(data),
51
+ staleTime: HOUR,
52
+ gcTime: HOUR,
53
+ refetchOnWindowFocus: false,
54
+ enabled: !!params.meta && options?.enabled !== false
55
+ });
56
+ };
57
+ z__default.object({
58
+ appName: z__default.string().min(1).max(255).default(APP_NAME).optional(),
59
+ meta: FileMetaSchema.nullish()
60
+ });
61
+ const useGetFile = (params, options) => {
62
+ const queryParams = new URLSearchParams();
63
+ queryParams.append("appName", params.appName ?? APP_NAME);
64
+ queryParams.append("id", params.meta?.id ?? "");
65
+ return useQuery({
66
+ ...options,
67
+ queryKey: [QUERY_KEY, params.appName ?? APP_NAME, params.meta?.id],
68
+ queryFn: ({ signal }) => httpClient.request({
69
+ url: `/${QUERY_KEY}/v1?${queryParams.toString()}`,
70
+ method: "GET",
71
+ signal,
72
+ responseType: "blob"
73
+ }),
74
+ select: (data) => URL.createObjectURL(data),
75
+ staleTime: HOUR,
76
+ gcTime: HOUR,
77
+ refetchOnWindowFocus: false,
78
+ enabled: !!params.meta && options?.enabled !== false
79
+ });
80
+ };
81
+ const useDownloadFile = (options) => {
82
+ return useMutation({
83
+ ...options,
84
+ mutationFn: (meta) => httpClient.request({
85
+ url: `/${QUERY_KEY}/v1/download?appName=${APP_NAME}&id=${meta.id}`,
86
+ method: "GET",
87
+ responseType: "blob"
88
+ }),
89
+ onSuccess: (data, variables) => saveAs(data, `${variables.fileName}.${variables.fileExtension}`)
90
+ });
91
+ };
92
+ const useOpenFile = (options) => {
93
+ return useMutation({
94
+ ...options,
95
+ mutationFn: (meta) => httpClient.request({
96
+ url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,
97
+ method: "GET",
98
+ responseType: "blob"
99
+ }),
100
+ onSuccess: (data) => {
101
+ window.open(URL.createObjectURL(data));
102
+ }
103
+ });
104
+ };
105
+ const useUpdateFileMeta = (options) => {
106
+ const queryClient = useQueryClient();
107
+ return useMutation({
108
+ ...options,
109
+ mutationFn: (meta) => httpClient.request({
110
+ url: `/${QUERY_KEY}/v1/meta?appName=${APP_NAME}&id=${meta.id}`,
111
+ method: "PUT",
112
+ data: meta
113
+ }),
114
+ onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
115
+ });
116
+ };
117
+ const useDeleteFile = (options) => {
118
+ const queryClient = useQueryClient();
119
+ return useMutation({
120
+ ...options,
121
+ mutationFn: (meta) => httpClient.request({
122
+ url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,
123
+ method: "DELETE"
124
+ }),
125
+ onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
126
+ });
127
+ };
128
+ const useDeleteFiles = (options) => {
129
+ const queryClient = useQueryClient();
130
+ return useMutation({
131
+ ...options,
132
+ mutationFn: (subId) => httpClient.request({
133
+ url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&subId=${subId}`,
134
+ method: "DELETE"
135
+ }),
136
+ onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
137
+ });
138
+ };
139
+ const useUploadFile = ({ subId, onSuccess, onError }) => {
140
+ const [progress, setProgress] = useState(0);
141
+ const queryClient = useQueryClient();
142
+ const mutate = async (file) => {
143
+ if (!subId) throw new Error("subId is required for file upload");
144
+ const metadata = {
145
+ id: uuidv7(),
146
+ appName: APP_NAME,
147
+ subId,
148
+ fileName: file.name
149
+ };
150
+ const upload = new Upload(file, {
151
+ endpoint: `${clientEnv.VITE_API_URL}/${QUERY_KEY}/v1/upload`,
152
+ chunkSize: 1048576,
153
+ // 1 MB
154
+ metadata: {
155
+ id: metadata.id,
156
+ appName: metadata.appName,
157
+ subId: metadata.subId,
158
+ fileName: metadata.fileName,
159
+ fileExtension: file.type
160
+ },
161
+ // headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
162
+ onError: (error) => {
163
+ setProgress(0);
164
+ onError?.(error);
165
+ },
166
+ onProgress: (bytesUploaded, bytesTotal) => {
167
+ setProgress(bytesUploaded / bytesTotal * 100);
168
+ },
169
+ onSuccess: () => {
170
+ setProgress(0);
171
+ queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta", subId], exact: false });
172
+ onSuccess?.(metadata);
173
+ }
174
+ });
175
+ const previousUploads = await upload.findPreviousUploads();
176
+ if (previousUploads.length > 0) {
177
+ upload.resumeFromPreviousUpload(previousUploads[0]);
178
+ }
179
+ upload.start();
180
+ };
181
+ return { mutate, progress };
182
+ };
183
+ export {
184
+ useGetFileThumbnail as a,
185
+ useGetFile as b,
186
+ useDownloadFile as c,
187
+ useOpenFile as d,
188
+ useUpdateFileMeta as e,
189
+ useDeleteFile as f,
190
+ useDeleteFiles as g,
191
+ useUploadFile as h,
192
+ useGetFileMetas as u
193
+ };
194
+ //# sourceMappingURL=FileHooks-BM2Oyvh6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileHooks-BM2Oyvh6.js","sources":["../src/queries/FileHooks.ts"],"sourcesContent":["import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\r\nimport saveAs from \"file-saver\";\r\nimport { useState } from \"react\";\r\nimport { Upload as TusUpload } from \"tus-js-client\";\r\nimport { uuidv7 } from \"uuidv7\";\r\nimport z from \"zod\";\r\nimport type { DetailedError } from \"tus-js-client\";\r\nimport type { DefinedInitialDataOptions, UseMutationOptions } from \"@tanstack/react-query\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { FileMetaSchema } from \"~/models/file/FileMeta\";\r\nimport { httpClient, toKebabCase } from \"~/lib/utils\";\r\nimport { clientEnv } from \"~/env\";\r\n\r\nconst QUERY_KEY = \"file\";\r\nconst HOUR = 1000 * 60 * 60;\r\nconst APP_NAME = toKebabCase(clientEnv.VITE_APP_TITLE);\r\n\r\ntype OptionalId = string | undefined | null;\r\n\r\ntype BaseFileMetaArrayQueryOptions = Omit<DefinedInitialDataOptions<Array<FileMeta>>, \"queryKey\" | \"queryFn\" | \"staleTime\" | \"gcTime\" | \"refetchOnWindowFocus\" | \"initialData\">;\r\ntype BaseBlobQueryOptions = Omit<DefinedInitialDataOptions<Blob, Error, string>, \"queryKey\" | \"queryFn\" | \"select\" | \"staleTime\" | \"gcTime\" | \"refetchOnWindowFocus\" | \"initialData\">;\r\ntype BaseFileMetaMutationOptions = Omit<UseMutationOptions<FileMeta, Error, FileMeta>, \"mutationFn\" | \"onSettled\">;\r\ntype BaseBlobMutationOptions = Omit<UseMutationOptions<Blob, Error, FileMeta>, \"mutationFn\" | \"onSuccess\">;\r\ntype BaseStringMutationOptions = Omit<UseMutationOptions<string, Error, string>, \"mutationFn\" | \"onSettled\">;\r\n\r\nexport const GetFileMetasParamsSchema = z.object({\r\n appName: z.string().min(1).max(255).default(APP_NAME).optional(),\r\n subId: z.uuid(),\r\n});\r\n\r\nexport type GetFileMetasParams = z.infer<typeof GetFileMetasParamsSchema>;\r\n\r\nexport const useGetFileMetas = (params: GetFileMetasParams, options?: BaseFileMetaArrayQueryOptions) => {\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", params.appName ?? APP_NAME);\r\n queryParams.append(\"subId\", params.subId);\r\n\r\n return useQuery<Array<FileMeta>>({\r\n ...options,\r\n queryKey: [QUERY_KEY, \"meta\", params.appName ?? APP_NAME, params.subId],\r\n queryFn: ({ signal }) => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/meta?${queryParams.toString()}`,\r\n method: \"GET\",\r\n signal,\r\n }),\r\n staleTime: HOUR,\r\n gcTime: HOUR,\r\n refetchOnWindowFocus: false,\r\n });\r\n};\r\n\r\nexport const GetFileThumbnailParamsSchema = z.object({\r\n appName: z.string().min(1).max(255).default(APP_NAME).optional(),\r\n meta: FileMetaSchema.nullish(),\r\n});\r\n\r\nexport type GetFileThumbnailParams = z.infer<typeof GetFileThumbnailParamsSchema>;\r\n\r\nexport const useGetFileThumbnail = (params: GetFileThumbnailParams, options?: BaseBlobQueryOptions) => {\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", params.appName ?? APP_NAME);\r\n queryParams.append(\"id\", params.meta?.id ?? \"\");\r\n\r\n return useQuery<Blob, Error, string>({\r\n ...options,\r\n queryKey: [QUERY_KEY, \"thumbnail\", params.appName ?? APP_NAME, params.meta?.id],\r\n queryFn: ({ signal }) => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/thumbnail?${queryParams.toString()}`,\r\n method: \"GET\",\r\n signal,\r\n responseType: \"blob\"\r\n }),\r\n select: data => URL.createObjectURL(data),\r\n staleTime: HOUR,\r\n gcTime: HOUR,\r\n refetchOnWindowFocus: false,\r\n enabled: !!params.meta && options?.enabled !== false,\r\n });\r\n};\r\n\r\nexport const GetFileParamsSchema = z.object({\r\n appName: z.string().min(1).max(255).default(APP_NAME).optional(),\r\n meta: FileMetaSchema.nullish(),\r\n});\r\n\r\nexport type GetFileParams = z.infer<typeof GetFileParamsSchema>;\r\n\r\nexport const useGetFile = (params: GetFileParams, options?: BaseBlobQueryOptions) => {\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", params.appName ?? APP_NAME);\r\n queryParams.append(\"id\", params.meta?.id ?? \"\");\r\n\r\n return useQuery<Blob, Error, string>({\r\n ...options,\r\n queryKey: [QUERY_KEY, params.appName ?? APP_NAME, params.meta?.id],\r\n queryFn: ({ signal }) => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?${queryParams.toString()}`,\r\n method: \"GET\",\r\n signal,\r\n responseType: \"blob\"\r\n }),\r\n select: data => URL.createObjectURL(data),\r\n staleTime: HOUR,\r\n gcTime: HOUR,\r\n refetchOnWindowFocus: false,\r\n enabled: !!params.meta && options?.enabled !== false,\r\n });\r\n};\r\n\r\nexport const useDownloadFile = (options?: BaseBlobMutationOptions) => {\r\n return useMutation<Blob, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/download?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"GET\",\r\n responseType: \"blob\"\r\n }),\r\n onSuccess: (data, variables) => saveAs(data, `${variables.fileName}.${variables.fileExtension}`)\r\n });\r\n};\r\n\r\nexport const useOpenFile = (options?: BaseBlobMutationOptions) => {\r\n return useMutation<Blob, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"GET\",\r\n responseType: \"blob\"\r\n }),\r\n onSuccess: data => { window.open(URL.createObjectURL(data)); }\r\n });\r\n};\r\n\r\nexport const useUpdateFileMeta = (options?: BaseFileMetaMutationOptions) => {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation<FileMeta, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/meta?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"PUT\",\r\n data: meta\r\n }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false })\r\n });\r\n};\r\n\r\nexport const useDeleteFile = (options?: BaseFileMetaMutationOptions) => {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation<FileMeta, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"DELETE\"\r\n }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false }),\r\n });\r\n};\r\n\r\nexport const useDeleteFiles = (options?: BaseStringMutationOptions) => {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation<string, Error, string>({\r\n ...options,\r\n mutationFn: subId => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&subId=${subId}`,\r\n method: \"DELETE\"\r\n }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false })\r\n });\r\n};\r\n\r\ninterface UseUploadFileProps {\r\n subId: OptionalId;\r\n onSuccess?: (meta: Pick<FileMeta, \"id\" | \"appName\" | \"subId\" | \"fileName\">) => void;\r\n onError?: (error: Error | DetailedError) => void;\r\n}\r\n\r\nexport const useUploadFile = ({ subId, onSuccess, onError }: UseUploadFileProps) => {\r\n const [progress, setProgress] = useState<number>(0);\r\n const queryClient = useQueryClient();\r\n\r\n const mutate = async (file: File) => {\r\n if (!subId) throw new Error(\"subId is required for file upload\");\r\n\r\n const metadata: Pick<FileMeta, \"id\" | \"appName\" | \"subId\" | \"fileName\"> = {\r\n id: uuidv7(),\r\n appName: APP_NAME,\r\n subId: subId,\r\n fileName: file.name,\r\n };\r\n\r\n const upload = new TusUpload(file, {\r\n endpoint: `${clientEnv.VITE_API_URL}/${QUERY_KEY}/v1/upload`,\r\n chunkSize: 1_048_576, // 1 MB\r\n metadata: {\r\n id: metadata.id,\r\n appName: metadata.appName,\r\n subId: metadata.subId,\r\n fileName: metadata.fileName,\r\n fileExtension: file.type\r\n },\r\n // headers: { \"Authorization\": `Bearer ${await getToken()}` }, //TODO: implement token retrieval\r\n onError: (error) => {\r\n setProgress(0);\r\n onError?.(error);\r\n },\r\n onProgress: (bytesUploaded, bytesTotal) => {\r\n setProgress((bytesUploaded / bytesTotal) * 100);\r\n },\r\n onSuccess: () => {\r\n setProgress(0);\r\n queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\", subId], exact: false });\r\n onSuccess?.(metadata);\r\n },\r\n });\r\n\r\n const previousUploads = await upload.findPreviousUploads();\r\n if (previousUploads.length > 0) {\r\n upload.resumeFromPreviousUpload(previousUploads[0]);\r\n }\r\n\r\n upload.start();\r\n };\r\n\r\n return { mutate, progress };\r\n};\r\n"],"names":["z","TusUpload"],"mappings":";;;;;;;;AAaA,MAAM,YAAY;AAClB,MAAM,OAAO,MAAO,KAAK;AACzB,MAAM,WAAW,YAAY,UAAU,cAAc;AAUbA,WAAE,OAAO;AAAA,EAC7C,SAASA,WAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,QAAQ,QAAQ,EAAE,SAAA;AAAA,EACtD,OAAOA,WAAE,KAAA;AACb,CAAC;AAIM,MAAM,kBAAkB,CAAC,QAA4B,YAA4C;AACpG,QAAM,cAAc,IAAI,gBAAA;AACxB,cAAY,OAAO,WAAW,OAAO,WAAW,QAAQ;AACxD,cAAY,OAAO,SAAS,OAAO,KAAK;AAExC,SAAO,SAA0B;AAAA,IAC7B,GAAG;AAAA,IACH,UAAU,CAAC,WAAW,QAAQ,OAAO,WAAW,UAAU,OAAO,KAAK;AAAA,IACtE,SAAS,CAAC,EAAE,aAAa,WAAW,QAAQ;AAAA,MACxC,KAAK,IAAI,SAAS,YAAY,YAAY,UA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A,MACJ,SAAS;AAAA,MACT;AAAA,MACA,UAAU,KAAK;AAAA,IAAA;AAGnB,UAAM,SAAS,IAAIC,OAAU,MAAM;AAAA,MAC/B,UAAU,GAAG,UAAU,YAAY,IAAI,SAAS;AAAA,MAChD,WAAW;AAAA;AAAA,MACX,UAAU;AAAA,QACN,IAAI,SAAS;AAAA,QACb,SAAS,SAAS;AAAA,QAClB,OAAO,SAAS;AAAA,QAChB,UAAU,SAAS;AAAA,QACnB,eAAe,KAAK;AAAA,MAAA;AAAA;AAAA,MAGxB,SAAS,CAAC,UAAU;AAChB,oBAAY,CAAC;AACb,kBAAU,KAAK;AAAA,MACnB;AAAA,MACA,YAAY,CAAC,eAAe,eAAe;AACvC,oBAAa,gBAAgB,aAAc,GAAG;AAAA,MAClD;AAAA,MACA,WAAW,MAAM;AACb,oBAAY,CAAC;AACb,oBAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,QAAQ,KAAK,GAAG,OAAO,OAAO;AACpF,oBAAY,QAAQ;AAAA,MACxB;AAAA,IAAA,CACH;AAED,UAAM,kBAAkB,MAAM,OAAO,oBAAA;AACrC,QAAI,gBAAgB,SAAS,GAAG;AAC5B,aAAO,yBAAyB,gBAAgB,CAAC,CAAC;AAAA,IACtD;AAEA,WAAO,MAAA;AAAA,EACX;AAEA,SAAO,EAAE,QAAQ,SAAA;AACrB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileMeta-G1oT3mYK.js","sources":["../src/models/file/FileMeta.ts"],"sourcesContent":["import * as z from \"zod\";\r\n\r\nexport const FileMetaSchema = z.object({\r\n id: z.uuid(),\r\n subId: z.uuid(),\r\n appName: z.string().trim().min(1).max(255),\r\n fileName: z.string().trim().min(1).max(255),\r\n fileExtension: z.string().trim().min(1).max(255),\r\n fileSize: z.number().min(0),\r\n mediaSubType: z.string().trim().min(1).max(255),\r\n mediaType: z.string().trim().min(1).max(255),\r\n mimeType: z.string().trim().min(1).max(255),\r\n createdBy: z.string().trim().min(1).max(255),\r\n createdDate: z.date(),\r\n});\r\n\r\nexport type FileMeta = z.infer<typeof FileMetaSchema>;\r\n"],"names":[],"mappings":";AAEO,MAAM,iBAAiB,EAAE,OAAO;AAAA,EACnC,IAAI,EAAE,KAAA;AAAA,EACN,OAAO,EAAE,KAAA;AAAA,EACT,SAAS,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACzC,UAAU,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC1C,eAAe,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/C,UAAU,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,cAAc,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC9C,WAAW,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC3C,UAAU,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC1C,WAAW,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC3C,aAAa,EAAE,KAAA;AACnB,CAAC;"}
1
+ {"version":3,"file":"FileMeta-G1oT3mYK.js","sources":["../src/models/file/FileMeta.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport const FileMetaSchema = z.object({\n id: z.uuid(),\n subId: z.uuid(),\n appName: z.string().trim().min(1).max(255),\n fileName: z.string().trim().min(1).max(255),\n fileExtension: z.string().trim().min(1).max(255),\n fileSize: z.number().min(0),\n mediaSubType: z.string().trim().min(1).max(255),\n mediaType: z.string().trim().min(1).max(255),\n mimeType: z.string().trim().min(1).max(255),\n createdBy: z.string().trim().min(1).max(255),\n createdDate: z.date(),\n});\n\nexport type FileMeta = z.infer<typeof FileMetaSchema>;\n"],"names":[],"mappings":";AAEO,MAAM,iBAAiB,EAAE,OAAO;AAAA,EACnC,IAAI,EAAE,KAAA;AAAA,EACN,OAAO,EAAE,KAAA;AAAA,EACT,SAAS,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACzC,UAAU,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC1C,eAAe,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/C,UAAU,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,cAAc,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC9C,WAAW,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC3C,UAAU,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC1C,WAAW,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC3C,aAAa,EAAE,KAAA;AACnB,CAAC;"}