@luizleon/sf.prefeiturasp.vuecomponents 0.0.1
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/components/content/Content.d.ts +21 -0
- package/dist/components/icon/Icon.d.ts +39 -0
- package/dist/components/internal/LoadingCircle.d.ts +2 -0
- package/dist/components/internal/LogoutIcon.d.ts +2 -0
- package/dist/components/internal/MenuIcon.d.ts +2 -0
- package/dist/components/internal/ScrollToTop.d.ts +2 -0
- package/dist/components/internal/ThemeToggle.d.ts +2 -0
- package/dist/components/internal/cssClassBuilder.d.ts +29 -0
- package/dist/components/layout/Layout.d.ts +12 -0
- package/dist/components/navmenulink/NavMenuLink.d.ts +12 -0
- package/dist/enum/cor.d.ts +9 -0
- package/dist/enum/index.d.ts +2 -0
- package/dist/enum/tamanho.d.ts +5 -0
- package/dist/index.d.ts +9 -0
- package/dist/lib.es.js +2724 -0
- package/dist/lib.umd.js +79 -0
- package/dist/services/authService.d.ts +20 -0
- package/dist/services/dialogService.d.ts +12 -0
- package/dist/services/navMenuService.d.ts +9 -0
- package/dist/style.css +1 -0
- package/package.json +31 -0
- package/src/components/content/Content.d.ts +35 -0
- package/src/components/content/Content.vue +41 -0
- package/src/components/icon/Icon.d.ts +38 -0
- package/src/components/icon/Icon.vue +43 -0
- package/src/components/internal/LoadingCircle.vue +16 -0
- package/src/components/internal/LogoutIcon.vue +14 -0
- package/src/components/internal/MenuIcon.vue +13 -0
- package/src/components/internal/ScrollToTop.vue +26 -0
- package/src/components/internal/ThemeToggle.ts +41 -0
- package/src/components/internal/ThemeToggle.vue +23 -0
- package/src/components/internal/cssClassBuilder.ts +44 -0
- package/src/components/layout/Layout.d.ts +44 -0
- package/src/components/layout/Layout.vue +63 -0
- package/src/components/navmenulink/NavMenuLink.d.ts +34 -0
- package/src/components/navmenulink/NavMenuLink.vue +41 -0
- package/src/enum/cor.ts +9 -0
- package/src/enum/index.ts +2 -0
- package/src/enum/tamanho.ts +5 -0
- package/src/index.ts +56 -0
- package/src/services/authService.ts +69 -0
- package/src/services/dialogService.ts +35 -0
- package/src/services/navMenuService.ts +21 -0
- package/src/sf-oidc-state.html +15 -0
- package/src/style/componentes.scss +22 -0
- package/src/style/src/_animation.scss +441 -0
- package/src/style/src/_display.scss +10 -0
- package/src/style/src/_flexbox.scss +85 -0
- package/src/style/src/_functions.scss +171 -0
- package/src/style/src/_gap.scss +8 -0
- package/src/style/src/_grid.scss +100 -0
- package/src/style/src/_mixins.scss +633 -0
- package/src/style/src/_normalize.scss +351 -0
- package/src/style/src/_ripple.scss +30 -0
- package/src/style/src/_size.scss +98 -0
- package/src/style/src/_spacing.scss +42 -0
- package/src/style/src/_typography.scss +43 -0
- package/src/style/src/_variables.scss +87 -0
- package/src/style/src/components/_button.scss +110 -0
- package/src/style/src/components/_checkbox.scss +53 -0
- package/src/style/src/components/_content.scss +57 -0
- package/src/style/src/components/_datefield.scss +405 -0
- package/src/style/src/components/_drawer.scss +99 -0
- package/src/style/src/components/_icon.scss +120 -0
- package/src/style/src/components/_internal_icon_button.scss +5 -0
- package/src/style/src/components/_layout.scss +183 -0
- package/src/style/src/components/_loading-circle.scss +24 -0
- package/src/style/src/components/_mark.scss +9 -0
- package/src/style/src/components/_mask.scss +33 -0
- package/src/style/src/components/_navmenulink.scss +31 -0
- package/src/style/src/components/_numpad.scss +58 -0
- package/src/style/src/components/_progress-circular.scss +52 -0
- package/src/style/src/components/_scrollToTop.scss +28 -0
- package/src/style/src/components/_select.scss +60 -0
- package/src/style/src/components/_svg_icon.scss +5 -0
- package/src/style/src/components/_textfield.scss +186 -0
- package/src/style/src/components/_themetoggle.scss +25 -0
- package/src/style/src/components/_toast.scss +66 -0
- package/src/style/src/components/_tooltip.scss +55 -0
- package/src/style/src/sweetalert/_sweetalert.scss +9 -0
- package/src/style/src/sweetalert/scss/_animations.scss +197 -0
- package/src/style/src/sweetalert/scss/_body.scss +45 -0
- package/src/style/src/sweetalert/scss/_core.scss +863 -0
- package/src/style/src/sweetalert/scss/_mixins.scss +16 -0
- package/src/style/src/sweetalert/scss/_theming.scss +8 -0
- package/src/style/src/sweetalert/scss/_toasts-animations.scss +83 -0
- package/src/style/src/sweetalert/scss/_toasts-body.scss +85 -0
- package/src/style/src/sweetalert/scss/_toasts.scss +203 -0
- package/src/style/src/sweetalert/scss/_variables.scss +265 -0
- package/src/style/tema.scss +169 -0
- package/src/ts-helpers.d.ts +57 -0
- package/tsconfig.json +19 -0
- package/vite.config.js +25 -0
package/dist/lib.umd.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
(function(s,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.Lib={},s.Vue))})(this,function(exports,vue){"use strict";var ur=Object.defineProperty;var dr=(s,o,d)=>o in s?ur(s,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[o]=d;var Ze=(s,o,d)=>(dr(s,typeof o!="symbol"?o+"":o,d),d);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;function getLens(s){var o=s.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var d=s.indexOf("=");d===-1&&(d=o);var f=d===o?0:4-d%4;return[d,f]}function byteLength(s){var o=getLens(s),d=o[0],f=o[1];return(d+f)*3/4-f}function _byteLength(s,o,d){return(o+d)*3/4-d}function toByteArray(s){var o,d=getLens(s),f=d[0],y=d[1],l=new Arr(_byteLength(s,f,y)),k=0,g=y>0?f-4:f,_;for(_=0;_<g;_+=4)o=revLookup[s.charCodeAt(_)]<<18|revLookup[s.charCodeAt(_+1)]<<12|revLookup[s.charCodeAt(_+2)]<<6|revLookup[s.charCodeAt(_+3)],l[k++]=o>>16&255,l[k++]=o>>8&255,l[k++]=o&255;return y===2&&(o=revLookup[s.charCodeAt(_)]<<2|revLookup[s.charCodeAt(_+1)]>>4,l[k++]=o&255),y===1&&(o=revLookup[s.charCodeAt(_)]<<10|revLookup[s.charCodeAt(_+1)]<<4|revLookup[s.charCodeAt(_+2)]>>2,l[k++]=o>>8&255,l[k++]=o&255),l}function tripletToBase64(s){return lookup[s>>18&63]+lookup[s>>12&63]+lookup[s>>6&63]+lookup[s&63]}function encodeChunk(s,o,d){for(var f,y=[],l=o;l<d;l+=3)f=(s[l]<<16&16711680)+(s[l+1]<<8&65280)+(s[l+2]&255),y.push(tripletToBase64(f));return y.join("")}function fromByteArray(s){for(var o,d=s.length,f=d%3,y=[],l=16383,k=0,g=d-f;k<g;k+=l)y.push(encodeChunk(s,k,k+l>g?g:k+l));return f===1?(o=s[d-1],y.push(lookup[o>>2]+lookup[o<<4&63]+"==")):f===2&&(o=(s[d-2]<<8)+s[d-1],y.push(lookup[o>>10]+lookup[o>>4&63]+lookup[o<<2&63]+"=")),y.join("")}var sha256$1={exports:{}};/**
|
|
2
|
+
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
3
|
+
*
|
|
4
|
+
* @version 0.9.0
|
|
5
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
6
|
+
* @copyright Chen, Yi-Cyuan 2014-2017
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(s){return typeof s=="object"&&s.buffer&&s.buffer.constructor===ArrayBuffer});var createOutputMethod=function(s,o){return function(d){return new Sha256(o,!0).update(d)[s]()}},createMethod=function(s){var o=createOutputMethod("hex",s);NODE_JS&&(o=nodeWrap(o,s)),o.create=function(){return new Sha256(s)},o.update=function(y){return o.create().update(y)};for(var d=0;d<OUTPUT_TYPES.length;++d){var f=OUTPUT_TYPES[d];o[f]=createOutputMethod(f,s)}return o},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(s){if(typeof s=="string")return crypto.createHash(algorithm).update(s,"utf8").digest("hex");if(s==null)throw new Error(ERROR);return s.constructor===ArrayBuffer&&(s=new Uint8Array(s)),Array.isArray(s)||ArrayBuffer.isView(s)||s.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(s)).digest("hex"):method(s)};return nodeMethod},createHmacOutputMethod=function(s,o){return function(d,f){return new HmacSha256(d,o,!0).update(f)[s]()}},createHmacMethod=function(s){var o=createHmacOutputMethod("hex",s);o.create=function(y){return new HmacSha256(y,s)},o.update=function(y,l){return o.create(y).update(l)};for(var d=0;d<OUTPUT_TYPES.length;++d){var f=OUTPUT_TYPES[d];o[f]=createHmacOutputMethod(f,s)}return o};function Sha256(s,o){o?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s?(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=s}Sha256.prototype.update=function(s){if(!this.finalized){var o,d=typeof s;if(d!=="string"){if(d==="object"){if(s===null)throw new Error(ERROR);if(ARRAY_BUFFER&&s.constructor===ArrayBuffer)s=new Uint8Array(s);else if(!Array.isArray(s)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(s)))throw new Error(ERROR)}else throw new Error(ERROR);o=!0}for(var f,y=0,l,k=s.length,g=this.blocks;y<k;){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),o)for(l=this.start;y<k&&l<64;++y)g[l>>2]|=s[y]<<SHIFT[l++&3];else for(l=this.start;y<k&&l<64;++y)f=s.charCodeAt(y),f<128?g[l>>2]|=f<<SHIFT[l++&3]:f<2048?(g[l>>2]|=(192|f>>6)<<SHIFT[l++&3],g[l>>2]|=(128|f&63)<<SHIFT[l++&3]):f<55296||f>=57344?(g[l>>2]|=(224|f>>12)<<SHIFT[l++&3],g[l>>2]|=(128|f>>6&63)<<SHIFT[l++&3],g[l>>2]|=(128|f&63)<<SHIFT[l++&3]):(f=65536+((f&1023)<<10|s.charCodeAt(++y)&1023),g[l>>2]|=(240|f>>18)<<SHIFT[l++&3],g[l>>2]|=(128|f>>12&63)<<SHIFT[l++&3],g[l>>2]|=(128|f>>6&63)<<SHIFT[l++&3],g[l>>2]|=(128|f&63)<<SHIFT[l++&3]);this.lastByteIndex=l,this.bytes+=l-this.start,l>=64?(this.block=g[16],this.start=l-64,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var s=this.blocks,o=this.lastByteIndex;s[16]=this.block,s[o>>2]|=EXTRA[o&3],this.block=s[16],o>=56&&(this.hashed||this.hash(),s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),s[14]=this.hBytes<<3|this.bytes>>>29,s[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var s=this.h0,o=this.h1,d=this.h2,f=this.h3,y=this.h4,l=this.h5,k=this.h6,g=this.h7,_=this.blocks,H,M,O,z,B,J,V,D,he,Q,ie;for(H=16;H<64;++H)B=_[H-15],M=(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3,B=_[H-2],O=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10,_[H]=_[H-16]+M+_[H-7]+O<<0;for(ie=o&d,H=0;H<64;H+=4)this.first?(this.is224?(D=300032,B=_[0]-1413257819,g=B-150054599<<0,f=B+24177077<<0):(D=704751109,B=_[0]-210244248,g=B-1521486534<<0,f=B+143694565<<0),this.first=!1):(M=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),O=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),D=s&o,z=D^s&d^ie,V=y&l^~y&k,B=g+O+V+K[H]+_[H],J=M+z,g=f+B<<0,f=B+J<<0),M=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),O=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),he=f&s,z=he^f&o^D,V=g&y^~g&l,B=k+O+V+K[H+1]+_[H+1],J=M+z,k=d+B<<0,d=B+J<<0,M=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),O=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),Q=d&f,z=Q^d&s^he,V=k&g^~k&y,B=l+O+V+K[H+2]+_[H+2],J=M+z,l=o+B<<0,o=B+J<<0,M=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),O=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),ie=o&d,z=ie^o&f^Q,V=l&k^~l&g,B=y+O+V+K[H+3]+_[H+3],J=M+z,y=s+B<<0,s=B+J<<0;this.h0=this.h0+s<<0,this.h1=this.h1+o<<0,this.h2=this.h2+d<<0,this.h3=this.h3+f<<0,this.h4=this.h4+y<<0,this.h5=this.h5+l<<0,this.h6=this.h6+k<<0,this.h7=this.h7+g<<0},Sha256.prototype.hex=function(){this.finalize();var s=this.h0,o=this.h1,d=this.h2,f=this.h3,y=this.h4,l=this.h5,k=this.h6,g=this.h7,_=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[d>>28&15]+HEX_CHARS[d>>24&15]+HEX_CHARS[d>>20&15]+HEX_CHARS[d>>16&15]+HEX_CHARS[d>>12&15]+HEX_CHARS[d>>8&15]+HEX_CHARS[d>>4&15]+HEX_CHARS[d&15]+HEX_CHARS[f>>28&15]+HEX_CHARS[f>>24&15]+HEX_CHARS[f>>20&15]+HEX_CHARS[f>>16&15]+HEX_CHARS[f>>12&15]+HEX_CHARS[f>>8&15]+HEX_CHARS[f>>4&15]+HEX_CHARS[f&15]+HEX_CHARS[y>>28&15]+HEX_CHARS[y>>24&15]+HEX_CHARS[y>>20&15]+HEX_CHARS[y>>16&15]+HEX_CHARS[y>>12&15]+HEX_CHARS[y>>8&15]+HEX_CHARS[y>>4&15]+HEX_CHARS[y&15]+HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>4&15]+HEX_CHARS[l&15]+HEX_CHARS[k>>28&15]+HEX_CHARS[k>>24&15]+HEX_CHARS[k>>20&15]+HEX_CHARS[k>>16&15]+HEX_CHARS[k>>12&15]+HEX_CHARS[k>>8&15]+HEX_CHARS[k>>4&15]+HEX_CHARS[k&15];return this.is224||(_+=HEX_CHARS[g>>28&15]+HEX_CHARS[g>>24&15]+HEX_CHARS[g>>20&15]+HEX_CHARS[g>>16&15]+HEX_CHARS[g>>12&15]+HEX_CHARS[g>>8&15]+HEX_CHARS[g>>4&15]+HEX_CHARS[g&15]),_},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var s=this.h0,o=this.h1,d=this.h2,f=this.h3,y=this.h4,l=this.h5,k=this.h6,g=this.h7,_=[s>>24&255,s>>16&255,s>>8&255,s&255,o>>24&255,o>>16&255,o>>8&255,o&255,d>>24&255,d>>16&255,d>>8&255,d&255,f>>24&255,f>>16&255,f>>8&255,f&255,y>>24&255,y>>16&255,y>>8&255,y&255,l>>24&255,l>>16&255,l>>8&255,l&255,k>>24&255,k>>16&255,k>>8&255,k&255];return this.is224||_.push(g>>24&255,g>>16&255,g>>8&255,g&255),_},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var s=new ArrayBuffer(this.is224?28:32),o=new DataView(s);return o.setUint32(0,this.h0),o.setUint32(4,this.h1),o.setUint32(8,this.h2),o.setUint32(12,this.h3),o.setUint32(16,this.h4),o.setUint32(20,this.h5),o.setUint32(24,this.h6),this.is224||o.setUint32(28,this.h7),s};function HmacSha256(s,o,d){var f,y=typeof s;if(y==="string"){var l=[],k=s.length,g=0,_;for(f=0;f<k;++f)_=s.charCodeAt(f),_<128?l[g++]=_:_<2048?(l[g++]=192|_>>6,l[g++]=128|_&63):_<55296||_>=57344?(l[g++]=224|_>>12,l[g++]=128|_>>6&63,l[g++]=128|_&63):(_=65536+((_&1023)<<10|s.charCodeAt(++f)&1023),l[g++]=240|_>>18,l[g++]=128|_>>12&63,l[g++]=128|_>>6&63,l[g++]=128|_&63);s=l}else if(y==="object"){if(s===null)throw new Error(ERROR);if(ARRAY_BUFFER&&s.constructor===ArrayBuffer)s=new Uint8Array(s);else if(!Array.isArray(s)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(s)))throw new Error(ERROR)}else throw new Error(ERROR);s.length>64&&(s=new Sha256(o,!0).update(s).array());var H=[],M=[];for(f=0;f<64;++f){var O=s[f]||0;H[f]=92^O,M[f]=54^O}Sha256.call(this,o,d),this.update(M),this.oKeyPad=H,this.inner=!0,this.sharedMemory=d}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var s=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(s),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256$1);var sha256Exports=sha256$1.exports;const sha256=getDefaultExportFromCjs(sha256Exports);if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function Keycloak(s){if(!(this instanceof Keycloak))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,d,f=[],y,l={enable:!0,callbackList:[],interval:5},k=document.getElementsByTagName("script"),g=0;g<k.length;g++)(k[g].src.indexOf("keycloak.js")!==-1||k[g].src.indexOf("keycloak.min.js")!==-1)&&k[g].src.indexOf("version=")!==-1&&(o.iframeVersion=k[g].src.substring(k[g].src.indexOf("version=")+8).split("&")[0]);var _=!0,H=_e(console.info),M=_e(console.warn);o.init=function(a){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,y=be();var c=["default","cordova","cordova-native"];if(a&&c.indexOf(a.adapter)>-1?d=I(a.adapter):a&&typeof a.adapter=="object"?d=a.adapter:window.Cordova||window.cordova?d=I("cordova"):d=I(),a){if(typeof a.useNonce<"u"&&(_=a.useNonce),typeof a.checkLoginIframe<"u"&&(l.enable=a.checkLoginIframe),a.checkLoginIframeInterval&&(l.interval=a.checkLoginIframeInterval),a.onLoad==="login-required"&&(o.loginRequired=!0),a.responseMode)if(a.responseMode==="query"||a.responseMode==="fragment")o.responseMode=a.responseMode;else throw"Invalid value for responseMode";if(a.flow){switch(a.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=a.flow}if(a.timeSkew!=null&&(o.timeSkew=a.timeSkew),a.redirectUri&&(o.redirectUri=a.redirectUri),a.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=a.silentCheckSsoRedirectUri),typeof a.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=a.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,a.pkceMethod){if(a.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=a.pkceMethod}typeof a.enableLogging=="boolean"?o.enableLogging=a.enableLogging:o.enableLogging=!1,typeof a.scope=="string"&&(o.scope=a.scope),typeof a.messageReceiveTimeout=="number"&&a.messageReceiveTimeout>0?o.messageReceiveTimeout=a.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var m=R(),w=R();w.promise.then(function(){o.onReady&&o.onReady(o.authenticated),m.setSuccess(o.authenticated)}).catch(function(S){m.setError(S)});var p=ie();function C(){var S=function(L){L||(E.prompt="none"),a&&a.locale&&(E.locale=a.locale),o.login(E).then(function(){w.setSuccess()}).catch(function(G){w.setError(G)})},x=function(){var L=document.createElement("iframe"),G=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});L.setAttribute("src",G),L.setAttribute("sandbox","allow-scripts allow-same-origin"),L.setAttribute("title","keycloak-silent-check-sso"),L.style.display="none",document.body.appendChild(L);var ne=function(j){if(!(j.origin!==window.location.origin||L.contentWindow!==j.source)){var pe=ae(j.data);Q(pe,w),document.body.removeChild(L),window.removeEventListener("message",ne)}};window.addEventListener("message",ne)},E={};switch(a.onLoad){case"check-sso":l.enable?ce().then(function(){re().then(function(L){L?w.setSuccess():o.silentCheckSsoRedirectUri?x():S(!1)}).catch(function(L){w.setError(L)})}):o.silentCheckSsoRedirectUri?x():S(!1);break;case"login-required":S(!0);break;default:throw"Invalid value for onLoad"}}function v(){var S=ae(window.location.href);if(S&&window.history.replaceState(window.history.state,null,S.newUrl),S&&S.valid)return ce().then(function(){Q(S,w)}).catch(function(x){w.setError(x)});a?a.token&&a.refreshToken?(de(a.token,a.refreshToken,a.idToken),l.enable?ce().then(function(){re().then(function(x){x?(o.onAuthSuccess&&o.onAuthSuccess(),w.setSuccess(),N()):w.setSuccess()}).catch(function(x){w.setError(x)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),w.setSuccess()}).catch(function(x){o.onAuthError&&o.onAuthError(),a.onLoad?C():w.setError(x)})):a.onLoad?C():w.setSuccess():w.setSuccess()}function b(){var S=R(),x=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",x),S.setSuccess())};return document.addEventListener("readystatechange",x),x(),S.promise}return p.then(function(){b().then(Y).then(v).catch(function(S){m.setError(S)})}),p.catch(function(S){m.setError(S)}),m.promise},o.login=function(a){return d.login(a)};function O(a){var c=null,m=window.crypto||window.msCrypto;if(m&&m.getRandomValues&&window.Uint8Array)return c=new Uint8Array(a),m.getRandomValues(c),c;c=new Array(a);for(var w=0;w<c.length;w++)c[w]=Math.floor(256*Math.random());return c}function z(a){return B(a,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function B(a,c){for(var m=O(a),w=new Array(a),p=0;p<a;p++)w[p]=c.charCodeAt(m[p]%c.length);return String.fromCharCode.apply(null,w)}function J(a,c){switch(a){case"S256":var m=new Uint8Array(sha256.arrayBuffer(c)),w=base64Js.fromByteArray(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return w;default:throw"Invalid value for pkceMethod"}}function V(a){var c={id_token:{acr:a}};return JSON.stringify(c)}o.createLoginUrl=function(a){var c=Ie(),m=Ie(),w=d.redirectUri(a),p={state:c,nonce:m,redirectUri:encodeURIComponent(w)};a&&a.prompt&&(p.prompt=a.prompt);var C;a&&a.action=="register"?C=o.endpoints.register():C=o.endpoints.authorize();var v=a&&a.scope||o.scope;v?v.indexOf("openid")===-1&&(v="openid "+v):v="openid";var b=C+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(w)+"&state="+encodeURIComponent(c)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(v);if(_&&(b=b+"&nonce="+encodeURIComponent(m)),a&&a.prompt&&(b+="&prompt="+encodeURIComponent(a.prompt)),a&&a.maxAge&&(b+="&max_age="+encodeURIComponent(a.maxAge)),a&&a.loginHint&&(b+="&login_hint="+encodeURIComponent(a.loginHint)),a&&a.idpHint&&(b+="&kc_idp_hint="+encodeURIComponent(a.idpHint)),a&&a.action&&a.action!="register"&&(b+="&kc_action="+encodeURIComponent(a.action)),a&&a.locale&&(b+="&ui_locales="+encodeURIComponent(a.locale)),a&&a.acr){var S=V(a.acr);b+="&claims="+encodeURIComponent(S)}if(o.pkceMethod){var x=z(96);p.pkceCodeVerifier=x;var E=J(o.pkceMethod,x);b+="&code_challenge="+E,b+="&code_challenge_method="+o.pkceMethod}return y.add(p),b},o.logout=function(a){return d.logout(a)},o.createLogoutUrl=function(a){var c=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(d.redirectUri(a,!1));return o.idToken&&(c+="&id_token_hint="+encodeURIComponent(o.idToken)),c},o.register=function(a){return d.register(a)},o.createRegisterUrl=function(a){return a||(a={}),a.action="register",o.createLoginUrl(a)},o.createAccountUrl=function(a){var c=D(),m=void 0;return typeof c<"u"&&(m=c+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(d.redirectUri(a))),m},o.accountManagement=function(){return d.accountManagement()},o.hasRealmRole=function(a){var c=o.realmAccess;return!!c&&c.roles.indexOf(a)>=0},o.hasResourceRole=function(a,c){if(!o.resourceAccess)return!1;var m=o.resourceAccess[c||o.clientId];return!!m&&m.roles.indexOf(a)>=0},o.loadUserProfile=function(){var a=D()+"/account",c=new XMLHttpRequest;c.open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.setRequestHeader("Authorization","bearer "+o.token);var m=R();return c.onreadystatechange=function(){c.readyState==4&&(c.status==200?(o.profile=JSON.parse(c.responseText),m.setSuccess(o.profile)):m.setError())},c.send(),m.promise},o.loadUserInfo=function(){var a=o.endpoints.userinfo(),c=new XMLHttpRequest;c.open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.setRequestHeader("Authorization","bearer "+o.token);var m=R();return c.onreadystatechange=function(){c.readyState==4&&(c.status==200?(o.userInfo=JSON.parse(c.responseText),m.setSuccess(o.userInfo)):m.setError())},c.send(),m.promise},o.isTokenExpired=function(a){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return H("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var c=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(a){if(isNaN(a))throw"Invalid minValidity";c-=a}return c<0},o.updateToken=function(a){var c=R();if(!o.refreshToken)return c.setError(),c.promise;a=a||5;var m=function(){var p=!1;if(a==-1?(p=!0,H("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(a))&&(p=!0,H("[KEYCLOAK] Refreshing token: token expired")),!p)c.setSuccess(!1);else{var C="grant_type=refresh_token&refresh_token="+o.refreshToken,v=o.endpoints.token();if(f.push(c),f.length==1){var b=new XMLHttpRequest;b.open("POST",v,!0),b.setRequestHeader("Content-type","application/x-www-form-urlencoded"),b.withCredentials=!0,C+="&client_id="+encodeURIComponent(o.clientId);var S=new Date().getTime();b.onreadystatechange=function(){if(b.readyState==4)if(b.status==200){H("[KEYCLOAK] Token refreshed"),S=(S+new Date().getTime())/2;var x=JSON.parse(b.responseText);de(x.access_token,x.refresh_token,x.id_token,S),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var E=f.pop();E!=null;E=f.pop())E.setSuccess(!0)}else{M("[KEYCLOAK] Failed to refresh token"),b.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var E=f.pop();E!=null;E=f.pop())E.setError(!0)}},b.send(C)}}};if(l.enable){var w=re();w.then(function(){m()}).catch(function(p){c.setError(p)})}else m();return c.promise},o.clearToken=function(){o.token&&(de(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};function D(){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 he(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function Q(a,c){var m=a.code,w=a.error,p=a.prompt,C=new Date().getTime();if(a.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(a.kc_action_status),w){if(p!="none"){var v={error:w,error_description:a.error_description};o.onAuthError&&o.onAuthError(v),c&&c.setError(v)}else c&&c.setSuccess();return}else o.flow!="standard"&&(a.access_token||a.id_token)&&E(a.access_token,null,a.id_token,!0);if(o.flow!="implicit"&&m){var b="code="+m+"&grant_type=authorization_code",S=o.endpoints.token(),x=new XMLHttpRequest;x.open("POST",S,!0),x.setRequestHeader("Content-type","application/x-www-form-urlencoded"),b+="&client_id="+encodeURIComponent(o.clientId),b+="&redirect_uri="+a.redirectUri,a.pkceCodeVerifier&&(b+="&code_verifier="+a.pkceCodeVerifier),x.withCredentials=!0,x.onreadystatechange=function(){if(x.readyState==4)if(x.status==200){var L=JSON.parse(x.responseText);E(L.access_token,L.refresh_token,L.id_token,o.flow==="standard"),N()}else o.onAuthError&&o.onAuthError(),c&&c.setError()},x.send(b)}function E(L,G,ne,j){C=(C+new Date().getTime())/2,de(L,G,ne,C),_&&(o.tokenParsed&&o.tokenParsed.nonce!=a.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=a.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=a.storedNonce)?(H("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),c&&c.setError()):j&&(o.onAuthSuccess&&o.onAuthSuccess(),c&&c.setSuccess())}}function ie(a){var c=R(),m;s?typeof s=="string"&&(m=s):m="keycloak.json";function w(x){x?o.endpoints={authorize:function(){return x.authorization_endpoint},token:function(){return x.token_endpoint},logout:function(){if(!x.end_session_endpoint)throw"Not supported by the OIDC server";return x.end_session_endpoint},checkSessionIframe:function(){if(!x.check_session_iframe)throw"Not supported by the OIDC server";return x.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!x.userinfo_endpoint)throw"Not supported by the OIDC server";return x.userinfo_endpoint}}:o.endpoints={authorize:function(){return D()+"/protocol/openid-connect/auth"},token:function(){return D()+"/protocol/openid-connect/token"},logout:function(){return D()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var E=D()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(E=E+"?version="+o.iframeVersion),E},thirdPartyCookiesIframe:function(){var E=D()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(E=E+"?version="+o.iframeVersion),E},register:function(){return D()+"/protocol/openid-connect/registrations"},userinfo:function(){return D()+"/protocol/openid-connect/userinfo"}}}if(m){var p=new XMLHttpRequest;p.open("GET",m,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||Se(p)){var x=JSON.parse(p.responseText);o.authServerUrl=x["auth-server-url"],o.realm=x.realm,o.clientId=x.resource,w(null),c.setSuccess()}else c.setError()},p.send()}else{if(!s.clientId)throw"clientId missing";o.clientId=s.clientId;var C=s.oidcProvider;if(C)if(typeof C=="string"){var S;C.charAt(C.length-1)=="/"?S=C+".well-known/openid-configuration":S=C+"/.well-known/openid-configuration";var p=new XMLHttpRequest;p.open("GET",S,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||Se(p)){var E=JSON.parse(p.responseText);w(E),c.setSuccess()}else c.setError()},p.send()}else w(C),c.setSuccess();else{if(!s.url){for(var v=document.getElementsByTagName("script"),b=0;b<v.length;b++)if(v[b].src.match(/.*keycloak\.js/)){s.url=v[b].src.substr(0,v[b].src.indexOf("/js/keycloak.js"));break}}if(!s.realm)throw"realm missing";o.authServerUrl=s.url,o.realm=s.realm,w(null),c.setSuccess()}}return c.promise}function Se(a){return a.status==0&&a.responseText&&a.responseURL.startsWith("file:")}function de(a,c,m,w){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),c?(o.refreshToken=c,o.refreshTokenParsed=Ae(c)):(delete o.refreshToken,delete o.refreshTokenParsed),m?(o.idToken=m,o.idTokenParsed=Ae(m)):(delete o.idToken,delete o.idTokenParsed),a){if(o.token=a,o.tokenParsed=Ae(a),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,w&&(o.timeSkew=Math.floor(w/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(H("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var p=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;H("[KEYCLOAK] Token expires in "+Math.round(p/1e3)+" s"),p<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,p)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function Ae(a){switch(a=a.split(".")[1],a=a.replace(/-/g,"+"),a=a.replace(/_/g,"/"),a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw"Invalid token"}return a=decodeURIComponent(escape(atob(a))),a=JSON.parse(a),a}function Ie(){var a="0123456789abcdef",c=B(36,a).split("");c[14]="4",c[19]=a.substr(c[19]&3|8,1),c[8]=c[13]=c[18]=c[23]="-";var m=c.join("");return m}function ae(a){var c=Oe(a);if(c){var m=y.get(c.state);return m&&(c.valid=!0,c.redirectUri=m.redirectUri,c.storedNonce=m.nonce,c.prompt=m.prompt,c.pkceCodeVerifier=m.pkceCodeVerifier),c}}function Oe(a){var c;switch(o.flow){case"standard":c=["code","state","session_state","kc_action_status","iss"];break;case"implicit":c=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":c=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}c.push("error"),c.push("error_description"),c.push("error_uri");var m=a.indexOf("?"),w=a.indexOf("#"),p,C;if(o.responseMode==="query"&&m!==-1?(p=a.substring(0,m),C=Fe(a.substring(m+1,w!==-1?w:a.length),c),C.paramsString!==""&&(p+="?"+C.paramsString),w!==-1&&(p+=a.substring(w))):o.responseMode==="fragment"&&w!==-1&&(p=a.substring(0,w),C=Fe(a.substring(w+1),c),C.paramsString!==""&&(p+="#"+C.paramsString)),C&&C.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((C.oauthParams.code||C.oauthParams.error)&&C.oauthParams.state)return C.oauthParams.newUrl=p,C.oauthParams}else if(o.flow==="implicit"&&(C.oauthParams.access_token||C.oauthParams.error)&&C.oauthParams.state)return C.oauthParams.newUrl=p,C.oauthParams}}function Fe(a,c){for(var m=a.split("&"),w={paramsString:"",oauthParams:{}},p=0;p<m.length;p++){var C=m[p].indexOf("="),v=m[p].slice(0,C);c.indexOf(v)!==-1?w.oauthParams[v]=m[p].slice(C+1):(w.paramsString!==""&&(w.paramsString+="&"),w.paramsString+=m[p])}return w}function R(){var a={setSuccess:function(c){a.resolve(c)},setError:function(c){a.reject(c)}};return a.promise=new Promise(function(c,m){a.resolve=c,a.reject=m}),a}function u(a,c,m){var w=null,p=new Promise(function(C,v){w=setTimeout(function(){v({error:m||"Promise is not settled within timeout of "+c+"ms"})},c)});return Promise.race([a,p]).finally(function(){clearTimeout(w)})}function ce(){var a=R();if(!l.enable||l.iframe)return a.setSuccess(),a.promise;var c=document.createElement("iframe");l.iframe=c,c.onload=function(){var p=o.endpoints.authorize();p.charAt(0)==="/"?l.iframeOrigin=he():l.iframeOrigin=p.substring(0,p.indexOf("/",8)),a.setSuccess()};var m=o.endpoints.checkSessionIframe();c.setAttribute("src",m),c.setAttribute("sandbox","allow-scripts allow-same-origin"),c.setAttribute("title","keycloak-session-iframe"),c.style.display="none",document.body.appendChild(c);var w=function(p){if(!(p.origin!==l.iframeOrigin||l.iframe.contentWindow!==p.source)&&(p.data=="unchanged"||p.data=="changed"||p.data=="error")){p.data!="unchanged"&&o.clearToken();for(var C=l.callbackList.splice(0,l.callbackList.length),v=C.length-1;v>=0;--v){var b=C[v];p.data=="error"?b.setError():b.setSuccess(p.data=="unchanged")}}};return window.addEventListener("message",w,!1),a.promise}function N(){l.enable&&o.token&&setTimeout(function(){re().then(function(a){a&&N()})},l.interval*1e3)}function re(){var a=R();if(l.iframe&&l.iframeOrigin){var c=o.clientId+" "+(o.sessionId?o.sessionId:"");l.callbackList.push(a);var m=l.iframeOrigin;l.callbackList.length==1&&l.iframe.contentWindow.postMessage(c,m)}else a.setSuccess();return a.promise}function Y(){var a=R();if(l.enable||o.silentCheckSsoRedirectUri){var c=document.createElement("iframe");c.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),c.setAttribute("sandbox","allow-scripts allow-same-origin"),c.setAttribute("title","keycloak-3p-check-iframe"),c.style.display="none",document.body.appendChild(c);var m=function(w){c.contentWindow===w.source&&(w.data!=="supported"&&w.data!=="unsupported"||(w.data==="unsupported"&&(M(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
9
|
+
|
|
10
|
+
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
11
|
+
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|
|
12
|
+
|
|
13
|
+
For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),l.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(c),window.removeEventListener("message",m),a.setSuccess()))};window.addEventListener("message",m,!1)}else a.setSuccess();return u(a.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function I(a){if(!a||a=="default")return{login:function(v){return window.location.assign(o.createLoginUrl(v)),R().promise},logout:function(v){return window.location.replace(o.createLogoutUrl(v)),R().promise},register:function(v){return window.location.assign(o.createRegisterUrl(v)),R().promise},accountManagement:function(){var v=o.createAccountUrl();if(typeof v<"u")window.location.href=v;else throw"Not supported by the OIDC server";return R().promise},redirectUri:function(v,b){return v&&v.redirectUri?v.redirectUri:o.redirectUri?o.redirectUri:location.href}};if(a=="cordova"){l.enable=!1;var c=function(v,b,S){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(v,b,S):window.open(v,b,S)},m=function(v){return v&&v.cordovaOptions?Object.keys(v.cordovaOptions).reduce(function(b,S){return b[S]=v.cordovaOptions[S],b},{}):{}},w=function(v){return Object.keys(v).reduce(function(b,S){return b.push(S+"="+v[S]),b},[]).join(",")},p=function(v){var b=m(v);return b.location="no",v&&v.prompt=="none"&&(b.hidden="yes"),w(b)},C=o.redirectUri||"http://localhost";return{login:function(v){var b=R(),S=p(v),x=o.createLoginUrl(v),E=c(x,"_blank",S),L=!1,G=!1,ne=function(){G=!0,E.close()};return E.addEventListener("loadstart",function(j){if(j.url.indexOf(C)==0){var pe=ae(j.url);Q(pe,b),ne(),L=!0}}),E.addEventListener("loaderror",function(j){if(!L)if(j.url.indexOf(C)==0){var pe=ae(j.url);Q(pe,b),ne(),L=!0}else b.setError(),ne()}),E.addEventListener("exit",function(j){G||b.setError({reason:"closed_by_user"})}),b.promise},logout:function(v){var b=R(),S=o.createLogoutUrl(v),x=c(S,"_blank","location=no,hidden=yes,clearcache=yes"),E;return x.addEventListener("loadstart",function(L){L.url.indexOf(C)==0&&x.close()}),x.addEventListener("loaderror",function(L){L.url.indexOf(C)==0||(E=!0),x.close()}),x.addEventListener("exit",function(L){E?b.setError():(o.clearToken(),b.setSuccess())}),b.promise},register:function(v){var b=R(),S=o.createRegisterUrl(),x=p(v),E=c(S,"_blank",x);return E.addEventListener("loadstart",function(L){if(L.url.indexOf(C)==0){E.close();var G=ae(L.url);Q(G,b)}}),b.promise},accountManagement:function(){var v=o.createAccountUrl();if(typeof v<"u"){var b=c(v,"_blank","location=no");b.addEventListener("loadstart",function(S){S.url.indexOf(C)==0&&b.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(v){return C}}}if(a=="cordova-native")return l.enable=!1,{login:function(v){var b=R(),S=o.createLoginUrl(v);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var E=ae(x.url);Q(E,b)}),window.cordova.plugins.browsertab.openUrl(S),b.promise},logout:function(v){var b=R(),S=o.createLogoutUrl(v);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),b.setSuccess()}),window.cordova.plugins.browsertab.openUrl(S),b.promise},register:function(v){var b=R(),S=o.createRegisterUrl(v);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var E=ae(x.url);Q(E,b)}),window.cordova.plugins.browsertab.openUrl(S),b.promise},accountManagement:function(){var v=o.createAccountUrl();if(typeof v<"u")window.cordova.plugins.browsertab.openUrl(v);else throw"Not supported by the OIDC server"},redirectUri:function(v){return v&&v.redirectUri?v.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+a}var le=function(){if(!(this instanceof le))return new le;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var a=this;function c(){for(var m=new Date().getTime(),w=0;w<localStorage.length;w++){var p=localStorage.key(w);if(p&&p.indexOf("kc-callback-")==0){var C=localStorage.getItem(p);if(C)try{var v=JSON.parse(C).expires;(!v||v<m)&&localStorage.removeItem(p)}catch{localStorage.removeItem(p)}}}}a.get=function(m){if(m){var w="kc-callback-"+m,p=localStorage.getItem(w);return p&&(localStorage.removeItem(w),p=JSON.parse(p)),c(),p}},a.add=function(m){c();var w="kc-callback-"+m.state;m.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(w,JSON.stringify(m))}},ve=function(){if(!(this instanceof ve))return new ve;var a=this;a.get=function(p){if(p){var C=m("kc-callback-"+p);if(w("kc-callback-"+p,"",c(-100)),C)return JSON.parse(C)}},a.add=function(p){w("kc-callback-"+p.state,JSON.stringify(p),c(60))},a.removeItem=function(p){w(p,"",c(-100))};var c=function(p){var C=new Date;return C.setTime(C.getTime()+p*60*1e3),C},m=function(p){for(var C=p+"=",v=document.cookie.split(";"),b=0;b<v.length;b++){for(var S=v[b];S.charAt(0)==" ";)S=S.substring(1);if(S.indexOf(C)==0)return S.substring(C.length,S.length)}return""},w=function(p,C,v){var b=p+"="+C+"; expires="+v.toUTCString()+"; ";document.cookie=b}};function be(){try{return new le}catch{}return new ve}function _e(a){return function(){o.enableLogging&&a.apply(console,Array.prototype.slice.call(arguments))}}}const keycloakInstance=new Keycloak,Login=(s,o)=>{keycloakInstance.init({onLoad:"login-required"}).then(async d=>{d&&await FetchUserInfo(),s()}).catch(d=>{o(d)})},FetchUserInfo=async()=>{const s=await keycloakInstance.loadUserInfo();AuthService.User.email=s.email??"",AuthService.User.emailVerified=s.email_verified===!0,AuthService.User.firstName=s.given_name??"",AuthService.User.lastName=s.family_name??"",AuthService.User.name=s.name??"",AuthService.User.sub=s.sub??"",AuthService.User.username=s.preferred_username??"",AuthService.User.roles=[...s.role??[]],AuthService.User.groups=[...s.group??[]],AuthService.User.IsInRole=o=>AuthService.User.roles.includes(o)},Logout=()=>{keycloakInstance.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})},AuthService={Instance:keycloakInstance,User:{},CallLogin:Login,CallLogout:Logout};class NavMenuService{constructor(){Ze(this,"_visible",vue.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 LkNavMenuService=new NavMenuService,UseNavMenuService=()=>LkNavMenuService;var Cor=(s=>(s.Primary="primary",s.Secondary="secondary",s.Info="info",s.Success="success",s.Help="help",s.Warn="warn",s.Error="error",s))(Cor||{}),Tamanho=(s=>(s.Pequeno="sm",s.Medio="md",s.Grande="lg",s))(Tamanho||{});const _export_sfc=(s,o)=>{const d=s.__vccOpts||s;for(const[f,y]of o)d[f]=y;return d},_sfc_main$8={},_hoisted_1$6={class:"sf-loading-circle"},_hoisted_2$6=vue.createElementVNode("div",null,[vue.createElementVNode("svg",{viewBox:"25 25 50 50"},[vue.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1),_hoisted_3$3=[_hoisted_2$6];function _sfc_render$2(s,o){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,_hoisted_3$3)}const LoadingCircle=_export_sfc(_sfc_main$8,[["render",_sfc_render$2]]);class CssClassBuilder{constructor(o){Ze(this,"retorno");this.retorno=o??""}Concat(o){return o&&o.trim().length&&(this.retorno+=` ${o}`),this}AddClass(o,d=!0){return d?this.Concat(o):this}Build(){return this.retorno.trim()}}const _hoisted_1$5=["disabled","tabindex"],_hoisted_2$5=["data-color"],_sfc_main$7=vue.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:Tamanho.Medio},dot:{type:Boolean},dotColor:{default:Cor.Error},buttonProps:{}},setup(s){const o=s;function d(){return new CssClassBuilder(`${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===Tamanho.Pequeno).AddClass("sf-icon-medium",o.tamanho===Tamanho.Medio).AddClass("sf-icon-large",o.tamanho===Tamanho.Grande).AddClass("sf-ripple",o.button===!0).Build()}return(f,y)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(o.style),class:vue.normalizeClass(d())},[vue.createElementVNode("button",vue.mergeProps({class:"material-symbols-outlined",disabled:o.disabled||o.loading},o.buttonProps,{tabindex:o.button?void 0:-1}),[o.loading?(vue.openBlock(),vue.createBlock(LoadingCircle,{key:0})):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(o.icone),1)],64))],16,_hoisted_1$5),o.dot?(vue.openBlock(),vue.createElementBlock("span",{key:0,"data-color":o.dotColor},null,8,_hoisted_2$5)):vue.createCommentVNode("",!0)],6))}}),_sfc_main$6={},_hoisted_1$4={class:"sf-internal-icon-button sf-ripple"},_hoisted_2$4=vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48"},[vue.createElementVNode("path",{d:"M194.694-124.001q-28.254 0-49.473-21.22-21.22-21.219-21.22-49.473v-570.612q0-28.254 21.22-49.473 21.219-21.22 49.473-21.22h285.075v58.384H194.694q-4.616 0-8.463 3.846-3.846 3.847-3.846 8.463v570.612q0 4.616 3.846 8.463 3.847 3.846 8.463 3.846h285.075v58.384H194.694Zm469.614-183.693-42.999-42.23 101.384-101.384H360.846v-58.384h360.616L620.078-611.076l42.615-41.615 173.306 173.499-171.691 171.498Z"})],-1),_hoisted_3$2=[_hoisted_2$4];function _sfc_render$1(s,o){return vue.openBlock(),vue.createElementBlock("button",_hoisted_1$4,_hoisted_3$2)}const LogoutIcon=_export_sfc(_sfc_main$6,[["render",_sfc_render$1]]),_sfc_main$5={},_hoisted_1$3={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},_hoisted_2$3=vue.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),_hoisted_3$1=[_hoisted_2$3];function _sfc_render(s,o){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$3,_hoisted_3$1)}const MenuIcon=_export_sfc(_sfc_main$5,[["render",_sfc_render]]);class ThemeToggle{get storedTheme(){return localStorage.getItem("lkVueTheme")}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("lkVueTheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("lkVueTheme","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 ThemeToggleBase=(()=>new ThemeToggle)(),_hoisted_1$2=vue.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),_hoisted_2$2=[_hoisted_1$2],_sfc_main$4=vue.defineComponent({__name:"ThemeToggle",setup(s){return(o,d)=>(vue.openBlock(),vue.createElementBlock("button",{id:"sf-theme-toggle",onClick:d[0]||(d[0]=(...f)=>vue.unref(ThemeToggleBase).Toggle&&vue.unref(ThemeToggleBase).Toggle(...f))},_hoisted_2$2))}}),_hoisted_1$1={id:"sf-layout"},_hoisted_2$1=vue.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),_hoisted_3={class:"title"},_hoisted_4={class:"sf-layout-nav-header"},_hoisted_5=vue.createElementVNode("span",null,"Menu",-1),_hoisted_6={class:"sf-layout-nav-content"},_hoisted_7=vue.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),_hoisted_8={id:"sf-layout-content"},_sfc_main$3=vue.defineComponent({__name:"Layout",setup(s){const o=UseNavMenuService(),d=UseDialogService();async function f(){await d.ConfirmAsync({message:"Você deseja sair da sua conta?",confirmLabel:"sair"})&&AuthService.CallLogout()}return(y,l)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("header",null,[vue.createElementVNode("div",{class:vue.normalizeClass(["sf-layout-menu-toggler",{invert:vue.unref(o).IsVisible}]),onClick:l[0]||(l[0]=k=>vue.unref(o).Toggle())},[_hoisted_2$1,vue.createVNode(MenuIcon)],2),vue.createElementVNode("div",_hoisted_3,[vue.renderSlot(y.$slots,"title")]),vue.renderSlot(y.$slots,"action"),vue.createVNode(_sfc_main$4),vue.createVNode(LogoutIcon,{onClick:f})]),vue.createElementVNode("nav",{class:vue.normalizeClass({visible:vue.unref(o).IsVisible})},[vue.createElementVNode("div",_hoisted_4,[_hoisted_5,vue.createVNode(_sfc_main$7,{icone:"close",button:"",onClick:l[1]||(l[1]=k=>vue.unref(o).Close())})]),vue.createElementVNode("div",_hoisted_6,[vue.renderSlot(y.$slots,"menu")])],2),vue.createElementVNode("main",{class:vue.normalizeClass({"menu-visible":vue.unref(o).IsVisible})},[_hoisted_7,vue.createElementVNode("section",_hoisted_8,[vue.renderSlot(y.$slots,"content")])],2)]))}}),_hoisted_1=["href","data-active","onClick"],_hoisted_2={class:"sf-navmenulink-text"},_sfc_main$2=vue.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{}},setup(s){const o=s,d=UseNavMenuService();function f(y,l){y.preventDefault();const g=y.target.closest(".sf-layout-nav-content");l(),g&&g.clientWidth+10>document.body.clientWidth&&d.Close()}return(y,l)=>{const k=vue.resolveComponent("router-link");return vue.openBlock(),vue.createBlock(k,{to:o.href,custom:""},{default:vue.withCtx(({href:g,navigate:_,isExactActive:H})=>[vue.createElementVNode("a",{class:"sf-navmenulink",href:g,"data-active":H,onClick:M=>f(M,_)},[o.icon?(vue.openBlock(),vue.createBlock(_sfc_main$7,{key:0,icone:o.icon,"button-props":{tabindex:-1}},null,8,["icone"])):vue.createCommentVNode("",!0),vue.createElementVNode("span",_hoisted_2,vue.toDisplayString(o.text),1)],8,_hoisted_1)]),_:1},8,["to"])}}}),_sfc_main$1=vue.defineComponent({__name:"ScrollToTop",setup(s){const o=vue.ref(!1),d=`--${+new Date}`;let f=null;function y(){f==null||f.scrollTo(0,0)}return vue.onMounted(()=>{var l;f=((l=document.getElementById(d))==null?void 0:l.parentElement)??null,f&&f.addEventListener("scroll",function(){o.value=this.scrollTop-this.clientHeight>0})}),(l,k)=>(vue.openBlock(),vue.createElementBlock("button",{id:d,class:vue.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":o.value}]),onClick:y},null,2))}}),_sfc_main=vue.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(s){const o=s;function d(){return new CssClassBuilder("sf-content").AddClass(o.class,!!o.class).Build()}function f(){return new CssClassBuilder("sf-content-body").AddClass("sf-content-no-padding",o.disableBodyPadding).Build()}function y(){return new CssClassBuilder("sf-content-header").AddClass("sf-content-no-padding",o.disableHeaderPadding).Build()}function l(){return new CssClassBuilder("sf-content-footer").AddClass("sf-content-no-padding",o.disableFooterPadding).Build()}return(k,g)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(d()),style:vue.normalizeStyle(o.style)},[vue.createElementVNode("div",{class:vue.normalizeClass(y())},[vue.renderSlot(k.$slots,"header")],2),vue.createElementVNode("div",{class:vue.normalizeClass(f())},[vue.renderSlot(k.$slots,"default"),vue.createVNode(_sfc_main$1)],2),vue.createElementVNode("div",{class:vue.normalizeClass(l())},[vue.renderSlot(k.$slots,"footer")],2)],6))}});var sweetalert2={exports:{}};/*!
|
|
14
|
+
* sweetalert2 v11.4.8
|
|
15
|
+
* Released under the MIT License.
|
|
16
|
+
*/(function(s,o){(function(d,f){s.exports=f()})(commonjsGlobal,function(){const d="SweetAlert2:",f=e=>{const t=[];for(let n=0;n<e.length;n++)t.indexOf(e[n])===-1&&t.push(e[n]);return t},y=e=>e.charAt(0).toUpperCase()+e.slice(1),l=e=>Array.prototype.slice.call(e),k=e=>{console.warn("".concat(d," ").concat(typeof e=="object"?e.join(" "):e))},g=e=>{console.error("".concat(d," ").concat(e))},_=[],H=e=>{_.includes(e)||(_.push(e),k(e))},M=(e,t)=>{H('"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'))},O=e=>typeof e=="function"?e():e,z=e=>e&&typeof e.toPromise=="function",B=e=>z(e)?e.toPromise():Promise.resolve(e),J=e=>e&&Promise.resolve(e)===e,V={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:"×",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},D=["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"],he={},Q=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],ie=e=>Object.prototype.hasOwnProperty.call(V,e),Se=e=>D.indexOf(e)!==-1,de=e=>he[e],Ae=e=>{ie(e)||k('Unknown parameter "'.concat(e,'"'))},Ie=e=>{Q.includes(e)&&k('The parameter "'.concat(e,'" is incompatible with toasts'))},ae=e=>{de(e)&&M(e,de(e))},Oe=e=>{!e.backdrop&&e.allowOutsideClick&&k('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Ae(t),e.toast&&Ie(t),ae(t)},Fe="swal2-",R=e=>{const t={};for(const n in e)t[e[n]]=Fe+e[n];return t},u=R(["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"]),ce=R(["success","warning","info","question","error"]),N=()=>document.body.querySelector(".".concat(u.container)),re=e=>{const t=N();return t?t.querySelector(e):null},Y=e=>re(".".concat(e)),I=()=>Y(u.popup),le=()=>Y(u.icon),ve=()=>Y(u.title),be=()=>Y(u["html-container"]),_e=()=>Y(u.image),a=()=>Y(u["progress-steps"]),c=()=>Y(u["validation-message"]),m=()=>re(".".concat(u.actions," .").concat(u.confirm)),w=()=>re(".".concat(u.actions," .").concat(u.deny)),p=()=>Y(u["input-label"]),C=()=>re(".".concat(u.loader)),v=()=>re(".".concat(u.actions," .").concat(u.cancel)),b=()=>Y(u.actions),S=()=>Y(u.footer),x=()=>Y(u["timer-progress-bar"]),E=()=>Y(u.close),L=`
|
|
17
|
+
a[href],
|
|
18
|
+
area[href],
|
|
19
|
+
input:not([disabled]),
|
|
20
|
+
select:not([disabled]),
|
|
21
|
+
textarea:not([disabled]),
|
|
22
|
+
button:not([disabled]),
|
|
23
|
+
iframe,
|
|
24
|
+
object,
|
|
25
|
+
embed,
|
|
26
|
+
[tabindex="0"],
|
|
27
|
+
[contenteditable],
|
|
28
|
+
audio[controls],
|
|
29
|
+
video[controls],
|
|
30
|
+
summary
|
|
31
|
+
`,G=()=>{const e=l(I().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n,r)=>{const h=parseInt(n.getAttribute("tabindex")),A=parseInt(r.getAttribute("tabindex"));return h>A?1:h<A?-1:0}),t=l(I().querySelectorAll(L)).filter(n=>n.getAttribute("tabindex")!=="-1");return f(e.concat(t)).filter(n=>ee(n))},ne=()=>ue(document.body,u.shown)&&!ue(document.body,u["toast-shown"])&&!ue(document.body,u["no-backdrop"]),j=()=>I()&&ue(I(),u.toast),pe=()=>I().hasAttribute("data-loading"),we={previousBodyPadding:null},$=(e,t)=>{if(e.textContent="",t){const r=new DOMParser().parseFromString(t,"text/html");l(r.querySelector("head").childNodes).forEach(h=>{e.appendChild(h)}),l(r.querySelector("body").childNodes).forEach(h=>{e.appendChild(h)})}},ue=(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},Ft=(e,t)=>{l(e.classList).forEach(n=>{!Object.values(u).includes(n)&&!Object.values(ce).includes(n)&&!Object.values(t.showClass).includes(n)&&e.classList.remove(n)})},oe=(e,t,n)=>{if(Ft(e,t),t.customClass&&t.customClass[n]){if(typeof t.customClass[n]!="string"&&!t.customClass[n].forEach)return k("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));F(e,t.customClass[n])}},Ne=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(u.popup," > .").concat(u[t]));case"checkbox":return e.querySelector(".".concat(u.popup," > .").concat(u.checkbox," input"));case"radio":return e.querySelector(".".concat(u.popup," > .").concat(u.radio," input:checked"))||e.querySelector(".".concat(u.popup," > .").concat(u.radio," input:first-child"));case"range":return e.querySelector(".".concat(u.popup," > .").concat(u.range," input"));default:return e.querySelector(".".concat(u.popup," > .").concat(u.input))}},Qe=e=>{if(e.focus(),e.type!=="file"){const t=e.value;e.value="",e.value=t}},et=(e,t,n)=>{!e||!t||(typeof t=="string"&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(r=>{Array.isArray(e)?e.forEach(h=>{n?h.classList.add(r):h.classList.remove(r)}):n?e.classList.add(r):e.classList.remove(r)}))},F=(e,t)=>{et(e,t,!0)},se=(e,t)=>{et(e,t,!1)},fe=(e,t)=>{const n=l(e.childNodes);for(let r=0;r<n.length;r++)if(ue(n[r],t))return n[r]},Ee=(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)},X=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"flex";e.style.display=t},q=e=>{e.style.display="none"},tt=(e,t,n,r)=>{const h=e.querySelector(t);h&&(h.style[n]=r)},Le=(e,t,n)=>{t?X(e,n):q(e)},ee=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),Lt=()=>!ee(m())&&!ee(w())&&!ee(v()),nt=e=>e.scrollHeight>e.clientHeight,ot=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},Ve=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=x();ee(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))},Rt=()=>{const e=x(),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,"%")},rt=()=>typeof window>"u"||typeof document>"u",Ut=100,T={},Mt=()=>{T.previousActiveElement&&T.previousActiveElement.focus?(T.previousActiveElement.focus(),T.previousActiveElement=null):document.body&&document.body.focus()},Ot=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;T.restoreFocusTimeout=setTimeout(()=>{Mt(),t()},Ut),window.scrollTo(n,r)}),Nt=`
|
|
32
|
+
<div aria-labelledby="`.concat(u.title,'" aria-describedby="').concat(u["html-container"],'" class="').concat(u.popup,`" tabindex="-1">
|
|
33
|
+
<button type="button" class="`).concat(u.close,`"></button>
|
|
34
|
+
<ul class="`).concat(u["progress-steps"],`"></ul>
|
|
35
|
+
<div class="`).concat(u.icon,`"></div>
|
|
36
|
+
<img class="`).concat(u.image,`" />
|
|
37
|
+
<h2 class="`).concat(u.title,'" id="').concat(u.title,`"></h2>
|
|
38
|
+
<div class="`).concat(u["html-container"],'" id="').concat(u["html-container"],`"></div>
|
|
39
|
+
<input class="`).concat(u.input,`" />
|
|
40
|
+
<input type="file" class="`).concat(u.file,`" />
|
|
41
|
+
<div class="`).concat(u.range,`">
|
|
42
|
+
<input type="range" />
|
|
43
|
+
<output></output>
|
|
44
|
+
</div>
|
|
45
|
+
<select class="`).concat(u.select,`"></select>
|
|
46
|
+
<div class="`).concat(u.radio,`"></div>
|
|
47
|
+
<label for="`).concat(u.checkbox,'" class="').concat(u.checkbox,`">
|
|
48
|
+
<input type="checkbox" />
|
|
49
|
+
<span class="`).concat(u.label,`"></span>
|
|
50
|
+
</label>
|
|
51
|
+
<textarea class="`).concat(u.textarea,`"></textarea>
|
|
52
|
+
<div class="`).concat(u["validation-message"],'" id="').concat(u["validation-message"],`"></div>
|
|
53
|
+
<div class="`).concat(u.actions,`">
|
|
54
|
+
<div class="`).concat(u.loader,`"></div>
|
|
55
|
+
<button type="button" class="`).concat(u.confirm,`"></button>
|
|
56
|
+
<button type="button" class="`).concat(u.deny,`"></button>
|
|
57
|
+
<button type="button" class="`).concat(u.cancel,`"></button>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="`).concat(u.footer,`"></div>
|
|
60
|
+
<div class="`).concat(u["timer-progress-bar-container"],`">
|
|
61
|
+
<div class="`).concat(u["timer-progress-bar"],`"></div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
`).replace(/(^|\n)\s*/g,""),Vt=()=>{const e=N();return e?(e.remove(),se([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0):!1},me=()=>{T.currentInstance.resetValidationMessage()},Dt=()=>{const e=I(),t=fe(e,u.input),n=fe(e,u.file),r=e.querySelector(".".concat(u.range," input")),h=e.querySelector(".".concat(u.range," output")),A=fe(e,u.select),U=e.querySelector(".".concat(u.checkbox," input")),te=fe(e,u.textarea);t.oninput=me,n.onchange=me,A.onchange=me,U.onchange=me,te.oninput=me,r.oninput=()=>{me(),h.value=r.value},r.onchange=()=>{me(),r.nextSibling.value=r.value}},jt=e=>typeof e=="string"?document.querySelector(e):e,Xt=e=>{const t=I();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},$t=e=>{window.getComputedStyle(e).direction==="rtl"&&F(N(),u.rtl)},qt=e=>{const t=Vt();if(rt()){g("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=u.container,t&&F(n,u["no-transition"]),$(n,Nt);const r=jt(e.target);r.appendChild(n),Xt(e),$t(r),Dt()},De=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e=="object"?Kt(e,t):e&&$(t,e)},Kt=(e,t)=>{e.jquery?Wt(t,e):$(t,e.toString())},Wt=(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))},Te=(()=>{if(rt())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})(),zt=()=>{const e=document.createElement("div");e.className=u["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},Jt=(e,t)=>{const n=b(),r=C();!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?q(n):X(n),oe(n,t,"actions"),Yt(n,r,t),$(r,t.loaderHtml),oe(r,t,"loader")};function Yt(e,t,n){const r=m(),h=w(),A=v();je(r,"confirm",n),je(h,"deny",n),je(A,"cancel",n),Gt(r,h,A,n),n.reverseButtons&&(n.toast?(e.insertBefore(A,r),e.insertBefore(h,r)):(e.insertBefore(A,t),e.insertBefore(h,t),e.insertBefore(r,t)))}function Gt(e,t,n,r){if(!r.buttonsStyling)return se([e,t,n],u.styled);F([e,t,n],u.styled),r.confirmButtonColor&&(e.style.backgroundColor=r.confirmButtonColor,F(e,u["default-outline"])),r.denyButtonColor&&(t.style.backgroundColor=r.denyButtonColor,F(t,u["default-outline"])),r.cancelButtonColor&&(n.style.backgroundColor=r.cancelButtonColor,F(n,u["default-outline"]))}function je(e,t,n){Le(e,n["show".concat(y(t),"Button")],"inline-block"),$(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=u[t],oe(e,n,"".concat(t,"Button")),F(e,n["".concat(t,"ButtonClass")])}function Zt(e,t){typeof t=="string"?e.style.background=t:t||F([document.documentElement,document.body],u["no-backdrop"])}function Qt(e,t){t in u?F(e,u[t]):(k('The "position" parameter is not valid, defaulting to "center"'),F(e,u.center))}function en(e,t){if(t&&typeof t=="string"){const n="grow-".concat(t);n in u&&F(e,u[n])}}const tn=(e,t)=>{const n=N();n&&(Zt(n,t.backdrop),Qt(n,t.position),en(n,t.grow),oe(n,t,"container"))};var P={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const nn=["input","file","range","select","radio","checkbox","textarea"],on=(e,t)=>{const n=I(),r=P.innerParams.get(e),h=!r||t.input!==r.input;nn.forEach(A=>{const U=u[A],te=fe(n,U);an(A,t.inputAttributes),te.className=U,h&&q(te)}),t.input&&(h&&rn(t),cn(t))},rn=e=>{if(!Z[e.input])return g('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=st(e.input),n=Z[e.input](t,e);X(n),setTimeout(()=>{Qe(n)})},sn=e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["type","value","style"].includes(n)||e.removeAttribute(n)}},an=(e,t)=>{const n=Ne(I(),e);if(n){sn(n);for(const r in t)n.setAttribute(r,t[r])}},cn=e=>{const t=st(e.input);e.customClass&&F(t,e.customClass.input)},Xe=(e,t)=>{(!e.placeholder||t.inputPlaceholder)&&(e.placeholder=t.inputPlaceholder)},Be=(e,t,n)=>{if(n.inputLabel){e.id=u.input;const r=document.createElement("label"),h=u["input-label"];r.setAttribute("for",e.id),r.className=h,F(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},st=e=>{const t=u[e]?u[e]:u.input;return fe(I(),t)},Z={};Z.text=Z.email=Z.password=Z.number=Z.tel=Z.url=(e,t)=>(typeof t.inputValue=="string"||typeof t.inputValue=="number"?e.value=t.inputValue:J(t.inputValue)||k('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),Be(e,e,t),Xe(e,t),e.type=t.input,e),Z.file=(e,t)=>(Be(e,e,t),Xe(e,t),e),Z.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,Be(n,e,t),e},Z.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");$(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Be(e,e,t),e},Z.radio=e=>(e.textContent="",e),Z.checkbox=(e,t)=>{const n=Ne(I(),"checkbox");n.value="1",n.id=u.checkbox,n.checked=!!t.inputValue;const r=e.querySelector("span");return $(r,t.inputPlaceholder),e},Z.textarea=(e,t)=>{e.value=t.inputValue,Xe(e,t),Be(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(I()).width),h=()=>{const A=e.offsetWidth+n(e);A>r?I().style.width="".concat(A,"px"):I().style.width=null};new MutationObserver(h).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const ln=(e,t)=>{const n=be();oe(n,t,"htmlContainer"),t.html?(De(t.html,n),X(n,"block")):t.text?(n.textContent=t.text,X(n,"block")):q(n),on(e,t)},un=(e,t)=>{const n=S();Le(n,t.footer),t.footer&&De(t.footer,n),oe(n,t,"footer")},dn=(e,t)=>{const n=E();$(n,t.closeButtonHtml),oe(n,t,"closeButton"),Le(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},fn=(e,t)=>{const n=P.innerParams.get(e),r=le();if(n&&t.icon===n.icon){at(r,t),it(r,t);return}if(!t.icon&&!t.iconHtml)return q(r);if(t.icon&&Object.keys(ce).indexOf(t.icon)===-1)return g('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),q(r);X(r),at(r,t),it(r,t),F(r,t.showClass.icon)},it=(e,t)=>{for(const n in ce)t.icon!==n&&se(e,ce[n]);F(e,ce[t.icon]),gn(e,t),hn(),oe(e,t,"icon")},hn=()=>{const e=I(),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},pn=`
|
|
65
|
+
<div class="swal2-success-circular-line-left"></div>
|
|
66
|
+
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
67
|
+
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
68
|
+
<div class="swal2-success-circular-line-right"></div>
|
|
69
|
+
`,mn=`
|
|
70
|
+
<span class="swal2-x-mark">
|
|
71
|
+
<span class="swal2-x-mark-line-left"></span>
|
|
72
|
+
<span class="swal2-x-mark-line-right"></span>
|
|
73
|
+
</span>
|
|
74
|
+
`,at=(e,t)=>{e.textContent="",t.iconHtml?$(e,ct(t.iconHtml)):t.icon==="success"?$(e,pn):t.icon==="error"?$(e,mn):$(e,ct({question:"?",warning:"!",info:"i"}[t.icon]))},gn=(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"])tt(e,n,"backgroundColor",t.iconColor);tt(e,".swal2-success-ring","borderColor",t.iconColor)}},ct=e=>'<div class="'.concat(u["icon-content"],'">').concat(e,"</div>"),vn=(e,t)=>{const n=_e();if(!t.imageUrl)return q(n);X(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),Ee(n,"width",t.imageWidth),Ee(n,"height",t.imageHeight),n.className=u.image,oe(n,t,"image")},bn=e=>{const t=document.createElement("li");return F(t,u["progress-step"]),$(t,e),t},wn=e=>{const t=document.createElement("li");return F(t,u["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t},yn=(e,t)=>{const n=a();if(!t.progressSteps||t.progressSteps.length===0)return q(n);X(n),n.textContent="",t.currentProgressStep>=t.progressSteps.length&&k("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((r,h)=>{const A=bn(r);if(n.appendChild(A),h===t.currentProgressStep&&F(A,u["active-progress-step"]),h!==t.progressSteps.length-1){const U=wn(t);n.appendChild(U)}})},kn=(e,t)=>{const n=ve();Le(n,t.title||t.titleText,"block"),t.title&&De(t.title,n),t.titleText&&(n.innerText=t.titleText),oe(n,t,"title")},Cn=(e,t)=>{const n=N(),r=I();t.toast?(Ee(n,"width",t.width),r.style.width="100%",r.insertBefore(C(),le())):Ee(r,"width",t.width),Ee(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),q(c()),xn(r,t)},xn=(e,t)=>{e.className="".concat(u.popup," ").concat(ee(e)?t.showClass.popup:""),t.toast?(F([document.documentElement,document.body],u["toast-shown"]),F(e,u.toast)):F(e,u.modal),oe(e,t,"popup"),typeof t.customClass=="string"&&F(e,t.customClass),t.icon&&F(e,u["icon-".concat(t.icon)])},lt=(e,t)=>{Cn(e,t),tn(e,t),yn(e,t),fn(e,t),vn(e,t),kn(e,t),dn(e,t),ln(e,t),Jt(e,t),un(e,t),typeof t.didRender=="function"&&t.didRender(I())},ye=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Sn=()=>{l(document.body.children).forEach(t=>{t===N()||t.contains(N())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})},ut=()=>{l(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")})},dt=["swal-title","swal-html","swal-footer"],An=e=>{const t=typeof e.template=="string"?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return In(n),Object.assign(_n(n),En(n),Tn(n),Bn(n),Pn(n),Hn(n,dt))},_n=e=>{const t={};return l(e.querySelectorAll("swal-param")).forEach(n=>{ge(n,["name","value"]);const r=n.getAttribute("name"),h=n.getAttribute("value");typeof V[r]=="boolean"&&h==="false"&&(t[r]=!1),typeof V[r]=="object"&&(t[r]=JSON.parse(h))}),t},En=e=>{const t={};return l(e.querySelectorAll("swal-button")).forEach(n=>{ge(n,["type","color","aria-label"]);const r=n.getAttribute("type");t["".concat(r,"ButtonText")]=n.innerHTML,t["show".concat(y(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},Tn=e=>{const t={},n=e.querySelector("swal-image");return n&&(ge(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},Bn=e=>{const t={},n=e.querySelector("swal-icon");return n&&(ge(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Pn=e=>{const t={},n=e.querySelector("swal-input");n&&(ge(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={},l(r).forEach(h=>{ge(h,["value"]);const A=h.getAttribute("value"),U=h.innerHTML;t.inputOptions[A]=U})),t},Hn=(e,t)=>{const n={};for(const r in t){const h=t[r],A=e.querySelector(h);A&&(ge(A,[]),n[h.replace(/^swal-/,"")]=A.innerHTML.trim())}return n},In=e=>{const t=dt.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);l(e.children).forEach(n=>{const r=n.tagName.toLowerCase();t.indexOf(r)===-1&&k("Unrecognized element <".concat(r,">"))})},ge=(e,t)=>{l(e.attributes).forEach(n=>{t.indexOf(n.name)===-1&&k(['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 ft={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 Fn(e){e.inputValidator||Object.keys(ft).forEach(t=>{e.input===t&&(e.inputValidator=ft[t])})}function Ln(e){(!e.target||typeof e.target=="string"&&!document.querySelector(e.target)||typeof e.target!="string"&&!e.target.appendChild)&&(k('Target parameter is not valid, defaulting to "body"'),e.target="body")}function Rn(e){Fn(e),e.showLoaderOnConfirm&&!e.preConfirm&&k(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
75
|
+
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
76
|
+
https://sweetalert2.github.io/#ajax-request`),Ln(e),typeof e.title=="string"&&(e.title=e.title.split(`
|
|
77
|
+
`).join("<br />")),qt(e)}class Un{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 Mn=()=>{we.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(we.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(we.previousBodyPadding+zt(),"px"))},On=()=>{we.previousBodyPadding!==null&&(document.body.style.paddingRight="".concat(we.previousBodyPadding,"px"),we.previousBodyPadding=null)},Nn=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!ue(document.body,u.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(t*-1,"px"),F(document.body,u.iosfix),Dn(),Vn()}},Vn=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);t&&n&&!e.match(/CriOS/i)&&I().scrollHeight>window.innerHeight-44&&(N().style.paddingBottom="".concat(44,"px"))},Dn=()=>{const e=N();let t;e.ontouchstart=n=>{t=jn(n)},e.ontouchmove=n=>{t&&(n.preventDefault(),n.stopPropagation())}},jn=e=>{const t=e.target,n=N();return Xn(e)||$n(e)?!1:t===n||!nt(n)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(nt(be())&&be().contains(t))},Xn=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",$n=e=>e.touches&&e.touches.length>1,qn=()=>{if(ue(document.body,u.iosfix)){const e=parseInt(document.body.style.top,10);se(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},ht=10,Kn=e=>{const t=N(),n=I();typeof e.willOpen=="function"&&e.willOpen(n);const h=window.getComputedStyle(document.body).overflowY;Jn(t,n,e),setTimeout(()=>{Wn(t,n)},ht),ne()&&(zn(t,e.scrollbarPadding,h),Sn()),!j()&&!T.previousActiveElement&&(T.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(n)),se(t,u["no-transition"])},pt=e=>{const t=I();if(e.target!==t)return;const n=N();t.removeEventListener(Te,pt),n.style.overflowY="auto"},Wn=(e,t)=>{Te&&ot(t)?(e.style.overflowY="hidden",t.addEventListener(Te,pt)):e.style.overflowY="auto"},zn=(e,t,n)=>{Nn(),t&&n!=="hidden"&&Mn(),setTimeout(()=>{e.scrollTop=0})},Jn=(e,t,n)=>{F(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),X(t,"grid"),setTimeout(()=>{F(t,n.showClass.popup),t.style.removeProperty("opacity")},ht),F([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&F([document.documentElement,document.body],u["height-auto"])},ke=e=>{let t=I();t||new Me,t=I();const n=C();j()?q(le()):Yn(t,e),X(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Yn=(e,t)=>{const n=b(),r=C();!t&&ee(m())&&(t=m()),X(n),t&&(q(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),F([e,n],u.loading)},Gn=(e,t)=>{t.input==="select"||t.input==="radio"?no(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(z(t.inputValue)||J(t.inputValue))&&(ke(m()),oo(e,t))},Zn=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Qn(n);case"radio":return eo(n);case"file":return to(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Qn=e=>e.checked?1:0,eo=e=>e.checked?e.value:null,to=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,no=(e,t)=>{const n=I(),r=h=>ro[t.input](n,$e(h),t);z(t.inputOptions)||J(t.inputOptions)?(ke(m()),B(t.inputOptions).then(h=>{e.hideLoading(),r(h)})):typeof t.inputOptions=="object"?r(t.inputOptions):g("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},oo=(e,t)=>{const n=e.getInput();q(n),B(t.inputValue).then(r=>{n.value=t.input==="number"?parseFloat(r)||0:"".concat(r),X(n),n.focus(),e.hideLoading()}).catch(r=>{g("Error in inputValue promise: ".concat(r)),n.value="",X(n),n.focus(),e.hideLoading()})},ro={select:(e,t,n)=>{const r=fe(e,u.select),h=(A,U,te)=>{const W=document.createElement("option");W.value=te,$(W,U),W.selected=mt(te,n.inputValue),A.appendChild(W)};t.forEach(A=>{const U=A[0],te=A[1];if(Array.isArray(te)){const W=document.createElement("optgroup");W.label=U,W.disabled=!1,r.appendChild(W),te.forEach(xe=>h(W,xe[1],xe[0]))}else h(r,te,U)}),r.focus()},radio:(e,t,n)=>{const r=fe(e,u.radio);t.forEach(A=>{const U=A[0],te=A[1],W=document.createElement("input"),xe=document.createElement("label");W.type="radio",W.name=u.radio,W.value=U,mt(U,n.inputValue)&&(W.checked=!0);const Ge=document.createElement("span");$(Ge,te),Ge.className=u.label,xe.appendChild(W),xe.appendChild(Ge),r.appendChild(xe)});const h=r.querySelectorAll("input");h.length&&h[0].focus()}},$e=e=>{const t=[];return typeof Map<"u"&&e instanceof Map?e.forEach((n,r)=>{let h=n;typeof h=="object"&&(h=$e(h)),t.push([r,h])}):Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&(r=$e(r)),t.push([n,r])}),t},mt=(e,t)=>t&&t.toString()===e.toString();function gt(){const e=P.innerParams.get(this);if(!e)return;const t=P.domCache.get(this);q(t.loader),j()?e.icon&&X(le()):so(t),se([t.popup,t.actions],u.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const so=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?X(t[0],"inline-block"):Lt()&&q(e.actions)};function io(e){const t=P.innerParams.get(e||this),n=P.domCache.get(e||this);return n?Ne(n.popup,t.input):null}var Pe={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const ao=()=>ee(I()),vt=()=>m()&&m().click(),co=()=>w()&&w().click(),lo=()=>v()&&v().click(),bt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},uo=(e,t,n,r)=>{bt(t),n.toast||(t.keydownHandler=h=>ho(e,h,r),t.keydownTarget=n.keydownListenerCapture?window:I(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},qe=(e,t,n)=>{const r=G();if(r.length)return t=t+n,t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();I().focus()},wt=["ArrowRight","ArrowDown"],fo=["ArrowLeft","ArrowUp"],ho=(e,t,n)=>{const r=P.innerParams.get(e);r&&(t.isComposing||t.keyCode===229||(r.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?po(e,t,r):t.key==="Tab"?mo(t,r):[...wt,...fo].includes(t.key)?go(t.key):t.key==="Escape"&&vo(t,r,n)))},po=(e,t,n)=>{if(O(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;vt(),t.preventDefault()}},mo=(e,t)=>{const n=e.target,r=G();let h=-1;for(let A=0;A<r.length;A++)if(n===r[A]){h=A;break}e.shiftKey?qe(t,h,-1):qe(t,h,1),e.stopPropagation(),e.preventDefault()},go=e=>{const t=m(),n=w(),r=v();if(![t,n,r].includes(document.activeElement))return;const h=wt.includes(e)?"nextElementSibling":"previousElementSibling";let A=document.activeElement;for(let U=0;U<b().children.length;U++){if(A=A[h],!A)return;if(ee(A)&&A instanceof HTMLButtonElement)break}A instanceof HTMLButtonElement&&A.focus()},vo=(e,t,n)=>{O(t.allowEscapeKey)&&(e.preventDefault(),n(ye.esc))};function yt(e,t,n,r){j()?kt(e,r):(Ot(n).then(()=>kt(e,r)),bt(T)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ne()&&(On(),qn(),ut()),bo()}function bo(){se([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Re(e){e=Co(e);const t=Pe.swalPromiseResolve.get(this),n=yo(this);this.isAwaitingPromise()?e.isDismissed||(He(this),t(e)):n&&t(e)}function wo(){return!!P.awaitingPromise.get(this)}const yo=e=>{const t=I();if(!t)return!1;const n=P.innerParams.get(e);if(!n||ue(t,n.hideClass.popup))return!1;se(t,n.showClass.popup),F(t,n.hideClass.popup);const r=N();return se(r,n.showClass.backdrop),F(r,n.hideClass.backdrop),xo(e,t,n),!0};function ko(e){const t=Pe.swalPromiseReject.get(this);He(this),t&&t(e)}const He=e=>{e.isAwaitingPromise()&&(P.awaitingPromise.delete(e),P.innerParams.get(e)||e._destroy())},Co=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),xo=(e,t,n)=>{const r=N(),h=Te&&ot(t);typeof n.willClose=="function"&&n.willClose(t),h?So(e,t,r,n.returnFocus,n.didClose):yt(e,r,n.returnFocus,n.didClose)},So=(e,t,n,r,h)=>{T.swalCloseEventFinishedCallback=yt.bind(null,e,n,r,h),t.addEventListener(Te,function(A){A.target===t&&(T.swalCloseEventFinishedCallback(),delete T.swalCloseEventFinishedCallback)})},kt=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),e._destroy()})};function Ct(e,t,n){const r=P.domCache.get(e);t.forEach(h=>{r[h].disabled=n})}function xt(e,t){if(!e)return!1;if(e.type==="radio"){const r=e.parentNode.parentNode.querySelectorAll("input");for(let h=0;h<r.length;h++)r[h].disabled=t}else e.disabled=t}function Ao(){Ct(this,["confirmButton","denyButton","cancelButton"],!1)}function _o(){Ct(this,["confirmButton","denyButton","cancelButton"],!0)}function Eo(){return xt(this.getInput(),!1)}function To(){return xt(this.getInput(),!0)}function Bo(e){const t=P.domCache.get(this),n=P.innerParams.get(this);$(t.validationMessage,e),t.validationMessage.className=u["validation-message"],n.customClass&&n.customClass.validationMessage&&F(t.validationMessage,n.customClass.validationMessage),X(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",u["validation-message"]),Qe(r),F(r,u.inputerror))}function Po(){const e=P.domCache.get(this);e.validationMessage&&q(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),se(t,u.inputerror))}function Ho(){return P.domCache.get(this).progressSteps}function Io(e){const t=I(),n=P.innerParams.get(this);if(!t||ue(t,n.hideClass.popup))return k("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=Fo(e),h=Object.assign({},n,r);lt(this,h),P.innerParams.set(this,h),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Fo=e=>{const t={};return Object.keys(e).forEach(n=>{Se(n)?t[n]=e[n]:k('Invalid parameter to update: "'.concat(n,`". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
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 Lo(){const e=P.domCache.get(this),t=P.innerParams.get(this);if(!t){St(this);return}e.popup&&T.swalCloseEventFinishedCallback&&(T.swalCloseEventFinishedCallback(),delete T.swalCloseEventFinishedCallback),T.deferDisposalTimer&&(clearTimeout(T.deferDisposalTimer),delete T.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),Ro(this)}const Ro=e=>{St(e),delete e.params,delete T.keydownHandler,delete T.keydownTarget,delete T.currentInstance},St=e=>{e.isAwaitingPromise()?(Ke(P,e),P.awaitingPromise.set(e,!0)):(Ke(Pe,e),Ke(P,e))},Ke=(e,t)=>{for(const n in e)e[n].delete(t)};var At=Object.freeze({hideLoading:gt,disableLoading:gt,getInput:io,close:Re,isAwaitingPromise:wo,rejectPromise:ko,handleAwaitingPromise:He,closePopup:Re,closeModal:Re,closeToast:Re,enableButtons:Ao,disableButtons:_o,enableInput:Eo,disableInput:To,showValidationMessage:Bo,resetValidationMessage:Po,getProgressSteps:Ho,update:Io,_destroy:Lo});const Uo=e=>{const t=P.innerParams.get(e);e.disableButtons(),t.input?_t(e,"confirm"):ze(e,!0)},Mo=e=>{const t=P.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?_t(e,"deny"):We(e,!1)},Oo=(e,t)=>{e.disableButtons(),t(ye.cancel)},_t=(e,t)=>{const n=P.innerParams.get(e);if(!n.input)return g('The "input" parameter is needed to be set when using returnInputValueOn'.concat(y(t)));const r=Zn(e,n);n.inputValidator?No(e,r,t):e.getInput().checkValidity()?t==="deny"?We(e,r):ze(e,r):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},No=(e,t,n)=>{const r=P.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>B(r.inputValidator(t,r.validationMessage))).then(A=>{e.enableButtons(),e.enableInput(),A?e.showValidationMessage(A):n==="deny"?We(e,t):ze(e,t)})},We=(e,t)=>{const n=P.innerParams.get(e||void 0);n.showLoaderOnDeny&&ke(w()),n.preDeny?(P.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>B(n.preDeny(t,n.validationMessage))).then(h=>{h===!1?(e.hideLoading(),He(e)):e.closePopup({isDenied:!0,value:typeof h>"u"?t:h})}).catch(h=>Tt(e||void 0,h))):e.closePopup({isDenied:!0,value:t})},Et=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Tt=(e,t)=>{e.rejectPromise(t)},ze=(e,t)=>{const n=P.innerParams.get(e||void 0);n.showLoaderOnConfirm&&ke(),n.preConfirm?(e.resetValidationMessage(),P.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>B(n.preConfirm(t,n.validationMessage))).then(h=>{ee(c())||h===!1?(e.hideLoading(),He(e)):Et(e,typeof h>"u"?t:h)}).catch(h=>Tt(e||void 0,h))):Et(e,t)},Vo=(e,t,n)=>{P.innerParams.get(e).toast?Do(e,t,n):(Xo(t),$o(t),qo(e,t,n))},Do=(e,t,n)=>{t.popup.onclick=()=>{const r=P.innerParams.get(e);r&&(jo(r)||r.timer||r.input)||n(ye.close)}},jo=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Ue=!1;const Xo=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Ue=!0)}}},$o=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Ue=!0)}}},qo=(e,t,n)=>{t.container.onclick=r=>{const h=P.innerParams.get(e);if(Ue){Ue=!1;return}r.target===t.container&&O(h.allowOutsideClick)&&n(ye.backdrop)}},Ko=e=>typeof e=="object"&&e.jquery,Bt=e=>e instanceof Element||Ko(e),Wo=e=>{const t={};return typeof e[0]=="object"&&!Bt(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((n,r)=>{const h=e[r];typeof h=="string"||Bt(h)?t[n]=h:h!==void 0&&g("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof h))}),t};function zo(){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 Jo(e){class t extends this{_main(r,h){return super._main(r,Object.assign({},e,h))}}return t}const Yo=()=>T.timeout&&T.timeout.getTimerLeft(),Pt=()=>{if(T.timeout)return Rt(),T.timeout.stop()},Ht=()=>{if(T.timeout){const e=T.timeout.start();return Ve(e),e}},Go=()=>{const e=T.timeout;return e&&(e.running?Pt():Ht())},Zo=e=>{if(T.timeout){const t=T.timeout.increase(e);return Ve(t,!0),t}},Qo=()=>T.timeout&&T.timeout.isRunning();let It=!1;const Je={};function er(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";Je[e]=this,It||(document.body.addEventListener("click",tr),It=!0)}const tr=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const n in Je){const r=t.getAttribute(n);if(r){Je[n].fire({template:r});return}}};var nr=Object.freeze({isValidParameter:ie,isUpdatableParameter:Se,isDeprecatedParameter:de,argsToParams:Wo,isVisible:ao,clickConfirm:vt,clickDeny:co,clickCancel:lo,getContainer:N,getPopup:I,getTitle:ve,getHtmlContainer:be,getImage:_e,getIcon:le,getInputLabel:p,getCloseButton:E,getActions:b,getConfirmButton:m,getDenyButton:w,getCancelButton:v,getLoader:C,getFooter:S,getTimerProgressBar:x,getFocusableElements:G,getValidationMessage:c,isLoading:pe,fire:zo,mixin:Jo,showLoading:ke,enableLoading:ke,getTimerLeft:Yo,stopTimer:Pt,resumeTimer:Ht,toggleTimer:Go,increaseTimer:Zo,isTimerRunning:Qo,bindClickHandler:er});let Ye;class Ce{constructor(){if(typeof window>"u")return;Ye=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const h=Object.freeze(this.constructor.argsToParams(n));Object.defineProperties(this,{params:{value:h,writable:!1,enumerable:!0,configurable:!0}});const A=this._main(this.params);P.promise.set(this,A)}_main(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Oe(Object.assign({},n,t)),T.currentInstance&&(T.currentInstance._destroy(),ne()&&ut()),T.currentInstance=this;const r=rr(t,n);Rn(r),Object.freeze(r),T.timeout&&(T.timeout.stop(),delete T.timeout),clearTimeout(T.restoreFocusTimeout);const h=sr(this);return lt(this,r),P.innerParams.set(this,r),or(this,h,r)}then(t){return P.promise.get(this).then(t)}finally(t){return P.promise.get(this).finally(t)}}const or=(e,t,n)=>new Promise((r,h)=>{const A=U=>{e.closePopup({isDismissed:!0,dismiss:U})};Pe.swalPromiseResolve.set(e,r),Pe.swalPromiseReject.set(e,h),t.confirmButton.onclick=()=>Uo(e),t.denyButton.onclick=()=>Mo(e),t.cancelButton.onclick=()=>Oo(e,A),t.closeButton.onclick=()=>A(ye.close),Vo(e,t,A),uo(e,T,n,A),Gn(e,n),Kn(n),ir(T,n,A),ar(t,n),setTimeout(()=>{t.container.scrollTop=0})}),rr=(e,t)=>{const n=An(e),r=Object.assign({},V,t,n,e);return r.showClass=Object.assign({},V.showClass,r.showClass),r.hideClass=Object.assign({},V.hideClass,r.hideClass),r},sr=e=>{const t={popup:I(),container:N(),actions:b(),confirmButton:m(),denyButton:w(),cancelButton:v(),loader:C(),closeButton:E(),validationMessage:c(),progressSteps:a()};return P.domCache.set(e,t),t},ir=(e,t,n)=>{const r=x();q(r),t.timer&&(e.timeout=new Un(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(X(r),oe(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&Ve(t.timer)})))},ar=(e,t)=>{if(!t.toast){if(!O(t.allowEnterKey))return lr();cr(e,t)||qe(t,-1,1)}},cr=(e,t)=>t.focusDeny&&ee(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ee(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&ee(e.confirmButton)?(e.confirmButton.focus(),!0):!1,lr=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Ce.prototype,At),Object.assign(Ce,nr),Object.keys(At).forEach(e=>{Ce[e]=function(){if(Ye)return Ye[e](...arguments)}}),Ce.DismissReason=ye,Ce.version="11.4.8";const Me=Ce;return Me.default=Me,Me}),typeof commonjsGlobal<"u"&&commonjsGlobal.Sweetalert2&&(commonjsGlobal.swal=commonjsGlobal.sweetAlert=commonjsGlobal.Swal=commonjsGlobal.SweetAlert=commonjsGlobal.Sweetalert2)})(sweetalert2);var sweetalert2Exports=sweetalert2.exports;const Swal=getDefaultExportFromCjs(sweetalert2Exports);class DialogService{get IsVisible(){return Swal.isVisible()}async ConfirmAsync(o){return new Promise(d=>{Swal.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:o.header,text:o.message,confirmButtonText:o.confirmLabel??"confirmar",cancelButtonText:o.rejectLabel??"cancelar"}).then(f=>{d(f.isConfirmed===!0)})})}}const service=new DialogService,UseDialogService=()=>service,tema="",componentes="";(()=>{function s(){vue.nextTick(()=>{setTimeout(()=>{var d;const o=document.querySelector(":root");o&&o.style.setProperty("--window-height",`${((d=window.visualViewport)==null?void 0:d.height)??window.innerHeight}px`)},1)})}s(),window.addEventListener("resize",s)})(),ThemeToggleBase.SetInitialTheme(),exports.AuthService=AuthService,exports.Cor=Cor,exports.SfContent=_sfc_main,exports.SfIcon=_sfc_main$7,exports.SfLayout=_sfc_main$3,exports.SfNavMenuLink=_sfc_main$2,exports.Tamanho=Tamanho,exports.UseDialogService=UseDialogService,exports.UseNavMenuService=UseNavMenuService,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Keycloak from "keycloak-js";
|
|
2
|
+
interface User {
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
username: string;
|
|
6
|
+
roles: string[];
|
|
7
|
+
groups: string[];
|
|
8
|
+
emailVerified: boolean;
|
|
9
|
+
firstName: string;
|
|
10
|
+
lastName: string;
|
|
11
|
+
sub: string;
|
|
12
|
+
IsInRole: (role: string) => boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const AuthService: {
|
|
15
|
+
Instance: Keycloak;
|
|
16
|
+
User: User;
|
|
17
|
+
CallLogin: (onSuccess: () => void, onError: (error: any) => void) => void;
|
|
18
|
+
CallLogout: () => void;
|
|
19
|
+
};
|
|
20
|
+
export { AuthService };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ConfirmOptions {
|
|
2
|
+
message: string;
|
|
3
|
+
header?: string;
|
|
4
|
+
confirmLabel?: string;
|
|
5
|
+
rejectLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
declare class DialogService {
|
|
8
|
+
get IsVisible(): boolean;
|
|
9
|
+
ConfirmAsync(options: ConfirmOptions): Promise<boolean>;
|
|
10
|
+
}
|
|
11
|
+
export declare const UseDialogService: () => DialogService;
|
|
12
|
+
export {};
|