@luizleon/sf.prefeiturasp.vuecomponents 0.0.9 → 0.0.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.
package/dist/lib.umd.js CHANGED
@@ -1,19 +1,19 @@
1
- (function(W,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(W=typeof globalThis<"u"?globalThis:W||self,c(W.Lib={},W.Vue))})(this,function(W,c){"use strict";var Ns=Object.defineProperty;var Hs=(W,c,Se)=>c in W?Ns(W,c,{enumerable:!0,configurable:!0,writable:!0,value:Se}):W[c]=Se;var $e=(W,c,Se)=>(Hs(W,typeof c!="symbol"?c+"":c,Se),Se);class Se{constructor(){$e(this,"_visible",c.ref(!1))}get IsVisible(){return this._visible.value===!0}Toggle(){this._visible.value=!this._visible.value}Close(){this._visible.value=!1}Open(){this._visible.value=!0}}const rn=new Se,Xe=()=>rn;var Ze=(l=>(l.Primary="primary",l.Secondary="secondary",l.Info="info",l.Success="success",l.Help="help",l.Warn="warn",l.Error="error",l))(Ze||{}),Pe=(l=>(l.Pequeno="sm",l.Medio="md",l.Grande="lg",l))(Pe||{});const mt=(l,o)=>{const h=l.__vccOpts||l;for(const[k,U]of o)h[k]=U;return h},sn={},an={class:"sf-loading-circle"},cn=[c.createElementVNode("div",null,[c.createElementVNode("svg",{viewBox:"25 25 50 50"},[c.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1)];function ln(l,o){return c.openBlock(),c.createElementBlock("div",an,cn)}const un=mt(sn,[["render",ln]]);class Oe{constructor(o){$e(this,"retorno");this.retorno=o??""}Concat(o){return o&&o.trim().length&&(this.retorno+=` ${o}`),this}AddClass(o,h=!0){return h?this.Concat(o):this}Build(){return this.retorno.trim()}}const dn=["disabled","tabindex"],fn=["data-color"],Ge=c.defineComponent({__name:"Icon",props:{icone:{},visible:{type:Boolean,default:!0},class:{default:""},style:{default:""},disabled:{type:Boolean},loading:{type:Boolean},button:{type:Boolean},tamanho:{default:Pe.Medio},dot:{type:Boolean},dotColor:{default:Ze.Error},buttonProps:{}},setup(l){const o=l;function h(){return new Oe(`${o.class} sf-icon`).AddClass("sf-component-loading",o.loading).AddClass("sf-component-disabled",o.disabled).AddClass("sf-icon-button",o.button).AddClass("sf-icon-small",o.tamanho===Pe.Pequeno).AddClass("sf-icon-medium",o.tamanho===Pe.Medio).AddClass("sf-icon-large",o.tamanho===Pe.Grande).AddClass("sf-ripple",o.button===!0).Build()}return(k,U)=>(c.openBlock(),c.createElementBlock("div",{style:c.normalizeStyle(o.style),class:c.normalizeClass(h())},[c.createElementVNode("button",c.mergeProps({class:"material-symbols-outlined",disabled:o.disabled||o.loading},o.buttonProps,{tabindex:o.button?void 0:-1}),[o.loading?(c.openBlock(),c.createBlock(un,{key:0})):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createTextVNode(c.toDisplayString(o.icone),1)],64))],16,dn),o.dot?(c.openBlock(),c.createElementBlock("span",{key:0,"data-color":o.dotColor},null,8,fn)):c.createCommentVNode("",!0)],6))}});var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function hn(l){if(l.__esModule)return l;var o=l.default;if(typeof o=="function"){var h=function k(){return this instanceof k?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};h.prototype=o.prototype}else h={};return Object.defineProperty(h,"__esModule",{value:!0}),Object.keys(l).forEach(function(k){var U=Object.getOwnPropertyDescriptor(l,k);Object.defineProperty(h,k,U.get?U:{enumerable:!0,get:function(){return l[k]}})}),h}var qe={};qe.byteLength=gn,qe.toByteArray=wn,qe.fromByteArray=kn;for(var be=[],de=[],pn=typeof Uint8Array<"u"?Uint8Array:Array,Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be=0,mn=Qe.length;Be<mn;++Be)be[Be]=Qe[Be],de[Qe.charCodeAt(Be)]=Be;de["-".charCodeAt(0)]=62,de["_".charCodeAt(0)]=63;function bt(l){var o=l.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=l.indexOf("=");h===-1&&(h=o);var k=h===o?0:4-h%4;return[h,k]}function gn(l){var o=bt(l),h=o[0],k=o[1];return(h+k)*3/4-k}function bn(l,o,h){return(o+h)*3/4-h}function wn(l){var o,h=bt(l),k=h[0],U=h[1],x=new pn(bn(l,k,U)),I=0,O=U>0?k-4:k,p;for(p=0;p<O;p+=4)o=de[l.charCodeAt(p)]<<18|de[l.charCodeAt(p+1)]<<12|de[l.charCodeAt(p+2)]<<6|de[l.charCodeAt(p+3)],x[I++]=o>>16&255,x[I++]=o>>8&255,x[I++]=o&255;return U===2&&(o=de[l.charCodeAt(p)]<<2|de[l.charCodeAt(p+1)]>>4,x[I++]=o&255),U===1&&(o=de[l.charCodeAt(p)]<<10|de[l.charCodeAt(p+1)]<<4|de[l.charCodeAt(p+2)]>>2,x[I++]=o>>8&255,x[I++]=o&255),x}function yn(l){return be[l>>18&63]+be[l>>12&63]+be[l>>6&63]+be[l&63]}function vn(l,o,h){for(var k,U=[],x=o;x<h;x+=3)k=(l[x]<<16&16711680)+(l[x+1]<<8&65280)+(l[x+2]&255),U.push(yn(k));return U.join("")}function kn(l){for(var o,h=l.length,k=h%3,U=[],x=16383,I=0,O=h-k;I<O;I+=x)U.push(vn(l,I,I+x>O?O:I+x));return k===1?(o=l[h-1],U.push(be[o>>2]+be[o<<4&63]+"==")):k===2&&(o=(l[h-2]<<8)+l[h-1],U.push(be[o>>10]+be[o>>4&63]+be[o<<2&63]+"=")),U.join("")}var wt={exports:{}};const yt=hn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));/**
1
+ (function(W,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(W=typeof globalThis<"u"?globalThis:W||self,c(W.Lib={},W.Vue))})(this,function(W,c){"use strict";var Ns=Object.defineProperty;var Hs=(W,c,Se)=>c in W?Ns(W,c,{enumerable:!0,configurable:!0,writable:!0,value:Se}):W[c]=Se;var $e=(W,c,Se)=>(Hs(W,typeof c!="symbol"?c+"":c,Se),Se);class Se{constructor(){$e(this,"_visible",c.ref(!1))}get IsVisible(){return this._visible.value===!0}Toggle(){this._visible.value=!this._visible.value}Close(){this._visible.value=!1}Open(){this._visible.value=!0}}const rn=new Se,Xe=()=>rn;var Ze=(l=>(l.Primary="primary",l.Secondary="secondary",l.Info="info",l.Success="success",l.Help="help",l.Warn="warn",l.Error="error",l))(Ze||{}),Be=(l=>(l.Pequeno="sm",l.Medio="md",l.Grande="lg",l))(Be||{});const mt=(l,o)=>{const h=l.__vccOpts||l;for(const[k,U]of o)h[k]=U;return h},sn={},an={class:"sf-loading-circle"},cn=[c.createElementVNode("div",null,[c.createElementVNode("svg",{viewBox:"25 25 50 50"},[c.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1)];function ln(l,o){return c.openBlock(),c.createElementBlock("div",an,cn)}const un=mt(sn,[["render",ln]]);class Oe{constructor(o){$e(this,"retorno");this.retorno=o??""}Concat(o){return o&&o.trim().length&&(this.retorno+=` ${o}`),this}AddClass(o,h=!0){return h?this.Concat(o):this}Build(){return this.retorno.trim()}}const dn=["disabled","tabindex"],fn=["data-color"],Ge=c.defineComponent({__name:"Icon",props:{icone:{},visible:{type:Boolean,default:!0},class:{default:""},style:{default:""},disabled:{type:Boolean},loading:{type:Boolean},button:{type:Boolean},tamanho:{default:Be.Medio},dot:{type:Boolean},dotColor:{default:Ze.Error},buttonProps:{}},setup(l){const o=l;function h(){return new Oe(`${o.class} sf-icon`).AddClass("sf-component-loading",o.loading).AddClass("sf-component-disabled",o.disabled).AddClass("sf-icon-button",o.button).AddClass("sf-icon-small",o.tamanho===Be.Pequeno).AddClass("sf-icon-medium",o.tamanho===Be.Medio).AddClass("sf-icon-large",o.tamanho===Be.Grande).AddClass("sf-ripple",o.button===!0).Build()}return(k,U)=>(c.openBlock(),c.createElementBlock("div",{style:c.normalizeStyle(o.style),class:c.normalizeClass(h())},[c.createElementVNode("button",c.mergeProps({class:"material-symbols-outlined",disabled:o.disabled||o.loading},o.buttonProps,{tabindex:o.button?void 0:-1}),[o.loading?(c.openBlock(),c.createBlock(un,{key:0})):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createTextVNode(c.toDisplayString(o.icone),1)],64))],16,dn),o.dot?(c.openBlock(),c.createElementBlock("span",{key:0,"data-color":o.dotColor},null,8,fn)):c.createCommentVNode("",!0)],6))}});var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function hn(l){if(l.__esModule)return l;var o=l.default;if(typeof o=="function"){var h=function k(){return this instanceof k?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};h.prototype=o.prototype}else h={};return Object.defineProperty(h,"__esModule",{value:!0}),Object.keys(l).forEach(function(k){var U=Object.getOwnPropertyDescriptor(l,k);Object.defineProperty(h,k,U.get?U:{enumerable:!0,get:function(){return l[k]}})}),h}var qe={};qe.byteLength=gn,qe.toByteArray=wn,qe.fromByteArray=kn;for(var be=[],de=[],pn=typeof Uint8Array<"u"?Uint8Array:Array,Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe=0,mn=Qe.length;Pe<mn;++Pe)be[Pe]=Qe[Pe],de[Qe.charCodeAt(Pe)]=Pe;de["-".charCodeAt(0)]=62,de["_".charCodeAt(0)]=63;function bt(l){var o=l.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=l.indexOf("=");h===-1&&(h=o);var k=h===o?0:4-h%4;return[h,k]}function gn(l){var o=bt(l),h=o[0],k=o[1];return(h+k)*3/4-k}function bn(l,o,h){return(o+h)*3/4-h}function wn(l){var o,h=bt(l),k=h[0],U=h[1],x=new pn(bn(l,k,U)),I=0,O=U>0?k-4:k,p;for(p=0;p<O;p+=4)o=de[l.charCodeAt(p)]<<18|de[l.charCodeAt(p+1)]<<12|de[l.charCodeAt(p+2)]<<6|de[l.charCodeAt(p+3)],x[I++]=o>>16&255,x[I++]=o>>8&255,x[I++]=o&255;return U===2&&(o=de[l.charCodeAt(p)]<<2|de[l.charCodeAt(p+1)]>>4,x[I++]=o&255),U===1&&(o=de[l.charCodeAt(p)]<<10|de[l.charCodeAt(p+1)]<<4|de[l.charCodeAt(p+2)]>>2,x[I++]=o>>8&255,x[I++]=o&255),x}function yn(l){return be[l>>18&63]+be[l>>12&63]+be[l>>6&63]+be[l&63]}function vn(l,o,h){for(var k,U=[],x=o;x<h;x+=3)k=(l[x]<<16&16711680)+(l[x+1]<<8&65280)+(l[x+2]&255),U.push(yn(k));return U.join("")}function kn(l){for(var o,h=l.length,k=h%3,U=[],x=16383,I=0,O=h-k;I<O;I+=x)U.push(vn(l,I,I+x>O?O:I+x));return k===1?(o=l[h-1],U.push(be[o>>2]+be[o<<4&63]+"==")):k===2&&(o=(l[h-2]<<8)+l[h-1],U.push(be[o>>10]+be[o>>4&63]+be[o<<2&63]+"=")),U.join("")}var wt={exports:{}};const yt=hn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));/**
2
2
  * [js-sha256]{@link https://github.com/emn178/js-sha256}
3
3
  *
4
4
  * @version 0.10.1
5
5
  * @author Chen, Yi-Cyuan [emn178@gmail.com]
6
6
  * @copyright Chen, Yi-Cyuan 2014-2023
7
7
  * @license MIT
8
- */(function(l){(function(){var o="input is invalid type",h=typeof window=="object",k=h?window:{};k.JS_SHA256_NO_WINDOW&&(h=!1);var U=!h&&typeof self=="object",x=!k.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;x?k=ke:U&&(k=self);var I=!k.JS_SHA256_NO_COMMON_JS&&!0&&l.exports,O=!k.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),K=[-2147483648,8388608,32768,128],z=[24,16,8,0],X=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ae=["hex","array","digest","arrayBuffer"],j=[];(k.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(d){return Object.prototype.toString.call(d)==="[object Array]"}),O&&(k.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(d){return typeof d=="object"&&d.buffer&&d.buffer.constructor===ArrayBuffer});var Ce=function(d,C){return function(L){return new J(C,!0).update(L)[d]()}},ge=function(d){var C=Ce("hex",d);x&&(C=ce(C,d)),C.create=function(){return new J(d)},C.update=function(E){return C.create().update(E)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Ce(A,d)}return C},ce=function(d,C){var L=yt,A=yt.Buffer,E=C?"sha224":"sha256",v;A.from&&!k.JS_SHA256_NO_BUFFER_FROM?v=A.from:v=function(g){return new A(g)};var i=function(g){if(typeof g=="string")return L.createHash(E).update(g,"utf8").digest("hex");if(g==null)throw new Error(o);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===A?L.createHash(E).update(v(g)).digest("hex"):d(g)};return i},Te=function(d,C){return function(L,A){return new we(L,C,!0).update(A)[d]()}},fe=function(d){var C=Te("hex",d);C.create=function(E){return new we(E,d)},C.update=function(E,v){return C.create(E).update(v)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Te(A,d)}return C};function J(d,C){C?(j[0]=j[16]=j[1]=j[2]=j[3]=j[4]=j[5]=j[6]=j[7]=j[8]=j[9]=j[10]=j[11]=j[12]=j[13]=j[14]=j[15]=0,this.blocks=j):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=d}J.prototype.update=function(d){if(!this.finalized){var C,L=typeof d;if(L!=="string"){if(L==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);C=!0}for(var A,E=0,v,i=d.length,g=this.blocks;E<i;){if(this.hashed&&(this.hashed=!1,g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),C)for(v=this.start;E<i&&v<64;++E)g[v>>2]|=d[E]<<z[v++&3];else for(v=this.start;E<i&&v<64;++E)A=d.charCodeAt(E),A<128?g[v>>2]|=A<<z[v++&3]:A<2048?(g[v>>2]|=(192|A>>6)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):A<55296||A>=57344?(g[v>>2]|=(224|A>>12)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):(A=65536+((A&1023)<<10|d.charCodeAt(++E)&1023),g[v>>2]|=(240|A>>18)<<z[v++&3],g[v>>2]|=(128|A>>12&63)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=g[16],this.start=v-64,this.hash(),this.hashed=!0):this.start=v}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var d=this.blocks,C=this.lastByteIndex;d[16]=this.block,d[C>>2]|=K[C&3],this.block=d[16],C>=56&&(this.hashed||this.hash(),d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),d[14]=this.hBytes<<3|this.bytes>>>29,d[15]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=this.blocks,$,q,F,G,N,te,s,a,m,b,u;for($=16;$<64;++$)N=T[$-15],q=(N>>>7|N<<25)^(N>>>18|N<<14)^N>>>3,N=T[$-2],F=(N>>>17|N<<15)^(N>>>19|N<<13)^N>>>10,T[$]=T[$-16]+q+T[$-7]+F<<0;for(u=C&L,$=0;$<64;$+=4)this.first?(this.is224?(a=300032,N=T[0]-1413257819,g=N-150054599<<0,A=N+24177077<<0):(a=704751109,N=T[0]-210244248,g=N-1521486534<<0,A=N+143694565<<0),this.first=!1):(q=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),F=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),a=d&C,G=a^d&L^u,s=E&v^~E&i,N=g+F+s+X[$]+T[$],te=q+G,g=A+N<<0,A=N+te<<0),q=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),F=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),m=A&d,G=m^A&C^a,s=g&E^~g&v,N=i+F+s+X[$+1]+T[$+1],te=q+G,i=L+N<<0,L=N+te<<0,q=(L>>>2|L<<30)^(L>>>13|L<<19)^(L>>>22|L<<10),F=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=L&A,G=b^L&d^m,s=i&g^~i&E,N=v+F+s+X[$+2]+T[$+2],te=q+G,v=C+N<<0,C=N+te<<0,q=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),F=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),u=C&L,G=u^C&A^b,s=v&i^~v&g,N=E+F+s+X[$+3]+T[$+3],te=q+G,E=d+N<<0,d=N+te<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+d<<0,this.h1=this.h1+C<<0,this.h2=this.h2+L<<0,this.h3=this.h3+A<<0,this.h4=this.h4+E<<0,this.h5=this.h5+v<<0,this.h6=this.h6+i<<0,this.h7=this.h7+g<<0},J.prototype.hex=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=p[d>>28&15]+p[d>>24&15]+p[d>>20&15]+p[d>>16&15]+p[d>>12&15]+p[d>>8&15]+p[d>>4&15]+p[d&15]+p[C>>28&15]+p[C>>24&15]+p[C>>20&15]+p[C>>16&15]+p[C>>12&15]+p[C>>8&15]+p[C>>4&15]+p[C&15]+p[L>>28&15]+p[L>>24&15]+p[L>>20&15]+p[L>>16&15]+p[L>>12&15]+p[L>>8&15]+p[L>>4&15]+p[L&15]+p[A>>28&15]+p[A>>24&15]+p[A>>20&15]+p[A>>16&15]+p[A>>12&15]+p[A>>8&15]+p[A>>4&15]+p[A&15]+p[E>>28&15]+p[E>>24&15]+p[E>>20&15]+p[E>>16&15]+p[E>>12&15]+p[E>>8&15]+p[E>>4&15]+p[E&15]+p[v>>28&15]+p[v>>24&15]+p[v>>20&15]+p[v>>16&15]+p[v>>12&15]+p[v>>8&15]+p[v>>4&15]+p[v&15]+p[i>>28&15]+p[i>>24&15]+p[i>>20&15]+p[i>>16&15]+p[i>>12&15]+p[i>>8&15]+p[i>>4&15]+p[i&15];return this.is224||(T+=p[g>>28&15]+p[g>>24&15]+p[g>>20&15]+p[g>>16&15]+p[g>>12&15]+p[g>>8&15]+p[g>>4&15]+p[g&15]),T},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=[d>>24&255,d>>16&255,d>>8&255,d&255,C>>24&255,C>>16&255,C>>8&255,C&255,L>>24&255,L>>16&255,L>>8&255,L&255,A>>24&255,A>>16&255,A>>8&255,A&255,E>>24&255,E>>16&255,E>>8&255,E&255,v>>24&255,v>>16&255,v>>8&255,v&255,i>>24&255,i>>16&255,i>>8&255,i&255];return this.is224||T.push(g>>24&255,g>>16&255,g>>8&255,g&255),T},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var d=new ArrayBuffer(this.is224?28:32),C=new DataView(d);return C.setUint32(0,this.h0),C.setUint32(4,this.h1),C.setUint32(8,this.h2),C.setUint32(12,this.h3),C.setUint32(16,this.h4),C.setUint32(20,this.h5),C.setUint32(24,this.h6),this.is224||C.setUint32(28,this.h7),d};function we(d,C,L){var A,E=typeof d;if(E==="string"){var v=[],i=d.length,g=0,T;for(A=0;A<i;++A)T=d.charCodeAt(A),T<128?v[g++]=T:T<2048?(v[g++]=192|T>>6,v[g++]=128|T&63):T<55296||T>=57344?(v[g++]=224|T>>12,v[g++]=128|T>>6&63,v[g++]=128|T&63):(T=65536+((T&1023)<<10|d.charCodeAt(++A)&1023),v[g++]=240|T>>18,v[g++]=128|T>>12&63,v[g++]=128|T>>6&63,v[g++]=128|T&63);d=v}else if(E==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);d.length>64&&(d=new J(C,!0).update(d).array());var $=[],q=[];for(A=0;A<64;++A){var F=d[A]||0;$[A]=92^F,q[A]=54^F}J.call(this,C,L),this.update(q),this.oKeyPad=$,this.inner=!0,this.sharedMemory=L}we.prototype=new J,we.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var d=this.array();J.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(d),J.prototype.finalize.call(this)}};var Z=ge();Z.sha256=Z,Z.sha224=ge(!0),Z.sha256.hmac=fe(),Z.sha224.hmac=fe(!0),I?l.exports=Z:(k.sha256=Z.sha256,k.sha224=Z.sha224)})()})(wt);var xn=wt.exports;const Cn=gt(xn);class Ve extends Error{}Ve.prototype.name="InvalidTokenError";function An(l){return decodeURIComponent(atob(l).replace(/(.)/g,(o,h)=>{let k=h.charCodeAt(0).toString(16).toUpperCase();return k.length<2&&(k="0"+k),"%"+k}))}function Sn(l){let o=l.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return An(o)}catch{return atob(o)}}function et(l,o){if(typeof l!="string")throw new Ve("Invalid token specified: must be a string");o||(o={});const h=o.header===!0?0:1,k=l.split(".")[h];if(typeof k!="string")throw new Ve(`Invalid token specified: missing part #${h+1}`);let U;try{U=Sn(k)}catch(x){throw new Ve(`Invalid token specified: invalid base64 for part #${h+1} (${x.message})`)}try{return JSON.parse(U)}catch(x){throw new Ve(`Invalid token specified: invalid json for part #${h+1} (${x.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function vt(l){if(!(this instanceof vt))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,h,k=[],U,x={enable:!0,callbackList:[],interval:5},I=document.getElementsByTagName("script"),O=0;O<I.length;O++)(I[O].src.indexOf("keycloak.js")!==-1||I[O].src.indexOf("keycloak.min.js")!==-1)&&I[O].src.indexOf("version=")!==-1&&(o.iframeVersion=I[O].src.substring(I[O].src.indexOf("version=")+8).split("&")[0]);var p=!0,K=te(console.info),z=te(console.warn);o.init=function(s){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,U=N();var a=["default","cordova","cordova-native"];if(s&&a.indexOf(s.adapter)>-1?h=q(s.adapter):s&&typeof s.adapter=="object"?h=s.adapter:window.Cordova||window.cordova?h=q("cordova"):h=q(),s){if(typeof s.useNonce<"u"&&(p=s.useNonce),typeof s.checkLoginIframe<"u"&&(x.enable=s.checkLoginIframe),s.checkLoginIframeInterval&&(x.interval=s.checkLoginIframeInterval),s.onLoad==="login-required"&&(o.loginRequired=!0),s.responseMode)if(s.responseMode==="query"||s.responseMode==="fragment")o.responseMode=s.responseMode;else throw"Invalid value for responseMode";if(s.flow){switch(s.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=s.flow}if(s.timeSkew!=null&&(o.timeSkew=s.timeSkew),s.redirectUri&&(o.redirectUri=s.redirectUri),s.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=s.silentCheckSsoRedirectUri),typeof s.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=s.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,s.pkceMethod){if(s.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=s.pkceMethod}typeof s.enableLogging=="boolean"?o.enableLogging=s.enableLogging:o.enableLogging=!1,typeof s.scope=="string"&&(o.scope=s.scope),typeof s.acrValues=="string"&&(o.acrValues=s.acrValues),typeof s.messageReceiveTimeout=="number"&&s.messageReceiveTimeout>0?o.messageReceiveTimeout=s.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var m=E(),b=E();b.promise.then(function(){o.onReady&&o.onReady(o.authenticated),m.setSuccess(o.authenticated)}).catch(function(_){m.setError(_)});var u=J();function S(){var _=function(H){H||(M.prompt="none"),s&&s.locale&&(M.locale=s.locale),o.login(M).then(function(){b.setSuccess()}).catch(function(he){b.setError(he)})},P=function(){var H=document.createElement("iframe"),he=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});H.setAttribute("src",he),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var pe=function(ne){if(!(ne.origin!==window.location.origin||H.contentWindow!==ne.source)){var ye=C(ne.data);fe(ye,b),document.body.removeChild(H),window.removeEventListener("message",pe)}};window.addEventListener("message",pe)},M={};switch(s.onLoad){case"check-sso":x.enable?i().then(function(){T().then(function(H){H?b.setSuccess():o.silentCheckSsoRedirectUri?P():_(!1)}).catch(function(H){b.setError(H)})}):o.silentCheckSsoRedirectUri?P():_(!1);break;case"login-required":_(!0);break;default:throw"Invalid value for onLoad"}}function w(){var _=C(window.location.href);if(_&&window.history.replaceState(window.history.state,null,_.newUrl),_&&_.valid)return i().then(function(){fe(_,b)}).catch(function(P){b.setError(P)});s?s.token&&s.refreshToken?(Z(s.token,s.refreshToken,s.idToken),x.enable?i().then(function(){T().then(function(P){P?(o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess(),g()):b.setSuccess()}).catch(function(P){b.setError(P)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess()}).catch(function(P){o.onAuthError&&o.onAuthError(),s.onLoad?S():b.setError(P)})):s.onLoad?S():b.setSuccess():b.setSuccess()}function y(){var _=E(),P=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",P),_.setSuccess())};return document.addEventListener("readystatechange",P),P(),_.promise}return u.then(function(){y().then($).then(w).catch(function(_){m.setError(_)})}),u.catch(function(_){m.setError(_)}),m.promise},o.login=function(s){return h.login(s)};function X(s){var a=null,m=window.crypto||window.msCrypto;if(m&&m.getRandomValues&&window.Uint8Array)return a=new Uint8Array(s),m.getRandomValues(a),a;a=new Array(s);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function ae(s){return j(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function j(s,a){for(var m=X(s),b=new Array(s),u=0;u<s;u++)b[u]=a.charCodeAt(m[u]%a.length);return String.fromCharCode.apply(null,b)}function Ce(s,a){switch(s){case"S256":var m=new Uint8Array(Cn.arrayBuffer(a)),b=qe.fromByteArray(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ge(s){var a={id_token:{acr:s}};return JSON.stringify(a)}o.createLoginUrl=function(s){var a=d(),m=d(),b=h.redirectUri(s),u={state:a,nonce:m,redirectUri:encodeURIComponent(b)};s&&s.prompt&&(u.prompt=s.prompt);var S;s&&s.action=="register"?S=o.endpoints.register():S=o.endpoints.authorize();var w=s&&s.scope||o.scope;w?w.indexOf("openid")===-1&&(w="openid "+w):w="openid";var y=S+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(w);if(p&&(y=y+"&nonce="+encodeURIComponent(m)),s&&s.prompt&&(y+="&prompt="+encodeURIComponent(s.prompt)),s&&s.maxAge&&(y+="&max_age="+encodeURIComponent(s.maxAge)),s&&s.loginHint&&(y+="&login_hint="+encodeURIComponent(s.loginHint)),s&&s.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(s.idpHint)),s&&s.action&&s.action!="register"&&(y+="&kc_action="+encodeURIComponent(s.action)),s&&s.locale&&(y+="&ui_locales="+encodeURIComponent(s.locale)),s&&s.acr){var _=ge(s.acr);y+="&claims="+encodeURIComponent(_)}if((s&&s.acrValues||o.acrValues)&&(y+="&acr_values="+encodeURIComponent(s.acrValues||o.acrValues)),o.pkceMethod){var P=ae(96);u.pkceCodeVerifier=P;var M=Ce(o.pkceMethod,P);y+="&code_challenge="+M,y+="&code_challenge_method="+o.pkceMethod}return U.add(u),y},o.logout=function(s){return h.logout(s)},o.createLogoutUrl=function(s){var a=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(h.redirectUri(s,!1));return o.idToken&&(a+="&id_token_hint="+encodeURIComponent(o.idToken)),a},o.register=function(s){return h.register(s)},o.createRegisterUrl=function(s){return s||(s={}),s.action="register",o.createLoginUrl(s)},o.createAccountUrl=function(s){var a=ce(),m=void 0;return typeof a<"u"&&(m=a+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(h.redirectUri(s))),m},o.accountManagement=function(){return h.accountManagement()},o.hasRealmRole=function(s){var a=o.realmAccess;return!!a&&a.roles.indexOf(s)>=0},o.hasResourceRole=function(s,a){if(!o.resourceAccess)return!1;var m=o.resourceAccess[a||o.clientId];return!!m&&m.roles.indexOf(s)>=0},o.loadUserProfile=function(){var s=ce()+"/account",a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.profile=JSON.parse(a.responseText),m.setSuccess(o.profile)):m.setError())},a.send(),m.promise},o.loadUserInfo=function(){var s=o.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.userInfo=JSON.parse(a.responseText),m.setSuccess(o.userInfo)):m.setError())},a.send(),m.promise},o.isTokenExpired=function(s){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return K("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(s){if(isNaN(s))throw"Invalid minValidity";a-=s}return a<0},o.updateToken=function(s){var a=E();if(!o.refreshToken)return a.setError(),a.promise;s=s||5;var m=function(){var u=!1;if(s==-1?(u=!0,K("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(s))&&(u=!0,K("[KEYCLOAK] Refreshing token: token expired")),!u)a.setSuccess(!1);else{var S="grant_type=refresh_token&refresh_token="+o.refreshToken,w=o.endpoints.token();if(k.push(a),k.length==1){var y=new XMLHttpRequest;y.open("POST",w,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,S+="&client_id="+encodeURIComponent(o.clientId);var _=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){K("[KEYCLOAK] Token refreshed"),_=(_+new Date().getTime())/2;var P=JSON.parse(y.responseText);Z(P.access_token,P.refresh_token,P.id_token,_),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var M=k.pop();M!=null;M=k.pop())M.setSuccess(!0)}else{z("[KEYCLOAK] Failed to refresh token"),y.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var M=k.pop();M!=null;M=k.pop())M.setError(!0)}},y.send(S)}}};if(x.enable){var b=T();b.then(function(){m()}).catch(function(u){a.setError(u)})}else m();return a.promise},o.clearToken=function(){o.token&&(Z(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())},o.setToken=Z;function ce(){if(typeof o.authServerUrl<"u")return o.authServerUrl.charAt(o.authServerUrl.length-1)=="/"?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function Te(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function fe(s,a){var m=s.code,b=s.error,u=s.prompt,S=new Date().getTime();if(s.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(s.kc_action_status),b){if(u!="none"){var w={error:b,error_description:s.error_description};o.onAuthError&&o.onAuthError(w),a&&a.setError(w)}else a&&a.setSuccess();return}else o.flow!="standard"&&(s.access_token||s.id_token)&&M(s.access_token,null,s.id_token,!0);if(o.flow!="implicit"&&m){var y="code="+m+"&grant_type=authorization_code",_=o.endpoints.token(),P=new XMLHttpRequest;P.open("POST",_,!0),P.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(o.clientId),y+="&redirect_uri="+s.redirectUri,s.pkceCodeVerifier&&(y+="&code_verifier="+s.pkceCodeVerifier),P.withCredentials=!0,P.onreadystatechange=function(){if(P.readyState==4)if(P.status==200){var H=JSON.parse(P.responseText);M(H.access_token,H.refresh_token,H.id_token,o.flow==="standard"),g()}else o.onAuthError&&o.onAuthError(),a&&a.setError()},P.send(y)}function M(H,he,pe,ne){S=(S+new Date().getTime())/2,Z(H,he,pe,S),p&&(o.tokenParsed&&o.tokenParsed.nonce!=s.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=s.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=s.storedNonce)?(K("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),a&&a.setError()):ne&&(o.onAuthSuccess&&o.onAuthSuccess(),a&&a.setSuccess())}}function J(s){var a=E(),m;l?typeof l=="string"&&(m=l):m="keycloak.json";function b(P){P?o.endpoints={authorize:function(){return P.authorization_endpoint},token:function(){return P.token_endpoint},logout:function(){if(!P.end_session_endpoint)throw"Not supported by the OIDC server";return P.end_session_endpoint},checkSessionIframe:function(){if(!P.check_session_iframe)throw"Not supported by the OIDC server";return P.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!P.userinfo_endpoint)throw"Not supported by the OIDC server";return P.userinfo_endpoint}}:o.endpoints={authorize:function(){return ce()+"/protocol/openid-connect/auth"},token:function(){return ce()+"/protocol/openid-connect/token"},logout:function(){return ce()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var M=ce()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},thirdPartyCookiesIframe:function(){var M=ce()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},register:function(){return ce()+"/protocol/openid-connect/registrations"},userinfo:function(){return ce()+"/protocol/openid-connect/userinfo"}}}if(m){var u=new XMLHttpRequest;u.open("GET",m,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var P=JSON.parse(u.responseText);o.authServerUrl=P["auth-server-url"],o.realm=P.realm,o.clientId=P.resource,b(null),a.setSuccess()}else a.setError()},u.send()}else{if(!l.clientId)throw"clientId missing";o.clientId=l.clientId;var S=l.oidcProvider;if(S)if(typeof S=="string"){var _;S.charAt(S.length-1)=="/"?_=S+".well-known/openid-configuration":_=S+"/.well-known/openid-configuration";var u=new XMLHttpRequest;u.open("GET",_,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var M=JSON.parse(u.responseText);b(M),a.setSuccess()}else a.setError()},u.send()}else b(S),a.setSuccess();else{if(!l.url){for(var w=document.getElementsByTagName("script"),y=0;y<w.length;y++)if(w[y].src.match(/.*keycloak\.js/)){l.url=w[y].src.substr(0,w[y].src.indexOf("/js/keycloak.js"));break}}if(!l.realm)throw"realm missing";o.authServerUrl=l.url,o.realm=l.realm,b(null),a.setSuccess()}}return a.promise}function we(s){return s.status==0&&s.responseText&&s.responseURL.startsWith("file:")}function Z(s,a,m,b){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),a?(o.refreshToken=a,o.refreshTokenParsed=et(a)):(delete o.refreshToken,delete o.refreshTokenParsed),m?(o.idToken=m,o.idTokenParsed=et(m)):(delete o.idToken,delete o.idTokenParsed),s){if(o.token=s,o.tokenParsed=et(s),o.sessionId=o.tokenParsed.session_state,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,b&&(o.timeSkew=Math.floor(b/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(K("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var u=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;K("[KEYCLOAK] Token expires in "+Math.round(u/1e3)+" s"),u<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,u)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function d(){var s="0123456789abcdef",a=j(36,s).split("");a[14]="4",a[19]=s.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var m=a.join("");return m}function C(s){var a=L(s);if(a){var m=U.get(a.state);return m&&(a.valid=!0,a.redirectUri=m.redirectUri,a.storedNonce=m.nonce,a.prompt=m.prompt,a.pkceCodeVerifier=m.pkceCodeVerifier),a}}function L(s){var a;switch(o.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var m=s.indexOf("?"),b=s.indexOf("#"),u,S;if(o.responseMode==="query"&&m!==-1?(u=s.substring(0,m),S=A(s.substring(m+1,b!==-1?b:s.length),a),S.paramsString!==""&&(u+="?"+S.paramsString),b!==-1&&(u+=s.substring(b))):o.responseMode==="fragment"&&b!==-1&&(u=s.substring(0,b),S=A(s.substring(b+1),a),S.paramsString!==""&&(u+="#"+S.paramsString)),S&&S.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((S.oauthParams.code||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}else if(o.flow==="implicit"&&(S.oauthParams.access_token||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}}function A(s,a){for(var m=s.split("&"),b={paramsString:"",oauthParams:{}},u=0;u<m.length;u++){var S=m[u].indexOf("="),w=m[u].slice(0,S);a.indexOf(w)!==-1?b.oauthParams[w]=m[u].slice(S+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=m[u])}return b}function E(){var s={setSuccess:function(a){s.resolve(a)},setError:function(a){s.reject(a)}};return s.promise=new Promise(function(a,m){s.resolve=a,s.reject=m}),s}function v(s,a,m){var b=null,u=new Promise(function(S,w){b=setTimeout(function(){w({error:m||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([s,u]).finally(function(){clearTimeout(b)})}function i(){var s=E();if(!x.enable||x.iframe)return s.setSuccess(),s.promise;var a=document.createElement("iframe");x.iframe=a,a.onload=function(){var u=o.endpoints.authorize();u.charAt(0)==="/"?x.iframeOrigin=Te():x.iframeOrigin=u.substring(0,u.indexOf("/",8)),s.setSuccess()};var m=o.endpoints.checkSessionIframe();a.setAttribute("src",m),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(u){if(!(u.origin!==x.iframeOrigin||x.iframe.contentWindow!==u.source)&&(u.data=="unchanged"||u.data=="changed"||u.data=="error")){u.data!="unchanged"&&o.clearToken();for(var S=x.callbackList.splice(0,x.callbackList.length),w=S.length-1;w>=0;--w){var y=S[w];u.data=="error"?y.setError():y.setSuccess(u.data=="unchanged")}}};return window.addEventListener("message",b,!1),s.promise}function g(){x.enable&&o.token&&setTimeout(function(){T().then(function(s){s&&g()})},x.interval*1e3)}function T(){var s=E();if(x.iframe&&x.iframeOrigin){var a=o.clientId+" "+(o.sessionId?o.sessionId:"");x.callbackList.push(s);var m=x.iframeOrigin;x.callbackList.length==1&&x.iframe.contentWindow.postMessage(a,m)}else s.setSuccess();return s.promise}function $(){var s=E();if(x.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var m=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(z(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
8
+ */(function(l){(function(){var o="input is invalid type",h=typeof window=="object",k=h?window:{};k.JS_SHA256_NO_WINDOW&&(h=!1);var U=!h&&typeof self=="object",x=!k.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;x?k=ke:U&&(k=self);var I=!k.JS_SHA256_NO_COMMON_JS&&!0&&l.exports,O=!k.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),K=[-2147483648,8388608,32768,128],z=[24,16,8,0],X=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ae=["hex","array","digest","arrayBuffer"],j=[];(k.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(d){return Object.prototype.toString.call(d)==="[object Array]"}),O&&(k.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(d){return typeof d=="object"&&d.buffer&&d.buffer.constructor===ArrayBuffer});var Ce=function(d,C){return function(L){return new J(C,!0).update(L)[d]()}},ge=function(d){var C=Ce("hex",d);x&&(C=ce(C,d)),C.create=function(){return new J(d)},C.update=function(E){return C.create().update(E)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Ce(A,d)}return C},ce=function(d,C){var L=yt,A=yt.Buffer,E=C?"sha224":"sha256",v;A.from&&!k.JS_SHA256_NO_BUFFER_FROM?v=A.from:v=function(g){return new A(g)};var i=function(g){if(typeof g=="string")return L.createHash(E).update(g,"utf8").digest("hex");if(g==null)throw new Error(o);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===A?L.createHash(E).update(v(g)).digest("hex"):d(g)};return i},Te=function(d,C){return function(L,A){return new we(L,C,!0).update(A)[d]()}},fe=function(d){var C=Te("hex",d);C.create=function(E){return new we(E,d)},C.update=function(E,v){return C.create(E).update(v)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Te(A,d)}return C};function J(d,C){C?(j[0]=j[16]=j[1]=j[2]=j[3]=j[4]=j[5]=j[6]=j[7]=j[8]=j[9]=j[10]=j[11]=j[12]=j[13]=j[14]=j[15]=0,this.blocks=j):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=d}J.prototype.update=function(d){if(!this.finalized){var C,L=typeof d;if(L!=="string"){if(L==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);C=!0}for(var A,E=0,v,i=d.length,g=this.blocks;E<i;){if(this.hashed&&(this.hashed=!1,g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),C)for(v=this.start;E<i&&v<64;++E)g[v>>2]|=d[E]<<z[v++&3];else for(v=this.start;E<i&&v<64;++E)A=d.charCodeAt(E),A<128?g[v>>2]|=A<<z[v++&3]:A<2048?(g[v>>2]|=(192|A>>6)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):A<55296||A>=57344?(g[v>>2]|=(224|A>>12)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):(A=65536+((A&1023)<<10|d.charCodeAt(++E)&1023),g[v>>2]|=(240|A>>18)<<z[v++&3],g[v>>2]|=(128|A>>12&63)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=g[16],this.start=v-64,this.hash(),this.hashed=!0):this.start=v}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var d=this.blocks,C=this.lastByteIndex;d[16]=this.block,d[C>>2]|=K[C&3],this.block=d[16],C>=56&&(this.hashed||this.hash(),d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),d[14]=this.hBytes<<3|this.bytes>>>29,d[15]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=this.blocks,$,q,F,G,N,te,s,a,m,b,u;for($=16;$<64;++$)N=T[$-15],q=(N>>>7|N<<25)^(N>>>18|N<<14)^N>>>3,N=T[$-2],F=(N>>>17|N<<15)^(N>>>19|N<<13)^N>>>10,T[$]=T[$-16]+q+T[$-7]+F<<0;for(u=C&L,$=0;$<64;$+=4)this.first?(this.is224?(a=300032,N=T[0]-1413257819,g=N-150054599<<0,A=N+24177077<<0):(a=704751109,N=T[0]-210244248,g=N-1521486534<<0,A=N+143694565<<0),this.first=!1):(q=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),F=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),a=d&C,G=a^d&L^u,s=E&v^~E&i,N=g+F+s+X[$]+T[$],te=q+G,g=A+N<<0,A=N+te<<0),q=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),F=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),m=A&d,G=m^A&C^a,s=g&E^~g&v,N=i+F+s+X[$+1]+T[$+1],te=q+G,i=L+N<<0,L=N+te<<0,q=(L>>>2|L<<30)^(L>>>13|L<<19)^(L>>>22|L<<10),F=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=L&A,G=b^L&d^m,s=i&g^~i&E,N=v+F+s+X[$+2]+T[$+2],te=q+G,v=C+N<<0,C=N+te<<0,q=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),F=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),u=C&L,G=u^C&A^b,s=v&i^~v&g,N=E+F+s+X[$+3]+T[$+3],te=q+G,E=d+N<<0,d=N+te<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+d<<0,this.h1=this.h1+C<<0,this.h2=this.h2+L<<0,this.h3=this.h3+A<<0,this.h4=this.h4+E<<0,this.h5=this.h5+v<<0,this.h6=this.h6+i<<0,this.h7=this.h7+g<<0},J.prototype.hex=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=p[d>>28&15]+p[d>>24&15]+p[d>>20&15]+p[d>>16&15]+p[d>>12&15]+p[d>>8&15]+p[d>>4&15]+p[d&15]+p[C>>28&15]+p[C>>24&15]+p[C>>20&15]+p[C>>16&15]+p[C>>12&15]+p[C>>8&15]+p[C>>4&15]+p[C&15]+p[L>>28&15]+p[L>>24&15]+p[L>>20&15]+p[L>>16&15]+p[L>>12&15]+p[L>>8&15]+p[L>>4&15]+p[L&15]+p[A>>28&15]+p[A>>24&15]+p[A>>20&15]+p[A>>16&15]+p[A>>12&15]+p[A>>8&15]+p[A>>4&15]+p[A&15]+p[E>>28&15]+p[E>>24&15]+p[E>>20&15]+p[E>>16&15]+p[E>>12&15]+p[E>>8&15]+p[E>>4&15]+p[E&15]+p[v>>28&15]+p[v>>24&15]+p[v>>20&15]+p[v>>16&15]+p[v>>12&15]+p[v>>8&15]+p[v>>4&15]+p[v&15]+p[i>>28&15]+p[i>>24&15]+p[i>>20&15]+p[i>>16&15]+p[i>>12&15]+p[i>>8&15]+p[i>>4&15]+p[i&15];return this.is224||(T+=p[g>>28&15]+p[g>>24&15]+p[g>>20&15]+p[g>>16&15]+p[g>>12&15]+p[g>>8&15]+p[g>>4&15]+p[g&15]),T},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=[d>>24&255,d>>16&255,d>>8&255,d&255,C>>24&255,C>>16&255,C>>8&255,C&255,L>>24&255,L>>16&255,L>>8&255,L&255,A>>24&255,A>>16&255,A>>8&255,A&255,E>>24&255,E>>16&255,E>>8&255,E&255,v>>24&255,v>>16&255,v>>8&255,v&255,i>>24&255,i>>16&255,i>>8&255,i&255];return this.is224||T.push(g>>24&255,g>>16&255,g>>8&255,g&255),T},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var d=new ArrayBuffer(this.is224?28:32),C=new DataView(d);return C.setUint32(0,this.h0),C.setUint32(4,this.h1),C.setUint32(8,this.h2),C.setUint32(12,this.h3),C.setUint32(16,this.h4),C.setUint32(20,this.h5),C.setUint32(24,this.h6),this.is224||C.setUint32(28,this.h7),d};function we(d,C,L){var A,E=typeof d;if(E==="string"){var v=[],i=d.length,g=0,T;for(A=0;A<i;++A)T=d.charCodeAt(A),T<128?v[g++]=T:T<2048?(v[g++]=192|T>>6,v[g++]=128|T&63):T<55296||T>=57344?(v[g++]=224|T>>12,v[g++]=128|T>>6&63,v[g++]=128|T&63):(T=65536+((T&1023)<<10|d.charCodeAt(++A)&1023),v[g++]=240|T>>18,v[g++]=128|T>>12&63,v[g++]=128|T>>6&63,v[g++]=128|T&63);d=v}else if(E==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);d.length>64&&(d=new J(C,!0).update(d).array());var $=[],q=[];for(A=0;A<64;++A){var F=d[A]||0;$[A]=92^F,q[A]=54^F}J.call(this,C,L),this.update(q),this.oKeyPad=$,this.inner=!0,this.sharedMemory=L}we.prototype=new J,we.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var d=this.array();J.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(d),J.prototype.finalize.call(this)}};var Z=ge();Z.sha256=Z,Z.sha224=ge(!0),Z.sha256.hmac=fe(),Z.sha224.hmac=fe(!0),I?l.exports=Z:(k.sha256=Z.sha256,k.sha224=Z.sha224)})()})(wt);var xn=wt.exports;const Cn=gt(xn);class Ve extends Error{}Ve.prototype.name="InvalidTokenError";function An(l){return decodeURIComponent(atob(l).replace(/(.)/g,(o,h)=>{let k=h.charCodeAt(0).toString(16).toUpperCase();return k.length<2&&(k="0"+k),"%"+k}))}function Sn(l){let o=l.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return An(o)}catch{return atob(o)}}function et(l,o){if(typeof l!="string")throw new Ve("Invalid token specified: must be a string");o||(o={});const h=o.header===!0?0:1,k=l.split(".")[h];if(typeof k!="string")throw new Ve(`Invalid token specified: missing part #${h+1}`);let U;try{U=Sn(k)}catch(x){throw new Ve(`Invalid token specified: invalid base64 for part #${h+1} (${x.message})`)}try{return JSON.parse(U)}catch(x){throw new Ve(`Invalid token specified: invalid json for part #${h+1} (${x.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function vt(l){if(!(this instanceof vt))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,h,k=[],U,x={enable:!0,callbackList:[],interval:5},I=document.getElementsByTagName("script"),O=0;O<I.length;O++)(I[O].src.indexOf("keycloak.js")!==-1||I[O].src.indexOf("keycloak.min.js")!==-1)&&I[O].src.indexOf("version=")!==-1&&(o.iframeVersion=I[O].src.substring(I[O].src.indexOf("version=")+8).split("&")[0]);var p=!0,K=te(console.info),z=te(console.warn);o.init=function(s){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,U=N();var a=["default","cordova","cordova-native"];if(s&&a.indexOf(s.adapter)>-1?h=q(s.adapter):s&&typeof s.adapter=="object"?h=s.adapter:window.Cordova||window.cordova?h=q("cordova"):h=q(),s){if(typeof s.useNonce<"u"&&(p=s.useNonce),typeof s.checkLoginIframe<"u"&&(x.enable=s.checkLoginIframe),s.checkLoginIframeInterval&&(x.interval=s.checkLoginIframeInterval),s.onLoad==="login-required"&&(o.loginRequired=!0),s.responseMode)if(s.responseMode==="query"||s.responseMode==="fragment")o.responseMode=s.responseMode;else throw"Invalid value for responseMode";if(s.flow){switch(s.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=s.flow}if(s.timeSkew!=null&&(o.timeSkew=s.timeSkew),s.redirectUri&&(o.redirectUri=s.redirectUri),s.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=s.silentCheckSsoRedirectUri),typeof s.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=s.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,s.pkceMethod){if(s.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=s.pkceMethod}typeof s.enableLogging=="boolean"?o.enableLogging=s.enableLogging:o.enableLogging=!1,typeof s.scope=="string"&&(o.scope=s.scope),typeof s.acrValues=="string"&&(o.acrValues=s.acrValues),typeof s.messageReceiveTimeout=="number"&&s.messageReceiveTimeout>0?o.messageReceiveTimeout=s.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var m=E(),b=E();b.promise.then(function(){o.onReady&&o.onReady(o.authenticated),m.setSuccess(o.authenticated)}).catch(function(_){m.setError(_)});var u=J();function S(){var _=function(H){H||(M.prompt="none"),s&&s.locale&&(M.locale=s.locale),o.login(M).then(function(){b.setSuccess()}).catch(function(he){b.setError(he)})},B=function(){var H=document.createElement("iframe"),he=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});H.setAttribute("src",he),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var pe=function(ne){if(!(ne.origin!==window.location.origin||H.contentWindow!==ne.source)){var ye=C(ne.data);fe(ye,b),document.body.removeChild(H),window.removeEventListener("message",pe)}};window.addEventListener("message",pe)},M={};switch(s.onLoad){case"check-sso":x.enable?i().then(function(){T().then(function(H){H?b.setSuccess():o.silentCheckSsoRedirectUri?B():_(!1)}).catch(function(H){b.setError(H)})}):o.silentCheckSsoRedirectUri?B():_(!1);break;case"login-required":_(!0);break;default:throw"Invalid value for onLoad"}}function w(){var _=C(window.location.href);if(_&&window.history.replaceState(window.history.state,null,_.newUrl),_&&_.valid)return i().then(function(){fe(_,b)}).catch(function(B){b.setError(B)});s?s.token&&s.refreshToken?(Z(s.token,s.refreshToken,s.idToken),x.enable?i().then(function(){T().then(function(B){B?(o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess(),g()):b.setSuccess()}).catch(function(B){b.setError(B)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess()}).catch(function(B){o.onAuthError&&o.onAuthError(),s.onLoad?S():b.setError(B)})):s.onLoad?S():b.setSuccess():b.setSuccess()}function y(){var _=E(),B=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",B),_.setSuccess())};return document.addEventListener("readystatechange",B),B(),_.promise}return u.then(function(){y().then($).then(w).catch(function(_){m.setError(_)})}),u.catch(function(_){m.setError(_)}),m.promise},o.login=function(s){return h.login(s)};function X(s){var a=null,m=window.crypto||window.msCrypto;if(m&&m.getRandomValues&&window.Uint8Array)return a=new Uint8Array(s),m.getRandomValues(a),a;a=new Array(s);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function ae(s){return j(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function j(s,a){for(var m=X(s),b=new Array(s),u=0;u<s;u++)b[u]=a.charCodeAt(m[u]%a.length);return String.fromCharCode.apply(null,b)}function Ce(s,a){switch(s){case"S256":var m=new Uint8Array(Cn.arrayBuffer(a)),b=qe.fromByteArray(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ge(s){var a={id_token:{acr:s}};return JSON.stringify(a)}o.createLoginUrl=function(s){var a=d(),m=d(),b=h.redirectUri(s),u={state:a,nonce:m,redirectUri:encodeURIComponent(b)};s&&s.prompt&&(u.prompt=s.prompt);var S;s&&s.action=="register"?S=o.endpoints.register():S=o.endpoints.authorize();var w=s&&s.scope||o.scope;w?w.indexOf("openid")===-1&&(w="openid "+w):w="openid";var y=S+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(w);if(p&&(y=y+"&nonce="+encodeURIComponent(m)),s&&s.prompt&&(y+="&prompt="+encodeURIComponent(s.prompt)),s&&s.maxAge&&(y+="&max_age="+encodeURIComponent(s.maxAge)),s&&s.loginHint&&(y+="&login_hint="+encodeURIComponent(s.loginHint)),s&&s.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(s.idpHint)),s&&s.action&&s.action!="register"&&(y+="&kc_action="+encodeURIComponent(s.action)),s&&s.locale&&(y+="&ui_locales="+encodeURIComponent(s.locale)),s&&s.acr){var _=ge(s.acr);y+="&claims="+encodeURIComponent(_)}if((s&&s.acrValues||o.acrValues)&&(y+="&acr_values="+encodeURIComponent(s.acrValues||o.acrValues)),o.pkceMethod){var B=ae(96);u.pkceCodeVerifier=B;var M=Ce(o.pkceMethod,B);y+="&code_challenge="+M,y+="&code_challenge_method="+o.pkceMethod}return U.add(u),y},o.logout=function(s){return h.logout(s)},o.createLogoutUrl=function(s){var a=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(h.redirectUri(s,!1));return o.idToken&&(a+="&id_token_hint="+encodeURIComponent(o.idToken)),a},o.register=function(s){return h.register(s)},o.createRegisterUrl=function(s){return s||(s={}),s.action="register",o.createLoginUrl(s)},o.createAccountUrl=function(s){var a=ce(),m=void 0;return typeof a<"u"&&(m=a+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(h.redirectUri(s))),m},o.accountManagement=function(){return h.accountManagement()},o.hasRealmRole=function(s){var a=o.realmAccess;return!!a&&a.roles.indexOf(s)>=0},o.hasResourceRole=function(s,a){if(!o.resourceAccess)return!1;var m=o.resourceAccess[a||o.clientId];return!!m&&m.roles.indexOf(s)>=0},o.loadUserProfile=function(){var s=ce()+"/account",a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.profile=JSON.parse(a.responseText),m.setSuccess(o.profile)):m.setError())},a.send(),m.promise},o.loadUserInfo=function(){var s=o.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.userInfo=JSON.parse(a.responseText),m.setSuccess(o.userInfo)):m.setError())},a.send(),m.promise},o.isTokenExpired=function(s){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return K("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(s){if(isNaN(s))throw"Invalid minValidity";a-=s}return a<0},o.updateToken=function(s){var a=E();if(!o.refreshToken)return a.setError(),a.promise;s=s||5;var m=function(){var u=!1;if(s==-1?(u=!0,K("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(s))&&(u=!0,K("[KEYCLOAK] Refreshing token: token expired")),!u)a.setSuccess(!1);else{var S="grant_type=refresh_token&refresh_token="+o.refreshToken,w=o.endpoints.token();if(k.push(a),k.length==1){var y=new XMLHttpRequest;y.open("POST",w,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,S+="&client_id="+encodeURIComponent(o.clientId);var _=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){K("[KEYCLOAK] Token refreshed"),_=(_+new Date().getTime())/2;var B=JSON.parse(y.responseText);Z(B.access_token,B.refresh_token,B.id_token,_),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var M=k.pop();M!=null;M=k.pop())M.setSuccess(!0)}else{z("[KEYCLOAK] Failed to refresh token"),y.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var M=k.pop();M!=null;M=k.pop())M.setError(!0)}},y.send(S)}}};if(x.enable){var b=T();b.then(function(){m()}).catch(function(u){a.setError(u)})}else m();return a.promise},o.clearToken=function(){o.token&&(Z(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())},o.setToken=Z;function ce(){if(typeof o.authServerUrl<"u")return o.authServerUrl.charAt(o.authServerUrl.length-1)=="/"?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function Te(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function fe(s,a){var m=s.code,b=s.error,u=s.prompt,S=new Date().getTime();if(s.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(s.kc_action_status),b){if(u!="none"){var w={error:b,error_description:s.error_description};o.onAuthError&&o.onAuthError(w),a&&a.setError(w)}else a&&a.setSuccess();return}else o.flow!="standard"&&(s.access_token||s.id_token)&&M(s.access_token,null,s.id_token,!0);if(o.flow!="implicit"&&m){var y="code="+m+"&grant_type=authorization_code",_=o.endpoints.token(),B=new XMLHttpRequest;B.open("POST",_,!0),B.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(o.clientId),y+="&redirect_uri="+s.redirectUri,s.pkceCodeVerifier&&(y+="&code_verifier="+s.pkceCodeVerifier),B.withCredentials=!0,B.onreadystatechange=function(){if(B.readyState==4)if(B.status==200){var H=JSON.parse(B.responseText);M(H.access_token,H.refresh_token,H.id_token,o.flow==="standard"),g()}else o.onAuthError&&o.onAuthError(),a&&a.setError()},B.send(y)}function M(H,he,pe,ne){S=(S+new Date().getTime())/2,Z(H,he,pe,S),p&&(o.tokenParsed&&o.tokenParsed.nonce!=s.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=s.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=s.storedNonce)?(K("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),a&&a.setError()):ne&&(o.onAuthSuccess&&o.onAuthSuccess(),a&&a.setSuccess())}}function J(s){var a=E(),m;l?typeof l=="string"&&(m=l):m="keycloak.json";function b(B){B?o.endpoints={authorize:function(){return B.authorization_endpoint},token:function(){return B.token_endpoint},logout:function(){if(!B.end_session_endpoint)throw"Not supported by the OIDC server";return B.end_session_endpoint},checkSessionIframe:function(){if(!B.check_session_iframe)throw"Not supported by the OIDC server";return B.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!B.userinfo_endpoint)throw"Not supported by the OIDC server";return B.userinfo_endpoint}}:o.endpoints={authorize:function(){return ce()+"/protocol/openid-connect/auth"},token:function(){return ce()+"/protocol/openid-connect/token"},logout:function(){return ce()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var M=ce()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},thirdPartyCookiesIframe:function(){var M=ce()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},register:function(){return ce()+"/protocol/openid-connect/registrations"},userinfo:function(){return ce()+"/protocol/openid-connect/userinfo"}}}if(m){var u=new XMLHttpRequest;u.open("GET",m,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var B=JSON.parse(u.responseText);o.authServerUrl=B["auth-server-url"],o.realm=B.realm,o.clientId=B.resource,b(null),a.setSuccess()}else a.setError()},u.send()}else{if(!l.clientId)throw"clientId missing";o.clientId=l.clientId;var S=l.oidcProvider;if(S)if(typeof S=="string"){var _;S.charAt(S.length-1)=="/"?_=S+".well-known/openid-configuration":_=S+"/.well-known/openid-configuration";var u=new XMLHttpRequest;u.open("GET",_,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var M=JSON.parse(u.responseText);b(M),a.setSuccess()}else a.setError()},u.send()}else b(S),a.setSuccess();else{if(!l.url){for(var w=document.getElementsByTagName("script"),y=0;y<w.length;y++)if(w[y].src.match(/.*keycloak\.js/)){l.url=w[y].src.substr(0,w[y].src.indexOf("/js/keycloak.js"));break}}if(!l.realm)throw"realm missing";o.authServerUrl=l.url,o.realm=l.realm,b(null),a.setSuccess()}}return a.promise}function we(s){return s.status==0&&s.responseText&&s.responseURL.startsWith("file:")}function Z(s,a,m,b){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),a?(o.refreshToken=a,o.refreshTokenParsed=et(a)):(delete o.refreshToken,delete o.refreshTokenParsed),m?(o.idToken=m,o.idTokenParsed=et(m)):(delete o.idToken,delete o.idTokenParsed),s){if(o.token=s,o.tokenParsed=et(s),o.sessionId=o.tokenParsed.session_state,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,b&&(o.timeSkew=Math.floor(b/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(K("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var u=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;K("[KEYCLOAK] Token expires in "+Math.round(u/1e3)+" s"),u<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,u)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function d(){var s="0123456789abcdef",a=j(36,s).split("");a[14]="4",a[19]=s.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var m=a.join("");return m}function C(s){var a=L(s);if(a){var m=U.get(a.state);return m&&(a.valid=!0,a.redirectUri=m.redirectUri,a.storedNonce=m.nonce,a.prompt=m.prompt,a.pkceCodeVerifier=m.pkceCodeVerifier),a}}function L(s){var a;switch(o.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var m=s.indexOf("?"),b=s.indexOf("#"),u,S;if(o.responseMode==="query"&&m!==-1?(u=s.substring(0,m),S=A(s.substring(m+1,b!==-1?b:s.length),a),S.paramsString!==""&&(u+="?"+S.paramsString),b!==-1&&(u+=s.substring(b))):o.responseMode==="fragment"&&b!==-1&&(u=s.substring(0,b),S=A(s.substring(b+1),a),S.paramsString!==""&&(u+="#"+S.paramsString)),S&&S.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((S.oauthParams.code||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}else if(o.flow==="implicit"&&(S.oauthParams.access_token||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}}function A(s,a){for(var m=s.split("&"),b={paramsString:"",oauthParams:{}},u=0;u<m.length;u++){var S=m[u].indexOf("="),w=m[u].slice(0,S);a.indexOf(w)!==-1?b.oauthParams[w]=m[u].slice(S+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=m[u])}return b}function E(){var s={setSuccess:function(a){s.resolve(a)},setError:function(a){s.reject(a)}};return s.promise=new Promise(function(a,m){s.resolve=a,s.reject=m}),s}function v(s,a,m){var b=null,u=new Promise(function(S,w){b=setTimeout(function(){w({error:m||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([s,u]).finally(function(){clearTimeout(b)})}function i(){var s=E();if(!x.enable||x.iframe)return s.setSuccess(),s.promise;var a=document.createElement("iframe");x.iframe=a,a.onload=function(){var u=o.endpoints.authorize();u.charAt(0)==="/"?x.iframeOrigin=Te():x.iframeOrigin=u.substring(0,u.indexOf("/",8)),s.setSuccess()};var m=o.endpoints.checkSessionIframe();a.setAttribute("src",m),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(u){if(!(u.origin!==x.iframeOrigin||x.iframe.contentWindow!==u.source)&&(u.data=="unchanged"||u.data=="changed"||u.data=="error")){u.data!="unchanged"&&o.clearToken();for(var S=x.callbackList.splice(0,x.callbackList.length),w=S.length-1;w>=0;--w){var y=S[w];u.data=="error"?y.setError():y.setSuccess(u.data=="unchanged")}}};return window.addEventListener("message",b,!1),s.promise}function g(){x.enable&&o.token&&setTimeout(function(){T().then(function(s){s&&g()})},x.interval*1e3)}function T(){var s=E();if(x.iframe&&x.iframeOrigin){var a=o.clientId+" "+(o.sessionId?o.sessionId:"");x.callbackList.push(s);var m=x.iframeOrigin;x.callbackList.length==1&&x.iframe.contentWindow.postMessage(a,m)}else s.setSuccess();return s.promise}function $(){var s=E();if(x.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var m=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(z(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
9
9
 
10
10
  - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
11
11
  - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
12
12
 
13
- For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),x.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",m),s.setSuccess()))};window.addEventListener("message",m,!1)}else s.setSuccess();return v(s.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function q(s){if(!s||s=="default")return{login:function(w){return window.location.assign(o.createLoginUrl(w)),E().promise},logout:function(w){return window.location.replace(o.createLogoutUrl(w)),E().promise},register:function(w){return window.location.assign(o.createRegisterUrl(w)),E().promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.location.href=w;else throw"Not supported by the OIDC server";return E().promise},redirectUri:function(w,y){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:location.href}};if(s=="cordova"){x.enable=!1;var a=function(w,y,_){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(w,y,_):window.open(w,y,_)},m=function(w){return w&&w.cordovaOptions?Object.keys(w.cordovaOptions).reduce(function(y,_){return y[_]=w.cordovaOptions[_],y},{}):{}},b=function(w){return Object.keys(w).reduce(function(y,_){return y.push(_+"="+w[_]),y},[]).join(",")},u=function(w){var y=m(w);return y.location="no",w&&w.prompt=="none"&&(y.hidden="yes"),b(y)},S=function(){return o.redirectUri||"http://localhost"};return{login:function(w){var y=E(),_=u(w),P=o.createLoginUrl(w),M=a(P,"_blank",_),H=!1,he=!1,pe=function(){he=!0,M.close()};return M.addEventListener("loadstart",function(ne){if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}}),M.addEventListener("loaderror",function(ne){if(!H)if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}else y.setError(),pe()}),M.addEventListener("exit",function(ne){he||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w),P=a(_,"_blank","location=no,hidden=yes,clearcache=yes"),M;return P.addEventListener("loadstart",function(H){H.url.indexOf(S())==0&&P.close()}),P.addEventListener("loaderror",function(H){H.url.indexOf(S())==0||(M=!0),P.close()}),P.addEventListener("exit",function(H){M?y.setError():(o.clearToken(),y.setSuccess())}),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(),P=u(w),M=a(_,"_blank",P);return M.addEventListener("loadstart",function(H){if(H.url.indexOf(S())==0){M.close();var he=C(H.url);fe(he,y)}}),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u"){var y=a(w,"_blank","location=no");y.addEventListener("loadstart",function(_){_.url.indexOf(S())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(w){return S()}}}if(s=="cordova-native")return x.enable=!1,{login:function(w){var y=E(),_=o.createLoginUrl(w);return universalLinks.subscribe("keycloak",function(P){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(P.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w);return universalLinks.subscribe("keycloak",function(P){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),y.setSuccess()}),window.cordova.plugins.browsertab.openUrl(_),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(w);return universalLinks.subscribe("keycloak",function(P){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(P.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.cordova.plugins.browsertab.openUrl(w);else throw"Not supported by the OIDC server"},redirectUri:function(w){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+s}var F=function(){if(!(this instanceof F))return new F;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var s=this;function a(){for(var m=new Date().getTime(),b=0;b<localStorage.length;b++){var u=localStorage.key(b);if(u&&u.indexOf("kc-callback-")==0){var S=localStorage.getItem(u);if(S)try{var w=JSON.parse(S).expires;(!w||w<m)&&localStorage.removeItem(u)}catch{localStorage.removeItem(u)}}}}s.get=function(m){if(m){var b="kc-callback-"+m,u=localStorage.getItem(b);return u&&(localStorage.removeItem(b),u=JSON.parse(u)),a(),u}},s.add=function(m){a();var b="kc-callback-"+m.state;m.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(b,JSON.stringify(m))}},G=function(){if(!(this instanceof G))return new G;var s=this;s.get=function(u){if(u){var S=m("kc-callback-"+u);if(b("kc-callback-"+u,"",a(-100)),S)return JSON.parse(S)}},s.add=function(u){b("kc-callback-"+u.state,JSON.stringify(u),a(60))},s.removeItem=function(u){b(u,"",a(-100))};var a=function(u){var S=new Date;return S.setTime(S.getTime()+u*60*1e3),S},m=function(u){for(var S=u+"=",w=document.cookie.split(";"),y=0;y<w.length;y++){for(var _=w[y];_.charAt(0)==" ";)_=_.substring(1);if(_.indexOf(S)==0)return _.substring(S.length,_.length)}return""},b=function(u,S,w){var y=u+"="+S+"; expires="+w.toUTCString()+"; ";document.cookie=y}};function N(){try{return new F}catch{}return new G}function te(s){return function(){o.enableLogging&&s.apply(console,Array.prototype.slice.call(arguments))}}}const ze=new vt,En=(l,o)=>{ze.init({onLoad:"login-required"}).then(async h=>{h&&await _n(),l()}).catch(h=>{o(h)})},_n=async()=>{const l=await ze.loadUserInfo();ee.User.email=l.email??"",ee.User.emailVerified=l.email_verified===!0,ee.User.firstName=l.given_name??"",ee.User.lastName=l.family_name??"",ee.User.name=l.name??"",ee.User.sub=l.sub??"",ee.User.username=l.preferred_username??"",ee.User.roles=[...l.role??[]],ee.User.groups=[...l.group??[]],ee.User.IsInRole=o=>ee.User.roles.includes(o)},ee={Instance:ze,User:{},CallLogin:En,CallLogout:()=>{ze.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})}};var kt={exports:{}};/*!
13
+ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),x.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",m),s.setSuccess()))};window.addEventListener("message",m,!1)}else s.setSuccess();return v(s.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function q(s){if(!s||s=="default")return{login:function(w){return window.location.assign(o.createLoginUrl(w)),E().promise},logout:function(w){return window.location.replace(o.createLogoutUrl(w)),E().promise},register:function(w){return window.location.assign(o.createRegisterUrl(w)),E().promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.location.href=w;else throw"Not supported by the OIDC server";return E().promise},redirectUri:function(w,y){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:location.href}};if(s=="cordova"){x.enable=!1;var a=function(w,y,_){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(w,y,_):window.open(w,y,_)},m=function(w){return w&&w.cordovaOptions?Object.keys(w.cordovaOptions).reduce(function(y,_){return y[_]=w.cordovaOptions[_],y},{}):{}},b=function(w){return Object.keys(w).reduce(function(y,_){return y.push(_+"="+w[_]),y},[]).join(",")},u=function(w){var y=m(w);return y.location="no",w&&w.prompt=="none"&&(y.hidden="yes"),b(y)},S=function(){return o.redirectUri||"http://localhost"};return{login:function(w){var y=E(),_=u(w),B=o.createLoginUrl(w),M=a(B,"_blank",_),H=!1,he=!1,pe=function(){he=!0,M.close()};return M.addEventListener("loadstart",function(ne){if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}}),M.addEventListener("loaderror",function(ne){if(!H)if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}else y.setError(),pe()}),M.addEventListener("exit",function(ne){he||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w),B=a(_,"_blank","location=no,hidden=yes,clearcache=yes"),M;return B.addEventListener("loadstart",function(H){H.url.indexOf(S())==0&&B.close()}),B.addEventListener("loaderror",function(H){H.url.indexOf(S())==0||(M=!0),B.close()}),B.addEventListener("exit",function(H){M?y.setError():(o.clearToken(),y.setSuccess())}),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(),B=u(w),M=a(_,"_blank",B);return M.addEventListener("loadstart",function(H){if(H.url.indexOf(S())==0){M.close();var he=C(H.url);fe(he,y)}}),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u"){var y=a(w,"_blank","location=no");y.addEventListener("loadstart",function(_){_.url.indexOf(S())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(w){return S()}}}if(s=="cordova-native")return x.enable=!1,{login:function(w){var y=E(),_=o.createLoginUrl(w);return universalLinks.subscribe("keycloak",function(B){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(B.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w);return universalLinks.subscribe("keycloak",function(B){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),y.setSuccess()}),window.cordova.plugins.browsertab.openUrl(_),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(w);return universalLinks.subscribe("keycloak",function(B){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(B.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.cordova.plugins.browsertab.openUrl(w);else throw"Not supported by the OIDC server"},redirectUri:function(w){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+s}var F=function(){if(!(this instanceof F))return new F;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var s=this;function a(){for(var m=new Date().getTime(),b=0;b<localStorage.length;b++){var u=localStorage.key(b);if(u&&u.indexOf("kc-callback-")==0){var S=localStorage.getItem(u);if(S)try{var w=JSON.parse(S).expires;(!w||w<m)&&localStorage.removeItem(u)}catch{localStorage.removeItem(u)}}}}s.get=function(m){if(m){var b="kc-callback-"+m,u=localStorage.getItem(b);return u&&(localStorage.removeItem(b),u=JSON.parse(u)),a(),u}},s.add=function(m){a();var b="kc-callback-"+m.state;m.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(b,JSON.stringify(m))}},G=function(){if(!(this instanceof G))return new G;var s=this;s.get=function(u){if(u){var S=m("kc-callback-"+u);if(b("kc-callback-"+u,"",a(-100)),S)return JSON.parse(S)}},s.add=function(u){b("kc-callback-"+u.state,JSON.stringify(u),a(60))},s.removeItem=function(u){b(u,"",a(-100))};var a=function(u){var S=new Date;return S.setTime(S.getTime()+u*60*1e3),S},m=function(u){for(var S=u+"=",w=document.cookie.split(";"),y=0;y<w.length;y++){for(var _=w[y];_.charAt(0)==" ";)_=_.substring(1);if(_.indexOf(S)==0)return _.substring(S.length,_.length)}return""},b=function(u,S,w){var y=u+"="+S+"; expires="+w.toUTCString()+"; ";document.cookie=y}};function N(){try{return new F}catch{}return new G}function te(s){return function(){o.enableLogging&&s.apply(console,Array.prototype.slice.call(arguments))}}}const ze=new vt,En=(l,o)=>{ze.init({onLoad:"login-required"}).then(async h=>{h&&await _n(),l()}).catch(h=>{o(h)})},_n=async()=>{const l=await ze.loadUserInfo();ee.User.email=l.email??"",ee.User.emailVerified=l.email_verified===!0,ee.User.firstName=l.given_name??"",ee.User.lastName=l.family_name??"",ee.User.name=l.name??"",ee.User.sub=l.sub??"",ee.User.username=l.preferred_username??"",ee.User.roles=[...l.role??[]],ee.User.groups=[...l.group??[]],ee.User.IsInRole=o=>ee.User.roles.includes(o)},ee={Instance:ze,User:{},CallLogin:En,CallLogout:()=>{ze.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})}};var kt={exports:{}};/*!
14
14
  * sweetalert2 v11.4.8
15
15
  * Released under the MIT License.
16
- */(function(l,o){(function(h,k){l.exports=k()})(ke,function(){const h="SweetAlert2:",k=e=>{const t=[];for(let n=0;n<e.length;n++)t.indexOf(e[n])===-1&&t.push(e[n]);return t},U=e=>e.charAt(0).toUpperCase()+e.slice(1),x=e=>Array.prototype.slice.call(e),I=e=>{console.warn("".concat(h," ").concat(typeof e=="object"?e.join(" "):e))},O=e=>{console.error("".concat(h," ").concat(e))},p=[],K=e=>{p.includes(e)||(p.push(e),I(e))},z=(e,t)=>{K('"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'))},X=e=>typeof e=="function"?e():e,ae=e=>e&&typeof e.toPromise=="function",j=e=>ae(e)?e.toPromise():Promise.resolve(e),Ce=e=>e&&Promise.resolve(e)===e,ge={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},ce=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Te={},fe=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],J=e=>Object.prototype.hasOwnProperty.call(ge,e),we=e=>ce.indexOf(e)!==-1,Z=e=>Te[e],d=e=>{J(e)||I('Unknown parameter "'.concat(e,'"'))},C=e=>{fe.includes(e)&&I('The parameter "'.concat(e,'" is incompatible with toasts'))},L=e=>{Z(e)&&z(e,Z(e))},A=e=>{!e.backdrop&&e.allowOutsideClick&&I('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)d(t),e.toast&&C(t),L(t)},E="swal2-",v=e=>{const t={};for(const n in e)t[e[n]]=E+e[n];return t},i=v(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),g=v(["success","warning","info","question","error"]),T=()=>document.body.querySelector(".".concat(i.container)),$=e=>{const t=T();return t?t.querySelector(e):null},q=e=>$(".".concat(e)),F=()=>q(i.popup),G=()=>q(i.icon),N=()=>q(i.title),te=()=>q(i["html-container"]),s=()=>q(i.image),a=()=>q(i["progress-steps"]),m=()=>q(i["validation-message"]),b=()=>$(".".concat(i.actions," .").concat(i.confirm)),u=()=>$(".".concat(i.actions," .").concat(i.deny)),S=()=>q(i["input-label"]),w=()=>$(".".concat(i.loader)),y=()=>$(".".concat(i.actions," .").concat(i.cancel)),_=()=>q(i.actions),P=()=>q(i.footer),M=()=>q(i["timer-progress-bar"]),H=()=>q(i.close),he=`
16
+ */(function(l,o){(function(h,k){l.exports=k()})(ke,function(){const h="SweetAlert2:",k=e=>{const t=[];for(let n=0;n<e.length;n++)t.indexOf(e[n])===-1&&t.push(e[n]);return t},U=e=>e.charAt(0).toUpperCase()+e.slice(1),x=e=>Array.prototype.slice.call(e),I=e=>{console.warn("".concat(h," ").concat(typeof e=="object"?e.join(" "):e))},O=e=>{console.error("".concat(h," ").concat(e))},p=[],K=e=>{p.includes(e)||(p.push(e),I(e))},z=(e,t)=>{K('"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'))},X=e=>typeof e=="function"?e():e,ae=e=>e&&typeof e.toPromise=="function",j=e=>ae(e)?e.toPromise():Promise.resolve(e),Ce=e=>e&&Promise.resolve(e)===e,ge={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},ce=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Te={},fe=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],J=e=>Object.prototype.hasOwnProperty.call(ge,e),we=e=>ce.indexOf(e)!==-1,Z=e=>Te[e],d=e=>{J(e)||I('Unknown parameter "'.concat(e,'"'))},C=e=>{fe.includes(e)&&I('The parameter "'.concat(e,'" is incompatible with toasts'))},L=e=>{Z(e)&&z(e,Z(e))},A=e=>{!e.backdrop&&e.allowOutsideClick&&I('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)d(t),e.toast&&C(t),L(t)},E="swal2-",v=e=>{const t={};for(const n in e)t[e[n]]=E+e[n];return t},i=v(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),g=v(["success","warning","info","question","error"]),T=()=>document.body.querySelector(".".concat(i.container)),$=e=>{const t=T();return t?t.querySelector(e):null},q=e=>$(".".concat(e)),F=()=>q(i.popup),G=()=>q(i.icon),N=()=>q(i.title),te=()=>q(i["html-container"]),s=()=>q(i.image),a=()=>q(i["progress-steps"]),m=()=>q(i["validation-message"]),b=()=>$(".".concat(i.actions," .").concat(i.confirm)),u=()=>$(".".concat(i.actions," .").concat(i.deny)),S=()=>q(i["input-label"]),w=()=>$(".".concat(i.loader)),y=()=>$(".".concat(i.actions," .").concat(i.cancel)),_=()=>q(i.actions),B=()=>q(i.footer),M=()=>q(i["timer-progress-bar"]),H=()=>q(i.close),he=`
17
17
  a[href],
18
18
  area[href],
19
19
  input:not([disabled]),
@@ -28,7 +28,7 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
28
28
  audio[controls],
29
29
  video[controls],
30
30
  summary
31
- `,pe=()=>{const e=x(F().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n,r)=>{const f=parseInt(n.getAttribute("tabindex")),B=parseInt(r.getAttribute("tabindex"));return f>B?1:f<B?-1:0}),t=x(F().querySelectorAll(he)).filter(n=>n.getAttribute("tabindex")!=="-1");return k(e.concat(t)).filter(n=>le(n))},ne=()=>xe(document.body,i.shown)&&!xe(document.body,i["toast-shown"])&&!xe(document.body,i["no-backdrop"]),ye=()=>F()&&xe(F(),i.toast),co=()=>F().hasAttribute("data-loading"),Ie={previousBodyPadding:null},oe=(e,t)=>{if(e.textContent="",t){const r=new DOMParser().parseFromString(t,"text/html");x(r.querySelector("head").childNodes).forEach(f=>{e.appendChild(f)}),x(r.querySelector("body").childNodes).forEach(f=>{e.appendChild(f)})}},xe=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let r=0;r<n.length;r++)if(!e.classList.contains(n[r]))return!1;return!0},lo=(e,t)=>{x(e.classList).forEach(n=>{!Object.values(i).includes(n)&&!Object.values(g).includes(n)&&!Object.values(t.showClass).includes(n)&&e.classList.remove(n)})},me=(e,t,n)=>{if(lo(e,t),t.customClass&&t.customClass[n]){if(typeof t.customClass[n]!="string"&&!t.customClass[n].forEach)return I("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));D(e,t.customClass[n])}},nt=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(i.popup," > .").concat(i[t]));case"checkbox":return e.querySelector(".".concat(i.popup," > .").concat(i.checkbox," input"));case"radio":return e.querySelector(".".concat(i.popup," > .").concat(i.radio," input:checked"))||e.querySelector(".".concat(i.popup," > .").concat(i.radio," input:first-child"));case"range":return e.querySelector(".".concat(i.popup," > .").concat(i.range," input"));default:return e.querySelector(".".concat(i.popup," > .").concat(i.input))}},At=e=>{if(e.focus(),e.type!=="file"){const t=e.value;e.value="",e.value=t}},St=(e,t,n)=>{!e||!t||(typeof t=="string"&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(r=>{Array.isArray(e)?e.forEach(f=>{n?f.classList.add(r):f.classList.remove(r)}):n?e.classList.add(r):e.classList.remove(r)}))},D=(e,t)=>{St(e,t,!0)},ve=(e,t)=>{St(e,t,!1)},Ae=(e,t)=>{const n=x(e.childNodes);for(let r=0;r<n.length;r++)if(xe(n[r],t))return n[r]},Re=(e,t,n)=>{n==="".concat(parseInt(n))&&(n=parseInt(n)),n||parseInt(n)===0?e.style[t]=typeof n=="number"?"".concat(n,"px"):n:e.style.removeProperty(t)},Q=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"flex";e.style.display=t},re=e=>{e.style.display="none"},Et=(e,t,n,r)=>{const f=e.querySelector(t);f&&(f.style[n]=r)},We=(e,t,n)=>{t?Q(e,n):re(e)},le=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),uo=()=>!le(b())&&!le(u())&&!le(y()),_t=e=>e.scrollHeight>e.clientHeight,Pt=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),r=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||r>0},ot=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=M();le(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))},fo=()=>{const e=M(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=parseInt(window.getComputedStyle(e).width),r=t/n*100;e.style.removeProperty("transition"),e.style.width="".concat(r,"%")},Bt=()=>typeof window>"u"||typeof document>"u",ho=100,V={},po=()=>{V.previousActiveElement&&V.previousActiveElement.focus?(V.previousActiveElement.focus(),V.previousActiveElement=null):document.body&&document.body.focus()},mo=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;V.restoreFocusTimeout=setTimeout(()=>{po(),t()},ho),window.scrollTo(n,r)}),go=`
31
+ `,pe=()=>{const e=x(F().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n,r)=>{const f=parseInt(n.getAttribute("tabindex")),P=parseInt(r.getAttribute("tabindex"));return f>P?1:f<P?-1:0}),t=x(F().querySelectorAll(he)).filter(n=>n.getAttribute("tabindex")!=="-1");return k(e.concat(t)).filter(n=>le(n))},ne=()=>xe(document.body,i.shown)&&!xe(document.body,i["toast-shown"])&&!xe(document.body,i["no-backdrop"]),ye=()=>F()&&xe(F(),i.toast),co=()=>F().hasAttribute("data-loading"),Ie={previousBodyPadding:null},oe=(e,t)=>{if(e.textContent="",t){const r=new DOMParser().parseFromString(t,"text/html");x(r.querySelector("head").childNodes).forEach(f=>{e.appendChild(f)}),x(r.querySelector("body").childNodes).forEach(f=>{e.appendChild(f)})}},xe=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let r=0;r<n.length;r++)if(!e.classList.contains(n[r]))return!1;return!0},lo=(e,t)=>{x(e.classList).forEach(n=>{!Object.values(i).includes(n)&&!Object.values(g).includes(n)&&!Object.values(t.showClass).includes(n)&&e.classList.remove(n)})},me=(e,t,n)=>{if(lo(e,t),t.customClass&&t.customClass[n]){if(typeof t.customClass[n]!="string"&&!t.customClass[n].forEach)return I("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));D(e,t.customClass[n])}},nt=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(i.popup," > .").concat(i[t]));case"checkbox":return e.querySelector(".".concat(i.popup," > .").concat(i.checkbox," input"));case"radio":return e.querySelector(".".concat(i.popup," > .").concat(i.radio," input:checked"))||e.querySelector(".".concat(i.popup," > .").concat(i.radio," input:first-child"));case"range":return e.querySelector(".".concat(i.popup," > .").concat(i.range," input"));default:return e.querySelector(".".concat(i.popup," > .").concat(i.input))}},At=e=>{if(e.focus(),e.type!=="file"){const t=e.value;e.value="",e.value=t}},St=(e,t,n)=>{!e||!t||(typeof t=="string"&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(r=>{Array.isArray(e)?e.forEach(f=>{n?f.classList.add(r):f.classList.remove(r)}):n?e.classList.add(r):e.classList.remove(r)}))},D=(e,t)=>{St(e,t,!0)},ve=(e,t)=>{St(e,t,!1)},Ae=(e,t)=>{const n=x(e.childNodes);for(let r=0;r<n.length;r++)if(xe(n[r],t))return n[r]},Re=(e,t,n)=>{n==="".concat(parseInt(n))&&(n=parseInt(n)),n||parseInt(n)===0?e.style[t]=typeof n=="number"?"".concat(n,"px"):n:e.style.removeProperty(t)},Q=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"flex";e.style.display=t},re=e=>{e.style.display="none"},Et=(e,t,n,r)=>{const f=e.querySelector(t);f&&(f.style[n]=r)},We=(e,t,n)=>{t?Q(e,n):re(e)},le=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),uo=()=>!le(b())&&!le(u())&&!le(y()),_t=e=>e.scrollHeight>e.clientHeight,Bt=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),r=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||r>0},ot=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=M();le(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))},fo=()=>{const e=M(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=parseInt(window.getComputedStyle(e).width),r=t/n*100;e.style.removeProperty("transition"),e.style.width="".concat(r,"%")},Pt=()=>typeof window>"u"||typeof document>"u",ho=100,V={},po=()=>{V.previousActiveElement&&V.previousActiveElement.focus?(V.previousActiveElement.focus(),V.previousActiveElement=null):document.body&&document.body.focus()},mo=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;V.restoreFocusTimeout=setTimeout(()=>{po(),t()},ho),window.scrollTo(n,r)}),go=`
32
32
  <div aria-labelledby="`.concat(i.title,'" aria-describedby="').concat(i["html-container"],'" class="').concat(i.popup,`" tabindex="-1">
33
33
  <button type="button" class="`).concat(i.close,`"></button>
34
34
  <ul class="`).concat(i["progress-steps"],`"></ul>
@@ -61,7 +61,7 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
61
61
  <div class="`).concat(i["timer-progress-bar"],`"></div>
62
62
  </div>
63
63
  </div>
64
- `).replace(/(^|\n)\s*/g,""),bo=()=>{const e=T();return e?(e.remove(),ve([document.documentElement,document.body],[i["no-backdrop"],i["toast-shown"],i["has-column"]]),!0):!1},Ee=()=>{V.currentInstance.resetValidationMessage()},wo=()=>{const e=F(),t=Ae(e,i.input),n=Ae(e,i.file),r=e.querySelector(".".concat(i.range," input")),f=e.querySelector(".".concat(i.range," output")),B=Ae(e,i.select),Y=e.querySelector(".".concat(i.checkbox," input")),ue=Ae(e,i.textarea);t.oninput=Ee,n.onchange=Ee,B.onchange=Ee,Y.onchange=Ee,ue.oninput=Ee,r.oninput=()=>{Ee(),f.value=r.value},r.onchange=()=>{Ee(),r.nextSibling.value=r.value}},yo=e=>typeof e=="string"?document.querySelector(e):e,vo=e=>{const t=F();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},ko=e=>{window.getComputedStyle(e).direction==="rtl"&&D(T(),i.rtl)},xo=e=>{const t=bo();if(Bt()){O("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=i.container,t&&D(n,i["no-transition"]),oe(n,go);const r=yo(e.target);r.appendChild(n),vo(e),ko(r),wo()},rt=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e=="object"?Co(e,t):e&&oe(t,e)},Co=(e,t)=>{e.jquery?Ao(t,e):oe(t,e.toString())},Ao=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Ne=(()=>{if(Bt())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&typeof e.style[n]<"u")return t[n];return!1})(),So=()=>{const e=document.createElement("div");e.className=i["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},Eo=(e,t)=>{const n=_(),r=w();!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?re(n):Q(n),me(n,t,"actions"),_o(n,r,t),oe(r,t.loaderHtml),me(r,t,"loader")};function _o(e,t,n){const r=b(),f=u(),B=y();st(r,"confirm",n),st(f,"deny",n),st(B,"cancel",n),Po(r,f,B,n),n.reverseButtons&&(n.toast?(e.insertBefore(B,r),e.insertBefore(f,r)):(e.insertBefore(B,t),e.insertBefore(f,t),e.insertBefore(r,t)))}function Po(e,t,n,r){if(!r.buttonsStyling)return ve([e,t,n],i.styled);D([e,t,n],i.styled),r.confirmButtonColor&&(e.style.backgroundColor=r.confirmButtonColor,D(e,i["default-outline"])),r.denyButtonColor&&(t.style.backgroundColor=r.denyButtonColor,D(t,i["default-outline"])),r.cancelButtonColor&&(n.style.backgroundColor=r.cancelButtonColor,D(n,i["default-outline"]))}function st(e,t,n){We(e,n["show".concat(U(t),"Button")],"inline-block"),oe(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=i[t],me(e,n,"".concat(t,"Button")),D(e,n["".concat(t,"ButtonClass")])}function Bo(e,t){typeof t=="string"?e.style.background=t:t||D([document.documentElement,document.body],i["no-backdrop"])}function To(e,t){t in i?D(e,i[t]):(I('The "position" parameter is not valid, defaulting to "center"'),D(e,i.center))}function Io(e,t){if(t&&typeof t=="string"){const n="grow-".concat(t);n in i&&D(e,i[n])}}const Lo=(e,t)=>{const n=T();n&&(Bo(n,t.backdrop),To(n,t.position),Io(n,t.grow),me(n,t,"container"))};var R={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Fo=["input","file","range","select","radio","checkbox","textarea"],Uo=(e,t)=>{const n=F(),r=R.innerParams.get(e),f=!r||t.input!==r.input;Fo.forEach(B=>{const Y=i[B],ue=Ae(n,Y);Vo(B,t.inputAttributes),ue.className=Y,f&&re(ue)}),t.input&&(f&&Mo(t),Ro(t))},Mo=e=>{if(!ie[e.input])return O('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Tt(e.input),n=ie[e.input](t,e);Q(n),setTimeout(()=>{At(n)})},Oo=e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["type","value","style"].includes(n)||e.removeAttribute(n)}},Vo=(e,t)=>{const n=nt(F(),e);if(n){Oo(n);for(const r in t)n.setAttribute(r,t[r])}},Ro=e=>{const t=Tt(e.input);e.customClass&&D(t,e.customClass.input)},it=(e,t)=>{(!e.placeholder||t.inputPlaceholder)&&(e.placeholder=t.inputPlaceholder)},He=(e,t,n)=>{if(n.inputLabel){e.id=i.input;const r=document.createElement("label"),f=i["input-label"];r.setAttribute("for",e.id),r.className=f,D(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},Tt=e=>{const t=i[e]?i[e]:i.input;return Ae(F(),t)},ie={};ie.text=ie.email=ie.password=ie.number=ie.tel=ie.url=(e,t)=>(typeof t.inputValue=="string"||typeof t.inputValue=="number"?e.value=t.inputValue:Ce(t.inputValue)||I('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),He(e,e,t),it(e,t),e.type=t.input,e),ie.file=(e,t)=>(He(e,e,t),it(e,t),e),ie.range=(e,t)=>{const n=e.querySelector("input"),r=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,r.value=t.inputValue,He(n,e,t),e},ie.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");oe(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return He(e,e,t),e},ie.radio=e=>(e.textContent="",e),ie.checkbox=(e,t)=>{const n=nt(F(),"checkbox");n.value="1",n.id=i.checkbox,n.checked=!!t.inputValue;const r=e.querySelector("span");return oe(r,t.inputPlaceholder),e},ie.textarea=(e,t)=>{e.value=t.inputValue,it(e,t),He(e,e,t);const n=r=>parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const r=parseInt(window.getComputedStyle(F()).width),f=()=>{const B=e.offsetWidth+n(e);B>r?F().style.width="".concat(B,"px"):F().style.width=null};new MutationObserver(f).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const No=(e,t)=>{const n=te();me(n,t,"htmlContainer"),t.html?(rt(t.html,n),Q(n,"block")):t.text?(n.textContent=t.text,Q(n,"block")):re(n),Uo(e,t)},Ho=(e,t)=>{const n=P();We(n,t.footer),t.footer&&rt(t.footer,n),me(n,t,"footer")},Do=(e,t)=>{const n=H();oe(n,t.closeButtonHtml),me(n,t,"closeButton"),We(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},jo=(e,t)=>{const n=R.innerParams.get(e),r=G();if(n&&t.icon===n.icon){Lt(r,t),It(r,t);return}if(!t.icon&&!t.iconHtml)return re(r);if(t.icon&&Object.keys(g).indexOf(t.icon)===-1)return O('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),re(r);Q(r),Lt(r,t),It(r,t),D(r,t.showClass.icon)},It=(e,t)=>{for(const n in g)t.icon!==n&&ve(e,g[n]);D(e,g[t.icon]),Wo(e,t),$o(),me(e,t,"icon")},$o=()=>{const e=F(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let r=0;r<n.length;r++)n[r].style.backgroundColor=t},qo=`
64
+ `).replace(/(^|\n)\s*/g,""),bo=()=>{const e=T();return e?(e.remove(),ve([document.documentElement,document.body],[i["no-backdrop"],i["toast-shown"],i["has-column"]]),!0):!1},Ee=()=>{V.currentInstance.resetValidationMessage()},wo=()=>{const e=F(),t=Ae(e,i.input),n=Ae(e,i.file),r=e.querySelector(".".concat(i.range," input")),f=e.querySelector(".".concat(i.range," output")),P=Ae(e,i.select),Y=e.querySelector(".".concat(i.checkbox," input")),ue=Ae(e,i.textarea);t.oninput=Ee,n.onchange=Ee,P.onchange=Ee,Y.onchange=Ee,ue.oninput=Ee,r.oninput=()=>{Ee(),f.value=r.value},r.onchange=()=>{Ee(),r.nextSibling.value=r.value}},yo=e=>typeof e=="string"?document.querySelector(e):e,vo=e=>{const t=F();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},ko=e=>{window.getComputedStyle(e).direction==="rtl"&&D(T(),i.rtl)},xo=e=>{const t=bo();if(Pt()){O("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=i.container,t&&D(n,i["no-transition"]),oe(n,go);const r=yo(e.target);r.appendChild(n),vo(e),ko(r),wo()},rt=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e=="object"?Co(e,t):e&&oe(t,e)},Co=(e,t)=>{e.jquery?Ao(t,e):oe(t,e.toString())},Ao=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Ne=(()=>{if(Pt())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&typeof e.style[n]<"u")return t[n];return!1})(),So=()=>{const e=document.createElement("div");e.className=i["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},Eo=(e,t)=>{const n=_(),r=w();!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?re(n):Q(n),me(n,t,"actions"),_o(n,r,t),oe(r,t.loaderHtml),me(r,t,"loader")};function _o(e,t,n){const r=b(),f=u(),P=y();st(r,"confirm",n),st(f,"deny",n),st(P,"cancel",n),Bo(r,f,P,n),n.reverseButtons&&(n.toast?(e.insertBefore(P,r),e.insertBefore(f,r)):(e.insertBefore(P,t),e.insertBefore(f,t),e.insertBefore(r,t)))}function Bo(e,t,n,r){if(!r.buttonsStyling)return ve([e,t,n],i.styled);D([e,t,n],i.styled),r.confirmButtonColor&&(e.style.backgroundColor=r.confirmButtonColor,D(e,i["default-outline"])),r.denyButtonColor&&(t.style.backgroundColor=r.denyButtonColor,D(t,i["default-outline"])),r.cancelButtonColor&&(n.style.backgroundColor=r.cancelButtonColor,D(n,i["default-outline"]))}function st(e,t,n){We(e,n["show".concat(U(t),"Button")],"inline-block"),oe(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=i[t],me(e,n,"".concat(t,"Button")),D(e,n["".concat(t,"ButtonClass")])}function Po(e,t){typeof t=="string"?e.style.background=t:t||D([document.documentElement,document.body],i["no-backdrop"])}function To(e,t){t in i?D(e,i[t]):(I('The "position" parameter is not valid, defaulting to "center"'),D(e,i.center))}function Io(e,t){if(t&&typeof t=="string"){const n="grow-".concat(t);n in i&&D(e,i[n])}}const Lo=(e,t)=>{const n=T();n&&(Po(n,t.backdrop),To(n,t.position),Io(n,t.grow),me(n,t,"container"))};var R={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Fo=["input","file","range","select","radio","checkbox","textarea"],Uo=(e,t)=>{const n=F(),r=R.innerParams.get(e),f=!r||t.input!==r.input;Fo.forEach(P=>{const Y=i[P],ue=Ae(n,Y);Vo(P,t.inputAttributes),ue.className=Y,f&&re(ue)}),t.input&&(f&&Mo(t),Ro(t))},Mo=e=>{if(!ie[e.input])return O('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Tt(e.input),n=ie[e.input](t,e);Q(n),setTimeout(()=>{At(n)})},Oo=e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["type","value","style"].includes(n)||e.removeAttribute(n)}},Vo=(e,t)=>{const n=nt(F(),e);if(n){Oo(n);for(const r in t)n.setAttribute(r,t[r])}},Ro=e=>{const t=Tt(e.input);e.customClass&&D(t,e.customClass.input)},it=(e,t)=>{(!e.placeholder||t.inputPlaceholder)&&(e.placeholder=t.inputPlaceholder)},He=(e,t,n)=>{if(n.inputLabel){e.id=i.input;const r=document.createElement("label"),f=i["input-label"];r.setAttribute("for",e.id),r.className=f,D(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},Tt=e=>{const t=i[e]?i[e]:i.input;return Ae(F(),t)},ie={};ie.text=ie.email=ie.password=ie.number=ie.tel=ie.url=(e,t)=>(typeof t.inputValue=="string"||typeof t.inputValue=="number"?e.value=t.inputValue:Ce(t.inputValue)||I('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),He(e,e,t),it(e,t),e.type=t.input,e),ie.file=(e,t)=>(He(e,e,t),it(e,t),e),ie.range=(e,t)=>{const n=e.querySelector("input"),r=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,r.value=t.inputValue,He(n,e,t),e},ie.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");oe(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return He(e,e,t),e},ie.radio=e=>(e.textContent="",e),ie.checkbox=(e,t)=>{const n=nt(F(),"checkbox");n.value="1",n.id=i.checkbox,n.checked=!!t.inputValue;const r=e.querySelector("span");return oe(r,t.inputPlaceholder),e},ie.textarea=(e,t)=>{e.value=t.inputValue,it(e,t),He(e,e,t);const n=r=>parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const r=parseInt(window.getComputedStyle(F()).width),f=()=>{const P=e.offsetWidth+n(e);P>r?F().style.width="".concat(P,"px"):F().style.width=null};new MutationObserver(f).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const No=(e,t)=>{const n=te();me(n,t,"htmlContainer"),t.html?(rt(t.html,n),Q(n,"block")):t.text?(n.textContent=t.text,Q(n,"block")):re(n),Uo(e,t)},Ho=(e,t)=>{const n=B();We(n,t.footer),t.footer&&rt(t.footer,n),me(n,t,"footer")},Do=(e,t)=>{const n=H();oe(n,t.closeButtonHtml),me(n,t,"closeButton"),We(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},jo=(e,t)=>{const n=R.innerParams.get(e),r=G();if(n&&t.icon===n.icon){Lt(r,t),It(r,t);return}if(!t.icon&&!t.iconHtml)return re(r);if(t.icon&&Object.keys(g).indexOf(t.icon)===-1)return O('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),re(r);Q(r),Lt(r,t),It(r,t),D(r,t.showClass.icon)},It=(e,t)=>{for(const n in g)t.icon!==n&&ve(e,g[n]);D(e,g[t.icon]),Wo(e,t),$o(),me(e,t,"icon")},$o=()=>{const e=F(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let r=0;r<n.length;r++)n[r].style.backgroundColor=t},qo=`
65
65
  <div class="swal2-success-circular-line-left"></div>
66
66
  <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
67
67
  <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
@@ -71,10 +71,10 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
71
71
  <span class="swal2-x-mark-line-left"></span>
72
72
  <span class="swal2-x-mark-line-right"></span>
73
73
  </span>
74
- `,Lt=(e,t)=>{e.textContent="",t.iconHtml?oe(e,Ft(t.iconHtml)):t.icon==="success"?oe(e,qo):t.icon==="error"?oe(e,zo):oe(e,Ft({question:"?",warning:"!",info:"i"}[t.icon]))},Wo=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Et(e,n,"backgroundColor",t.iconColor);Et(e,".swal2-success-ring","borderColor",t.iconColor)}},Ft=e=>'<div class="'.concat(i["icon-content"],'">').concat(e,"</div>"),Ko=(e,t)=>{const n=s();if(!t.imageUrl)return re(n);Q(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),Re(n,"width",t.imageWidth),Re(n,"height",t.imageHeight),n.className=i.image,me(n,t,"image")},Jo=e=>{const t=document.createElement("li");return D(t,i["progress-step"]),oe(t,e),t},Yo=e=>{const t=document.createElement("li");return D(t,i["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t},Xo=(e,t)=>{const n=a();if(!t.progressSteps||t.progressSteps.length===0)return re(n);Q(n),n.textContent="",t.currentProgressStep>=t.progressSteps.length&&I("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((r,f)=>{const B=Jo(r);if(n.appendChild(B),f===t.currentProgressStep&&D(B,i["active-progress-step"]),f!==t.progressSteps.length-1){const Y=Yo(t);n.appendChild(Y)}})},Zo=(e,t)=>{const n=N();We(n,t.title||t.titleText,"block"),t.title&&rt(t.title,n),t.titleText&&(n.innerText=t.titleText),me(n,t,"title")},Go=(e,t)=>{const n=T(),r=F();t.toast?(Re(n,"width",t.width),r.style.width="100%",r.insertBefore(w(),G())):Re(r,"width",t.width),Re(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),re(m()),Qo(r,t)},Qo=(e,t)=>{e.className="".concat(i.popup," ").concat(le(e)?t.showClass.popup:""),t.toast?(D([document.documentElement,document.body],i["toast-shown"]),D(e,i.toast)):D(e,i.modal),me(e,t,"popup"),typeof t.customClass=="string"&&D(e,t.customClass),t.icon&&D(e,i["icon-".concat(t.icon)])},Ut=(e,t)=>{Go(e,t),Lo(e,t),Xo(e,t),jo(e,t),Ko(e,t),Zo(e,t),Do(e,t),No(e,t),Eo(e,t),Ho(e,t),typeof t.didRender=="function"&&t.didRender(F())},Le=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),er=()=>{x(document.body.children).forEach(t=>{t===T()||t.contains(T())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})},Mt=()=>{x(document.body.children).forEach(t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},Ot=["swal-title","swal-html","swal-footer"],tr=e=>{const t=typeof e.template=="string"?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return cr(n),Object.assign(nr(n),or(n),rr(n),sr(n),ir(n),ar(n,Ot))},nr=e=>{const t={};return x(e.querySelectorAll("swal-param")).forEach(n=>{_e(n,["name","value"]);const r=n.getAttribute("name"),f=n.getAttribute("value");typeof ge[r]=="boolean"&&f==="false"&&(t[r]=!1),typeof ge[r]=="object"&&(t[r]=JSON.parse(f))}),t},or=e=>{const t={};return x(e.querySelectorAll("swal-button")).forEach(n=>{_e(n,["type","color","aria-label"]);const r=n.getAttribute("type");t["".concat(r,"ButtonText")]=n.innerHTML,t["show".concat(U(r),"Button")]=!0,n.hasAttribute("color")&&(t["".concat(r,"ButtonColor")]=n.getAttribute("color")),n.hasAttribute("aria-label")&&(t["".concat(r,"ButtonAriaLabel")]=n.getAttribute("aria-label"))}),t},rr=e=>{const t={},n=e.querySelector("swal-image");return n&&(_e(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},sr=e=>{const t={},n=e.querySelector("swal-icon");return n&&(_e(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},ir=e=>{const t={},n=e.querySelector("swal-input");n&&(_e(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const r=e.querySelectorAll("swal-input-option");return r.length&&(t.inputOptions={},x(r).forEach(f=>{_e(f,["value"]);const B=f.getAttribute("value"),Y=f.innerHTML;t.inputOptions[B]=Y})),t},ar=(e,t)=>{const n={};for(const r in t){const f=t[r],B=e.querySelector(f);B&&(_e(B,[]),n[f.replace(/^swal-/,"")]=B.innerHTML.trim())}return n},cr=e=>{const t=Ot.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);x(e.children).forEach(n=>{const r=n.tagName.toLowerCase();t.indexOf(r)===-1&&I("Unrecognized element <".concat(r,">"))})},_e=(e,t)=>{x(e.attributes).forEach(n=>{t.indexOf(n.name)===-1&&I(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])})};var Vt={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function lr(e){e.inputValidator||Object.keys(Vt).forEach(t=>{e.input===t&&(e.inputValidator=Vt[t])})}function ur(e){(!e.target||typeof e.target=="string"&&!document.querySelector(e.target)||typeof e.target!="string"&&!e.target.appendChild)&&(I('Target parameter is not valid, defaulting to "body"'),e.target="body")}function dr(e){lr(e),e.showLoaderOnConfirm&&!e.preConfirm&&I(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
74
+ `,Lt=(e,t)=>{e.textContent="",t.iconHtml?oe(e,Ft(t.iconHtml)):t.icon==="success"?oe(e,qo):t.icon==="error"?oe(e,zo):oe(e,Ft({question:"?",warning:"!",info:"i"}[t.icon]))},Wo=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Et(e,n,"backgroundColor",t.iconColor);Et(e,".swal2-success-ring","borderColor",t.iconColor)}},Ft=e=>'<div class="'.concat(i["icon-content"],'">').concat(e,"</div>"),Ko=(e,t)=>{const n=s();if(!t.imageUrl)return re(n);Q(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),Re(n,"width",t.imageWidth),Re(n,"height",t.imageHeight),n.className=i.image,me(n,t,"image")},Jo=e=>{const t=document.createElement("li");return D(t,i["progress-step"]),oe(t,e),t},Yo=e=>{const t=document.createElement("li");return D(t,i["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t},Xo=(e,t)=>{const n=a();if(!t.progressSteps||t.progressSteps.length===0)return re(n);Q(n),n.textContent="",t.currentProgressStep>=t.progressSteps.length&&I("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((r,f)=>{const P=Jo(r);if(n.appendChild(P),f===t.currentProgressStep&&D(P,i["active-progress-step"]),f!==t.progressSteps.length-1){const Y=Yo(t);n.appendChild(Y)}})},Zo=(e,t)=>{const n=N();We(n,t.title||t.titleText,"block"),t.title&&rt(t.title,n),t.titleText&&(n.innerText=t.titleText),me(n,t,"title")},Go=(e,t)=>{const n=T(),r=F();t.toast?(Re(n,"width",t.width),r.style.width="100%",r.insertBefore(w(),G())):Re(r,"width",t.width),Re(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),re(m()),Qo(r,t)},Qo=(e,t)=>{e.className="".concat(i.popup," ").concat(le(e)?t.showClass.popup:""),t.toast?(D([document.documentElement,document.body],i["toast-shown"]),D(e,i.toast)):D(e,i.modal),me(e,t,"popup"),typeof t.customClass=="string"&&D(e,t.customClass),t.icon&&D(e,i["icon-".concat(t.icon)])},Ut=(e,t)=>{Go(e,t),Lo(e,t),Xo(e,t),jo(e,t),Ko(e,t),Zo(e,t),Do(e,t),No(e,t),Eo(e,t),Ho(e,t),typeof t.didRender=="function"&&t.didRender(F())},Le=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),er=()=>{x(document.body.children).forEach(t=>{t===T()||t.contains(T())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})},Mt=()=>{x(document.body.children).forEach(t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},Ot=["swal-title","swal-html","swal-footer"],tr=e=>{const t=typeof e.template=="string"?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return cr(n),Object.assign(nr(n),or(n),rr(n),sr(n),ir(n),ar(n,Ot))},nr=e=>{const t={};return x(e.querySelectorAll("swal-param")).forEach(n=>{_e(n,["name","value"]);const r=n.getAttribute("name"),f=n.getAttribute("value");typeof ge[r]=="boolean"&&f==="false"&&(t[r]=!1),typeof ge[r]=="object"&&(t[r]=JSON.parse(f))}),t},or=e=>{const t={};return x(e.querySelectorAll("swal-button")).forEach(n=>{_e(n,["type","color","aria-label"]);const r=n.getAttribute("type");t["".concat(r,"ButtonText")]=n.innerHTML,t["show".concat(U(r),"Button")]=!0,n.hasAttribute("color")&&(t["".concat(r,"ButtonColor")]=n.getAttribute("color")),n.hasAttribute("aria-label")&&(t["".concat(r,"ButtonAriaLabel")]=n.getAttribute("aria-label"))}),t},rr=e=>{const t={},n=e.querySelector("swal-image");return n&&(_e(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},sr=e=>{const t={},n=e.querySelector("swal-icon");return n&&(_e(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},ir=e=>{const t={},n=e.querySelector("swal-input");n&&(_e(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const r=e.querySelectorAll("swal-input-option");return r.length&&(t.inputOptions={},x(r).forEach(f=>{_e(f,["value"]);const P=f.getAttribute("value"),Y=f.innerHTML;t.inputOptions[P]=Y})),t},ar=(e,t)=>{const n={};for(const r in t){const f=t[r],P=e.querySelector(f);P&&(_e(P,[]),n[f.replace(/^swal-/,"")]=P.innerHTML.trim())}return n},cr=e=>{const t=Ot.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);x(e.children).forEach(n=>{const r=n.tagName.toLowerCase();t.indexOf(r)===-1&&I("Unrecognized element <".concat(r,">"))})},_e=(e,t)=>{x(e.attributes).forEach(n=>{t.indexOf(n.name)===-1&&I(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])})};var Vt={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function lr(e){e.inputValidator||Object.keys(Vt).forEach(t=>{e.input===t&&(e.inputValidator=Vt[t])})}function ur(e){(!e.target||typeof e.target=="string"&&!document.querySelector(e.target)||typeof e.target!="string"&&!e.target.appendChild)&&(I('Target parameter is not valid, defaulting to "body"'),e.target="body")}function dr(e){lr(e),e.showLoaderOnConfirm&&!e.preConfirm&&I(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
75
75
  showLoaderOnConfirm should be used together with preConfirm, see usage example:
76
76
  https://sweetalert2.github.io/#ajax-request`),ur(e),typeof e.title=="string"&&(e.title=e.title.split(`
77
- `).join("<br />")),xo(e)}class fr{constructor(t,n){this.callback=t,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(t){const n=this.running;return n&&this.stop(),this.remaining+=t,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const hr=()=>{Ie.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Ie.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Ie.previousBodyPadding+So(),"px"))},pr=()=>{Ie.previousBodyPadding!==null&&(document.body.style.paddingRight="".concat(Ie.previousBodyPadding,"px"),Ie.previousBodyPadding=null)},mr=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!xe(document.body,i.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(t*-1,"px"),D(document.body,i.iosfix),br(),gr()}},gr=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);t&&n&&!e.match(/CriOS/i)&&F().scrollHeight>window.innerHeight-44&&(T().style.paddingBottom="".concat(44,"px"))},br=()=>{const e=T();let t;e.ontouchstart=n=>{t=wr(n)},e.ontouchmove=n=>{t&&(n.preventDefault(),n.stopPropagation())}},wr=e=>{const t=e.target,n=T();return yr(e)||vr(e)?!1:t===n||!_t(n)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(_t(te())&&te().contains(t))},yr=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",vr=e=>e.touches&&e.touches.length>1,kr=()=>{if(xe(document.body,i.iosfix)){const e=parseInt(document.body.style.top,10);ve(document.body,i.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},Rt=10,xr=e=>{const t=T(),n=F();typeof e.willOpen=="function"&&e.willOpen(n);const f=window.getComputedStyle(document.body).overflowY;Sr(t,n,e),setTimeout(()=>{Cr(t,n)},Rt),ne()&&(Ar(t,e.scrollbarPadding,f),er()),!ye()&&!V.previousActiveElement&&(V.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(n)),ve(t,i["no-transition"])},Nt=e=>{const t=F();if(e.target!==t)return;const n=T();t.removeEventListener(Ne,Nt),n.style.overflowY="auto"},Cr=(e,t)=>{Ne&&Pt(t)?(e.style.overflowY="hidden",t.addEventListener(Ne,Nt)):e.style.overflowY="auto"},Ar=(e,t,n)=>{mr(),t&&n!=="hidden"&&hr(),setTimeout(()=>{e.scrollTop=0})},Sr=(e,t,n)=>{D(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),Q(t,"grid"),setTimeout(()=>{D(t,n.showClass.popup),t.style.removeProperty("opacity")},Rt),D([document.documentElement,document.body],i.shown),n.heightAuto&&n.backdrop&&!n.toast&&D([document.documentElement,document.body],i["height-auto"])},Fe=e=>{let t=F();t||new Ye,t=F();const n=w();ye()?re(G()):Er(t,e),Q(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Er=(e,t)=>{const n=_(),r=w();!t&&le(b())&&(t=b()),Q(n),t&&(re(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),D([e,n],i.loading)},_r=(e,t)=>{t.input==="select"||t.input==="radio"?Lr(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(ae(t.inputValue)||Ce(t.inputValue))&&(Fe(b()),Fr(e,t))},Pr=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Br(n);case"radio":return Tr(n);case"file":return Ir(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Br=e=>e.checked?1:0,Tr=e=>e.checked?e.value:null,Ir=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,Lr=(e,t)=>{const n=F(),r=f=>Ur[t.input](n,at(f),t);ae(t.inputOptions)||Ce(t.inputOptions)?(Fe(b()),j(t.inputOptions).then(f=>{e.hideLoading(),r(f)})):typeof t.inputOptions=="object"?r(t.inputOptions):O("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},Fr=(e,t)=>{const n=e.getInput();re(n),j(t.inputValue).then(r=>{n.value=t.input==="number"?parseFloat(r)||0:"".concat(r),Q(n),n.focus(),e.hideLoading()}).catch(r=>{O("Error in inputValue promise: ".concat(r)),n.value="",Q(n),n.focus(),e.hideLoading()})},Ur={select:(e,t,n)=>{const r=Ae(e,i.select),f=(B,Y,ue)=>{const se=document.createElement("option");se.value=ue,oe(se,Y),se.selected=Ht(ue,n.inputValue),B.appendChild(se)};t.forEach(B=>{const Y=B[0],ue=B[1];if(Array.isArray(ue)){const se=document.createElement("optgroup");se.label=Y,se.disabled=!1,r.appendChild(se),ue.forEach(Me=>f(se,Me[1],Me[0]))}else f(r,ue,Y)}),r.focus()},radio:(e,t,n)=>{const r=Ae(e,i.radio);t.forEach(B=>{const Y=B[0],ue=B[1],se=document.createElement("input"),Me=document.createElement("label");se.type="radio",se.name=i.radio,se.value=Y,Ht(Y,n.inputValue)&&(se.checked=!0);const pt=document.createElement("span");oe(pt,ue),pt.className=i.label,Me.appendChild(se),Me.appendChild(pt),r.appendChild(Me)});const f=r.querySelectorAll("input");f.length&&f[0].focus()}},at=e=>{const t=[];return typeof Map<"u"&&e instanceof Map?e.forEach((n,r)=>{let f=n;typeof f=="object"&&(f=at(f)),t.push([r,f])}):Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&(r=at(r)),t.push([n,r])}),t},Ht=(e,t)=>t&&t.toString()===e.toString();function Dt(){const e=R.innerParams.get(this);if(!e)return;const t=R.domCache.get(this);re(t.loader),ye()?e.icon&&Q(G()):Mr(t),ve([t.popup,t.actions],i.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Mr=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Q(t[0],"inline-block"):uo()&&re(e.actions)};function Or(e){const t=R.innerParams.get(e||this),n=R.domCache.get(e||this);return n?nt(n.popup,t.input):null}var De={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Vr=()=>le(F()),jt=()=>b()&&b().click(),Rr=()=>u()&&u().click(),Nr=()=>y()&&y().click(),$t=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Hr=(e,t,n,r)=>{$t(t),n.toast||(t.keydownHandler=f=>jr(e,f,r),t.keydownTarget=n.keydownListenerCapture?window:F(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},ct=(e,t,n)=>{const r=pe();if(r.length)return t=t+n,t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();F().focus()},qt=["ArrowRight","ArrowDown"],Dr=["ArrowLeft","ArrowUp"],jr=(e,t,n)=>{const r=R.innerParams.get(e);r&&(t.isComposing||t.keyCode===229||(r.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?$r(e,t,r):t.key==="Tab"?qr(t,r):[...qt,...Dr].includes(t.key)?zr(t.key):t.key==="Escape"&&Wr(t,r,n)))},$r=(e,t,n)=>{if(X(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;jt(),t.preventDefault()}},qr=(e,t)=>{const n=e.target,r=pe();let f=-1;for(let B=0;B<r.length;B++)if(n===r[B]){f=B;break}e.shiftKey?ct(t,f,-1):ct(t,f,1),e.stopPropagation(),e.preventDefault()},zr=e=>{const t=b(),n=u(),r=y();if(![t,n,r].includes(document.activeElement))return;const f=qt.includes(e)?"nextElementSibling":"previousElementSibling";let B=document.activeElement;for(let Y=0;Y<_().children.length;Y++){if(B=B[f],!B)return;if(le(B)&&B instanceof HTMLButtonElement)break}B instanceof HTMLButtonElement&&B.focus()},Wr=(e,t,n)=>{X(t.allowEscapeKey)&&(e.preventDefault(),n(Le.esc))};function zt(e,t,n,r){ye()?Wt(e,r):(mo(n).then(()=>Wt(e,r)),$t(V)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ne()&&(pr(),kr(),Mt()),Kr()}function Kr(){ve([document.documentElement,document.body],[i.shown,i["height-auto"],i["no-backdrop"],i["toast-shown"]])}function Ke(e){e=Zr(e);const t=De.swalPromiseResolve.get(this),n=Yr(this);this.isAwaitingPromise()?e.isDismissed||(je(this),t(e)):n&&t(e)}function Jr(){return!!R.awaitingPromise.get(this)}const Yr=e=>{const t=F();if(!t)return!1;const n=R.innerParams.get(e);if(!n||xe(t,n.hideClass.popup))return!1;ve(t,n.showClass.popup),D(t,n.hideClass.popup);const r=T();return ve(r,n.showClass.backdrop),D(r,n.hideClass.backdrop),Gr(e,t,n),!0};function Xr(e){const t=De.swalPromiseReject.get(this);je(this),t&&t(e)}const je=e=>{e.isAwaitingPromise()&&(R.awaitingPromise.delete(e),R.innerParams.get(e)||e._destroy())},Zr=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Gr=(e,t,n)=>{const r=T(),f=Ne&&Pt(t);typeof n.willClose=="function"&&n.willClose(t),f?Qr(e,t,r,n.returnFocus,n.didClose):zt(e,r,n.returnFocus,n.didClose)},Qr=(e,t,n,r,f)=>{V.swalCloseEventFinishedCallback=zt.bind(null,e,n,r,f),t.addEventListener(Ne,function(B){B.target===t&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback)})},Wt=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),e._destroy()})};function Kt(e,t,n){const r=R.domCache.get(e);t.forEach(f=>{r[f].disabled=n})}function Jt(e,t){if(!e)return!1;if(e.type==="radio"){const r=e.parentNode.parentNode.querySelectorAll("input");for(let f=0;f<r.length;f++)r[f].disabled=t}else e.disabled=t}function es(){Kt(this,["confirmButton","denyButton","cancelButton"],!1)}function ts(){Kt(this,["confirmButton","denyButton","cancelButton"],!0)}function ns(){return Jt(this.getInput(),!1)}function os(){return Jt(this.getInput(),!0)}function rs(e){const t=R.domCache.get(this),n=R.innerParams.get(this);oe(t.validationMessage,e),t.validationMessage.className=i["validation-message"],n.customClass&&n.customClass.validationMessage&&D(t.validationMessage,n.customClass.validationMessage),Q(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",i["validation-message"]),At(r),D(r,i.inputerror))}function ss(){const e=R.domCache.get(this);e.validationMessage&&re(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),ve(t,i.inputerror))}function is(){return R.domCache.get(this).progressSteps}function as(e){const t=F(),n=R.innerParams.get(this);if(!t||xe(t,n.hideClass.popup))return I("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const r=cs(e),f=Object.assign({},n,r);Ut(this,f),R.innerParams.set(this,f),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const cs=e=>{const t={};return Object.keys(e).forEach(n=>{we(n)?t[n]=e[n]:I('Invalid parameter to update: "'.concat(n,`". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
77
+ `).join("<br />")),xo(e)}class fr{constructor(t,n){this.callback=t,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(t){const n=this.running;return n&&this.stop(),this.remaining+=t,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const hr=()=>{Ie.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Ie.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Ie.previousBodyPadding+So(),"px"))},pr=()=>{Ie.previousBodyPadding!==null&&(document.body.style.paddingRight="".concat(Ie.previousBodyPadding,"px"),Ie.previousBodyPadding=null)},mr=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!xe(document.body,i.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(t*-1,"px"),D(document.body,i.iosfix),br(),gr()}},gr=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);t&&n&&!e.match(/CriOS/i)&&F().scrollHeight>window.innerHeight-44&&(T().style.paddingBottom="".concat(44,"px"))},br=()=>{const e=T();let t;e.ontouchstart=n=>{t=wr(n)},e.ontouchmove=n=>{t&&(n.preventDefault(),n.stopPropagation())}},wr=e=>{const t=e.target,n=T();return yr(e)||vr(e)?!1:t===n||!_t(n)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(_t(te())&&te().contains(t))},yr=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",vr=e=>e.touches&&e.touches.length>1,kr=()=>{if(xe(document.body,i.iosfix)){const e=parseInt(document.body.style.top,10);ve(document.body,i.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},Rt=10,xr=e=>{const t=T(),n=F();typeof e.willOpen=="function"&&e.willOpen(n);const f=window.getComputedStyle(document.body).overflowY;Sr(t,n,e),setTimeout(()=>{Cr(t,n)},Rt),ne()&&(Ar(t,e.scrollbarPadding,f),er()),!ye()&&!V.previousActiveElement&&(V.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(n)),ve(t,i["no-transition"])},Nt=e=>{const t=F();if(e.target!==t)return;const n=T();t.removeEventListener(Ne,Nt),n.style.overflowY="auto"},Cr=(e,t)=>{Ne&&Bt(t)?(e.style.overflowY="hidden",t.addEventListener(Ne,Nt)):e.style.overflowY="auto"},Ar=(e,t,n)=>{mr(),t&&n!=="hidden"&&hr(),setTimeout(()=>{e.scrollTop=0})},Sr=(e,t,n)=>{D(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),Q(t,"grid"),setTimeout(()=>{D(t,n.showClass.popup),t.style.removeProperty("opacity")},Rt),D([document.documentElement,document.body],i.shown),n.heightAuto&&n.backdrop&&!n.toast&&D([document.documentElement,document.body],i["height-auto"])},Fe=e=>{let t=F();t||new Ye,t=F();const n=w();ye()?re(G()):Er(t,e),Q(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Er=(e,t)=>{const n=_(),r=w();!t&&le(b())&&(t=b()),Q(n),t&&(re(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),D([e,n],i.loading)},_r=(e,t)=>{t.input==="select"||t.input==="radio"?Lr(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(ae(t.inputValue)||Ce(t.inputValue))&&(Fe(b()),Fr(e,t))},Br=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Pr(n);case"radio":return Tr(n);case"file":return Ir(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Pr=e=>e.checked?1:0,Tr=e=>e.checked?e.value:null,Ir=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,Lr=(e,t)=>{const n=F(),r=f=>Ur[t.input](n,at(f),t);ae(t.inputOptions)||Ce(t.inputOptions)?(Fe(b()),j(t.inputOptions).then(f=>{e.hideLoading(),r(f)})):typeof t.inputOptions=="object"?r(t.inputOptions):O("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},Fr=(e,t)=>{const n=e.getInput();re(n),j(t.inputValue).then(r=>{n.value=t.input==="number"?parseFloat(r)||0:"".concat(r),Q(n),n.focus(),e.hideLoading()}).catch(r=>{O("Error in inputValue promise: ".concat(r)),n.value="",Q(n),n.focus(),e.hideLoading()})},Ur={select:(e,t,n)=>{const r=Ae(e,i.select),f=(P,Y,ue)=>{const se=document.createElement("option");se.value=ue,oe(se,Y),se.selected=Ht(ue,n.inputValue),P.appendChild(se)};t.forEach(P=>{const Y=P[0],ue=P[1];if(Array.isArray(ue)){const se=document.createElement("optgroup");se.label=Y,se.disabled=!1,r.appendChild(se),ue.forEach(Me=>f(se,Me[1],Me[0]))}else f(r,ue,Y)}),r.focus()},radio:(e,t,n)=>{const r=Ae(e,i.radio);t.forEach(P=>{const Y=P[0],ue=P[1],se=document.createElement("input"),Me=document.createElement("label");se.type="radio",se.name=i.radio,se.value=Y,Ht(Y,n.inputValue)&&(se.checked=!0);const pt=document.createElement("span");oe(pt,ue),pt.className=i.label,Me.appendChild(se),Me.appendChild(pt),r.appendChild(Me)});const f=r.querySelectorAll("input");f.length&&f[0].focus()}},at=e=>{const t=[];return typeof Map<"u"&&e instanceof Map?e.forEach((n,r)=>{let f=n;typeof f=="object"&&(f=at(f)),t.push([r,f])}):Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&(r=at(r)),t.push([n,r])}),t},Ht=(e,t)=>t&&t.toString()===e.toString();function Dt(){const e=R.innerParams.get(this);if(!e)return;const t=R.domCache.get(this);re(t.loader),ye()?e.icon&&Q(G()):Mr(t),ve([t.popup,t.actions],i.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Mr=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Q(t[0],"inline-block"):uo()&&re(e.actions)};function Or(e){const t=R.innerParams.get(e||this),n=R.domCache.get(e||this);return n?nt(n.popup,t.input):null}var De={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Vr=()=>le(F()),jt=()=>b()&&b().click(),Rr=()=>u()&&u().click(),Nr=()=>y()&&y().click(),$t=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Hr=(e,t,n,r)=>{$t(t),n.toast||(t.keydownHandler=f=>jr(e,f,r),t.keydownTarget=n.keydownListenerCapture?window:F(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},ct=(e,t,n)=>{const r=pe();if(r.length)return t=t+n,t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();F().focus()},qt=["ArrowRight","ArrowDown"],Dr=["ArrowLeft","ArrowUp"],jr=(e,t,n)=>{const r=R.innerParams.get(e);r&&(t.isComposing||t.keyCode===229||(r.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?$r(e,t,r):t.key==="Tab"?qr(t,r):[...qt,...Dr].includes(t.key)?zr(t.key):t.key==="Escape"&&Wr(t,r,n)))},$r=(e,t,n)=>{if(X(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;jt(),t.preventDefault()}},qr=(e,t)=>{const n=e.target,r=pe();let f=-1;for(let P=0;P<r.length;P++)if(n===r[P]){f=P;break}e.shiftKey?ct(t,f,-1):ct(t,f,1),e.stopPropagation(),e.preventDefault()},zr=e=>{const t=b(),n=u(),r=y();if(![t,n,r].includes(document.activeElement))return;const f=qt.includes(e)?"nextElementSibling":"previousElementSibling";let P=document.activeElement;for(let Y=0;Y<_().children.length;Y++){if(P=P[f],!P)return;if(le(P)&&P instanceof HTMLButtonElement)break}P instanceof HTMLButtonElement&&P.focus()},Wr=(e,t,n)=>{X(t.allowEscapeKey)&&(e.preventDefault(),n(Le.esc))};function zt(e,t,n,r){ye()?Wt(e,r):(mo(n).then(()=>Wt(e,r)),$t(V)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ne()&&(pr(),kr(),Mt()),Kr()}function Kr(){ve([document.documentElement,document.body],[i.shown,i["height-auto"],i["no-backdrop"],i["toast-shown"]])}function Ke(e){e=Zr(e);const t=De.swalPromiseResolve.get(this),n=Yr(this);this.isAwaitingPromise()?e.isDismissed||(je(this),t(e)):n&&t(e)}function Jr(){return!!R.awaitingPromise.get(this)}const Yr=e=>{const t=F();if(!t)return!1;const n=R.innerParams.get(e);if(!n||xe(t,n.hideClass.popup))return!1;ve(t,n.showClass.popup),D(t,n.hideClass.popup);const r=T();return ve(r,n.showClass.backdrop),D(r,n.hideClass.backdrop),Gr(e,t,n),!0};function Xr(e){const t=De.swalPromiseReject.get(this);je(this),t&&t(e)}const je=e=>{e.isAwaitingPromise()&&(R.awaitingPromise.delete(e),R.innerParams.get(e)||e._destroy())},Zr=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Gr=(e,t,n)=>{const r=T(),f=Ne&&Bt(t);typeof n.willClose=="function"&&n.willClose(t),f?Qr(e,t,r,n.returnFocus,n.didClose):zt(e,r,n.returnFocus,n.didClose)},Qr=(e,t,n,r,f)=>{V.swalCloseEventFinishedCallback=zt.bind(null,e,n,r,f),t.addEventListener(Ne,function(P){P.target===t&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback)})},Wt=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),e._destroy()})};function Kt(e,t,n){const r=R.domCache.get(e);t.forEach(f=>{r[f].disabled=n})}function Jt(e,t){if(!e)return!1;if(e.type==="radio"){const r=e.parentNode.parentNode.querySelectorAll("input");for(let f=0;f<r.length;f++)r[f].disabled=t}else e.disabled=t}function es(){Kt(this,["confirmButton","denyButton","cancelButton"],!1)}function ts(){Kt(this,["confirmButton","denyButton","cancelButton"],!0)}function ns(){return Jt(this.getInput(),!1)}function os(){return Jt(this.getInput(),!0)}function rs(e){const t=R.domCache.get(this),n=R.innerParams.get(this);oe(t.validationMessage,e),t.validationMessage.className=i["validation-message"],n.customClass&&n.customClass.validationMessage&&D(t.validationMessage,n.customClass.validationMessage),Q(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",i["validation-message"]),At(r),D(r,i.inputerror))}function ss(){const e=R.domCache.get(this);e.validationMessage&&re(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),ve(t,i.inputerror))}function is(){return R.domCache.get(this).progressSteps}function as(e){const t=F(),n=R.innerParams.get(this);if(!t||xe(t,n.hideClass.popup))return I("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const r=cs(e),f=Object.assign({},n,r);Ut(this,f),R.innerParams.set(this,f),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const cs=e=>{const t={};return Object.keys(e).forEach(n=>{we(n)?t[n]=e[n]:I('Invalid parameter to update: "'.concat(n,`". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
78
78
 
79
- If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`))}),t};function ls(){const e=R.domCache.get(this),t=R.innerParams.get(this);if(!t){Yt(this);return}e.popup&&V.swalCloseEventFinishedCallback&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback),V.deferDisposalTimer&&(clearTimeout(V.deferDisposalTimer),delete V.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),us(this)}const us=e=>{Yt(e),delete e.params,delete V.keydownHandler,delete V.keydownTarget,delete V.currentInstance},Yt=e=>{e.isAwaitingPromise()?(lt(R,e),R.awaitingPromise.set(e,!0)):(lt(De,e),lt(R,e))},lt=(e,t)=>{for(const n in e)e[n].delete(t)};var Xt=Object.freeze({hideLoading:Dt,disableLoading:Dt,getInput:Or,close:Ke,isAwaitingPromise:Jr,rejectPromise:Xr,handleAwaitingPromise:je,closePopup:Ke,closeModal:Ke,closeToast:Ke,enableButtons:es,disableButtons:ts,enableInput:ns,disableInput:os,showValidationMessage:rs,resetValidationMessage:ss,getProgressSteps:is,update:as,_destroy:ls});const ds=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.input?Zt(e,"confirm"):dt(e,!0)},fs=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Zt(e,"deny"):ut(e,!1)},hs=(e,t)=>{e.disableButtons(),t(Le.cancel)},Zt=(e,t)=>{const n=R.innerParams.get(e);if(!n.input)return O('The "input" parameter is needed to be set when using returnInputValueOn'.concat(U(t)));const r=Pr(e,n);n.inputValidator?ps(e,r,t):e.getInput().checkValidity()?t==="deny"?ut(e,r):dt(e,r):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},ps=(e,t,n)=>{const r=R.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>j(r.inputValidator(t,r.validationMessage))).then(B=>{e.enableButtons(),e.enableInput(),B?e.showValidationMessage(B):n==="deny"?ut(e,t):dt(e,t)})},ut=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnDeny&&Fe(u()),n.preDeny?(R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preDeny(t,n.validationMessage))).then(f=>{f===!1?(e.hideLoading(),je(e)):e.closePopup({isDenied:!0,value:typeof f>"u"?t:f})}).catch(f=>Qt(e||void 0,f))):e.closePopup({isDenied:!0,value:t})},Gt=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Qt=(e,t)=>{e.rejectPromise(t)},dt=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Fe(),n.preConfirm?(e.resetValidationMessage(),R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preConfirm(t,n.validationMessage))).then(f=>{le(m())||f===!1?(e.hideLoading(),je(e)):Gt(e,typeof f>"u"?t:f)}).catch(f=>Qt(e||void 0,f))):Gt(e,t)},ms=(e,t,n)=>{R.innerParams.get(e).toast?gs(e,t,n):(ws(t),ys(t),vs(e,t,n))},gs=(e,t,n)=>{t.popup.onclick=()=>{const r=R.innerParams.get(e);r&&(bs(r)||r.timer||r.input)||n(Le.close)}},bs=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Je=!1;const ws=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Je=!0)}}},ys=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Je=!0)}}},vs=(e,t,n)=>{t.container.onclick=r=>{const f=R.innerParams.get(e);if(Je){Je=!1;return}r.target===t.container&&X(f.allowOutsideClick)&&n(Le.backdrop)}},ks=e=>typeof e=="object"&&e.jquery,en=e=>e instanceof Element||ks(e),xs=e=>{const t={};return typeof e[0]=="object"&&!en(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((n,r)=>{const f=e[r];typeof f=="string"||en(f)?t[n]=f:f!==void 0&&O("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof f))}),t};function Cs(){const e=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new e(...n)}function As(e){class t extends this{_main(r,f){return super._main(r,Object.assign({},e,f))}}return t}const Ss=()=>V.timeout&&V.timeout.getTimerLeft(),tn=()=>{if(V.timeout)return fo(),V.timeout.stop()},nn=()=>{if(V.timeout){const e=V.timeout.start();return ot(e),e}},Es=()=>{const e=V.timeout;return e&&(e.running?tn():nn())},_s=e=>{if(V.timeout){const t=V.timeout.increase(e);return ot(t,!0),t}},Ps=()=>V.timeout&&V.timeout.isRunning();let on=!1;const ft={};function Bs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";ft[e]=this,on||(document.body.addEventListener("click",Ts),on=!0)}const Ts=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const n in ft){const r=t.getAttribute(n);if(r){ft[n].fire({template:r});return}}};var Is=Object.freeze({isValidParameter:J,isUpdatableParameter:we,isDeprecatedParameter:Z,argsToParams:xs,isVisible:Vr,clickConfirm:jt,clickDeny:Rr,clickCancel:Nr,getContainer:T,getPopup:F,getTitle:N,getHtmlContainer:te,getImage:s,getIcon:G,getInputLabel:S,getCloseButton:H,getActions:_,getConfirmButton:b,getDenyButton:u,getCancelButton:y,getLoader:w,getFooter:P,getTimerProgressBar:M,getFocusableElements:pe,getValidationMessage:m,isLoading:co,fire:Cs,mixin:As,showLoading:Fe,enableLoading:Fe,getTimerLeft:Ss,stopTimer:tn,resumeTimer:nn,toggleTimer:Es,increaseTimer:_s,isTimerRunning:Ps,bindClickHandler:Bs});let ht;class Ue{constructor(){if(typeof window>"u")return;ht=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const f=Object.freeze(this.constructor.argsToParams(n));Object.defineProperties(this,{params:{value:f,writable:!1,enumerable:!0,configurable:!0}});const B=this._main(this.params);R.promise.set(this,B)}_main(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(Object.assign({},n,t)),V.currentInstance&&(V.currentInstance._destroy(),ne()&&Mt()),V.currentInstance=this;const r=Fs(t,n);dr(r),Object.freeze(r),V.timeout&&(V.timeout.stop(),delete V.timeout),clearTimeout(V.restoreFocusTimeout);const f=Us(this);return Ut(this,r),R.innerParams.set(this,r),Ls(this,f,r)}then(t){return R.promise.get(this).then(t)}finally(t){return R.promise.get(this).finally(t)}}const Ls=(e,t,n)=>new Promise((r,f)=>{const B=Y=>{e.closePopup({isDismissed:!0,dismiss:Y})};De.swalPromiseResolve.set(e,r),De.swalPromiseReject.set(e,f),t.confirmButton.onclick=()=>ds(e),t.denyButton.onclick=()=>fs(e),t.cancelButton.onclick=()=>hs(e,B),t.closeButton.onclick=()=>B(Le.close),ms(e,t,B),Hr(e,V,n,B),_r(e,n),xr(n),Ms(V,n,B),Os(t,n),setTimeout(()=>{t.container.scrollTop=0})}),Fs=(e,t)=>{const n=tr(e),r=Object.assign({},ge,t,n,e);return r.showClass=Object.assign({},ge.showClass,r.showClass),r.hideClass=Object.assign({},ge.hideClass,r.hideClass),r},Us=e=>{const t={popup:F(),container:T(),actions:_(),confirmButton:b(),denyButton:u(),cancelButton:y(),loader:w(),closeButton:H(),validationMessage:m(),progressSteps:a()};return R.domCache.set(e,t),t},Ms=(e,t,n)=>{const r=M();re(r),t.timer&&(e.timeout=new fr(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(Q(r),me(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ot(t.timer)})))},Os=(e,t)=>{if(!t.toast){if(!X(t.allowEnterKey))return Rs();Vs(e,t)||ct(t,-1,1)}},Vs=(e,t)=>t.focusDeny&&le(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&le(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&le(e.confirmButton)?(e.confirmButton.focus(),!0):!1,Rs=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Ue.prototype,Xt),Object.assign(Ue,Is),Object.keys(Xt).forEach(e=>{Ue[e]=function(){if(ht)return ht[e](...arguments)}}),Ue.DismissReason=Le,Ue.version="11.4.8";const Ye=Ue;return Ye.default=Ye,Ye}),typeof ke<"u"&&ke.Sweetalert2&&(ke.swal=ke.sweetAlert=ke.Swal=ke.SweetAlert=ke.Sweetalert2)})(kt);var Pn=kt.exports;const xt=gt(Pn);class Bn{get IsVisible(){return xt.isVisible()}async ConfirmAsync(o){return new Promise(h=>{xt.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:o.header,html:o.message,confirmButtonText:o.confirmLabel??"confirmar",cancelButtonText:o.rejectLabel??"cancelar"}).then(k=>{h(k.isConfirmed===!0)})})}}const Tn=new Bn,Ct=()=>Tn,In=["data-cor"],Ln=c.defineComponent({__name:"HeaderAvatar",setup(l){const o=Ct(),h=U();async function k(){await o.ConfirmAsync({message:`${ee.User.username} - ${ee.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&ee.CallLogout()}function U(){const I=ee.User.name;let O="?";if(!I)return O;const p=I.split(" ").filter(z=>z.length>0).map(z=>z[0].toUpperCase()),K=Math.min(2,p.length);return O=p.slice(0,K).join(""),O.length>0?O:"?"}function x(){const I=h[0],O=I==="?"?0:(I.charCodeAt(0)-64)%19;return Math.max(O,0)}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{id:"sf-header-avatar","data-cor":x(),onClick:k},c.toDisplayString(c.unref(h)),9,In))}}),Fn={},Un={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},Mn=[c.createElementVNode("path",{d:"m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"},null,-1)];function On(l,o){return c.openBlock(),c.createElementBlock("svg",Un,Mn)}const Vn=mt(Fn,[["render",On]]);class Rn{get storedTheme(){return localStorage.getItem("color-scheme")}get IsDark(){return document.documentElement.classList.contains("dark")}Toggle(){this.IsDark?this.EnableLightMode():this.EnableDarkMode()}EnableDarkMode(){document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),localStorage.setItem("color-scheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("color-scheme","light")}SetInitialTheme(){if(this.storedTheme==="light")return this.EnableLightMode();if(this.storedTheme==="dark")return this.EnableDarkMode();if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return this.EnableDarkMode();this.EnableLightMode()}}const tt=(()=>new Rn)(),Nn=[c.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>',1)],Hn=c.defineComponent({__name:"ThemeToggle",setup(l){return(o,h)=>(c.openBlock(),c.createElementBlock("button",{id:"sf-theme-toggle",onClick:h[0]||(h[0]=(...k)=>c.unref(tt).Toggle&&c.unref(tt).Toggle(...k))},Nn))}}),Dn={id:"sf-layout"},jn=c.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),$n={class:"title"},qn={class:"sf-layout-nav-header"},zn=c.createElementVNode("span",null,"Menu",-1),Wn={class:"sf-layout-nav-content"},Kn=c.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),Jn={id:"sf-layout-content"},Yn=c.defineComponent({__name:"Layout",setup(l){const o=Xe();return(h,k)=>(c.openBlock(),c.createElementBlock("div",Dn,[c.createElementVNode("header",null,[c.createElementVNode("div",{class:c.normalizeClass(["sf-layout-menu-toggler",{invert:c.unref(o).IsVisible}]),onClick:k[0]||(k[0]=U=>c.unref(o).Toggle())},[jn,c.createVNode(Vn)],2),c.createElementVNode("div",$n,[c.renderSlot(h.$slots,"title")]),c.renderSlot(h.$slots,"action"),c.createVNode(Hn),c.createVNode(Ln)]),c.createElementVNode("nav",{class:c.normalizeClass({visible:c.unref(o).IsVisible})},[c.createElementVNode("div",qn,[zn,c.createVNode(Ge,{icone:"close",button:"",onClick:k[1]||(k[1]=U=>c.unref(o).Close())})]),c.createElementVNode("div",Wn,[c.renderSlot(h.$slots,"menu")])],2),c.createElementVNode("main",{class:c.normalizeClass({"menu-visible":c.unref(o).IsVisible})},[Kn,c.createElementVNode("section",Jn,[c.renderSlot(h.$slots,"content")])],2)]))}}),Xn=["href","data-active","onClick"],Zn={class:"sf-navmenulink-text"},Gn=c.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{}},setup(l){const o=l,h=Xe();function k(U,x){U.preventDefault();const O=U.target.closest(".sf-layout-nav-content");x(),O&&O.clientWidth+10>document.body.clientWidth&&h.Close()}return(U,x)=>{const I=c.resolveComponent("router-link");return c.openBlock(),c.createBlock(I,{to:o.href,custom:""},{default:c.withCtx(({href:O,navigate:p,isExactActive:K})=>[c.createElementVNode("a",{class:"sf-navmenulink",href:O,"data-active":K,onClick:z=>k(z,p)},[o.icon?(c.openBlock(),c.createBlock(Ge,{key:0,icone:o.icon,"button-props":{tabindex:-1}},null,8,["icone"])):c.createCommentVNode("",!0),c.createElementVNode("span",Zn,c.toDisplayString(o.text),1)],8,Xn)]),_:1},8,["to"])}}}),Qn=c.defineComponent({__name:"ScrollToTop",setup(l){const o=c.ref(!1),h=`--${+new Date}`;let k=null;function U(){k==null||k.scrollTo(0,0)}return c.onMounted(()=>{var x;k=((x=document.getElementById(h))==null?void 0:x.parentElement)??null,k&&k.addEventListener("scroll",function(){o.value=this.scrollTop-this.clientHeight>0})}),(x,I)=>(c.openBlock(),c.createElementBlock("button",{id:h,class:c.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":o.value}]),onClick:U},null,2))}}),eo=c.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(l){const o=l;function h(){return new Oe("sf-content").AddClass(o.class,!!o.class).Build()}function k(){return new Oe("sf-content-body").AddClass("sf-content-no-padding",o.disableBodyPadding).Build()}function U(){return new Oe("sf-content-header").AddClass("sf-content-no-padding",o.disableHeaderPadding).Build()}function x(){return new Oe("sf-content-footer").AddClass("sf-content-no-padding",o.disableFooterPadding).Build()}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(h()),style:c.normalizeStyle(o.style)},[c.createElementVNode("div",{class:c.normalizeClass(U())},[c.renderSlot(I.$slots,"header")],2),c.createElementVNode("div",{class:c.normalizeClass(k())},[c.renderSlot(I.$slots,"default"),c.createVNode(Qn)],2),c.createElementVNode("div",{class:c.normalizeClass(x())},[c.renderSlot(I.$slots,"footer")],2)],6))}}),to={class:"sf-tab-navigation"},no=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)],oo=["data-active"],ro=["href","onClick"],so=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1)],io=c.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(l){const o=l,h=c.ref(null),k=new ResizeObserver(p=>{O()}),U=c.ref(!1),x=c.ref(!1);function I(p=!1){const K=h.value.clientWidth;h.value.scrollLeft+=p?-K:K}function O(){const p=h.value.scrollWidth-h.value.clientWidth;U.value=h.value.scrollLeft>10,x.value=h.value.scrollLeft<p-10}return c.onMounted(()=>{h.value.addEventListener("scroll",O),k.observe(h.value)}),c.onBeforeUnmount(()=>{var p;try{(p=h.value)==null||p.removeEventListener("scroll",O),k.unobserve(h.value),k.disconnect()}catch{}}),(p,K)=>{const z=c.resolveComponent("RouterLink");return c.openBlock(),c.createElementBlock("div",to,[c.createElementVNode("div",{class:c.normalizeClass(["left-arrow",{active:U.value}]),onClick:K[0]||(K[0]=X=>I(!0))},no,2),c.createElementVNode("ul",{ref_key:"trackerContainer",ref:h},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.tabs,X=>(c.openBlock(),c.createBlock(z,{to:X.route,custom:!0},{default:c.withCtx(({navigate:ae,isActive:j})=>[c.createElementVNode("li",{"data-active":j},[c.renderSlot(p.$slots,"item",{item:X,navigate:ae,isActive:j},()=>[c.createElementVNode("a",{href:X.route,class:c.normalizeClass({active:j}),onClick:ae},c.toDisplayString(X.text),11,ro)])],8,oo)]),_:2},1032,["to"]))),256))],512),c.createElementVNode("div",{class:c.normalizeClass(["right-arrow",{active:x.value}]),onClick:K[1]||(K[1]=X=>I())},so,2)])}}});class ao{constructor(o=null){$e(this,"errors",[]);$e(this,"_value",null);this._value=o}get value(){return this._value}set value(o){this._value=o}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}WithError(o){this.errors.push(o)}}const Ys="",Xs="";(()=>{function l(){c.nextTick(()=>{setTimeout(()=>{var h;const o=document.querySelector(":root");o&&o.style.setProperty("--window-height",`${((h=window.visualViewport)==null?void 0:h.height)??window.innerHeight}px`)},1)})}l(),window.addEventListener("resize",l)})(),tt.SetInitialTheme(),W.AppResult=ao,W.AuthService=ee,W.Cor=Ze,W.SfContent=eo,W.SfIcon=Ge,W.SfLayout=Yn,W.SfNavMenuLink=Gn,W.SfTabNavigation=io,W.Tamanho=Pe,W.UseDialogService=Ct,W.UseNavMenuService=Xe,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
79
+ If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`))}),t};function ls(){const e=R.domCache.get(this),t=R.innerParams.get(this);if(!t){Yt(this);return}e.popup&&V.swalCloseEventFinishedCallback&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback),V.deferDisposalTimer&&(clearTimeout(V.deferDisposalTimer),delete V.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),us(this)}const us=e=>{Yt(e),delete e.params,delete V.keydownHandler,delete V.keydownTarget,delete V.currentInstance},Yt=e=>{e.isAwaitingPromise()?(lt(R,e),R.awaitingPromise.set(e,!0)):(lt(De,e),lt(R,e))},lt=(e,t)=>{for(const n in e)e[n].delete(t)};var Xt=Object.freeze({hideLoading:Dt,disableLoading:Dt,getInput:Or,close:Ke,isAwaitingPromise:Jr,rejectPromise:Xr,handleAwaitingPromise:je,closePopup:Ke,closeModal:Ke,closeToast:Ke,enableButtons:es,disableButtons:ts,enableInput:ns,disableInput:os,showValidationMessage:rs,resetValidationMessage:ss,getProgressSteps:is,update:as,_destroy:ls});const ds=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.input?Zt(e,"confirm"):dt(e,!0)},fs=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Zt(e,"deny"):ut(e,!1)},hs=(e,t)=>{e.disableButtons(),t(Le.cancel)},Zt=(e,t)=>{const n=R.innerParams.get(e);if(!n.input)return O('The "input" parameter is needed to be set when using returnInputValueOn'.concat(U(t)));const r=Br(e,n);n.inputValidator?ps(e,r,t):e.getInput().checkValidity()?t==="deny"?ut(e,r):dt(e,r):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},ps=(e,t,n)=>{const r=R.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>j(r.inputValidator(t,r.validationMessage))).then(P=>{e.enableButtons(),e.enableInput(),P?e.showValidationMessage(P):n==="deny"?ut(e,t):dt(e,t)})},ut=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnDeny&&Fe(u()),n.preDeny?(R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preDeny(t,n.validationMessage))).then(f=>{f===!1?(e.hideLoading(),je(e)):e.closePopup({isDenied:!0,value:typeof f>"u"?t:f})}).catch(f=>Qt(e||void 0,f))):e.closePopup({isDenied:!0,value:t})},Gt=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Qt=(e,t)=>{e.rejectPromise(t)},dt=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Fe(),n.preConfirm?(e.resetValidationMessage(),R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preConfirm(t,n.validationMessage))).then(f=>{le(m())||f===!1?(e.hideLoading(),je(e)):Gt(e,typeof f>"u"?t:f)}).catch(f=>Qt(e||void 0,f))):Gt(e,t)},ms=(e,t,n)=>{R.innerParams.get(e).toast?gs(e,t,n):(ws(t),ys(t),vs(e,t,n))},gs=(e,t,n)=>{t.popup.onclick=()=>{const r=R.innerParams.get(e);r&&(bs(r)||r.timer||r.input)||n(Le.close)}},bs=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Je=!1;const ws=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Je=!0)}}},ys=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Je=!0)}}},vs=(e,t,n)=>{t.container.onclick=r=>{const f=R.innerParams.get(e);if(Je){Je=!1;return}r.target===t.container&&X(f.allowOutsideClick)&&n(Le.backdrop)}},ks=e=>typeof e=="object"&&e.jquery,en=e=>e instanceof Element||ks(e),xs=e=>{const t={};return typeof e[0]=="object"&&!en(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((n,r)=>{const f=e[r];typeof f=="string"||en(f)?t[n]=f:f!==void 0&&O("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof f))}),t};function Cs(){const e=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new e(...n)}function As(e){class t extends this{_main(r,f){return super._main(r,Object.assign({},e,f))}}return t}const Ss=()=>V.timeout&&V.timeout.getTimerLeft(),tn=()=>{if(V.timeout)return fo(),V.timeout.stop()},nn=()=>{if(V.timeout){const e=V.timeout.start();return ot(e),e}},Es=()=>{const e=V.timeout;return e&&(e.running?tn():nn())},_s=e=>{if(V.timeout){const t=V.timeout.increase(e);return ot(t,!0),t}},Bs=()=>V.timeout&&V.timeout.isRunning();let on=!1;const ft={};function Ps(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";ft[e]=this,on||(document.body.addEventListener("click",Ts),on=!0)}const Ts=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const n in ft){const r=t.getAttribute(n);if(r){ft[n].fire({template:r});return}}};var Is=Object.freeze({isValidParameter:J,isUpdatableParameter:we,isDeprecatedParameter:Z,argsToParams:xs,isVisible:Vr,clickConfirm:jt,clickDeny:Rr,clickCancel:Nr,getContainer:T,getPopup:F,getTitle:N,getHtmlContainer:te,getImage:s,getIcon:G,getInputLabel:S,getCloseButton:H,getActions:_,getConfirmButton:b,getDenyButton:u,getCancelButton:y,getLoader:w,getFooter:B,getTimerProgressBar:M,getFocusableElements:pe,getValidationMessage:m,isLoading:co,fire:Cs,mixin:As,showLoading:Fe,enableLoading:Fe,getTimerLeft:Ss,stopTimer:tn,resumeTimer:nn,toggleTimer:Es,increaseTimer:_s,isTimerRunning:Bs,bindClickHandler:Ps});let ht;class Ue{constructor(){if(typeof window>"u")return;ht=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const f=Object.freeze(this.constructor.argsToParams(n));Object.defineProperties(this,{params:{value:f,writable:!1,enumerable:!0,configurable:!0}});const P=this._main(this.params);R.promise.set(this,P)}_main(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(Object.assign({},n,t)),V.currentInstance&&(V.currentInstance._destroy(),ne()&&Mt()),V.currentInstance=this;const r=Fs(t,n);dr(r),Object.freeze(r),V.timeout&&(V.timeout.stop(),delete V.timeout),clearTimeout(V.restoreFocusTimeout);const f=Us(this);return Ut(this,r),R.innerParams.set(this,r),Ls(this,f,r)}then(t){return R.promise.get(this).then(t)}finally(t){return R.promise.get(this).finally(t)}}const Ls=(e,t,n)=>new Promise((r,f)=>{const P=Y=>{e.closePopup({isDismissed:!0,dismiss:Y})};De.swalPromiseResolve.set(e,r),De.swalPromiseReject.set(e,f),t.confirmButton.onclick=()=>ds(e),t.denyButton.onclick=()=>fs(e),t.cancelButton.onclick=()=>hs(e,P),t.closeButton.onclick=()=>P(Le.close),ms(e,t,P),Hr(e,V,n,P),_r(e,n),xr(n),Ms(V,n,P),Os(t,n),setTimeout(()=>{t.container.scrollTop=0})}),Fs=(e,t)=>{const n=tr(e),r=Object.assign({},ge,t,n,e);return r.showClass=Object.assign({},ge.showClass,r.showClass),r.hideClass=Object.assign({},ge.hideClass,r.hideClass),r},Us=e=>{const t={popup:F(),container:T(),actions:_(),confirmButton:b(),denyButton:u(),cancelButton:y(),loader:w(),closeButton:H(),validationMessage:m(),progressSteps:a()};return R.domCache.set(e,t),t},Ms=(e,t,n)=>{const r=M();re(r),t.timer&&(e.timeout=new fr(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(Q(r),me(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ot(t.timer)})))},Os=(e,t)=>{if(!t.toast){if(!X(t.allowEnterKey))return Rs();Vs(e,t)||ct(t,-1,1)}},Vs=(e,t)=>t.focusDeny&&le(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&le(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&le(e.confirmButton)?(e.confirmButton.focus(),!0):!1,Rs=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Ue.prototype,Xt),Object.assign(Ue,Is),Object.keys(Xt).forEach(e=>{Ue[e]=function(){if(ht)return ht[e](...arguments)}}),Ue.DismissReason=Le,Ue.version="11.4.8";const Ye=Ue;return Ye.default=Ye,Ye}),typeof ke<"u"&&ke.Sweetalert2&&(ke.swal=ke.sweetAlert=ke.Swal=ke.SweetAlert=ke.Sweetalert2)})(kt);var Bn=kt.exports;const xt=gt(Bn);class Pn{get IsVisible(){return xt.isVisible()}async ConfirmAsync(o){return new Promise(h=>{xt.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:o.header,html:o.message,confirmButtonText:o.confirmLabel??"confirmar",cancelButtonText:o.rejectLabel??"cancelar"}).then(k=>{h(k.isConfirmed===!0)})})}}const Tn=new Pn,Ct=()=>Tn,In=["data-cor"],Ln=c.defineComponent({__name:"HeaderAvatar",setup(l){const o=Ct(),h=U();async function k(){await o.ConfirmAsync({message:`${ee.User.username} - ${ee.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&ee.CallLogout()}function U(){const I=ee.User.name;let O="?";if(!I)return O;const p=I.split(" ").filter(z=>z.length>0).map(z=>z[0].toUpperCase()),K=Math.min(2,p.length);return O=p.slice(0,K).join(""),O.length>0?O:"?"}function x(){const I=h[0],O=I==="?"?0:(I.charCodeAt(0)-64)%19;return Math.max(O,0)}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{id:"sf-header-avatar","data-cor":x(),onClick:k},c.toDisplayString(c.unref(h)),9,In))}}),Fn={},Un={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},Mn=[c.createElementVNode("path",{d:"m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"},null,-1)];function On(l,o){return c.openBlock(),c.createElementBlock("svg",Un,Mn)}const Vn=mt(Fn,[["render",On]]);class Rn{get storedTheme(){return localStorage.getItem("color-scheme")}get IsDark(){return document.documentElement.classList.contains("dark")}Toggle(){this.IsDark?this.EnableLightMode():this.EnableDarkMode()}EnableDarkMode(){document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),localStorage.setItem("color-scheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("color-scheme","light")}SetInitialTheme(){if(this.storedTheme==="light")return this.EnableLightMode();if(this.storedTheme==="dark")return this.EnableDarkMode();if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return this.EnableDarkMode();this.EnableLightMode()}}const tt=(()=>new Rn)(),Nn=[c.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>',1)],Hn=c.defineComponent({__name:"ThemeToggle",setup(l){return(o,h)=>(c.openBlock(),c.createElementBlock("button",{id:"sf-theme-toggle",onClick:h[0]||(h[0]=(...k)=>c.unref(tt).Toggle&&c.unref(tt).Toggle(...k))},Nn))}}),Dn={id:"sf-layout"},jn=c.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),$n={class:"title"},qn={class:"sf-layout-nav-header"},zn=c.createElementVNode("span",null,"Menu",-1),Wn={class:"sf-layout-nav-content"},Kn=c.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),Jn={id:"sf-layout-content"},Yn=c.defineComponent({__name:"Layout",setup(l){const o=Xe();return(h,k)=>(c.openBlock(),c.createElementBlock("div",Dn,[c.createElementVNode("header",null,[c.createElementVNode("div",{class:c.normalizeClass(["sf-layout-menu-toggler",{invert:c.unref(o).IsVisible}]),onClick:k[0]||(k[0]=U=>c.unref(o).Toggle())},[jn,c.createVNode(Vn)],2),c.createElementVNode("div",$n,[c.renderSlot(h.$slots,"title")]),c.renderSlot(h.$slots,"action"),c.createVNode(Hn),c.createVNode(Ln)]),c.createElementVNode("nav",{class:c.normalizeClass({visible:c.unref(o).IsVisible})},[c.createElementVNode("div",qn,[zn,c.createVNode(Ge,{icone:"close",button:"",onClick:k[1]||(k[1]=U=>c.unref(o).Close())})]),c.createElementVNode("div",Wn,[c.renderSlot(h.$slots,"menu")])],2),c.createElementVNode("main",{class:c.normalizeClass({"menu-visible":c.unref(o).IsVisible})},[Kn,c.createElementVNode("section",Jn,[c.renderSlot(h.$slots,"content")])],2)]))}}),Xn=["href","data-active","onClick"],Zn={class:"sf-navmenulink-text"},Gn=c.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{},exact:{type:Boolean}},setup(l){const o=l,h=Xe();function k(U,x){U.preventDefault();const O=U.target.closest(".sf-layout-nav-content");x(),O&&O.clientWidth+10>document.body.clientWidth&&h.Close()}return(U,x)=>{const I=c.resolveComponent("router-link");return c.openBlock(),c.createBlock(I,{to:o.href,custom:""},{default:c.withCtx(({href:O,navigate:p,isExactActive:K,isActive:z})=>[c.createElementVNode("a",{class:"sf-navmenulink",href:O,"data-active":o.exact?K:z,onClick:X=>k(X,p)},[o.icon?(c.openBlock(),c.createBlock(Ge,{key:0,icone:o.icon,"button-props":{tabindex:-1}},null,8,["icone"])):c.createCommentVNode("",!0),c.createElementVNode("span",Zn,c.toDisplayString(o.text),1)],8,Xn)]),_:1},8,["to"])}}}),Qn=c.defineComponent({__name:"ScrollToTop",setup(l){const o=c.ref(!1),h=`--${+new Date}`;let k=null;function U(){k==null||k.scrollTo(0,0)}return c.onMounted(()=>{var x;k=((x=document.getElementById(h))==null?void 0:x.parentElement)??null,k&&k.addEventListener("scroll",function(){o.value=this.scrollTop-this.clientHeight>0})}),(x,I)=>(c.openBlock(),c.createElementBlock("button",{id:h,class:c.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":o.value}]),onClick:U},null,2))}}),eo=c.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(l){const o=l;function h(){return new Oe("sf-content").AddClass(o.class,!!o.class).Build()}function k(){return new Oe("sf-content-body").AddClass("sf-content-no-padding",o.disableBodyPadding).Build()}function U(){return new Oe("sf-content-header").AddClass("sf-content-no-padding",o.disableHeaderPadding).Build()}function x(){return new Oe("sf-content-footer").AddClass("sf-content-no-padding",o.disableFooterPadding).Build()}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(h()),style:c.normalizeStyle(o.style)},[c.createElementVNode("div",{class:c.normalizeClass(U())},[c.renderSlot(I.$slots,"header")],2),c.createElementVNode("div",{class:c.normalizeClass(k())},[c.renderSlot(I.$slots,"default"),c.createVNode(Qn)],2),c.createElementVNode("div",{class:c.normalizeClass(x())},[c.renderSlot(I.$slots,"footer")],2)],6))}}),to={class:"sf-tab-navigation"},no=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)],oo=["data-active"],ro=["href","onClick"],so=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1)],io=c.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(l){const o=l,h=c.ref(null),k=new ResizeObserver(p=>{O()}),U=c.ref(!1),x=c.ref(!1);function I(p=!1){const K=h.value.clientWidth;h.value.scrollLeft+=p?-K:K}function O(){const p=h.value.scrollWidth-h.value.clientWidth;U.value=h.value.scrollLeft>10,x.value=h.value.scrollLeft<p-10}return c.onMounted(()=>{h.value.addEventListener("scroll",O),k.observe(h.value)}),c.onBeforeUnmount(()=>{var p;try{(p=h.value)==null||p.removeEventListener("scroll",O),k.unobserve(h.value),k.disconnect()}catch{}}),(p,K)=>{const z=c.resolveComponent("RouterLink");return c.openBlock(),c.createElementBlock("div",to,[c.createElementVNode("div",{class:c.normalizeClass(["left-arrow",{active:U.value}]),onClick:K[0]||(K[0]=X=>I(!0))},no,2),c.createElementVNode("ul",{ref_key:"trackerContainer",ref:h},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.tabs,X=>(c.openBlock(),c.createBlock(z,{to:X.route,custom:!0},{default:c.withCtx(({navigate:ae,isActive:j})=>[c.createElementVNode("li",{"data-active":j},[c.renderSlot(p.$slots,"item",{item:X,navigate:ae,isActive:j},()=>[c.createElementVNode("a",{href:X.route,class:c.normalizeClass({active:j}),onClick:ae},c.toDisplayString(X.text),11,ro)])],8,oo)]),_:2},1032,["to"]))),256))],512),c.createElementVNode("div",{class:c.normalizeClass(["right-arrow",{active:x.value}]),onClick:K[1]||(K[1]=X=>I())},so,2)])}}});class ao{constructor(o=null){$e(this,"errors",[]);$e(this,"_value",null);this._value=o}get value(){return this._value}set value(o){this._value=o}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}WithError(o){this.errors.push(o)}}const Ys="",Xs="";(()=>{function l(){c.nextTick(()=>{setTimeout(()=>{var h;const o=document.querySelector(":root");o&&o.style.setProperty("--window-height",`${((h=window.visualViewport)==null?void 0:h.height)??window.innerHeight}px`)},1)})}l(),window.addEventListener("resize",l)})(),tt.SetInitialTheme(),W.AppResult=ao,W.AuthService=ee,W.Cor=Ze,W.SfContent=eo,W.SfIcon=Ge,W.SfLayout=Yn,W.SfNavMenuLink=Gn,W.SfTabNavigation=io,W.Tamanho=Be,W.UseDialogService=Ct,W.UseNavMenuService=Xe,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
80
80
  //# sourceMappingURL=lib.umd.js.map