itrm-components 1.0.43 → 1.0.44
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.
package/dist/index.umd.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(o){return o instanceof this?o:new this(o)}static concat(o,...t){const l=new this(o);return t.forEach(n=>l.set(n)),l}static accessor(o){const l=(this[dO1]=this[dO1]={accessors:{}}).accessors,n=this.prototype;function d(c){const h=v1(c);l[h]||(eR1(n,c),l[h]=!0)}return i.isArray(o)?o.forEach(d):d(o),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),i.reduceDescriptors(A.prototype,({value:a},o)=>{let t=o[0].toUpperCase()+o.slice(1);return{get:()=>a,set(l){this[t]=l}}}),i.freezeMethods(A);function X0(a,o){const t=this||i1,l=o||t,n=A.from(l.headers);let d=l.data;return i.forEach(a,function(h){d=h.call(t,d,n.normalize(),o?o.status:void 0)}),n.normalize(),d}function cO1(a){return!!(a&&a.__CANCEL__)}function t1(a,o,t){f.call(this,a??"canceled",f.ERR_CANCELED,o,t),this.name="CanceledError"}i.inherits(t1,f,{__CANCEL__:!0});function sO1(a,o,t){const l=t.config.validateStatus;!t.status||!l||l(t.status)?a(t):o(new f("Request failed with status code "+t.status,[f.ERR_BAD_REQUEST,f.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function aR1(a){const o=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return o&&o[1]||""}function oR1(a,o){a=a||10;const t=new Array(a),l=new Array(a);let n=0,d=0,c;return o=o!==void 0?o:1e3,function(p){const g=Date.now(),v=l[d];c||(c=g),t[n]=p,l[n]=g;let y=d,$=0;for(;y!==n;)$+=t[y++],y=y%a;if(n=(n+1)%a,n===d&&(d=(d+1)%a),g-c<o)return;const S=v&&g-v;return S?Math.round($*1e3/S):void 0}}function tR1(a,o){let t=0,l=1e3/o,n,d;const c=(g,v=Date.now())=>{t=v,n=null,d&&(clearTimeout(d),d=null),a(...g)};return[(...g)=>{const v=Date.now(),y=v-t;y>=l?c(g,v):(n=g,d||(d=setTimeout(()=>{d=null,c(n)},l-y)))},()=>n&&c(n)]}const b1=(a,o,t=3)=>{let l=0;const n=oR1(50,250);return tR1(d=>{const c=d.loaded,h=d.lengthComputable?d.total:void 0,p=c-l,g=n(p),v=c<=h;l=c;const y={loaded:c,total:h,progress:h?c/h:void 0,bytes:p,rate:g||void 0,estimated:g&&h&&v?(h-c)/g:void 0,event:d,lengthComputable:h!=null,[o?"download":"upload"]:!0};a(y)},t)},hO1=(a,o)=>{const t=a!=null;return[l=>o[0]({lengthComputable:t,total:a,loaded:l}),o[1]]},iO1=a=>(...o)=>i.asap(()=>a(...o)),lR1=q.hasStandardBrowserEnv?((a,o)=>t=>(t=new URL(t,q.origin),a.protocol===t.protocol&&a.host===t.host&&(o||a.port===t.port)))(new URL(q.origin),q.navigator&&/(msie|trident)/i.test(q.navigator.userAgent)):()=>!0,nR1=q.hasStandardBrowserEnv?{write(a,o,t,l,n,d,c){if(typeof document>"u")return;const h=[`${a}=${encodeURIComponent(o)}`];i.isNumber(t)&&h.push(`expires=${new Date(t).toUTCString()}`),i.isString(l)&&h.push(`path=${l}`),i.isString(n)&&h.push(`domain=${n}`),d===!0&&h.push("secure"),i.isString(c)&&h.push(`SameSite=${c}`),document.cookie=h.join("; ")},read(a){if(typeof document>"u")return null;const o=document.cookie.match(new RegExp("(?:^|; )"+a+"=([^;]*)"));return o?decodeURIComponent(o[1]):null},remove(a){this.write(a,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function dR1(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function cR1(a,o){return o?a.replace(/\/?\/$/,"")+"/"+o.replace(/^\/+/,""):a}function vO1(a,o,t){let l=!dR1(o);return a&&(l||t==!1)?cR1(a,o):o}const pO1=a=>a instanceof A?{...a}:a;function J(a,o){o=o||{};const t={};function l(g,v,y,$){return i.isPlainObject(g)&&i.isPlainObject(v)?i.merge.call({caseless:$},g,v):i.isPlainObject(v)?i.merge({},v):i.isArray(v)?v.slice():v}function n(g,v,y,$){if(i.isUndefined(v)){if(!i.isUndefined(g))return l(void 0,g,y,$)}else return l(g,v,y,$)}function d(g,v){if(!i.isUndefined(v))return l(void 0,v)}function c(g,v){if(i.isUndefined(v)){if(!i.isUndefined(g))return l(void 0,g)}else return l(void 0,v)}function h(g,v,y){if(y in o)return l(g,v);if(y in a)return l(void 0,g)}const p={url:d,method:d,data:d,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:h,headers:(g,v,y)=>n(pO1(g),pO1(v),y,!0)};return i.forEach(Object.keys({...a,...o}),function(v){const y=p[v]||n,$=y(a[v],o[v],v);i.isUndefined($)&&y!==h||(t[v]=$)}),t}const gO1=a=>{const o=J({},a);let{data:t,withXSRFToken:l,xsrfHeaderName:n,xsrfCookieName:d,headers:c,auth:h}=o;if(o.headers=c=A.from(c),o.url=oO1(vO1(o.baseURL,o.url,o.allowAbsoluteUrls),a.params,a.paramsSerializer),h&&c.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),i.isFormData(t)){if(q.hasStandardBrowserEnv||q.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(i.isFunction(t.getHeaders)){const p=t.getHeaders(),g=["content-type","content-length"];Object.entries(p).forEach(([v,y])=>{g.includes(v.toLowerCase())&&c.set(v,y)})}}if(q.hasStandardBrowserEnv&&(l&&i.isFunction(l)&&(l=l(o)),l||l!==!1&&lR1(o.url))){const p=n&&d&&nR1.read(d);p&&c.set(n,p)}return o},sR1=typeof XMLHttpRequest<"u"&&function(a){return new Promise(function(t,l){const n=gO1(a);let d=n.data;const c=A.from(n.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:g}=n,v,y,$,S,r;function _(){S&&S(),r&&r(),n.cancelToken&&n.cancelToken.unsubscribe(v),n.signal&&n.signal.removeEventListener("abort",v)}let k=new XMLHttpRequest;k.open(n.method.toUpperCase(),n.url,!0),k.timeout=n.timeout;function M(){if(!k)return;const C=A.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),u={data:!h||h==="text"||h==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:C,config:a,request:k};sO1(function(N){t(N),_()},function(N){l(N),_()},u),k=null}"onloadend"in k?k.onloadend=M:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(M)},k.onabort=function(){k&&(l(new f("Request aborted",f.ECONNABORTED,a,k)),k=null)},k.onerror=function(F){const u=F&&F.message?F.message:"Network Error",m=new f(u,f.ERR_NETWORK,a,k);m.event=F||null,l(m),k=null},k.ontimeout=function(){let F=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const u=n.transitional||lO1;n.timeoutErrorMessage&&(F=n.timeoutErrorMessage),l(new f(F,u.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,a,k)),k=null},d===void 0&&c.setContentType(null),"setRequestHeader"in k&&i.forEach(c.toJSON(),function(F,u){k.setRequestHeader(u,F)}),i.isUndefined(n.withCredentials)||(k.withCredentials=!!n.withCredentials),h&&h!=="json"&&(k.responseType=n.responseType),g&&([$,r]=b1(g,!0),k.addEventListener("progress",$)),p&&k.upload&&([y,S]=b1(p),k.upload.addEventListener("progress",y),k.upload.addEventListener("loadend",S)),(n.cancelToken||n.signal)&&(v=C=>{k&&(l(!C||C.type?new t1(null,a,k):C),k.abort(),k=null)},n.cancelToken&&n.cancelToken.subscribe(v),n.signal&&(n.signal.aborted?v():n.signal.addEventListener("abort",v)));const I=aR1(n.url);if(I&&q.protocols.indexOf(I)===-1){l(new f("Unsupported protocol "+I+":",f.ERR_BAD_REQUEST,a));return}k.send(d||null)})},hR1=(a,o)=>{const{length:t}=a=a?a.filter(Boolean):[];if(o||t){let l=new AbortController,n;const d=function(g){if(!n){n=!0,h();const v=g instanceof Error?g:this.reason;l.abort(v instanceof f?v:new t1(v instanceof Error?v.message:v))}};let c=o&&setTimeout(()=>{c=null,d(new f(`timeout ${o} of ms exceeded`,f.ETIMEDOUT))},o);const h=()=>{a&&(c&&clearTimeout(c),c=null,a.forEach(g=>{g.unsubscribe?g.unsubscribe(d):g.removeEventListener("abort",d)}),a=null)};a.forEach(g=>g.addEventListener("abort",d));const{signal:p}=l;return p.unsubscribe=()=>i.asap(h),p}},iR1=function*(a,o){let t=a.byteLength;if(t<o){yield a;return}let l=0,n;for(;l<t;)n=l+o,yield a.slice(l,n),l=n},vR1=async function*(a,o){for await(const t of pR1(a))yield*iR1(t,o)},pR1=async function*(a){if(a[Symbol.asyncIterator]){yield*a;return}const o=a.getReader();try{for(;;){const{done:t,value:l}=await o.read();if(t)break;yield l}}finally{await o.cancel()}},rO1=(a,o,t,l)=>{const n=vR1(a,o);let d=0,c,h=p=>{c||(c=!0,l&&l(p))};return new ReadableStream({async pull(p){try{const{done:g,value:v}=await n.next();if(g){h(),p.close();return}let y=v.byteLength;if(t){let $=d+=y;t($)}p.enqueue(new Uint8Array(v))}catch(g){throw h(g),g}},cancel(p){return h(p),n.return()}},{highWaterMark:2})},yO1=64*1024,{isFunction:z1}=i,gR1=(({Request:a,Response:o})=>({Request:a,Response:o}))(i.global),{ReadableStream:kO1,TextEncoder:_O1}=i.global,MO1=(a,...o)=>{try{return!!a(...o)}catch{return!1}},rR1=a=>{a=i.merge.call({skipUndefined:!0},gR1,a);const{fetch:o,Request:t,Response:l}=a,n=o?z1(o):typeof fetch=="function",d=z1(t),c=z1(l);if(!n)return!1;const h=n&&z1(kO1),p=n&&(typeof _O1=="function"?(r=>_=>r.encode(_))(new _O1):async r=>new Uint8Array(await new t(r).arrayBuffer())),g=d&&h&&MO1(()=>{let r=!1;const _=new t(q.origin,{body:new kO1,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!_}),v=c&&h&&MO1(()=>i.isReadableStream(new l("").body)),y={stream:v&&(r=>r.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(r=>{!y[r]&&(y[r]=(_,k)=>{let M=_&&_[r];if(M)return M.call(_);throw new f(`Response type '${r}' is not supported`,f.ERR_NOT_SUPPORT,k)})});const $=async r=>{if(r==null)return 0;if(i.isBlob(r))return r.size;if(i.isSpecCompliantForm(r))return(await new t(q.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(i.isArrayBufferView(r)||i.isArrayBuffer(r))return r.byteLength;if(i.isURLSearchParams(r)&&(r=r+""),i.isString(r))return(await p(r)).byteLength},S=async(r,_)=>{const k=i.toFiniteNumber(r.getContentLength());return k??$(_)};return async r=>{let{url:_,method:k,data:M,signal:I,cancelToken:C,timeout:F,onDownloadProgress:u,onUploadProgress:m,responseType:N,headers:w,withCredentials:H="same-origin",fetchOptions:W}=gO1(r),G=o||fetch;N=N?(N+"").toLowerCase():"text";let B=hR1([I,C&&C.toAbortSignal()],F),O=null;const V=B&&B.unsubscribe&&(()=>{B.unsubscribe()});let e1;try{if(m&&g&&k!=="get"&&k!=="head"&&(e1=await S(w,M))!==0){let L=new t(_,{method:"POST",body:M,duplex:"half"}),X;if(i.isFormData(M)&&(X=L.headers.get("content-type"))&&w.setContentType(X),L.body){const[g1,n1]=hO1(e1,b1(iO1(m)));M=rO1(L.body,yO1,g1,n1)}}i.isString(H)||(H=H?"include":"omit");const T=d&&"credentials"in t.prototype,l1={...W,signal:B,method:k.toUpperCase(),headers:w.normalize().toJSON(),body:M,duplex:"half",credentials:T?H:void 0};O=d&&new t(_,l1);let E=await(d?G(O,W):G(_,l1));const B1=v&&(N==="stream"||N==="response");if(v&&(u||B1&&V)){const L={};["status","statusText","headers"].forEach(D1=>{L[D1]=E[D1]});const X=i.toFiniteNumber(E.headers.get("content-length")),[g1,n1]=u&&hO1(X,b1(iO1(u),!0))||[];E=new l(rO1(E.body,yO1,g1,()=>{n1&&n1(),V&&V()}),L)}N=N||"text";let e2=await y[i.findKey(y,N)||"text"](E,r);return!B1&&V&&V(),await new Promise((L,X)=>{sO1(L,X,{data:e2,headers:A.from(E.headers),status:E.status,statusText:E.statusText,config:r,request:O})})}catch(T){throw V&&V(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new f("Network Error",f.ERR_NETWORK,r,O),{cause:T.cause||T}):f.from(T,T&&T.code,r,O)}}},yR1=new Map,uO1=a=>{let o=a&&a.env||{};const{fetch:t,Request:l,Response:n}=o,d=[l,n,t];let c=d.length,h=c,p,g,v=yR1;for(;h--;)p=d[h],g=v.get(p),g===void 0&&v.set(p,g=h?new Map:rR1(o)),v=g;return g};uO1();const Q0={http:AT1,xhr:sR1,fetch:{get:uO1}};i.forEach(Q0,(a,o)=>{if(a){try{Object.defineProperty(a,"name",{value:o})}catch{}Object.defineProperty(a,"adapterName",{value:o})}});const NO1=a=>`- ${a}`,kR1=a=>i.isFunction(a)||a===null||a===!1;function _R1(a,o){a=i.isArray(a)?a:[a];const{length:t}=a;let l,n;const d={};for(let c=0;c<t;c++){l=a[c];let h;if(n=l,!kR1(l)&&(n=Q0[(h=String(l)).toLowerCase()],n===void 0))throw new f(`Unknown adapter '${h}'`);if(n&&(i.isFunction(n)||(n=n.get(o))))break;d[h||"#"+c]=n}if(!n){const c=Object.entries(d).map(([p,g])=>`adapter ${p} `+(g===!1?"is not supported by the environment":"is not available in the build"));let h=t?c.length>1?`since :
|
|
4
4
|
`+c.map(NO1).join(`
|
|
5
5
|
`):" "+NO1(c[0]):"as no adapter specified";throw new f("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return n}const $O1={getAdapter:_R1,adapters:Q0};function Z0(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new t1(null,a)}function fO1(a){return Z0(a),a.headers=A.from(a.headers),a.data=X0.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),$O1.getAdapter(a.adapter||i1.adapter,a)(a).then(function(l){return Z0(a),l.data=X0.call(a,a.transformResponse,l),l.headers=A.from(l.headers),l},function(l){return cO1(l)||(Z0(a),l&&l.response&&(l.response.data=X0.call(a,a.transformResponse,l.response),l.response.headers=A.from(l.response.headers))),Promise.reject(l)})}const mO1="1.13.2",C1={};["object","boolean","number","function","string","symbol"].forEach((a,o)=>{C1[a]=function(l){return typeof l===a||"a"+(o<1?"n ":" ")+a}});const IO1={};C1.transitional=function(o,t,l){function n(d,c){return"[Axios v"+mO1+"] Transitional option '"+d+"'"+c+(l?". "+l:"")}return(d,c,h)=>{if(o===!1)throw new f(n(c," has been removed"+(t?" in "+t:"")),f.ERR_DEPRECATED);return t&&!IO1[c]&&(IO1[c]=!0,console.warn(n(c," has been deprecated since v"+t+" and will be removed in the near future"))),o?o(d,c,h):!0}},C1.spelling=function(o){return(t,l)=>(console.warn(`${l} is likely a misspelling of ${o}`),!0)};function MR1(a,o,t){if(typeof a!="object")throw new f("options must be an object",f.ERR_BAD_OPTION_VALUE);const l=Object.keys(a);let n=l.length;for(;n-- >0;){const d=l[n],c=o[d];if(c){const h=a[d],p=h===void 0||c(h,d,a);if(p!==!0)throw new f("option "+d+" must be "+p,f.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new f("Unknown option "+d,f.ERR_BAD_OPTION)}}const w1={assertOptions:MR1,validators:C1},U=w1.validators;let Y=class{constructor(o){this.defaults=o||{},this.interceptors={request:new tO1,response:new tO1}}async request(o,t){try{return await this._request(o,t)}catch(l){if(l instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const d=n.stack?n.stack.replace(/^.+\n/,""):"";try{l.stack?d&&!String(l.stack).endsWith(d.replace(/^.+\n.+\n/,""))&&(l.stack+=`
|
|
6
|
-
`+d):l.stack=d}catch{}}throw l}}_request(o,t){typeof o=="string"?(t=t||{},t.url=o):t=o||{},t=J(this.defaults,t);const{transitional:l,paramsSerializer:n,headers:d}=t;l!==void 0&&w1.assertOptions(l,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),n!=null&&(i.isFunction(n)?t.paramsSerializer={serialize:n}:w1.assertOptions(n,{encode:U.function,serialize:U.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),w1.assertOptions(t,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let c=d&&i.merge(d.common,d[t.method]);d&&i.forEach(["delete","get","head","post","put","patch","common"],r=>{delete d[r]}),t.headers=A.concat(c,d);const h=[];let p=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(t)===!1||(p=p&&_.synchronous,h.unshift(_.fulfilled,_.rejected))});const g=[];this.interceptors.response.forEach(function(_){g.push(_.fulfilled,_.rejected)});let v,y=0,$;if(!p){const r=[fO1.bind(this),void 0];for(r.unshift(...h),r.push(...g),$=r.length,v=Promise.resolve(t);y<$;)v=v.then(r[y++],r[y++]);return v}$=h.length;let S=t;for(;y<$;){const r=h[y++],_=h[y++];try{S=r(S)}catch(k){_.call(this,k);break}}try{v=fO1.call(this,S)}catch(r){return Promise.reject(r)}for(y=0,$=g.length;y<$;)v=v.then(g[y++],g[y++]);return v}getUri(o){o=J(this.defaults,o);const t=vO1(o.baseURL,o.url,o.allowAbsoluteUrls);return oO1(t,o.params,o.paramsSerializer)}};i.forEach(["delete","get","head","options"],function(o){Y.prototype[o]=function(t,l){return this.request(J(l||{},{method:o,url:t,data:(l||{}).data}))}}),i.forEach(["post","put","patch"],function(o){function t(l){return function(d,c,h){return this.request(J(h||{},{method:o,headers:l?{"Content-Type":"multipart/form-data"}:{},url:d,data:c}))}}Y.prototype[o]=t(),Y.prototype[o+"Form"]=t(!0)});let uR1=class WO1{constructor(o){if(typeof o!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(d){t=d});const l=this;this.promise.then(n=>{if(!l._listeners)return;let d=l._listeners.length;for(;d-- >0;)l._listeners[d](n);l._listeners=null}),this.promise.then=n=>{let d;const c=new Promise(h=>{l.subscribe(h),d=h}).then(n);return c.cancel=function(){l.unsubscribe(d)},c},o(function(d,c,h){l.reason||(l.reason=new t1(d,c,h),t(l.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(o){if(this.reason){o(this.reason);return}this._listeners?this._listeners.push(o):this._listeners=[o]}unsubscribe(o){if(!this._listeners)return;const t=this._listeners.indexOf(o);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const o=new AbortController,t=l=>{o.abort(l)};return this.subscribe(t),o.signal.unsubscribe=()=>this.unsubscribe(t),o.signal}static source(){let o;return{token:new WO1(function(n){o=n}),cancel:o}}};function NR1(a){return function(t){return a.apply(null,t)}}function $R1(a){return i.isObject(a)&&a.isAxiosError===!0}const K0={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(K0).forEach(([a,o])=>{K0[o]=a});function bO1(a){const o=new Y(a),t=HA1(Y.prototype.request,o);return i.extend(t,Y.prototype,o,{allOwnKeys:!0}),i.extend(t,o,null,{allOwnKeys:!0}),t.create=function(n){return bO1(J(a,n))},t}const D=bO1(i1);D.Axios=Y,D.CanceledError=t1,D.CancelToken=uR1,D.isCancel=cO1,D.VERSION=mO1,D.toFormData=m1,D.AxiosError=f,D.Cancel=D.CanceledError,D.all=function(o){return Promise.all(o)},D.spread=NR1,D.isAxiosError=$R1,D.mergeConfig=J,D.AxiosHeaders=A,D.formToJSON=a=>nO1(i.isHTMLForm(a)?new FormData(a):a),D.getAdapter=$O1.getAdapter,D.HttpStatusCode=K0,D.default=D;const{Axios:Um2,AxiosError:jm2,CanceledError:Wm2,isCancel:Gm2,CancelToken:Vm2,VERSION:Xm2,all:Qm2,Cancel:Zm2,isAxiosError:Km2,spread:Jm2,toFormData:Ym2,AxiosHeaders:eI2,HttpStatusCode:aI2,formToJSON:oI2,getAdapter:tI2,mergeConfig:lI2}=D,zO1=(a,o)=>Math.ceil(a/o),fR1=async(a,o,t,l)=>{if(a.automaticManagement){const{urlConfig:n}=a,d=(await D.get(`${p1(n?.url,l)}${p1(n?.url,l).indexOf("?")!==-1?"&":"?"}count=true`,n.headers)).data.payload,c=(await D.get(`${p1(n?.url,l)}${p1(n?.url,l).indexOf("?")!==-1?"&":"?"}limit=${o}&offset=${(t-1)*o}`,n.headers)).data.payload,h=n.formatItems?await n.formatItems(c):c;return{...a,items:h,totalItems:d}}else{const n=l?.filters??[];let d=a.items,c=n.filter(p=>Object.keys(p).length>0);c.length>0&&(d=a.items.filter(p=>c.every(g=>p[g.keyQuery].status===g.value)));const h=d.length;return{...a,items:d,totalItems:h}}},mR1=async(a,o)=>{const{urlConfig:t,items:l}=a,{selectedItems:n}=o;if(t?.url){const{data:d}=await D.get(p1(t.url,o),t.headers),c=d.payload;return n?.enabled&&n.items.length>0?n.items:c}return n?.enabled&&n.items.length>0?n.items:l},p1=(a,o)=>{const l=(o?.filters??[]).filter(n=>Object.keys(n).length>0);if(l.length>0){const n=l.map(c=>`${c.keyQuery}=${c.value}`).join("&"),d=a+(a.includes("?")?"&":"?");return n?d+n:a}return a},CO1=2,IR1=({tableName:a,setPage:o})=>{const t=Q.useSelector(n=>n.tables.tables[a])||{pagination:{pages:0,currentPage:0}},l=n=>{if(n.pages<=6)return Array.from({length:n.pages},(p,g)=>g+1);const d=Math.max(1,n.currentPage-CO1),c=Math.min(n.pages,n.currentPage+CO1),h=[];for(let p=d;p<=c;p++)h.push(p);return d>1&&h.unshift("..."),c<n.pages&&h.push("..."),h};return s.jsxs("nav",{"aria-label":"Paginación de la tabla",className:"light-pagination ",children:[s.jsx("button",{onClick:()=>o(1),children:"<<"}),l(t.pagination).map(n=>n==="..."?s.jsx("a",{children:n},n):s.jsx("a",{href:`?page=${n}`,className:t.pagination.currentPage===Number(n)?"active":"",onClick:d=>{d.preventDefault(),o(Number(n));const c=new URLSearchParams(window.location.search);c.set("page",n.toString()),window.history.replaceState({},"",`${window.location.pathname}?${c.toString()}`)},children:n},n)),s.jsx("button",{onClick:()=>o(t.pagination.pages),disabled:t.pagination.currentPage===t.pagination.pages,children:">>"})]})},bR1={tables:{}},wO1=l2.createSlice({name:"tables",initialState:bR1,reducers:{updateTable:(a,o)=>{a.tables[o.payload.key]=o.payload.value},clearTables:a=>{a.tables={}},setRefreshTrigger:(a,o)=>{a.tables[o.payload.key]&&(a.tables[o.payload.key].refreshTrigger=o.payload.value)}}}),{updateTable:F1,clearTables:nI2,setRefreshTrigger:FO1}=wO1.actions,zR1=wO1.reducer,CR1=({title:a,column:o,selectedOptions:t,handleCheckboxChange:l})=>{const[n,d]=z.useState(!1),c=()=>{d(!n)};return s.jsxs("nav",{className:"accordion-container",children:[s.jsxs("div",{onClick:c,className:`main-item ${n?"main-item--open":""}`,children:[a,n?s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"icon icon-tabler icons-tabler-outline icon-tabler-filter-down",children:[s.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),s.jsx("path",{d:"M12 20l-3 1v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v3"}),s.jsx("path",{d:"M19 16v6"}),s.jsx("path",{d:"M22 19l-3 3l-3 -3"})]}):s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"icon icon-tabler icons-tabler-outline icon-tabler-filter",children:[s.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),s.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})]}),s.jsx("ul",{children:o.filter.options.map((h,p)=>s.jsxs("li",{children:[h.label,s.jsx("input",{style:{marginLeft:"0.2rem"},type:"checkbox",checked:t.includes(h.value),onChange:g=>l(o.filter?.options[0]?.keyQuery,h.value,g.target.checked),onClick:c})]},p))})]})},wR1=({tableName:a})=>{const o=Q.useDispatch(),t=Q.useSelector(h=>h.tables.tables[a])||{columns:[],optionsColumn:{title:"",options:[]},data:[],selectedItems:{enabled:!1,titleButton:"",items:[],manageSelectedItems:()=>{}},pagination:{total:0,pages:0,currentPage:0,pageSize:10},filters:[{}],download:{titleButton:"",download:()=>{},enableSelectedItemsDownloading:!1}},l=(h,p,g)=>{const v=t.filters||[],y=v.findIndex(S=>S.keyQuery===h);let $=g?n(v,h,p,y):d(v,h,p);JSON.stringify($)!==JSON.stringify(v)&&o(F1({key:a,value:{...t,filters:$}}))},n=(h,p,g,v)=>v!==-1?h.map(y=>y.keyQuery===p?{...y,value:y.value.split(",").includes(g)?y.value:`${y.value},${g}`}:y):[...h,{keyQuery:p,value:g}],d=(h,p,g)=>h.map(v=>v.keyQuery===p?{...v,value:v.value.split(",").filter(y=>y!==g).join(",")}:v).filter(v=>v.value!==""),c=h=>{if(h.filter&&h.filter.options){const p=t.filters?.find(g=>g.keyQuery===h.filter?.options[0]?.keyQuery)?.value.split(",")||[];return s.jsx(CR1,{title:h.tittle,column:h,selectedOptions:p,handleCheckboxChange:l})}return h.tittle};return s.jsxs(s.Fragment,{children:[t.columns.map((h,p)=>s.jsx("th",{className:h.class?h.class:"",children:c(h)},h.key+p)),t.optionsColumn?.tittle&&s.jsx("th",{children:t.optionsColumn?.tittle}),t.selectedItems?.enabled&&s.jsx("th",{children:s.jsx(Z,{content:t.selectedItems?.titleButton,children:s.jsx("button",{onClick:()=>t.selectedItems?.manageSelectedItems(t.selectedItems?.items),style:{fontSize:"1rem",fontWeight:"bold"},children:t.selectedItems?.titleButton})})})]})};var j=(a=>(a.DATE="date",a.TIME="time",a.DATETIME="datetime",a.NUMBER="number",a.DOLLAR="dollar",a.PERCENTAGE="percentage",a.LIST="list",a.LINK="link",a))(j||{});function S1(a,o){let t=Math.pow(10,o);return Math.round(a*t)/t}const SO1={[j.DATE]:DO1,[j.TIME]:PO1,[j.DATETIME]:AO1,[j.NUMBER]:LO1,[j.DOLLAR]:xO1,[j.PERCENTAGE]:qO1,[j.LIST]:BO1,[j.LINK]:SR1},FR1=a=>a.format&&SO1[a.format]?SO1[a.format](a.value):a.value;function BO1(a){return a}function DO1(a){const o=new Date(a),t=o.getFullYear(),l=String(o.getMonth()+1).padStart(2,"0"),n=String(o.getDate()).padStart(2,"0");return`${t}-${l}-${n}`}function xO1(a){return Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumSignificantDigits:20}).format(S1(a,2))}function qO1(a){return Intl.NumberFormat("en-US",{maximumSignificantDigits:20}).format(S1(a*100,2))+"%"}function LO1(a){return Intl.NumberFormat("en-US",{maximumSignificantDigits:20}).format(S1(a,2))}function PO1(a){return a.toString()}function AO1(a){return a.toString()}function SR1(a){if(typeof a!="string"||!/^https?:\/\/[\w.-]+(?:\.[\w\.-]+)+[/#?]?.*$/.test(a))return a;const t=a.match(/valorCampo:([^#?]*)$/),l=t?decodeURIComponent(t[1]):a.length>40?a.substring(0,40)+"...":a,n=t?a.replace(/valorCampo:[^#?]*$/,""):a;return s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"underline"},children:l})}const BR1=a=>{const o=a.getFullYear(),t=(a.getMonth()+1).toString().padStart(2,"0"),l=a.getDate().toString().padStart(2,"0");return`${o}-${t}-${l}`},J0=a=>{const o=ZO1[a];return s.jsx(o,{})},DR1=({tableName:a})=>{const o=Q.useDispatch(),t=Q.useSelector(d=>d.tables.tables[a])||{columns:[],optionsColumn:{title:"",options:[]},data:[],selectedItems:{enabled:!1,titleButton:"",items:[],manageSelectedItems:()=>{}},pagination:{total:0,pages:0,currentPage:0,pageSize:10},filters:[{}]};z.useEffect(()=>{},[t]);const l=d=>{const c=[...t.selectedItems?.items?t.selectedItems.items:[]],h=c.findIndex(p=>JSON.stringify(p)===JSON.stringify(d));h!==-1?c.splice(h,1):c.push(d),o(F1({key:a,value:{...t,selectedItems:{...t.selectedItems,items:c}}}))},n=d=>s.jsx(s.Fragment,{children:s.jsxs("tr",{children:[t.columns.map(c=>s.jsx(s.Fragment,{children:s.jsx("td",{className:d[c.key].class?d[c.key].class:"",children:d[c.key].format&&d[c.key].format=="list"?s.jsx("ul",{children:Array.isArray(d[c.key].value)?d[c.key].value.map((h,p)=>s.jsx("li",{style:{color:h.color?h.color:""},children:String(h.name)},p)):typeof d[c.key].value=="object"&&d[c.key].value!==null?Object.entries(d[c.key].value).sort(([,h],[,p])=>p.order-h.order).map(([h,p])=>s.jsx("li",{children:`${h} - ${p.type} - ${p.required?"obligatorio":"no obligatorio"}`},h)):s.jsx("li",{children:String(d[c.key].value)})}):FR1(d[c.key])},c.key)})),t.optionsColumn&&s.jsx("td",{style:{display:"flex",alignItems:"center"},children:t.optionsColumn.options.filter(c=>t.optionsColumn.filter?t.optionsColumn.filter(d,c):!0).map(c=>s.jsx(Z,{content:c.label,children:s.jsx("button",{onClick:()=>c.onclick(d),style:{color:"var(--text-primary-color)"},children:c.icon&&J0(c.icon)})},c.label+d.id))}),t.selectedItems?.enabled&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",checked:t.selectedItems.items.some(c=>JSON.stringify(c)===JSON.stringify(d)),onChange:()=>l(d)})})]},d.id)});return s.jsx(s.Fragment,{children:Array.isArray(t.data)&&t.data.length>0?t.data.map(n):s.jsx("tr",{children:s.jsx("td",{colSpan:t.columns.length+(t.optionsColumn?t.optionsColumn.options.length:0),style:{textAlign:"center",verticalAlign:"middle"},children:"No hay datos disponibles"})})})},OO1=()=>s.jsx("div",{className:"spinner-container",children:s.jsx("div",{className:"spinner"})}),xR1=({columns:a,optionsColumn:o,data:t,pageSize:l,tableName:n,theme:d,caption:c,selectionEnabled:h,download:p,isLoading:g,error:v})=>{const[y,$]=z.useState(1),[S,r]=z.useState(0),_=Q.useDispatch(),k=Q.useSelector(N=>N.tables.tables[n]),M=z.useMemo(()=>k,[k]),I=N=>{$(N),_(F1({key:n,value:{...M,pagination:{...M.pagination,currentPage:N}}}))},C=z.useRef(null),F=z.useRef(null);z.useEffect(()=>{(async()=>{const w=await fR1(t,l,y,M),H=JSON.stringify(w.items),W=C.current,G=JSON.stringify(M?.filters),B=F.current;(H!==W||G!==B||M?.refreshTrigger||t.automaticManagement===!1)&&(C.current=H,F.current=G,r(t.urlConfig?.url?w.totalItems:t.items?.length),_(F1({key:n,value:{...M,columns:a,optionsColumn:o,data:w.items.length>0&&!t.urlConfig?u(w.items):w.items,selectedItems:{enabled:h?.enabled??!1,tittleButton:h?.titleButton??"",items:[],manageSelectedItems:h?.enabled?h.manageSelectedItems:()=>{},sortBy:h?.sortBy},pagination:{total:t.urlConfig?.url?w.totalItems:t.items?.length,pages:t.urlConfig?.url?zO1(w.totalItems,l):zO1(t.items?.length,l),currentPage:y,pageSize:l,setCurrentPage:$},filters:M&&M.filters?M.filters:[{}],refreshTrigger:!1}})),_(FO1({key:n,value:!1})))})()},[t,a,o,l,y,M?.filters,M?.refreshTrigger,n]);const u=z.useCallback(N=>{const w=(y-1)*l;return N.slice(w,w+l)},[y,l]),m=async N=>{const w=await mR1(t,k);N(w)};return s.jsx("div",{className:d.default?`${d.default}`:`${d.class}`,children:s.jsxs("table",{className:d.default?`${d.default}-table`:`${d.class}-table`,children:[c&&s.jsx("caption",{className:d.default?`${d.default}-caption`:`${d.class}-caption`,children:s.jsxs("div",{className:d.default?`${d.default}-caption-container`:`${d.class}-caption-container`,children:[(c.title||c.size)&&s.jsxs("div",{className:d.default?`${d.default}-caption-container-titles`:`${d.class}-caption-container-titles`,children:[c.title&&s.jsx("span",{className:d.default?`${d.default}-caption-title`:`${d.class}-caption-title`,children:n}),c.size&&!c.filterNavs&&s.jsxs("span",{className:d.default?`${d.default}-caption-size`:`${d.class}-caption-size`,children:[S," ",n]}),c.filterNavs&&c.filterNavs.filterOptions.length>0&&c.size&&s.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[s.jsxs("span",{className:d.default?`${d.default}-caption-size`:`${d.class}-caption-size`,children:[S," ",n]}),s.jsx("select",{className:d.default?`${d.default}-caption-filterNavs`:"caption-filterNavs",value:c.filterNavs.selectedFilter,onChange:N=>c.filterNavs.setFilter(N.target.value),children:c.filterNavs.filterOptions.map((N,w)=>s.jsx("option",{value:N.type,children:N.type},w))})]}),c.filterNavs&&c.filterNavs.filterOptions.length>0&&!c.size&&s.jsx("select",{className:d.default?`${d.default}-caption-filterNavs`:"caption-filterNavs",value:c.filterNavs.selectedFilter,onChange:N=>c.filterNavs.setFilter(N.target.value),children:c.filterNavs.filterOptions.map((N,w)=>s.jsx("option",{value:N.type,children:N.type},w))})]}),s.jsxs("div",{style:{display:"flex"},children:[c.buttons&&s.jsxs("div",{className:d.default?`${d.default}-caption-buttons`:`${d.class}-caption-buttons`,children:[c.buttons.map((N,w)=>s.jsx(Z,{content:N.label?N.label:"",children:s.jsx("button",{className:d.default?`${d.default}-caption-button`:`${d.class}-caption-button`,onClick:N.onclick,children:N.icon&&N.icon},w)})),h?.enabled&&M?.selectedItems?.enabled&&M?.selectedItems?.items?.length>0&&s.jsx(Z,{content:h.titleButton,children:s.jsx("button",{className:d.default?`${d.default}-caption-button`:`${d.class}-caption-button`,onClick:()=>h.manageSelectedItems(M?.selectedItems?.items&&M?.selectedItems?.items.length>0?M?.selectedItems?.items:[]),children:h.icon?J0(h.icon):s.jsx(f0,{})})})]}),p&&c.buttons?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{margin:"0 8px",borderLeft:"2px solid var(--text-primary-color)",height:"1.6rem"}}),s.jsx(Z,{content:p.label?p.label:"",children:s.jsx("button",{onClick:()=>m(p.onclick),children:s.jsx(_1,{style:{cursor:"pointer"}})})})]}):p&&s.jsx(Z,{content:p.label?p.label:"",children:s.jsx("button",{onClick:()=>m(p.onclick),children:s.jsx(_1,{style:{cursor:"pointer"}})})})]})]})}),s.jsx("thead",{className:d.default?`${d.default}-head`:`${d.class}-head`,children:s.jsx("tr",{children:s.jsx(wR1,{tableName:n})})}),s.jsx("tbody",{className:d.default?`${d.default}-body`:`${d.class}-body`,children:g?s.jsx(OO1,{}):v?s.jsx("p",{children:v}):s.jsx(DR1,{tableName:n})}),s.jsx("tfoot",{className:d.default?`${d.default}-footer-container`:`${d.class}-footer-container`,children:s.jsx("tr",{className:d.default?`${d.default}-footer`:`${d.class}-footer`,children:s.jsx("td",{colSpan:4,className:d.default?`${d.default}-footer-pagination`:`${d.class}-footer-pagination`,children:s.jsx(IR1,{tableName:n,setPage:I})})})})]})})},qR1=l2.configureStore({reducer:{tables:zR1}}),LR1=5e3;async function PR1(a,o,t={},l=LR1){let n=[],d=[];do d=(await o.get(`${a}${a.includes("?")?"&":"?"}limit=${l}&offset=${n.length}`,t)).data.payload,n=n.concat(d);while(d.length>0);return n}class Y0 extends Error{constructor(o,t,l,n){super(l),this.httpStatus=o,this.code=t,this.details=n,Object.setPrototypeOf(this,Y0.prototype)}}class AR1{static success(o,t,l){return{success:!0,payload:o,message:t,meta:{timestamp:new Date().toISOString(),...l}}}static error(o,t){return{success:!1,payload:null,error:{code:o.code,message:o.message,details:o.details},meta:{timestamp:new Date().toISOString(),...t}}}static paginated(o,t,l){return{success:!0,payload:o,message:l,meta:{timestamp:new Date().toISOString(),pagination:t}}}}function OR1(a){switch(a){case"NOT_FOUND":return 404;case"UNAUTHORIZED":return 401;case"INTERNAL_SERVER_ERROR":return 500;case"FORBIDDEN":return 403;default:return 400}}var TO1=(a=>(a[a.OK=200]="OK",a[a.CREATED=201]="CREATED",a[a.NO_CONTENT=204]="NO_CONTENT",a[a.BAD_REQUEST=400]="BAD_REQUEST",a[a.UNAUTHORIZED=401]="UNAUTHORIZED",a[a.FORBIDDEN=403]="FORBIDDEN",a[a.NOT_FOUND=404]="NOT_FOUND",a[a.CONFLICT=409]="CONFLICT",a[a.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",a[a.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",a))(TO1||{});function RO1(a){const{showAlert:o}=M1();return z.useCallback(t=>{o("danger",t),a?.(t)},[o,a])}const TR1={title:"Verificación de Dos Factores",description:"Abre tu aplicación de autenticación (Google Authenticator, Microsoft Authenticator, etc.) e ingresa el código de 6 dígitos que aparece.",placeholder:"000000",verifyButton:"Verificar",loadingButton:"Cargando",tooltip:"Este código cambia cada 30 segundos. Asegúrate de ingresar el código actual.",brandName:"Elemento Alpha",backToLogin:"← Volver al inicio de sesión",backToDashboard:"← Volver al dashboard",emptyCode:"Por favor ingresa el código de verificación",invalidLength:"El código debe tener 6 dígitos",invalidCode:"Código de verificación inválido",success:"Código verificado exitosamente",verifyError:"Error al verificar el código"},RR1=({onVerify:a,onSuccess:o,onError:t,onBack:l,renderBackLink:n,isLoginFlow:d=!1,labels:c,className:h,classNames:p,showBackground:g=!0,backgroundVideoSrc:v,showLogo:y=!0,logoSrc:$,showTooltip:S=!0,icons:r})=>{const _=RO1(t),{showAlert:k}=M1(),M={...TR1,...c},I=(B,O)=>[B,O&&p?.[O]].filter(Boolean).join(" "),C={shield:r?.shield!==void 0?r.shield:s.jsx(d1,{size:48}),lock:r?.lock!==void 0?r.lock:s.jsx(i0,{size:32}),help:r?.help!==void 0?r.help:s.jsx(Z1,{size:32})},[F,u]=z.useState(""),[m,N]=z.useState(!1);async function w(){(F.trim()??"").length==6?await H():F.trim()?_(M.invalidLength):_(M.emptyCode)}async function H(){N(!0);try{const B=await a(F);B.successful?(k("success",M.success),o&&o(B.data)):_(B.message||M.invalidCode)}catch(B){console.error("Verification error:",B),_(M.verifyError)}finally{N(!1)}}function W(B){const O=B.replace(/\D/g,"");u(O)}function G(B){B.key==="Enter"&&F.length===6&&!m&&w()}return s.jsxs("div",{className:[I("video-background-container","root"),h].filter(Boolean).join(" "),children:[g&&v&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:v,type:"video/mp4"})})}),y&&s.jsxs("div",{className:"contenedor-logo",children:[$&&s.jsx("img",{src:$,alt:"logo",className:"logo"}),s.jsx("p",{children:M.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsxs("div",{className:I("generic-2fa-card","card"),children:[s.jsxs("div",{className:I("generic-2fa-header","header"),children:[C.shield,s.jsx("h1",{children:M.title}),s.jsx("p",{children:M.description})]}),s.jsx("div",{className:I("generic-2fa-content","content"),children:s.jsxs("div",{className:"generic-2fa-verify-section",children:[s.jsxs("div",{className:"generic-2fa-input-group",children:[s.jsxs("div",{className:I("generic-2fa-input-wrapper","inputWrapper"),children:[C.lock,s.jsx("input",{type:"text",className:I("generic-2fa-input","input"),placeholder:M.placeholder,value:F,onChange:B=>W(B.target.value),onKeyPress:G,maxLength:6,disabled:m,autoFocus:!0}),S&&d&&s.jsxs("div",{className:"generic-2fa-tooltip-wrapper",children:[s.jsx("button",{type:"button",className:"generic-2fa-tooltip-trigger","aria-label":"Información sobre el código",children:C.help}),s.jsx("div",{className:"generic-2fa-tooltip-content",role:"tooltip",children:M.tooltip})]})]}),s.jsx("button",{className:I("generic-2fa-btn-verify","verifyButton"),onClick:w,disabled:m||F.length!==6,children:m?M.loadingButton:M.verifyButton})]}),s.jsx("div",{className:I("generic-2fa-back-link","backLink"),children:n?n({isLoginFlow:d,label:d?M.backToLogin:M.backToDashboard}):l&&s.jsx("a",{role:"button",tabIndex:0,style:{cursor:"pointer"},onClick:l,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&l()},children:d?M.backToLogin:M.backToDashboard})})]})})]})})]})},HR1={brandName:"Elemento Alpha",loading:"Cargando...",title:"Configurar Autenticación de Dos Factores",subtitle:"Protege tu cuenta con una capa adicional de seguridad",qrStepTitle:"Paso 1: Escanea el Código QR",qrInstructions:"Usa una aplicación de autenticación como Google Authenticator, Microsoft Authenticator o Authy para escanear este código:",qrAlt:"QR Code para 2FA",verifyStepTitle:"Paso 2: Verifica el Código",verifyInstructions:"Ingresa el código de 6 dígitos que aparece en tu aplicación:",placeholder:"000000",verifyButton:"Verificar",verifyingButton:"Verificando...",skipButton:"Omitir",backToStart:"Volver al Inicio",qrError:"No se pudo generar el código QR. Por favor, intenta nuevamente.",retryButton:"Reintentar",alreadyTitle:"Autenticación de Dos Factores Activa",alreadyDescription:"Tu cuenta ya tiene activada la autenticación de dos factores.",disableButton:"Desactivar 2FA",disablingButton:"Desactivando...",confirmTitle:"¿Desactivar autenticación de dos factores?",confirmDescription:"Ingresa el código actual de tu app de autenticación para confirmar que eres tú.",cancelButton:"Cancelar",confirmDisableButton:"Sí, desactivar",disableSuccessTitle:"2FA Desactivado",disableSuccessDescription:"La autenticación de dos factores fue desactivada para tu cuenta.",disableSuccessNote:"Si quieres volver a protegerla, puedes configurarla nuevamente cuando quieras.",registerSuccessTitle:"¡Registro Exitoso!",registerSuccessDescription:"La autenticación de dos factores ha sido configurada correctamente.",registerSuccessNote:"A partir de ahora, necesitarás ingresar un código de verificación cada vez que inicies sesión.",registerSuccessAlert:"2FA registrado exitosamente",disableSuccessAlert:"2FA desactivado correctamente",emptyCode:"Por favor ingresa el código de verificación",userNotFound:"Usuario no encontrado",tooManyAttempts:"Demasiados intentos fallidos. Vuelve a iniciar sesión.",registerInitError:"Error al iniciar el registro 2FA",invalidCode:"Código incorrecto. Verifica e intenta de nuevo.",attemptsLeft:a=>`Código incorrecto. Te ${a===1?"queda 1 intento":`quedan ${a} intentos`}.`},ER1=({userId:a,onInitialize:o,onVerify:t,onDisable:l,onSuccess:n,onError:d,onSkip:c,onBack:h,renderBackLink:p,onTooManyAttempts:g,renderLoader:v,labels:y,className:$,classNames:S,showBackground:r=!0,backgroundVideoSrc:_,showLogo:k=!0,logoSrc:M,icons:I})=>{const{showAlert:C}=M1(),F=RO1(d),u={...HR1,...y},m=(x,r1)=>[x,r1&&S?.[r1]].filter(Boolean).join(" "),N={shieldHeader:I?.shield!==void 0?I.shield:s.jsx(d1,{size:38}),shieldActive:I?.shield!==void 0?I.shield:s.jsx(d1,{size:64,className:"shield-icon"}),check:I?.check!==void 0?I.check:s.jsx(k1,{size:64}),qr:I?.qr!==void 0?I.qr:s.jsx(y0,{size:24}),alert:I?.alert!==void 0?I.alert:s.jsx(y1,{size:40}),arrow:I?.arrow!==void 0?I.arrow:s.jsx(x1,{size:16})},w=p?p({label:u.backToStart}):h&&s.jsx("button",{type:"button",className:m("btn-primary","primaryButton"),onClick:h,children:u.backToStart}),[H,W]=z.useState(!0),[G,B]=z.useState(!1),[O,V]=z.useState(null),[e1,T]=z.useState(""),[l1,E]=z.useState(!1),[B1,e2]=z.useState(!1),[L,X]=z.useState(!1),[g1,n1]=z.useState(!1),[D1,a2]=z.useState(!1),[o2,t2]=z.useState(""),HO1=z.useRef(!1),EO1=z.useRef(0),UR1=3;z.useEffect(()=>{a&&!HO1.current&&(HO1.current=!0,UO1())},[a]);async function UO1(){W(!0);const x=await o();x.alreadyRegistered?B(!0):x.successful&&x.qr?V(x.qr):F(x.message||u.registerInitError),W(!1)}async function jR1(){let x,r1=!1;if(e1.trim()){if(E(!0),(await t(e1)).successful)C("success",u.registerSuccessAlert),e2(!0),n&&n();else{EO1.current+=1;const jO1=UR1-EO1.current;T(""),jO1>0?C("danger",u.attemptsLeft(jO1)):(x=u.tooManyAttempts,r1=!0)}E(!1)}else C("warning",u.emptyCode);x&&F(x),r1&&g?.()}function WR1(){a2(!0)}async function GR1(){X(!0);const x=await l(o2);x.successful?(C("success",u.disableSuccessAlert),a2(!1),t2(""),B(!1),n1(!0)):F(x.message||u.invalidCode),X(!1)}return H?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsx("div",{className:"loading-spinner-2fa",children:v?v():s.jsx("p",{children:u.loading})})})})]}):G?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsxs("div",{className:m("already-registered","alreadyRegistered"),children:[N.shieldActive,s.jsx("h2",{children:u.alreadyTitle}),s.jsx("p",{children:u.alreadyDescription}),s.jsxs("div",{className:"already-registered-actions",children:[s.jsx("button",{className:m("btn-danger","dangerButton"),onClick:WR1,disabled:L,children:L?u.disablingButton:u.disableButton}),w]})]})})}),D1&&s.jsx("div",{className:"confirm-modal-overlay",role:"dialog","aria-modal":"true",children:s.jsxs("div",{className:m("confirm-modal-card","confirmModal"),children:[s.jsx("div",{className:"confirm-modal-icon",children:N.alert}),s.jsx("h3",{children:u.confirmTitle}),s.jsx("p",{children:u.confirmDescription}),s.jsx("input",{type:"text",className:"generic-2fa-input confirm-modal-input",placeholder:u.placeholder,value:o2,onChange:x=>t2(x.target.value.replace(/\D/g,"")),maxLength:6,disabled:L,autoFocus:!0}),s.jsxs("div",{className:"confirm-modal-actions",children:[s.jsx("button",{className:m("btn-ghost","ghostButton"),onClick:()=>{a2(!1),t2("")},disabled:L,children:u.cancelButton}),s.jsx("button",{className:m("btn-danger","dangerButton"),onClick:GR1,disabled:L||o2.length!==6,children:L?u.disablingButton:u.confirmDisableButton})]})]})})]}):g1?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsxs("div",{className:m("success-view","successView"),children:[s.jsx("div",{className:"success-icon",children:N.check}),s.jsx("h2",{children:u.disableSuccessTitle}),s.jsx("p",{children:u.disableSuccessDescription}),s.jsx("p",{className:"success-message",children:u.disableSuccessNote}),w]})})})]}):B1?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsxs("div",{className:m("success-view","successView"),children:[s.jsx("div",{className:"success-icon",children:N.check}),s.jsx("h2",{children:u.registerSuccessTitle}),s.jsx("p",{children:u.registerSuccessDescription}),s.jsx("p",{className:"success-message",children:u.registerSuccessNote}),w]})})})]}):s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsxs("div",{className:m("generic-2fa-card","card"),children:[s.jsxs("div",{className:m("generic-2fa-header","header"),children:[N.shieldHeader,s.jsx("h1",{children:u.title}),s.jsx("p",{children:u.subtitle})]}),O&&s.jsxs("div",{className:m("generic-2fa-content","content"),children:[s.jsxs("div",{className:m("qr-section","qrSection"),children:[s.jsxs("div",{className:"qr instructions-wrapper",children:[s.jsxs("div",{className:"qr-header",children:[N.qr,s.jsx("h3",{children:u.qrStepTitle})]}),s.jsx("p",{className:"qr-instructions",children:u.qrInstructions})]}),s.jsx("div",{className:"qr-code-wrapper",children:s.jsx("img",{src:O,alt:u.qrAlt})})]}),s.jsx("div",{className:"generic-2fa-verify-section code-generic-2fa-content",children:s.jsxs("div",{className:"verification-header",children:[s.jsxs("div",{className:"verification-header-content",children:[s.jsxs("div",{className:"code-instructions instructions-wrapper",children:[s.jsx("h3",{children:u.verifyStepTitle}),s.jsx("p",{children:u.verifyInstructions})]}),s.jsx("div",{className:"generic-2fa-input-group",children:s.jsx("input",{type:"text",className:m("generic-2fa-input","input"),placeholder:u.placeholder,value:e1,onChange:x=>T(x.target.value.replace(/\D/g,"")),maxLength:6,disabled:l1})})]}),s.jsxs("div",{className:"verify-actions",children:[s.jsx("button",{className:m("generic-2fa-btn-verify","verifyButton"),onClick:jR1,disabled:l1||e1.length!==6,children:l1?u.verifyingButton:u.verifyButton}),c&&s.jsxs("button",{type:"button",className:m("btn-skip","skipButton"),onClick:c,children:[u.skipButton,N.arrow]})]})]})})]}),!O&&s.jsxs("div",{className:m("error-state","errorState"),children:[s.jsx("p",{children:u.qrError}),s.jsx("button",{className:m("btn-secondary","secondaryButton"),onClick:UO1,children:u.retryButton})]})]})})]})};b.AlertProvider=JO1,b.ApiServiceError=Y0,b.HttpCode=TO1,b.Register2FA=ER1,b.ResponseUtils=AR1,b.Spinner=OO1,b.StandardTable=xR1,b.Tooltip=Z,b.Verify2FA=RR1,b.dateFormat=DO1,b.dateTimeFormat=AO1,b.dollarFormat=xO1,b.formatDate=BR1,b.getIcon=J0,b.listFormat=BO1,b.mapErrorCodeToHttpStatus=OR1,b.numberFormat=LO1,b.percentageFormat=qO1,b.requestAll=PR1,b.round=S1,b.setRefreshTrigger=FO1,b.store=qR1,b.timeFormat=PO1,b.useAlert=M1,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
`+d):l.stack=d}catch{}}throw l}}_request(o,t){typeof o=="string"?(t=t||{},t.url=o):t=o||{},t=J(this.defaults,t);const{transitional:l,paramsSerializer:n,headers:d}=t;l!==void 0&&w1.assertOptions(l,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),n!=null&&(i.isFunction(n)?t.paramsSerializer={serialize:n}:w1.assertOptions(n,{encode:U.function,serialize:U.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),w1.assertOptions(t,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let c=d&&i.merge(d.common,d[t.method]);d&&i.forEach(["delete","get","head","post","put","patch","common"],r=>{delete d[r]}),t.headers=A.concat(c,d);const h=[];let p=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(t)===!1||(p=p&&_.synchronous,h.unshift(_.fulfilled,_.rejected))});const g=[];this.interceptors.response.forEach(function(_){g.push(_.fulfilled,_.rejected)});let v,y=0,$;if(!p){const r=[fO1.bind(this),void 0];for(r.unshift(...h),r.push(...g),$=r.length,v=Promise.resolve(t);y<$;)v=v.then(r[y++],r[y++]);return v}$=h.length;let S=t;for(;y<$;){const r=h[y++],_=h[y++];try{S=r(S)}catch(k){_.call(this,k);break}}try{v=fO1.call(this,S)}catch(r){return Promise.reject(r)}for(y=0,$=g.length;y<$;)v=v.then(g[y++],g[y++]);return v}getUri(o){o=J(this.defaults,o);const t=vO1(o.baseURL,o.url,o.allowAbsoluteUrls);return oO1(t,o.params,o.paramsSerializer)}};i.forEach(["delete","get","head","options"],function(o){Y.prototype[o]=function(t,l){return this.request(J(l||{},{method:o,url:t,data:(l||{}).data}))}}),i.forEach(["post","put","patch"],function(o){function t(l){return function(d,c,h){return this.request(J(h||{},{method:o,headers:l?{"Content-Type":"multipart/form-data"}:{},url:d,data:c}))}}Y.prototype[o]=t(),Y.prototype[o+"Form"]=t(!0)});let uR1=class WO1{constructor(o){if(typeof o!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(d){t=d});const l=this;this.promise.then(n=>{if(!l._listeners)return;let d=l._listeners.length;for(;d-- >0;)l._listeners[d](n);l._listeners=null}),this.promise.then=n=>{let d;const c=new Promise(h=>{l.subscribe(h),d=h}).then(n);return c.cancel=function(){l.unsubscribe(d)},c},o(function(d,c,h){l.reason||(l.reason=new t1(d,c,h),t(l.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(o){if(this.reason){o(this.reason);return}this._listeners?this._listeners.push(o):this._listeners=[o]}unsubscribe(o){if(!this._listeners)return;const t=this._listeners.indexOf(o);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const o=new AbortController,t=l=>{o.abort(l)};return this.subscribe(t),o.signal.unsubscribe=()=>this.unsubscribe(t),o.signal}static source(){let o;return{token:new WO1(function(n){o=n}),cancel:o}}};function NR1(a){return function(t){return a.apply(null,t)}}function $R1(a){return i.isObject(a)&&a.isAxiosError===!0}const K0={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(K0).forEach(([a,o])=>{K0[o]=a});function bO1(a){const o=new Y(a),t=HA1(Y.prototype.request,o);return i.extend(t,Y.prototype,o,{allOwnKeys:!0}),i.extend(t,o,null,{allOwnKeys:!0}),t.create=function(n){return bO1(J(a,n))},t}const D=bO1(i1);D.Axios=Y,D.CanceledError=t1,D.CancelToken=uR1,D.isCancel=cO1,D.VERSION=mO1,D.toFormData=m1,D.AxiosError=f,D.Cancel=D.CanceledError,D.all=function(o){return Promise.all(o)},D.spread=NR1,D.isAxiosError=$R1,D.mergeConfig=J,D.AxiosHeaders=A,D.formToJSON=a=>nO1(i.isHTMLForm(a)?new FormData(a):a),D.getAdapter=$O1.getAdapter,D.HttpStatusCode=K0,D.default=D;const{Axios:Um2,AxiosError:jm2,CanceledError:Wm2,isCancel:Gm2,CancelToken:Vm2,VERSION:Xm2,all:Qm2,Cancel:Zm2,isAxiosError:Km2,spread:Jm2,toFormData:Ym2,AxiosHeaders:eI2,HttpStatusCode:aI2,formToJSON:oI2,getAdapter:tI2,mergeConfig:lI2}=D,zO1=(a,o)=>Math.ceil(a/o),fR1=async(a,o,t,l)=>{if(a.automaticManagement){const{urlConfig:n}=a,d=(await D.get(`${p1(n?.url,l)}${p1(n?.url,l).indexOf("?")!==-1?"&":"?"}count=true`,n.headers)).data.payload,c=(await D.get(`${p1(n?.url,l)}${p1(n?.url,l).indexOf("?")!==-1?"&":"?"}limit=${o}&offset=${(t-1)*o}`,n.headers)).data.payload,h=n.formatItems?await n.formatItems(c):c;return{...a,items:h,totalItems:d}}else{const n=l?.filters??[];let d=a.items,c=n.filter(p=>Object.keys(p).length>0);c.length>0&&(d=a.items.filter(p=>c.every(g=>p[g.keyQuery].status===g.value)));const h=d.length;return{...a,items:d,totalItems:h}}},mR1=async(a,o)=>{const{urlConfig:t,items:l}=a,{selectedItems:n}=o;if(t?.url){const{data:d}=await D.get(p1(t.url,o),t.headers),c=d.payload;return n?.enabled&&n.items.length>0?n.items:c}return n?.enabled&&n.items.length>0?n.items:l},p1=(a,o)=>{const l=(o?.filters??[]).filter(n=>Object.keys(n).length>0);if(l.length>0){const n=l.map(c=>`${c.keyQuery}=${c.value}`).join("&"),d=a+(a.includes("?")?"&":"?");return n?d+n:a}return a},CO1=2,IR1=({tableName:a,setPage:o})=>{const t=Q.useSelector(n=>n.tables.tables[a])||{pagination:{pages:0,currentPage:0}},l=n=>{if(n.pages<=6)return Array.from({length:n.pages},(p,g)=>g+1);const d=Math.max(1,n.currentPage-CO1),c=Math.min(n.pages,n.currentPage+CO1),h=[];for(let p=d;p<=c;p++)h.push(p);return d>1&&h.unshift("..."),c<n.pages&&h.push("..."),h};return s.jsxs("nav",{"aria-label":"Paginación de la tabla",className:"light-pagination ",children:[s.jsx("button",{onClick:()=>o(1),children:"<<"}),l(t.pagination).map(n=>n==="..."?s.jsx("a",{children:n},n):s.jsx("a",{href:`?page=${n}`,className:t.pagination.currentPage===Number(n)?"active":"",onClick:d=>{d.preventDefault(),o(Number(n));const c=new URLSearchParams(window.location.search);c.set("page",n.toString()),window.history.replaceState({},"",`${window.location.pathname}?${c.toString()}`)},children:n},n)),s.jsx("button",{onClick:()=>o(t.pagination.pages),disabled:t.pagination.currentPage===t.pagination.pages,children:">>"})]})},bR1={tables:{}},wO1=l2.createSlice({name:"tables",initialState:bR1,reducers:{updateTable:(a,o)=>{a.tables[o.payload.key]=o.payload.value},clearTables:a=>{a.tables={}},setRefreshTrigger:(a,o)=>{a.tables[o.payload.key]&&(a.tables[o.payload.key].refreshTrigger=o.payload.value)}}}),{updateTable:F1,clearTables:nI2,setRefreshTrigger:FO1}=wO1.actions,zR1=wO1.reducer,CR1=({title:a,column:o,selectedOptions:t,handleCheckboxChange:l})=>{const[n,d]=z.useState(!1),c=()=>{d(!n)};return s.jsxs("nav",{className:"accordion-container",children:[s.jsxs("div",{onClick:c,className:`main-item ${n?"main-item--open":""}`,children:[a,n?s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"icon icon-tabler icons-tabler-outline icon-tabler-filter-down",children:[s.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),s.jsx("path",{d:"M12 20l-3 1v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v3"}),s.jsx("path",{d:"M19 16v6"}),s.jsx("path",{d:"M22 19l-3 3l-3 -3"})]}):s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"icon icon-tabler icons-tabler-outline icon-tabler-filter",children:[s.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),s.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})]}),s.jsx("ul",{children:o.filter.options.map((h,p)=>s.jsxs("li",{children:[h.label,s.jsx("input",{style:{marginLeft:"0.2rem"},type:"checkbox",checked:t.includes(h.value),onChange:g=>l(o.filter?.options[0]?.keyQuery,h.value,g.target.checked),onClick:c})]},p))})]})},wR1=({tableName:a})=>{const o=Q.useDispatch(),t=Q.useSelector(h=>h.tables.tables[a])||{columns:[],optionsColumn:{title:"",options:[]},data:[],selectedItems:{enabled:!1,titleButton:"",items:[],manageSelectedItems:()=>{}},pagination:{total:0,pages:0,currentPage:0,pageSize:10},filters:[{}],download:{titleButton:"",download:()=>{},enableSelectedItemsDownloading:!1}},l=(h,p,g)=>{const v=t.filters||[],y=v.findIndex(S=>S.keyQuery===h);let $=g?n(v,h,p,y):d(v,h,p);JSON.stringify($)!==JSON.stringify(v)&&o(F1({key:a,value:{...t,filters:$}}))},n=(h,p,g,v)=>v!==-1?h.map(y=>y.keyQuery===p?{...y,value:y.value.split(",").includes(g)?y.value:`${y.value},${g}`}:y):[...h,{keyQuery:p,value:g}],d=(h,p,g)=>h.map(v=>v.keyQuery===p?{...v,value:v.value.split(",").filter(y=>y!==g).join(",")}:v).filter(v=>v.value!==""),c=h=>{if(h.filter&&h.filter.options){const p=t.filters?.find(g=>g.keyQuery===h.filter?.options[0]?.keyQuery)?.value.split(",")||[];return s.jsx(CR1,{title:h.tittle,column:h,selectedOptions:p,handleCheckboxChange:l})}return h.tittle};return s.jsxs(s.Fragment,{children:[t.columns.map((h,p)=>s.jsx("th",{className:h.class?h.class:"",children:c(h)},h.key+p)),t.optionsColumn?.tittle&&s.jsx("th",{children:t.optionsColumn?.tittle}),t.selectedItems?.enabled&&s.jsx("th",{children:s.jsx(Z,{content:t.selectedItems?.titleButton,children:s.jsx("button",{onClick:()=>t.selectedItems?.manageSelectedItems(t.selectedItems?.items),style:{fontSize:"1rem",fontWeight:"bold"},children:t.selectedItems?.titleButton})})})]})};var j=(a=>(a.DATE="date",a.TIME="time",a.DATETIME="datetime",a.NUMBER="number",a.DOLLAR="dollar",a.PERCENTAGE="percentage",a.LIST="list",a.LINK="link",a))(j||{});function S1(a,o){let t=Math.pow(10,o);return Math.round(a*t)/t}const SO1={[j.DATE]:DO1,[j.TIME]:PO1,[j.DATETIME]:AO1,[j.NUMBER]:LO1,[j.DOLLAR]:xO1,[j.PERCENTAGE]:qO1,[j.LIST]:BO1,[j.LINK]:SR1},FR1=a=>a.format&&SO1[a.format]?SO1[a.format](a.value):a.value;function BO1(a){return a}function DO1(a){const o=new Date(a),t=o.getFullYear(),l=String(o.getMonth()+1).padStart(2,"0"),n=String(o.getDate()).padStart(2,"0");return`${t}-${l}-${n}`}function xO1(a){return Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumSignificantDigits:20}).format(S1(a,2))}function qO1(a){return Intl.NumberFormat("en-US",{maximumSignificantDigits:20}).format(S1(a*100,2))+"%"}function LO1(a){return Intl.NumberFormat("en-US",{maximumSignificantDigits:20}).format(S1(a,2))}function PO1(a){return a.toString()}function AO1(a){return a.toString()}function SR1(a){if(typeof a!="string"||!/^https?:\/\/[\w.-]+(?:\.[\w\.-]+)+[/#?]?.*$/.test(a))return a;const t=a.match(/valorCampo:([^#?]*)$/),l=t?decodeURIComponent(t[1]):a.length>40?a.substring(0,40)+"...":a,n=t?a.replace(/valorCampo:[^#?]*$/,""):a;return s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"underline"},children:l})}const BR1=a=>{const o=a.getFullYear(),t=(a.getMonth()+1).toString().padStart(2,"0"),l=a.getDate().toString().padStart(2,"0");return`${o}-${t}-${l}`},J0=a=>{const o=ZO1[a];return s.jsx(o,{})},DR1=({tableName:a})=>{const o=Q.useDispatch(),t=Q.useSelector(d=>d.tables.tables[a])||{columns:[],optionsColumn:{title:"",options:[]},data:[],selectedItems:{enabled:!1,titleButton:"",items:[],manageSelectedItems:()=>{}},pagination:{total:0,pages:0,currentPage:0,pageSize:10},filters:[{}]};z.useEffect(()=>{},[t]);const l=d=>{const c=[...t.selectedItems?.items?t.selectedItems.items:[]],h=c.findIndex(p=>JSON.stringify(p)===JSON.stringify(d));h!==-1?c.splice(h,1):c.push(d),o(F1({key:a,value:{...t,selectedItems:{...t.selectedItems,items:c}}}))},n=d=>s.jsx(s.Fragment,{children:s.jsxs("tr",{children:[t.columns.map(c=>s.jsx(s.Fragment,{children:s.jsx("td",{className:d[c.key].class?d[c.key].class:"",children:d[c.key].format&&d[c.key].format=="list"?s.jsx("ul",{children:Array.isArray(d[c.key].value)?d[c.key].value.map((h,p)=>s.jsx("li",{style:{color:h.color?h.color:""},children:String(h.name)},p)):typeof d[c.key].value=="object"&&d[c.key].value!==null?Object.entries(d[c.key].value).sort(([,h],[,p])=>p.order-h.order).map(([h,p])=>s.jsx("li",{children:`${h} - ${p.type} - ${p.required?"obligatorio":"no obligatorio"}`},h)):s.jsx("li",{children:String(d[c.key].value)})}):FR1(d[c.key])},c.key)})),t.optionsColumn&&s.jsx("td",{style:{display:"flex",alignItems:"center"},children:t.optionsColumn.options.filter(c=>t.optionsColumn.filter?t.optionsColumn.filter(d,c):!0).map(c=>s.jsx(Z,{content:c.label,children:s.jsx("button",{onClick:()=>c.onclick(d),style:{color:"var(--text-primary-color)"},children:c.icon&&J0(c.icon)})},c.label+d.id))}),t.selectedItems?.enabled&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",checked:t.selectedItems.items.some(c=>JSON.stringify(c)===JSON.stringify(d)),onChange:()=>l(d)})})]},d.id)});return s.jsx(s.Fragment,{children:Array.isArray(t.data)&&t.data.length>0?t.data.map(n):s.jsx("tr",{children:s.jsx("td",{colSpan:t.columns.length+(t.optionsColumn?t.optionsColumn.options.length:0),style:{textAlign:"center",verticalAlign:"middle"},children:"No hay datos disponibles"})})})},OO1=()=>s.jsx("div",{className:"spinner-container",children:s.jsx("div",{className:"spinner"})}),xR1=({columns:a,optionsColumn:o,data:t,pageSize:l,tableName:n,theme:d,caption:c,selectionEnabled:h,download:p,isLoading:g,error:v})=>{const[y,$]=z.useState(1),[S,r]=z.useState(0),_=Q.useDispatch(),k=Q.useSelector(N=>N.tables.tables[n]),M=z.useMemo(()=>k,[k]),I=N=>{$(N),_(F1({key:n,value:{...M,pagination:{...M.pagination,currentPage:N}}}))},C=z.useRef(null),F=z.useRef(null);z.useEffect(()=>{(async()=>{const w=await fR1(t,l,y,M),H=JSON.stringify(w.items),W=C.current,G=JSON.stringify(M?.filters),B=F.current;(H!==W||G!==B||M?.refreshTrigger||t.automaticManagement===!1)&&(C.current=H,F.current=G,r(t.urlConfig?.url?w.totalItems:t.items?.length),_(F1({key:n,value:{...M,columns:a,optionsColumn:o,data:w.items.length>0&&!t.urlConfig?u(w.items):w.items,selectedItems:{enabled:h?.enabled??!1,tittleButton:h?.titleButton??"",items:[],manageSelectedItems:h?.enabled?h.manageSelectedItems:()=>{},sortBy:h?.sortBy},pagination:{total:t.urlConfig?.url?w.totalItems:t.items?.length,pages:t.urlConfig?.url?zO1(w.totalItems,l):zO1(t.items?.length,l),currentPage:y,pageSize:l,setCurrentPage:$},filters:M&&M.filters?M.filters:[{}],refreshTrigger:!1}})),_(FO1({key:n,value:!1})))})()},[t,a,o,l,y,M?.filters,M?.refreshTrigger,n]);const u=z.useCallback(N=>{const w=(y-1)*l;return N.slice(w,w+l)},[y,l]),m=async N=>{const w=await mR1(t,k);N(w)};return s.jsx("div",{className:d.default?`${d.default}`:`${d.class}`,children:s.jsxs("table",{className:d.default?`${d.default}-table`:`${d.class}-table`,children:[c&&s.jsx("caption",{className:d.default?`${d.default}-caption`:`${d.class}-caption`,children:s.jsxs("div",{className:d.default?`${d.default}-caption-container`:`${d.class}-caption-container`,children:[(c.title||c.size)&&s.jsxs("div",{className:d.default?`${d.default}-caption-container-titles`:`${d.class}-caption-container-titles`,children:[c.title&&s.jsx("span",{className:d.default?`${d.default}-caption-title`:`${d.class}-caption-title`,children:n}),c.size&&!c.filterNavs&&s.jsxs("span",{className:d.default?`${d.default}-caption-size`:`${d.class}-caption-size`,children:[S," ",n]}),c.filterNavs&&c.filterNavs.filterOptions.length>0&&c.size&&s.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[s.jsxs("span",{className:d.default?`${d.default}-caption-size`:`${d.class}-caption-size`,children:[S," ",n]}),s.jsx("select",{className:d.default?`${d.default}-caption-filterNavs`:"caption-filterNavs",value:c.filterNavs.selectedFilter,onChange:N=>c.filterNavs.setFilter(N.target.value),children:c.filterNavs.filterOptions.map((N,w)=>s.jsx("option",{value:N.type,children:N.type},w))})]}),c.filterNavs&&c.filterNavs.filterOptions.length>0&&!c.size&&s.jsx("select",{className:d.default?`${d.default}-caption-filterNavs`:"caption-filterNavs",value:c.filterNavs.selectedFilter,onChange:N=>c.filterNavs.setFilter(N.target.value),children:c.filterNavs.filterOptions.map((N,w)=>s.jsx("option",{value:N.type,children:N.type},w))})]}),s.jsxs("div",{style:{display:"flex"},children:[c.buttons&&s.jsxs("div",{className:d.default?`${d.default}-caption-buttons`:`${d.class}-caption-buttons`,children:[c.buttons.map((N,w)=>s.jsx(Z,{content:N.label?N.label:"",children:s.jsx("button",{className:d.default?`${d.default}-caption-button`:`${d.class}-caption-button`,onClick:N.onclick,children:N.icon&&N.icon},w)})),h?.enabled&&M?.selectedItems?.enabled&&M?.selectedItems?.items?.length>0&&s.jsx(Z,{content:h.titleButton,children:s.jsx("button",{className:d.default?`${d.default}-caption-button`:`${d.class}-caption-button`,onClick:()=>h.manageSelectedItems(M?.selectedItems?.items&&M?.selectedItems?.items.length>0?M?.selectedItems?.items:[]),children:h.icon?J0(h.icon):s.jsx(f0,{})})})]}),p&&c.buttons?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{margin:"0 8px",borderLeft:"2px solid var(--text-primary-color)",height:"1.6rem"}}),s.jsx(Z,{content:p.label?p.label:"",children:s.jsx("button",{onClick:()=>m(p.onclick),children:s.jsx(_1,{style:{cursor:"pointer"}})})})]}):p&&s.jsx(Z,{content:p.label?p.label:"",children:s.jsx("button",{onClick:()=>m(p.onclick),children:s.jsx(_1,{style:{cursor:"pointer"}})})})]})]})}),s.jsx("thead",{className:d.default?`${d.default}-head`:`${d.class}-head`,children:s.jsx("tr",{children:s.jsx(wR1,{tableName:n})})}),s.jsx("tbody",{className:d.default?`${d.default}-body`:`${d.class}-body`,children:g?s.jsx(OO1,{}):v?s.jsx("p",{children:v}):s.jsx(DR1,{tableName:n})}),s.jsx("tfoot",{className:d.default?`${d.default}-footer-container`:`${d.class}-footer-container`,children:s.jsx("tr",{className:d.default?`${d.default}-footer`:`${d.class}-footer`,children:s.jsx("td",{colSpan:4,className:d.default?`${d.default}-footer-pagination`:`${d.class}-footer-pagination`,children:s.jsx(IR1,{tableName:n,setPage:I})})})})]})})},qR1=l2.configureStore({reducer:{tables:zR1}}),LR1=5e3;async function PR1(a,o,t={},l=LR1){let n=[],d=[];do d=(await o.get(`${a}${a.includes("?")?"&":"?"}limit=${l}&offset=${n.length}`,t)).data.payload,n=n.concat(d);while(d.length>0);return n}class Y0 extends Error{constructor(o,t,l,n){super(l),this.httpStatus=o,this.code=t,this.details=n,Object.setPrototypeOf(this,Y0.prototype)}}class AR1{static success(o,t,l){return{success:!0,payload:o,message:t,meta:{timestamp:new Date().toISOString(),...l}}}static error(o,t){return{success:!1,payload:null,error:{code:o.code,message:o.message,details:o.details},meta:{timestamp:new Date().toISOString(),...t}}}static paginated(o,t,l){return{success:!0,payload:o,message:l,meta:{timestamp:new Date().toISOString(),pagination:t}}}}function OR1(a){switch(a){case"NOT_FOUND":return 404;case"UNAUTHORIZED":return 401;case"INTERNAL_SERVER_ERROR":return 500;case"FORBIDDEN":return 403;default:return 400}}var TO1=(a=>(a[a.OK=200]="OK",a[a.CREATED=201]="CREATED",a[a.NO_CONTENT=204]="NO_CONTENT",a[a.BAD_REQUEST=400]="BAD_REQUEST",a[a.UNAUTHORIZED=401]="UNAUTHORIZED",a[a.FORBIDDEN=403]="FORBIDDEN",a[a.NOT_FOUND=404]="NOT_FOUND",a[a.CONFLICT=409]="CONFLICT",a[a.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",a[a.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",a))(TO1||{});function RO1(a){const{showAlert:o}=M1();return z.useCallback(t=>{o("danger",t),a?.(t)},[o,a])}const TR1={title:"Verificación de Dos Factores",description:"Abre tu aplicación de autenticación (Google Authenticator, Microsoft Authenticator, etc.) e ingresa el código de 6 dígitos que aparece.",placeholder:"000000",verifyButton:"Verificar",loadingButton:"Cargando",tooltip:"Este código cambia cada 30 segundos. Asegúrate de ingresar el código actual.",brandName:"Elemento Alpha",backToLogin:"← Volver al inicio de sesión",backToDashboard:"← Volver al dashboard",emptyCode:"Por favor ingresa el código de verificación",invalidLength:"El código debe tener 6 dígitos",invalidCode:"Código de verificación inválido",success:"Código verificado exitosamente",verifyError:"Error al verificar el código"},RR1=({onVerify:a,onSuccess:o,onError:t,onBack:l,renderBackLink:n,isLoginFlow:d=!1,labels:c,className:h,classNames:p,showBackground:g=!0,backgroundVideoSrc:v,showLogo:y=!0,logoSrc:$,showTooltip:S=!0,icons:r})=>{const _=RO1(t),{showAlert:k}=M1(),M={...TR1,...c},I=(B,O)=>[B,O&&p?.[O]].filter(Boolean).join(" "),C={shield:r?.shield!==void 0?r.shield:s.jsx(d1,{size:48}),lock:r?.lock!==void 0?r.lock:s.jsx(i0,{size:32}),help:r?.help!==void 0?r.help:s.jsx(Z1,{size:32})},[F,u]=z.useState(""),[m,N]=z.useState(!1);async function w(){(F.trim()??"").length==6?await H():F.trim()?_(M.invalidLength):_(M.emptyCode)}async function H(){N(!0);try{const B=await a(F);B.successful?(k("success",M.success),o&&o(B.data)):_(B.message||M.invalidCode)}catch(B){console.error("Verification error:",B),_(M.verifyError)}finally{N(!1)}}function W(B){const O=B.replace(/\D/g,"");u(O)}function G(B){B.key==="Enter"&&(B.preventDefault(),F.length===6&&!m&&w())}return s.jsxs("div",{className:[I("video-background-container","root"),h].filter(Boolean).join(" "),children:[g&&v&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:v,type:"video/mp4"})})}),y&&s.jsxs("div",{className:"contenedor-logo",children:[$&&s.jsx("img",{src:$,alt:"logo",className:"logo"}),s.jsx("p",{children:M.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsxs("div",{className:I("generic-2fa-card","card"),children:[s.jsxs("div",{className:I("generic-2fa-header","header"),children:[C.shield,s.jsx("h1",{children:M.title}),s.jsx("p",{children:M.description})]}),s.jsx("div",{className:I("generic-2fa-content","content"),children:s.jsxs("div",{className:"generic-2fa-verify-section",children:[s.jsxs("div",{className:"generic-2fa-input-group",children:[s.jsxs("div",{className:I("generic-2fa-input-wrapper","inputWrapper"),children:[C.lock,s.jsx("input",{type:"text",className:I("generic-2fa-input","input"),placeholder:M.placeholder,value:F,onChange:B=>W(B.target.value),onKeyDown:G,maxLength:6,disabled:m,autoFocus:!0}),S&&d&&s.jsxs("div",{className:"generic-2fa-tooltip-wrapper",children:[s.jsx("button",{type:"button",className:"generic-2fa-tooltip-trigger","aria-label":"Información sobre el código",children:C.help}),s.jsx("div",{className:"generic-2fa-tooltip-content",role:"tooltip",children:M.tooltip})]})]}),s.jsx("button",{type:"button",className:I("generic-2fa-btn-verify","verifyButton"),onClick:w,disabled:m||F.length!==6,children:m?M.loadingButton:M.verifyButton})]}),s.jsx("div",{className:I("generic-2fa-back-link","backLink"),children:n?n({isLoginFlow:d,label:d?M.backToLogin:M.backToDashboard}):l&&s.jsx("a",{role:"button",tabIndex:0,style:{cursor:"pointer"},onClick:l,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&l()},children:d?M.backToLogin:M.backToDashboard})})]})})]})})]})},HR1={brandName:"Elemento Alpha",loading:"Cargando...",title:"Configurar Autenticación de Dos Factores",subtitle:"Protege tu cuenta con una capa adicional de seguridad",qrStepTitle:"Paso 1: Escanea el Código QR",qrInstructions:"Usa una aplicación de autenticación como Google Authenticator, Microsoft Authenticator o Authy para escanear este código:",qrAlt:"QR Code para 2FA",verifyStepTitle:"Paso 2: Verifica el Código",verifyInstructions:"Ingresa el código de 6 dígitos que aparece en tu aplicación:",placeholder:"000000",verifyButton:"Verificar",verifyingButton:"Verificando...",skipButton:"Omitir",backToStart:"Volver al Inicio",qrError:"No se pudo generar el código QR. Por favor, intenta nuevamente.",retryButton:"Reintentar",alreadyTitle:"Autenticación de Dos Factores Activa",alreadyDescription:"Tu cuenta ya tiene activada la autenticación de dos factores.",disableButton:"Desactivar 2FA",disablingButton:"Desactivando...",confirmTitle:"¿Desactivar autenticación de dos factores?",confirmDescription:"Ingresa el código actual de tu app de autenticación para confirmar que eres tú.",cancelButton:"Cancelar",confirmDisableButton:"Sí, desactivar",disableSuccessTitle:"2FA Desactivado",disableSuccessDescription:"La autenticación de dos factores fue desactivada para tu cuenta.",disableSuccessNote:"Si quieres volver a protegerla, puedes configurarla nuevamente cuando quieras.",registerSuccessTitle:"¡Registro Exitoso!",registerSuccessDescription:"La autenticación de dos factores ha sido configurada correctamente.",registerSuccessNote:"A partir de ahora, necesitarás ingresar un código de verificación cada vez que inicies sesión.",registerSuccessAlert:"2FA registrado exitosamente",disableSuccessAlert:"2FA desactivado correctamente",emptyCode:"Por favor ingresa el código de verificación",userNotFound:"Usuario no encontrado",tooManyAttempts:"Demasiados intentos fallidos. Vuelve a iniciar sesión.",registerInitError:"Error al iniciar el registro 2FA",invalidCode:"Código incorrecto. Verifica e intenta de nuevo.",attemptsLeft:a=>`Código incorrecto. Te ${a===1?"queda 1 intento":`quedan ${a} intentos`}.`},ER1=({userId:a,onInitialize:o,onVerify:t,onDisable:l,onSuccess:n,onError:d,onSkip:c,onBack:h,renderBackLink:p,onTooManyAttempts:g,renderLoader:v,labels:y,className:$,classNames:S,showBackground:r=!0,backgroundVideoSrc:_,showLogo:k=!0,logoSrc:M,icons:I})=>{const{showAlert:C}=M1(),F=RO1(d),u={...HR1,...y},m=(x,r1)=>[x,r1&&S?.[r1]].filter(Boolean).join(" "),N={shieldHeader:I?.shield!==void 0?I.shield:s.jsx(d1,{size:38}),shieldActive:I?.shield!==void 0?I.shield:s.jsx(d1,{size:64,className:"shield-icon"}),check:I?.check!==void 0?I.check:s.jsx(k1,{size:64}),qr:I?.qr!==void 0?I.qr:s.jsx(y0,{size:24}),alert:I?.alert!==void 0?I.alert:s.jsx(y1,{size:40}),arrow:I?.arrow!==void 0?I.arrow:s.jsx(x1,{size:16})},w=p?p({label:u.backToStart}):h&&s.jsx("button",{type:"button",className:m("btn-primary","primaryButton"),onClick:h,children:u.backToStart}),[H,W]=z.useState(!0),[G,B]=z.useState(!1),[O,V]=z.useState(null),[e1,T]=z.useState(""),[l1,E]=z.useState(!1),[B1,e2]=z.useState(!1),[L,X]=z.useState(!1),[g1,n1]=z.useState(!1),[D1,a2]=z.useState(!1),[o2,t2]=z.useState(""),HO1=z.useRef(!1),EO1=z.useRef(0),UR1=3;z.useEffect(()=>{a&&!HO1.current&&(HO1.current=!0,UO1())},[a]);async function UO1(){W(!0);const x=await o();x.alreadyRegistered?B(!0):x.successful&&x.qr?V(x.qr):F(x.message||u.registerInitError),W(!1)}async function jR1(){let x,r1=!1;if(e1.trim()){if(E(!0),(await t(e1)).successful)C("success",u.registerSuccessAlert),e2(!0),n&&n();else{EO1.current+=1;const jO1=UR1-EO1.current;T(""),jO1>0?C("danger",u.attemptsLeft(jO1)):(x=u.tooManyAttempts,r1=!0)}E(!1)}else C("warning",u.emptyCode);x&&F(x),r1&&g?.()}function WR1(){a2(!0)}async function GR1(){X(!0);const x=await l(o2);x.successful?(C("success",u.disableSuccessAlert),a2(!1),t2(""),B(!1),n1(!0)):F(x.message||u.invalidCode),X(!1)}return H?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsx("div",{className:"loading-spinner-2fa",children:v?v():s.jsx("p",{children:u.loading})})})})]}):G?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsxs("div",{className:m("already-registered","alreadyRegistered"),children:[N.shieldActive,s.jsx("h2",{children:u.alreadyTitle}),s.jsx("p",{children:u.alreadyDescription}),s.jsxs("div",{className:"already-registered-actions",children:[s.jsx("button",{className:m("btn-danger","dangerButton"),onClick:WR1,disabled:L,children:L?u.disablingButton:u.disableButton}),w]})]})})}),D1&&s.jsx("div",{className:"confirm-modal-overlay",role:"dialog","aria-modal":"true",children:s.jsxs("div",{className:m("confirm-modal-card","confirmModal"),children:[s.jsx("div",{className:"confirm-modal-icon",children:N.alert}),s.jsx("h3",{children:u.confirmTitle}),s.jsx("p",{children:u.confirmDescription}),s.jsx("input",{type:"text",className:"generic-2fa-input confirm-modal-input",placeholder:u.placeholder,value:o2,onChange:x=>t2(x.target.value.replace(/\D/g,"")),maxLength:6,disabled:L,autoFocus:!0}),s.jsxs("div",{className:"confirm-modal-actions",children:[s.jsx("button",{className:m("btn-ghost","ghostButton"),onClick:()=>{a2(!1),t2("")},disabled:L,children:u.cancelButton}),s.jsx("button",{className:m("btn-danger","dangerButton"),onClick:GR1,disabled:L||o2.length!==6,children:L?u.disablingButton:u.confirmDisableButton})]})]})})]}):g1?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsxs("div",{className:m("success-view","successView"),children:[s.jsx("div",{className:"success-icon",children:N.check}),s.jsx("h2",{children:u.disableSuccessTitle}),s.jsx("p",{children:u.disableSuccessDescription}),s.jsx("p",{className:"success-message",children:u.disableSuccessNote}),w]})})})]}):B1?s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsx("div",{className:m("generic-2fa-card","card"),children:s.jsxs("div",{className:m("success-view","successView"),children:[s.jsx("div",{className:"success-icon",children:N.check}),s.jsx("h2",{children:u.registerSuccessTitle}),s.jsx("p",{children:u.registerSuccessDescription}),s.jsx("p",{className:"success-message",children:u.registerSuccessNote}),w]})})})]}):s.jsxs("div",{className:[m("video-background-container","root"),$].filter(Boolean).join(" "),children:[r&&_&&s.jsx("div",{className:"video-background-wrapper",children:s.jsx("video",{autoPlay:!0,loop:!0,muted:!0,className:"video-background",children:s.jsx("source",{src:_,type:"video/mp4"})})}),k&&s.jsxs("div",{className:"contenedor-logo",children:[M&&s.jsx("img",{src:M,alt:"logo",className:"logo"}),s.jsx("p",{children:u.brandName})]}),s.jsx("div",{className:"generic-2fa-container",children:s.jsxs("div",{className:m("generic-2fa-card","card"),children:[s.jsxs("div",{className:m("generic-2fa-header","header"),children:[N.shieldHeader,s.jsx("h1",{children:u.title}),s.jsx("p",{children:u.subtitle})]}),O&&s.jsxs("div",{className:m("generic-2fa-content","content"),children:[s.jsxs("div",{className:m("qr-section","qrSection"),children:[s.jsxs("div",{className:"qr instructions-wrapper",children:[s.jsxs("div",{className:"qr-header",children:[N.qr,s.jsx("h3",{children:u.qrStepTitle})]}),s.jsx("p",{className:"qr-instructions",children:u.qrInstructions})]}),s.jsx("div",{className:"qr-code-wrapper",children:s.jsx("img",{src:O,alt:u.qrAlt})})]}),s.jsx("div",{className:"generic-2fa-verify-section code-generic-2fa-content",children:s.jsxs("div",{className:"verification-header",children:[s.jsxs("div",{className:"verification-header-content",children:[s.jsxs("div",{className:"code-instructions instructions-wrapper",children:[s.jsx("h3",{children:u.verifyStepTitle}),s.jsx("p",{children:u.verifyInstructions})]}),s.jsx("div",{className:"generic-2fa-input-group",children:s.jsx("input",{type:"text",className:m("generic-2fa-input","input"),placeholder:u.placeholder,value:e1,onChange:x=>T(x.target.value.replace(/\D/g,"")),maxLength:6,disabled:l1})})]}),s.jsxs("div",{className:"verify-actions",children:[s.jsx("button",{className:m("generic-2fa-btn-verify","verifyButton"),onClick:jR1,disabled:l1||e1.length!==6,children:l1?u.verifyingButton:u.verifyButton}),c&&s.jsxs("button",{type:"button",className:m("btn-skip","skipButton"),onClick:c,children:[u.skipButton,N.arrow]})]})]})})]}),!O&&s.jsxs("div",{className:m("error-state","errorState"),children:[s.jsx("p",{children:u.qrError}),s.jsx("button",{className:m("btn-secondary","secondaryButton"),onClick:UO1,children:u.retryButton})]})]})})]})};b.AlertProvider=JO1,b.ApiServiceError=Y0,b.HttpCode=TO1,b.Register2FA=ER1,b.ResponseUtils=AR1,b.Spinner=OO1,b.StandardTable=xR1,b.Tooltip=Z,b.Verify2FA=RR1,b.dateFormat=DO1,b.dateTimeFormat=AO1,b.dollarFormat=xO1,b.formatDate=BR1,b.getIcon=J0,b.listFormat=BO1,b.mapErrorCodeToHttpStatus=OR1,b.numberFormat=LO1,b.percentageFormat=qO1,b.requestAll=PR1,b.round=S1,b.setRefreshTrigger=FO1,b.store=qR1,b.timeFormat=PO1,b.useAlert=M1,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
|
|
7
7
|
//# sourceMappingURL=index.umd.js.map
|