@ozdao/prometheus-framework 0.1.85 → 0.1.87
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +22 -22
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +49 -2
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +2 -49
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +106 -84
- 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/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +62 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -62
- 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/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 +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
- 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/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.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/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.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/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- 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/style.css +1 -1
- package/package.json +1 -1
- package/src/modules/auth/store/auth.js +45 -42
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! Capacitor: https://capacitorjs.com/ - MIT License */const Z=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},i=(o,a)=>{r.platforms.set(o,a)},n=o=>{r.platforms.has(o)&&(r.currentPlatform=r.platforms.get(o))};return r.addPlatform=i,r.setPlatform=n,r},N=t=>t.CapacitorPlatforms=Z(t),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(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(exports.ExceptionCode||(exports.ExceptionCode={}));class O extends Error{constructor(e,r,i){super(e),this.message=e,this.code=r,this.data=i}}const ee=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},te=t=>{var e,r,i,n,o;const a=t.CapacitorCustomPlatform||null,s=t.Capacitor||{},f=s.Plugins=s.Plugins||{},l=t.CapacitorPlatforms,E=()=>a!==null?a.name:ee(t),v=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||E,$=()=>v()!=="web",D=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||$,B=c=>{const d=j.get(c);return!!(d!=null&&d.platforms.has(v())||H(c))},G=((i=l==null?void 0:l.currentPlatform)===null||i===void 0?void 0:i.isPluginAvailable)||B,F=c=>{var d;return(d=s.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},H=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||F,K=c=>t.console.error(c),z=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),j=new Map,V=(c,d={})=>{const y=j.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=v(),C=H(c);let h;const Q=async()=>(!h&&P in d?h=typeof d[P]=="function"?h=await d[P]():h=d[P]:a!==null&&!h&&"web"in d&&(h=typeof d.web=="function"?h=await d.web():h=d.web),h),X=(u,g)=>{var p,w;if(C){const b=C==null?void 0:C.methods.find(m=>g===m.name);if(b)return b.rtype==="promise"?m=>s.nativePromise(c,g.toString(),m):(m,k)=>s.nativeCallback(c,g.toString(),m,k);if(u)return(p=u[g])===null||p===void 0?void 0:p.bind(u)}else{if(u)return(w=u[g])===null||w===void 0?void 0:w.bind(u);throw new O(`"${c}" plugin is not implemented on ${P}`,exports.ExceptionCode.Unimplemented)}},U=u=>{let g;const p=(...w)=>{const b=Q().then(m=>{const k=X(m,u);if(k){const x=k(...w);return g=x==null?void 0:x.remove,x}else throw new O(`"${c}.${u}()" is not implemented on ${P}`,exports.ExceptionCode.Unimplemented)});return u==="addListener"&&(b.remove=async()=>g()),b};return p.toString=()=>`${u.toString()}() { [capacitor code] }`,Object.defineProperty(p,"name",{value:u,writable:!1,configurable:!1}),p},M=U("addListener"),W=U("removeListener"),Y=(u,g)=>{const p=M({eventName:u},g),w=async()=>{const m=await p;W({eventName:u,callbackId:m},g)},b=new Promise(m=>p.then(()=>m({remove:w})));return b.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await w()},b},A=new Proxy({},{get(u,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?Y:M;case"removeListener":return W;default:return U(g)}}});return f[c]=A,j.set(c,{name:c,proxy:A,platforms:new Set([...Object.keys(d),...C?[P]:[]])}),A},J=((o=l==null?void 0:l.currentPlatform)===null||o===void 0?void 0:o.registerPlugin)||V;return s.convertFileSrc||(s.convertFileSrc=c=>c),s.getPlatform=v,s.handleError=K,s.isNativePlatform=D,s.isPluginAvailable=G,s.pluginMethodNoop=z,s.registerPlugin=J,s.Exception=O,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},re=t=>t.Capacitor=te(t),L=re(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),T=L.registerPlugin;L.Plugins;class _{constructor(e){this.listeners={},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,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const o=async()=>this.removeListener(e,r),a=Promise.resolve({remove:o});return Object.defineProperty(a,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await o()}}),a}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const i=this.listeners[e];i&&i.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:i=>{this.notifyListeners(r,i)}}}unimplemented(e="not implemented"){return new L.Exception(e,exports.ExceptionCode.Unimplemented)}unavailable(e="not available"){return new L.Exception(e,exports.ExceptionCode.Unavailable)}async removeListener(e,r){const i=this.listeners[e];if(!i)return;const n=i.indexOf(r);this.listeners[e].splice(n,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)}}const R=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),I=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ne extends _{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(i=>{if(i.length<=0)return;let[n,o]=i.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=I(n).trim(),o=I(o).trim(),r[n]=o}),r}async setCookie(e){try{const r=R(e.key),i=R(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,o=(e.path||"/").replace("path=",""),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${i||""}${n}; path=${o}; ${a};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.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})
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! Capacitor: https://capacitorjs.com/ - MIT License */const Z=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},i=(o,a)=>{r.platforms.set(o,a)},n=o=>{r.platforms.has(o)&&(r.currentPlatform=r.platforms.get(o))};return r.addPlatform=i,r.setPlatform=n,r},N=t=>t.CapacitorPlatforms=Z(t),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(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(exports.ExceptionCode||(exports.ExceptionCode={}));class O extends Error{constructor(e,r,i){super(e),this.message=e,this.code=r,this.data=i}}const ee=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},te=t=>{var e,r,i,n,o;const a=t.CapacitorCustomPlatform||null,s=t.Capacitor||{},f=s.Plugins=s.Plugins||{},l=t.CapacitorPlatforms,E=()=>a!==null?a.name:ee(t),v=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||E,$=()=>v()!=="web",D=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||$,B=c=>{const d=j.get(c);return!!(d!=null&&d.platforms.has(v())||H(c))},G=((i=l==null?void 0:l.currentPlatform)===null||i===void 0?void 0:i.isPluginAvailable)||B,F=c=>{var d;return(d=s.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},H=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||F,K=c=>t.console.error(c),z=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),j=new Map,V=(c,d={})=>{const y=j.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=v(),C=H(c);let h;const Q=async()=>(!h&&P in d?h=typeof d[P]=="function"?h=await d[P]():h=d[P]:a!==null&&!h&&"web"in d&&(h=typeof d.web=="function"?h=await d.web():h=d.web),h),X=(u,g)=>{var p,w;if(C){const b=C==null?void 0:C.methods.find(m=>g===m.name);if(b)return b.rtype==="promise"?m=>s.nativePromise(c,g.toString(),m):(m,k)=>s.nativeCallback(c,g.toString(),m,k);if(u)return(p=u[g])===null||p===void 0?void 0:p.bind(u)}else{if(u)return(w=u[g])===null||w===void 0?void 0:w.bind(u);throw new O(`"${c}" plugin is not implemented on ${P}`,exports.ExceptionCode.Unimplemented)}},U=u=>{let g;const p=(...w)=>{const b=Q().then(m=>{const k=X(m,u);if(k){const x=k(...w);return g=x==null?void 0:x.remove,x}else throw new O(`"${c}.${u}()" is not implemented on ${P}`,exports.ExceptionCode.Unimplemented)});return u==="addListener"&&(b.remove=async()=>g()),b};return p.toString=()=>`${u.toString()}() { [capacitor code] }`,Object.defineProperty(p,"name",{value:u,writable:!1,configurable:!1}),p},M=U("addListener"),W=U("removeListener"),Y=(u,g)=>{const p=M({eventName:u},g),w=async()=>{const m=await p;W({eventName:u,callbackId:m},g)},b=new Promise(m=>p.then(()=>m({remove:w})));return b.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await w()},b},A=new Proxy({},{get(u,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?Y:M;case"removeListener":return W;default:return U(g)}}});return f[c]=A,j.set(c,{name:c,proxy:A,platforms:new Set([...Object.keys(d),...C?[P]:[]])}),A},J=((o=l==null?void 0:l.currentPlatform)===null||o===void 0?void 0:o.registerPlugin)||V;return s.convertFileSrc||(s.convertFileSrc=c=>c),s.getPlatform=v,s.handleError=K,s.isNativePlatform=D,s.isPluginAvailable=G,s.pluginMethodNoop=z,s.registerPlugin=J,s.Exception=O,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},re=t=>t.Capacitor=te(t),L=re(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),T=L.registerPlugin;L.Plugins;class _{constructor(e){this.listeners={},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,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const o=async()=>this.removeListener(e,r),a=Promise.resolve({remove:o});return Object.defineProperty(a,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await o()}}),a}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const i=this.listeners[e];i&&i.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:i=>{this.notifyListeners(r,i)}}}unimplemented(e="not implemented"){return new L.Exception(e,exports.ExceptionCode.Unimplemented)}unavailable(e="not available"){return new L.Exception(e,exports.ExceptionCode.Unavailable)}async removeListener(e,r){const i=this.listeners[e];if(!i)return;const n=i.indexOf(r);this.listeners[e].splice(n,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)}}const R=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),I=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ne extends _{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(i=>{if(i.length<=0)return;let[n,o]=i.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=I(n).trim(),o=I(o).trim(),r[n]=o}),r}async setCookie(e){try{const r=R(e.key),i=R(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,o=(e.path||"/").replace("path=",""),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${i||""}${n}; path=${o}; ${a};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.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)}}}const oe=T("CapacitorCookies",{web:()=>new ne}),se=async t=>new Promise((e,r)=>{const i=new FileReader;i.onload=()=>{const n=i.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},i.onerror=n=>r(n),i.readAsDataURL(t)}),ie=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,o,a)=>(n[o]=t[e[a]],n),{})},ae=(t,e=!0)=>t?Object.entries(t).reduce((i,n)=>{const[o,a]=n;let s,f;return Array.isArray(a)?(f="",a.forEach(l=>{s=e?encodeURIComponent(l):l,f+=`${o}=${s}&`}),f.slice(0,-1)):(s=e?encodeURIComponent(a):a,f=`${o}=${s}`),`${i}&${f}`},"").substr(1):null,q=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=ie(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[a,s]of Object.entries(t.data||{}))o.set(a,s);r.body=o.toString()}else if(n.includes("multipart/form-data")){const o=new FormData;if(t.data instanceof FormData)t.data.forEach((s,f)=>{o.append(f,s)});else for(const s of Object.keys(t.data))o.append(s,t.data[s]);r.body=o;const a=new Headers(r.headers);a.delete("content-type"),r.headers=a}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class le extends _{async request(e){const r=q(e,e.webFetchExtra),i=ae(e.params,e.shouldEncodeUrlParams),n=i?`${e.url}?${i}`:e.url,o=await fetch(n,r),a=o.headers.get("content-type")||"";let{responseType:s="text"}=o.ok?e:{};a.includes("application/json")&&(s="json");let f,l;switch(s){case"arraybuffer":case"blob":l=await o.blob(),f=await se(l);break;case"json":f=await o.json();break;case"document":case"text":default:f=await o.text()}const E={};return o.headers.forEach((v,$)=>{E[$]=v}),{data:f,headers:E,status:o.status,url:o.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 le});exports.Capacitor=L;exports.CapacitorCookies=oe;exports.CapacitorException=O;exports.CapacitorPlatforms=S;exports.WebPlugin=_;exports.buildRequestInit=q;exports.registerPlugin=T;
|
@@ -38,33 +38,33 @@ const ee = (t) => {
|
|
38
38
|
const y = j.get(c);
|
39
39
|
if (y)
|
40
40
|
return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`), y.proxy;
|
41
|
-
const
|
41
|
+
const b = P(), C = T(c);
|
42
42
|
let w;
|
43
|
-
const Q = async () => (!w &&
|
44
|
-
var h,
|
43
|
+
const Q = async () => (!w && b in d ? w = typeof d[b] == "function" ? w = await d[b]() : w = d[b] : a !== null && !w && "web" in d && (w = typeof d.web == "function" ? w = await d.web() : w = d.web), w), X = (u, m) => {
|
44
|
+
var h, p;
|
45
45
|
if (C) {
|
46
|
-
const
|
47
|
-
if (
|
48
|
-
return
|
46
|
+
const v = C == null ? void 0 : C.methods.find((g) => m === g.name);
|
47
|
+
if (v)
|
48
|
+
return v.rtype === "promise" ? (g) => o.nativePromise(c, m.toString(), g) : (g, E) => o.nativeCallback(c, m.toString(), g, E);
|
49
49
|
if (u)
|
50
50
|
return (h = u[m]) === null || h === void 0 ? void 0 : h.bind(u);
|
51
51
|
} else {
|
52
52
|
if (u)
|
53
|
-
return (
|
54
|
-
throw new S(`"${c}" plugin is not implemented on ${
|
53
|
+
return (p = u[m]) === null || p === void 0 ? void 0 : p.bind(u);
|
54
|
+
throw new S(`"${c}" plugin is not implemented on ${b}`, L.Unimplemented);
|
55
55
|
}
|
56
56
|
}, U = (u) => {
|
57
57
|
let m;
|
58
|
-
const h = (...
|
59
|
-
const
|
58
|
+
const h = (...p) => {
|
59
|
+
const v = Q().then((g) => {
|
60
60
|
const E = X(g, u);
|
61
61
|
if (E) {
|
62
|
-
const $ = E(...
|
62
|
+
const $ = E(...p);
|
63
63
|
return m = $ == null ? void 0 : $.remove, $;
|
64
64
|
} else
|
65
|
-
throw new S(`"${c}.${u}()" is not implemented on ${
|
65
|
+
throw new S(`"${c}.${u}()" is not implemented on ${b}`, L.Unimplemented);
|
66
66
|
});
|
67
|
-
return u === "addListener" && (
|
67
|
+
return u === "addListener" && (v.remove = async () => m()), v;
|
68
68
|
};
|
69
69
|
return h.toString = () => `${u.toString()}() { [capacitor code] }`, Object.defineProperty(h, "name", {
|
70
70
|
value: u,
|
@@ -72,16 +72,16 @@ const ee = (t) => {
|
|
72
72
|
configurable: !1
|
73
73
|
}), h;
|
74
74
|
}, _ = U("addListener"), H = U("removeListener"), Y = (u, m) => {
|
75
|
-
const h = _({ eventName: u }, m),
|
75
|
+
const h = _({ eventName: u }, m), p = async () => {
|
76
76
|
const g = await h;
|
77
77
|
H({
|
78
78
|
eventName: u,
|
79
79
|
callbackId: g
|
80
80
|
}, m);
|
81
|
-
},
|
82
|
-
return
|
83
|
-
console.warn("Using addListener() without 'await' is deprecated."), await
|
84
|
-
},
|
81
|
+
}, v = new Promise((g) => h.then(() => g({ remove: p })));
|
82
|
+
return v.remove = async () => {
|
83
|
+
console.warn("Using addListener() without 'await' is deprecated."), await p();
|
84
|
+
}, v;
|
85
85
|
}, A = new Proxy({}, {
|
86
86
|
get(u, m) {
|
87
87
|
switch (m) {
|
@@ -103,7 +103,7 @@ const ee = (t) => {
|
|
103
103
|
proxy: A,
|
104
104
|
platforms: /* @__PURE__ */ new Set([
|
105
105
|
...Object.keys(d),
|
106
|
-
...C ? [
|
106
|
+
...C ? [b] : []
|
107
107
|
])
|
108
108
|
}), A;
|
109
109
|
}, J = ((s = l == null ? void 0 : l.currentPlatform) === null || s === void 0 ? void 0 : s.registerPlugin) || V;
|
@@ -211,10 +211,9 @@ class ne extends q {
|
|
211
211
|
}
|
212
212
|
}
|
213
213
|
}
|
214
|
-
I("CapacitorCookies", {
|
214
|
+
const ce = I("CapacitorCookies", {
|
215
215
|
web: () => new ne()
|
216
|
-
})
|
217
|
-
const se = async (t) => new Promise((e, r) => {
|
216
|
+
}), se = async (t) => new Promise((e, r) => {
|
218
217
|
const i = new FileReader();
|
219
218
|
i.onload = () => {
|
220
219
|
const n = i.result;
|
@@ -328,6 +327,7 @@ I("CapacitorHttp", {
|
|
328
327
|
});
|
329
328
|
export {
|
330
329
|
O as Capacitor,
|
330
|
+
ce as CapacitorCookies,
|
331
331
|
S as CapacitorException,
|
332
332
|
R as CapacitorPlatforms,
|
333
333
|
L as ExceptionCode,
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("../FieldPhone/click-outside.cjs");require("./Dropdown.vue2.cjs");const u=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),s={__name:"Dropdown",props:{label:{type:String,default:"Open"},align:{type:String,default:"left"}},setup(i){let n=a.default;const t=e.ref(!1);function r(){t.value=!1}return(o,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"dropdown pos-relative",onClick:l[0]||(l[0]=e.withModifiers(c=>t.value=!t.value,["stop"]))},[e.createTextVNode(e.toDisplayString(i.label)+" ",1),e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle({left:i.align==="left"?"0":"auto",right:i.align==="right"?"0":"auto"}),class:"dropdown-content w-15r radius-big"},[e.renderSlot(o.$slots,"default",{},void 0,!0)],4),[[e.vShow,t.value]])]),_:3})])),[[e.unref(n),r]])}},d=u.default(s,[["__scopeId","data-v-2f59adb5"]]);exports.default=d;
|
@@ -1,4 +1,51 @@
|
|
1
|
-
|
1
|
+
import { ref as a, withDirectives as i, openBlock as d, createElementBlock as s, withModifiers as u, createTextVNode as c, toDisplayString as f, createVNode as p, Transition as m, withCtx as v, createElementVNode as g, normalizeStyle as w, renderSlot as k, vShow as S, unref as h } from "vue";
|
2
|
+
import y from "../FieldPhone/click-outside.js";
|
3
|
+
import "./Dropdown.vue2.js";
|
4
|
+
import O from "../../../../_virtual/_plugin-vue_export-helper.js";
|
5
|
+
const b = {
|
6
|
+
__name: "Dropdown",
|
7
|
+
props: {
|
8
|
+
label: {
|
9
|
+
type: String,
|
10
|
+
default: "Open"
|
11
|
+
},
|
12
|
+
align: {
|
13
|
+
type: String,
|
14
|
+
default: "left"
|
15
|
+
}
|
16
|
+
},
|
17
|
+
setup(t) {
|
18
|
+
let l = y;
|
19
|
+
const e = a(!1);
|
20
|
+
function n() {
|
21
|
+
e.value = !1;
|
22
|
+
}
|
23
|
+
return (r, o) => i((d(), s("div", {
|
24
|
+
class: "dropdown pos-relative",
|
25
|
+
onClick: o[0] || (o[0] = u((x) => e.value = !e.value, ["stop"]))
|
26
|
+
}, [
|
27
|
+
c(f(t.label) + " ", 1),
|
28
|
+
p(m, {
|
29
|
+
name: "TransitionTranslateY",
|
30
|
+
mode: "out-in"
|
31
|
+
}, {
|
32
|
+
default: v(() => [
|
33
|
+
i(g("div", {
|
34
|
+
style: w({ left: t.align === "left" ? "0" : "auto", right: t.align === "right" ? "0" : "auto" }),
|
35
|
+
class: "dropdown-content w-15r radius-big"
|
36
|
+
}, [
|
37
|
+
k(r.$slots, "default", {}, void 0, !0)
|
38
|
+
], 4), [
|
39
|
+
[S, e.value]
|
40
|
+
])
|
41
|
+
]),
|
42
|
+
_: 3
|
43
|
+
})
|
44
|
+
])), [
|
45
|
+
[h(l), n]
|
46
|
+
]);
|
47
|
+
}
|
48
|
+
}, N = /* @__PURE__ */ O(b, [["__scopeId", "data-v-2f59adb5"]]);
|
2
49
|
export {
|
3
|
-
|
50
|
+
N as default
|
4
51
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
|
@@ -1,51 +1,4 @@
|
|
1
|
-
|
2
|
-
import y from "../FieldPhone/click-outside.js";
|
3
|
-
import "./Dropdown.vue.js";
|
4
|
-
import O from "../../../../_virtual/_plugin-vue_export-helper.js";
|
5
|
-
const b = {
|
6
|
-
__name: "Dropdown",
|
7
|
-
props: {
|
8
|
-
label: {
|
9
|
-
type: String,
|
10
|
-
default: "Open"
|
11
|
-
},
|
12
|
-
align: {
|
13
|
-
type: String,
|
14
|
-
default: "left"
|
15
|
-
}
|
16
|
-
},
|
17
|
-
setup(t) {
|
18
|
-
let l = y;
|
19
|
-
const e = a(!1);
|
20
|
-
function n() {
|
21
|
-
e.value = !1;
|
22
|
-
}
|
23
|
-
return (r, o) => i((d(), s("div", {
|
24
|
-
class: "dropdown pos-relative",
|
25
|
-
onClick: o[0] || (o[0] = u((x) => e.value = !e.value, ["stop"]))
|
26
|
-
}, [
|
27
|
-
c(f(t.label) + " ", 1),
|
28
|
-
p(m, {
|
29
|
-
name: "TransitionTranslateY",
|
30
|
-
mode: "out-in"
|
31
|
-
}, {
|
32
|
-
default: v(() => [
|
33
|
-
i(g("div", {
|
34
|
-
style: w({ left: t.align === "left" ? "0" : "auto", right: t.align === "right" ? "0" : "auto" }),
|
35
|
-
class: "dropdown-content w-15r radius-big"
|
36
|
-
}, [
|
37
|
-
k(r.$slots, "default", {}, void 0, !0)
|
38
|
-
], 4), [
|
39
|
-
[S, e.value]
|
40
|
-
])
|
41
|
-
]),
|
42
|
-
_: 3
|
43
|
-
})
|
44
|
-
])), [
|
45
|
-
[h(l), n]
|
46
|
-
]);
|
47
|
-
}
|
48
|
-
}, N = /* @__PURE__ */ O(b, [["__scopeId", "data-v-2f59adb5"]]);
|
1
|
+
const _ = "";
|
49
2
|
export {
|
50
|
-
|
3
|
+
_ as default
|
51
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Select.vue2.cjs");const p=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),k=["onClick"],v={key:0,class:"t-transp mn-r-small"},f={class:"w-100"},h=["onClick"],g={key:0,class:"w-100"},B={key:0,class:"mn-t-thin invalid-feedback"},_={__name:"Select",props:{label:String,select:[String,Object],placeholder:{type:String,default:"Please select an item"},options:{type:Array,default:()=>[]},validation:Boolean},emits:["update:select","focus","blur"],setup(l,{emit:u}){const c=u,o=l,n=e.ref(o.select),a=e.ref(!1);e.watch(()=>o.select,t=>{n.value=t});const d=e.computed(()=>o.select?o.options.filter(t=>t!==o.select):o.options),r=()=>{a.value=!a.value,c(a.value?"focus":"blur")},m=t=>{n.value=t,r(),c("update:select",n.value)};return(t,C)=>{var i;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{onClick:e.withModifiers(r,["stop"]),class:e.normalizeClass([t.$attrs.class,"cursor-pointer flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("li",f,[e.createElementVNode("span",null,e.toDisplayString(((i=n.value)==null?void 0:i.name)||n.value||l.placeholder),1)]),e.createVNode(e.Transition,{mode:"out-in",name:"TransitionTranslateY"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass([t.$attrs.class,"pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,s=>(e.openBlock(),e.createElementBlock("li",{onClick:e.withModifiers(E=>m(s),["stop"])},[s?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(s.name||s),1)):e.createCommentVNode("",!0)],8,h))),256))],2)):e.createCommentVNode("",!0)]),_:1})],10,k),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[l.validation?(e.openBlock(),e.createElementBlock("div",B," * "+e.toDisplayString(l.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64)}}},y=p.default(_,[["__scopeId","data-v-dfe03dc2"]]);exports.default=y;
|
@@ -1,4 +1,80 @@
|
|
1
|
-
|
1
|
+
import { ref as f, watch as S, computed as x, openBlock as t, createElementBlock as l, Fragment as v, createElementVNode as i, withModifiers as h, normalizeClass as _, toDisplayString as r, createCommentVNode as u, createVNode as k, Transition as b, withCtx as g, renderList as B } from "vue";
|
2
|
+
import "./Select.vue2.js";
|
3
|
+
import M from "../../../../_virtual/_plugin-vue_export-helper.js";
|
4
|
+
const N = ["onClick"], O = {
|
5
|
+
key: 0,
|
6
|
+
class: "t-transp mn-r-small"
|
7
|
+
}, T = { class: "w-100" }, V = ["onClick"], $ = {
|
8
|
+
key: 0,
|
9
|
+
class: "w-100"
|
10
|
+
}, z = {
|
11
|
+
key: 0,
|
12
|
+
class: "mn-t-thin invalid-feedback"
|
13
|
+
}, E = {
|
14
|
+
__name: "Select",
|
15
|
+
props: {
|
16
|
+
label: String,
|
17
|
+
select: [String, Object],
|
18
|
+
placeholder: { type: String, default: "Please select an item" },
|
19
|
+
options: { type: Array, default: () => [] },
|
20
|
+
validation: Boolean
|
21
|
+
},
|
22
|
+
emits: ["update:select", "focus", "blur"],
|
23
|
+
setup(s, { emit: w }) {
|
24
|
+
const d = w, a = s, n = f(a.select), o = f(!1);
|
25
|
+
S(() => a.select, (e) => {
|
26
|
+
n.value = e;
|
27
|
+
});
|
28
|
+
const y = x(() => a.select ? a.options.filter((e) => e !== a.select) : a.options), m = () => {
|
29
|
+
o.value = !o.value, d(o.value ? "focus" : "blur");
|
30
|
+
}, C = (e) => {
|
31
|
+
n.value = e, m(), d("update:select", n.value);
|
32
|
+
};
|
33
|
+
return (e, L) => {
|
34
|
+
var p;
|
35
|
+
return t(), l(v, null, [
|
36
|
+
i("div", {
|
37
|
+
onClick: h(m, ["stop"]),
|
38
|
+
class: _([e.$attrs.class, "cursor-pointer flex-nowrap flex"])
|
39
|
+
}, [
|
40
|
+
s.label ? (t(), l("div", O, [
|
41
|
+
i("span", null, r(s.label), 1)
|
42
|
+
])) : u("", !0),
|
43
|
+
i("li", T, [
|
44
|
+
i("span", null, r(((p = n.value) == null ? void 0 : p.name) || n.value || s.placeholder), 1)
|
45
|
+
]),
|
46
|
+
k(b, {
|
47
|
+
mode: "out-in",
|
48
|
+
name: "TransitionTranslateY"
|
49
|
+
}, {
|
50
|
+
default: g(() => [
|
51
|
+
o.value ? (t(), l("ul", {
|
52
|
+
key: 0,
|
53
|
+
class: _([e.$attrs.class, "pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"])
|
54
|
+
}, [
|
55
|
+
(t(!0), l(v, null, B(y.value, (c) => (t(), l("li", {
|
56
|
+
onClick: h((j) => C(c), ["stop"])
|
57
|
+
}, [
|
58
|
+
c ? (t(), l("span", $, r(c.name || c), 1)) : u("", !0)
|
59
|
+
], 8, V))), 256))
|
60
|
+
], 2)) : u("", !0)
|
61
|
+
]),
|
62
|
+
_: 1
|
63
|
+
})
|
64
|
+
], 10, N),
|
65
|
+
k(b, {
|
66
|
+
mode: "out-in",
|
67
|
+
name: "fade"
|
68
|
+
}, {
|
69
|
+
default: g(() => [
|
70
|
+
s.validation ? (t(), l("div", z, " * " + r(s.validation.message), 1)) : u("", !0)
|
71
|
+
]),
|
72
|
+
_: 1
|
73
|
+
})
|
74
|
+
], 64);
|
75
|
+
};
|
76
|
+
}
|
77
|
+
}, I = /* @__PURE__ */ M(E, [["__scopeId", "data-v-dfe03dc2"]]);
|
2
78
|
export {
|
3
|
-
|
79
|
+
I as default
|
4
80
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
|
@@ -1,80 +1,4 @@
|
|
1
|
-
|
2
|
-
import "./Select.vue.js";
|
3
|
-
import M from "../../../../_virtual/_plugin-vue_export-helper.js";
|
4
|
-
const N = ["onClick"], O = {
|
5
|
-
key: 0,
|
6
|
-
class: "t-transp mn-r-small"
|
7
|
-
}, T = { class: "w-100" }, V = ["onClick"], $ = {
|
8
|
-
key: 0,
|
9
|
-
class: "w-100"
|
10
|
-
}, z = {
|
11
|
-
key: 0,
|
12
|
-
class: "mn-t-thin invalid-feedback"
|
13
|
-
}, E = {
|
14
|
-
__name: "Select",
|
15
|
-
props: {
|
16
|
-
label: String,
|
17
|
-
select: [String, Object],
|
18
|
-
placeholder: { type: String, default: "Please select an item" },
|
19
|
-
options: { type: Array, default: () => [] },
|
20
|
-
validation: Boolean
|
21
|
-
},
|
22
|
-
emits: ["update:select", "focus", "blur"],
|
23
|
-
setup(s, { emit: w }) {
|
24
|
-
const d = w, a = s, n = f(a.select), o = f(!1);
|
25
|
-
S(() => a.select, (e) => {
|
26
|
-
n.value = e;
|
27
|
-
});
|
28
|
-
const y = x(() => a.select ? a.options.filter((e) => e !== a.select) : a.options), m = () => {
|
29
|
-
o.value = !o.value, d(o.value ? "focus" : "blur");
|
30
|
-
}, C = (e) => {
|
31
|
-
n.value = e, m(), d("update:select", n.value);
|
32
|
-
};
|
33
|
-
return (e, L) => {
|
34
|
-
var p;
|
35
|
-
return t(), l(v, null, [
|
36
|
-
i("div", {
|
37
|
-
onClick: h(m, ["stop"]),
|
38
|
-
class: _([e.$attrs.class, "cursor-pointer flex-nowrap flex"])
|
39
|
-
}, [
|
40
|
-
s.label ? (t(), l("div", O, [
|
41
|
-
i("span", null, r(s.label), 1)
|
42
|
-
])) : u("", !0),
|
43
|
-
i("li", T, [
|
44
|
-
i("span", null, r(((p = n.value) == null ? void 0 : p.name) || n.value || s.placeholder), 1)
|
45
|
-
]),
|
46
|
-
k(b, {
|
47
|
-
mode: "out-in",
|
48
|
-
name: "TransitionTranslateY"
|
49
|
-
}, {
|
50
|
-
default: g(() => [
|
51
|
-
o.value ? (t(), l("ul", {
|
52
|
-
key: 0,
|
53
|
-
class: _([e.$attrs.class, "pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"])
|
54
|
-
}, [
|
55
|
-
(t(!0), l(v, null, B(y.value, (c) => (t(), l("li", {
|
56
|
-
onClick: h((j) => C(c), ["stop"])
|
57
|
-
}, [
|
58
|
-
c ? (t(), l("span", $, r(c.name || c), 1)) : u("", !0)
|
59
|
-
], 8, V))), 256))
|
60
|
-
], 2)) : u("", !0)
|
61
|
-
]),
|
62
|
-
_: 1
|
63
|
-
})
|
64
|
-
], 10, N),
|
65
|
-
k(b, {
|
66
|
-
mode: "out-in",
|
67
|
-
name: "fade"
|
68
|
-
}, {
|
69
|
-
default: g(() => [
|
70
|
-
s.validation ? (t(), l("div", z, " * " + r(s.validation.message), 1)) : u("", !0)
|
71
|
-
]),
|
72
|
-
_: 1
|
73
|
-
})
|
74
|
-
], 64);
|
75
|
-
};
|
76
|
-
}
|
77
|
-
}, I = /* @__PURE__ */ M(E, [["__scopeId", "data-v-dfe03dc2"]]);
|
1
|
+
const e = "";
|
78
2
|
export {
|
79
|
-
|
3
|
+
e as default
|
80
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../node_modules/axios/lib/axios.cjs"),
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../node_modules/axios/lib/axios.cjs"),d=require("../../../../../node_modules/js-cookie/src/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/core/dist/index.cjs"),k=require("vue"),n=require("../../globals/store/globals.cjs"),g=require("./twofa.cjs"),i=w.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=k.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function O(){const e=await P("user");if(console.log("user cookie is "+e),e){const{_id:t,email:s,phone:c,roles:r,accessToken:o}=e;Object.assign(a.user,{_id:t,email:s,phone:c}),Object.assign(a.access,{token:o,roles:r,status:!!o}),i.interceptors.request.use(u=>(o&&(u.headers["x-access-token"]=o),u),u=>Promise.reject(u))}}O();const f={async login(e,t){try{const s=await i.post("/api/auth/signin",{...e,type:t});return p("user",s.data),Object.assign(a.user,{...s.data}),Object.assign(a.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(a.access,{token:null,status:!1,roles:null}),n.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:c,passwordRepeat:r}=a.user;if(c!==r){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(o),new Error(o.response.status)}try{e.phone=e.phone.number;const o=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return o.data.accessToken&&p("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0,roles:o.data.roles}),o.data}catch(o){throw n.setError(o),console.log("Sign up falied"),o}},logout(){b("user"),Object.assign(a.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(a.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await i.post("/api/auth/reset-password",{email:e.email,phone:e.phone.number,type:t});return Object.assign(g.state.code,{...s.data,isSended:!0}),s.data}catch(s){return n.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:c}=a.user;if(s!==c){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(r),new Error(r.response.status)}try{const r=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone.number,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return r.data.accessToken&&p("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0}),r.data}catch(r){return n.setError(r),Promise.reject(r)}}},h={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};async function P(e){if(process.env.MOBILE_APP){const t=await l.CapacitorCookies.getCookies();return console.log("capacitor cookie is "+t),t?JSON.parse(t[e]):null}else{const t=d.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.NODE_ENV){process.env.MOBILE_APP?l.CapacitorCookies.setCookie({url:process.env.API_URL,key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),h[s])}function b(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.CapacitorCookies.deleteCookie({url:process.env.API_URL,key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};d.default.remove(e,s)}}k.watch(a,(e,t)=>{});exports.actions=f;exports.state=a;
|