@ozdao/prometheus-framework 0.2.88 → 0.2.90
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main-BV1Yv9Hy.js +92 -0
- package/dist/main-DmNP-t33.mjs +13625 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1 -1
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +748 -750
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.cjs +1 -1
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +40 -39
- package/dist/node_modules/web3/lib/esm/index.cjs +1 -1
- package/dist/node_modules/web3/lib/esm/index.js +42 -41
- package/dist/node_modules/web3/lib/esm/version.cjs +1 -1
- package/dist/node_modules/web3/lib/esm/version.js +1 -1
- package/dist/node_modules/web3-eth/lib/esm/schemas.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/schemas.js +113 -88
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.cjs +3 -1
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.js +242 -217
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.cjs +1 -1
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.js +43 -37
- package/dist/node_modules/web3-eth-ens/lib/esm/config.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/config.js +3 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.js +34 -13
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.js +48 -36
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.js +2 -2
- package/dist/node_modules/web3-utils/lib/esm/converters.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/converters.js +52 -50
- package/dist/node_modules/web3-utils/lib/esm/uint8array.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/uint8array.js +13 -13
- package/dist/node_modules/web3-validator/lib/esm/utils.cjs +1 -1
- package/dist/node_modules/web3-validator/lib/esm/utils.js +76 -87
- package/dist/node_modules/web3-validator/lib/esm/validator.cjs +1 -1
- package/dist/node_modules/web3-validator/lib/esm/validator.js +49 -47
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +168 -158
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +73 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -73
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +20 -25
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-Bk_OtXgv.js +1 -0
- package/dist/web-VFuzUsNl.mjs +54 -0
- package/package.json +19 -19
- package/src/modules/events/components/pages/Events.vue +0 -1
- package/src/modules/landing/components/pages/Governance.vue +0 -11
- package/src/modules/landing/components/pages/Hotel.vue +0 -9
- package/src/modules/landing/components/pages/Page.vue +0 -7
- package/src/modules/marketplace/components/layouts/Marketplace.vue +1 -8
- package/src/modules/products/components/pages/Product.vue +1 -13
- package/src/modules/spots/components/layouts/Spots.vue +0 -9
@@ -1,80 +1,82 @@
|
|
1
1
|
import "../../../web3-errors/lib/esm/errors/rpc_errors.js";
|
2
|
-
import { SchemaFormatError as
|
3
|
-
import
|
4
|
-
import { Web3ValidatorError as
|
2
|
+
import { SchemaFormatError as I } from "../../../web3-errors/lib/esm/errors/schema_errors.js";
|
3
|
+
import u, { ZodIssueCode as p } from "../../../zod/lib/index.js";
|
4
|
+
import { Web3ValidatorError as b } from "./errors.js";
|
5
5
|
import y from "./formats.js";
|
6
6
|
const s = (t) => {
|
7
7
|
if ((!(t != null && t.type) || (t == null ? void 0 : t.type) === "object") && (t != null && t.properties)) {
|
8
|
-
const
|
8
|
+
const e = {};
|
9
9
|
for (const i of Object.keys(t.properties)) {
|
10
|
-
const
|
11
|
-
|
10
|
+
const n = s(t.properties[i]);
|
11
|
+
n && (e[i] = n);
|
12
12
|
}
|
13
|
-
return Array.isArray(t.required) ?
|
13
|
+
return Array.isArray(t.required) ? u.object(e).partial().required(t.required.reduce((i, n) => Object.assign(Object.assign({}, i), { [n]: !0 }), {})) : u.object(e).partial();
|
14
14
|
}
|
15
15
|
if ((t == null ? void 0 : t.type) === "array" && (t != null && t.items)) {
|
16
|
-
if (Array.isArray(t.items) && t.items.length > 0) {
|
16
|
+
if (Array.isArray(t.items) && t.items.length > 1 && t.maxItems !== void 0 && new Set(t.items.map((n) => n.$id)).size === t.items.length) {
|
17
17
|
const n = [];
|
18
|
-
for (const
|
19
|
-
const
|
20
|
-
|
18
|
+
for (const o of t.items) {
|
19
|
+
const r = s(o);
|
20
|
+
r && n.push(r);
|
21
21
|
}
|
22
|
-
return
|
22
|
+
return u.tuple(n);
|
23
23
|
}
|
24
|
-
|
24
|
+
const e = Array.isArray(t.items) ? t.items[0] : t.items;
|
25
|
+
let i = u.array(s(e));
|
26
|
+
return i = t.minItems !== void 0 ? i.min(t.minItems) : i, i = t.maxItems !== void 0 ? i.max(t.maxItems) : i, i;
|
25
27
|
}
|
26
28
|
if (t.oneOf && Array.isArray(t.oneOf))
|
27
|
-
return
|
29
|
+
return u.union(t.oneOf.map((e) => s(e)));
|
28
30
|
if (t != null && t.format) {
|
29
31
|
if (!y[t.format])
|
30
|
-
throw new
|
31
|
-
return
|
32
|
-
params: { value:
|
32
|
+
throw new I(t.format);
|
33
|
+
return u.any().refine(y[t.format], (e) => ({
|
34
|
+
params: { value: e, format: t.format }
|
33
35
|
}));
|
34
36
|
}
|
35
|
-
return t != null && t.type && (t == null ? void 0 : t.type) !== "object" && typeof
|
37
|
+
return t != null && t.type && (t == null ? void 0 : t.type) !== "object" && typeof u[String(t.type)] == "function" ? u[String(t.type)]() : u.object({ data: u.any() }).partial();
|
36
38
|
};
|
37
39
|
class v {
|
38
40
|
// eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
|
39
41
|
static factory() {
|
40
42
|
return v.validatorInstance || (v.validatorInstance = new v()), v.validatorInstance;
|
41
43
|
}
|
42
|
-
validate(
|
43
|
-
var
|
44
|
-
const
|
45
|
-
if (!
|
46
|
-
const
|
47
|
-
if (
|
48
|
-
if (
|
49
|
-
return
|
50
|
-
throw new
|
44
|
+
validate(e, i, n) {
|
45
|
+
var o, r;
|
46
|
+
const l = s(e).safeParse(i);
|
47
|
+
if (!l.success) {
|
48
|
+
const a = this.convertErrors((r = (o = l.error) === null || o === void 0 ? void 0 : o.issues) !== null && r !== void 0 ? r : []);
|
49
|
+
if (a) {
|
50
|
+
if (n != null && n.silent)
|
51
|
+
return a;
|
52
|
+
throw new b(a);
|
51
53
|
}
|
52
54
|
}
|
53
55
|
}
|
54
56
|
// eslint-disable-next-line class-methods-use-this
|
55
|
-
convertErrors(
|
56
|
-
if (
|
57
|
-
return
|
58
|
-
var
|
59
|
-
let
|
60
|
-
|
61
|
-
const
|
62
|
-
if (i.code ===
|
63
|
-
|
64
|
-
else if (i.code ===
|
65
|
-
|
66
|
-
else if (i.code ===
|
67
|
-
const { value: f, format: g } = (
|
68
|
-
typeof f > "u" ?
|
69
|
-
typeof f == "object" ? JSON.stringify(f) : f}" at "/${
|
57
|
+
convertErrors(e) {
|
58
|
+
if (e && Array.isArray(e) && e.length > 0)
|
59
|
+
return e.map((i) => {
|
60
|
+
var n;
|
61
|
+
let o, r, d, l;
|
62
|
+
l = i.path.join("/");
|
63
|
+
const a = String(i.path[i.path.length - 1]), m = i.path.join("/");
|
64
|
+
if (i.code === p.too_big)
|
65
|
+
r = "maxItems", l = `${m}/maxItems`, d = { limit: i.maximum }, o = `must NOT have more than ${i.maximum} items`;
|
66
|
+
else if (i.code === p.too_small)
|
67
|
+
r = "minItems", l = `${m}/minItems`, d = { limit: i.minimum }, o = `must NOT have fewer than ${i.minimum} items`;
|
68
|
+
else if (i.code === p.custom) {
|
69
|
+
const { value: f, format: g } = (n = i.params) !== null && n !== void 0 ? n : {};
|
70
|
+
typeof f > "u" ? o = `value at "/${l}" is required` : o = `value "${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
71
|
+
typeof f == "object" ? JSON.stringify(f) : f}" at "/${l}" must pass "${g}" validation`, d = { value: f };
|
70
72
|
}
|
71
73
|
return {
|
72
|
-
keyword:
|
73
|
-
instancePath:
|
74
|
-
schemaPath:
|
74
|
+
keyword: r ?? a,
|
75
|
+
instancePath: m ? `/${m}` : "",
|
76
|
+
schemaPath: l ? `#${l}` : "#",
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
76
|
-
params:
|
77
|
-
message:
|
78
|
+
params: d ?? { value: i.message },
|
79
|
+
message: o ?? i.message
|
78
80
|
};
|
79
81
|
});
|
80
82
|
}
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! Capacitor: https://capacitorjs.com/ - MIT License */const Z=
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! Capacitor: https://capacitorjs.com/ - MIT License */const Z=r=>{const e=new Map;e.set("web",{name:"web"});const t=r.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},o=(n,a)=>{t.platforms.set(n,a)},i=n=>{t.platforms.has(n)&&(t.currentPlatform=t.platforms.get(n))};return t.addPlatform=o,t.setPlatform=i,t},N=r=>r.CapacitorPlatforms=Z(r),S=N(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});S.addPlatform;S.setPlatform;exports.ExceptionCode=void 0;(function(r){r.Unimplemented="UNIMPLEMENTED",r.Unavailable="UNAVAILABLE"})(exports.ExceptionCode||(exports.ExceptionCode={}));class $ extends Error{constructor(e,t,o){super(e),this.message=e,this.code=t,this.data=o}}const ee=r=>{var e,t;return r!=null&&r.androidBridge?"android":!((t=(e=r==null?void 0:r.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||t===void 0)&&t.bridge?"ios":"web"},te=r=>{var e,t,o,i,n;const a=r.CapacitorCustomPlatform||null,s=r.Capacitor||{},f=s.Plugins=s.Plugins||{},l=r.CapacitorPlatforms,L=()=>a!==null?a.name:ee(r),P=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||L,O=()=>P()!=="web",D=((t=l==null?void 0:l.currentPlatform)===null||t===void 0?void 0:t.isNativePlatform)||O,F=c=>{const d=A.get(c);return!!(d!=null&&d.platforms.has(P())||H(c))},B=((o=l==null?void 0:l.currentPlatform)===null||o===void 0?void 0:o.isPluginAvailable)||F,G=c=>{var d;return(d=s.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},H=((i=l==null?void 0:l.currentPlatform)===null||i===void 0?void 0:i.getPluginHeader)||G,K=c=>r.console.error(c),z=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),A=new Map,V=(c,d={})=>{const y=A.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const w=P(),C=H(c);let p;const Q=async()=>(!p&&w in d?p=typeof d[w]=="function"?p=await d[w]():p=d[w]:a!==null&&!p&&"web"in d&&(p=typeof d.web=="function"?p=await d.web():p=d.web),p),X=(u,g)=>{var h,b;if(C){const v=C==null?void 0:C.methods.find(m=>g===m.name);if(v)return v.rtype==="promise"?m=>s.nativePromise(c,g.toString(),m):(m,k)=>s.nativeCallback(c,g.toString(),m,k);if(u)return(h=u[g])===null||h===void 0?void 0:h.bind(u)}else{if(u)return(b=u[g])===null||b===void 0?void 0:b.bind(u);throw new $(`"${c}" plugin is not implemented on ${w}`,exports.ExceptionCode.Unimplemented)}},j=u=>{let g;const h=(...b)=>{const v=Q().then(m=>{const k=X(m,u);if(k){const x=k(...b);return g=x==null?void 0:x.remove,x}else throw new $(`"${c}.${u}()" is not implemented on ${w}`,exports.ExceptionCode.Unimplemented)});return u==="addListener"&&(v.remove=async()=>g()),v};return h.toString=()=>`${u.toString()}() { [capacitor code] }`,Object.defineProperty(h,"name",{value:u,writable:!1,configurable:!1}),h},R=j("addListener"),M=j("removeListener"),Y=(u,g)=>{const h=R({eventName:u},g),b=async()=>{const m=await h;M({eventName:u,callbackId:m},g)},v=new Promise(m=>h.then(()=>m({remove:b})));return v.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await b()},v},U=new Proxy({},{get(u,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?Y:R;case"removeListener":return M;default:return j(g)}}});return f[c]=U,A.set(c,{name:c,proxy:U,platforms:new Set([...Object.keys(d),...C?[w]:[]])}),U},J=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.registerPlugin)||V;return s.convertFileSrc||(s.convertFileSrc=c=>c),s.getPlatform=P,s.handleError=K,s.isNativePlatform=D,s.isPluginAvailable=B,s.pluginMethodNoop=z,s.registerPlugin=J,s.Exception=$,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},re=r=>r.Capacitor=te(r),E=re(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),T=E.registerPlugin;E.Plugins;class _{constructor(e){this.listeners={},this.retainedEventArguments={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,t){let o=!1;this.listeners[e]||(this.listeners[e]=[],o=!0),this.listeners[e].push(t);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n),o&&this.sendRetainedArgumentsForEvent(e);const a=async()=>this.removeListener(e,t);return Promise.resolve({remove:a})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,o){const i=this.listeners[e];if(!i){if(o){let n=this.retainedEventArguments[e];n||(n=[]),n.push(t),this.retainedEventArguments[e]=n}return}i.forEach(n=>n(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:o=>{this.notifyListeners(t,o)}}}unimplemented(e="not implemented"){return new E.Exception(e,exports.ExceptionCode.Unimplemented)}unavailable(e="not available"){return new E.Exception(e,exports.ExceptionCode.Unavailable)}async removeListener(e,t){const o=this.listeners[e];if(!o)return;const i=o.indexOf(t);this.listeners[e].splice(i,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach(o=>{this.notifyListeners(e,o)}))}}const W=r=>encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),I=r=>r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ne extends _{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach(o=>{if(o.length<=0)return;let[i,n]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");i=I(i).trim(),n=I(n).trim(),t[i]=n}),t}async setCookie(e){try{const t=W(e.key),o=W(e.value),i=`; expires=${(e.expires||"").replace("expires=","")}`,n=(e.path||"/").replace("path=",""),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${o||""}${i}; path=${n}; ${a};`}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}T("CapacitorCookies",{web:()=>new ne});const se=async r=>new Promise((e,t)=>{const o=new FileReader;o.onload=()=>{const i=o.result;e(i.indexOf(",")>=0?i.split(",")[1]:i)},o.onerror=i=>t(i),o.readAsDataURL(r)}),oe=(r={})=>{const e=Object.keys(r);return Object.keys(r).map(i=>i.toLocaleLowerCase()).reduce((i,n,a)=>(i[n]=r[e[a]],i),{})},ie=(r,e=!0)=>r?Object.entries(r).reduce((o,i)=>{const[n,a]=i;let s,f;return Array.isArray(a)?(f="",a.forEach(l=>{s=e?encodeURIComponent(l):l,f+=`${n}=${s}&`}),f.slice(0,-1)):(s=e?encodeURIComponent(a):a,f=`${n}=${s}`),`${o}&${f}`},"").substr(1):null,q=(r,e={})=>{const t=Object.assign({method:r.method||"GET",headers:r.headers},e),i=oe(r.headers)["content-type"]||"";if(typeof r.data=="string")t.body=r.data;else if(i.includes("application/x-www-form-urlencoded")){const n=new URLSearchParams;for(const[a,s]of Object.entries(r.data||{}))n.set(a,s);t.body=n.toString()}else if(i.includes("multipart/form-data")||r.data instanceof FormData){const n=new FormData;if(r.data instanceof FormData)r.data.forEach((s,f)=>{n.append(f,s)});else for(const s of Object.keys(r.data))n.append(s,r.data[s]);t.body=n;const a=new Headers(t.headers);a.delete("content-type"),t.headers=a}else(i.includes("application/json")||typeof r.data=="object")&&(t.body=JSON.stringify(r.data));return t};class ae extends _{async request(e){const t=q(e,e.webFetchExtra),o=ie(e.params,e.shouldEncodeUrlParams),i=o?`${e.url}?${o}`:e.url,n=await fetch(i,t),a=n.headers.get("content-type")||"";let{responseType:s="text"}=n.ok?e:{};a.includes("application/json")&&(s="json");let f,l;switch(s){case"arraybuffer":case"blob":l=await n.blob(),f=await se(l);break;case"json":f=await n.json();break;case"document":case"text":default:f=await n.text()}const L={};return n.headers.forEach((P,O)=>{L[O]=P}),{data:f,headers:L,status:n.status,url:n.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}T("CapacitorHttp",{web:()=>new ae});exports.Capacitor=E;exports.CapacitorException=$;exports.CapacitorPlatforms=S;exports.WebPlugin=_;exports.buildRequestInit=q;exports.registerPlugin=T;
|