ingeniuscliq-core 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ "use strict";var vt=Object.defineProperty;var It=(t,e,r)=>e in t?vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var C=(t,e,r)=>It(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $e=require("i18next"),He=require("react-i18next"),P=require("react");class Bt{}const Dt=[{id:1,name:"menu.store",route:"/store",isMainAction:!0},{id:2,name:"menu.about",route:"/info"},{id:3,name:"menu.contact",route:"/contact-us"}];function Me(t,e){return function(){return t.apply(e,arguments)}}const{toString:qt}=Object.prototype,{getPrototypeOf:we}=Object,{iterator:oe,toStringTag:ze}=Symbol,ie=(t=>e=>{const r=qt.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),N=t=>(t=t.toLowerCase(),e=>ie(e)===t),ae=t=>e=>typeof e===t,{isArray:q}=Array,V=ae("undefined");function W(t){return t!==null&&!V(t)&&t.constructor!==null&&!V(t.constructor)&&x(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Je=N("ArrayBuffer");function jt(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Je(t.buffer),e}const $t=ae("string"),x=ae("function"),Ke=ae("number"),G=t=>t!==null&&typeof t=="object",Ht=t=>t===!0||t===!1,Y=t=>{if(ie(t)!=="object")return!1;const e=we(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ze in t)&&!(oe in t)},Mt=t=>{if(!G(t)||W(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},zt=N("Date"),Jt=N("File"),Kt=N("Blob"),Vt=N("FileList"),Wt=t=>G(t)&&x(t.pipe),Gt=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||x(t.append)&&((e=ie(t))==="formdata"||e==="object"&&x(t.toString)&&t.toString()==="[object FormData]"))},Xt=N("URLSearchParams"),[Qt,Zt,Yt,er]=["ReadableStream","Request","Response","Headers"].map(N),tr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function X(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,s;if(typeof t!="object"&&(t=[t]),q(t))for(n=0,s=t.length;n<s;n++)e.call(null,t[n],n,t);else{if(W(t))return;const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let c;for(n=0;n<i;n++)c=o[n],e.call(null,t[c],c,t)}}function Ve(t,e){if(W(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n=r.length,s;for(;n-- >0;)if(s=r[n],e===s.toLowerCase())return s;return null}const L=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,We=t=>!V(t)&&t!==L;function he(){const{caseless:t}=We(this)&&this||{},e={},r=(n,s)=>{const o=t&&Ve(e,s)||s;Y(e[o])&&Y(n)?e[o]=he(e[o],n):Y(n)?e[o]=he({},n):q(n)?e[o]=n.slice():e[o]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&X(arguments[n],r);return e}const rr=(t,e,r,{allOwnKeys:n}={})=>(X(e,(s,o)=>{r&&x(s)?t[o]=Me(s,r):t[o]=s},{allOwnKeys:n}),t),nr=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),sr=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},or=(t,e,r,n)=>{let s,o,i;const c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)i=s[o],(!n||n(i,t,e))&&!c[i]&&(e[i]=t[i],c[i]=!0);t=r!==!1&&we(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},ir=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},ar=t=>{if(!t)return null;if(q(t))return t;let e=t.length;if(!Ke(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},cr=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&we(Uint8Array)),ur=(t,e)=>{const n=(t&&t[oe]).call(t);let s;for(;(s=n.next())&&!s.done;){const o=s.value;e.call(t,o[0],o[1])}},lr=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},dr=N("HTMLFormElement"),fr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Te=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),pr=N("RegExp"),Ge=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};X(r,(s,o)=>{let i;(i=e(s,o,t))!==!1&&(n[o]=i||s)}),Object.defineProperties(t,n)},hr=t=>{Ge(t,(e,r)=>{if(x(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(x(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},mr=(t,e)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return q(t)?n(t):n(String(t).split(e)),r},yr=()=>{},Sr=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function gr(t){return!!(t&&x(t.append)&&t[ze]==="FormData"&&t[oe])}const br=t=>{const e=new Array(10),r=(n,s)=>{if(G(n)){if(e.indexOf(n)>=0)return;if(W(n))return n;if(!("toJSON"in n)){e[s]=n;const o=q(n)?[]:{};return X(n,(i,c)=>{const d=r(i,s+1);!V(d)&&(o[c]=d)}),e[s]=void 0,o}}return n};return r(t,0)},Rr=N("AsyncFunction"),wr=t=>t&&(G(t)||x(t))&&x(t.then)&&x(t.catch),Xe=((t,e)=>t?setImmediate:e?((r,n)=>(L.addEventListener("message",({source:s,data:o})=>{s===L&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),L.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",x(L.postMessage)),Er=typeof queueMicrotask<"u"?queueMicrotask.bind(L):typeof process<"u"&&process.nextTick||Xe,Cr=t=>t!=null&&x(t[oe]),a={isArray:q,isArrayBuffer:Je,isBuffer:W,isFormData:Gt,isArrayBufferView:jt,isString:$t,isNumber:Ke,isBoolean:Ht,isObject:G,isPlainObject:Y,isEmptyObject:Mt,isReadableStream:Qt,isRequest:Zt,isResponse:Yt,isHeaders:er,isUndefined:V,isDate:zt,isFile:Jt,isBlob:Kt,isRegExp:pr,isFunction:x,isStream:Wt,isURLSearchParams:Xt,isTypedArray:cr,isFileList:Vt,forEach:X,merge:he,extend:rr,trim:tr,stripBOM:nr,inherits:sr,toFlatObject:or,kindOf:ie,kindOfTest:N,endsWith:ir,toArray:ar,forEachEntry:ur,matchAll:lr,isHTMLForm:dr,hasOwnProperty:Te,hasOwnProp:Te,reduceDescriptors:Ge,freezeMethods:hr,toObjectSet:mr,toCamelCase:fr,noop:yr,toFiniteNumber:Sr,findKey:Ve,global:L,isContextDefined:We,isSpecCompliantForm:gr,toJSONObject:br,isAsyncFn:Rr,isThenable:wr,setImmediate:Xe,asap:Er,isIterable:Cr};function S(t,e,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(S,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Qe=S.prototype,Ze={};["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ze[t]={value:t}});Object.defineProperties(S,Ze);Object.defineProperty(Qe,"isAxiosError",{value:!0});S.from=(t,e,r,n,s,o)=>{const i=Object.create(Qe);return a.toFlatObject(t,i,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),S.call(i,t.message,e,r,n,s),i.cause=t,i.name=t.name,o&&Object.assign(i,o),i};const Tr=null;function me(t){return a.isPlainObject(t)||a.isArray(t)}function Ye(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Oe(t,e,r){return t?t.concat(e).map(function(s,o){return s=Ye(s),!r&&o?"["+s+"]":s}).join(r?".":""):e}function Or(t){return a.isArray(t)&&!t.some(me)}const Ar=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function ce(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,m){return!a.isUndefined(m[p])});const n=r.metaTokens,s=r.visitor||l,o=r.dots,i=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!d&&a.isBlob(h))throw new S("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?d&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,p,m){let E=h;if(h&&!m&&typeof h=="object"){if(a.endsWith(p,"{}"))p=n?p:p.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&Or(h)||(a.isFileList(h)||a.endsWith(p,"[]"))&&(E=a.toArray(h)))return p=Ye(p),E.forEach(function(w,A){!(a.isUndefined(w)||w===null)&&e.append(i===!0?Oe([p],A,o):i===null?p:p+"[]",u(w))}),!1}return me(h)?!0:(e.append(Oe(m,p,o),u(h)),!1)}const f=[],y=Object.assign(Ar,{defaultVisitor:l,convertValue:u,isVisitable:me});function b(h,p){if(!a.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+p.join("."));f.push(h),a.forEach(h,function(E,g){(!(a.isUndefined(E)||E===null)&&s.call(e,E,a.isString(g)?g.trim():g,p,y))===!0&&b(E,p?p.concat(g):[g])}),f.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return b(t),e}function Ae(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Ee(t,e){this._pairs=[],t&&ce(t,this,e)}const et=Ee.prototype;et.append=function(e,r){this._pairs.push([e,r])};et.toString=function(e){const r=e?function(n){return e.call(this,n,Ae)}:Ae;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function _r(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function tt(t,e,r){if(!e)return t;const n=r&&r.encode||_r;a.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(s?o=s(e,r):o=a.isURLSearchParams(e)?e.toString():new Ee(e,r).toString(n),o){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class _e{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(n){n!==null&&e(n)})}}const rt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pr=typeof URLSearchParams<"u"?URLSearchParams:Ee,xr=typeof FormData<"u"?FormData:null,Fr=typeof Blob<"u"?Blob:null,kr={isBrowser:!0,classes:{URLSearchParams:Pr,FormData:xr,Blob:Fr},protocols:["http","https","file","blob","url","data"]},Ce=typeof window<"u"&&typeof document<"u",ye=typeof navigator=="object"&&navigator||void 0,Nr=Ce&&(!ye||["ReactNative","NativeScript","NS"].indexOf(ye.product)<0),Ur=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Lr=Ce&&window.location.href||"http://localhost",vr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ce,hasStandardBrowserEnv:Nr,hasStandardBrowserWebWorkerEnv:Ur,navigator:ye,origin:Lr},Symbol.toStringTag,{value:"Module"})),O={...vr,...kr};function Ir(t,e){return ce(t,new O.classes.URLSearchParams,{visitor:function(r,n,s,o){return O.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Br(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Dr(t){const e={},r=Object.keys(t);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],e[o]=t[o];return e}function nt(t){function e(r,n,s,o){let i=r[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),d=o>=r.length;return i=!i&&a.isArray(s)?s.length:i,d?(a.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),e(r,n,s[i],o)&&a.isArray(s[i])&&(s[i]=Dr(s[i])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const r={};return a.forEachEntry(t,(n,s)=>{e(Br(n),s,r,0)}),r}return null}function qr(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Q={transitional:rt,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return s?JSON.stringify(nt(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ir(e,this.formSerializer).toString();if((c=a.isFileList(e))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return ce(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),qr(e)):e}],transformResponse:[function(e){const r=this.transitional||Q.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(c){if(i)throw c.name==="SyntaxError"?S.from(c,S.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{Q.headers[t]={}});const jr=a.toObjectSet(["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"]),$r=t=>{const e={};let r,n,s;return t&&t.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||e[r]&&jr[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},Pe=Symbol("internals");function J(t){return t&&String(t).trim().toLowerCase()}function ee(t){return t===!1||t==null?t:a.isArray(t)?t.map(ee):String(t)}function Hr(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const Mr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function de(t,e,r,n,s){if(a.isFunction(n))return n.call(this,e,r);if(s&&(e=r),!!a.isString(e)){if(a.isString(n))return e.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(e)}}function zr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Jr(t,e){const r=a.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(s,o,i){return this[n].call(this,e,s,o,i)},configurable:!0})})}let F=class{constructor(e){e&&this.set(e)}set(e,r,n){const s=this;function o(c,d,u){const l=J(d);if(!l)throw new Error("header name must be a non-empty string");const f=a.findKey(s,l);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||d]=ee(c))}const i=(c,d)=>a.forEach(c,(u,l)=>o(u,l,d));if(a.isPlainObject(e)||e instanceof this.constructor)i(e,r);else if(a.isString(e)&&(e=e.trim())&&!Mr(e))i($r(e),r);else if(a.isObject(e)&&a.isIterable(e)){let c={},d,u;for(const l of e){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(d=c[u])?a.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}i(c,r)}else e!=null&&o(r,e,n);return this}get(e,r){if(e=J(e),e){const n=a.findKey(this,e);if(n){const s=this[n];if(!r)return s;if(r===!0)return Hr(s);if(a.isFunction(r))return r.call(this,s,n);if(a.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=J(e),e){const n=a.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||de(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let s=!1;function o(i){if(i=J(i),i){const c=a.findKey(n,i);c&&(!r||de(n,n[c],c,r))&&(delete n[c],s=!0)}}return a.isArray(e)?e.forEach(o):o(e),s}clear(e){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!e||de(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const r=this,n={};return a.forEach(this,(s,o)=>{const i=a.findKey(n,o);if(i){r[i]=ee(s),delete r[o];return}const c=e?zr(o):String(o).trim();c!==o&&delete r[o],r[c]=ee(s),n[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return a.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=e&&a.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[Pe]=this[Pe]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=J(i);n[c]||(Jr(s,i),n[c]=!0)}return a.isArray(e)?e.forEach(o):o(e),this}};F.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(F.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});a.freezeMethods(F);function fe(t,e){const r=this||Q,n=e||r,s=F.from(n.headers);let o=n.data;return a.forEach(t,function(c){o=c.call(r,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function st(t){return!!(t&&t.__CANCEL__)}function j(t,e,r){S.call(this,t??"canceled",S.ERR_CANCELED,e,r),this.name="CanceledError"}a.inherits(j,S,{__CANCEL__:!0});function ot(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new S("Request failed with status code "+r.status,[S.ERR_BAD_REQUEST,S.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Kr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Vr(t,e){t=t||10;const r=new Array(t),n=new Array(t);let s=0,o=0,i;return e=e!==void 0?e:1e3,function(d){const u=Date.now(),l=n[o];i||(i=u),r[s]=d,n[s]=u;let f=o,y=0;for(;f!==s;)y+=r[f++],f=f%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),u-i<e)return;const b=l&&u-l;return b?Math.round(y*1e3/b):void 0}}function Wr(t,e){let r=0,n=1e3/e,s,o;const i=(u,l=Date.now())=>{r=l,s=null,o&&(clearTimeout(o),o=null),t(...u)};return[(...u)=>{const l=Date.now(),f=l-r;f>=n?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},n-f)))},()=>s&&i(s)]}const ne=(t,e,r=3)=>{let n=0;const s=Vr(50,250);return Wr(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,d=i-n,u=s(d),l=i<=c;n=i;const f={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},r)},xe=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Fe=t=>(...e)=>a.asap(()=>t(...e)),Gr=O.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,O.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,Xr=O.hasStandardBrowserEnv?{write(t,e,r,n,s,o){const i=[t+"="+encodeURIComponent(e)];a.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),a.isString(n)&&i.push("path="+n),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Qr(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function it(t,e,r){let n=!Qr(e);return t&&(n||r==!1)?Zr(t,e):e}const ke=t=>t instanceof F?{...t}:t;function I(t,e){e=e||{};const r={};function n(u,l,f,y){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:y},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,f,y){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u,f,y)}else return n(u,l,f,y)}function o(u,l){if(!a.isUndefined(l))return n(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function c(u,l,f){if(f in e)return n(u,l);if(f in t)return n(void 0,u)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken: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:c,headers:(u,l,f)=>s(ke(u),ke(l),f,!0)};return a.forEach(Object.keys({...t,...e}),function(l){const f=d[l]||s,y=f(t[l],e[l],l);a.isUndefined(y)&&f!==c||(r[l]=y)}),r}const at=t=>{const e=I({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=e;e.headers=i=F.from(i),e.url=tt(it(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(a.isFormData(r)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((d=i.getContentType())!==!1){const[u,...l]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(O.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(e)),n||n!==!1&&Gr(e.url))){const u=s&&o&&Xr.read(o);u&&i.set(s,u)}return e},Yr=typeof XMLHttpRequest<"u",en=Yr&&function(t){return new Promise(function(r,n){const s=at(t);let o=s.data;const i=F.from(s.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=s,l,f,y,b,h;function p(){b&&b(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function E(){if(!m)return;const w=F.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),R={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:w,config:t,request:m};ot(function(k){r(k),p()},function(k){n(k),p()},R),m=null}"onloadend"in m?m.onloadend=E:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(E)},m.onabort=function(){m&&(n(new S("Request aborted",S.ECONNABORTED,t,m)),m=null)},m.onerror=function(){n(new S("Network Error",S.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const R=s.transitional||rt;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),n(new S(A,R.clarifyTimeoutError?S.ETIMEDOUT:S.ECONNABORTED,t,m)),m=null},o===void 0&&i.setContentType(null),"setRequestHeader"in m&&a.forEach(i.toJSON(),function(A,R){m.setRequestHeader(R,A)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),c&&c!=="json"&&(m.responseType=s.responseType),u&&([y,h]=ne(u,!0),m.addEventListener("progress",y)),d&&m.upload&&([f,b]=ne(d),m.upload.addEventListener("progress",f),m.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(l=w=>{m&&(n(!w||w.type?new j(null,t,m):w),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const g=Kr(s.url);if(g&&O.protocols.indexOf(g)===-1){n(new S("Unsupported protocol "+g+":",S.ERR_BAD_REQUEST,t));return}m.send(o||null)})},tn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;n.abort(l instanceof S?l:new j(l instanceof Error?l.message:l))}};let i=e&&setTimeout(()=>{i=null,o(new S(`timeout ${e} of ms exceeded`,S.ETIMEDOUT))},e);const c=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:d}=n;return d.unsubscribe=()=>a.asap(c),d}},rn=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,s;for(;n<r;)s=n+e,yield t.slice(n,s),n=s},nn=async function*(t,e){for await(const r of sn(t))yield*rn(r,e)},sn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},Ne=(t,e,r,n)=>{const s=nn(t,e);let o=0,i,c=d=>{i||(i=!0,n&&n(d))};return new ReadableStream({async pull(d){try{const{done:u,value:l}=await s.next();if(u){c(),d.close();return}let f=l.byteLength;if(r){let y=o+=f;r(y)}d.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(d){return c(d),s.return()}},{highWaterMark:2})},ue=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ct=ue&&typeof ReadableStream=="function",on=ue&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),ut=(t,...e)=>{try{return!!t(...e)}catch{return!1}},an=ct&&ut(()=>{let t=!1;const e=new Request(O.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ue=64*1024,Se=ct&&ut(()=>a.isReadableStream(new Response("").body)),se={stream:Se&&(t=>t.body)};ue&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!se[e]&&(se[e]=a.isFunction(t[e])?r=>r[e]():(r,n)=>{throw new S(`Response type '${e}' is not supported`,S.ERR_NOT_SUPPORT,n)})})})(new Response);const cn=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(O.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(a.isArrayBufferView(t)||a.isArrayBuffer(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await on(t)).byteLength},un=async(t,e)=>{const r=a.toFiniteNumber(t.getContentLength());return r??cn(e)},ln=ue&&(async t=>{let{url:e,method:r,data:n,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:d,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:y}=at(t);u=u?(u+"").toLowerCase():"text";let b=tn([s,o&&o.toAbortSignal()],i),h;const p=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let m;try{if(d&&an&&r!=="get"&&r!=="head"&&(m=await un(l,n))!==0){let R=new Request(e,{method:"POST",body:n,duplex:"half"}),_;if(a.isFormData(n)&&(_=R.headers.get("content-type"))&&l.setContentType(_),R.body){const[k,D]=xe(m,ne(Fe(d)));n=Ne(R.body,Ue,k,D)}}a.isString(f)||(f=f?"include":"omit");const E="credentials"in Request.prototype;h=new Request(e,{...y,signal:b,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:E?f:void 0});let g=await fetch(h,y);const w=Se&&(u==="stream"||u==="response");if(Se&&(c||w&&p)){const R={};["status","statusText","headers"].forEach(Z=>{R[Z]=g[Z]});const _=a.toFiniteNumber(g.headers.get("content-length")),[k,D]=c&&xe(_,ne(Fe(c),!0))||[];g=new Response(Ne(g.body,Ue,k,()=>{D&&D(),p&&p()}),R)}u=u||"text";let A=await se[a.findKey(se,u)||"text"](g,t);return!w&&p&&p(),await new Promise((R,_)=>{ot(R,_,{data:A,headers:F.from(g.headers),status:g.status,statusText:g.statusText,config:t,request:h})})}catch(E){throw p&&p(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new S("Network Error",S.ERR_NETWORK,t,h),{cause:E.cause||E}):S.from(E,E&&E.code,t,h)}}),ge={http:Tr,xhr:en,fetch:ln};a.forEach(ge,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Le=t=>`- ${t}`,dn=t=>a.isFunction(t)||t===null||t===!1,lt={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let r,n;const s={};for(let o=0;o<e;o++){r=t[o];let i;if(n=r,!dn(r)&&(n=ge[(i=String(r)).toLowerCase()],n===void 0))throw new S(`Unknown adapter '${i}'`);if(n)break;s[i||"#"+o]=n}if(!n){const o=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=e?o.length>1?`since :
4
+ `+o.map(Le).join(`
5
+ `):" "+Le(o[0]):"as no adapter specified";throw new S("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:ge};function pe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new j(null,t)}function ve(t){return pe(t),t.headers=F.from(t.headers),t.data=fe.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),lt.getAdapter(t.adapter||Q.adapter)(t).then(function(n){return pe(t),n.data=fe.call(t,t.transformResponse,n),n.headers=F.from(n.headers),n},function(n){return st(n)||(pe(t),n&&n.response&&(n.response.data=fe.call(t,t.transformResponse,n.response),n.response.headers=F.from(n.response.headers))),Promise.reject(n)})}const dt="1.11.0",le={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{le[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Ie={};le.transitional=function(e,r,n){function s(o,i){return"[Axios v"+dt+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,c)=>{if(e===!1)throw new S(s(i," has been removed"+(r?" in "+r:"")),S.ERR_DEPRECATED);return r&&!Ie[i]&&(Ie[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,i,c):!0}};le.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function fn(t,e,r){if(typeof t!="object")throw new S("options must be an object",S.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let s=n.length;for(;s-- >0;){const o=n[s],i=e[o];if(i){const c=t[o],d=c===void 0||i(c,o,t);if(d!==!0)throw new S("option "+o+" must be "+d,S.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new S("Unknown option "+o,S.ERR_BAD_OPTION)}}const te={assertOptions:fn,validators:le},U=te.validators;let v=class{constructor(e){this.defaults=e||{},this.interceptors={request:new _e,response:new _e}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
+ `+o):n.stack=o}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=I(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&te.assertOptions(n,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:te.assertOptions(s,{encode:U.function,serialize:U.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),te.assertOptions(r,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[r.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),r.headers=F.concat(i,o);const c=[];let d=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(d=d&&p.synchronous,c.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let l,f=0,y;if(!d){const h=[ve.bind(this),void 0];for(h.unshift(...c),h.push(...u),y=h.length,l=Promise.resolve(r);f<y;)l=l.then(h[f++],h[f++]);return l}y=c.length;let b=r;for(f=0;f<y;){const h=c[f++],p=c[f++];try{b=h(b)}catch(m){p.call(this,m);break}}try{l=ve.call(this,b)}catch(h){return Promise.reject(h)}for(f=0,y=u.length;f<y;)l=l.then(u[f++],u[f++]);return l}getUri(e){e=I(this.defaults,e);const r=it(e.baseURL,e.url,e.allowAbsoluteUrls);return tt(r,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){v.prototype[e]=function(r,n){return this.request(I(n||{},{method:e,url:r,data:(n||{}).data}))}});a.forEach(["post","put","patch"],function(e){function r(n){return function(o,i,c){return this.request(I(c||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}v.prototype[e]=r(),v.prototype[e+"Form"]=r(!0)});let pn=class ft{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{n.subscribe(c),o=c}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},e(function(o,i,c){n.reason||(n.reason=new j(o,i,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new ft(function(s){e=s}),cancel:e}}};function hn(t){return function(r){return t.apply(null,r)}}function mn(t){return a.isObject(t)&&t.isAxiosError===!0}const be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(be).forEach(([t,e])=>{be[e]=t});function pt(t){const e=new v(t),r=Me(v.prototype.request,e);return a.extend(r,v.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return pt(I(t,s))},r}const T=pt(Q);T.Axios=v;T.CanceledError=j;T.CancelToken=pn;T.isCancel=st;T.VERSION=dt;T.toFormData=ce;T.AxiosError=S;T.Cancel=T.CanceledError;T.all=function(e){return Promise.all(e)};T.spread=hn;T.isAxiosError=mn;T.mergeConfig=I;T.AxiosHeaders=F;T.formToJSON=t=>nt(a.isHTMLForm(t)?new FormData(t):t);T.getAdapter=lt.getAdapter;T.HttpStatusCode=be;T.default=T;const{Axios:Ps,AxiosError:xs,CanceledError:Fs,isCancel:ks,CancelToken:Ns,VERSION:Us,all:Ls,Cancel:vs,isAxiosError:Is,spread:Bs,toFormData:Ds,AxiosHeaders:qs,HttpStatusCode:js,formToJSON:$s,getAdapter:Hs,mergeConfig:Ms}=T,re="http://localhost:8000",$=(t=!1)=>{var s;if(typeof window>"u")return re;const e=window.location.href,r=(s=e.split(".")[0])==null?void 0:s.split("//")[1];if(!r)return re;let n=re;return e.split(".").length>1&&(n=`http://${r}.localhost:8000`),t&&(n=`${n}/api/`),n},yn=()=>$()===re,Sn=()=>$().split(".")[0].split("//")[1],B=T.create({baseURL:$(),withCredentials:!0,headers:{Accept:"application/json","Content-Type":"application/json"}});let Be=!1;B.interceptors.request.use(async t=>{var e,r;return t.baseURL=$(),(e=t.url)!=null&&e.includes("sanctum/csrf-cookie")||(!document.cookie.includes("XSRF-TOKEN")&&!((r=t.url)!=null&&r.includes("sanctum/csrf-cookie"))&&await ht(),gn(t)),t},t=>Promise.reject(t));B.interceptors.response.use(t=>{const e=t.headers["set-cookie"];return e!=null&&e.find(r=>r.includes("XSRF-TOKEN"))&&console.debug("New CSRF token received from server"),t},async t=>{var e;return(e=t.response)==null||e.status,Promise.reject(t)});const ht=async()=>{if(!Be)try{await fetch(`${$()}/sanctum/csrf-cookie`,{method:"GET",credentials:"include"}),Be=!0}catch(t){return console.error("Failed to fetch CSRF token:",t),!1}return!0},gn=t=>{var r;const e=(r=document.cookie.split("; ").find(n=>n.startsWith("XSRF-TOKEN=")))==null?void 0:r.split("=")[1];if(e){const n=decodeURIComponent(e);t.headers&&(t.headers["X-XSRF-TOKEN"]=n)}},bn=t=>t==null?void 0:t.styles.reduce((e,r)=>({...e,...Object.fromEntries(r.colorProperties.map(n=>[n.key,n.value]))}),{}),Rn=(t,e)=>{const n=Object.keys(Object.assign({})).find(o=>o.includes(`/src/components/templates/${t}/`)&&o.endsWith(`/${e}.tsx`));return n||Object.keys(Object.assign({})).find(o=>o.endsWith(`/${e}.tsx`))};function wn(t){return!t||typeof t!="string"?t:t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}const En={store:"Store",about:"About",contact:"Contact"},Cn={login:"Login",register:"Register",noAccount:"Don't have an account?",alreadyHaveAccount:"Already have an account?"},Tn={menu:En,auth:Cn},On={store:"Tienda",about:"Acerca de",contact:"Contacto"},An={login:"Iniciar sesión",register:"Registrarse",noAccount:"¿No tiene una cuenta?",alreadyHaveAccount:"¿Ya tiene una cuenta?"},_n={menu:On,auth:An},Pn="Loading...",xn={create:"Successfully created",update:"Successfully updated",delete:"Successfully deleted"},Fn={required:"This field is required",invalid:"The entered value is invalid",notFound:"The requested resource was not found"},kn={delete:"Are you sure you want to delete this item?",cancel:"Are you sure you want to cancel?"},Nn={name:"Name is required",lastname:"Lastname is required",email:"Invalid email address",password:"Password must be at least 8 characters",passwordConfirmation:"Confirm password required",passwordConfirmationNotMatch:"Passwords do not match",customer_name:"Name is required",customer_email:"Invalid email address",customer_phone:{required:"Phone is required",prefix:"Phone must start with +",length:"Phone must be 10 digits"},customer_address:"Address is required"},Un={loading:Pn,success:xn,error:Fn,confirmation:kn,validation:Nn},Ln="Cargando...",vn={create:"Creado exitosamente",update:"Actualizado exitosamente",delete:"Eliminado exitosamente"},In={required:"Este campo es requerido",invalid:"El valor ingresado no es válido",notFound:"No se encontró el recurso solicitado"},Bn={delete:"¿Está seguro que desea eliminar este elemento?",cancel:"¿Está seguro que desea cancelar?"},Dn={name:"El nombre es requerido",lastname:"El apellido es requerido",email:"El correo electrónico no es válido",password:"La contraseña debe tener al menos 8 caracteres",passwordConfirmation:"Confirmar contraseña requerida",passwordConfirmationNotMatch:"Las contraseñas no coinciden",customer_name:"El nombre es requerido",customer_email:"El correo electrónico no es válido",customer_phone:{required:"El teléfono es requerido",prefix:"El teléfono debe empezar con +",length:"El teléfono debe tener 10 dígitos"},customer_address:"La dirección es requerida"},qn={loading:Ln,success:vn,error:In,confirmation:Bn,validation:Dn},jn="Name",$n="Lastname",Hn="Email",Mn="Password",zn="Confirm password",Jn="Phone",Kn="Address",Vn="Note",Wn="Name",Gn="Email",Xn="Phone",Qn="Address",Zn={name:jn,lastname:$n,email:Hn,password:Mn,password_confirmation:zn,phone:Jn,address:Kn,note:Vn,customer_name:Wn,customer_email:Gn,customer_phone:Xn,customer_address:Qn},Yn="Nombre",es="Apellido",ts="Correo electrónico",rs="Contraseña",ns="Confirmar contraseña",ss="Teléfono",os="Dirección",is="Notas",as="Nombre",cs="Correo electrónico",us="Teléfono",ls="Dirección",ds={name:Yn,lastname:es,email:ts,password:rs,password_confirmation:ns,phone:ss,address:os,note:is,customer_name:as,customer_email:cs,customer_phone:us,customer_address:ls},mt={en:{translation:{...Tn,modules:{},messages:Un,fields:Zn}},es:{translation:{..._n,modules:{},messages:qn,fields:ds}}};$e.use(He.initReactI18next).init({resources:mt,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1},defaultNS:"translation",ns:["translation"]});class H{constructor(e,r=B){C(this,"resource");C(this,"api",B);C(this,"apiPrefix","/api");C(this,"crudResource");C(this,"setCrudResourceProperty",(e,r)=>{switch(e){case"getAll":this.crudResource.getAll=r;break;case"get":this.crudResource.get=r;break;case"create":this.crudResource.create=r;break;case"update":this.crudResource.update=r;break;case"delete":this.crudResource.delete=r;break}});C(this,"buildCrudResource",()=>this.resource.trim().length!==0&&!this.resource.endsWith("s")?{getAll:`${this.resource}s`,get:this.resource,create:this.resource,update:this.resource,delete:this.resource}:{getAll:this.resource,get:this.resource,create:this.resource,update:this.resource,delete:this.resource});C(this,"getAll",e=>this.api.get(`${this.apiPrefix}/${this.crudResource.getAll}`,{params:e}));C(this,"getById",e=>this.api.get(`${this.apiPrefix}/${this.crudResource.get}/${e}`));C(this,"create",e=>this.api.post(`${this.apiPrefix}/${this.crudResource.create}`,e));C(this,"update",(e,r)=>this.api.put(`${this.apiPrefix}/${this.crudResource.update}/${e}`,r));C(this,"deleteById",e=>this.api.delete(`${this.apiPrefix}/${this.crudResource.delete}/${e}`));this.resource=e,this.crudResource=this.buildCrudResource(),this.api=r}}function fs(t,e){let r;try{r=t()}catch{return}return{getItem:s=>{var o;const i=d=>d===null?null:JSON.parse(d,void 0),c=(o=r.getItem(s))!=null?o:null;return c instanceof Promise?c.then(i):i(c)},setItem:(s,o)=>r.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>r.removeItem(s)}}const Re=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return Re(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Re(n)(r)}}}},ps=(t,e)=>(r,n,s)=>{let o={storage:fs(()=>localStorage),partialize:p=>p,version:0,merge:(p,m)=>({...m,...p}),...e},i=!1;const c=new Set,d=new Set;let u=o.storage;if(!u)return t((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...p)},n,s);const l=()=>{const p=o.partialize({...n()});return u.setItem(o.name,{state:p,version:o.version})},f=s.setState;s.setState=(p,m)=>{f(p,m),l()};const y=t((...p)=>{r(...p),l()},n,s);s.getInitialState=()=>y;let b;const h=()=>{var p,m;if(!u)return;i=!1,c.forEach(g=>{var w;return g((w=n())!=null?w:y)});const E=((m=o.onRehydrateStorage)==null?void 0:m.call(o,(p=n())!=null?p:y))||void 0;return Re(u.getItem.bind(u))(o.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==o.version){if(o.migrate){const w=o.migrate(g.state,g.version);return w instanceof Promise?w.then(A=>[!0,A]):[!0,w]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var w;const[A,R]=g;if(b=o.merge(R,(w=n())!=null?w:y),r(b,!0),A)return l()}).then(()=>{E==null||E(b,void 0),b=n(),i=!0,d.forEach(g=>g(b))}).catch(g=>{E==null||E(void 0,g)})};return s.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>i,onHydrate:p=>(c.add(p),()=>{c.delete(p)}),onFinishHydration:p=>(d.add(p),()=>{d.delete(p)})},o.skipHydration||h(),b||y},M=ps,De=t=>{let e;const r=new Set,n=(u,l)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const y=e;e=l??(typeof f!="object"||f===null)?f:Object.assign({},e,f),r.forEach(b=>b(e,y))}},s=()=>e,c={setState:n,getState:s,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u))},d=e=t(n,s,c);return c},hs=t=>t?De(t):De,ms=t=>t;function ys(t,e=ms){const r=P.useSyncExternalStore(t.subscribe,P.useCallback(()=>e(t.getState()),[t,e]),P.useCallback(()=>e(t.getInitialState()),[t,e]));return P.useDebugValue(r),r}const qe=t=>{const e=hs(t),r=n=>ys(e,n);return Object.assign(r,e),r},z=t=>t?qe(t):qe;class yt extends H{constructor(){super("layout")}fetchTemplate(){return this.api.get(this.apiPrefix+"/layout")}}class St{constructor(e=new yt,r=this.initialState){C(this,"customizationService");C(this,"initialState",{template:null,components:null,styles:null,settings:null,loading:!1,error:null});this.customizationService=e,this.initialState=r}build(){return z()(M((e,r)=>({...this.initialState,getTemplate:()=>r().template,getComponents:()=>r().components,getStyles:()=>r().styles,getSettings:()=>r().settings,fetchTemplate:async()=>(await this.customizationService.fetchTemplate()).data.data,setTemplate:n=>e({template:n}),setComponents:n=>e({components:n}),setStyles:n=>e({styles:n}),setSettings:n=>e({settings:n}),setLoading:n=>e({loading:n}),setError:n=>e({error:n}),reset:()=>e(this.initialState)}),{name:"template-storage",partialize:e=>({template:e.template,components:e.components,styles:e.styles,settings:e.settings})}))}}const Ss=new St,gs=Ss.build(),gt="/api/login",bt="/api/register",Rt="/api/logout",wt="/api/refresh-token",Et="/api/user",je={user:null,token:null,refreshToken:null,isAuthenticated:!1,loading:!1,error:null},Ct=z()(M(t=>({...je,setUser:e=>t({user:e,isAuthenticated:!!e}),setToken:e=>t({token:e}),setRefreshToken:e=>t({refreshToken:e}),setError:e=>t({error:e}),setLoading:e=>t({loading:e}),reset:()=>t(je)}),{name:"auth-storage",partialize:t=>({user:t.user,token:t.token,refreshToken:t.refreshToken,isAuthenticated:t.isAuthenticated})}));class Tt{constructor(e,r){C(this,"api",B);C(this,"routes",{login:gt,register:bt,logout:Rt,refreshToken:wt,user:Et});this.api=r||B,this.routes=e||this.routes}getUser(){return this.api.get(this.routes.user)}login(e){return this.api.post(this.routes.login,e)}register(e){return this.api.post(this.routes.register,e)}logout(e){return this.api.post(this.routes.logout,e)}refreshToken(e){return this.api.post(this.routes.refreshToken,e)}}function bs(t="es"){const{t:e,i18n:r}=He.useTranslation(),n=()=>{const s=r.language==="en"?"es":"en";r.changeLanguage(s)};return P.useEffect(()=>{r.changeLanguage(t)},[]),{t:e,i18n:r,toggleLanguage:n}}const K=new Tt;function Rs(){const t=P.useRef(!0),{t:e}=bs(),{user:r,token:n,refreshToken:s,isAuthenticated:o,loading:i,error:c,setUser:d,setToken:u,setRefreshToken:l,setError:f,setLoading:y,reset:b}=Ct();P.useEffect(()=>{(t.current||!r)&&(t.current=!1,p())},[r,o]);const h=P.useCallback(async R=>{try{y(!0),f(null);const _=await R(),{user:k,token:D,refreshToken:Z}=_.data;return d(k),u(D),l(Z),_.data}catch(_){f(e("error.invalid")),console.error(_)}finally{y(!1)}},[]),p=P.useCallback(async()=>h(()=>K.getUser()),[h]),m=P.useCallback(async R=>h(()=>K.login(R)),[h]),E=P.useCallback(async R=>h(()=>K.register(R)),[h]),g=P.useCallback(async()=>{try{y(!0),await K.logout()}catch(R){f(e("error.invalid")),console.error(R)}finally{b(),y(!1)}},[e,b,f,y]),w=P.useCallback(async()=>{try{y(!0),f(null);const R=await K.refreshToken(),{token:_,refreshToken:k}=R.data;return u(_),l(k),R.data}catch(R){f(e("error.invalid")),console.error(R)}finally{y(!1)}},[e,f,y,l,u]),A=P.useCallback(R=>{r&&d({...r,...R})},[r,d]);return{user:r,token:n,refreshToken:s,isAuthenticated:o,loading:i,error:c,getUser:p,login:m,register:E,logout:g,refreshUserToken:w,updateUser:A,setUser:d,setError:f,reset:b}}class Ot extends H{constructor(){super("orders")}}class ws{constructor(e=new Ot,r=this.initialState){C(this,"orderService");C(this,"initialState",{order:{id:0,customer_name:"",customer_email:"",customer_address:"",customer_phone:"",order_number:"",userable_type:"",userable_id:0,items_subtotal:0,current_base_currency:"",currency:"",exchange_rate:0,status:"",base_total_amount_in_cents:0,base_total_amount_formatted:"",total_amount_in_cents:0,total_amount_formatted:"",status_name:"",allowed_next_statuses:[],products:[]}});this.orderService=e,this.initialState=r}build(){return z()(M((e,r)=>({...this.initialState,createOrder:async n=>{const s=await this.orderService.create(n),o=s.data.data.order;return e({order:o}),s.data},fetchOrder:async n=>{const s=await this.orderService.getById(n),o=s.data.data;return e({order:o}),s.data},getOrder:()=>r().order}),{name:"order-storage",partialize:e=>({order:e.order})}))}}class At extends H{constructor(){super("payforms"),this.setCrudResourceProperty("getAll","payforms/actives")}}class Es{constructor(e=new At,r=this.initialState){C(this,"payFormService");C(this,"initialState",{payForms:null,loading:!1,error:null});this.payFormService=e,this.initialState=r}build(){return z()(M((e,r)=>({...this.initialState,setPayForms:n=>e({payForms:n}),setLoading:n=>e({loading:n}),setError:n=>e({error:n}),getPayForms:()=>r().payForms,fetchPayForms:async n=>{try{const s=await this.payFormService.getAll(n);return e({payForms:s.data.data}),s.data}catch(s){throw e({error:s}),s}},reset:()=>e(this.initialState)}),{name:"pay-form-storage",partialize:e=>({payForms:e.payForms})}))}}class _t extends H{constructor(){super("product"),this.setCrudResourceProperty("getAll","shop/products"),this.setCrudResourceProperty("get","products")}}class Cs{constructor(e=new _t,r=this.initialState){C(this,"productService");C(this,"initialState",{productDetails:null,products:null,loading:!1,error:null});this.productService=e,this.initialState=r}build(){return z()(M((e,r)=>({...this.initialState,setProductDetails:n=>e({productDetails:n}),setProducts:n=>e({products:n}),setLoading:n=>e({loading:n}),setError:n=>e({error:n}),getProducts:()=>r().products,fetchProducts:async n=>{try{const s=await this.productService.getAll(n);return e({products:s.data.data}),s.data}catch(s){throw e({error:s}),s}},getProductDetails:()=>r().productDetails,fetchProductDetails:async n=>{try{const s=await this.productService.getById(n);return e({productDetails:s.data.data}),s.data}catch(s){throw e({error:s}),s}},reset:()=>e(this.initialState)}),{name:"product-storage",partialize:e=>({productDetails:e.productDetails,products:e.products})}))}}const Pt="/api/cart/product/add",xt="/api/cart/product/remove",Ft="/api/cart/product/delete",kt="/api/cart/clear",Nt="/api/cart/items",Ut="/api/cart";class Lt extends H{constructor(){super("shop-cart")}addToCart(e,r){return this.api.post(Pt,{product_id:e,quantity:r})}removeFromCart(e){this.api.put(xt,{product_id:e})}removeItemFromCart(e){this.api.delete(Ft,{data:{product_id:e}})}clearCart(){this.api.post(kt)}getCartItems(){return this.api.get(Nt)}getCart(){return this.api.get(Ut)}}class Ts{constructor(e=new Lt,r=this.initialState){C(this,"shopCartService");C(this,"initialState",{cart:{items:[],subtotal:0,total:0,itemized_subtotals:[]},cartItems:[]});this.shopCartService=e,this.initialState=r}build(){return z()(M((e,r)=>({...this.initialState,addToCart:async(n,s)=>{const o=r().cart,i=r().cartItems;try{const c=await this.shopCartService.addToCart(n,s);e(d=>({cartItems:[...d.cartItems,c.data.data],cart:{...d.cart,items:[...d.cart.items,c.data.data]}}))}catch(c){console.error(c),e(()=>({cart:o,cartItems:i}))}},removeFromCart:n=>{const s=r().cart;try{this.shopCartService.removeFromCart(n);const o=r().cart.items.find(i=>i.productible_id===n);o&&e(i=>({cart:{...i.cart,items:[...i.cart.items,{...o,quantity:o.quantity-1}]},cartItems:[...i.cartItems,{...o,quantity:o.quantity-1}]}))}catch(o){console.error(o),e(()=>({cart:s}))}},removeItemFromCart:n=>{const s=r().cart;try{this.shopCartService.removeItemFromCart(n),e(o=>({cart:{...o.cart,items:o.cart.items.filter(i=>i.productible_id!==n)},cartItems:o.cartItems.filter(i=>i.productible_id!==n)}))}catch(o){console.error(o),e(()=>({cart:s}))}},clearCart:()=>{const n=r().cart,s=r().cartItems;try{this.shopCartService.clearCart(),e({...this.initialState})}catch(o){console.error(o),e(()=>({cart:n,cartItems:s}))}},getCartItems:()=>r().cartItems,getCart:()=>r().cart,setCart:n=>{e({cart:n})},setCartItems:n=>{e({cartItems:n})},fetchCart:async()=>{const n=r().cart,s=r().cartItems;try{let o=await this.shopCartService.getCart();return e(()=>({cart:o.data.data,cartItems:o.data.data.items})),o.data}catch(o){throw console.error(o),e(()=>({cart:n,cartItems:s})),o}},fetchCartItems:async()=>{const n=r().cartItems,s=r().cart;try{let o=await this.shopCartService.getCartItems();return e(()=>({cartItems:o.data.data})),o.data}catch(o){throw console.error(o),e(()=>({cartItems:n,cart:s})),o}}}),{name:"shop-cart-storage",partialize:e=>({cart:e.cart,cartItems:e.cartItems})}))}}exports.i18n=$e;exports.BaseService=H;exports.CoreAuthBaseService=Tt;exports.CoreBuilder=Bt;exports.CoreCustomizationBaseService=yt;exports.CoreCustomizationBuilder=St;exports.CoreOrderBaseService=Ot;exports.CoreOrderBuilder=ws;exports.CorePayFormBaseService=At;exports.CorePayFormBuilder=Es;exports.CoreProductBaseService=_t;exports.CoreProductBuilder=Cs;exports.CoreShopCartBaseService=Lt;exports.CoreShopCartBuilder=Ts;exports.LOGIN_ROUTE=gt;exports.LOGOUT_ROUTE=Rt;exports.REFRESH_TOKEN_ROUTE=wt;exports.REGISTER_ROUTE=bt;exports.SHOP_CART_ADD_TO_CART=Pt;exports.SHOP_CART_CLEAR_CART=kt;exports.SHOP_CART_GET_CART=Ut;exports.SHOP_CART_GET_CART_ITEMS=Nt;exports.SHOP_CART_REMOVE_FROM_CART=xt;exports.SHOP_CART_REMOVE_ITEM_FROM_CART=Ft;exports.SUB_MENU_HEADER=Dt;exports.USER_ROUTE=Et;exports.api=B;exports.capitalizeFirstLetter=wn;exports.ensureCsrfToken=ht;exports.findComponentPath=Rn;exports.getTemplateStyles=bn;exports.getTenantName=Sn;exports.getTenantURL=$;exports.isCentralAccess=yn;exports.resources=mt;exports.useAuth=Rs;exports.useAuthStore=Ct;exports.useCustomizationStore=gs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",
File without changes