@tonysamperi/ts-mapi-core 2.0.0-beta.5 → 2.0.0-beta.6

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.
@@ -1,2 +1,2 @@
1
- "use strict";var zt=Object.defineProperty;var ys=Object.getOwnPropertyDescriptor;var xs=Object.getOwnPropertyNames;var bs=Object.prototype.hasOwnProperty;var n=(e,t)=>zt(e,"name",{value:t,configurable:!0});var As=(e,t)=>{for(var r in t)zt(e,r,{get:t[r],enumerable:!0})},Es=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of xs(t))!bs.call(e,s)&&s!==r&&zt(e,s,{get:()=>t[s],enumerable:!(o=ys(t,s))||o.enumerable});return e};var vs=e=>Es(zt({},"__esModule",{value:!0}),e);var Ec={};As(Ec,{SMP_HEALTHZ:()=>Cs,SmpAbstractCacheStrategy:()=>Tt,SmpAbstractTtlCacheStrategy:()=>tt,SmpAesCrypt:()=>yt,SmpApiCommonUtils:()=>je,SmpBaseJwtToken:()=>Ne,SmpBaseJwtTokenPlain:()=>Me,SmpBrowserCache:()=>Ct,SmpCommonUtils:()=>Ke,SmpCrypto:()=>at,SmpErrorResponse:()=>L,SmpFilterException:()=>qe,SmpFirebaseErrors:()=>js,SmpGenericResponse:()=>ut,SmpGiftcardTransaction:()=>Qt,SmpGiftcardTransactionHashStrategies:()=>ct,SmpGiftcardTransactionOps:()=>j,SmpHttpSessionStorageCache:()=>It,SmpHttpStatusCodes:()=>ye,SmpHttpTwoService:()=>Pe,SmpInMemoryCache:()=>Nt,SmpMarketingCloudValidators:()=>Ns,SmpRegularExpressions:()=>Ve,SmpResponseMessage:()=>N,SmpResponseMessageTypes:()=>et,SmpRestVerbs:()=>De,SmpSecureCode:()=>Jt,SmpSid:()=>He,SmpSocialSignInKeys:()=>Is,SmpSocialSignInUxModes:()=>Ps,VERSION:()=>Ac,smpApplyMixin:()=>Ms,smpIsSmpCachedValue:()=>_e,smpNoop:()=>ls.smpNoop});module.exports=vs(Ec);var we=require("ts-luxon");var Tt=class{static{n(this,"SmpAbstractCacheStrategy")}};function _e(e){return typeof e=="object"&&e!==null&&"value"in e&&"expiry"in e&&typeof e.expiry=="number"}n(_e,"smpIsSmpCachedValue");var tt=class extends Tt{static{n(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(t){let r=this._readRaw(t);if(this._isSmpCachedValue(r)){if(r.expiry>=we.DateTime.now().ts)return r.value;this._removeRaw(t);return}return r}remove(t){this._removeRaw(t)}write(t,r,o){if(isNaN(+o)||+o<=0){this._writeRaw(t,r,o);return}let s=we.DateTime.now().ts+o*1e3,i={value:r,expiry:s};this._writeRaw(t,i,o)}_isSmpCachedValue(t){return _e(t)}};var Ct=class extends tt{static{n(this,"SmpBrowserCache")}_storage;_prefix;constructor(t,r){super(),this._storage=t,this._prefix=r}_flushRaw(){let t=[],r=-1;for(;++r<this._storage.length;){let o=this._storage.key(r);o&&o.startsWith(this._prefix)&&t.push(o)}for(r=-1;++r<t.length;)this._storage.removeItem(t[r])}_readRaw(t){let r=this._storage.getItem(this._prefix+t);try{return r?JSON.parse(r):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+t}`);return}}_removeRaw(t){this._storage.removeItem(this._prefix+t)}_writeRaw(t,r){try{this._storage.setItem(this._prefix+t,JSON.stringify(r))}catch(o){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+t}`,o)}}};var It=class extends Ct{static{n(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var ye=(function(e){return e[e.Continue=100]="Continue",e[e.SwitchingProtocols=101]="SwitchingProtocols",e[e.Processing=102]="Processing",e[e.EarlyHints=103]="EarlyHints",e[e.Ok=200]="Ok",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",e[e.NoContent=204]="NoContent",e[e.ResetContent=205]="ResetContent",e[e.PartialContent=206]="PartialContent",e[e.MultiStatus=207]="MultiStatus",e[e.AlreadyReported=208]="AlreadyReported",e[e.ImUsed=226]="ImUsed",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.Found=302]="Found",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.Unused=306]="Unused",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.LengthRequired=411]="LengthRequired",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.UriTooLong=414]="UriTooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.ImATeapot=418]="ImATeapot",e[e.MisdirectedRequest=421]="MisdirectedRequest",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.Locked=423]="Locked",e[e.FailedDependency=424]="FailedDependency",e[e.TooEarly=425]="TooEarly",e[e.UpgradeRequired=426]="UpgradeRequired",e[e.PreconditionRequired=428]="PreconditionRequired",e[e.TooManyRequests=429]="TooManyRequests",e[e.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",e[e.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HttpVersionNotSupported=505]="HttpVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.LoopDetected=508]="LoopDetected",e[e.NotExtended=510]="NotExtended",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",e})({});var Pt=require("class-transformer");var H=require("class-transformer");var xe=require("class-transformer");var et=(function(e){return e.INFO="INFO",e.SUCCESS="SUCCESS",e.WARNING="WARNING",e.ERROR="ERROR",e})({});function rr(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(rr,"_ts_decorate");function $t(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n($t,"_ts_metadata");var N=class e{static{n(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(t,r=et.ERROR){this._message=t,this._type=r}static sanitizeMessages(t){return typeof t=="string"?t.length?[new e(t)]:[]:[t].flat().map(r=>typeof r=="string"?new e(r):r)}};rr([(0,xe.Expose)(),$t("design:type",String),$t("design:paramtypes",[])],N.prototype,"message",null);rr([(0,xe.Expose)(),$t("design:type",typeof et>"u"?Object:et),$t("design:paramtypes",[])],N.prototype,"type",null);function Os(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(Os,"_ts_decorate");function or(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n(or,"_ts_metadata");var ut=class e{static{n(this,"SmpGenericResponse")}_messages;data;set messages(t){this._messages=N.sanitizeMessages(t)}get messages(){return this._messages}constructor(t=[],r){this._messages=t,this.data=r}static create(t){return new e([t.messages||[]].flat().map(r=>r instanceof N?r:new N(r,t.type||et.SUCCESS)),t.data)}static fromPlain(t){return(0,H.plainToInstance)(e,t)}isError(){return!this.isSuccess()}isSuccess(){return typeof this._errorCode=="number"}serialize(){return(0,H.instanceToPlain)(this,{excludePrefixes:["_"]})}};Os([(0,H.Expose)(),(0,H.Transform)(({value:e})=>e?.length?e:void 0),or("design:type",Object),or("design:paramtypes",[])],ut.prototype,"messages",null);function sr(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(sr,"_ts_decorate");function kt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n(kt,"_ts_metadata");var L=class e extends ut{static{n(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new N("GENERIC_ERROR")]}set errorCode(t){this._errorCode=t}get errorCode(){return this._errorCode}get status(){return this._status}set timestamp(t){this._timestamp=t}get timestamp(){return this._timestamp}_timestamp=Date.now();constructor(t=e.DEFAULT_MESSAGES,r="GENERIC_ERROR",o=500,s){super(t,s),this._errorCode=r,this._status=o}static create({messages:t=e.DEFAULT_MESSAGES,...r}={}){return new e(N.sanitizeMessages(t),r.errorCode,r.status,r.data)}static fromPlain(t){let r=(0,Pt.plainToInstance)(Rs,t,{excludePrefixes:["_"]}),o=new e;return Object.getOwnPropertyNames(r).forEach(s=>{s in o&&(o[s]=r[s])}),o}};sr([(0,Pt.Expose)(),kt("design:type",Object),kt("design:paramtypes",[])],L.prototype,"errorCode",null);sr([(0,Pt.Expose)(),kt("design:type",Number),kt("design:paramtypes",[])],L.prototype,"timestamp",null);var Rs=class extends L{static{n(this,"SmpErrorResponseMutable")}set errorCode(t){this._errorCode=t}set status(t){this._status=t}set timestamp(t){this._timestamp=t}};var V=class{static{n(this,"Hex")}static parse(t){let r=t.length,o=[];for(let s=0;s<r;s+=2)o[s>>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new _(o,r/2)}static stringify(t){let r=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;r.push((s>>>4).toString(16)),r.push((s&15).toString(16))}return r.join("")}};var _=class be{static{n(this,"WordArray")}constructor(t,r){this.words=t||[],r!==void 0?this.sigBytes=r:this.sigBytes=this.words.length*4}static random(t){let r=[],o=n(function(s){let i=987654321,a=4294967295;return function(){i=36969*(i&65535)+(i>>16)&a,s=18e3*(s&65535)+(s>>16)&a;let c=(i<<16)+s&a;return c/=4294967296,c+=.5,c*(Math.random()>.5?1:-1)}},"r");for(let s=0,i;s<t;s+=4){let a=o((i||Math.random())*4294967296);i=a()*987654071,r.push(a()*4294967296|0)}return new be(r,t)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new be(this.words.slice(0),this.sigBytes)}concat(t){if(this.clamp(),this.sigBytes%4)for(let r=0;r<t.sigBytes;r++){let o=t.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=o<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<t.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=t.words[r>>>2];return this.sigBytes+=t.sigBytes,this}toString(t){return(t||V).stringify(this)}};var Gt=class{static{n(this,"Latin1")}static parse(t){let r=t.length,o=[];for(let s=0;s<r;s++)o[s>>>2]|=(t.charCodeAt(s)&255)<<24-s%4*8;return new _(o,r)}static stringify(t){let r=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(s))}return r.join("")}};var I=class{static{n(this,"Utf8")}static parse(t){return Gt.parse(unescape(encodeURIComponent(t)))}static stringify(t){try{return decodeURIComponent(escape(Gt.stringify(t)))}catch(r){throw console.error("Malformed UTF-8 data",r),new Error("Malformed UTF-8 data")}}};var Wt=class{static{n(this,"BufferedBlockAlgorithm")}constructor(t){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},t),this._data=new _,this._nDataBytes=0}clone(){let t=this.constructor();for(let r in this)Object.prototype.hasOwnProperty.call(this,r)&&(t[r]=this[r]);return t._data=this._data.clone(),t}reset(){this._data=new _,this._nDataBytes=0}_append(t){typeof t=="string"&&(t=I.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}_process(t){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let r=this.cfg.blockSize*4,o=this._data.sigBytes/r;t?o=Math.ceil(o):o=Math.max((o|0)-this._minBufferSize,0);let s=o*this.cfg.blockSize,i=Math.min(s*4,this._data.sigBytes),a;if(s){for(let c=0;c<s;c+=this.cfg.blockSize)this._doProcessBlock(this._data.words,c);a=this._data.words.splice(0,s),this._data.sigBytes-=i}return new _(a,i)}};var dt=class{static{n(this,"CipherParams")}constructor(t){this.ciphertext=t.ciphertext,this.key=t.key,this.iv=t.iv,this.salt=t.salt,this.algorithm=t.algorithm,this.mode=t.mode,this.padding=t.padding,this.blockSize=t.blockSize,this.formatter=t.formatter}extend(t){return t.ciphertext!==void 0&&(this.ciphertext=t.ciphertext),t.key!==void 0&&(this.key=t.key),t.iv!==void 0&&(this.iv=t.iv),t.salt!==void 0&&(this.salt=t.salt),t.algorithm!==void 0&&(this.algorithm=t.algorithm),t.mode!==void 0&&(this.mode=t.mode),t.padding!==void 0&&(this.padding=t.padding),t.blockSize!==void 0&&(this.blockSize=t.blockSize),t.formatter!==void 0&&(this.formatter=t.formatter),this}toString(t){if(t)return t.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var z=class{static{n(this,"Base64")}static parse(t){let r=t.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let s=0;s<this._map.length;s++)this._reverseMap[this._map.charCodeAt(s)]=s}let o=this._map.charAt(64);if(o){let s=t.indexOf(o);s!==-1&&(r=s)}return this.parseLoop(t,r,this._reverseMap)}static parseLoop(t,r,o){let s=[],i=0;for(let a=0;a<r;a++)if(a%4){let c=o[t.charCodeAt(a-1)]<<a%4*2,h=o[t.charCodeAt(a)]>>>6-a%4*2;s[i>>>2]|=(c|h)<<24-i%4*8,i++}return new _(s,i)}static stringify(t){t.clamp();let r=[];for(let s=0;s<t.sigBytes;s+=3){let i=t.words[s>>>2]>>>24-s%4*8&255,a=t.words[s+1>>>2]>>>24-(s+1)%4*8&255,c=t.words[s+2>>>2]>>>24-(s+2)%4*8&255,h=i<<16|a<<8|c;for(let f=0;f<4&&s+f*.75<t.sigBytes;f++)r.push(this._map.charAt(h>>>6*(3-f)&63))}let o=this._map.charAt(64);if(o)for(;r.length%4;)r.push(o);return r.join("")}};z._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";z._reverseMap=void 0;var Kt=class{static{n(this,"OpenSSL")}static parse(t){let r=z.parse(t),o;return r.words[0]===1398893684&&r.words[1]===1701076831&&(o=new _(r.words.slice(2,4)),r.words.splice(0,4),r.sigBytes-=16),new dt({ciphertext:r,salt:o})}static stringify(t){if(!t.ciphertext)throw new Error("missing ciphertext in params");let r=t.ciphertext,o=t.salt,s;if(o){if(typeof o=="string")throw new Error("salt is expected to be a WordArray");s=new _([1398893684,1701076831]).concat(o).concat(r)}else s=r;return s.toString(z)}};var rt=class{static{n(this,"SerializableCipher")}static decrypt(t,r,o,s){let i=Object.assign({},this.cfg,s);if(!i.format)throw new Error("could not determine format");if(r=this._parse(r,i.format),!r.ciphertext)throw new Error("could not determine ciphertext");return t.createDecryptor(o,i).finalize(r.ciphertext)}static encrypt(t,r,o,s){let i=Object.assign({},this.cfg,s),a=t.createEncryptor(o,i),c=a.finalize(r);return new dt({ciphertext:c,key:o,iv:a.cfg.iv,algorithm:t,mode:a.cfg.mode,padding:a.cfg.padding,blockSize:a.cfg.blockSize,formatter:i.format})}static _parse(t,r){return typeof t=="string"?r.parse(t):t}};rt.cfg={blockSize:4,iv:new _([]),format:Kt};var C=class extends Wt{static{n(this,"Hasher")}constructor(t){super(Object.assign({blockSize:512/32},t)),this.reset()}static _createHelper(t){function r(o,s){return new t(s).finalize(o)}return n(r,"helper"),r}finalize(t){return t&&this._append(t),this._doFinalize()}update(t){return this._append(t),this._process(),this}};var p=[];for(let e=0;e<64;e++)p[e]=Math.abs(Math.sin(e+1))*4294967296|0;var $=class u extends C{static{n(this,"MD5")}get hash(){return this._hash}static FF(t,r,o,s,i,a,c){let h=t+(r&o|~r&s)+i+c;return(h<<a|h>>>32-a)+r}static GG(t,r,o,s,i,a,c){let h=t+(r&s|o&~s)+i+c;return(h<<a|h>>>32-a)+r}static HH(t,r,o,s,i,a,c){let h=t+(r^o^s)+i+c;return(h<<a|h>>>32-a)+r}static II(t,r,o,s,i,a,c){let h=t+(o^(r|~s))+i+c;return(h<<a|h>>>32-a)+r}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let t=this._nDataBytes*8,r=this._data.sigBytes*8;this._data.words[r>>>5]|=128<<24-r%32;let o=Math.floor(t/4294967296),s=t;this._data.words[(r+64>>>9<<4)+15]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,this._data.words[(r+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let i=0;i<4;i++)this._hash.words[i]=(this._hash.words[i]<<8|this._hash.words[i]>>>24)&16711935|(this._hash.words[i]<<24|this._hash.words[i]>>>8)&4278255360;return this._hash}_doProcessBlock(t,r){for(let h=0;h<16;h++){let f=r+h,g=t[f];t[f]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let o=Array.from({length:16});for(let h=0;h<16;h++)o[h]=t[r+h];let s=this._hash.words[0],i=this._hash.words[1],a=this._hash.words[2],c=this._hash.words[3];s=u.FF(s,i,a,c,o[0],7,p[0]),c=u.FF(c,s,i,a,o[1],12,p[1]),a=u.FF(a,c,s,i,o[2],17,p[2]),i=u.FF(i,a,c,s,o[3],22,p[3]),s=u.FF(s,i,a,c,o[4],7,p[4]),c=u.FF(c,s,i,a,o[5],12,p[5]),a=u.FF(a,c,s,i,o[6],17,p[6]),i=u.FF(i,a,c,s,o[7],22,p[7]),s=u.FF(s,i,a,c,o[8],7,p[8]),c=u.FF(c,s,i,a,o[9],12,p[9]),a=u.FF(a,c,s,i,o[10],17,p[10]),i=u.FF(i,a,c,s,o[11],22,p[11]),s=u.FF(s,i,a,c,o[12],7,p[12]),c=u.FF(c,s,i,a,o[13],12,p[13]),a=u.FF(a,c,s,i,o[14],17,p[14]),i=u.FF(i,a,c,s,o[15],22,p[15]),s=u.GG(s,i,a,c,o[1],5,p[16]),c=u.GG(c,s,i,a,o[6],9,p[17]),a=u.GG(a,c,s,i,o[11],14,p[18]),i=u.GG(i,a,c,s,o[0],20,p[19]),s=u.GG(s,i,a,c,o[5],5,p[20]),c=u.GG(c,s,i,a,o[10],9,p[21]),a=u.GG(a,c,s,i,o[15],14,p[22]),i=u.GG(i,a,c,s,o[4],20,p[23]),s=u.GG(s,i,a,c,o[9],5,p[24]),c=u.GG(c,s,i,a,o[14],9,p[25]),a=u.GG(a,c,s,i,o[3],14,p[26]),i=u.GG(i,a,c,s,o[8],20,p[27]),s=u.GG(s,i,a,c,o[13],5,p[28]),c=u.GG(c,s,i,a,o[2],9,p[29]),a=u.GG(a,c,s,i,o[7],14,p[30]),i=u.GG(i,a,c,s,o[12],20,p[31]),s=u.HH(s,i,a,c,o[5],4,p[32]),c=u.HH(c,s,i,a,o[8],11,p[33]),a=u.HH(a,c,s,i,o[11],16,p[34]),i=u.HH(i,a,c,s,o[14],23,p[35]),s=u.HH(s,i,a,c,o[1],4,p[36]),c=u.HH(c,s,i,a,o[4],11,p[37]),a=u.HH(a,c,s,i,o[7],16,p[38]),i=u.HH(i,a,c,s,o[10],23,p[39]),s=u.HH(s,i,a,c,o[13],4,p[40]),c=u.HH(c,s,i,a,o[0],11,p[41]),a=u.HH(a,c,s,i,o[3],16,p[42]),i=u.HH(i,a,c,s,o[6],23,p[43]),s=u.HH(s,i,a,c,o[9],4,p[44]),c=u.HH(c,s,i,a,o[12],11,p[45]),a=u.HH(a,c,s,i,o[15],16,p[46]),i=u.HH(i,a,c,s,o[2],23,p[47]),s=u.II(s,i,a,c,o[0],6,p[48]),c=u.II(c,s,i,a,o[7],10,p[49]),a=u.II(a,c,s,i,o[14],15,p[50]),i=u.II(i,a,c,s,o[5],21,p[51]),s=u.II(s,i,a,c,o[12],6,p[52]),c=u.II(c,s,i,a,o[3],10,p[53]),a=u.II(a,c,s,i,o[10],15,p[54]),i=u.II(i,a,c,s,o[1],21,p[55]),s=u.II(s,i,a,c,o[8],6,p[56]),c=u.II(c,s,i,a,o[15],10,p[57]),a=u.II(a,c,s,i,o[6],15,p[58]),i=u.II(i,a,c,s,o[13],21,p[59]),s=u.II(s,i,a,c,o[4],6,p[60]),c=u.II(c,s,i,a,o[11],10,p[61]),a=u.II(a,c,s,i,o[2],15,p[62]),i=u.II(i,a,c,s,o[9],21,p[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+i|0,this._hash.words[2]=this._hash.words[2]+a|0,this._hash.words[3]=this._hash.words[3]+c|0}};var Ae=class ir{static{n(this,"EVPKDF")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:$,iterations:1},t)}static execute(t,r,o){return new ir(o).compute(t,r)}compute(t,r){let o=new this.cfg.hasher,s=new _,i;for(;s.words.length<this.cfg.keySize;){i&&o.update(i),i=o.update(t).finalize(r),o.reset();for(let a=1;a<this.cfg.iterations;a++)i=o.finalize(i),o.reset();s.concat(i)}return s.sigBytes=this.cfg.keySize*4,s}};var nr=class{static{n(this,"OpenSSLKdf")}static execute(t,r,o,s){s||(s=_.random(64/8));let i=new Ae({keySize:r+o}).compute(t,s),a=new _(i.words.slice(r),o*4);return i.sigBytes=r*4,new dt({key:i,iv:a,salt:s})}};var qt=class{static{n(this,"PasswordBasedCipher")}static decrypt(t,r,o,s){let i=Object.assign({},this.cfg,s);if(i.format===void 0)throw new Error("missing format in config");if(r=this._parse(r,i.format),i.kdf===void 0)throw new Error("the key derivation function must be set");let a=i.kdf.execute(o,t.keySize,t.ivSize,r.salt);return a.iv!==void 0&&(i.iv=a.iv),rt.decrypt.call(this,t,r,a.key,i)}static encrypt(t,r,o,s){let i=Object.assign({},this.cfg,s);if(i.kdf===void 0)throw new Error("missing kdf in config");let a=i.kdf.execute(o,t.keySize,t.ivSize);return a.iv!==void 0&&(i.iv=a.iv),rt.encrypt.call(this,t,r,a.key,i).extend(a)}static _parse(t,r){return typeof t=="string"?r.parse(t):t}};qt.cfg={blockSize:4,iv:new _([]),format:Kt,kdf:nr};var ar=class{static{n(this,"CipherHelper")}constructor(t){this._cipher=t}decrypt(t,r,o){return typeof r=="string"?qt.decrypt(this._cipher,t,r,o):rt.decrypt(this._cipher,t,r,o)}encrypt(t,r,o){return typeof r=="string"?qt.encrypt(this._cipher,t,r,o):rt.encrypt(this._cipher,t,r,o)}};var mt=class extends Wt{static{n(this,"Cipher")}constructor(t,r,o){super(Object.assign({blockSize:1},o)),this._xformMode=t,this._key=r,this.reset()}static _createHelper(t){return new ar(t)}static createDecryptor(t,r){let o=this;return new o(this._DEC_XFORM_MODE,t,r)}static createEncryptor(t,r){return new this(this._ENC_XFORM_MODE,t,r)}finalize(t){return t&&this._append(t),this._doFinalize()}process(t){return this._append(t),this._process()}};mt.ivSize=4;mt.keySize=4;mt._DEC_XFORM_MODE=2;mt._ENC_XFORM_MODE=1;var ot=class{static{n(this,"BlockCipherModeAlgorithm")}constructor(t,r){this.init(t,r)}init(t,r){this._cipher=t,this._iv=r}};var St=class{static{n(this,"BlockCipherMode")}static createDecryptor(t,r){let o=this.Decryptor;return new o(t,r)}static createEncryptor(t,r){let o=this.Encryptor;return new o(t,r)}};St.Decryptor=ot;St.Encryptor=ot;var cr=class extends ot{static{n(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(t,r){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(t,r,this._cipher.cfg.blockSize),this._cipher.encryptBlock(t,r),this._prevBlock=t.slice(r,r+this._cipher.cfg.blockSize)}xorBlock(t,r,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[r+i]^=s[i]}};var hr=class extends ot{static{n(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(t,r){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let o=t.slice(r,r+this._cipher.cfg.blockSize);this._cipher.decryptBlock(t,r),this.xorBlock(t,r,this._cipher.cfg.blockSize),this._prevBlock=o}xorBlock(t,r,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[r+i]^=s[i]}};var X=class extends St{static{n(this,"CBC")}};X.Decryptor=hr;X.Encryptor=cr;var gt=class{static{n(this,"PKCS7")}static pad(t,r){let o=r*4,s=o-t.sigBytes%o,i=s<<24|s<<16|s<<8|s,a=[];for(let h=0;h<s;h+=4)a.push(i);let c=new _(a,s);t.concat(c)}static unpad(t){let r=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=r}};var Ht=class extends mt{static{n(this,"BlockCipher")}constructor(t,r,o){super(t,r,Object.assign({blockSize:4,mode:X,padding:gt},o))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let t;this._xformMode===this.constructor._ENC_XFORM_MODE?t=this.cfg.mode.createEncryptor:(t=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===t?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=t.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=t)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let t;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),t=this._process(!0)}else t=this._process(!0),this.cfg.padding.unpad(t);return t}_doProcessBlock(t,r){this._mode.processBlock(t,r)}};var l=class U{static{n(this,"X64Word")}constructor(t,r){this.high=t,this.low=r}add(t){let r=this.low+t.low|0,o=r>>>0<this.low>>>0?1:0,s=this.high+t.high+o|0;return new U(s,r)}and(t){return new U(this.high&t.high,this.low&t.low)}not(){return new U(~this.high,~this.low)}or(t){return new U(this.high|t.high,this.low|t.low)}rotL(t){return this.shiftL(t).or(this.shiftR(64-t))}rotR(t){return this.shiftR(t).or(this.shiftL(64-t))}shiftL(t){return t<32?new U(this.high<<t|this.low>>>32-t,this.low<<t):new U(this.low<<t-32,0)}shiftR(t){return t<32?new U(this.high>>>t,this.low>>>t|this.high<<32-t):new U(0,this.high>>>t-32)}xor(t){return new U(this.high^t.high,this.low^t.low)}};var lr=class Ee{static{n(this,"X64WordArray")}constructor(t=[],r){this.words=t,this.sigBytes=r!==void 0?r:t.length*8}static create(t=[],r){return new Ee(t,r)}clone(){let t=this.words.map(r=>new l(r.high,r.low));return new Ee(t,this.sigBytes)}toX32(){let t=[];for(let r of this.words)t.push(r.high,r.low);return new _(t,this.sigBytes)}};var P=[],fr=[],pr=[],ur=[],dr=[],mr=[],ve=[],Oe=[],Re=[],Be=[];(function(){let e=[];for(let o=0;o<256;o++)o<128?e[o]=o<<1:e[o]=o<<1^283;let t=0,r=0;for(let o=0;o<256;o++){let s=r^r<<1^r<<2^r<<3^r<<4;s=s>>>8^s&255^99,P[t]=s,fr[s]=t;let i=e[t],a=e[i],c=e[a],h=e[s]*257^s*16843008;pr[t]=h<<24|h>>>8,ur[t]=h<<16|h>>>16,dr[t]=h<<8|h>>>24,mr[t]=h,h=c*16843009^a*65537^i*257^t*16843008,ve[s]=h<<24|h>>>8,Oe[s]=h<<16|h>>>16,Re[s]=h<<8|h>>>24,Be[s]=h,t?(t=i^e[e[e[c^i]]],r^=e[e[r]]):t=r=1}})();var Bs=[0,1,2,4,8,16,32,64,128,27,54],Vt=class extends Ht{static{n(this,"AES")}constructor(t,r,o){super(t,r,o),super.reset()}decryptBlock(t,r){let o=t[r+1];t[r+1]=t[r+3],t[r+3]=o,this._doCryptBlock(t,r,this._invKeySchedule,ve,Oe,Re,Be,fr),o=t[r+1],t[r+1]=t[r+3],t[r+3]=o}encryptBlock(t,r){this._doCryptBlock(t,r,this._keySchedule,pr,ur,dr,mr,P)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let t=this._keyPriorReset=this._key,r=t.words,o=t.sigBytes/4,i=((this._nRounds=o+6)+1)*4,a=this._keySchedule=[];for(let c=0;c<i;c++)if(c<o)a[c]=r[c];else{let h=a[c-1];c%o?o>6&&c%o===4&&(h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255]):(h=h<<8|h>>>24,h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255],h^=Bs[c/o|0]<<24),a[c]=a[c-o]^h}this._invKeySchedule=[];for(let c=0;c<i;c++){let h=i-c,f;c%4?f=a[h]:f=a[h-4],c<4||h<=4?this._invKeySchedule[c]=f:this._invKeySchedule[c]=ve[P[f>>>24]]^Oe[P[f>>>16&255]]^Re[P[f>>>8&255]]^Be[P[f&255]]}}_doCryptBlock(t,r,o,s,i,a,c,h){let f=t[r]^o[0],g=t[r+1]^o[1],d=t[r+2]^o[2],m=t[r+3]^o[3],w=4;for(let v=1;v<this._nRounds;v++){let x=s[f>>>24]^i[g>>>16&255]^a[d>>>8&255]^c[m&255]^o[w++],b=s[g>>>24]^i[d>>>16&255]^a[m>>>8&255]^c[f&255]^o[w++],T=s[d>>>24]^i[m>>>16&255]^a[f>>>8&255]^c[g&255]^o[w++],ge=s[m>>>24]^i[f>>>16&255]^a[g>>>8&255]^c[d&255]^o[w++];f=x,g=b,d=T,m=ge}let y=(h[f>>>24]<<24|h[g>>>16&255]<<16|h[d>>>8&255]<<8|h[m&255])^o[w++],E=(h[g>>>24]<<24|h[d>>>16&255]<<16|h[m>>>8&255]<<8|h[f&255])^o[w++],O=(h[d>>>24]<<24|h[m>>>16&255]<<16|h[f>>>8&255]<<8|h[g&255])^o[w++],R=(h[m>>>24]<<24|h[f>>>16&255]<<16|h[g>>>8&255]<<8|h[d&255])^o[w++];t[r]=y,t[r+1]=E,t[r+2]=O,t[r+3]=R}};Vt.keySize=256/32;var Ts=[1732584193,4023233417,2562383102,271733878,3285377520],st=new Array(80),it=class extends C{static{n(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(Ts.slice(0))}_doFinalize(){let t=this._nDataBytes*8,r=this._data.sigBytes*8;return this._data.words[r>>>5]|=128<<24-r%32,this._data.words[(r+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(r+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,r){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)st[h]=t[r+h]|0;else{let m=st[h-3]^st[h-8]^st[h-14]^st[h-16];st[h]=m<<1|m>>>31}let f,g;h<20?(f=s&i|~s&a,g=1518500249):h<40?(f=s^i^a,g=1859775393):h<60?(f=s&i|s&a|i&a,g=2400959708):(f=s^i^a,g=3395469782);let d=(o<<5|o>>>27)+f+c+g+st[h];c=a,a=i,i=s<<30|s>>>2,s=o,o=d|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0}};var gr=[],_r=[];(function(){function e(s){let i=Math.sqrt(s);for(let a=2;a<=i;a++)if(!(s%a))return!1;return!0}n(e,"isPrime");function t(s){return(s-(s|0))*4294967296|0}n(t,"getFractionalBits");let r=2,o=0;for(;o<64;)e(r)&&(o<8&&(gr[o]=t(Math.pow(r,1/2))),_r[o]=t(Math.pow(r,1/3)),o++),r++})();var nt=[],jt=class extends C{static{n(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(gr.slice(0))}_doFinalize(){let t=this._nDataBytes*8,r=this._data.sigBytes*8;return this._data.words[r>>>5]|=128<<24-r%32,this._data.words[(r+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(r+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,r){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4],h=this._hash.words[5],f=this._hash.words[6],g=this._hash.words[7];for(let d=0;d<64;d++){if(d<16)nt[d]=t[r+d]|0;else{let v=nt[d-15],x=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,b=nt[d-2],T=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;nt[d]=x+nt[d-7]+T+nt[d-16]}let m=c&h^~c&f,w=o&s^o&i^s&i,y=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),E=(c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25),O=g+E+m+_r[d]+nt[d],R=y+w;g=f,f=h,h=c,c=a+O|0,a=i,i=s,s=o,o=O+R|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+f|0,this._hash.words[7]=this._hash.words[7]+g|0}};var Te=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],M=[];(function(){for(let e=0;e<80;e++)M[e]=new l(void 0,void 0)})();var Ce=class extends C{static{n(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new lr([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let t=this._data,r=t.words,o=this._nDataBytes*8,s=t.sigBytes*8;return r[s>>>5]|=128<<24-s%32,r[(s+128>>>10<<5)+30]=Math.floor(o/4294967296),r[(s+128>>>10<<5)+31]=o,t.sigBytes=r.length*4,this._process(),this._hash.toX32()}_doProcessBlock(t,r){let o=this._hash.words[0].high,s=this._hash.words[0].low,i=this._hash.words[1].high,a=this._hash.words[1].low,c=this._hash.words[2].high,h=this._hash.words[2].low,f=this._hash.words[3].high,g=this._hash.words[3].low,d=this._hash.words[4].high,m=this._hash.words[4].low,w=this._hash.words[5].high,y=this._hash.words[5].low,E=this._hash.words[6].high,O=this._hash.words[6].low,R=this._hash.words[7].high,v=this._hash.words[7].low;for(let x=0;x<80;x++){let b,T;if(x<16)T=M[x].high=t[r+x*2]|0,b=M[x].low=t[r+x*2+1]|0;else{let Ye=M[x-15],ft=Ye.high,Rt=Ye.low,_s=(ft>>>1|Rt<<31)^(ft>>>8|Rt<<24)^ft>>>7,Qe=(Rt>>>1|ft<<31)^(Rt>>>8|ft<<24)^(Rt>>>7|ft<<25),tr=M[x-2],pt=tr.high,Bt=tr.low,ws=(pt>>>19|Bt<<13)^(pt<<3|Bt>>>29)^pt>>>6,er=(Bt>>>19|pt<<13)^(Bt<<3|pt>>>29)^(Bt>>>6|pt<<26);b=Qe+M[x-7].low,T=_s+M[x-7].high+(b>>>0<Qe>>>0?1:0),b=b+er,T=T+ws+(b>>>0<er>>>0?1:0),b=b+M[x-16].low,T=T+M[x-16].high+(b>>>0<M[x-16].low>>>0?1:0),M[x].high=T,M[x].low=b}let ge=d&w^~d&E,Xe=m&y^~m&O,fs=o&i^o&c^i&c,ps=s&a^s&h^a&h,us=(o>>>28|s<<4)^(o<<30|s>>>2)^(o<<25|s>>>7),Ze=(s>>>28|o<<4)^(s<<30|o>>>2)^(s<<25|o>>>7),ds=(d>>>14|m<<18)^(d>>>18|m<<14)^(d<<23|m>>>9),ms=(m>>>14|d<<18)^(m>>>18|d<<14)^(m<<23|d>>>9),D=v+ms,S=R+ds+(D>>>0<v>>>0?1:0);D=D+Xe,S=S+ge+(D>>>0<Xe>>>0?1:0),D=D+Te[x].low,S=S+Te[x].high+(D>>>0<Te[x].low>>>0?1:0),D=D+b,S=S+T+(D>>>0<b>>>0?1:0);let Je=Ze+ps,gs=us+fs+(Je>>>0<Ze>>>0?1:0);R=E,v=O,E=w,O=y,w=d,y=m,m=g+D|0,d=f+S+(m>>>0<g>>>0?1:0)|0,f=c,g=h,c=i,h=a,i=o,a=s,s=D+Je|0,o=S+gs+(s>>>0<D>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+s,this._hash.words[0].high=this._hash.words[0].high+o+(this._hash.words[0].low>>>0<s>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+a,this._hash.words[1].high=this._hash.words[1].high+i+(this._hash.words[1].low>>>0<a>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+c+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+f+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+m,this._hash.words[4].high=this._hash.words[4].high+d+(this._hash.words[4].low>>>0<m>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+y,this._hash.words[5].high=this._hash.words[5].high+w+(this._hash.words[5].low>>>0<y>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+O,this._hash.words[6].high=this._hash.words[6].high+E+(this._hash.words[6].low>>>0<O>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+v,this._hash.words[7].high=this._hash.words[7].high+R+(this._hash.words[7].low>>>0<v>>>0?1:0)}};var wr=class{static{n(this,"HMAC")}constructor(t,r){this._hasher=new t;let o=typeof r=="string"?I.parse(r):r,s=this._hasher.cfg.blockSize,i=s*4;o.sigBytes>i&&(o=this._hasher.finalize(o)),o.clamp();let a=this._oKey=o.clone(),c=this._iKey=o.clone(),h=a.words,f=c.words;for(let g=0;g<s;g++)h[g]^=1549556828,f[g]^=909522486;a.sigBytes=c.sigBytes=i,this.reset()}finalize(t){let r=this._hasher.finalize(t);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(r))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(t){return this._hasher.update(t),this}};var Ie=class yr{static{n(this,"PBKDF2")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:jt,iterations:25e4},t)}static execute(t,r,o){return new yr(o).compute(t,r)}compute(t,r){let o=this.cfg,s=new wr(o.hasher,t),i=new _,a=new _([1]),c=i.words,h=a.words,f=o.keySize,g=o.iterations;for(;c.length<f;){let d=s.update(r).finalize(a);s.reset();let m=d.words,w=m.length,y=d;for(let E=1;E<g;E++){y=s.finalize(y),s.reset();let O=y.words;for(let R=0;R<w;R++)m[R]^=O[R]}i.concat(d),h[0]++}return i.sigBytes=f*4,i}};var Dt=Ht._createHelper(Vt);var _t=C._createHelper($);var wt=C._createHelper(it);var Xt=C._createHelper(jt);var Zt=C._createHelper(Ce);var at=class{static{n(this,"SmpCrypto")}static base64Decode(t){return I.stringify(z.parse(t))}static base64Encode(t){return z.stringify(I.parse(t))}static md5(t){return _t(t).toString()}static sha1(t){return wt(t).toString()}static sha256(t){return Xt(t).toString()}static sha512(t){return Zt(t).toString()}};var Nt=class extends tt{static{n(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(t){return this._staticSelf._storage.get(t)}_removeRaw(t){this._staticSelf._storage.delete(t)}_writeRaw(t,r){this._staticSelf._storage.set(t,r)}};var Pe=class{static{n(this,"SmpHttpTwoService")}static _cacheStrategy=typeof sessionStorage<"u"?new It:new Nt;static _errorClass=L;static _mergeParamsFallbackBaseUrl="https://uc-api-nest-common-fe";static _running=new Map;static $http(t){return this._generateAjax(t)}static async _generateAjax(t){let r=this._generateCacheKey(t),o=+(t.ttl||0)>0;if(o){let a=this._cacheStrategy.read(r);if(a)return Promise.resolve(a)}let s=this._running.get(r);if(s)return s;let i=this._generateAjaxBase(t).then(a=>(o&&this._cacheStrategy.write(r,a,t.ttl),a)).finally(()=>{this._running.delete(r)});return this._running.set(r,i),i}static async _generateAjaxBase(t){let r=await this._preprocessRequest(t),o={method:r.method,headers:new Headers({"content-type":"application/json",...r.headers}),body:r.body?JSON.stringify(r.body):null};return r.useCredentials&&(o.credentials="include"),r.url=this.mergeQueryParams(r.url,r.queryParams),fetch(r.url,o).then(s=>this._preprocessResponse(t,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(r.responseType){case"blob":return s.blob();case"arraybuffer":return s.arrayBuffer();case"text":return s.text();case"json":default:return s.json()}}return s.json().then(i=>{let a=i;try{a=this._errorClass.fromPlain(i)}catch(c){console.debug("http: failed to parse error response into ErrorResponse",c)}return Promise.reject({status:s.status,message:s.statusText,body:a})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(t,r){if(!r||Object.keys(r).length===0)return t;let o=t.startsWith("http"),s=new URL(t,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),a={...Object.fromEntries(new URLSearchParams(s.search).entries()),...r},c=[];for(let[d,m]of Object.entries(a))if(m!=null)if(Array.isArray(m))for(let w of m)c.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(w))}`);else c.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(m))}`);let h=c.length?`?${c.join("&")}`:"",g=s.origin+s.pathname+h;return o?g:g.replace(s.origin,"")}static _generateCacheKey(t){let r=`${t.method}:${t.url}`;return t.queryParams&&Object.keys(t.queryParams).length>0&&(r+=`:${at.md5(JSON.stringify(t.queryParams))}`),t.body&&Object.keys(t.body).length>0?`${r}:${at.md5(JSON.stringify(t.body))}`:r}static async _preprocessRequest(t){return t}static async _preprocessResponse(t,r){return r}};var xr=require("@tonysamperi/logger");var je=class{static{n(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new xr.SmpLoggerMethods;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(t,r){return`Basic ${Buffer.from(`${t}:${r}`).toString("base64")}`}static fromBearer(t=""){return t.split(" ")[1]}static getCountryFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[1]}static getLocaleFromReferer(t){return t?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(t,r){try{return t.replace(this._pathParamRegex,(o,s)=>{let i=r[s];return i!==void 0?encodeURIComponent(i):o})}catch(o){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,o)}return t}};var Cs={status:"OK"};var De=(function(e){return e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e})({});var Ne=class{static{n(this,"SmpBaseJwtToken")}_access_token;_exp;_iss;get access_token(){return this._access_token}get exp(){return this._exp}get iss(){return this._iss}constructor(t,r,o){this._access_token=t,this._exp=r,this._iss=o}serialize(){return{access_token:this._access_token,exp:this._exp,iss:this._iss}}};var Me=class{static{n(this,"SmpBaseJwtTokenPlain")}access_token;exp;iss};var Is=(function(e){return e.APPLE="APPLE",e.FACEBOOK="FACEBOOK",e.GOOGLE="GOOGLE",e})({});var Ps=(function(e){return e.POPUP="POPUP",e.REDIRECT="REDIRECT",e})({});var yt=class{static{n(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?V.parse(this._initVector):void 0}_mode=X;_padding=gt;constructor(t,r,o){this._password=t,this._salt=r,this._initVector=o}decryptAES(t){return Dt.decrypt(t,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(t){return Dt.encrypt(t,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return Ie.execute(this._password,V.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:it})}};var Jt=class{static{n(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength=5;_seed="changeme";constructor(t){this._baseCode=t}static check(t,r){if(new this(t).secureCode!==r)throw L.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:ye.BadRequest})}_encode(){let t=new $;return t.update(I.parse(this._seed+this._baseCode)),t.finalize().toString(V).substring(0,this._crcLength).toUpperCase()}};var js=(function(e){return e.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",e.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",e.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",e.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",e.EMAIL_EXISTS="auth/email-already-exists",e.INVALID_ACTION_CODE="auth/invalid-action-code",e.POPUP_BLOCKED="auth/popup-blocked",e.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",e.USER_NOT_FOUND="auth/user-not-found",e.WRONG_PASSWORD="auth/wrong-password",e})({});var xt=require("class-transformer"),Yt=require("ts-luxon");var j=(function(e){return e.ACTIVATE="ACTIVATE",e.BLOCK="BLOCK",e.CHECK="CHECK",e.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",e.FREEZE="FREEZE",e.PURCHASE="PURCHASE",e.RECHARGE="RECHARGE",e.ROLLBACK="ROLLBACK",e.TRANSACTION="TRANSACTION",e.TRANSACTION_DETAIL="TRANSACTION_DETAIL",e.UNFREEZE="UNFREEZE",e.XREFUND="XREFUND",e})({});var ct=(function(e){return e.MD5="MD5",e.MD5_HMAC="MD5_HMAC",e.SHA1="SHA1",e.SHA1_HMAC="SHA1_HMAC",e})({});function Ds(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(Ds,"_ts_decorate");function br(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n(br,"_ts_metadata");var Qt=class e{static{n(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new yt("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _OP_CODES={[j.CHECK]:"",[j.TRANSACTION]:"",[j.TRANSACTION_DETAIL]:"",[j.ACTIVATE]:"A",[j.BLOCK]:"B",[j.DIGITAL_ACTIVATE]:"D",[j.FREEZE]:"F",[j.PURCHASE]:"P",[j.RECHARGE]:"G",[j.ROLLBACK]:"R",[j.UNFREEZE]:"U",[j.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies={[ct.MD5]:t=>_t(t),[ct.MD5_HMAC]:t=>{let r=new $;return r.update(I.parse(t)),r.finalize()},[ct.SHA1]:t=>wt(t),[ct.SHA1_HMAC]:t=>{let r=new it;return r.update(I.parse(t)),r.finalize()}};_hashStrategy=this._hashStrategies[ct.MD5];constructor(t="ACTIVATION",r,o,s){this.gc=t,this.op=r,this.ot=o,this._dto=typeof s=="number"&&s>=0?Yt.DateTime.fromMillis(+`${s}000`.slice(0,13)):Yt.DateTime.local()}static build({gc:t,op:r,ot:o,dto:s}){return new this(t,r,o,s?.ts)}static explode(t){let r=this.constructor,o=(t||"").split(r._SEP);if(o.length<4)throw new Error(`${this.constructor.name}::explode: invalid transactionId provided => "${t}"`);return this.build({gc:o[1],op:r.prefixToOperation(o[2]),dto:Yt.DateTime.fromSeconds(+o[3])})}static isBase64(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)&&t.length%4===0}static parse(t){console.info(`${this.constructor.name}::parse: trying to parse ${t}`);try{if(this.isBase64(t)){let r=this._AES_ENCODER.decryptAES(t),o=JSON.parse(r);return(0,xt.plainToInstance)(e,o)}else return this.explode(t)}catch(r){throw console.error(`${this.constructor.name}::parse: failed to parse ${t}`,r),new Error(`${this.constructor.name}::parse: could not parse transactionId ${t}`)}}static prefixToOperation(t){return Object.entries(this._OP_CODES).find(([,o])=>o===t)[0]}serialize(){return(0,xt.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let t=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(t)}};Ds([(0,xt.Expose)(),br("design:type",Number),br("design:paramtypes",[])],Qt.prototype,"ts",null);var Ns=(function(e){return e.ListDetectiveValidator="ListDetectiveValidator",e.MXValidator="MXValidator",e.SyntaxValidator="SyntaxValidator",e})({});function Ms(e,t){t.forEach(r=>{Object.getOwnPropertyNames(r.prototype).forEach(o=>{o!=="constructor"&&(o in e.prototype||Object.defineProperty(e.prototype,o,Object.getOwnPropertyDescriptor(r.prototype,o)))});try{let o=new r;Object.getOwnPropertyNames(o).forEach(s=>{s in e.prototype||Object.defineProperty(e.prototype,s,Object.getOwnPropertyDescriptor(o,s))})}catch{}Object.getOwnPropertyNames(r).forEach(o=>{o!=="prototype"&&o!=="name"&&o!=="length"&&(o in e||Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o)))})})}n(Ms,"smpApplyMixin");function Fs(){this.__data__=[],this.size=0}n(Fs,"listCacheClear");var Ar=Fs;function Ls(e,t){return e===t||e!==e&&t!==t}n(Ls,"eq");var te=Ls;function Us(e,t){for(var r=e.length;r--;)if(te(e[r][0],t))return r;return-1}n(Us,"assocIndexOf");var Z=Us;var zs=Array.prototype,$s=zs.splice;function ks(e){var t=this.__data__,r=Z(t,e);if(r<0)return!1;var o=t.length-1;return r==o?t.pop():$s.call(t,r,1),--this.size,!0}n(ks,"listCacheDelete");var Er=ks;function Gs(e){var t=this.__data__,r=Z(t,e);return r<0?void 0:t[r][1]}n(Gs,"listCacheGet");var vr=Gs;function Ws(e){return Z(this.__data__,e)>-1}n(Ws,"listCacheHas");var Or=Ws;function Ks(e,t){var r=this.__data__,o=Z(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}n(Ks,"listCacheSet");var Rr=Ks;function bt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}n(bt,"ListCache");bt.prototype.clear=Ar;bt.prototype.delete=Er;bt.prototype.get=vr;bt.prototype.has=Or;bt.prototype.set=Rr;var J=bt;function qs(){this.__data__=new J,this.size=0}n(qs,"stackClear");var Br=qs;function Ss(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}n(Ss,"stackDelete");var Tr=Ss;function Hs(e){return this.__data__.get(e)}n(Hs,"stackGet");var Cr=Hs;function Vs(e){return this.__data__.has(e)}n(Vs,"stackHas");var Ir=Vs;var Xs=typeof global=="object"&&global&&global.Object===Object&&global,ee=Xs;var Zs=typeof self=="object"&&self&&self.Object===Object&&self,Js=ee||Zs||Function("return this")(),B=Js;var Ys=B.Symbol,k=Ys;var Pr=Object.prototype,Qs=Pr.hasOwnProperty,ti=Pr.toString,Mt=k?k.toStringTag:void 0;function ei(e){var t=Qs.call(e,Mt),r=e[Mt];try{e[Mt]=void 0;var o=!0}catch{}var s=ti.call(e);return o&&(t?e[Mt]=r:delete e[Mt]),s}n(ei,"getRawTag");var jr=ei;var ri=Object.prototype,oi=ri.toString;function si(e){return oi.call(e)}n(si,"objectToString");var Dr=si;var ii="[object Null]",ni="[object Undefined]",Nr=k?k.toStringTag:void 0;function ai(e){return e==null?e===void 0?ni:ii:Nr&&Nr in Object(e)?jr(e):Dr(e)}n(ai,"baseGetTag");var G=ai;function ci(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(ci,"isObject");var re=ci;var hi="[object AsyncFunction]",li="[object Function]",fi="[object GeneratorFunction]",pi="[object Proxy]";function ui(e){if(!re(e))return!1;var t=G(e);return t==li||t==fi||t==hi||t==pi}n(ui,"isFunction");var oe=ui;var di=B["__core-js_shared__"],se=di;var Mr=(function(){var e=/[^.]+$/.exec(se&&se.keys&&se.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function mi(e){return!!Mr&&Mr in e}n(mi,"isMasked");var Fr=mi;var gi=Function.prototype,_i=gi.toString;function wi(e){if(e!=null){try{return _i.call(e)}catch{}try{return e+""}catch{}}return""}n(wi,"toSource");var W=wi;var yi=/[\\^$.*+?()[\]{}|]/g,xi=/^\[object .+?Constructor\]$/,bi=Function.prototype,Ai=Object.prototype,Ei=bi.toString,vi=Ai.hasOwnProperty,Oi=RegExp("^"+Ei.call(vi).replace(yi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ri(e){if(!re(e)||Fr(e))return!1;var t=oe(e)?Oi:xi;return t.test(W(e))}n(Ri,"baseIsNative");var Lr=Ri;function Bi(e,t){return e?.[t]}n(Bi,"getValue");var Ur=Bi;function Ti(e,t){var r=Ur(e,t);return Lr(r)?r:void 0}n(Ti,"getNative");var F=Ti;var Ci=F(B,"Map"),Y=Ci;var Ii=F(Object,"create"),K=Ii;function Pi(){this.__data__=K?K(null):{},this.size=0}n(Pi,"hashClear");var zr=Pi;function ji(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}n(ji,"hashDelete");var $r=ji;var Di="__lodash_hash_undefined__",Ni=Object.prototype,Mi=Ni.hasOwnProperty;function Fi(e){var t=this.__data__;if(K){var r=t[e];return r===Di?void 0:r}return Mi.call(t,e)?t[e]:void 0}n(Fi,"hashGet");var kr=Fi;var Li=Object.prototype,Ui=Li.hasOwnProperty;function zi(e){var t=this.__data__;return K?t[e]!==void 0:Ui.call(t,e)}n(zi,"hashHas");var Gr=zi;var $i="__lodash_hash_undefined__";function ki(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=K&&t===void 0?$i:t,this}n(ki,"hashSet");var Wr=ki;function At(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}n(At,"Hash");At.prototype.clear=zr;At.prototype.delete=$r;At.prototype.get=kr;At.prototype.has=Gr;At.prototype.set=Wr;var Fe=At;function Gi(){this.size=0,this.__data__={hash:new Fe,map:new(Y||J),string:new Fe}}n(Gi,"mapCacheClear");var Kr=Gi;function Wi(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}n(Wi,"isKeyable");var qr=Wi;function Ki(e,t){var r=e.__data__;return qr(t)?r[typeof t=="string"?"string":"hash"]:r.map}n(Ki,"getMapData");var Q=Ki;function qi(e){var t=Q(this,e).delete(e);return this.size-=t?1:0,t}n(qi,"mapCacheDelete");var Sr=qi;function Si(e){return Q(this,e).get(e)}n(Si,"mapCacheGet");var Hr=Si;function Hi(e){return Q(this,e).has(e)}n(Hi,"mapCacheHas");var Vr=Hi;function Vi(e,t){var r=Q(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}n(Vi,"mapCacheSet");var Xr=Vi;function Et(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}n(Et,"MapCache");Et.prototype.clear=Kr;Et.prototype.delete=Sr;Et.prototype.get=Hr;Et.prototype.has=Vr;Et.prototype.set=Xr;var ie=Et;var Xi=200;function Zi(e,t){var r=this.__data__;if(r instanceof J){var o=r.__data__;if(!Y||o.length<Xi-1)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new ie(o)}return r.set(e,t),this.size=r.size,this}n(Zi,"stackSet");var Zr=Zi;function vt(e){var t=this.__data__=new J(e);this.size=t.size}n(vt,"Stack");vt.prototype.clear=Br;vt.prototype.delete=Tr;vt.prototype.get=Cr;vt.prototype.has=Ir;vt.prototype.set=Zr;var ne=vt;var Ji="__lodash_hash_undefined__";function Yi(e){return this.__data__.set(e,Ji),this}n(Yi,"setCacheAdd");var Jr=Yi;function Qi(e){return this.__data__.has(e)}n(Qi,"setCacheHas");var Yr=Qi;function ae(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ie;++t<r;)this.add(e[t])}n(ae,"SetCache");ae.prototype.add=ae.prototype.push=Jr;ae.prototype.has=Yr;var Qr=ae;function tn(e,t){for(var r=-1,o=e==null?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1}n(tn,"arraySome");var to=tn;function en(e,t){return e.has(t)}n(en,"cacheHas");var eo=en;var rn=1,on=2;function sn(e,t,r,o,s,i){var a=r&rn,c=e.length,h=t.length;if(c!=h&&!(a&&h>c))return!1;var f=i.get(e),g=i.get(t);if(f&&g)return f==t&&g==e;var d=-1,m=!0,w=r&on?new Qr:void 0;for(i.set(e,t),i.set(t,e);++d<c;){var y=e[d],E=t[d];if(o)var O=a?o(E,y,d,t,e,i):o(y,E,d,e,t,i);if(O!==void 0){if(O)continue;m=!1;break}if(w){if(!to(t,function(R,v){if(!eo(w,v)&&(y===R||s(y,R,r,o,i)))return w.push(v)})){m=!1;break}}else if(!(y===E||s(y,E,r,o,i))){m=!1;break}}return i.delete(e),i.delete(t),m}n(sn,"equalArrays");var ce=sn;var nn=B.Uint8Array,Le=nn;function an(e){var t=-1,r=Array(e.size);return e.forEach(function(o,s){r[++t]=[s,o]}),r}n(an,"mapToArray");var ro=an;function cn(e){var t=-1,r=Array(e.size);return e.forEach(function(o){r[++t]=o}),r}n(cn,"setToArray");var oo=cn;var hn=1,ln=2,fn="[object Boolean]",pn="[object Date]",un="[object Error]",dn="[object Map]",mn="[object Number]",gn="[object RegExp]",_n="[object Set]",wn="[object String]",yn="[object Symbol]",xn="[object ArrayBuffer]",bn="[object DataView]",so=k?k.prototype:void 0,Ue=so?so.valueOf:void 0;function An(e,t,r,o,s,i,a){switch(r){case bn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xn:return!(e.byteLength!=t.byteLength||!i(new Le(e),new Le(t)));case fn:case pn:case mn:return te(+e,+t);case un:return e.name==t.name&&e.message==t.message;case gn:case wn:return e==t+"";case dn:var c=ro;case _n:var h=o&hn;if(c||(c=oo),e.size!=t.size&&!h)return!1;var f=a.get(e);if(f)return f==t;o|=ln,a.set(e,t);var g=ce(c(e),c(t),o,s,i,a);return a.delete(e),g;case yn:if(Ue)return Ue.call(e)==Ue.call(t)}return!1}n(An,"equalByTag");var io=An;function En(e,t){for(var r=-1,o=t.length,s=e.length;++r<o;)e[s+r]=t[r];return e}n(En,"arrayPush");var no=En;var vn=Array.isArray,ht=vn;function On(e,t,r){var o=t(e);return ht(e)?o:no(o,r(e))}n(On,"baseGetAllKeys");var ao=On;function Rn(e,t){for(var r=-1,o=e==null?0:e.length,s=0,i=[];++r<o;){var a=e[r];t(a,r,e)&&(i[s++]=a)}return i}n(Rn,"arrayFilter");var co=Rn;function Bn(){return[]}n(Bn,"stubArray");var ho=Bn;var Tn=Object.prototype,Cn=Tn.propertyIsEnumerable,lo=Object.getOwnPropertySymbols,In=lo?function(e){return e==null?[]:(e=Object(e),co(lo(e),function(t){return Cn.call(e,t)}))}:ho,fo=In;function Pn(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}n(Pn,"baseTimes");var po=Pn;function jn(e){return e!=null&&typeof e=="object"}n(jn,"isObjectLike");var q=jn;var Dn="[object Arguments]";function Nn(e){return q(e)&&G(e)==Dn}n(Nn,"baseIsArguments");var ze=Nn;var uo=Object.prototype,Mn=uo.hasOwnProperty,Fn=uo.propertyIsEnumerable,Ln=ze((function(){return arguments})())?ze:function(e){return q(e)&&Mn.call(e,"callee")&&!Fn.call(e,"callee")},mo=Ln;function Un(){return!1}n(Un,"stubFalse");var go=Un;var yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_o=yo&&typeof module=="object"&&module&&!module.nodeType&&module,zn=_o&&_o.exports===yo,wo=zn?B.Buffer:void 0,$n=wo?wo.isBuffer:void 0,kn=$n||go,Ft=kn;var Gn=9007199254740991,Wn=/^(?:0|[1-9]\d*)$/;function Kn(e,t){var r=typeof e;return t=t??Gn,!!t&&(r=="number"||r!="symbol"&&Wn.test(e))&&e>-1&&e%1==0&&e<t}n(Kn,"isIndex");var xo=Kn;var qn=9007199254740991;function Sn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qn}n(Sn,"isLength");var he=Sn;var Hn="[object Arguments]",Vn="[object Array]",Xn="[object Boolean]",Zn="[object Date]",Jn="[object Error]",Yn="[object Function]",Qn="[object Map]",ta="[object Number]",ea="[object Object]",ra="[object RegExp]",oa="[object Set]",sa="[object String]",ia="[object WeakMap]",na="[object ArrayBuffer]",aa="[object DataView]",ca="[object Float32Array]",ha="[object Float64Array]",la="[object Int8Array]",fa="[object Int16Array]",pa="[object Int32Array]",ua="[object Uint8Array]",da="[object Uint8ClampedArray]",ma="[object Uint16Array]",ga="[object Uint32Array]",A={};A[ca]=A[ha]=A[la]=A[fa]=A[pa]=A[ua]=A[da]=A[ma]=A[ga]=!0;A[Hn]=A[Vn]=A[na]=A[Xn]=A[aa]=A[Zn]=A[Jn]=A[Yn]=A[Qn]=A[ta]=A[ea]=A[ra]=A[oa]=A[sa]=A[ia]=!1;function _a(e){return q(e)&&he(e.length)&&!!A[G(e)]}n(_a,"baseIsTypedArray");var bo=_a;function wa(e){return function(t){return e(t)}}n(wa,"baseUnary");var Ao=wa;var Eo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Lt=Eo&&typeof module=="object"&&module&&!module.nodeType&&module,ya=Lt&&Lt.exports===Eo,$e=ya&&ee.process,xa=(function(){try{var e=Lt&&Lt.require&&Lt.require("util").types;return e||$e&&$e.binding&&$e.binding("util")}catch{}})(),ke=xa;var vo=ke&&ke.isTypedArray,ba=vo?Ao(vo):bo,le=ba;var Aa=Object.prototype,Ea=Aa.hasOwnProperty;function va(e,t){var r=ht(e),o=!r&&mo(e),s=!r&&!o&&Ft(e),i=!r&&!o&&!s&&le(e),a=r||o||s||i,c=a?po(e.length,String):[],h=c.length;for(var f in e)(t||Ea.call(e,f))&&!(a&&(f=="length"||s&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||xo(f,h)))&&c.push(f);return c}n(va,"arrayLikeKeys");var Oo=va;var Oa=Object.prototype;function Ra(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Oa;return e===r}n(Ra,"isPrototype");var Ro=Ra;function Ba(e,t){return function(r){return e(t(r))}}n(Ba,"overArg");var Bo=Ba;var Ta=Bo(Object.keys,Object),To=Ta;var Ca=Object.prototype,Ia=Ca.hasOwnProperty;function Pa(e){if(!Ro(e))return To(e);var t=[];for(var r in Object(e))Ia.call(e,r)&&r!="constructor"&&t.push(r);return t}n(Pa,"baseKeys");var Co=Pa;function ja(e){return e!=null&&he(e.length)&&!oe(e)}n(ja,"isArrayLike");var Io=ja;function Da(e){return Io(e)?Oo(e):Co(e)}n(Da,"keys");var Po=Da;function Na(e){return ao(e,Po,fo)}n(Na,"getAllKeys");var Ge=Na;var Ma=1,Fa=Object.prototype,La=Fa.hasOwnProperty;function Ua(e,t,r,o,s,i){var a=r&Ma,c=Ge(e),h=c.length,f=Ge(t),g=f.length;if(h!=g&&!a)return!1;for(var d=h;d--;){var m=c[d];if(!(a?m in t:La.call(t,m)))return!1}var w=i.get(e),y=i.get(t);if(w&&y)return w==t&&y==e;var E=!0;i.set(e,t),i.set(t,e);for(var O=a;++d<h;){m=c[d];var R=e[m],v=t[m];if(o)var x=a?o(v,R,m,t,e,i):o(R,v,m,e,t,i);if(!(x===void 0?R===v||s(R,v,r,o,i):x)){E=!1;break}O||(O=m=="constructor")}if(E&&!O){var b=e.constructor,T=t.constructor;b!=T&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(E=!1)}return i.delete(e),i.delete(t),E}n(Ua,"equalObjects");var jo=Ua;var za=F(B,"DataView"),fe=za;var $a=F(B,"Promise"),pe=$a;var ka=F(B,"Set"),ue=ka;var Ga=F(B,"WeakMap"),de=Ga;var Do="[object Map]",Wa="[object Object]",No="[object Promise]",Mo="[object Set]",Fo="[object WeakMap]",Lo="[object DataView]",Ka=W(fe),qa=W(Y),Sa=W(pe),Ha=W(ue),Va=W(de),lt=G;(fe&&lt(new fe(new ArrayBuffer(1)))!=Lo||Y&&lt(new Y)!=Do||pe&&lt(pe.resolve())!=No||ue&&lt(new ue)!=Mo||de&&lt(new de)!=Fo)&&(lt=n(function(e){var t=G(e),r=t==Wa?e.constructor:void 0,o=r?W(r):"";if(o)switch(o){case Ka:return Lo;case qa:return Do;case Sa:return No;case Ha:return Mo;case Va:return Fo}return t},"getTag"));var We=lt;var Xa=1,Uo="[object Arguments]",zo="[object Array]",me="[object Object]",Za=Object.prototype,$o=Za.hasOwnProperty;function Ja(e,t,r,o,s,i){var a=ht(e),c=ht(t),h=a?zo:We(e),f=c?zo:We(t);h=h==Uo?me:h,f=f==Uo?me:f;var g=h==me,d=f==me,m=h==f;if(m&&Ft(e)){if(!Ft(t))return!1;a=!0,g=!1}if(m&&!g)return i||(i=new ne),a||le(e)?ce(e,t,r,o,s,i):io(e,t,h,r,o,s,i);if(!(r&Xa)){var w=g&&$o.call(e,"__wrapped__"),y=d&&$o.call(t,"__wrapped__");if(w||y){var E=w?e.value():e,O=y?t.value():t;return i||(i=new ne),s(E,O,r,o,i)}}return m?(i||(i=new ne),jo(e,t,r,o,s,i)):!1}n(Ja,"baseIsEqualDeep");var ko=Ja;function Go(e,t,r,o,s){return e===t?!0:e==null||t==null||!q(e)&&!q(t)?e!==e&&t!==t:ko(e,t,r,o,Go,s)}n(Go,"baseIsEqual");var Wo=Go;function Ya(e,t){return Wo(e,t)}n(Ya,"isEqual");var Ko=Ya;var Qa=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function qo(e){return e.match(Qa)}n(qo,"smpAsciiWords");var Jo="\\ud800-\\udfff",tc="\\u0300-\\u036f",ec="\\ufe20-\\ufe2f",rc="\\u20d0-\\u20ff",oc="\\u1ab0-\\u1aff",sc="\\u1dc0-\\u1dff",ic=tc+ec+rc+oc+sc,Yo="\\u2700-\\u27bf",Qo="a-z\\xdf-\\xf6\\xf8-\\xff",nc="\\xac\\xb1\\xd7\\xf7",ac="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cc="\\u2000-\\u206f",hc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ts="A-Z\\xc0-\\xd6\\xd8-\\xde",lc="\\ufe0e\\ufe0f",es=nc+ac+cc+hc,rs="['\u2019]",So=`[${es}]`,fc=`[${ic}]`,os="\\d",pc=`[${Yo}]`,ss=`[${Qo}]`,is=`[^${Jo}${es+os+Yo+Qo+ts}]`,uc="\\ud83c[\\udffb-\\udfff]",dc=`(?:${fc}|${uc})`,mc=`[^${Jo}]`,ns="(?:\\ud83c[\\udde6-\\uddff]){2}",as="[\\ud800-\\udbff][\\udc00-\\udfff]",Ot=`[${ts}]`,gc="\\u200d",Ho=`(?:${ss}|${is})`,_c=`(?:${Ot}|${is})`,Vo=`(?:${rs}(?:d|ll|m|re|s|t|ve))?`,Xo=`(?:${rs}(?:D|LL|M|RE|S|T|VE))?`,cs=`${dc}?`,hs=`[${lc}]?`,wc=`(?:${gc}(?:${[mc,ns,as].join("|")})${hs+cs})*`,yc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bc=hs+cs+wc,Zo=`(?:${[pc,ns,as].join("|")})${bc}`,Ut=class{static{n(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${Ot}?${ss}+${Vo}(?=${[So,Ot,"$"].join("|")})`,`${_c}+${Xo}(?=${[So,Ot+Ho,"$"].join("|")})`,`${Ot}?${Ho}+${Vo}`,`${Ot}+${Xo}`,xc,yc,`${os}+`,Zo].join("|"),"g");static RS_EMOJI=Zo;static unicodeWords(t){return t.match(this.RE_UNICODE_WORDS)}};var Ke=class{static{n(this,"SmpCommonUtils")}static arrayRemove(t,r){let o=[],s=t.filter((i,a)=>r(i,a)&&o.push(a));return o.reverse().forEach(i=>t.splice(i,1)),s}static assertIsArray(t,r){if(!Array.isArray(t))throw new Error(r||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(t,r){if(!this.isBoolean(t))throw new Error(r||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(t,r){if(!this.isFunction(t))throw new Error(r||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(t,r,o){if(!(t instanceof r))throw new Error(o||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(t,r){if(this.isEmpty(t))throw new Error(r||`${this.constructor.name} => entity was empty`)}static assertIsNumber(t,r){if(typeof t!="number")throw new Error(r||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(t,r){if(!this.isNumeric(t))throw new Error(r||`${this.constructor.name} => val was not numeric`)}static assertIsObject(t,r){if(!this.isObject(t))throw new Error(r||`${this.constructor.name} => val was not an object`)}static assertIsString(t,r){if(!this.isString(t))throw new Error(r||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(t,r){if(!t)throw new Error(r||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...t){let r=t.filter(o=>!!o).join("/").replace(/(?<!:)\/\/+/g,"/");return r.startsWith("http")&&!r.endsWith("/")?`${r}/`:r}static downloadBlob(t,r){let o=window.URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.setAttribute("download",r),document.body.appendChild(s),s.click()}static generateRandomHexString(t=12){let r="0123456789abcdef",o="";for(let s=0;s<t;s++){let i=Math.floor(Math.random()*r.length);o+=r[i]}return o}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})}static getDecimalPrecision(t){if(this.assertIsNumeric(t),!isFinite(+t))return 0;let r=1,o=0;for(;Math.round(+t*r)/r!==t;)r*=10,o++;return o}static getType(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}static isBoolean(t){return typeof t=="boolean"}static isColor(t){if(!t||!this.isString(t))return!1;let r=new Option().style;return r.color=t,r.color!==""}static isEmpty(t){return!t&&t!==0}static isEqual(t,r){return Ko(t,r)}static isFormField(t){return/^(?:input|select|textarea|button)$/i.test(t.nodeName)}static isFunction(t){return typeof t==typeof isNaN}static isNotEmpty(t){return!this.isEmpty(t)}static isNumber(t){return typeof t=="number"&&this.isNumeric(t)}static isNumeric(t){return!isNaN(t)}static isObject(t){return!!t&&t===Object(t)&&t.constructor===Object}static isPrimitive(t){let r=this.getType(t);return r!=="function"&&(r!=="object"||!t)}static isString(t){return typeof t=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(t,r){if(this.assertIsFunction(r,`CommonUtils => expected type of iteratee to be Function, got ${typeof r}`),this.isObject(t))return Object.entries(t).reduce((o,[s,i])=>(o.push(r(i,s)),o),[]);if(Array.isArray(t))return t.map(r);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof r}`)}static mapObjectKeys(t,r){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>{let a=r(s,i);return o[a]=i,o},{}):{}}static mapObjectValues(t,r){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>(o[s]=r.call(null,i,s),o),{}):{}}static noop(){}static objectHasValue(t,r){return!!~Object.values(t).filter(o=>this.isEqual(o,r))}static omit(t,r){return Object.keys(t).filter(s=>!r.includes(s)).reduce((s,i)=>(s[i]=t[i],s),{})}static parseBoolean(t){return t?/^true$/i.test(t):!1}static parseJsonSafely(t){try{return JSON.parse(t)}catch(r){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:t,error:r});return}}static pick(t,r){return r.reduce((o,s)=>(s in t&&(o[s]=t[s]),o),{})}static runSafely(t,r=null,o=[]){if(this.isFunction(t))return t.apply(r,o)}static sleep(t){return new Promise(r=>setTimeout(r,t))}static sprintf(t,...r){return this.isString(t)&&r.length?this.sprintf(t.replace("%s",String(r.shift())),...r):t}static stripComments(t){return typeof t=="string"?t.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):t}static submitFakeForm({action:t,method:r=De.POST,data:o,target:s}){let i=Object.entries(o||{}).map(([c,h])=>`<input name="${c}" type="hidden" value="${h}" />`),a=document.createElement("form");a.method=r,a.action=t,a.innerHTML=`${i}`,a.target=s||"_self",document.body.append(a),a.submit()}static toCamelCase(t){return this.words(t.replace(/['\u2019]/g,"")).reduce((r,o,s)=>(o=o.toLowerCase(),r+(s?o.charAt(0).toUpperCase()+o.slice(1):o)),"")}static toKebabCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(t){return this.toCamelCase(t).replace(/^(.)/,r=>r.toUpperCase())}static toSnakeCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(t){return this.toSnakeCase(t).toUpperCase()}static words(t,r){return r===void 0?(Ut.HAS_UNICODE_WORD(t)?Ut.unicodeWords(t):qo(t))||[]:t.match(r)||[]}};var qe=class extends Error{static{n(this,"SmpFilterException")}message;data;constructor(t="Filter Exception",r){super(),this.message=t,this.data=r}};var Se=require("ts-luxon");var He=class e{static{n(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return Se.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix="$1";constructor(t=`sid-xxxx-${+Se.DateTime.now().ts}`,r=0){this.value=t,this.expiry=r}static parse(t){return new e(t.value,t.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};var ls=require("@tonysamperi/logger");var Ve=class{static{n(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var Ac="2.0.0-beta.5";0&&(module.exports={SMP_HEALTHZ,SmpAbstractCacheStrategy,SmpAbstractTtlCacheStrategy,SmpAesCrypt,SmpApiCommonUtils,SmpBaseJwtToken,SmpBaseJwtTokenPlain,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpHttpTwoService,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpApplyMixin,smpIsSmpCachedValue,smpNoop});
1
+ "use strict";var zt=Object.defineProperty;var xs=Object.getOwnPropertyDescriptor;var bs=Object.getOwnPropertyNames;var As=Object.prototype.hasOwnProperty;var n=(e,t)=>zt(e,"name",{value:t,configurable:!0});var Es=(e,t)=>{for(var r in t)zt(e,r,{get:t[r],enumerable:!0})},vs=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of bs(t))!As.call(e,s)&&s!==r&&zt(e,s,{get:()=>t[s],enumerable:!(o=xs(t,s))||o.enumerable});return e};var Os=e=>vs(zt({},"__esModule",{value:!0}),e);var vc={};Es(vc,{SMP_HEALTHZ:()=>Cs,SmpAbstractCacheStrategy:()=>Tt,SmpAbstractTtlCacheStrategy:()=>tt,SmpAesCrypt:()=>yt,SmpApiCommonUtils:()=>De,SmpBaseJwtToken:()=>Me,SmpBaseJwtTokenPlain:()=>Fe,SmpBrowserCache:()=>It,SmpCommonUtils:()=>Se,SmpCrypto:()=>at,SmpErrorResponse:()=>L,SmpFilterException:()=>He,SmpFirebaseErrors:()=>Ds,SmpGenericResponse:()=>ut,SmpGiftcardTransaction:()=>te,SmpGiftcardTransactionHashStrategies:()=>ct,SmpGiftcardTransactionOps:()=>j,SmpHttpSessionStorageCache:()=>Ct,SmpHttpStatusCodes:()=>xe,SmpHttpTwoService:()=>je,SmpInMemoryCache:()=>Nt,SmpMarketingCloudValidators:()=>Ms,SmpRegularExpressions:()=>Xe,SmpResponseMessage:()=>N,SmpResponseMessageTypes:()=>et,SmpRestVerbs:()=>Ne,SmpSecureCode:()=>Yt,SmpSid:()=>Ve,SmpSocialSignInKeys:()=>Ps,SmpSocialSignInUxModes:()=>js,VERSION:()=>Ec,smpApplyMixin:()=>Fs,smpIsSmpCachedValue:()=>we,smpNoop:()=>fs.smpNoop});module.exports=Os(vc);var ye=require("ts-luxon");var Tt=class{static{n(this,"SmpAbstractCacheStrategy")}};function we(e){return typeof e=="object"&&e!==null&&"value"in e&&"expiry"in e&&typeof e.expiry=="number"}n(we,"smpIsSmpCachedValue");var tt=class extends Tt{static{n(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(t){let r=this._readRaw(t);if(this._isSmpCachedValue(r)){if(r.expiry>=ye.DateTime.now().ts)return r.value;this._removeRaw(t);return}return r}remove(t){this._removeRaw(t)}write(t,r,o){if(isNaN(+o)||+o<=0){this._writeRaw(t,r,o);return}let s=ye.DateTime.now().ts+o*1e3,i={value:r,expiry:s};this._writeRaw(t,i,o)}_isSmpCachedValue(t){return we(t)}};var It=class extends tt{static{n(this,"SmpBrowserCache")}_storage;_prefix;constructor(t,r){super(),this._storage=t,this._prefix=r}_flushRaw(){let t=[],r=-1;for(;++r<this._storage.length;){let o=this._storage.key(r);o&&o.startsWith(this._prefix)&&t.push(o)}for(r=-1;++r<t.length;)this._storage.removeItem(t[r])}_readRaw(t){let r=this._storage.getItem(this._prefix+t);try{return r?JSON.parse(r):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+t}`);return}}_removeRaw(t){this._storage.removeItem(this._prefix+t)}_writeRaw(t,r){try{this._storage.setItem(this._prefix+t,JSON.stringify(r))}catch(o){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+t}`,o)}}};var Ct=class extends It{static{n(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var xe=(function(e){return e[e.Continue=100]="Continue",e[e.SwitchingProtocols=101]="SwitchingProtocols",e[e.Processing=102]="Processing",e[e.EarlyHints=103]="EarlyHints",e[e.Ok=200]="Ok",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",e[e.NoContent=204]="NoContent",e[e.ResetContent=205]="ResetContent",e[e.PartialContent=206]="PartialContent",e[e.MultiStatus=207]="MultiStatus",e[e.AlreadyReported=208]="AlreadyReported",e[e.ImUsed=226]="ImUsed",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.Found=302]="Found",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.Unused=306]="Unused",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.LengthRequired=411]="LengthRequired",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.UriTooLong=414]="UriTooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.ImATeapot=418]="ImATeapot",e[e.MisdirectedRequest=421]="MisdirectedRequest",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.Locked=423]="Locked",e[e.FailedDependency=424]="FailedDependency",e[e.TooEarly=425]="TooEarly",e[e.UpgradeRequired=426]="UpgradeRequired",e[e.PreconditionRequired=428]="PreconditionRequired",e[e.TooManyRequests=429]="TooManyRequests",e[e.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",e[e.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HttpVersionNotSupported=505]="HttpVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.LoopDetected=508]="LoopDetected",e[e.NotExtended=510]="NotExtended",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",e})({});var Pt=require("class-transformer");var q=require("class-transformer");var be=require("class-transformer");var et=(function(e){return e.INFO="INFO",e.SUCCESS="SUCCESS",e.WARNING="WARNING",e.ERROR="ERROR",e})({});function or(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(or,"_ts_decorate");function kt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n(kt,"_ts_metadata");var N=class e{static{n(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(t,r=et.ERROR){this._message=t,this._type=r}static sanitizeMessages(t){return typeof t=="string"?t.length?[new e(t)]:[]:[t].flat().map(r=>typeof r=="string"?new e(r):r)}};or([(0,be.Expose)(),kt("design:type",String),kt("design:paramtypes",[])],N.prototype,"message",null);or([(0,be.Expose)(),kt("design:type",typeof et>"u"?Object:et),kt("design:paramtypes",[])],N.prototype,"type",null);function Rs(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(Rs,"_ts_decorate");function sr(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n(sr,"_ts_metadata");var ut=class e{static{n(this,"SmpGenericResponse")}_messages;data;set messages(t){this._messages=N.sanitizeMessages(t)}get messages(){return this._messages}constructor(t=[],r){this._messages=t,this.data=r}static create(t){return new e([t.messages||[]].flat().map(r=>r instanceof N?r:new N(r,t.type||et.SUCCESS)),t.data)}static fromPlain(t){return(0,q.plainToInstance)(e,t)}isError(){return!this.isSuccess()}isSuccess(){return typeof this._errorCode=="number"}serialize(){return(0,q.instanceToPlain)(this,{excludePrefixes:["_"]})}};Rs([(0,q.Expose)(),(0,q.Transform)(({value:e})=>e?.length?e:void 0),sr("design:type",Object),sr("design:paramtypes",[])],ut.prototype,"messages",null);function ir(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(ir,"_ts_decorate");function $t(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n($t,"_ts_metadata");var L=class e extends ut{static{n(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new N("GENERIC_ERROR")]}set errorCode(t){this._errorCode=t}get errorCode(){return this._errorCode}get status(){return this._status}set timestamp(t){this._timestamp=t}get timestamp(){return this._timestamp}_timestamp=Date.now();constructor(t=e.DEFAULT_MESSAGES,r="GENERIC_ERROR",o=500,s){super(t,s),this._errorCode=r,this._status=o}static create({messages:t=e.DEFAULT_MESSAGES,...r}={}){return new e(N.sanitizeMessages(t),r.errorCode,r.status,r.data)}static fromPlain(t){let r=(0,Pt.plainToInstance)(Bs,t,{excludePrefixes:["_"]}),o=new e;return Object.getOwnPropertyNames(r).forEach(s=>{s in o&&(o[s]=r[s])}),o}};ir([(0,Pt.Expose)(),$t("design:type",Object),$t("design:paramtypes",[])],L.prototype,"errorCode",null);ir([(0,Pt.Expose)(),$t("design:type",Number),$t("design:paramtypes",[])],L.prototype,"timestamp",null);var Bs=class extends L{static{n(this,"SmpErrorResponseMutable")}set errorCode(t){this._errorCode=t}set status(t){this._status=t}set timestamp(t){this._timestamp=t}};var V=class{static{n(this,"Hex")}static parse(t){let r=t.length,o=[];for(let s=0;s<r;s+=2)o[s>>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new _(o,r/2)}static stringify(t){let r=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;r.push((s>>>4).toString(16)),r.push((s&15).toString(16))}return r.join("")}};var _=class Ae{static{n(this,"WordArray")}constructor(t,r){this.words=t||[],r!==void 0?this.sigBytes=r:this.sigBytes=this.words.length*4}static random(t){let r=[],o=n(function(s){let i=987654321,a=4294967295;return function(){i=36969*(i&65535)+(i>>16)&a,s=18e3*(s&65535)+(s>>16)&a;let c=(i<<16)+s&a;return c/=4294967296,c+=.5,c*(Math.random()>.5?1:-1)}},"r");for(let s=0,i;s<t;s+=4){let a=o((i||Math.random())*4294967296);i=a()*987654071,r.push(a()*4294967296|0)}return new Ae(r,t)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new Ae(this.words.slice(0),this.sigBytes)}concat(t){if(this.clamp(),this.sigBytes%4)for(let r=0;r<t.sigBytes;r++){let o=t.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=o<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<t.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=t.words[r>>>2];return this.sigBytes+=t.sigBytes,this}toString(t){return(t||V).stringify(this)}};var Gt=class{static{n(this,"Latin1")}static parse(t){let r=t.length,o=[];for(let s=0;s<r;s++)o[s>>>2]|=(t.charCodeAt(s)&255)<<24-s%4*8;return new _(o,r)}static stringify(t){let r=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(s))}return r.join("")}};var C=class{static{n(this,"Utf8")}static parse(t){return Gt.parse(unescape(encodeURIComponent(t)))}static stringify(t){try{return decodeURIComponent(escape(Gt.stringify(t)))}catch(r){throw console.error("Malformed UTF-8 data",r),new Error("Malformed UTF-8 data")}}};var Wt=class{static{n(this,"BufferedBlockAlgorithm")}constructor(t){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},t),this._data=new _,this._nDataBytes=0}clone(){let t=this.constructor();for(let r in this)Object.prototype.hasOwnProperty.call(this,r)&&(t[r]=this[r]);return t._data=this._data.clone(),t}reset(){this._data=new _,this._nDataBytes=0}_append(t){typeof t=="string"&&(t=C.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}_process(t){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let r=this.cfg.blockSize*4,o=this._data.sigBytes/r;t?o=Math.ceil(o):o=Math.max((o|0)-this._minBufferSize,0);let s=o*this.cfg.blockSize,i=Math.min(s*4,this._data.sigBytes),a;if(s){for(let c=0;c<s;c+=this.cfg.blockSize)this._doProcessBlock(this._data.words,c);a=this._data.words.splice(0,s),this._data.sigBytes-=i}return new _(a,i)}};var dt=class{static{n(this,"CipherParams")}constructor(t){this.ciphertext=t.ciphertext,this.key=t.key,this.iv=t.iv,this.salt=t.salt,this.algorithm=t.algorithm,this.mode=t.mode,this.padding=t.padding,this.blockSize=t.blockSize,this.formatter=t.formatter}extend(t){return t.ciphertext!==void 0&&(this.ciphertext=t.ciphertext),t.key!==void 0&&(this.key=t.key),t.iv!==void 0&&(this.iv=t.iv),t.salt!==void 0&&(this.salt=t.salt),t.algorithm!==void 0&&(this.algorithm=t.algorithm),t.mode!==void 0&&(this.mode=t.mode),t.padding!==void 0&&(this.padding=t.padding),t.blockSize!==void 0&&(this.blockSize=t.blockSize),t.formatter!==void 0&&(this.formatter=t.formatter),this}toString(t){if(t)return t.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var z=class{static{n(this,"Base64")}static parse(t){let r=t.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let s=0;s<this._map.length;s++)this._reverseMap[this._map.charCodeAt(s)]=s}let o=this._map.charAt(64);if(o){let s=t.indexOf(o);s!==-1&&(r=s)}return this.parseLoop(t,r,this._reverseMap)}static parseLoop(t,r,o){let s=[],i=0;for(let a=0;a<r;a++)if(a%4){let c=o[t.charCodeAt(a-1)]<<a%4*2,h=o[t.charCodeAt(a)]>>>6-a%4*2;s[i>>>2]|=(c|h)<<24-i%4*8,i++}return new _(s,i)}static stringify(t){t.clamp();let r=[];for(let s=0;s<t.sigBytes;s+=3){let i=t.words[s>>>2]>>>24-s%4*8&255,a=t.words[s+1>>>2]>>>24-(s+1)%4*8&255,c=t.words[s+2>>>2]>>>24-(s+2)%4*8&255,h=i<<16|a<<8|c;for(let f=0;f<4&&s+f*.75<t.sigBytes;f++)r.push(this._map.charAt(h>>>6*(3-f)&63))}let o=this._map.charAt(64);if(o)for(;r.length%4;)r.push(o);return r.join("")}};z._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";z._reverseMap=void 0;var Kt=class{static{n(this,"OpenSSL")}static parse(t){let r=z.parse(t),o;return r.words[0]===1398893684&&r.words[1]===1701076831&&(o=new _(r.words.slice(2,4)),r.words.splice(0,4),r.sigBytes-=16),new dt({ciphertext:r,salt:o})}static stringify(t){if(!t.ciphertext)throw new Error("missing ciphertext in params");let r=t.ciphertext,o=t.salt,s;if(o){if(typeof o=="string")throw new Error("salt is expected to be a WordArray");s=new _([1398893684,1701076831]).concat(o).concat(r)}else s=r;return s.toString(z)}};var rt=class{static{n(this,"SerializableCipher")}static decrypt(t,r,o,s){let i=Object.assign({},this.cfg,s);if(!i.format)throw new Error("could not determine format");if(r=this._parse(r,i.format),!r.ciphertext)throw new Error("could not determine ciphertext");return t.createDecryptor(o,i).finalize(r.ciphertext)}static encrypt(t,r,o,s){let i=Object.assign({},this.cfg,s),a=t.createEncryptor(o,i),c=a.finalize(r);return new dt({ciphertext:c,key:o,iv:a.cfg.iv,algorithm:t,mode:a.cfg.mode,padding:a.cfg.padding,blockSize:a.cfg.blockSize,formatter:i.format})}static _parse(t,r){return typeof t=="string"?r.parse(t):t}};rt.cfg={blockSize:4,iv:new _([]),format:Kt};var I=class extends Wt{static{n(this,"Hasher")}constructor(t){super(Object.assign({blockSize:512/32},t)),this.reset()}static _createHelper(t){function r(o,s){return new t(s).finalize(o)}return n(r,"helper"),r}finalize(t){return t&&this._append(t),this._doFinalize()}update(t){return this._append(t),this._process(),this}};var p=[];for(let e=0;e<64;e++)p[e]=Math.abs(Math.sin(e+1))*4294967296|0;var k=class u extends I{static{n(this,"MD5")}get hash(){return this._hash}static FF(t,r,o,s,i,a,c){let h=t+(r&o|~r&s)+i+c;return(h<<a|h>>>32-a)+r}static GG(t,r,o,s,i,a,c){let h=t+(r&s|o&~s)+i+c;return(h<<a|h>>>32-a)+r}static HH(t,r,o,s,i,a,c){let h=t+(r^o^s)+i+c;return(h<<a|h>>>32-a)+r}static II(t,r,o,s,i,a,c){let h=t+(o^(r|~s))+i+c;return(h<<a|h>>>32-a)+r}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let t=this._nDataBytes*8,r=this._data.sigBytes*8;this._data.words[r>>>5]|=128<<24-r%32;let o=Math.floor(t/4294967296),s=t;this._data.words[(r+64>>>9<<4)+15]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,this._data.words[(r+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let i=0;i<4;i++)this._hash.words[i]=(this._hash.words[i]<<8|this._hash.words[i]>>>24)&16711935|(this._hash.words[i]<<24|this._hash.words[i]>>>8)&4278255360;return this._hash}_doProcessBlock(t,r){for(let h=0;h<16;h++){let f=r+h,g=t[f];t[f]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let o=Array.from({length:16});for(let h=0;h<16;h++)o[h]=t[r+h];let s=this._hash.words[0],i=this._hash.words[1],a=this._hash.words[2],c=this._hash.words[3];s=u.FF(s,i,a,c,o[0],7,p[0]),c=u.FF(c,s,i,a,o[1],12,p[1]),a=u.FF(a,c,s,i,o[2],17,p[2]),i=u.FF(i,a,c,s,o[3],22,p[3]),s=u.FF(s,i,a,c,o[4],7,p[4]),c=u.FF(c,s,i,a,o[5],12,p[5]),a=u.FF(a,c,s,i,o[6],17,p[6]),i=u.FF(i,a,c,s,o[7],22,p[7]),s=u.FF(s,i,a,c,o[8],7,p[8]),c=u.FF(c,s,i,a,o[9],12,p[9]),a=u.FF(a,c,s,i,o[10],17,p[10]),i=u.FF(i,a,c,s,o[11],22,p[11]),s=u.FF(s,i,a,c,o[12],7,p[12]),c=u.FF(c,s,i,a,o[13],12,p[13]),a=u.FF(a,c,s,i,o[14],17,p[14]),i=u.FF(i,a,c,s,o[15],22,p[15]),s=u.GG(s,i,a,c,o[1],5,p[16]),c=u.GG(c,s,i,a,o[6],9,p[17]),a=u.GG(a,c,s,i,o[11],14,p[18]),i=u.GG(i,a,c,s,o[0],20,p[19]),s=u.GG(s,i,a,c,o[5],5,p[20]),c=u.GG(c,s,i,a,o[10],9,p[21]),a=u.GG(a,c,s,i,o[15],14,p[22]),i=u.GG(i,a,c,s,o[4],20,p[23]),s=u.GG(s,i,a,c,o[9],5,p[24]),c=u.GG(c,s,i,a,o[14],9,p[25]),a=u.GG(a,c,s,i,o[3],14,p[26]),i=u.GG(i,a,c,s,o[8],20,p[27]),s=u.GG(s,i,a,c,o[13],5,p[28]),c=u.GG(c,s,i,a,o[2],9,p[29]),a=u.GG(a,c,s,i,o[7],14,p[30]),i=u.GG(i,a,c,s,o[12],20,p[31]),s=u.HH(s,i,a,c,o[5],4,p[32]),c=u.HH(c,s,i,a,o[8],11,p[33]),a=u.HH(a,c,s,i,o[11],16,p[34]),i=u.HH(i,a,c,s,o[14],23,p[35]),s=u.HH(s,i,a,c,o[1],4,p[36]),c=u.HH(c,s,i,a,o[4],11,p[37]),a=u.HH(a,c,s,i,o[7],16,p[38]),i=u.HH(i,a,c,s,o[10],23,p[39]),s=u.HH(s,i,a,c,o[13],4,p[40]),c=u.HH(c,s,i,a,o[0],11,p[41]),a=u.HH(a,c,s,i,o[3],16,p[42]),i=u.HH(i,a,c,s,o[6],23,p[43]),s=u.HH(s,i,a,c,o[9],4,p[44]),c=u.HH(c,s,i,a,o[12],11,p[45]),a=u.HH(a,c,s,i,o[15],16,p[46]),i=u.HH(i,a,c,s,o[2],23,p[47]),s=u.II(s,i,a,c,o[0],6,p[48]),c=u.II(c,s,i,a,o[7],10,p[49]),a=u.II(a,c,s,i,o[14],15,p[50]),i=u.II(i,a,c,s,o[5],21,p[51]),s=u.II(s,i,a,c,o[12],6,p[52]),c=u.II(c,s,i,a,o[3],10,p[53]),a=u.II(a,c,s,i,o[10],15,p[54]),i=u.II(i,a,c,s,o[1],21,p[55]),s=u.II(s,i,a,c,o[8],6,p[56]),c=u.II(c,s,i,a,o[15],10,p[57]),a=u.II(a,c,s,i,o[6],15,p[58]),i=u.II(i,a,c,s,o[13],21,p[59]),s=u.II(s,i,a,c,o[4],6,p[60]),c=u.II(c,s,i,a,o[11],10,p[61]),a=u.II(a,c,s,i,o[2],15,p[62]),i=u.II(i,a,c,s,o[9],21,p[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+i|0,this._hash.words[2]=this._hash.words[2]+a|0,this._hash.words[3]=this._hash.words[3]+c|0}};var Ee=class nr{static{n(this,"EVPKDF")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:k,iterations:1},t)}static execute(t,r,o){return new nr(o).compute(t,r)}compute(t,r){let o=new this.cfg.hasher,s=new _,i;for(;s.words.length<this.cfg.keySize;){i&&o.update(i),i=o.update(t).finalize(r),o.reset();for(let a=1;a<this.cfg.iterations;a++)i=o.finalize(i),o.reset();s.concat(i)}return s.sigBytes=this.cfg.keySize*4,s}};var ar=class{static{n(this,"OpenSSLKdf")}static execute(t,r,o,s){s||(s=_.random(64/8));let i=new Ee({keySize:r+o}).compute(t,s),a=new _(i.words.slice(r),o*4);return i.sigBytes=r*4,new dt({key:i,iv:a,salt:s})}};var St=class{static{n(this,"PasswordBasedCipher")}static decrypt(t,r,o,s){let i=Object.assign({},this.cfg,s);if(i.format===void 0)throw new Error("missing format in config");if(r=this._parse(r,i.format),i.kdf===void 0)throw new Error("the key derivation function must be set");let a=i.kdf.execute(o,t.keySize,t.ivSize,r.salt);return a.iv!==void 0&&(i.iv=a.iv),rt.decrypt.call(this,t,r,a.key,i)}static encrypt(t,r,o,s){let i=Object.assign({},this.cfg,s);if(i.kdf===void 0)throw new Error("missing kdf in config");let a=i.kdf.execute(o,t.keySize,t.ivSize);return a.iv!==void 0&&(i.iv=a.iv),rt.encrypt.call(this,t,r,a.key,i).extend(a)}static _parse(t,r){return typeof t=="string"?r.parse(t):t}};St.cfg={blockSize:4,iv:new _([]),format:Kt,kdf:ar};var cr=class{static{n(this,"CipherHelper")}constructor(t){this._cipher=t}decrypt(t,r,o){return typeof r=="string"?St.decrypt(this._cipher,t,r,o):rt.decrypt(this._cipher,t,r,o)}encrypt(t,r,o){return typeof r=="string"?St.encrypt(this._cipher,t,r,o):rt.encrypt(this._cipher,t,r,o)}};var mt=class extends Wt{static{n(this,"Cipher")}constructor(t,r,o){super(Object.assign({blockSize:1},o)),this._xformMode=t,this._key=r,this.reset()}static _createHelper(t){return new cr(t)}static createDecryptor(t,r){let o=this;return new o(this._DEC_XFORM_MODE,t,r)}static createEncryptor(t,r){return new this(this._ENC_XFORM_MODE,t,r)}finalize(t){return t&&this._append(t),this._doFinalize()}process(t){return this._append(t),this._process()}};mt.ivSize=4;mt.keySize=4;mt._DEC_XFORM_MODE=2;mt._ENC_XFORM_MODE=1;var ot=class{static{n(this,"BlockCipherModeAlgorithm")}constructor(t,r){this.init(t,r)}init(t,r){this._cipher=t,this._iv=r}};var Ht=class{static{n(this,"BlockCipherMode")}static createDecryptor(t,r){let o=this.Decryptor;return new o(t,r)}static createEncryptor(t,r){let o=this.Encryptor;return new o(t,r)}};Ht.Decryptor=ot;Ht.Encryptor=ot;var hr=class extends ot{static{n(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(t,r){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(t,r,this._cipher.cfg.blockSize),this._cipher.encryptBlock(t,r),this._prevBlock=t.slice(r,r+this._cipher.cfg.blockSize)}xorBlock(t,r,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[r+i]^=s[i]}};var lr=class extends ot{static{n(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(t,r){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let o=t.slice(r,r+this._cipher.cfg.blockSize);this._cipher.decryptBlock(t,r),this.xorBlock(t,r,this._cipher.cfg.blockSize),this._prevBlock=o}xorBlock(t,r,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[r+i]^=s[i]}};var X=class extends Ht{static{n(this,"CBC")}};X.Decryptor=lr;X.Encryptor=hr;var gt=class{static{n(this,"PKCS7")}static pad(t,r){let o=r*4,s=o-t.sigBytes%o,i=s<<24|s<<16|s<<8|s,a=[];for(let h=0;h<s;h+=4)a.push(i);let c=new _(a,s);t.concat(c)}static unpad(t){let r=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=r}};var qt=class extends mt{static{n(this,"BlockCipher")}constructor(t,r,o){super(t,r,Object.assign({blockSize:4,mode:X,padding:gt},o))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let t;this._xformMode===this.constructor._ENC_XFORM_MODE?t=this.cfg.mode.createEncryptor:(t=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===t?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=t.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=t)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let t;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),t=this._process(!0)}else t=this._process(!0),this.cfg.padding.unpad(t);return t}_doProcessBlock(t,r){this._mode.processBlock(t,r)}};var l=class U{static{n(this,"X64Word")}constructor(t,r){this.high=t,this.low=r}add(t){let r=this.low+t.low|0,o=r>>>0<this.low>>>0?1:0,s=this.high+t.high+o|0;return new U(s,r)}and(t){return new U(this.high&t.high,this.low&t.low)}not(){return new U(~this.high,~this.low)}or(t){return new U(this.high|t.high,this.low|t.low)}rotL(t){return this.shiftL(t).or(this.shiftR(64-t))}rotR(t){return this.shiftR(t).or(this.shiftL(64-t))}shiftL(t){return t<32?new U(this.high<<t|this.low>>>32-t,this.low<<t):new U(this.low<<t-32,0)}shiftR(t){return t<32?new U(this.high>>>t,this.low>>>t|this.high<<32-t):new U(0,this.high>>>t-32)}xor(t){return new U(this.high^t.high,this.low^t.low)}};var fr=class ve{static{n(this,"X64WordArray")}constructor(t=[],r){this.words=t,this.sigBytes=r!==void 0?r:t.length*8}static create(t=[],r){return new ve(t,r)}clone(){let t=this.words.map(r=>new l(r.high,r.low));return new ve(t,this.sigBytes)}toX32(){let t=[];for(let r of this.words)t.push(r.high,r.low);return new _(t,this.sigBytes)}};var P=[],pr=[],ur=[],dr=[],mr=[],gr=[],Oe=[],Re=[],Be=[],Te=[];(function(){let e=[];for(let o=0;o<256;o++)o<128?e[o]=o<<1:e[o]=o<<1^283;let t=0,r=0;for(let o=0;o<256;o++){let s=r^r<<1^r<<2^r<<3^r<<4;s=s>>>8^s&255^99,P[t]=s,pr[s]=t;let i=e[t],a=e[i],c=e[a],h=e[s]*257^s*16843008;ur[t]=h<<24|h>>>8,dr[t]=h<<16|h>>>16,mr[t]=h<<8|h>>>24,gr[t]=h,h=c*16843009^a*65537^i*257^t*16843008,Oe[s]=h<<24|h>>>8,Re[s]=h<<16|h>>>16,Be[s]=h<<8|h>>>24,Te[s]=h,t?(t=i^e[e[e[c^i]]],r^=e[e[r]]):t=r=1}})();var Ts=[0,1,2,4,8,16,32,64,128,27,54],Vt=class extends qt{static{n(this,"AES")}constructor(t,r,o){super(t,r,o),super.reset()}decryptBlock(t,r){let o=t[r+1];t[r+1]=t[r+3],t[r+3]=o,this._doCryptBlock(t,r,this._invKeySchedule,Oe,Re,Be,Te,pr),o=t[r+1],t[r+1]=t[r+3],t[r+3]=o}encryptBlock(t,r){this._doCryptBlock(t,r,this._keySchedule,ur,dr,mr,gr,P)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let t=this._keyPriorReset=this._key,r=t.words,o=t.sigBytes/4,i=((this._nRounds=o+6)+1)*4,a=this._keySchedule=[];for(let c=0;c<i;c++)if(c<o)a[c]=r[c];else{let h=a[c-1];c%o?o>6&&c%o===4&&(h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255]):(h=h<<8|h>>>24,h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255],h^=Ts[c/o|0]<<24),a[c]=a[c-o]^h}this._invKeySchedule=[];for(let c=0;c<i;c++){let h=i-c,f;c%4?f=a[h]:f=a[h-4],c<4||h<=4?this._invKeySchedule[c]=f:this._invKeySchedule[c]=Oe[P[f>>>24]]^Re[P[f>>>16&255]]^Be[P[f>>>8&255]]^Te[P[f&255]]}}_doCryptBlock(t,r,o,s,i,a,c,h){let f=t[r]^o[0],g=t[r+1]^o[1],d=t[r+2]^o[2],m=t[r+3]^o[3],w=4;for(let v=1;v<this._nRounds;v++){let x=s[f>>>24]^i[g>>>16&255]^a[d>>>8&255]^c[m&255]^o[w++],b=s[g>>>24]^i[d>>>16&255]^a[m>>>8&255]^c[f&255]^o[w++],T=s[d>>>24]^i[m>>>16&255]^a[f>>>8&255]^c[g&255]^o[w++],_e=s[m>>>24]^i[f>>>16&255]^a[g>>>8&255]^c[d&255]^o[w++];f=x,g=b,d=T,m=_e}let y=(h[f>>>24]<<24|h[g>>>16&255]<<16|h[d>>>8&255]<<8|h[m&255])^o[w++],E=(h[g>>>24]<<24|h[d>>>16&255]<<16|h[m>>>8&255]<<8|h[f&255])^o[w++],O=(h[d>>>24]<<24|h[m>>>16&255]<<16|h[f>>>8&255]<<8|h[g&255])^o[w++],R=(h[m>>>24]<<24|h[f>>>16&255]<<16|h[g>>>8&255]<<8|h[d&255])^o[w++];t[r]=y,t[r+1]=E,t[r+2]=O,t[r+3]=R}};Vt.keySize=256/32;var Is=[1732584193,4023233417,2562383102,271733878,3285377520],st=new Array(80),it=class extends I{static{n(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(Is.slice(0))}_doFinalize(){let t=this._nDataBytes*8,r=this._data.sigBytes*8;return this._data.words[r>>>5]|=128<<24-r%32,this._data.words[(r+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(r+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,r){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)st[h]=t[r+h]|0;else{let m=st[h-3]^st[h-8]^st[h-14]^st[h-16];st[h]=m<<1|m>>>31}let f,g;h<20?(f=s&i|~s&a,g=1518500249):h<40?(f=s^i^a,g=1859775393):h<60?(f=s&i|s&a|i&a,g=2400959708):(f=s^i^a,g=3395469782);let d=(o<<5|o>>>27)+f+c+g+st[h];c=a,a=i,i=s<<30|s>>>2,s=o,o=d|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0}};var _r=[],wr=[];(function(){function e(s){let i=Math.sqrt(s);for(let a=2;a<=i;a++)if(!(s%a))return!1;return!0}n(e,"isPrime");function t(s){return(s-(s|0))*4294967296|0}n(t,"getFractionalBits");let r=2,o=0;for(;o<64;)e(r)&&(o<8&&(_r[o]=t(Math.pow(r,1/2))),wr[o]=t(Math.pow(r,1/3)),o++),r++})();var nt=[],jt=class extends I{static{n(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(_r.slice(0))}_doFinalize(){let t=this._nDataBytes*8,r=this._data.sigBytes*8;return this._data.words[r>>>5]|=128<<24-r%32,this._data.words[(r+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(r+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,r){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4],h=this._hash.words[5],f=this._hash.words[6],g=this._hash.words[7];for(let d=0;d<64;d++){if(d<16)nt[d]=t[r+d]|0;else{let v=nt[d-15],x=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,b=nt[d-2],T=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;nt[d]=x+nt[d-7]+T+nt[d-16]}let m=c&h^~c&f,w=o&s^o&i^s&i,y=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),E=(c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25),O=g+E+m+wr[d]+nt[d],R=y+w;g=f,f=h,h=c,c=a+O|0,a=i,i=s,s=o,o=O+R|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+f|0,this._hash.words[7]=this._hash.words[7]+g|0}};var Ie=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],M=[];(function(){for(let e=0;e<80;e++)M[e]=new l(void 0,void 0)})();var Ce=class extends I{static{n(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new fr([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let t=this._data,r=t.words,o=this._nDataBytes*8,s=t.sigBytes*8;return r[s>>>5]|=128<<24-s%32,r[(s+128>>>10<<5)+30]=Math.floor(o/4294967296),r[(s+128>>>10<<5)+31]=o,t.sigBytes=r.length*4,this._process(),this._hash.toX32()}_doProcessBlock(t,r){let o=this._hash.words[0].high,s=this._hash.words[0].low,i=this._hash.words[1].high,a=this._hash.words[1].low,c=this._hash.words[2].high,h=this._hash.words[2].low,f=this._hash.words[3].high,g=this._hash.words[3].low,d=this._hash.words[4].high,m=this._hash.words[4].low,w=this._hash.words[5].high,y=this._hash.words[5].low,E=this._hash.words[6].high,O=this._hash.words[6].low,R=this._hash.words[7].high,v=this._hash.words[7].low;for(let x=0;x<80;x++){let b,T;if(x<16)T=M[x].high=t[r+x*2]|0,b=M[x].low=t[r+x*2+1]|0;else{let Qe=M[x-15],ft=Qe.high,Rt=Qe.low,ws=(ft>>>1|Rt<<31)^(ft>>>8|Rt<<24)^ft>>>7,tr=(Rt>>>1|ft<<31)^(Rt>>>8|ft<<24)^(Rt>>>7|ft<<25),er=M[x-2],pt=er.high,Bt=er.low,ys=(pt>>>19|Bt<<13)^(pt<<3|Bt>>>29)^pt>>>6,rr=(Bt>>>19|pt<<13)^(Bt<<3|pt>>>29)^(Bt>>>6|pt<<26);b=tr+M[x-7].low,T=ws+M[x-7].high+(b>>>0<tr>>>0?1:0),b=b+rr,T=T+ys+(b>>>0<rr>>>0?1:0),b=b+M[x-16].low,T=T+M[x-16].high+(b>>>0<M[x-16].low>>>0?1:0),M[x].high=T,M[x].low=b}let _e=d&w^~d&E,Ze=m&y^~m&O,ps=o&i^o&c^i&c,us=s&a^s&h^a&h,ds=(o>>>28|s<<4)^(o<<30|s>>>2)^(o<<25|s>>>7),Je=(s>>>28|o<<4)^(s<<30|o>>>2)^(s<<25|o>>>7),ms=(d>>>14|m<<18)^(d>>>18|m<<14)^(d<<23|m>>>9),gs=(m>>>14|d<<18)^(m>>>18|d<<14)^(m<<23|d>>>9),D=v+gs,H=R+ms+(D>>>0<v>>>0?1:0);D=D+Ze,H=H+_e+(D>>>0<Ze>>>0?1:0),D=D+Ie[x].low,H=H+Ie[x].high+(D>>>0<Ie[x].low>>>0?1:0),D=D+b,H=H+T+(D>>>0<b>>>0?1:0);let Ye=Je+us,_s=ds+ps+(Ye>>>0<Je>>>0?1:0);R=E,v=O,E=w,O=y,w=d,y=m,m=g+D|0,d=f+H+(m>>>0<g>>>0?1:0)|0,f=c,g=h,c=i,h=a,i=o,a=s,s=D+Ye|0,o=H+_s+(s>>>0<D>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+s,this._hash.words[0].high=this._hash.words[0].high+o+(this._hash.words[0].low>>>0<s>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+a,this._hash.words[1].high=this._hash.words[1].high+i+(this._hash.words[1].low>>>0<a>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+c+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+f+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+m,this._hash.words[4].high=this._hash.words[4].high+d+(this._hash.words[4].low>>>0<m>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+y,this._hash.words[5].high=this._hash.words[5].high+w+(this._hash.words[5].low>>>0<y>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+O,this._hash.words[6].high=this._hash.words[6].high+E+(this._hash.words[6].low>>>0<O>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+v,this._hash.words[7].high=this._hash.words[7].high+R+(this._hash.words[7].low>>>0<v>>>0?1:0)}};var yr=class{static{n(this,"HMAC")}constructor(t,r){this._hasher=new t;let o=typeof r=="string"?C.parse(r):r,s=this._hasher.cfg.blockSize,i=s*4;o.sigBytes>i&&(o=this._hasher.finalize(o)),o.clamp();let a=this._oKey=o.clone(),c=this._iKey=o.clone(),h=a.words,f=c.words;for(let g=0;g<s;g++)h[g]^=1549556828,f[g]^=909522486;a.sigBytes=c.sigBytes=i,this.reset()}finalize(t){let r=this._hasher.finalize(t);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(r))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(t){return this._hasher.update(t),this}};var Pe=class xr{static{n(this,"PBKDF2")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:jt,iterations:25e4},t)}static execute(t,r,o){return new xr(o).compute(t,r)}compute(t,r){let o=this.cfg,s=new yr(o.hasher,t),i=new _,a=new _([1]),c=i.words,h=a.words,f=o.keySize,g=o.iterations;for(;c.length<f;){let d=s.update(r).finalize(a);s.reset();let m=d.words,w=m.length,y=d;for(let E=1;E<g;E++){y=s.finalize(y),s.reset();let O=y.words;for(let R=0;R<w;R++)m[R]^=O[R]}i.concat(d),h[0]++}return i.sigBytes=f*4,i}};var Dt=qt._createHelper(Vt);var Xt=n(function(){let e=Date.now().toString(36),t=globalThis.crypto;if(t?.getRandomValues){let r=new Uint8Array(8);t.getRandomValues(r);let o="";for(let s=0;s<r.length;s++){let i=r[s].toString(16);o+=i.length===1?"0"+i:i}return e+"-"+o}return e+"-"+Math.random().toString(36).slice(2,10)},"correlationIdHelper");var _t=I._createHelper(k);var wt=I._createHelper(it);var Zt=I._createHelper(jt);var Jt=I._createHelper(Ce);var at=class{static{n(this,"SmpCrypto")}static base64Decode(t){return C.stringify(z.parse(t))}static base64Encode(t){return z.stringify(C.parse(t))}static generateCorrelationId(){return Xt()}static md5(t){return _t(t).toString()}static sha1(t){return wt(t).toString()}static sha256(t){return Zt(t).toString()}static sha512(t){return Jt(t).toString()}};var Nt=class extends tt{static{n(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(t){return this._staticSelf._storage.get(t)}_removeRaw(t){this._staticSelf._storage.delete(t)}_writeRaw(t,r){this._staticSelf._storage.set(t,r)}};var je=class{static{n(this,"SmpHttpTwoService")}static _cacheStrategy=typeof sessionStorage<"u"?new Ct:new Nt;static _errorClass=L;static _mergeParamsFallbackBaseUrl="https://uc-api-nest-common-fe";static _running=new Map;static $http(t){return this._generateAjax(t)}static async _generateAjax(t){let r=this._generateCacheKey(t),o=+(t.ttl||0)>0;if(o){let a=this._cacheStrategy.read(r);if(a)return Promise.resolve(a)}let s=this._running.get(r);if(s)return s;let i=this._generateAjaxBase(t).then(a=>(o&&this._cacheStrategy.write(r,a,t.ttl),a)).finally(()=>{this._running.delete(r)});return this._running.set(r,i),i}static async _generateAjaxBase(t){let r=await this._preprocessRequest(t),o={method:r.method,headers:new Headers({"content-type":"application/json",...r.headers}),body:r.body?JSON.stringify(r.body):null};return r.useCredentials&&(o.credentials="include"),r.url=this.mergeQueryParams(r.url,r.queryParams),fetch(r.url,o).then(s=>this._preprocessResponse(t,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(r.responseType){case"blob":return s.blob();case"arraybuffer":return s.arrayBuffer();case"text":return s.text();case"json":default:return s.json()}}return s.json().then(i=>{let a=i;try{a=this._errorClass.fromPlain(i)}catch(c){console.debug("http: failed to parse error response into ErrorResponse",c)}return Promise.reject({status:s.status,message:s.statusText,body:a})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(t,r){if(!r||Object.keys(r).length===0)return t;let o=t.startsWith("http"),s=new URL(t,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),a={...Object.fromEntries(new URLSearchParams(s.search).entries()),...r},c=[];for(let[d,m]of Object.entries(a))if(m!=null)if(Array.isArray(m))for(let w of m)c.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(w))}`);else c.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(m))}`);let h=c.length?`?${c.join("&")}`:"",g=s.origin+s.pathname+h;return o?g:g.replace(s.origin,"")}static _generateCacheKey(t){let r=`${t.method}:${t.url}`;return t.queryParams&&Object.keys(t.queryParams).length>0&&(r+=`:${at.md5(JSON.stringify(t.queryParams))}`),t.body&&Object.keys(t.body).length>0?`${r}:${at.md5(JSON.stringify(t.body))}`:r}static async _preprocessRequest(t){return t}static async _preprocessResponse(t,r){return r}};var br=require("@tonysamperi/logger");var De=class{static{n(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new br.SmpLoggerMethods;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(t,r){return`Basic ${Buffer.from(`${t}:${r}`).toString("base64")}`}static fromBearer(t=""){return t.split(" ")[1]}static getCountryFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[1]}static getLocaleFromReferer(t){return t?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(t,r){try{return t.replace(this._pathParamRegex,(o,s)=>{let i=r[s];return i!==void 0?encodeURIComponent(i):o})}catch(o){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,o)}return t}};var Cs={status:"OK"};var Ne=(function(e){return e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e})({});var Me=class{static{n(this,"SmpBaseJwtToken")}_access_token;_exp;_iss;get access_token(){return this._access_token}get exp(){return this._exp}get iss(){return this._iss}constructor(t,r,o){this._access_token=t,this._exp=r,this._iss=o}serialize(){return{access_token:this._access_token,exp:this._exp,iss:this._iss}}};var Fe=class{static{n(this,"SmpBaseJwtTokenPlain")}access_token;exp;iss};var Ps=(function(e){return e.APPLE="APPLE",e.FACEBOOK="FACEBOOK",e.GOOGLE="GOOGLE",e})({});var js=(function(e){return e.POPUP="POPUP",e.REDIRECT="REDIRECT",e})({});var yt=class{static{n(this,"SmpAesCrypt")}_password;_salt;_initVector;_iv;_key;_mode=X;_padding=gt;constructor(t,r,o){this._password=t,this._salt=r,this._initVector=o,this._iv=this._initVector?V.parse(this._initVector):void 0,this._key=this._buildKey()}decryptAES(t){return Dt.decrypt(t,this._key,{iv:this._iv,mode:this._mode,padding:this._padding}).toString(C)}encryptAES(t){return Dt.encrypt(t,this._key,{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return Pe.execute(this._password,V.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:it})}};var Yt=class{static{n(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength=5;_seed="changeme";constructor(t){this._baseCode=t}static check(t,r){if(new this(t).secureCode!==r)throw L.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:xe.BadRequest})}_encode(){let t=new k;return t.update(C.parse(this._seed+this._baseCode)),t.finalize().toString(V).substring(0,this._crcLength).toUpperCase()}};var Ds=(function(e){return e.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",e.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",e.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",e.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",e.EMAIL_EXISTS="auth/email-already-exists",e.INVALID_ACTION_CODE="auth/invalid-action-code",e.POPUP_BLOCKED="auth/popup-blocked",e.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",e.USER_NOT_FOUND="auth/user-not-found",e.WRONG_PASSWORD="auth/wrong-password",e})({});var xt=require("class-transformer"),Qt=require("ts-luxon");var j=(function(e){return e.ACTIVATE="ACTIVATE",e.BLOCK="BLOCK",e.CHECK="CHECK",e.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",e.FREEZE="FREEZE",e.PURCHASE="PURCHASE",e.RECHARGE="RECHARGE",e.ROLLBACK="ROLLBACK",e.TRANSACTION="TRANSACTION",e.TRANSACTION_DETAIL="TRANSACTION_DETAIL",e.UNFREEZE="UNFREEZE",e.XREFUND="XREFUND",e})({});var ct=(function(e){return e.MD5="MD5",e.MD5_HMAC="MD5_HMAC",e.SHA1="SHA1",e.SHA1_HMAC="SHA1_HMAC",e})({});function Ns(e,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}n(Ns,"_ts_decorate");function Ar(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}n(Ar,"_ts_metadata");var te=class e{static{n(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new yt("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _OP_CODES={[j.CHECK]:"",[j.TRANSACTION]:"",[j.TRANSACTION_DETAIL]:"",[j.ACTIVATE]:"A",[j.BLOCK]:"B",[j.DIGITAL_ACTIVATE]:"D",[j.FREEZE]:"F",[j.PURCHASE]:"P",[j.RECHARGE]:"G",[j.ROLLBACK]:"R",[j.UNFREEZE]:"U",[j.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies={[ct.MD5]:t=>_t(t),[ct.MD5_HMAC]:t=>{let r=new k;return r.update(C.parse(t)),r.finalize()},[ct.SHA1]:t=>wt(t),[ct.SHA1_HMAC]:t=>{let r=new it;return r.update(C.parse(t)),r.finalize()}};_hashStrategy=this._hashStrategies[ct.MD5];constructor(t="ACTIVATION",r,o,s){this.gc=t,this.op=r,this.ot=o,this._dto=typeof s=="number"&&s>=0?Qt.DateTime.fromMillis(+`${s}000`.slice(0,13)):Qt.DateTime.local()}static build({gc:t,op:r,ot:o,dto:s}){return new this(t,r,o,s?.ts)}static explode(t){let r=this.constructor,o=(t||"").split(r._SEP);if(o.length<4)throw new Error(`${this.constructor.name}::explode: invalid transactionId provided => "${t}"`);return this.build({gc:o[1],op:r.prefixToOperation(o[2]),dto:Qt.DateTime.fromSeconds(+o[3])})}static isBase64(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)&&t.length%4===0}static parse(t){console.info(`${this.constructor.name}::parse: trying to parse ${t}`);try{if(this.isBase64(t)){let r=this._AES_ENCODER.decryptAES(t),o=JSON.parse(r);return(0,xt.plainToInstance)(e,o)}else return this.explode(t)}catch(r){throw console.error(`${this.constructor.name}::parse: failed to parse ${t}`,r),new Error(`${this.constructor.name}::parse: could not parse transactionId ${t}`)}}static prefixToOperation(t){return Object.entries(this._OP_CODES).find(([,o])=>o===t)[0]}serialize(){return(0,xt.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let t=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(t)}};Ns([(0,xt.Expose)(),Ar("design:type",Number),Ar("design:paramtypes",[])],te.prototype,"ts",null);var Ms=(function(e){return e.ListDetectiveValidator="ListDetectiveValidator",e.MXValidator="MXValidator",e.SyntaxValidator="SyntaxValidator",e})({});function Fs(e,t){t.forEach(r=>{Object.getOwnPropertyNames(r.prototype).forEach(o=>{o!=="constructor"&&(o in e.prototype||Object.defineProperty(e.prototype,o,Object.getOwnPropertyDescriptor(r.prototype,o)))});try{let o=new r;Object.getOwnPropertyNames(o).forEach(s=>{s in e.prototype||Object.defineProperty(e.prototype,s,Object.getOwnPropertyDescriptor(o,s))})}catch{}Object.getOwnPropertyNames(r).forEach(o=>{o!=="prototype"&&o!=="name"&&o!=="length"&&(o in e||Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o)))})})}n(Fs,"smpApplyMixin");function Ls(){this.__data__=[],this.size=0}n(Ls,"listCacheClear");var Er=Ls;function Us(e,t){return e===t||e!==e&&t!==t}n(Us,"eq");var ee=Us;function zs(e,t){for(var r=e.length;r--;)if(ee(e[r][0],t))return r;return-1}n(zs,"assocIndexOf");var Z=zs;var ks=Array.prototype,$s=ks.splice;function Gs(e){var t=this.__data__,r=Z(t,e);if(r<0)return!1;var o=t.length-1;return r==o?t.pop():$s.call(t,r,1),--this.size,!0}n(Gs,"listCacheDelete");var vr=Gs;function Ws(e){var t=this.__data__,r=Z(t,e);return r<0?void 0:t[r][1]}n(Ws,"listCacheGet");var Or=Ws;function Ks(e){return Z(this.__data__,e)>-1}n(Ks,"listCacheHas");var Rr=Ks;function Ss(e,t){var r=this.__data__,o=Z(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}n(Ss,"listCacheSet");var Br=Ss;function bt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}n(bt,"ListCache");bt.prototype.clear=Er;bt.prototype.delete=vr;bt.prototype.get=Or;bt.prototype.has=Rr;bt.prototype.set=Br;var J=bt;function Hs(){this.__data__=new J,this.size=0}n(Hs,"stackClear");var Tr=Hs;function qs(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}n(qs,"stackDelete");var Ir=qs;function Vs(e){return this.__data__.get(e)}n(Vs,"stackGet");var Cr=Vs;function Xs(e){return this.__data__.has(e)}n(Xs,"stackHas");var Pr=Xs;var Zs=typeof global=="object"&&global&&global.Object===Object&&global,re=Zs;var Js=typeof self=="object"&&self&&self.Object===Object&&self,Ys=re||Js||Function("return this")(),B=Ys;var Qs=B.Symbol,$=Qs;var jr=Object.prototype,ti=jr.hasOwnProperty,ei=jr.toString,Mt=$?$.toStringTag:void 0;function ri(e){var t=ti.call(e,Mt),r=e[Mt];try{e[Mt]=void 0;var o=!0}catch{}var s=ei.call(e);return o&&(t?e[Mt]=r:delete e[Mt]),s}n(ri,"getRawTag");var Dr=ri;var oi=Object.prototype,si=oi.toString;function ii(e){return si.call(e)}n(ii,"objectToString");var Nr=ii;var ni="[object Null]",ai="[object Undefined]",Mr=$?$.toStringTag:void 0;function ci(e){return e==null?e===void 0?ai:ni:Mr&&Mr in Object(e)?Dr(e):Nr(e)}n(ci,"baseGetTag");var G=ci;function hi(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(hi,"isObject");var oe=hi;var li="[object AsyncFunction]",fi="[object Function]",pi="[object GeneratorFunction]",ui="[object Proxy]";function di(e){if(!oe(e))return!1;var t=G(e);return t==fi||t==pi||t==li||t==ui}n(di,"isFunction");var se=di;var mi=B["__core-js_shared__"],ie=mi;var Fr=(function(){var e=/[^.]+$/.exec(ie&&ie.keys&&ie.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function gi(e){return!!Fr&&Fr in e}n(gi,"isMasked");var Lr=gi;var _i=Function.prototype,wi=_i.toString;function yi(e){if(e!=null){try{return wi.call(e)}catch{}try{return e+""}catch{}}return""}n(yi,"toSource");var W=yi;var xi=/[\\^$.*+?()[\]{}|]/g,bi=/^\[object .+?Constructor\]$/,Ai=Function.prototype,Ei=Object.prototype,vi=Ai.toString,Oi=Ei.hasOwnProperty,Ri=RegExp("^"+vi.call(Oi).replace(xi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bi(e){if(!oe(e)||Lr(e))return!1;var t=se(e)?Ri:bi;return t.test(W(e))}n(Bi,"baseIsNative");var Ur=Bi;function Ti(e,t){return e?.[t]}n(Ti,"getValue");var zr=Ti;function Ii(e,t){var r=zr(e,t);return Ur(r)?r:void 0}n(Ii,"getNative");var F=Ii;var Ci=F(B,"Map"),Y=Ci;var Pi=F(Object,"create"),K=Pi;function ji(){this.__data__=K?K(null):{},this.size=0}n(ji,"hashClear");var kr=ji;function Di(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}n(Di,"hashDelete");var $r=Di;var Ni="__lodash_hash_undefined__",Mi=Object.prototype,Fi=Mi.hasOwnProperty;function Li(e){var t=this.__data__;if(K){var r=t[e];return r===Ni?void 0:r}return Fi.call(t,e)?t[e]:void 0}n(Li,"hashGet");var Gr=Li;var Ui=Object.prototype,zi=Ui.hasOwnProperty;function ki(e){var t=this.__data__;return K?t[e]!==void 0:zi.call(t,e)}n(ki,"hashHas");var Wr=ki;var $i="__lodash_hash_undefined__";function Gi(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=K&&t===void 0?$i:t,this}n(Gi,"hashSet");var Kr=Gi;function At(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}n(At,"Hash");At.prototype.clear=kr;At.prototype.delete=$r;At.prototype.get=Gr;At.prototype.has=Wr;At.prototype.set=Kr;var Le=At;function Wi(){this.size=0,this.__data__={hash:new Le,map:new(Y||J),string:new Le}}n(Wi,"mapCacheClear");var Sr=Wi;function Ki(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}n(Ki,"isKeyable");var Hr=Ki;function Si(e,t){var r=e.__data__;return Hr(t)?r[typeof t=="string"?"string":"hash"]:r.map}n(Si,"getMapData");var Q=Si;function Hi(e){var t=Q(this,e).delete(e);return this.size-=t?1:0,t}n(Hi,"mapCacheDelete");var qr=Hi;function qi(e){return Q(this,e).get(e)}n(qi,"mapCacheGet");var Vr=qi;function Vi(e){return Q(this,e).has(e)}n(Vi,"mapCacheHas");var Xr=Vi;function Xi(e,t){var r=Q(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}n(Xi,"mapCacheSet");var Zr=Xi;function Et(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}n(Et,"MapCache");Et.prototype.clear=Sr;Et.prototype.delete=qr;Et.prototype.get=Vr;Et.prototype.has=Xr;Et.prototype.set=Zr;var ne=Et;var Zi=200;function Ji(e,t){var r=this.__data__;if(r instanceof J){var o=r.__data__;if(!Y||o.length<Zi-1)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new ne(o)}return r.set(e,t),this.size=r.size,this}n(Ji,"stackSet");var Jr=Ji;function vt(e){var t=this.__data__=new J(e);this.size=t.size}n(vt,"Stack");vt.prototype.clear=Tr;vt.prototype.delete=Ir;vt.prototype.get=Cr;vt.prototype.has=Pr;vt.prototype.set=Jr;var ae=vt;var Yi="__lodash_hash_undefined__";function Qi(e){return this.__data__.set(e,Yi),this}n(Qi,"setCacheAdd");var Yr=Qi;function tn(e){return this.__data__.has(e)}n(tn,"setCacheHas");var Qr=tn;function ce(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ne;++t<r;)this.add(e[t])}n(ce,"SetCache");ce.prototype.add=ce.prototype.push=Yr;ce.prototype.has=Qr;var to=ce;function en(e,t){for(var r=-1,o=e==null?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1}n(en,"arraySome");var eo=en;function rn(e,t){return e.has(t)}n(rn,"cacheHas");var ro=rn;var on=1,sn=2;function nn(e,t,r,o,s,i){var a=r&on,c=e.length,h=t.length;if(c!=h&&!(a&&h>c))return!1;var f=i.get(e),g=i.get(t);if(f&&g)return f==t&&g==e;var d=-1,m=!0,w=r&sn?new to:void 0;for(i.set(e,t),i.set(t,e);++d<c;){var y=e[d],E=t[d];if(o)var O=a?o(E,y,d,t,e,i):o(y,E,d,e,t,i);if(O!==void 0){if(O)continue;m=!1;break}if(w){if(!eo(t,function(R,v){if(!ro(w,v)&&(y===R||s(y,R,r,o,i)))return w.push(v)})){m=!1;break}}else if(!(y===E||s(y,E,r,o,i))){m=!1;break}}return i.delete(e),i.delete(t),m}n(nn,"equalArrays");var he=nn;var an=B.Uint8Array,Ue=an;function cn(e){var t=-1,r=Array(e.size);return e.forEach(function(o,s){r[++t]=[s,o]}),r}n(cn,"mapToArray");var oo=cn;function hn(e){var t=-1,r=Array(e.size);return e.forEach(function(o){r[++t]=o}),r}n(hn,"setToArray");var so=hn;var ln=1,fn=2,pn="[object Boolean]",un="[object Date]",dn="[object Error]",mn="[object Map]",gn="[object Number]",_n="[object RegExp]",wn="[object Set]",yn="[object String]",xn="[object Symbol]",bn="[object ArrayBuffer]",An="[object DataView]",io=$?$.prototype:void 0,ze=io?io.valueOf:void 0;function En(e,t,r,o,s,i,a){switch(r){case An:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case bn:return!(e.byteLength!=t.byteLength||!i(new Ue(e),new Ue(t)));case pn:case un:case gn:return ee(+e,+t);case dn:return e.name==t.name&&e.message==t.message;case _n:case yn:return e==t+"";case mn:var c=oo;case wn:var h=o&ln;if(c||(c=so),e.size!=t.size&&!h)return!1;var f=a.get(e);if(f)return f==t;o|=fn,a.set(e,t);var g=he(c(e),c(t),o,s,i,a);return a.delete(e),g;case xn:if(ze)return ze.call(e)==ze.call(t)}return!1}n(En,"equalByTag");var no=En;function vn(e,t){for(var r=-1,o=t.length,s=e.length;++r<o;)e[s+r]=t[r];return e}n(vn,"arrayPush");var ao=vn;var On=Array.isArray,ht=On;function Rn(e,t,r){var o=t(e);return ht(e)?o:ao(o,r(e))}n(Rn,"baseGetAllKeys");var co=Rn;function Bn(e,t){for(var r=-1,o=e==null?0:e.length,s=0,i=[];++r<o;){var a=e[r];t(a,r,e)&&(i[s++]=a)}return i}n(Bn,"arrayFilter");var ho=Bn;function Tn(){return[]}n(Tn,"stubArray");var lo=Tn;var In=Object.prototype,Cn=In.propertyIsEnumerable,fo=Object.getOwnPropertySymbols,Pn=fo?function(e){return e==null?[]:(e=Object(e),ho(fo(e),function(t){return Cn.call(e,t)}))}:lo,po=Pn;function jn(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}n(jn,"baseTimes");var uo=jn;function Dn(e){return e!=null&&typeof e=="object"}n(Dn,"isObjectLike");var S=Dn;var Nn="[object Arguments]";function Mn(e){return S(e)&&G(e)==Nn}n(Mn,"baseIsArguments");var ke=Mn;var mo=Object.prototype,Fn=mo.hasOwnProperty,Ln=mo.propertyIsEnumerable,Un=ke((function(){return arguments})())?ke:function(e){return S(e)&&Fn.call(e,"callee")&&!Ln.call(e,"callee")},go=Un;function zn(){return!1}n(zn,"stubFalse");var _o=zn;var xo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wo=xo&&typeof module=="object"&&module&&!module.nodeType&&module,kn=wo&&wo.exports===xo,yo=kn?B.Buffer:void 0,$n=yo?yo.isBuffer:void 0,Gn=$n||_o,Ft=Gn;var Wn=9007199254740991,Kn=/^(?:0|[1-9]\d*)$/;function Sn(e,t){var r=typeof e;return t=t??Wn,!!t&&(r=="number"||r!="symbol"&&Kn.test(e))&&e>-1&&e%1==0&&e<t}n(Sn,"isIndex");var bo=Sn;var Hn=9007199254740991;function qn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Hn}n(qn,"isLength");var le=qn;var Vn="[object Arguments]",Xn="[object Array]",Zn="[object Boolean]",Jn="[object Date]",Yn="[object Error]",Qn="[object Function]",ta="[object Map]",ea="[object Number]",ra="[object Object]",oa="[object RegExp]",sa="[object Set]",ia="[object String]",na="[object WeakMap]",aa="[object ArrayBuffer]",ca="[object DataView]",ha="[object Float32Array]",la="[object Float64Array]",fa="[object Int8Array]",pa="[object Int16Array]",ua="[object Int32Array]",da="[object Uint8Array]",ma="[object Uint8ClampedArray]",ga="[object Uint16Array]",_a="[object Uint32Array]",A={};A[ha]=A[la]=A[fa]=A[pa]=A[ua]=A[da]=A[ma]=A[ga]=A[_a]=!0;A[Vn]=A[Xn]=A[aa]=A[Zn]=A[ca]=A[Jn]=A[Yn]=A[Qn]=A[ta]=A[ea]=A[ra]=A[oa]=A[sa]=A[ia]=A[na]=!1;function wa(e){return S(e)&&le(e.length)&&!!A[G(e)]}n(wa,"baseIsTypedArray");var Ao=wa;function ya(e){return function(t){return e(t)}}n(ya,"baseUnary");var Eo=ya;var vo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Lt=vo&&typeof module=="object"&&module&&!module.nodeType&&module,xa=Lt&&Lt.exports===vo,$e=xa&&re.process,ba=(function(){try{var e=Lt&&Lt.require&&Lt.require("util").types;return e||$e&&$e.binding&&$e.binding("util")}catch{}})(),Ge=ba;var Oo=Ge&&Ge.isTypedArray,Aa=Oo?Eo(Oo):Ao,fe=Aa;var Ea=Object.prototype,va=Ea.hasOwnProperty;function Oa(e,t){var r=ht(e),o=!r&&go(e),s=!r&&!o&&Ft(e),i=!r&&!o&&!s&&fe(e),a=r||o||s||i,c=a?uo(e.length,String):[],h=c.length;for(var f in e)(t||va.call(e,f))&&!(a&&(f=="length"||s&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||bo(f,h)))&&c.push(f);return c}n(Oa,"arrayLikeKeys");var Ro=Oa;var Ra=Object.prototype;function Ba(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ra;return e===r}n(Ba,"isPrototype");var Bo=Ba;function Ta(e,t){return function(r){return e(t(r))}}n(Ta,"overArg");var To=Ta;var Ia=To(Object.keys,Object),Io=Ia;var Ca=Object.prototype,Pa=Ca.hasOwnProperty;function ja(e){if(!Bo(e))return Io(e);var t=[];for(var r in Object(e))Pa.call(e,r)&&r!="constructor"&&t.push(r);return t}n(ja,"baseKeys");var Co=ja;function Da(e){return e!=null&&le(e.length)&&!se(e)}n(Da,"isArrayLike");var Po=Da;function Na(e){return Po(e)?Ro(e):Co(e)}n(Na,"keys");var jo=Na;function Ma(e){return co(e,jo,po)}n(Ma,"getAllKeys");var We=Ma;var Fa=1,La=Object.prototype,Ua=La.hasOwnProperty;function za(e,t,r,o,s,i){var a=r&Fa,c=We(e),h=c.length,f=We(t),g=f.length;if(h!=g&&!a)return!1;for(var d=h;d--;){var m=c[d];if(!(a?m in t:Ua.call(t,m)))return!1}var w=i.get(e),y=i.get(t);if(w&&y)return w==t&&y==e;var E=!0;i.set(e,t),i.set(t,e);for(var O=a;++d<h;){m=c[d];var R=e[m],v=t[m];if(o)var x=a?o(v,R,m,t,e,i):o(R,v,m,e,t,i);if(!(x===void 0?R===v||s(R,v,r,o,i):x)){E=!1;break}O||(O=m=="constructor")}if(E&&!O){var b=e.constructor,T=t.constructor;b!=T&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(E=!1)}return i.delete(e),i.delete(t),E}n(za,"equalObjects");var Do=za;var ka=F(B,"DataView"),pe=ka;var $a=F(B,"Promise"),ue=$a;var Ga=F(B,"Set"),de=Ga;var Wa=F(B,"WeakMap"),me=Wa;var No="[object Map]",Ka="[object Object]",Mo="[object Promise]",Fo="[object Set]",Lo="[object WeakMap]",Uo="[object DataView]",Sa=W(pe),Ha=W(Y),qa=W(ue),Va=W(de),Xa=W(me),lt=G;(pe&&lt(new pe(new ArrayBuffer(1)))!=Uo||Y&&lt(new Y)!=No||ue&&lt(ue.resolve())!=Mo||de&&lt(new de)!=Fo||me&&lt(new me)!=Lo)&&(lt=n(function(e){var t=G(e),r=t==Ka?e.constructor:void 0,o=r?W(r):"";if(o)switch(o){case Sa:return Uo;case Ha:return No;case qa:return Mo;case Va:return Fo;case Xa:return Lo}return t},"getTag"));var Ke=lt;var Za=1,zo="[object Arguments]",ko="[object Array]",ge="[object Object]",Ja=Object.prototype,$o=Ja.hasOwnProperty;function Ya(e,t,r,o,s,i){var a=ht(e),c=ht(t),h=a?ko:Ke(e),f=c?ko:Ke(t);h=h==zo?ge:h,f=f==zo?ge:f;var g=h==ge,d=f==ge,m=h==f;if(m&&Ft(e)){if(!Ft(t))return!1;a=!0,g=!1}if(m&&!g)return i||(i=new ae),a||fe(e)?he(e,t,r,o,s,i):no(e,t,h,r,o,s,i);if(!(r&Za)){var w=g&&$o.call(e,"__wrapped__"),y=d&&$o.call(t,"__wrapped__");if(w||y){var E=w?e.value():e,O=y?t.value():t;return i||(i=new ae),s(E,O,r,o,i)}}return m?(i||(i=new ae),Do(e,t,r,o,s,i)):!1}n(Ya,"baseIsEqualDeep");var Go=Ya;function Wo(e,t,r,o,s){return e===t?!0:e==null||t==null||!S(e)&&!S(t)?e!==e&&t!==t:Go(e,t,r,o,Wo,s)}n(Wo,"baseIsEqual");var Ko=Wo;function Qa(e,t){return Ko(e,t)}n(Qa,"isEqual");var So=Qa;var tc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ho(e){return e.match(tc)}n(Ho,"smpAsciiWords");var Yo="\\ud800-\\udfff",ec="\\u0300-\\u036f",rc="\\ufe20-\\ufe2f",oc="\\u20d0-\\u20ff",sc="\\u1ab0-\\u1aff",ic="\\u1dc0-\\u1dff",nc=ec+rc+oc+sc+ic,Qo="\\u2700-\\u27bf",ts="a-z\\xdf-\\xf6\\xf8-\\xff",ac="\\xac\\xb1\\xd7\\xf7",cc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hc="\\u2000-\\u206f",lc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",es="A-Z\\xc0-\\xd6\\xd8-\\xde",fc="\\ufe0e\\ufe0f",rs=ac+cc+hc+lc,os="['\u2019]",qo=`[${rs}]`,pc=`[${nc}]`,ss="\\d",uc=`[${Qo}]`,is=`[${ts}]`,ns=`[^${Yo}${rs+ss+Qo+ts+es}]`,dc="\\ud83c[\\udffb-\\udfff]",mc=`(?:${pc}|${dc})`,gc=`[^${Yo}]`,as="(?:\\ud83c[\\udde6-\\uddff]){2}",cs="[\\ud800-\\udbff][\\udc00-\\udfff]",Ot=`[${es}]`,_c="\\u200d",Vo=`(?:${is}|${ns})`,wc=`(?:${Ot}|${ns})`,Xo=`(?:${os}(?:d|ll|m|re|s|t|ve))?`,Zo=`(?:${os}(?:D|LL|M|RE|S|T|VE))?`,hs=`${mc}?`,ls=`[${fc}]?`,yc=`(?:${_c}(?:${[gc,as,cs].join("|")})${ls+hs})*`,xc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ac=ls+hs+yc,Jo=`(?:${[uc,as,cs].join("|")})${Ac}`,Ut=class{static{n(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${Ot}?${is}+${Xo}(?=${[qo,Ot,"$"].join("|")})`,`${wc}+${Zo}(?=${[qo,Ot+Vo,"$"].join("|")})`,`${Ot}?${Vo}+${Xo}`,`${Ot}+${Zo}`,bc,xc,`${ss}+`,Jo].join("|"),"g");static RS_EMOJI=Jo;static unicodeWords(t){return t.match(this.RE_UNICODE_WORDS)}};var Se=class{static{n(this,"SmpCommonUtils")}static arrayRemove(t,r){let o=[],s=t.filter((i,a)=>r(i,a)&&o.push(a));return o.reverse().forEach(i=>t.splice(i,1)),s}static assertIsArray(t,r){if(!Array.isArray(t))throw new Error(r||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(t,r){if(!this.isBoolean(t))throw new Error(r||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(t,r){if(!this.isFunction(t))throw new Error(r||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(t,r,o){if(!(t instanceof r))throw new Error(o||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(t,r){if(this.isEmpty(t))throw new Error(r||`${this.constructor.name} => entity was empty`)}static assertIsNumber(t,r){if(typeof t!="number")throw new Error(r||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(t,r){if(!this.isNumeric(t))throw new Error(r||`${this.constructor.name} => val was not numeric`)}static assertIsObject(t,r){if(!this.isObject(t))throw new Error(r||`${this.constructor.name} => val was not an object`)}static assertIsString(t,r){if(!this.isString(t))throw new Error(r||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(t,r){if(!t)throw new Error(r||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...t){let r=t.filter(o=>!!o).join("/").replace(/(?<!:)\/\/+/g,"/");return r.startsWith("http")&&!r.endsWith("/")?`${r}/`:r}static downloadBlob(t,r){let o=window.URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.setAttribute("download",r),document.body.appendChild(s),s.click()}static fixDecimalPrecision(t,r=2){this.assertIsNumber(t),this.assertIsNumber(r);let s=10**Math.max(0,Math.trunc(r));return Math.round((t+Number.EPSILON)*s)/s}static generateRandomHexString(t=12){let r="0123456789abcdef",o="";for(let s=0;s<t;s++){let i=Math.floor(Math.random()*r.length);o+=r[i]}return o}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})}static getDecimalPrecision(t){if(this.assertIsNumeric(t),!isFinite(+t))return 0;let r=1,o=0;for(;Math.round(+t*r)/r!==t;)r*=10,o++;return o}static getType(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}static isBoolean(t){return typeof t=="boolean"}static isColor(t){if(!t||!this.isString(t))return!1;let r=new Option().style;return r.color=t,r.color!==""}static isEmpty(t){return!t&&t!==0}static isEqual(t,r){return So(t,r)}static isFormField(t){return/^(?:input|select|textarea|button)$/i.test(t.nodeName)}static isFunction(t){return typeof t==typeof isNaN}static isNotEmpty(t){return!this.isEmpty(t)}static isNumber(t){return typeof t=="number"&&this.isNumeric(t)}static isNumeric(t){return!isNaN(t)}static isObject(t){return!!t&&t===Object(t)&&t.constructor===Object}static isPrimitive(t){let r=this.getType(t);return r!=="function"&&(r!=="object"||!t)}static isString(t){return typeof t=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(t,r){if(this.assertIsFunction(r,`CommonUtils => expected type of iteratee to be Function, got ${typeof r}`),this.isObject(t))return Object.entries(t).reduce((o,[s,i])=>(o.push(r(i,s)),o),[]);if(Array.isArray(t))return t.map(r);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof r}`)}static mapObjectKeys(t,r){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>{let a=r(s,i);return o[a]=i,o},{}):{}}static mapObjectValues(t,r){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>(o[s]=r.call(null,i,s),o),{}):{}}static noop(){}static objectHasValue(t,r){return!!~Object.values(t).filter(o=>this.isEqual(o,r))}static omit(t,r){return Object.keys(t).filter(s=>!r.includes(s)).reduce((s,i)=>(s[i]=t[i],s),{})}static parseBoolean(t){return t?/^true$/i.test(t):!1}static parseJsonSafely(t){try{return JSON.parse(t)}catch(r){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:t,error:r});return}}static pick(t,r){return r.reduce((o,s)=>(s in t&&(o[s]=t[s]),o),{})}static runSafely(t,r=null,o=[]){if(this.isFunction(t))return t.apply(r,o)}static sleep(t){return new Promise(r=>setTimeout(r,t))}static sprintf(t,...r){return this.isString(t)&&r.length?this.sprintf(t.replace("%s",String(r.shift())),...r):t}static stripComments(t){return typeof t=="string"?t.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):t}static submitFakeForm({action:t,method:r=Ne.POST,data:o,target:s}){let i=Object.entries(o||{}).map(([c,h])=>`<input name="${c}" type="hidden" value="${h}" />`),a=document.createElement("form");a.method=r,a.action=t,a.innerHTML=`${i}`,a.target=s||"_self",document.body.append(a),a.submit()}static toCamelCase(t){return this.words(t.replace(/['\u2019]/g,"")).reduce((r,o,s)=>(o=o.toLowerCase(),r+(s?o.charAt(0).toUpperCase()+o.slice(1):o)),"")}static toKebabCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(t){return this.toCamelCase(t).replace(/^(.)/,r=>r.toUpperCase())}static toSnakeCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(t){return this.toSnakeCase(t).toUpperCase()}static words(t,r){return r===void 0?(Ut.HAS_UNICODE_WORD(t)?Ut.unicodeWords(t):Ho(t))||[]:t.match(r)||[]}};var He=class extends Error{static{n(this,"SmpFilterException")}message;data;constructor(t="Filter Exception",r){super(),this.message=t,this.data=r}};var qe=require("ts-luxon");var Ve=class e{static{n(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return qe.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix="$1";constructor(t=`sid-xxxx-${+qe.DateTime.now().ts}`,r=0){this.value=t,this.expiry=r}static parse(t){return new e(t.value,t.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};var fs=require("@tonysamperi/logger");var Xe=class{static{n(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var Ec="2.0.0-beta.6";0&&(module.exports={SMP_HEALTHZ,SmpAbstractCacheStrategy,SmpAbstractTtlCacheStrategy,SmpAesCrypt,SmpApiCommonUtils,SmpBaseJwtToken,SmpBaseJwtTokenPlain,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpHttpTwoService,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpApplyMixin,smpIsSmpCachedValue,smpNoop});
2
2
  //# sourceMappingURL=index.cjs.map