@ozdao/prometheus-framework 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-561d6db3.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-9e474158.mjs +1945 -0
- package/dist/ButtonFollow-38d9a720.mjs +131 -0
- package/dist/ButtonFollow-9a33ab06.js +1 -0
- package/dist/CardOrganization-3049931d.mjs +230 -0
- package/dist/CardOrganization-8b376cbb.js +1 -0
- package/dist/Chips-03ff0c34.mjs +108 -0
- package/dist/Chips-4d8ac62e.js +1 -0
- package/dist/Feed-1d0d9853.js +1 -0
- package/dist/Feed-79839e67.mjs +368 -0
- package/dist/Feed-af94027c.js +1 -0
- package/dist/Feed-b616f102.mjs +439 -0
- package/dist/Image-75f5becb.js +9 -0
- package/dist/Image-be69af9c.mjs +477 -0
- package/dist/Popup-d7dbc670.mjs +76 -0
- package/dist/Popup-ee4bd834.js +1 -0
- package/dist/Product-8bee8d1c.mjs +838 -0
- package/dist/Product-a39f3ca3.js +7 -0
- package/dist/ProductEdit-052b0aef.mjs +350 -0
- package/dist/ProductEdit-a322f1ba.js +1 -0
- package/dist/ProfileBlogposts-08f784c3.mjs +64 -0
- package/dist/ProfileBlogposts-d6bba033.js +1 -0
- package/dist/ProfileComments-96f6cde8.mjs +44 -0
- package/dist/ProfileComments-dd923865.js +1 -0
- package/dist/ProfileEvents-1e0c1291.js +1 -0
- package/dist/ProfileEvents-26a72fe2.mjs +56 -0
- package/dist/ProfileLikes-b1060d1e.js +1 -0
- package/dist/ProfileLikes-c8dab14d.mjs +44 -0
- package/dist/ProfileOrganizations-3a879480.mjs +212 -0
- package/dist/ProfileOrganizations-78fef72e.js +1 -0
- package/dist/Publics-8bb9a680.js +1 -0
- package/dist/Publics-ffc08ad7.mjs +123 -0
- package/dist/UploadImage-6344f789.js +1 -0
- package/dist/UploadImage-f04e4bc0.mjs +83 -0
- package/dist/auth-60c81f40.mjs +1836 -0
- package/dist/auth-e8f6d979.js +8 -0
- package/dist/auth.client.cjs +4 -4
- package/dist/auth.client.js +247 -236
- package/dist/auth.server.js +72 -11
- package/dist/auth.server.mjs +72 -11
- package/dist/auth.validation-1d5f2990.mjs +20 -0
- package/dist/auth.validation-2dfb450f.js +1 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +11 -11
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +9 -9
- package/dist/organizations-4157d81d.js +1 -0
- package/dist/organizations-52438d24.mjs +121 -0
- package/dist/organizations.client-16ee6b43.js +3 -0
- package/dist/organizations.client-cdbaf6aa.mjs +3017 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +11 -11
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +258 -239
- package/dist/users.server.js +7 -0
- package/dist/users.server.mjs +7 -0
- package/package.json +1 -1
- package/src/components/CardHeader/CardHeader.vue +2 -1
- package/src/modules/auth/components/pages/SignIn.vue +48 -39
- package/src/modules/auth/controllers/auth.controller.js +42 -11
- package/src/modules/auth/store/auth.js +3 -10
- package/src/modules/auth/utils/server/verifyAppleIdToken.js +57 -0
- package/src/modules/users/components/pages/Profile.vue +20 -6
- package/src/modules/users/components/pages/ProfileEdit.vue +15 -5
- package/src/modules/users/models/user.model.js +9 -1
- package/src/modules/users/store/users.js +2 -1
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";const u=require("vue"),qt=require("./_plugin-vue_export-helper-f246444f.js"),M=require("./globals-928eb13c.js");const It={key:0,class:"t-transp mn-r-small"},Ft={class:"w-100"},Vt=["type","value","placeholder"],Mt=["value","placeholder"],Ht={key:0,class:"mn-t-thin mn-thin mn-b-thin invalid-feedback"},Wt={__name:"Field",props:{label:null,type:"text",placeholder:"Enter something here",field:null,validation:!1,disabled:!1},emits:["update:field","focus","blur"],setup(t,{emit:e}){const r=t,s=u.ref(r.field);return(n,a)=>(u.openBlock(),u.createElementBlock(u.Fragment,null,[u.createElementVNode("div",{class:u.normalizeClass([[n.$attrs.class,{"bg-fourth-nano":t.validation}],"flex-center flex-nowrap flex"])},[t.label?(u.openBlock(),u.createElementBlock("div",It,[u.createElementVNode("span",null,u.toDisplayString(t.label),1)])):u.createCommentVNode("",!0),u.createElementVNode("div",Ft,[t.type!=="textarea"?(u.openBlock(),u.createElementBlock("input",{key:0,onInput:a[0]||(a[0]=o=>s.value=e("update:field",o.target.value)),onFocus:a[1]||(a[1]=o=>e("focus",o)),onBlur:a[2]||(a[2]=o=>e("blur",o)),type:t.type,class:"w-100",value:t.field,placeholder:t.placeholder},null,40,Vt)):(u.openBlock(),u.createElementBlock("textarea",{key:1,onInput:a[3]||(a[3]=o=>s.value=e("update:field",o.target.value)),onFocus:a[4]||(a[4]=o=>e("focus",o)),onBlur:a[5]||(a[5]=o=>e("blur",o)),class:"w-100",value:t.field,placeholder:t.placeholder},null,40,Mt))])],2),u.createVNode(u.Transition,{name:"fade"},{default:u.withCtx(()=>[t.validation?(u.openBlock(),u.createElementBlock("div",Ht," * "+u.toDisplayString(t.validation.message),1)):u.createCommentVNode("",!0)]),_:1})],64))}},Jt=qt._export_sfc(Wt,[["__scopeId","data-v-deecbd0c"]]);const zt=["onClick","disabled"],Kt={key:0},Gt={key:0,class:"loading"},Xt=u.createElementVNode("span",null,[u.createElementVNode("svg",{class:"i-small",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[u.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[u.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),u.createTextVNode(),u.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),u.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[u.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),u.createTextVNode(),u.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),u.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[u.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),u.createTextVNode(),u.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),u.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[u.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),u.createTextVNode(),u.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),u.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[u.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),u.createTextVNode(),u.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])])],-1),Qt=[Xt],Yt={key:0,class:"h4 loading"},Zt=u.createElementVNode("span",{class:"p-small t-white"},"✔",-1),er=[Zt],tr={key:0,class:"error"},rr={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},validation:{type:Boolean,default:!1}},setup(t){const e=t,r=u.ref(null),s=u.ref(null),n=u.ref(!1),a=u.ref(!1);async function o(){r.value.style["pointer-events"]="none",s.value=null,n.value=!0;try{await e.submit(),r.value.classList.replace("bg-main","bg-light-main"),n.value=!1,a.value=!0,setTimeout(()=>{r.value&&(r.value.classList.replace("bg-light-main","bg-main"),r.value.style.pointerEvents="auto",n.value=!1,a.value=!1,s.value=null)},500),e.callback&&setTimeout(()=>e.callback(),e.callbackDelay)}catch{r.value.classList.replace("bg-main","bg-fourth-nano"),s.value="❌",setTimeout(()=>{r.value.classList.replace("bg-fourth-nano","bg-main"),r.value.style.pointerEvents="auto",n.value=!1,a.value=!1,s.value=null},1330)}}return(i,l)=>(u.openBlock(),u.createElementBlock("button",{onClick:u.withModifiers(o,["stop"]),disabled:t.validation,ref_key:"button",ref:r,class:"w-100 bg-main button"},[u.createVNode(u.Transition,{mode:"out-in",name:"fadeIn"},{default:u.withCtx(()=>[!n.value&&!s.value&&!a.value?(u.openBlock(),u.createElementBlock("span",Kt,[u.renderSlot(i.$slots,"default")])):u.createCommentVNode("",!0)]),_:3}),u.createVNode(u.Transition,{mode:"out-in",name:"fadeIn"},{default:u.withCtx(()=>[n.value&&!s.value?(u.openBlock(),u.createElementBlock("div",Gt,Qt)):u.createCommentVNode("",!0)]),_:1}),u.createVNode(u.Transition,{mode:"out-in",name:"fadeIn"},{default:u.withCtx(()=>[a.value?(u.openBlock(),u.createElementBlock("div",Yt,er)):u.createCommentVNode("",!0)]),_:1}),u.createVNode(u.Transition,{mode:"out-in",name:"fadeIn"},{default:u.withCtx(()=>[s.value?(u.openBlock(),u.createElementBlock("div",tr,[u.createElementVNode("span",null,u.toDisplayString(s.value),1)])):u.createCommentVNode("",!0)]),_:1})],8,zt))}};function Le(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ue={exports:{}},mt=function(e,r){return function(){for(var n=new Array(arguments.length),a=0;a<n.length;a++)n[a]=arguments[a];return e.apply(r,n)}},nr=mt,Be=Object.prototype.toString,De=function(t){return function(e){var r=Be.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function H(t){return t=t.toLowerCase(),function(r){return De(r)===t}}function je(t){return Array.isArray(t)}function ie(t){return typeof t>"u"}function ar(t){return t!==null&&!ie(t)&&t.constructor!==null&&!ie(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}var vt=H("ArrayBuffer");function sr(t){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&vt(t.buffer),e}function or(t){return typeof t=="string"}function ir(t){return typeof t=="number"}function wt(t){return t!==null&&typeof t=="object"}function se(t){if(De(t)!=="object")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}var ur=H("Date"),lr=H("File"),cr=H("Blob"),dr=H("FileList");function $e(t){return Be.call(t)==="[object Function]"}function fr(t){return wt(t)&&$e(t.pipe)}function pr(t){var e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||Be.call(t)===e||$e(t.toString)&&t.toString()===e)}var hr=H("URLSearchParams");function mr(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function vr(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function qe(t,e){if(!(t===null||typeof t>"u"))if(typeof t!="object"&&(t=[t]),je(t))for(var r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}function Te(){var t={};function e(n,a){se(t[a])&&se(n)?t[a]=Te(t[a],n):se(n)?t[a]=Te({},n):je(n)?t[a]=n.slice():t[a]=n}for(var r=0,s=arguments.length;r<s;r++)qe(arguments[r],e);return t}function wr(t,e,r){return qe(e,function(n,a){r&&typeof n=="function"?t[a]=nr(n,r):t[a]=n}),t}function br(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}function yr(t,e,r,s){t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)}function gr(t,e,r){var s,n,a,o={};e=e||{};do{for(s=Object.getOwnPropertyNames(t),n=s.length;n-- >0;)a=s[n],o[a]||(e[a]=t[a],o[a]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e}function Er(t,e,r){t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;var s=t.indexOf(e,r);return s!==-1&&s===r}function Cr(t){if(!t)return null;var e=t.length;if(ie(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r}var Pr=function(t){return function(e){return t&&e instanceof t}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),E={isArray:je,isArrayBuffer:vt,isBuffer:ar,isFormData:pr,isArrayBufferView:sr,isString:or,isNumber:ir,isObject:wt,isPlainObject:se,isUndefined:ie,isDate:ur,isFile:lr,isBlob:cr,isFunction:$e,isStream:fr,isURLSearchParams:hr,isStandardBrowserEnv:vr,forEach:qe,merge:Te,extend:wr,trim:mr,stripBOM:br,inherits:yr,toFlatObject:gr,kindOf:De,kindOfTest:H,endsWith:Er,toArray:Cr,isTypedArray:Pr,isFileList:dr},z=E;function He(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var bt=function(e,r,s){if(!r)return e;var n;if(s)n=s(r);else if(z.isURLSearchParams(r))n=r.toString();else{var a=[];z.forEach(r,function(l,d){l===null||typeof l>"u"||(z.isArray(l)?d=d+"[]":l=[l],z.forEach(l,function(f){z.isDate(f)?f=f.toISOString():z.isObject(f)&&(f=JSON.stringify(f)),a.push(He(d)+"="+He(f))}))}),n=a.join("&")}if(n){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e},Or=E;function le(){this.handlers=[]}le.prototype.use=function(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};le.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};le.prototype.forEach=function(e){Or.forEach(this.handlers,function(s){s!==null&&e(s)})};var Rr=le,xr=E,_r=function(e,r){xr.forEach(e,function(n,a){a!==r&&a.toUpperCase()===r.toUpperCase()&&(e[r]=n,delete e[a])})},yt=E;function G(t,e,r,s,n){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),s&&(this.request=s),n&&(this.response=n)}yt.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var gt=G.prototype,Et={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(t){Et[t]={value:t}});Object.defineProperties(G,Et);Object.defineProperty(gt,"isAxiosError",{value:!0});G.from=function(t,e,r,s,n,a){var o=Object.create(gt);return yt.toFlatObject(t,o,function(l){return l!==Error.prototype}),G.call(o,t.message,e,r,s,n),o.name=t.name,a&&Object.assign(o,a),o};var Z=G,Ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},N=E;function Sr(t,e){e=e||new FormData;var r=[];function s(a){return a===null?"":N.isDate(a)?a.toISOString():N.isArrayBuffer(a)||N.isTypedArray(a)?typeof Blob=="function"?new Blob([a]):Buffer.from(a):a}function n(a,o){if(N.isPlainObject(a)||N.isArray(a)){if(r.indexOf(a)!==-1)throw Error("Circular reference detected in "+o);r.push(a),N.forEach(a,function(l,d){if(!N.isUndefined(l)){var p=o?o+"."+d:d,f;if(l&&!o&&typeof l=="object"){if(N.endsWith(d,"{}"))l=JSON.stringify(l);else if(N.endsWith(d,"[]")&&(f=N.toArray(l))){f.forEach(function(c){!N.isUndefined(c)&&e.append(p,s(c))});return}}n(l,p)}}),r.pop()}else e.append(o,s(a))}return n(t),e}var Pt=Sr,me,We;function Ar(){if(We)return me;We=1;var t=Z;return me=function(r,s,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?r(n):s(new t("Request failed with status code "+n.status,[t.ERR_BAD_REQUEST,t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))},me}var ve,Je;function Nr(){if(Je)return ve;Je=1;var t=E;return ve=t.isStandardBrowserEnv()?function(){return{write:function(s,n,a,o,i,l){var d=[];d.push(s+"="+encodeURIComponent(n)),t.isNumber(a)&&d.push("expires="+new Date(a).toGMTString()),t.isString(o)&&d.push("path="+o),t.isString(i)&&d.push("domain="+i),l===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(s){var n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),ve}var kr=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Tr=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e},Lr=kr,Ur=Tr,Ot=function(e,r){return e&&!Lr(r)?Ur(e,r):r},we,ze;function Br(){if(ze)return we;ze=1;var t=E,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return we=function(s){var n={},a,o,i;return s&&t.forEach(s.split(`
|
2
|
+
`),function(d){if(i=d.indexOf(":"),a=t.trim(d.substr(0,i)).toLowerCase(),o=t.trim(d.substr(i+1)),a){if(n[a]&&e.indexOf(a)>=0)return;a==="set-cookie"?n[a]=(n[a]?n[a]:[]).concat([o]):n[a]=n[a]?n[a]+", "+o:o}}),n},we}var be,Ke;function Dr(){if(Ke)return be;Ke=1;var t=E;return be=t.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),n;function a(o){var i=o;return r&&(s.setAttribute("href",i),i=s.href),s.setAttribute("href",i),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=a(window.location.href),function(i){var l=t.isString(i)?a(i):i;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}(),be}var ye,Ge;function ce(){if(Ge)return ye;Ge=1;var t=Z,e=E;function r(s){t.call(this,s??"canceled",t.ERR_CANCELED),this.name="CanceledError"}return e.inherits(r,t,{__CANCEL__:!0}),ye=r,ye}var ge,Xe;function jr(){return Xe||(Xe=1,ge=function(e){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}),ge}var Ee,Qe;function Ye(){if(Qe)return Ee;Qe=1;var t=E,e=Ar(),r=Nr(),s=bt,n=Ot,a=Br(),o=Dr(),i=Ct,l=Z,d=ce(),p=jr();return Ee=function(c){return new Promise(function(_,y){var S=c.data,k=c.headers,V=c.responseType,j;function W(){c.cancelToken&&c.cancelToken.unsubscribe(j),c.signal&&c.signal.removeEventListener("abort",j)}t.isFormData(S)&&t.isStandardBrowserEnv()&&delete k["Content-Type"];var h=new XMLHttpRequest;if(c.auth){var pe=c.auth.username||"",w=c.auth.password?unescape(encodeURIComponent(c.auth.password)):"";k.Authorization="Basic "+btoa(pe+":"+w)}var m=n(c.baseURL,c.url);h.open(c.method.toUpperCase(),s(m,c.params,c.paramsSerializer),!0),h.timeout=c.timeout;function B(){if(h){var b="getAllResponseHeaders"in h?a(h.getAllResponseHeaders()):null,$=!V||V==="text"||V==="json"?h.responseText:h.response,D={data:$,status:h.status,statusText:h.statusText,headers:b,config:c,request:h};e(function(J){_(J),W()},function(J){y(J),W()},D),h=null}}if("onloadend"in h?h.onloadend=B:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(B)},h.onabort=function(){h&&(y(new l("Request aborted",l.ECONNABORTED,c,h)),h=null)},h.onerror=function(){y(new l("Network Error",l.ERR_NETWORK,c,h,h)),h=null},h.ontimeout=function(){var $=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",D=c.transitional||i;c.timeoutErrorMessage&&($=c.timeoutErrorMessage),y(new l($,D.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,c,h)),h=null},t.isStandardBrowserEnv()){var T=(c.withCredentials||o(m))&&c.xsrfCookieName?r.read(c.xsrfCookieName):void 0;T&&(k[c.xsrfHeaderName]=T)}"setRequestHeader"in h&&t.forEach(k,function($,D){typeof S>"u"&&D.toLowerCase()==="content-type"?delete k[D]:h.setRequestHeader(D,$)}),t.isUndefined(c.withCredentials)||(h.withCredentials=!!c.withCredentials),V&&V!=="json"&&(h.responseType=c.responseType),typeof c.onDownloadProgress=="function"&&h.addEventListener("progress",c.onDownloadProgress),typeof c.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",c.onUploadProgress),(c.cancelToken||c.signal)&&(j=function(b){h&&(y(!b||b&&b.type?new d:b),h.abort(),h=null)},c.cancelToken&&c.cancelToken.subscribe(j),c.signal&&(c.signal.aborted?j():c.signal.addEventListener("abort",j))),S||(S=null);var L=p(m);if(L&&["http","https","file"].indexOf(L)===-1){y(new l("Unsupported protocol "+L+":",l.ERR_BAD_REQUEST,c));return}h.send(S)})},Ee}var Ce,Ze;function $r(){return Ze||(Ze=1,Ce=null),Ce}var g=E,et=_r,tt=Z,qr=Ct,Ir=Pt,Fr={"Content-Type":"application/x-www-form-urlencoded"};function rt(t,e){!g.isUndefined(t)&&g.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Vr(){var t;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(t=Ye()),t}function Mr(t,e,r){if(g.isString(t))try{return(e||JSON.parse)(t),g.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var de={transitional:qr,adapter:Vr(),transformRequest:[function(e,r){if(et(r,"Accept"),et(r,"Content-Type"),g.isFormData(e)||g.isArrayBuffer(e)||g.isBuffer(e)||g.isStream(e)||g.isFile(e)||g.isBlob(e))return e;if(g.isArrayBufferView(e))return e.buffer;if(g.isURLSearchParams(e))return rt(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=g.isObject(e),n=r&&r["Content-Type"],a;if((a=g.isFileList(e))||s&&n==="multipart/form-data"){var o=this.env&&this.env.FormData;return Ir(a?{"files[]":e}:e,o&&new o)}else if(s||n==="application/json")return rt(r,"application/json"),Mr(e);return e}],transformResponse:[function(e){var r=this.transitional||de.transitional,s=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,a=!s&&this.responseType==="json";if(a||n&&g.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?tt.from(o,tt.ERR_BAD_RESPONSE,this,null,this.response):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$r()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};g.forEach(["delete","get","head"],function(e){de.headers[e]={}});g.forEach(["post","put","patch"],function(e){de.headers[e]=g.merge(Fr)});var Ie=de,Hr=E,Wr=Ie,Jr=function(e,r,s){var n=this||Wr;return Hr.forEach(s,function(o){e=o.call(n,e,r)}),e},Pe,nt;function Rt(){return nt||(nt=1,Pe=function(e){return!!(e&&e.__CANCEL__)}),Pe}var at=E,Oe=Jr,zr=Rt(),Kr=Ie,Gr=ce();function Re(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Gr}var Xr=function(e){Re(e),e.headers=e.headers||{},e.data=Oe.call(e,e.data,e.headers,e.transformRequest),e.headers=at.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),at.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var r=e.adapter||Kr.adapter;return r(e).then(function(n){return Re(e),n.data=Oe.call(e,n.data,n.headers,e.transformResponse),n},function(n){return zr(n)||(Re(e),n&&n.response&&(n.response.data=Oe.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})},x=E,xt=function(e,r){r=r||{};var s={};function n(p,f){return x.isPlainObject(p)&&x.isPlainObject(f)?x.merge(p,f):x.isPlainObject(f)?x.merge({},f):x.isArray(f)?f.slice():f}function a(p){if(x.isUndefined(r[p])){if(!x.isUndefined(e[p]))return n(void 0,e[p])}else return n(e[p],r[p])}function o(p){if(!x.isUndefined(r[p]))return n(void 0,r[p])}function i(p){if(x.isUndefined(r[p])){if(!x.isUndefined(e[p]))return n(void 0,e[p])}else return n(void 0,r[p])}function l(p){if(p in r)return n(e[p],r[p]);if(p in e)return n(void 0,e[p])}var d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l};return x.forEach(Object.keys(e).concat(Object.keys(r)),function(f){var c=d[f]||a,v=c(f);x.isUndefined(v)&&c!==l||(s[f]=v)}),s},xe,st;function _t(){return st||(st=1,xe={version:"0.27.2"}),xe}var Qr=_t().version,F=Z,Fe={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){Fe[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});var ot={};Fe.transitional=function(e,r,s){function n(a,o){return"[Axios v"+Qr+"] Transitional option '"+a+"'"+o+(s?". "+s:"")}return function(a,o,i){if(e===!1)throw new F(n(o," has been removed"+(r?" in "+r:"")),F.ERR_DEPRECATED);return r&&!ot[o]&&(ot[o]=!0,console.warn(n(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,o,i):!0}};function Yr(t,e,r){if(typeof t!="object")throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(t),n=s.length;n-- >0;){var a=s[n],o=e[a];if(o){var i=t[a],l=i===void 0||o(i,a,t);if(l!==!0)throw new F("option "+a+" must be "+l,F.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new F("Unknown option "+a,F.ERR_BAD_OPTION)}}var Zr={assertOptions:Yr,validators:Fe},St=E,en=bt,it=Rr,ut=Xr,fe=xt,tn=Ot,At=Zr,K=At.validators;function X(t){this.defaults=t,this.interceptors={request:new it,response:new it}}X.prototype.request=function(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=fe(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var s=r.transitional;s!==void 0&&At.assertOptions(s,{silentJSONParsing:K.transitional(K.boolean),forcedJSONParsing:K.transitional(K.boolean),clarifyTimeoutError:K.transitional(K.boolean)},!1);var n=[],a=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(r)===!1||(a=a&&v.synchronous,n.unshift(v.fulfilled,v.rejected))});var o=[];this.interceptors.response.forEach(function(v){o.push(v.fulfilled,v.rejected)});var i;if(!a){var l=[ut,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(o),i=Promise.resolve(r);l.length;)i=i.then(l.shift(),l.shift());return i}for(var d=r;n.length;){var p=n.shift(),f=n.shift();try{d=p(d)}catch(c){f(c);break}}try{i=ut(d)}catch(c){return Promise.reject(c)}for(;o.length;)i=i.then(o.shift(),o.shift());return i};X.prototype.getUri=function(e){e=fe(this.defaults,e);var r=tn(e.baseURL,e.url);return en(r,e.params,e.paramsSerializer)};St.forEach(["delete","get","head","options"],function(e){X.prototype[e]=function(r,s){return this.request(fe(s||{},{method:e,url:r,data:(s||{}).data}))}});St.forEach(["post","put","patch"],function(e){function r(s){return function(a,o,i){return this.request(fe(i||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}X.prototype[e]=r(),X.prototype[e+"Form"]=r(!0)});var rn=X,_e,lt;function nn(){if(lt)return _e;lt=1;var t=ce();function e(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(o){s=o});var n=this;this.promise.then(function(a){if(n._listeners){var o,i=n._listeners.length;for(o=0;o<i;o++)n._listeners[o](a);n._listeners=null}}),this.promise.then=function(a){var o,i=new Promise(function(l){n.subscribe(l),o=l}).then(a);return i.cancel=function(){n.unsubscribe(o)},i},r(function(o){n.reason||(n.reason=new t(o),s(n.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]},e.prototype.unsubscribe=function(s){if(this._listeners){var n=this._listeners.indexOf(s);n!==-1&&this._listeners.splice(n,1)}},e.source=function(){var s,n=new e(function(o){s=o});return{token:n,cancel:s}},_e=e,_e}var Se,ct;function an(){return ct||(ct=1,Se=function(e){return function(s){return e.apply(null,s)}}),Se}var Ae,dt;function sn(){if(dt)return Ae;dt=1;var t=E;return Ae=function(r){return t.isObject(r)&&r.isAxiosError===!0},Ae}var ft=E,on=mt,oe=rn,un=xt,ln=Ie;function Nt(t){var e=new oe(t),r=on(oe.prototype.request,e);return ft.extend(r,oe.prototype,e),ft.extend(r,e),r.create=function(n){return Nt(un(t,n))},r}var R=Nt(ln);R.Axios=oe;R.CanceledError=ce();R.CancelToken=nn();R.isCancel=Rt();R.VERSION=_t().version;R.toFormData=Pt;R.AxiosError=Z;R.Cancel=R.CanceledError;R.all=function(e){return Promise.all(e)};R.spread=an();R.isAxiosError=sn();Ue.exports=R;Ue.exports.default=R;var cn=Ue.exports,dn=cn;const Ve=Le(dn);var kt={exports:{}};/*!
|
3
|
+
* JavaScript Cookie v2.2.1
|
4
|
+
* https://github.com/js-cookie/js-cookie
|
5
|
+
*
|
6
|
+
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
7
|
+
* Released under the MIT license
|
8
|
+
*/(function(t,e){(function(r){var s;if(t.exports=r(),s=!0,!s){var n=window.Cookies,a=window.Cookies=r();a.noConflict=function(){return window.Cookies=n,a}}})(function(){function r(){for(var a=0,o={};a<arguments.length;a++){var i=arguments[a];for(var l in i)o[l]=i[l]}return o}function s(a){return a.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function n(a){function o(){}function i(d,p,f){if(!(typeof document>"u")){f=r({path:"/"},o.defaults,f),typeof f.expires=="number"&&(f.expires=new Date(new Date*1+f.expires*864e5)),f.expires=f.expires?f.expires.toUTCString():"";try{var c=JSON.stringify(p);/^[\{\[]/.test(c)&&(p=c)}catch{}p=a.write?a.write(p,d):encodeURIComponent(String(p)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),d=encodeURIComponent(String(d)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var v="";for(var _ in f)f[_]&&(v+="; "+_,f[_]!==!0&&(v+="="+f[_].split(";")[0]));return document.cookie=d+"="+p+v}}function l(d,p){if(!(typeof document>"u")){for(var f={},c=document.cookie?document.cookie.split("; "):[],v=0;v<c.length;v++){var _=c[v].split("="),y=_.slice(1).join("=");!p&&y.charAt(0)==='"'&&(y=y.slice(1,-1));try{var S=s(_[0]);if(y=(a.read||a)(y,S)||s(y),p)try{y=JSON.parse(y)}catch{}if(f[S]=y,d===S)break}catch{}}return d?f[d]:f}}return o.set=i,o.get=function(d){return l(d,!1)},o.getJSON=function(d){return l(d,!0)},o.remove=function(d,p){i(d,"",r(p,{expires:-1}))},o.defaults={},o.withConverter=n,o}return n(function(){})})})(kt);var fn=kt.exports;const re=Le(fn);/*! Capacitor: https://capacitorjs.com/ - MIT License */const pn=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},s=(a,o)=>{r.platforms.set(a,o)},n=a=>{r.platforms.has(a)&&(r.currentPlatform=r.platforms.get(a))};return r.addPlatform=s,r.setPlatform=n,r},hn=t=>t.CapacitorPlatforms=pn(t),Tt=hn(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Tt.addPlatform;Tt.setPlatform;var Q;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(Q||(Q={}));class Ne extends Error{constructor(e,r,s){super(e),this.message=e,this.code=r,this.data=s}}const mn=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"},vn=t=>{var e,r,s,n,a;const o=t.CapacitorCustomPlatform||null,i=t.Capacitor||{},l=i.Plugins=i.Plugins||{},d=t.CapacitorPlatforms,p=()=>o!==null?o.name:mn(t),f=((e=d==null?void 0:d.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||p,c=()=>f()!=="web",v=((r=d==null?void 0:d.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||c,_=w=>{const m=W.get(w);return!!(m!=null&&m.platforms.has(f())||k(w))},y=((s=d==null?void 0:d.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||_,S=w=>{var m;return(m=i.PluginHeaders)===null||m===void 0?void 0:m.find(B=>B.name===w)},k=((n=d==null?void 0:d.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||S,V=w=>t.console.error(w),j=(w,m,B)=>Promise.reject(`${B} does not have an implementation of "${m}".`),W=new Map,h=(w,m={})=>{const B=W.get(w);if(B)return console.warn(`Capacitor plugin "${w}" already registered. Cannot register plugins twice.`),B.proxy;const T=f(),L=k(w);let b;const $=async()=>(!b&&T in m?b=typeof m[T]=="function"?b=await m[T]():b=m[T]:o!==null&&!b&&"web"in m&&(b=typeof m.web=="function"?b=await m.web():b=m.web),b),D=(C,O)=>{var U,q;if(L){const I=L==null?void 0:L.methods.find(A=>O===A.name);if(I)return I.rtype==="promise"?A=>i.nativePromise(w,O.toString(),A):(A,ne)=>i.nativeCallback(w,O.toString(),A,ne);if(C)return(U=C[O])===null||U===void 0?void 0:U.bind(C)}else{if(C)return(q=C[O])===null||q===void 0?void 0:q.bind(C);throw new Ne(`"${w}" plugin is not implemented on ${T}`,Q.Unimplemented)}},ee=C=>{let O;const U=(...q)=>{const I=$().then(A=>{const ne=D(A,C);if(ne){const ae=ne(...q);return O=ae==null?void 0:ae.remove,ae}else throw new Ne(`"${w}.${C}()" is not implemented on ${T}`,Q.Unimplemented)});return C==="addListener"&&(I.remove=async()=>O()),I};return U.toString=()=>`${C.toString()}() { [capacitor code] }`,Object.defineProperty(U,"name",{value:C,writable:!1,configurable:!1}),U},J=ee("addListener"),Me=ee("removeListener"),$t=(C,O)=>{const U=J({eventName:C},O),q=async()=>{const A=await U;Me({eventName:C,callbackId:A},O)},I=new Promise(A=>U.then(()=>A({remove:q})));return I.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await q()},I},he=new Proxy({},{get(C,O){switch(O){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return L?$t:J;case"removeListener":return Me;default:return ee(O)}}});return l[w]=he,W.set(w,{name:w,proxy:he,platforms:new Set([...Object.keys(m),...L?[T]:[]])}),he},pe=((a=d==null?void 0:d.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||h;return i.convertFileSrc||(i.convertFileSrc=w=>w),i.getPlatform=f,i.handleError=V,i.isNativePlatform=v,i.isPluginAvailable=y,i.pluginMethodNoop=j,i.registerPlugin=pe,i.Exception=Ne,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},wn=t=>t.Capacitor=vn(t),ue=wn(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Lt=ue.registerPlugin;ue.Plugins;class Ut{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 a=async()=>this.removeListener(e,r),o=Promise.resolve({remove:a});return Object.defineProperty(o,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await a()}}),o}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const s=this.listeners[e];s&&s.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:s=>{this.notifyListeners(r,s)}}}unimplemented(e="not implemented"){return new ue.Exception(e,Q.Unimplemented)}unavailable(e="not available"){return new ue.Exception(e,Q.Unavailable)}async removeListener(e,r){const s=this.listeners[e];if(!s)return;const n=s.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 pt=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ht=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class bn extends Ut{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(s=>{if(s.length<=0)return;let[n,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=ht(n).trim(),a=ht(a).trim(),r[n]=a}),r}async setCookie(e){try{const r=pt(e.key),s=pt(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,a=(e.path||"/").replace("path=",""),o=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${s||""}${n}; path=${a}; ${o};`}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 Bt=Lt("CapacitorCookies",{web:()=>new bn}),yn=async t=>new Promise((e,r)=>{const s=new FileReader;s.onload=()=>{const n=s.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},s.onerror=n=>r(n),s.readAsDataURL(t)}),gn=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,a,o)=>(n[a]=t[e[o]],n),{})},En=(t,e=!0)=>t?Object.entries(t).reduce((s,n)=>{const[a,o]=n;let i,l;return Array.isArray(o)?(l="",o.forEach(d=>{i=e?encodeURIComponent(d):d,l+=`${a}=${i}&`}),l.slice(0,-1)):(i=e?encodeURIComponent(o):o,l=`${a}=${i}`),`${s}&${l}`},"").substr(1):null,Cn=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=gn(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[o,i]of Object.entries(t.data||{}))a.set(o,i);r.body=a.toString()}else if(n.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((i,l)=>{a.append(l,i)});else for(const i of Object.keys(t.data))a.append(i,t.data[i]);r.body=a;const o=new Headers(r.headers);o.delete("content-type"),r.headers=o}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class Pn extends Ut{async request(e){const r=Cn(e,e.webFetchExtra),s=En(e.params,e.shouldEncodeUrlParams),n=s?`${e.url}?${s}`:e.url,a=await fetch(n,r),o=a.headers.get("content-type")||"";let{responseType:i="text"}=a.ok?e:{};o.includes("application/json")&&(i="json");let l,d;switch(i){case"arraybuffer":case"blob":d=await a.blob(),l=await yn(d);break;case"json":l=await a.json();break;case"document":case"text":default:l=await a.text()}const p={};return a.headers.forEach((f,c)=>{p[c]=f}),{data:l,headers:p,status:a.status,url:a.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"}))}}Lt("CapacitorHttp",{web:()=>new Pn});const On=Ve.create({baseURL:process.env.API_URL,withCredentials:!0}),Y=u.reactive({code:{value:"",type:"",method:"",isSended:!1,isValid:!1}});async function Dt(t,e,r){return await On.post("/api/twofa/sendcode",{phone:t.phone.number,email:t.email,method:e,type:r}).then(s=>(Y.code=s.data,Y.code.isSended=!0,Promise.resolve(s.data)),s=>(console.log(s),M.setError(s),Promise.reject(s)))}u.watch(Y,(t,e)=>{});const Rn=Object.freeze(Object.defineProperty({__proto__:null,sendCode:Dt,state:Y},Symbol.toStringTag,{value:"Module"})),te=Ve.create({baseURL:process.env.API_URL,withCredentials:!0}),P=u.reactive({user:{_id:"",username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});if(re.get("user")){const{_id:t,email:e,phone:r,roles:s,accessToken:n}=JSON.parse(re.get("user"));Object.assign(P.user,{_id:t,email:e,phone:r}),Object.assign(P.access,{token:n,roles:s,status:!!n}),te.interceptors.request.use(a=>(n&&(a.headers["x-access-token"]=n),a),a=>Promise.reject(a))}const jt={async login(t,e){try{const r=await te.post("/api/auth/signin",{...t,type:e});return ke("user",r.data),Object.assign(P.user,{...r.data}),Object.assign(P.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){return Object.assign(P.access,{token:null,status:!1,roles:null}),M.setError(r),Promise.reject(r)}},async signup(t,e,r){const{password:s,passwordRepeat:n}=P.user;if(s!==n){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw M.setError(a),new Error(a.response.status)}try{t.phone=t.phone.number;const a=await te.post("/api/auth/signup",{...t,type:e,inviteCode:r});return a.data.accessToken&&ke("user",a.data),Object.assign(P.user,{...a.data}),Object.assign(P.access,{token:a.data.accessToken,status:!0,roles:a.data.roles}),a.data}catch(a){throw M.setError(a),console.log("Sign up falied"),a}},logout(){_n("user"),Object.assign(P.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(P.access,{token:null,status:!1})},async resetPassword(t,e){try{const r=await te.post("/api/auth/reset-password",{email:t.email,phone:t.phone.number,type:e});return Object.assign(Y.code,{...r.data,isSended:!0}),r.data}catch(r){return M.setError(r),Promise.reject(r)}},async updatePassword(t,e){const{password:r,passwordRepeat:s}=P.user;if(r!==s){const n={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw M.setError(n),new Error(n.response.status)}try{const n=await te.post("/api/auth/update-password",{email:t.email,phone:t.phone.number,password:t.password,passwordRepeat:t.passwordRepeat,type:e});return n.data.accessToken&&ke("user",n.data),Object.assign(P.user,{...n.data}),Object.assign(P.access,{token:n.data.accessToken,status:!0}),n.data}catch(n){return M.setError(n),Promise.reject(n)}}},xn={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function ke(t,e,r=process.env.NODE_ENV){process.env.MOBILE_APP?Bt.setCookie({url:process.env.API_URL,key:t,value:JSON.stringify(e)}):re.set(t,JSON.stringify(e),xn[r])}function _n(t,e=process.env.NODE_ENV){if(process.env.MOBILE_APP)Bt.deleteCookie({url:process.env.API_URL,key:t});else{const r=e==="production"?{domain:process.env.API_URL}:{};re.remove(t,r)}}u.watch(P,(t,e)=>{});const Sn=Object.freeze(Object.defineProperty({__proto__:null,actions:jt,state:P},Symbol.toStringTag,{value:"Module"}));exports.Cookies=re;exports.Field=Jt;exports._sfc_main=rr;exports.actions=jt;exports.auth=Sn;exports.axios=Ve;exports.getDefaultExportFromCjs=Le;exports.sendCode=Dt;exports.state=P;exports.state$1=Y;exports.twofa=Rn;
|