!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).upsert_totp=t()}((function(){return CryptoJS.enc.u8array={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=new Uint8Array(r),o=0;o>>2]>>>24-o%4*8&255;n[o]=a}return n},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t[n])<<24-n%4*8;return CryptoJS.lib.WordArray.create(r,e)}},base32toHex=t=>{if("string"!=typeof t)throw new Error("Argument to base32toHex() is not a string");if(0===t.length)throw new Error("Argument to base32toHex() is empty");if(!t.match(/^[A-Z2-7]+=*$/i))throw new Error("Argument to base32toHex() contains invalid characters");var e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),n=(t.toUpperCase()+"========").match(/.{1,8}/g);n.pop();var o=n[n.length-1].match(/=*$/)[0].length;if(o>6)throw new Error("Invalid base32 data (too much padding)");for(var a=0;a{const e=15&t[19];return((((127&t[e])<<24)+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3])%10**6).toString(10).padStart(6,"0")},cryptoJSTotp=(t,e)=>{let r=CryptoJS.HmacSHA1(CryptoJS.enc.Hex.parse(t),CryptoJS.enc.Hex.parse(base32toHex(e))).toString(CryptoJS.enc.u8array);return truncate(r)},interval=()=>{const t=Math.floor((new Date).getTime()/1e3);return Math.floor(t/30).toString(16).padStart(16,"0")},totp=t=>cryptoJSTotp(interval(),t),(t,e)=>(otp=totp(pm.environment.get(t)),pm.environment.set(e,otp),otp)}));