@agentlang/lstudio 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/_commonjs-dynamic-modules-DkOKMH7F.js +1 -0
- package/assets/_commonjsHelpers-B4e78b8K-W3E8ocG7.js +1 -0
- package/assets/index-69shuAsh-DF18H7zf.js +1 -0
- package/assets/{index-CoCLR6CX.js → index-BFv-M3PX.js} +5 -5
- package/assets/{index-D3JO_TBD-DrqEk_TF.js → index-BJBOx-Z---hbiLl7B.js} +3 -3
- package/assets/index-BXMy9UIl.js +1 -0
- package/assets/{index-DlfdnOJV.js → index-BitrXVkV.js} +1 -1
- package/assets/index-Bto-kj6R-C0A_3Pwb.js +1 -0
- package/assets/index-C34r0HKa.js +1 -0
- package/assets/index-C8tvsrai.js +21890 -0
- package/assets/{index-JiKw9JSs.js → index-ChvoNxcO.js} +1 -1
- package/assets/{index-CSAsH4Cj-CNgNYeys.js → index-D4z_hbl0-ClNPY1JA.js} +8 -8
- package/assets/index-D5vNLZXv.js +1 -0
- package/assets/index-DSosZ5sh-Ceejs_jv.js +1 -0
- package/assets/index-DTNuphFO-Bf5Ad1xs.js +17 -0
- package/assets/{index-CbTQ5dVq.js → index-DW4dYGSc.js} +1 -1
- package/assets/{index-BdxSFemm-BKC3Ptjg.js → index-DYmn2gQ6-CnjFa625.js} +1 -1
- package/assets/index-DsIu-45t-Bejjlpz4.js +6 -0
- package/assets/index-GdiJDpox.js +1 -0
- package/assets/{index-KGBiLwKE-Kc8k70rJ.js → index-KGBiLwKE-Doz2tX9S.js} +4 -4
- package/assets/index.browser-DdnlJxmD.js +6 -0
- package/assets/inherits_browser-nmOknR35-Bp0mvRSL.js +1 -0
- package/assets/loadCognitoIdentity-C9MQ72ix.js +1 -0
- package/assets/loadSts-Cwi0dSFK.js +1 -0
- package/assets/{normalizeProvider-EC8cbfMc.js → normalizeProvider-CtDY37Q6.js} +1 -1
- package/assets/replService-pU_w3BzQ.js +1 -0
- package/assets/resolveDefaultsModeConfig-Ck7QP6UJ.js +15 -0
- package/assets/util-BsXBaa-K.js +10 -0
- package/assets/util-CNqBjtt6-GUXK7Yxz.js +10 -0
- package/assets/util-DZRIOW0Z-CproX86h.js +1 -0
- package/assets/winston-1qzyIKCb-DxpEu08L.js +37 -0
- package/assets/winston-BAFdjLIs.js +37 -0
- package/assets/winston-CtxF18qc-BCWRradW.js +1 -0
- package/assets/{winston-CPWYjGTE.js → winston-eavTMbBZ.js} +1 -1
- package/index.html +10 -8
- package/package.json +1 -1
- package/assets/AwsJson1_1Protocol-DdIGyZVw.js +0 -1
- package/assets/index-B3X6Xu-W.js +0 -1
- package/assets/index-BEhtjPxy-CBgP3wC4.js +0 -1
- package/assets/index-BjQNf7Nf.js +0 -15
- package/assets/index-Br2Hgz2q.js +0 -1
- package/assets/index-ClUL-R5x.js +0 -1
- package/assets/index-DB9kJcqZ.js +0 -5166
- package/assets/index-DSosZ5sh-_5CimrqR.js +0 -1
- package/assets/index-ZTnKX8xy-BNOF_2FA.js +0 -16952
- package/assets/index-mwiGaNy1-DKNEoPya.js +0 -17
- package/assets/index-q0DdgLUs.js +0 -1
- package/assets/index.browser-ClkxIF_a.js +0 -6
- package/assets/inherits_browser-SFmLU6iN-Bpg6Btaw.js +0 -6
- package/assets/loadCognitoIdentity-D3DCDtA_.js +0 -1
- package/assets/loadSts-De9MppCU.js +0 -1
- package/assets/replService-3_Zm3_kc.js +0 -1
- package/assets/util-COkob34j-BZ2TtJP8.js +0 -10
- package/assets/util-CsY--ROm-CHWqg22i.js +0 -1
- package/assets/winston-BSc_Rh2n-BqL-578K.js +0 -46
- package/assets/winston-C_b7Zy4p.js +0 -46
- package/assets/winston-tM2NjUgP-Cgaf-Nmz.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as B}from"./__vite-browser-external-DLjrMatA.js";import{a as N}from"./_commonjsHelpers-D6-XlEtG.js";const R=N(B);var C={},m;function j(){if(m)return C;m=1,C.byteLength=p,C.toByteArray=y,C.fromByteArray=g;for(var n=[],a=[],A=typeof Uint8Array<"u"?Uint8Array:Array,x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,c=x.length;i<c;++i)n[i]=x[i],a[x.charCodeAt(i)]=i;a[45]=62,a[95]=63;function t(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var o=r.indexOf("=");o===-1&&(o=e);var f=o===e?0:4-o%4;return[o,f]}function p(r){var e=t(r),o=e[0],f=e[1];return(o+f)*3/4-f}function l(r,e,o){return(e+o)*3/4-o}function y(r){var e,o=t(r),f=o[0],d=o[1],s=new A(l(r,f,d)),u=0,w=d>0?f-4:f,F;for(F=0;F<w;F+=4)e=a[r.charCodeAt(F)]<<18|a[r.charCodeAt(F+1)]<<12|a[r.charCodeAt(F+2)]<<6|a[r.charCodeAt(F+3)],s[u++]=e>>16&255,s[u++]=e>>8&255,s[u++]=e&255;return d===2&&(e=a[r.charCodeAt(F)]<<2|a[r.charCodeAt(F+1)]>>4,s[u++]=e&255),d===1&&(e=a[r.charCodeAt(F)]<<10|a[r.charCodeAt(F+1)]<<4|a[r.charCodeAt(F+2)]>>2,s[u++]=e>>8&255,s[u++]=e&255),s}function h(r){return n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[r&63]}function v(r,e,o){for(var f,d=[],s=e;s<o;s+=3)f=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),d.push(h(f));return d.join("")}function g(r){for(var e,o=r.length,f=o%3,d=[],s=16383,u=0,w=o-f;u<w;u+=s)d.push(v(r,u,u+s>w?w:u+s));return f===1?(e=r[o-1],d.push(n[e>>2]+n[e<<4&63]+"==")):f===2&&(e=(r[o-2]<<8)+r[o-1],d.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),d.join("")}return C}var M={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var q;function J(){return q||(q=1,M.read=function(n,a,A,x,i){var c,t,p=i*8-x-1,l=(1<<p)-1,y=l>>1,h=-7,v=A?i-1:0,g=A?-1:1,r=n[a+v];for(v+=g,c=r&(1<<-h)-1,r>>=-h,h+=p;h>0;c=c*256+n[a+v],v+=g,h-=8);for(t=c&(1<<-h)-1,c>>=-h,h+=x;h>0;t=t*256+n[a+v],v+=g,h-=8);if(c===0)c=1-y;else{if(c===l)return t?NaN:(r?-1:1)*(1/0);t=t+Math.pow(2,x),c=c-y}return(r?-1:1)*t*Math.pow(2,c-x)},M.write=function(n,a,A,x,i,c){var t,p,l,y=c*8-i-1,h=(1<<y)-1,v=h>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,r=x?0:c-1,e=x?1:-1,o=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(p=isNaN(a)?1:0,t=h):(t=Math.floor(Math.log(a)/Math.LN2),a*(l=Math.pow(2,-t))<1&&(t--,l*=2),t+v>=1?a+=g/l:a+=g*Math.pow(2,1-v),a*l>=2&&(t++,l/=2),t+v>=h?(p=0,t=h):t+v>=1?(p=(a*l-1)*Math.pow(2,i),t=t+v):(p=a*Math.pow(2,v-1)*Math.pow(2,i),t=0));i>=8;n[A+r]=p&255,r+=e,p/=256,i-=8);for(t=t<<i|p,y+=i;y>0;n[A+r]=t&255,r+=e,t/=256,y-=8);n[A+r-e]|=o*128}),M}function L(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}export{j as a,R as b,L as c,J as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function f(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var o=t.default;if(typeof o=="function"){var e=function r(){return this instanceof r?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};e.prototype=o.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),e}export{l as f,f as l,u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as Ct}from"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";var jr,dr;function V(){return dr||(dr=1,jr=TypeError),jr}var Fr,Er;function Wt(){return Er||(Er=1,Fr=Object),Fr}var Ir,Rr;function ye(){return Rr||(Rr=1,Ir=Error),Ir}var Ur,Mr;function fe(){return Mr||(Mr=1,Ur=EvalError),Ur}var _r,xr;function pe(){return xr||(xr=1,_r=RangeError),_r}var Tr,Br;function le(){return Br||(Br=1,Tr=ReferenceError),Tr}var Nr,Gr;function $t(){return Gr||(Gr=1,Nr=SyntaxError),Nr}var Dr,kr;function ce(){return kr||(kr=1,Dr=URIError),Dr}var Cr,Wr;function se(){return Wr||(Wr=1,Cr=Math.abs),Cr}var $r,Jr;function ge(){return Jr||(Jr=1,$r=Math.floor),$r}var Vr,zr;function be(){return zr||(zr=1,Vr=Math.max),Vr}var qr,Lr;function ve(){return Lr||(Lr=1,qr=Math.min),qr}var Yr,Hr;function me(){return Hr||(Hr=1,Yr=Math.pow),Yr}var Kr,Qr;function Ae(){return Qr||(Qr=1,Kr=Math.round),Kr}var Xr,Zr;function he(){return Zr||(Zr=1,Xr=Number.isNaN||function(r){return r!==r}),Xr}var Y,rt;function Pe(){if(rt)return Y;rt=1;var r=he();return Y=function(e){return r(e)||e===0?e:e<0?-1:1},Y}var tt,et;function Se(){return et||(et=1,tt=Object.getOwnPropertyDescriptor),tt}var H,ot;function B(){if(ot)return H;ot=1;var r=Se();if(r)try{r([],"length")}catch{r=null}return H=r,H}var K,nt;function z(){if(nt)return K;nt=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return K=r,K}var at,it;function Jt(){return it||(it=1,at=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},e=Symbol("test"),a=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var n=42;r[e]=n;for(var p in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var l=Object.getOwnPropertySymbols(r);if(l.length!==1||l[0]!==e||!Object.prototype.propertyIsEnumerable.call(r,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var y=Object.getOwnPropertyDescriptor(r,e);if(y.value!==n||y.enumerable!==!0)return!1}return!0}),at}var Q,ut;function we(){if(ut)return Q;ut=1;var r=typeof Symbol<"u"&&Symbol,e=Jt();return Q=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Q}var yt,ft;function Vt(){return ft||(ft=1,yt=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),yt}var X,pt;function zt(){if(pt)return X;pt=1;var r=Wt();return X=r.getPrototypeOf||null,X}var Z,lt;function Oe(){if(lt)return Z;lt=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,a=Math.max,n="[object Function]",p=function(t,u){for(var f=[],o=0;o<t.length;o+=1)f[o]=t[o];for(var c=0;c<u.length;c+=1)f[c+t.length]=u[c];return f},l=function(t,u){for(var f=[],o=u,c=0;o<t.length;o+=1,c+=1)f[c]=t[o];return f},y=function(t,u){for(var f="",o=0;o<t.length;o+=1)f+=t[o],o+1<t.length&&(f+=u);return f};return Z=function(t){var u=this;if(typeof u!="function"||e.apply(u)!==n)throw new TypeError(r+u);for(var f=l(arguments,1),o,c=function(){if(this instanceof o){var s=u.apply(this,p(f,arguments));return Object(s)===s?s:this}return u.apply(t,p(f,arguments))},j=a(0,u.length-f.length),E=[],d=0;d<j;d++)E[d]="$"+d;if(o=Function("binder","return function ("+y(E,",")+"){ return binder.apply(this,arguments); }")(c),u.prototype){var g=function(){};g.prototype=u.prototype,o.prototype=new g,g.prototype=null}return o},Z}var rr,ct;function N(){if(ct)return rr;ct=1;var r=Oe();return rr=Function.prototype.bind||r,rr}var st,gt;function Ar(){return gt||(gt=1,st=Function.prototype.call),st}var bt,vt;function hr(){return vt||(vt=1,bt=Function.prototype.apply),bt}var mt,At;function je(){return At||(At=1,mt=typeof Reflect<"u"&&Reflect&&Reflect.apply),mt}var tr,ht;function qt(){if(ht)return tr;ht=1;var r=N(),e=hr(),a=Ar(),n=je();return tr=n||r.call(a,e),tr}var er,Pt;function Pr(){if(Pt)return er;Pt=1;var r=N(),e=V(),a=Ar(),n=qt();return er=function(p){if(p.length<1||typeof p[0]!="function")throw new e("a function is required");return n(r,a,p)},er}var or,St;function de(){if(St)return or;St=1;var r=Pr(),e=B(),a;try{a=[].__proto__===Array.prototype}catch(y){if(!y||typeof y!="object"||!("code"in y)||y.code!=="ERR_PROTO_ACCESS")throw y}var n=!!a&&e&&e(Object.prototype,"__proto__"),p=Object,l=p.getPrototypeOf;return or=n&&typeof n.get=="function"?r([n.get]):typeof l=="function"?(function(y){return l(y==null?y:p(y))}):!1,or}var nr,wt;function Lt(){if(wt)return nr;wt=1;var r=Vt(),e=zt(),a=de();return nr=r?function(n){return r(n)}:e?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return e(n)}:a?function(n){return a(n)}:null,nr}var ar,Ot;function Fe(){if(Ot)return ar;Ot=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,a=N();return ar=a.call(r,e),ar}var ir,jt;function Yt(){if(jt)return ir;jt=1;var r,e=Wt(),a=ye(),n=fe(),p=pe(),l=le(),y=$t(),t=V(),u=ce(),f=se(),o=ge(),c=be(),j=ve(),E=me(),d=Ae(),g=Pe(),s=Function,v=function(m){try{return s('"use strict"; return ('+m+").constructor;")()}catch{}},i=B(),h=z(),q=function(){throw new t},Ht=i?(function(){try{return arguments.callee,q}catch{try{return i(arguments,"callee").get}catch{return q}}})():q,R=we()(),A=Lt(),Kt=zt(),Qt=Vt(),Sr=hr(),_=Ar(),U={},Xt=typeof Uint8Array>"u"||!A?r:A(Uint8Array),I={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":R&&A?A([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":R&&A?A(A([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!R||!A?r:A(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":i,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":p,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!R||!A?r:A(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":R&&A?A(""[Symbol.iterator]()):r,"%Symbol%":R?Symbol:r,"%SyntaxError%":y,"%ThrowTypeError%":Ht,"%TypedArray%":Xt,"%TypeError%":t,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":_,"%Function.prototype.apply%":Sr,"%Object.defineProperty%":h,"%Object.getPrototypeOf%":Kt,"%Math.abs%":f,"%Math.floor%":o,"%Math.max%":c,"%Math.min%":j,"%Math.pow%":E,"%Math.round%":d,"%Math.sign%":g,"%Reflect.getPrototypeOf%":Qt};if(A)try{null.error}catch(m){var Zt=A(A(m));I["%Error.prototype%"]=Zt}var re=function m(P){var b;if(P==="%AsyncFunction%")b=v("async function () {}");else if(P==="%GeneratorFunction%")b=v("function* () {}");else if(P==="%AsyncGeneratorFunction%")b=v("async function* () {}");else if(P==="%AsyncGenerator%"){var S=m("%AsyncGeneratorFunction%");S&&(b=S.prototype)}else if(P==="%AsyncIteratorPrototype%"){var O=m("%AsyncGenerator%");O&&A&&(b=A(O.prototype))}return I[P]=b,b},wr={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=N(),G=Fe(),te=x.call(_,Array.prototype.concat),ee=x.call(Sr,Array.prototype.splice),Or=x.call(_,String.prototype.replace),D=x.call(_,String.prototype.slice),oe=x.call(_,RegExp.prototype.exec),ne=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ae=/\\(\\)?/g,ie=function(m){var P=D(m,0,1),b=D(m,-1);if(P==="%"&&b!=="%")throw new y("invalid intrinsic syntax, expected closing `%`");if(b==="%"&&P!=="%")throw new y("invalid intrinsic syntax, expected opening `%`");var S=[];return Or(m,ne,function(O,M,w,k){S[S.length]=w?Or(k,ae,"$1"):M||O}),S},ue=function(m,P){var b=m,S;if(G(wr,b)&&(S=wr[b],b="%"+S[0]+"%"),G(I,b)){var O=I[b];if(O===U&&(O=re(b)),typeof O>"u"&&!P)throw new t("intrinsic "+m+" exists, but is not available. Please file an issue!");return{alias:S,name:b,value:O}}throw new y("intrinsic "+m+" does not exist!")};return ir=function(m,P){if(typeof m!="string"||m.length===0)throw new t("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof P!="boolean")throw new t('"allowMissing" argument must be a boolean');if(oe(/^%?[^%]*%?$/,m)===null)throw new y("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var b=ie(m),S=b.length>0?b[0]:"",O=ue("%"+S+"%",P),M=O.name,w=O.value,k=!1,L=O.alias;L&&(S=L[0],ee(b,te([0,1],L)));for(var C=1,T=!0;C<b.length;C+=1){var F=b[C],W=D(F,0,1),$=D(F,-1);if((W==='"'||W==="'"||W==="`"||$==='"'||$==="'"||$==="`")&&W!==$)throw new y("property names with quotes must have matching quotes");if((F==="constructor"||!T)&&(k=!0),S+="."+F,M="%"+S+"%",G(I,M))w=I[M];else if(w!=null){if(!(F in w)){if(!P)throw new t("base intrinsic for "+m+" exists, but the property is not available.");return}if(i&&C+1>=b.length){var J=i(w,F);T=!!J,T&&"get"in J&&!("originalValue"in J.get)?w=J.get:w=w[F]}else T=G(w,F),w=w[F];T&&!k&&(I[M]=w)}}return w},ir}var ur,dt;function Ee(){if(dt)return ur;dt=1;var r=Yt(),e=Pr(),a=e([r("%String.prototype.indexOf%")]);return ur=function(n,p){var l=r(n,!!p);return typeof l=="function"&&a(n,".prototype.")>-1?e([l]):l},ur}var yr,Ft;function Ie(){if(Ft)return yr;Ft=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,a,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{a=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,a)}catch(i){i!==n&&(e=null)}else e=null;var p=/^\s*class\b/,l=function(i){try{var h=r.call(i);return p.test(h)}catch{return!1}},y=function(i){try{return l(i)?!1:(r.call(i),!0)}catch{return!1}},t=Object.prototype.toString,u="[object Object]",f="[object Function]",o="[object GeneratorFunction]",c="[object HTMLAllCollection]",j="[object HTML document.all class]",E="[object HTMLCollection]",d=typeof Symbol=="function"&&!!Symbol.toStringTag,g=!(0 in[,]),s=function(){return!1};if(typeof document=="object"){var v=document.all;t.call(v)===t.call(document.all)&&(s=function(i){if((g||!i)&&(typeof i>"u"||typeof i=="object"))try{var h=t.call(i);return(h===c||h===j||h===E||h===u)&&i("")==null}catch{}return!1})}return yr=e?function(i){if(s(i))return!0;if(!i||typeof i!="function"&&typeof i!="object")return!1;try{e(i,null,a)}catch(h){if(h!==n)return!1}return!l(i)&&y(i)}:function(i){if(s(i))return!0;if(!i||typeof i!="function"&&typeof i!="object")return!1;if(d)return y(i);if(l(i))return!1;var h=t.call(i);return h!==f&&h!==o&&!/^\[object HTML/.test(h)?!1:y(i)},yr}var fr,Et;function Re(){if(Et)return fr;Et=1;var r=Ie(),e=Object.prototype.toString,a=Object.prototype.hasOwnProperty,n=function(t,u,f){for(var o=0,c=t.length;o<c;o++)a.call(t,o)&&(f==null?u(t[o],o,t):u.call(f,t[o],o,t))},p=function(t,u,f){for(var o=0,c=t.length;o<c;o++)f==null?u(t.charAt(o),o,t):u.call(f,t.charAt(o),o,t)},l=function(t,u,f){for(var o in t)a.call(t,o)&&(f==null?u(t[o],o,t):u.call(f,t[o],o,t))};function y(t){return e.call(t)==="[object Array]"}return fr=function(t,u,f){if(!r(u))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=f),y(t)?n(t,u,o):typeof t=="string"?p(t,u,o):l(t,u,o)},fr}var It,Rt;function Ue(){return Rt||(Rt=1,It=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),It}var pr,Ut;function Me(){if(Ut)return pr;Ut=1;var r=Ue(),e=typeof globalThis>"u"?Ct:globalThis;return pr=function(){for(var a=[],n=0;n<r.length;n++)typeof e[r[n]]=="function"&&(a[a.length]=r[n]);return a},pr}var Mt={exports:{}},lr,_t;function _e(){if(_t)return lr;_t=1;var r=z(),e=$t(),a=V(),n=B();return lr=function(p,l,y){if(!p||typeof p!="object"&&typeof p!="function")throw new a("`obj` must be an object or a function`");if(typeof l!="string"&&typeof l!="symbol")throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new a("`loose`, if provided, must be a boolean");var t=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,c=!!n&&n(p,l);if(r)r(p,l,{configurable:f===null&&c?c.configurable:!f,enumerable:t===null&&c?c.enumerable:!t,value:y,writable:u===null&&c?c.writable:!u});else if(o||!t&&!u&&!f)p[l]=y;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},lr}var cr,xt;function xe(){if(xt)return cr;xt=1;var r=z(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},cr=e,cr}var sr,Tt;function Te(){if(Tt)return sr;Tt=1;var r=Yt(),e=_e(),a=xe()(),n=B(),p=V(),l=r("%Math.floor%");return sr=function(y,t){if(typeof y!="function")throw new p("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||l(t)!==t)throw new p("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],f=!0,o=!0;if("length"in y&&n){var c=n(y,"length");c&&!c.configurable&&(f=!1),c&&!c.writable&&(o=!1)}return(f||o||!u)&&(a?e(y,"length",t,!0,!0):e(y,"length",t)),y},sr}var gr,Bt;function Be(){if(Bt)return gr;Bt=1;var r=N(),e=hr(),a=qt();return gr=function(){return a(r,e,arguments)},gr}var Nt;function Ne(){return Nt||(Nt=1,(function(r){var e=Te(),a=z(),n=Pr(),p=Be();r.exports=function(l){var y=n(arguments),t=l.length-(arguments.length-1);return e(y,1+(t>0?t:0),!0)},a?a(r.exports,"apply",{value:p}):r.exports.apply=p})(Mt)),Mt.exports}var br,Gt;function Ge(){if(Gt)return br;Gt=1;var r=Jt();return br=function(){return r()&&!!Symbol.toStringTag},br}var vr,Dt;function De(){if(Dt)return vr;Dt=1;var r=Re(),e=Me(),a=Ne(),n=Ee(),p=B(),l=Lt(),y=n("Object.prototype.toString"),t=Ge()(),u=typeof globalThis>"u"?Ct:globalThis,f=e(),o=n("String.prototype.slice"),c=n("Array.prototype.indexOf",!0)||function(g,s){for(var v=0;v<g.length;v+=1)if(g[v]===s)return v;return-1},j={__proto__:null};t&&p&&l?r(f,function(g){var s=new u[g];if(Symbol.toStringTag in s&&l){var v=l(s),i=p(v,Symbol.toStringTag);if(!i&&v){var h=l(v);i=p(h,Symbol.toStringTag)}j["$"+g]=a(i.get)}}):r(f,function(g){var s=new u[g],v=s.slice||s.set;v&&(j["$"+g]=a(v))});var E=function(g){var s=!1;return r(j,function(v,i){if(!s)try{"$"+v(g)===i&&(s=o(i,1))}catch{}}),s},d=function(g){var s=!1;return r(j,function(v,i){if(!s)try{v(g),s=o(i,1)}catch{}}),s};return vr=function(g){if(!g||typeof g!="object")return!1;if(!t){var s=o(y(g),8,-1);return c(f,s)>-1?s:s!=="Object"?!1:d(g)}return p?E(g):null},vr}var mr,kt;function Ce(){if(kt)return mr;kt=1;var r=De();return mr=function(e){return!!r(e)},mr}export{B as D,Ee as F,Ce as G,V as J,De as N,Ge as U,Lt as Y,Fe as w};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{
|
|
1
|
+
import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{a as Ot,r as Nt,c as Kt,b as kt}from"./_commonjs-dynamic-modules-DkOKMH7F.js";import"./__vite-browser-external-DLjrMatA.js";/*!
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/var
|
|
4
|
+
*/var Vn=(function(){function o(r){var e=r||{},a=e.ValidationData,s=e.Username,f=e.Password,u=e.AuthParameters,l=e.ClientMetadata;this.validationData=a||{},this.authParameters=u||{},this.clientMetadata=l||{},this.username=s,this.password=f}var t=o.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},o})(),Ae={},Ue,Je;function qt(){if(Je)return Ue;Je=1;var o={}.toString;return Ue=Array.isArray||function(t){return o.call(t)=="[object Array]"},Ue}/*!
|
|
5
5
|
* The buffer module from node.js, for the browser.
|
|
6
6
|
*
|
|
7
7
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
@@ -46,13 +46,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
46
46
|
*/var Z={},An=(function(){function o(){}return o.setItem=function(r,e){return Z[r]=e,Z[r]},o.getItem=function(r){return Object.prototype.hasOwnProperty.call(Z,r)?Z[r]:void 0},o.removeItem=function(r){return delete Z[r]},o.clear=function(){return Z={},Z},o})(),At=(function(){function o(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch{this.storageWindow=An}}var t=o.prototype;return t.getStorage=function(){return this.storageWindow},o})();/*!
|
|
47
47
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
48
48
|
* SPDX-License-Identifier: Apache-2.0
|
|
49
|
-
*/var Un=typeof navigator<"u",lt=Un?Ct.isReactNative?"react-native":navigator.userAgent:"nodejs",pt=(function(){function o(r){if(r==null||r.Username==null||r.Pool==null)throw new Error("Username and Pool information are required.");this.username=r.Username||"",this.pool=r.Pool,this.Session=null,this.client=r.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=r.Storage||new At().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=o.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,a){var s=this,f=e.getAuthParameters();f.USERNAME=this.username;var u=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),l={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:u};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",l,function(p,d){if(p)return a.onFailure(p);var y=d.ChallengeName,S=d.ChallengeParameters;return y==="CUSTOM_CHALLENGE"?(s.Session=d.Session,a.customChallenge(S)):(s.signInUserSession=s.getCognitoUserSession(d.AuthenticationResult),s.cacheTokens(),a.onSuccess(s.signInUserSession))})},t.authenticateUser=function(e,a){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(e,a):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(e,a):a.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,a){var s=this,f=new X(this.pool.getUserPoolName()),u=new ct,l,p,d={};this.deviceKey!=null&&(d.DEVICE_KEY=this.deviceKey),d.USERNAME=this.username,f.getLargeAValue(function(y,S){y&&a.onFailure(y),d.SRP_A=S.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(d.CHALLENGE_NAME="SRP_A");var U=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),A={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:d,ClientMetadata:U};s.getUserContextData(s.username)&&(A.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",A,function(C,D){if(C)return a.onFailure(C);var T=D.ChallengeParameters;s.username=T.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",l=new w(T.SRP_B,16),p=new w(T.SALT,16),s.getCachedDeviceKeyAndPassword(),f.getPasswordAuthenticationKey(s.username,e.getPassword(),l,p,function(P,j){P&&a.onFailure(P);var k=u.getNowString(),Y=I.Buffer.concat([I.Buffer.from(s.pool.getUserPoolName(),"utf8"),I.Buffer.from(s.username,"utf8"),I.Buffer.from(T.SECRET_BLOCK,"base64"),I.Buffer.from(k,"utf8")]),W=new ce.Sha256(j);W.update(Y);var te=W.digestSync(),L=I.Buffer.from(te).toString("base64"),O={};O.USERNAME=s.username,O.PASSWORD_CLAIM_SECRET_BLOCK=T.SECRET_BLOCK,O.TIMESTAMP=k,O.PASSWORD_CLAIM_SIGNATURE=L,s.deviceKey!=null&&(O.DEVICE_KEY=s.deviceKey);var J=function($,ne){return s.client.request("RespondToAuthChallenge",$,function(G,Ce){return G&&G.code==="ResourceNotFoundException"&&G.message.toLowerCase().indexOf("device")!==-1?(O.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),J($,ne)):ne(G,Ce)})},z={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:O,Session:D.Session,ClientMetadata:U};s.getUserContextData()&&(z.UserContextData=s.getUserContextData()),J(z,function(re,$){return re?a.onFailure(re):s.authenticateUserInternal($,f,a)})})})})},t.authenticateUserPlainUsernamePassword=function(e,a){var s=this,f={};if(f.USERNAME=this.username,f.PASSWORD=e.getPassword(),!f.PASSWORD){a.onFailure(new Error("PASSWORD parameter is required"));return}var u=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(f.DEVICE_KEY=this.deviceKey);var l=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),p={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:l};this.getUserContextData(this.username)&&(p.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",p,function(d,y){return d?a.onFailure(d):s.authenticateUserInternal(y,u,a)})},t.authenticateUserInternal=function(e,a,s){var f=this,u=e.ChallengeName,l=e.ChallengeParameters;if(u==="SMS_MFA")return this.Session=e.Session,s.mfaRequired(u,l);if(u==="SELECT_MFA_TYPE")return this.Session=e.Session,s.selectMFAType(u,l);if(u==="MFA_SETUP")return this.Session=e.Session,s.mfaSetup(u,l);if(u==="SOFTWARE_TOKEN_MFA")return this.Session=e.Session,s.totpRequired(u,l);if(u==="CUSTOM_CHALLENGE")return this.Session=e.Session,s.customChallenge(l);if(u==="NEW_PASSWORD_REQUIRED"){this.Session=e.Session;var p=null,d=null,y=[],S=a.getNewPasswordRequiredChallengeUserAttributePrefix();if(l&&(p=JSON.parse(e.ChallengeParameters.userAttributes),d=JSON.parse(e.ChallengeParameters.requiredAttributes)),d)for(var U=0;U<d.length;U++)y[U]=d[U].substr(S.length);return s.newPasswordRequired(p,y)}if(u==="DEVICE_SRP_AUTH"){this.Session=e.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=u,this.cacheTokens();var A=e.AuthenticationResult.NewDeviceMetadata;if(A==null)return s.onSuccess(this.signInUserSession);a.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return s.onFailure(C);var D={Salt:I.Buffer.from(a.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(a.getVerifierDevices(),"hex").toString("base64")};f.verifierDevices=D.PasswordVerifier,f.deviceGroupKey=A.DeviceGroupKey,f.randomPassword=a.getRandomPassword(),f.client.request("ConfirmDevice",{DeviceKey:A.DeviceKey,AccessToken:f.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?s.onFailure(T):(f.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,f.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?s.onSuccess(f.signInUserSession,P.UserConfirmationNecessary):s.onSuccess(f.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,a,s,f){var u=this;if(!e)return s.onFailure(new Error("New password is required."));var l=new X(this.pool.getUserPoolName()),p=l.getNewPasswordRequiredChallengeUserAttributePrefix(),d={};a&&Object.keys(a).forEach(function(S){d[p+S]=a[S]}),d.NEW_PASSWORD=e,d.USERNAME=this.username;var y={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:d,Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(y.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",y,function(S,U){return S?s.onFailure(S):u.authenticateUserInternal(U,l,s)})},t.getDeviceResponse=function(e,a){var s=this,f=new X(this.deviceGroupKey),u=new ct,l={};l.USERNAME=this.username,l.DEVICE_KEY=this.deviceKey,f.getLargeAValue(function(p,d){p&&e.onFailure(p),l.SRP_A=d.toString(16);var y={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:l,ClientMetadata:a,Session:s.Session};s.getUserContextData()&&(y.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",y,function(S,U){if(S)return e.onFailure(S);var A=U.ChallengeParameters,C=new w(A.SRP_B,16),D=new w(A.SALT,16);f.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,C,D,function(T,P){if(T)return e.onFailure(T);var j=u.getNowString(),k=I.Buffer.concat([I.Buffer.from(s.deviceGroupKey,"utf8"),I.Buffer.from(s.deviceKey,"utf8"),I.Buffer.from(A.SECRET_BLOCK,"base64"),I.Buffer.from(j,"utf8")]),Y=new ce.Sha256(P);Y.update(k);var W=Y.digestSync(),te=I.Buffer.from(W).toString("base64"),L={};L.USERNAME=s.username,L.PASSWORD_CLAIM_SECRET_BLOCK=A.SECRET_BLOCK,L.TIMESTAMP=j,L.PASSWORD_CLAIM_SIGNATURE=te,L.DEVICE_KEY=s.deviceKey;var O={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:L,Session:U.Session};s.getUserContextData()&&(O.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",O,function(J,z){return J?e.onFailure(J):(s.signInUserSession=s.getCognitoUserSession(z.AuthenticationResult),s.cacheTokens(),e.onSuccess(s.signInUserSession))})})})})},t.confirmRegistration=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",u,function(l){return l?s(l,null):s(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,a,s){var f=this,u={};u.USERNAME=this.username,u.ANSWER=e;var l=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(u.DEVICE_KEY=this.deviceKey);var p={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:u,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(p.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",p,function(d,y){return d?a.onFailure(d):f.authenticateUserInternal(y,l,a)})},t.sendMFACode=function(e,a,s,f){var u=this,l={};l.USERNAME=this.username,l.SMS_MFA_CODE=e;var p=s||"SMS_MFA";p==="SOFTWARE_TOKEN_MFA"&&(l.SOFTWARE_TOKEN_MFA_CODE=e),this.deviceKey!=null&&(l.DEVICE_KEY=this.deviceKey);var d={ChallengeName:p,ChallengeResponses:l,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(y,S){if(y)return a.onFailure(y);var U=S.ChallengeName;if(U==="DEVICE_SRP_AUTH"){u.getDeviceResponse(a);return}if(u.signInUserSession=u.getCognitoUserSession(S.AuthenticationResult),u.cacheTokens(),S.AuthenticationResult.NewDeviceMetadata==null)return a.onSuccess(u.signInUserSession);var A=new X(u.pool.getUserPoolName());A.generateHashDevice(S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,S.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return a.onFailure(C);var D={Salt:I.Buffer.from(A.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(A.getVerifierDevices(),"hex").toString("base64")};u.verifierDevices=D.PasswordVerifier,u.deviceGroupKey=S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,u.randomPassword=A.getRandomPassword(),u.client.request("ConfirmDevice",{DeviceKey:S.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:u.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?a.onFailure(T):(u.deviceKey=S.AuthenticationResult.NewDeviceMetadata.DeviceKey,u.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?a.onSuccess(u.signInUserSession,P.UserConfirmationNecessary):a.onSuccess(u.signInUserSession))})})})},t.changePassword=function(e,a,s,f){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:f},function(u){return u?s(u,null):s(null,"SUCCESS")})},t.enableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};a.push(s),this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?e(f,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s(f,null):s(null,"SUCCESS")})},t.disableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[];this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e(s,null):e(null,"SUCCESS")})},t.deleteUser=function(e,a){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:a},function(f){return f?e(f,null):(s.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,a,s){var f=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return a(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:s},function(u,l){return u?a(u,null):f.getUserData(function(){return a(null,"SUCCESS",l)},{bypassCache:!0})})},t.getUserAttributes=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){if(a)return e(a,null);for(var f=[],u=0;u<s.UserAttributes.length;u++){var l={Name:s.UserAttributes[u].Name,Value:s.UserAttributes[u].Value},p=new Cn(l);f.push(p)}return e(null,f)})},t.getMFAOptions=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){return a?e(a,null):e(null,s.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var a=this;return e===void 0&&(e={}),new Promise(function(s){var f=a.signInUserSession.getRefreshToken();f&&f.getToken()?a.refreshSession(f,s,e.clientMetadata):s()})},t.getUserData=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var f=this.getUserDataFromCache();if(!f){this.fetchUserData().then(function(u){e(null,u)}).catch(e);return}if(this.isFetchUserDataAndTokenRequired(a)){this.fetchUserData().then(function(u){return s.refreshSessionIfPossible(a).then(function(){return u})}).then(function(u){return e(null,u)}).catch(e);return}try{e(null,JSON.parse(f));return}catch(u){this.clearCachedUserData(),e(u,null);return}},t.getUserDataFromCache=function(){var e=this.storage.getItem(this.userDataKey);return e},t.isFetchUserDataAndTokenRequired=function(e){var a=e||{},s=a.bypassCache,f=s===void 0?!1:s;return f},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(a){return e.cacheUserData(a),a})},t.deleteAttributes=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return a(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?a(f,null):s.getUserData(function(){return a(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.client.request("ResendConfirmationCode",s,function(f,u){return f?e(f,null):e(null,u)})},t.getSession=function(e,a){if(a===void 0&&(a={}),this.username==null)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,f=s+".idToken",u=s+".accessToken",l=s+".refreshToken",p=s+".clockDrift";if(this.storage.getItem(f)){var d=new ut({IdToken:this.storage.getItem(f)}),y=new at({AccessToken:this.storage.getItem(u)}),S=new ft({RefreshToken:this.storage.getItem(l)}),U=parseInt(this.storage.getItem(p),0)||0,A={IdToken:d,AccessToken:y,RefreshToken:S,ClockDrift:U},C=new ht(A);if(C.isValid())return this.signInUserSession=C,e(null,this.signInUserSession);if(!S.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(S,e,a.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,a,s){var f=this,u=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(a):a,l={};l.REFRESH_TOKEN=e.getToken();var p="CognitoIdentityServiceProvider."+this.pool.getClientId(),d=p+".LastAuthUser";if(this.storage.getItem(d)){this.username=this.storage.getItem(d);var y=p+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(y),l.DEVICE_KEY=this.deviceKey}var S={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,ClientMetadata:s};this.getUserContextData()&&(S.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",S,function(U,A){if(U)return U.code==="NotAuthorizedException"&&f.clearCachedUser(),u(U,null);if(A){var C=A.AuthenticationResult;return Object.prototype.hasOwnProperty.call(C,"RefreshToken")||(C.RefreshToken=e.getToken()),f.signInUserSession=f.getCognitoUserSession(C),f.cacheTokens(),u(null,f.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+"."+this.username+".clockDrift",l=e+".LastAuthUser";this.storage.setItem(a,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(f,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(u,""+this.signInUserSession.getClockDrift()),this.storage.setItem(l,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.setItem(a,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(f,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.getItem(a)&&(this.deviceKey=this.storage.getItem(a),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(f))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+".LastAuthUser",l=e+"."+this.username+".clockDrift";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f),this.storage.removeItem(u),this.storage.removeItem(l)},t.getCognitoUserSession=function(e){var a=new ut(e),s=new at(e),f=new ft(e),u={IdToken:a,AccessToken:s,RefreshToken:f};return new ht(u)},t.forgotPassword=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(f,u){return f?e.onFailure(f):typeof e.inputVerificationCode=="function"?e.inputVerificationCode(u):e.onSuccess(u)})},t.confirmPassword=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",u,function(l){return l?s.onFailure(l):s.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(f,u){return f?a.onFailure(f):typeof a.inputVerificationCode=="function"?a.inputVerificationCode(u):a.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s.onFailure(f):s.onSuccess("SUCCESS")})},t.getDevice=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(a,s){return a?e.onFailure(a):e.onSuccess(s)})},t.forgetSpecificDevice=function(e,a){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(s){return s?a.onFailure(s):a.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var a=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(f){return a.deviceKey=null,a.deviceGroupKey=null,a.randomPassword=null,a.clearCachedDeviceKeyAndPassword(),e.onSuccess(f)}})},t.setDeviceStatusRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.listDevices=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var f={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};a&&(f.PaginationToken=a),this.client.request("ListDevices",f,function(u,l){return u?s.onFailure(u):s.onSuccess(l)})},t.globalSignOut=function(e){var a=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e.onFailure(s):(a.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var a=this;if(!e||typeof e!="function"){this.cleanClientData();return}this.getSession(function(s,f){if(s)return e(s);a.revokeTokens(function(u){a.cleanClientData(),e(u)})})},t.revokeTokens=function(e){if(e===void 0&&(e=function(){}),typeof e!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var a=new Error("User is not authenticated");return e(a)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return e(s)}var f=this.signInUserSession.getRefreshToken().getToken(),u=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(u)&&f)return this.revokeToken({token:f,callback:e});e()},t.isSessionRevocable=function(e){if(e&&typeof e.decodePayload=="function")try{var a=e.decodePayload(),s=a.origin_jti;return!!s}catch{}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var a=e.token,s=e.callback;this.client.requestWithRetry("RevokeToken",{Token:a,ClientId:this.pool.getClientId()},function(f){if(f)return s(f);s()})},t.sendMFASelectionAnswer=function(e,a){var s=this,f={};f.USERNAME=this.username,f.ANSWER=e;var u={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:f,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(l,p){if(l)return a.onFailure(l);if(s.Session=p.Session,e==="SMS_MFA")return a.mfaRequired(p.ChallengeName,p.ChallengeParameters);if(e==="SOFTWARE_TOKEN_MFA")return a.totpRequired(p.ChallengeName,p.ChallengeParameters)})},t.getUserContextData=function(){var e=this.pool;return e.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var a=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,f){return s?e.onFailure(s):e.associateSecretCode(f.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,f){return s?e.onFailure(s):(a.Session=f.Session,e.associateSecretCode(f.SecretCode))})},t.verifySoftwareToken=function(e,a,s){var f=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:a},function(u,l){return u?s.onFailure(u):s.onSuccess(l)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:a},function(u,l){if(u)return s.onFailure(u);f.Session=l.Session;var p={};p.USERNAME=f.username;var d={ChallengeName:"MFA_SETUP",ClientId:f.pool.getClientId(),ChallengeResponses:p,Session:f.Session};f.getUserContextData()&&(d.UserContextData=f.getUserContextData()),f.client.request("RespondToAuthChallenge",d,function(y,S){return y?s.onFailure(y):(f.signInUserSession=f.getCognitoUserSession(S.AuthenticationResult),f.cacheTokens(),s.onSuccess(f.signInUserSession))})})},o})();function En(o,t){return t=t||{},new Promise(function(r,e){var a=new XMLHttpRequest,s=[],f=[],u={},l=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:l,headers:{keys:function(){return s},entries:function(){return f},get:function(d){return u[d.toLowerCase()]},has:function(d){return d.toLowerCase()in u}}}};for(var p in a.open(t.method||"get",o,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,y,S){s.push(y=y.toLowerCase()),f.push([y,S]),u[y]=u[y]?u[y]+","+S:S}),r(l())},a.onerror=e,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(p,t.headers[p]);a.send(t.body||null)})}const Tn=Object.freeze(Object.defineProperty({__proto__:null,default:En},Symbol.toStringTag,{value:"Module"})),gt=Oe(Tn);var xe,dt;function Dn(){return dt||(dt=1,xe=self.fetch||(self.fetch=gt.default||gt)),xe}Dn();function K(){}K.prototype.userAgent=yn();var Xn=function(t){t&&(K.prototype.userAgent&&!K.prototype.userAgent.includes(t)&&(K.prototype.userAgent=K.prototype.userAgent.concat(" ",t)),(!K.prototype.userAgent||K.prototype.userAgent==="")&&(K.prototype.userAgent=t))},xn=function(t){var r=K.category?" "+K.category:"",e=K.framework?" framework/"+K.framework:"",a=""+K.prototype.userAgent+r+e;return a};function In(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,pe(o,t)}function be(o){var t=typeof Map=="function"?new Map:void 0;return be=function(e){if(e===null||!Rn(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return _n(e,arguments,Me(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),pe(a,e)},be(o)}function _n(o,t,r){if(Ut())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var a=new(o.bind.apply(o,e));return r&&pe(a,r.prototype),a}function Ut(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!o})()}function Rn(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}}function pe(o,t){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},pe(o,t)}function Me(o){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Me(o)}var Pn=(function(o){function t(r,e,a,s){var f;return f=o.call(this,r)||this,f.code=e,f.name=a,f.statusCode=s,f}return In(t,o),t})(be(Error)),Fn=(function(){function o(r,e,a){this.endpoint=e||"https://cognito-idp."+r+".amazonaws.com/";var s=a||{},f=s.credentials;this.fetchOptions=f?{credentials:f}:{}}var t=o.prototype;return t.promisifyRequest=function(e,a){var s=this;return new Promise(function(f,u){s.request(e,a,function(l,p){l?u(new Pn(l.message,l.code,l.name,l.statusCode)):f(p)})})},t.requestWithRetry=function(e,a,s){var f=this,u=5*1e3;Mn(function(l){return new Promise(function(p,d){f.request(e,l,function(y,S){y?d(y):p(S)})})},[a],u).then(function(l){return s(null,l)}).catch(function(l){return s(l)})},t.request=function(e,a,s){var f={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":xn(),"Cache-Control":"no-store"},u=Object.assign({},this.fetchOptions,{headers:f,method:"POST",mode:"cors",body:JSON.stringify(a)}),l;fetch(this.endpoint,u).then(function(p){return l=p,p},function(p){throw p instanceof TypeError?new Error("Network error"):p}).then(function(p){return p.json().catch(function(){return{}})}).then(function(p){if(l.ok)return s(null,p);var d=(p.__type||p.code).split("#").pop(),y=new Error(p.message||p.Message||null);return y.name=d,y.code=d,s(y)}).catch(function(p){if(l&&l.headers&&l.headers.get("x-amzn-errortype"))try{var d=l.headers.get("x-amzn-errortype").split(":")[0],y=new Error(l.status?l.status.toString():null);return y.code=d,y.name=d,y.statusCode=l.status,s(y)}catch{return s(p)}else p instanceof Error&&p.message==="Network error"&&(p.code="NetworkError");return s(p)})},o})(),Se={debug:function(){}},Bn=function(t){var r="nonRetryable";return t&&t[r]};function Et(o,t,r,e){if(e===void 0&&(e=1),typeof o!="function")throw Error("functionToRetry must be a function");return Se.debug(o.name+" attempt #"+e+" with args: "+JSON.stringify(t)),o.apply(void 0,t).catch(function(a){if(Se.debug("error on "+o.name,a),Bn(a))throw Se.debug(o.name+" non retryable error",a),a;var s=r(e,t,a);if(Se.debug(o.name+" retrying in "+s+" ms"),s!==!1)return new Promise(function(f){return setTimeout(f,s)}).then(function(){return Et(o,t,r,e+1)});throw a})}function bn(o){var t=100,r=100;return function(e){var a=Math.pow(2,e)*t+r*Math.random();return a>o?!1:a}}function Mn(o,t,r){return Et(o,t,bn(r))}/*!
|
|
49
|
+
*/var Un=typeof navigator<"u",lt=Un?Ct.isReactNative?"react-native":navigator.userAgent:"nodejs",pt=(function(){function o(r){if(r==null||r.Username==null||r.Pool==null)throw new Error("Username and Pool information are required.");this.username=r.Username||"",this.pool=r.Pool,this.Session=null,this.client=r.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=r.Storage||new At().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=o.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,a){var s=this,f=e.getAuthParameters();f.USERNAME=this.username;var u=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),l={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:u};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",l,function(p,d){if(p)return a.onFailure(p);var y=d.ChallengeName,S=d.ChallengeParameters;return y==="CUSTOM_CHALLENGE"?(s.Session=d.Session,a.customChallenge(S)):(s.signInUserSession=s.getCognitoUserSession(d.AuthenticationResult),s.cacheTokens(),a.onSuccess(s.signInUserSession))})},t.authenticateUser=function(e,a){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(e,a):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(e,a):a.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,a){var s=this,f=new X(this.pool.getUserPoolName()),u=new ct,l,p,d={};this.deviceKey!=null&&(d.DEVICE_KEY=this.deviceKey),d.USERNAME=this.username,f.getLargeAValue(function(y,S){y&&a.onFailure(y),d.SRP_A=S.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(d.CHALLENGE_NAME="SRP_A");var U=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),A={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:d,ClientMetadata:U};s.getUserContextData(s.username)&&(A.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",A,function(C,D){if(C)return a.onFailure(C);var T=D.ChallengeParameters;s.username=T.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",l=new w(T.SRP_B,16),p=new w(T.SALT,16),s.getCachedDeviceKeyAndPassword(),f.getPasswordAuthenticationKey(s.username,e.getPassword(),l,p,function(P,j){P&&a.onFailure(P);var k=u.getNowString(),Y=I.Buffer.concat([I.Buffer.from(s.pool.getUserPoolName(),"utf8"),I.Buffer.from(s.username,"utf8"),I.Buffer.from(T.SECRET_BLOCK,"base64"),I.Buffer.from(k,"utf8")]),W=new ce.Sha256(j);W.update(Y);var te=W.digestSync(),L=I.Buffer.from(te).toString("base64"),O={};O.USERNAME=s.username,O.PASSWORD_CLAIM_SECRET_BLOCK=T.SECRET_BLOCK,O.TIMESTAMP=k,O.PASSWORD_CLAIM_SIGNATURE=L,s.deviceKey!=null&&(O.DEVICE_KEY=s.deviceKey);var J=function($,ne){return s.client.request("RespondToAuthChallenge",$,function(G,Ce){return G&&G.code==="ResourceNotFoundException"&&G.message.toLowerCase().indexOf("device")!==-1?(O.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),J($,ne)):ne(G,Ce)})},z={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:O,Session:D.Session,ClientMetadata:U};s.getUserContextData()&&(z.UserContextData=s.getUserContextData()),J(z,function(re,$){return re?a.onFailure(re):s.authenticateUserInternal($,f,a)})})})})},t.authenticateUserPlainUsernamePassword=function(e,a){var s=this,f={};if(f.USERNAME=this.username,f.PASSWORD=e.getPassword(),!f.PASSWORD){a.onFailure(new Error("PASSWORD parameter is required"));return}var u=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(f.DEVICE_KEY=this.deviceKey);var l=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),p={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:l};this.getUserContextData(this.username)&&(p.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",p,function(d,y){return d?a.onFailure(d):s.authenticateUserInternal(y,u,a)})},t.authenticateUserInternal=function(e,a,s){var f=this,u=e.ChallengeName,l=e.ChallengeParameters;if(u==="SMS_MFA")return this.Session=e.Session,s.mfaRequired(u,l);if(u==="SELECT_MFA_TYPE")return this.Session=e.Session,s.selectMFAType(u,l);if(u==="MFA_SETUP")return this.Session=e.Session,s.mfaSetup(u,l);if(u==="SOFTWARE_TOKEN_MFA")return this.Session=e.Session,s.totpRequired(u,l);if(u==="CUSTOM_CHALLENGE")return this.Session=e.Session,s.customChallenge(l);if(u==="NEW_PASSWORD_REQUIRED"){this.Session=e.Session;var p=null,d=null,y=[],S=a.getNewPasswordRequiredChallengeUserAttributePrefix();if(l&&(p=JSON.parse(e.ChallengeParameters.userAttributes),d=JSON.parse(e.ChallengeParameters.requiredAttributes)),d)for(var U=0;U<d.length;U++)y[U]=d[U].substr(S.length);return s.newPasswordRequired(p,y)}if(u==="DEVICE_SRP_AUTH"){this.Session=e.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=u,this.cacheTokens();var A=e.AuthenticationResult.NewDeviceMetadata;if(A==null)return s.onSuccess(this.signInUserSession);a.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return s.onFailure(C);var D={Salt:I.Buffer.from(a.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(a.getVerifierDevices(),"hex").toString("base64")};f.verifierDevices=D.PasswordVerifier,f.deviceGroupKey=A.DeviceGroupKey,f.randomPassword=a.getRandomPassword(),f.client.request("ConfirmDevice",{DeviceKey:A.DeviceKey,AccessToken:f.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?s.onFailure(T):(f.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,f.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?s.onSuccess(f.signInUserSession,P.UserConfirmationNecessary):s.onSuccess(f.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,a,s,f){var u=this;if(!e)return s.onFailure(new Error("New password is required."));var l=new X(this.pool.getUserPoolName()),p=l.getNewPasswordRequiredChallengeUserAttributePrefix(),d={};a&&Object.keys(a).forEach(function(S){d[p+S]=a[S]}),d.NEW_PASSWORD=e,d.USERNAME=this.username;var y={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:d,Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(y.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",y,function(S,U){return S?s.onFailure(S):u.authenticateUserInternal(U,l,s)})},t.getDeviceResponse=function(e,a){var s=this,f=new X(this.deviceGroupKey),u=new ct,l={};l.USERNAME=this.username,l.DEVICE_KEY=this.deviceKey,f.getLargeAValue(function(p,d){p&&e.onFailure(p),l.SRP_A=d.toString(16);var y={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:l,ClientMetadata:a,Session:s.Session};s.getUserContextData()&&(y.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",y,function(S,U){if(S)return e.onFailure(S);var A=U.ChallengeParameters,C=new w(A.SRP_B,16),D=new w(A.SALT,16);f.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,C,D,function(T,P){if(T)return e.onFailure(T);var j=u.getNowString(),k=I.Buffer.concat([I.Buffer.from(s.deviceGroupKey,"utf8"),I.Buffer.from(s.deviceKey,"utf8"),I.Buffer.from(A.SECRET_BLOCK,"base64"),I.Buffer.from(j,"utf8")]),Y=new ce.Sha256(P);Y.update(k);var W=Y.digestSync(),te=I.Buffer.from(W).toString("base64"),L={};L.USERNAME=s.username,L.PASSWORD_CLAIM_SECRET_BLOCK=A.SECRET_BLOCK,L.TIMESTAMP=j,L.PASSWORD_CLAIM_SIGNATURE=te,L.DEVICE_KEY=s.deviceKey;var O={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:L,Session:U.Session};s.getUserContextData()&&(O.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",O,function(J,z){return J?e.onFailure(J):(s.signInUserSession=s.getCognitoUserSession(z.AuthenticationResult),s.cacheTokens(),e.onSuccess(s.signInUserSession))})})})})},t.confirmRegistration=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",u,function(l){return l?s(l,null):s(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,a,s){var f=this,u={};u.USERNAME=this.username,u.ANSWER=e;var l=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(u.DEVICE_KEY=this.deviceKey);var p={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:u,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(p.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",p,function(d,y){return d?a.onFailure(d):f.authenticateUserInternal(y,l,a)})},t.sendMFACode=function(e,a,s,f){var u=this,l={};l.USERNAME=this.username,l.SMS_MFA_CODE=e;var p=s||"SMS_MFA";p==="SOFTWARE_TOKEN_MFA"&&(l.SOFTWARE_TOKEN_MFA_CODE=e),this.deviceKey!=null&&(l.DEVICE_KEY=this.deviceKey);var d={ChallengeName:p,ChallengeResponses:l,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(y,S){if(y)return a.onFailure(y);var U=S.ChallengeName;if(U==="DEVICE_SRP_AUTH"){u.getDeviceResponse(a);return}if(u.signInUserSession=u.getCognitoUserSession(S.AuthenticationResult),u.cacheTokens(),S.AuthenticationResult.NewDeviceMetadata==null)return a.onSuccess(u.signInUserSession);var A=new X(u.pool.getUserPoolName());A.generateHashDevice(S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,S.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return a.onFailure(C);var D={Salt:I.Buffer.from(A.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(A.getVerifierDevices(),"hex").toString("base64")};u.verifierDevices=D.PasswordVerifier,u.deviceGroupKey=S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,u.randomPassword=A.getRandomPassword(),u.client.request("ConfirmDevice",{DeviceKey:S.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:u.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?a.onFailure(T):(u.deviceKey=S.AuthenticationResult.NewDeviceMetadata.DeviceKey,u.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?a.onSuccess(u.signInUserSession,P.UserConfirmationNecessary):a.onSuccess(u.signInUserSession))})})})},t.changePassword=function(e,a,s,f){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:f},function(u){return u?s(u,null):s(null,"SUCCESS")})},t.enableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};a.push(s),this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?e(f,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s(f,null):s(null,"SUCCESS")})},t.disableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[];this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e(s,null):e(null,"SUCCESS")})},t.deleteUser=function(e,a){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:a},function(f){return f?e(f,null):(s.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,a,s){var f=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return a(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:s},function(u,l){return u?a(u,null):f.getUserData(function(){return a(null,"SUCCESS",l)},{bypassCache:!0})})},t.getUserAttributes=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){if(a)return e(a,null);for(var f=[],u=0;u<s.UserAttributes.length;u++){var l={Name:s.UserAttributes[u].Name,Value:s.UserAttributes[u].Value},p=new Cn(l);f.push(p)}return e(null,f)})},t.getMFAOptions=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){return a?e(a,null):e(null,s.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var a=this;return e===void 0&&(e={}),new Promise(function(s){var f=a.signInUserSession.getRefreshToken();f&&f.getToken()?a.refreshSession(f,s,e.clientMetadata):s()})},t.getUserData=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var f=this.getUserDataFromCache();if(!f){this.fetchUserData().then(function(u){e(null,u)}).catch(e);return}if(this.isFetchUserDataAndTokenRequired(a)){this.fetchUserData().then(function(u){return s.refreshSessionIfPossible(a).then(function(){return u})}).then(function(u){return e(null,u)}).catch(e);return}try{e(null,JSON.parse(f));return}catch(u){this.clearCachedUserData(),e(u,null);return}},t.getUserDataFromCache=function(){var e=this.storage.getItem(this.userDataKey);return e},t.isFetchUserDataAndTokenRequired=function(e){var a=e||{},s=a.bypassCache,f=s===void 0?!1:s;return f},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(a){return e.cacheUserData(a),a})},t.deleteAttributes=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return a(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?a(f,null):s.getUserData(function(){return a(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.client.request("ResendConfirmationCode",s,function(f,u){return f?e(f,null):e(null,u)})},t.getSession=function(e,a){if(a===void 0&&(a={}),this.username==null)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,f=s+".idToken",u=s+".accessToken",l=s+".refreshToken",p=s+".clockDrift";if(this.storage.getItem(f)){var d=new ut({IdToken:this.storage.getItem(f)}),y=new at({AccessToken:this.storage.getItem(u)}),S=new ft({RefreshToken:this.storage.getItem(l)}),U=parseInt(this.storage.getItem(p),0)||0,A={IdToken:d,AccessToken:y,RefreshToken:S,ClockDrift:U},C=new ht(A);if(C.isValid())return this.signInUserSession=C,e(null,this.signInUserSession);if(!S.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(S,e,a.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,a,s){var f=this,u=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(a):a,l={};l.REFRESH_TOKEN=e.getToken();var p="CognitoIdentityServiceProvider."+this.pool.getClientId(),d=p+".LastAuthUser";if(this.storage.getItem(d)){this.username=this.storage.getItem(d);var y=p+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(y),l.DEVICE_KEY=this.deviceKey}var S={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,ClientMetadata:s};this.getUserContextData()&&(S.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",S,function(U,A){if(U)return U.code==="NotAuthorizedException"&&f.clearCachedUser(),u(U,null);if(A){var C=A.AuthenticationResult;return Object.prototype.hasOwnProperty.call(C,"RefreshToken")||(C.RefreshToken=e.getToken()),f.signInUserSession=f.getCognitoUserSession(C),f.cacheTokens(),u(null,f.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+"."+this.username+".clockDrift",l=e+".LastAuthUser";this.storage.setItem(a,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(f,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(u,""+this.signInUserSession.getClockDrift()),this.storage.setItem(l,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.setItem(a,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(f,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.getItem(a)&&(this.deviceKey=this.storage.getItem(a),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(f))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+".LastAuthUser",l=e+"."+this.username+".clockDrift";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f),this.storage.removeItem(u),this.storage.removeItem(l)},t.getCognitoUserSession=function(e){var a=new ut(e),s=new at(e),f=new ft(e),u={IdToken:a,AccessToken:s,RefreshToken:f};return new ht(u)},t.forgotPassword=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(f,u){return f?e.onFailure(f):typeof e.inputVerificationCode=="function"?e.inputVerificationCode(u):e.onSuccess(u)})},t.confirmPassword=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",u,function(l){return l?s.onFailure(l):s.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(f,u){return f?a.onFailure(f):typeof a.inputVerificationCode=="function"?a.inputVerificationCode(u):a.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s.onFailure(f):s.onSuccess("SUCCESS")})},t.getDevice=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(a,s){return a?e.onFailure(a):e.onSuccess(s)})},t.forgetSpecificDevice=function(e,a){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(s){return s?a.onFailure(s):a.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var a=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(f){return a.deviceKey=null,a.deviceGroupKey=null,a.randomPassword=null,a.clearCachedDeviceKeyAndPassword(),e.onSuccess(f)}})},t.setDeviceStatusRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.listDevices=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var f={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};a&&(f.PaginationToken=a),this.client.request("ListDevices",f,function(u,l){return u?s.onFailure(u):s.onSuccess(l)})},t.globalSignOut=function(e){var a=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e.onFailure(s):(a.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var a=this;if(!e||typeof e!="function"){this.cleanClientData();return}this.getSession(function(s,f){if(s)return e(s);a.revokeTokens(function(u){a.cleanClientData(),e(u)})})},t.revokeTokens=function(e){if(e===void 0&&(e=function(){}),typeof e!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var a=new Error("User is not authenticated");return e(a)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return e(s)}var f=this.signInUserSession.getRefreshToken().getToken(),u=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(u)&&f)return this.revokeToken({token:f,callback:e});e()},t.isSessionRevocable=function(e){if(e&&typeof e.decodePayload=="function")try{var a=e.decodePayload(),s=a.origin_jti;return!!s}catch{}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var a=e.token,s=e.callback;this.client.requestWithRetry("RevokeToken",{Token:a,ClientId:this.pool.getClientId()},function(f){if(f)return s(f);s()})},t.sendMFASelectionAnswer=function(e,a){var s=this,f={};f.USERNAME=this.username,f.ANSWER=e;var u={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:f,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(l,p){if(l)return a.onFailure(l);if(s.Session=p.Session,e==="SMS_MFA")return a.mfaRequired(p.ChallengeName,p.ChallengeParameters);if(e==="SOFTWARE_TOKEN_MFA")return a.totpRequired(p.ChallengeName,p.ChallengeParameters)})},t.getUserContextData=function(){var e=this.pool;return e.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var a=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,f){return s?e.onFailure(s):e.associateSecretCode(f.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,f){return s?e.onFailure(s):(a.Session=f.Session,e.associateSecretCode(f.SecretCode))})},t.verifySoftwareToken=function(e,a,s){var f=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:a},function(u,l){return u?s.onFailure(u):s.onSuccess(l)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:a},function(u,l){if(u)return s.onFailure(u);f.Session=l.Session;var p={};p.USERNAME=f.username;var d={ChallengeName:"MFA_SETUP",ClientId:f.pool.getClientId(),ChallengeResponses:p,Session:f.Session};f.getUserContextData()&&(d.UserContextData=f.getUserContextData()),f.client.request("RespondToAuthChallenge",d,function(y,S){return y?s.onFailure(y):(f.signInUserSession=f.getCognitoUserSession(S.AuthenticationResult),f.cacheTokens(),s.onSuccess(f.signInUserSession))})})},o})();function En(o,t){return t=t||{},new Promise(function(r,e){var a=new XMLHttpRequest,s=[],f=[],u={},l=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:l,headers:{keys:function(){return s},entries:function(){return f},get:function(d){return u[d.toLowerCase()]},has:function(d){return d.toLowerCase()in u}}}};for(var p in a.open(t.method||"get",o,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,y,S){s.push(y=y.toLowerCase()),f.push([y,S]),u[y]=u[y]?u[y]+","+S:S}),r(l())},a.onerror=e,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(p,t.headers[p]);a.send(t.body||null)})}const Tn=Object.freeze(Object.defineProperty({__proto__:null,default:En},Symbol.toStringTag,{value:"Module"})),gt=Oe(Tn);var xe,dt;function Dn(){return dt||(dt=1,xe=self.fetch||(self.fetch=gt.default||gt)),xe}Dn();function K(){}K.prototype.userAgent=yn();var Ln=function(t){t&&(K.prototype.userAgent&&!K.prototype.userAgent.includes(t)&&(K.prototype.userAgent=K.prototype.userAgent.concat(" ",t)),(!K.prototype.userAgent||K.prototype.userAgent==="")&&(K.prototype.userAgent=t))},xn=function(t){var r=K.category?" "+K.category:"",e=K.framework?" framework/"+K.framework:"",a=""+K.prototype.userAgent+r+e;return a};function In(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,pe(o,t)}function be(o){var t=typeof Map=="function"?new Map:void 0;return be=function(e){if(e===null||!Rn(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return _n(e,arguments,Me(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),pe(a,e)},be(o)}function _n(o,t,r){if(Ut())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var a=new(o.bind.apply(o,e));return r&&pe(a,r.prototype),a}function Ut(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!o})()}function Rn(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}}function pe(o,t){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},pe(o,t)}function Me(o){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Me(o)}var Pn=(function(o){function t(r,e,a,s){var f;return f=o.call(this,r)||this,f.code=e,f.name=a,f.statusCode=s,f}return In(t,o),t})(be(Error)),Fn=(function(){function o(r,e,a){this.endpoint=e||"https://cognito-idp."+r+".amazonaws.com/";var s=a||{},f=s.credentials;this.fetchOptions=f?{credentials:f}:{}}var t=o.prototype;return t.promisifyRequest=function(e,a){var s=this;return new Promise(function(f,u){s.request(e,a,function(l,p){l?u(new Pn(l.message,l.code,l.name,l.statusCode)):f(p)})})},t.requestWithRetry=function(e,a,s){var f=this,u=5*1e3;Mn(function(l){return new Promise(function(p,d){f.request(e,l,function(y,S){y?d(y):p(S)})})},[a],u).then(function(l){return s(null,l)}).catch(function(l){return s(l)})},t.request=function(e,a,s){var f={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":xn(),"Cache-Control":"no-store"},u=Object.assign({},this.fetchOptions,{headers:f,method:"POST",mode:"cors",body:JSON.stringify(a)}),l;fetch(this.endpoint,u).then(function(p){return l=p,p},function(p){throw p instanceof TypeError?new Error("Network error"):p}).then(function(p){return p.json().catch(function(){return{}})}).then(function(p){if(l.ok)return s(null,p);var d=(p.__type||p.code).split("#").pop(),y=new Error(p.message||p.Message||null);return y.name=d,y.code=d,s(y)}).catch(function(p){if(l&&l.headers&&l.headers.get("x-amzn-errortype"))try{var d=l.headers.get("x-amzn-errortype").split(":")[0],y=new Error(l.status?l.status.toString():null);return y.code=d,y.name=d,y.statusCode=l.status,s(y)}catch{return s(p)}else p instanceof Error&&p.message==="Network error"&&(p.code="NetworkError");return s(p)})},o})(),Se={debug:function(){}},Bn=function(t){var r="nonRetryable";return t&&t[r]};function Et(o,t,r,e){if(e===void 0&&(e=1),typeof o!="function")throw Error("functionToRetry must be a function");return Se.debug(o.name+" attempt #"+e+" with args: "+JSON.stringify(t)),o.apply(void 0,t).catch(function(a){if(Se.debug("error on "+o.name,a),Bn(a))throw Se.debug(o.name+" non retryable error",a),a;var s=r(e,t,a);if(Se.debug(o.name+" retrying in "+s+" ms"),s!==!1)return new Promise(function(f){return setTimeout(f,s)}).then(function(){return Et(o,t,r,e+1)});throw a})}function bn(o){var t=100,r=100;return function(e){var a=Math.pow(2,e)*t+r*Math.random();return a>o?!1:a}}function Mn(o,t,r){return Et(o,t,bn(r))}/*!
|
|
50
50
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
51
51
|
* SPDX-License-Identifier: Apache-2.0
|
|
52
|
-
*/var On=55,
|
|
52
|
+
*/var On=55,jn=(function(){function o(r,e){var a=r||{},s=a.UserPoolId,f=a.ClientId,u=a.endpoint,l=a.fetchOptions,p=a.AdvancedSecurityDataCollectionFlag;if(!s||!f)throw new Error("Both UserPoolId and ClientId are required.");if(s.length>On||!/^[\w-]+_[0-9a-zA-Z]+$/.test(s))throw new Error("Invalid UserPoolId format.");var d=s.split("_")[0];this.userPoolId=s,this.clientId=f,this.client=new Fn(d,u,l),this.advancedSecurityDataCollectionFlag=p!==!1,this.storage=r.Storage||new At().getStorage(),e&&(this.wrapRefreshSessionCallback=e)}var t=o.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,a,s,f,u,l){var p=this,d={ClientId:this.clientId,Username:e,Password:a,UserAttributes:s,ValidationData:f,ClientMetadata:l};this.getUserContextData(e)&&(d.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",d,function(y,S){if(y)return u(y,null);var U={Username:e,Pool:p,Storage:p.storage},A={user:new pt(U),userConfirmed:S.UserConfirmed,userSub:S.UserSub,codeDeliveryDetails:S.CodeDeliveryDetails};return u(null,A)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",a=this.storage.getItem(e);if(a){var s={Username:a,Pool:this,Storage:this.storage};return new pt(s)}return null},t.getUserContextData=function(e){if(!(typeof AmazonCognitoAdvancedSecurityData>"u")){var a=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var s=a.getData(e,this.userPoolId,this.clientId);if(s){var f={EncodedData:s};return f}}return{}}},o})(),Ie={exports:{}};/*!
|
|
53
53
|
* JavaScript Cookie v2.2.1
|
|
54
54
|
* https://github.com/js-cookie/js-cookie
|
|
55
55
|
*
|
|
56
56
|
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
57
57
|
* Released under the MIT license
|
|
58
|
-
*/var vt;function Nn(){return vt||(vt=1,(function(o,t){(function(r){var e;if(o.exports=r(),e=!0,!e){var a=window.Cookies,s=window.Cookies=r();s.noConflict=function(){return window.Cookies=a,s}}})(function(){function r(){for(var s=0,f={};s<arguments.length;s++){var u=arguments[s];for(var l in u)f[l]=u[l]}return f}function e(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function a(s){function f(){}function u(p,d,y){if(!(typeof document>"u")){y=r({path:"/"},f.defaults,y),typeof y.expires=="number"&&(y.expires=new Date(new Date*1+y.expires*864e5)),y.expires=y.expires?y.expires.toUTCString():"";try{var S=JSON.stringify(d);/^[\{\[]/.test(S)&&(d=S)}catch{}d=s.write?s.write(d,p):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),p=encodeURIComponent(String(p)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var U="";for(var A in y)y[A]&&(U+="; "+A,y[A]!==!0&&(U+="="+y[A].split(";")[0]));return document.cookie=p+"="+d+U}}function l(p,d){if(!(typeof document>"u")){for(var y={},S=document.cookie?document.cookie.split("; "):[],U=0;U<S.length;U++){var A=S[U].split("="),C=A.slice(1).join("=");!d&&C.charAt(0)==='"'&&(C=C.slice(1,-1));try{var D=e(A[0]);if(C=(s.read||s)(C,D)||e(C),d)try{C=JSON.parse(C)}catch{}if(y[D]=C,p===D)break}catch{}}return p?y[p]:y}}return f.set=u,f.get=function(p){return l(p,!1)},f.getJSON=function(p){return l(p,!0)},f.remove=function(p,d){u(p,"",r(d,{expires:-1}))},f.defaults={},f.withConverter=a,f}return a(function(){})})})(Ie)),Ie.exports}var he=Nn(),
|
|
58
|
+
*/var vt;function Nn(){return vt||(vt=1,(function(o,t){(function(r){var e;if(o.exports=r(),e=!0,!e){var a=window.Cookies,s=window.Cookies=r();s.noConflict=function(){return window.Cookies=a,s}}})(function(){function r(){for(var s=0,f={};s<arguments.length;s++){var u=arguments[s];for(var l in u)f[l]=u[l]}return f}function e(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function a(s){function f(){}function u(p,d,y){if(!(typeof document>"u")){y=r({path:"/"},f.defaults,y),typeof y.expires=="number"&&(y.expires=new Date(new Date*1+y.expires*864e5)),y.expires=y.expires?y.expires.toUTCString():"";try{var S=JSON.stringify(d);/^[\{\[]/.test(S)&&(d=S)}catch{}d=s.write?s.write(d,p):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),p=encodeURIComponent(String(p)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var U="";for(var A in y)y[A]&&(U+="; "+A,y[A]!==!0&&(U+="="+y[A].split(";")[0]));return document.cookie=p+"="+d+U}}function l(p,d){if(!(typeof document>"u")){for(var y={},S=document.cookie?document.cookie.split("; "):[],U=0;U<S.length;U++){var A=S[U].split("="),C=A.slice(1).join("=");!d&&C.charAt(0)==='"'&&(C=C.slice(1,-1));try{var D=e(A[0]);if(C=(s.read||s)(C,D)||e(C),d)try{C=JSON.parse(C)}catch{}if(y[D]=C,p===D)break}catch{}}return p?y[p]:y}}return f.set=u,f.get=function(p){return l(p,!1)},f.getJSON=function(p){return l(p,!0)},f.remove=function(p,d){u(p,"",r(d,{expires:-1}))},f.defaults={},f.withConverter=a,f}return a(function(){})})})(Ie)),Ie.exports}var he=Nn(),Hn=(function(){function o(r){if(r===void 0&&(r={}),r.domain&&(this.domain=r.domain),r.path?this.path=r.path:this.path="/",Object.prototype.hasOwnProperty.call(r,"expires")?this.expires=r.expires:this.expires=365,Object.prototype.hasOwnProperty.call(r,"secure")?this.secure=r.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(r,"sameSite")){if(!["strict","lax","none"].includes(r.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(r.sameSite==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=r.sameSite}else this.sameSite=null}var t=o.prototype;return t.setItem=function(e,a){var s={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(s.sameSite=this.sameSite),he.set(e,a,s),he.get(e)},t.getItem=function(e){return he.get(e)},t.removeItem=function(e){var a={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(a.sameSite=this.sameSite),he.remove(e,a)},t.clear=function(){for(var e=he.get(),a=Object.keys(e).length,s=0;s<a;++s)this.removeItem(Object.keys(e)[s]);return{}},o})();export{Vn as AuthenticationDetails,X as AuthenticationHelper,at as CognitoAccessToken,ut as CognitoIdToken,ft as CognitoRefreshToken,pt as CognitoUser,Cn as CognitoUserAttribute,jn as CognitoUserPool,ht as CognitoUserSession,Hn as CookieStorage,ct as DateHelper,Ht as WordArray,Ln as appendToCognitoUserAgent};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const p=(o=0)=>e=>`\x1B[${e+o}m`,B=(o=0)=>e=>`\x1B[${38+o};5;${e}m`,y=(o=0)=>(e,t,r)=>`\x1B[${38+o};2;${e};${t};${r}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(l.modifier);const
|
|
1
|
+
const p=(o=0)=>e=>`\x1B[${e+o}m`,B=(o=0)=>e=>`\x1B[${38+o};5;${e}m`,y=(o=0)=>(e,t,r)=>`\x1B[${38+o};2;${e};${t};${r}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(l.modifier);const T=Object.keys(l.color),M=Object.keys(l.bgColor);[...T,...M];function w(){const o=new Map;for(const[e,t]of Object.entries(l)){for(const[r,n]of Object.entries(t))l[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=l[r],o.set(n[0],n[1]);Object.defineProperty(l,e,{value:t,enumerable:!1})}return Object.defineProperty(l,"codes",{value:o,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.color.ansi=p(),l.color.ansi256=B(),l.color.ansi16m=y(),l.bgColor.ansi=p(10),l.bgColor.ansi256=B(10),l.bgColor.ansi16m=y(10),Object.defineProperties(l,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>l.rgbToAnsi256(...l.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;const v=e%36;t=Math.floor(e/36)/5,r=Math.floor(v/6)/5,n=v%6/5}const s=Math.max(t,r,n)*2;if(s===0)return 30;let a=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>l.ansi256ToAnsi(l.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>l.ansi256ToAnsi(l.hexToAnsi256(e)),enumerable:!1}}),l}const i=w(),O=(()=>{if(navigator.userAgentData){const o=navigator.userAgentData.brands.find(({brand:e})=>e==="Chromium");if(o&&o.version>93)return 3}return/\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),x=O!==0&&{level:O},P={stdout:x,stderr:x};function k(o,e,t){let r=o.indexOf(e);if(r===-1)return o;const n=e.length;let s=0,a="";do a+=o.slice(s,r)+e+t,s=r+n,r=o.indexOf(e,s);while(r!==-1);return a+=o.slice(s),a}function R(o,e,t,r){let n=0,s="";do{const a=o[r-1]==="\r";s+=o.slice(n,a?r-1:r)+e+(a?`\r
|
|
2
2
|
`:`
|
|
3
3
|
`)+t,n=r+1,r=o.indexOf(`
|
|
4
|
-
`,n)}while(r!==-1);return s+=o.slice(n),s}const{stdout:A,stderr:
|
|
5
|
-
`);return s!==-1&&(e=R(e,n,r,s)),r+e+n};Object.defineProperties(b.prototype,
|
|
4
|
+
`,n)}while(r!==-1);return s+=o.slice(n),s}const{stdout:A,stderr:j}=P,f=Symbol("GENERATOR"),c=Symbol("STYLER"),g=Symbol("IS_EMPTY"),C=["ansi","ansi","ansi256","ansi16m"],u=Object.create(null),$=(o,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const t=A?A.level:0;o.level=e.level===void 0?t:e.level},S=o=>{const e=(...t)=>t.join(" ");return $(e,o),Object.setPrototypeOf(e,b.prototype),e};function b(o){return S(o)}Object.setPrototypeOf(b.prototype,Function.prototype);for(const[o,e]of Object.entries(i))u[o]={get(){const t=h(this,m(e.open,e.close,this[c]),this[g]);return Object.defineProperty(this,o,{value:t}),t}};u.visible={get(){const o=h(this,this[c],!0);return Object.defineProperty(this,"visible",{value:o}),o}};const d=(o,e,t,...r)=>o==="rgb"?e==="ansi16m"?i[t].ansi16m(...r):e==="ansi256"?i[t].ansi256(i.rgbToAnsi256(...r)):i[t].ansi(i.rgbToAnsi(...r)):o==="hex"?d("rgb",e,t,...i.hexToRgb(...r)):i[t][o](...r),E=["rgb","hex","ansi256"];for(const o of E){u[o]={get(){const{level:t}=this;return function(...r){const n=m(d(o,C[t],"color",...r),i.color.close,this[c]);return h(this,n,this[g])}}};const e="bg"+o[0].toUpperCase()+o.slice(1);u[e]={get(){const{level:t}=this;return function(...r){const n=m(d(o,C[t],"bgColor",...r),i.bgColor.close,this[c]);return h(this,n,this[g])}}}}const G=Object.defineProperties(()=>{},{...u,level:{enumerable:!0,get(){return this[f].level},set(o){this[f].level=o}}}),m=(o,e,t)=>{let r,n;return t===void 0?(r=o,n=e):(r=t.openAll+o,n=e+t.closeAll),{open:o,close:e,openAll:r,closeAll:n,parent:t}},h=(o,e,t)=>{const r=(...n)=>N(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,G),r[f]=o,r[c]=e,r[g]=t,r},N=(o,e)=>{if(o.level<=0||!e)return o[g]?"":e;let t=o[c];if(t===void 0)return e;const{openAll:r,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=k(e,t.close,t.open),t=t.parent;const s=e.indexOf(`
|
|
5
|
+
`);return s!==-1&&(e=R(e,n,r,s)),r+e+n};Object.defineProperties(b.prototype,u);const I=b();b({level:j?j.level:0});export{M as backgroundColorNames,M as backgroundColors,I as default,T as foregroundColorNames,T as foregroundColors,A as supportsColor,j as supportsColorStderr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as N}from"./_commonjsHelpers-D6-XlEtG.js";import{b}from"./_commonjs-dynamic-modules-DkOKMH7F.js";var p,S;function w(){if(S)return p;S=1;const u=b;class i{constructor(e,t){typeof e=="string"?this.#r(e):t!==void 0?this.#t(e,t):this.#e(e)}toPostgres(){const e=this.values,t=this.indices.map((s,n)=>u.format("%i:%f",s+1,e[n])).join(",");return u.format("{%s}/%d",t,this.dimensions)}toString(){return this.toPostgres()}toArray(){const e=Array(this.dimensions).fill(0);for(const[t,s]of this.indices.entries())e[s]=this.values[t];return e}#r(e){const t=e.split("/",2);this.dimensions=parseInt(t[1]),this.indices=[],this.values=[];const s=t[0].slice(1,-1).split(",");for(const n of s){const c=n.split(":",2);this.indices.push(parseInt(c[0])-1),this.values.push(parseFloat(c[1]))}}#e(e){this.dimensions=e.length,this.indices=[],this.values=[];for(const[t,s]of e.entries()){const n=Number(s);n!=0&&(this.indices.push(Number(t)),this.values.push(n))}}#t(e,t){this.dimensions=Number(t),this.indices=[],this.values=[];const s=e instanceof Map?e.entries():Object.entries(e);for(const[n,c]of s){const l=Number(c);l!=0&&(this.indices.push(Number(n)),this.values.push(l))}}}return p={SparseVector:i},p}var h,q;function A(){if(q)return h;q=1;const u=b,{SparseVector:i}=w();function f(r){return r===null?null:r.substring(1,r.length-1).split(",").map(o=>parseFloat(o))}function e(r){return Array.isArray(r)?JSON.stringify(r.map(o=>Number(o))):r}const t=f,s=e;function n(r){return r===null?null:new i(r)}function c(r){return r instanceof i?r.toPostgres():r}function l(r){if(r===null)return null;if(r[0]=="[")return f(r);if(r[0]=="{")return n(r);throw new Error("invalid text representation")}function g(r){if(r===null)return null;if(Array.isArray(r))return e(r);if(r instanceof i)return c(r);throw new Error("expected array or sparse vector")}function a(r,o){if(o==null)return r;if(!Number.isInteger(o))throw new Error("expected integer");return u.format("%s(%d)",r,o)}function d(r){return a("vector",r)}function v(r){return a("halfvec",r)}function T(r){return a("bit",r)}function x(r){return a("sparsevec",r)}return h={fromSql:l,toSql:g,vectorFromSql:f,vectorToSql:e,halfvecFromSql:t,halfvecToSql:s,sparsevecFromSql:n,sparsevecToSql:c,sqlType:d,vectorType:d,halfvecType:v,bitType:T,sparsevecType:x,SparseVector:i},h}var m,y;function F(){if(y)return m;y=1;const{fromSql:u,toSql:i,SparseVector:f}=A();return m={fromSql:u,toSql:i,SparseVector:f},m}var V=F();const j=N(V),_=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"}));export{_ as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as z,i as x}from"./normalizeProvider-CtDY37Q6.js";class T{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:a,serializer:n,deserializer:o,serdeContext:m,defaultContentType:y}){this.marshaller=a,this.serializer=n,this.deserializer=o,this.serdeContext=m,this.defaultContentType=y}async serializeEventStream({eventStream:a,requestSchema:n,initialRequest:o}){const m=this.marshaller,y=n.getEventStreamMember(),p=n.getMemberSchema(y),d=this.serializer,f=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){const r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:f}};d.write(n,o);const t=d.flush();yield{[h]:!0,headers:r,body:t}}for await(const r of a)yield r}};return m.serialize(S,r=>{if(r[h])return{headers:r.headers,body:r.body};const t=Object.keys(r).find(s=>s!=="__type")??"",{additionalHeaders:e,body:i,eventType:l,explicitPayloadContentType:c}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:c??f},...e},body:i}})}async deserializeEventStream({response:a,responseSchema:n,initialResponseContainer:o}){const m=this.marshaller,y=n.getEventStreamMember(),d=n.getMemberSchema(y).getMemberSchemas(),f=Symbol("initialResponseMarker"),h=m.deserialize(a.body,async t=>{const e=Object.keys(t).find(l=>l!=="__type")??"",i=t[e].body;if(e==="initial-response"){const l=await this.deserializer.read(n,i);return delete l[y],{[f]:!0,...l}}else if(e in d){const l=d[e];if(l.isStructSchema()){const c={};let u=!1;for(const[s,g]of l.structIterator()){const{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(u=u||!!(v||w),w)g.isBlobSchema()?c[s]=i:g.isStringSchema()?c[s]=(this.serdeContext?.utf8Encoder??z)(i):g.isStructSchema()&&(c[s]=await this.deserializer.read(g,i));else if(v){const b=t[e].headers[s]?.value;b!=null&&(g.isNumericSchema()?b&&typeof b=="object"&&"bytes"in b?c[s]=BigInt(b.toString()):c[s]=Number(b):c[s]=b)}}if(u)return{[e]:c};if(i.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,i)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[f]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){for(r?.value?.[f]||(yield r.value);;){const{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(a,n,o){const m=this.serializer;let y=a,p=null,d;const f=n.getSchema()[4].includes(a),h={};if(f){const t=n.getMemberSchema(a);if(t.isStructSchema()){for(const[e,i]of t.structIterator()){const{eventHeader:l,eventPayload:c}=i.getMergedTraits();if(c)p=e;else if(l){const u=o[a][e];let s="binary";i.isNumericSchema()?(-2)**31<=u&&u<=2**31-1?s="integer":s="long":i.isTimestampSchema()?s="timestamp":i.isStringSchema()?s="string":i.isBooleanSchema()&&(s="boolean"),u!=null&&(h[e]={type:s,value:u},delete o[a][e])}}if(p!==null){const e=t.getMemberSchema(p);e.isBlobSchema()?d="application/octet-stream":e.isStringSchema()&&(d="text/plain"),m.write(e,o[a][p])}else m.write(t,o[a])}else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[t,e]=o[a];y=t,m.write(15,e)}const S=m.flush();return{body:typeof S=="string"?(this.serdeContext?.utf8Decoder??x)(S):S,eventType:y,explicitPayloadContentType:d,additionalHeaders:h}}}export{T as EventStreamSerde};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as q}from"./util-CNqBjtt6-GUXK7Yxz.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-69shuAsh-DF18H7zf.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";var p,d;function w(){if(d)return p;d=1;const c=q();class i{constructor(e,r){typeof e=="string"?this.#t(e):r!==void 0?this.#r(e,r):this.#e(e)}toPostgres(){const e=this.values,r=this.indices.map((s,n)=>c.format("%i:%f",s+1,e[n])).join(",");return c.format("{%s}/%d",r,this.dimensions)}toString(){return this.toPostgres()}toArray(){const e=Array(this.dimensions).fill(0);for(const[r,s]of this.indices.entries())e[s]=this.values[r];return e}#t(e){const r=e.split("/",2);this.dimensions=parseInt(r[1]),this.indices=[],this.values=[];const s=r[0].slice(1,-1).split(",");for(const n of s){const o=n.split(":",2);this.indices.push(parseInt(o[0])-1),this.values.push(parseFloat(o[1]))}}#e(e){this.dimensions=e.length,this.indices=[],this.values=[];for(const[r,s]of e.entries()){const n=Number(s);n!=0&&(this.indices.push(Number(r)),this.values.push(n))}}#r(e,r){this.dimensions=Number(r),this.indices=[],this.values=[];const s=e instanceof Map?e.entries():Object.entries(e);for(const[n,o]of s){const a=Number(o);a!=0&&(this.indices.push(Number(n)),this.values.push(a))}}}return p={SparseVector:i},p}var h,S;function A(){if(S)return h;S=1;const c=q(),{SparseVector:i}=w();function l(t){return t===null?null:t.substring(1,t.length-1).split(",").map(u=>parseFloat(u))}function e(t){return Array.isArray(t)?JSON.stringify(t.map(u=>Number(u))):t}const r=l,s=e;function n(t){return t===null?null:new i(t)}function o(t){return t instanceof i?t.toPostgres():t}function a(t){if(t===null)return null;if(t[0]=="[")return l(t);if(t[0]=="{")return n(t);throw new Error("invalid text representation")}function b(t){if(t===null)return null;if(Array.isArray(t))return e(t);if(t instanceof i)return o(t);throw new Error("expected array or sparse vector")}function f(t,u){if(u==null)return t;if(!Number.isInteger(u))throw new Error("expected integer");return c.format("%s(%d)",t,u)}function v(t){return f("vector",t)}function g(t){return f("halfvec",t)}function N(t){return f("bit",t)}function T(t){return f("sparsevec",t)}return h={fromSql:a,toSql:b,vectorFromSql:l,vectorToSql:e,halfvecFromSql:r,halfvecToSql:s,sparsevecFromSql:n,sparsevecToSql:o,sqlType:v,vectorType:v,halfvecType:g,bitType:N,sparsevecType:T,SparseVector:i},h}var m,y;function F(){if(y)return m;y=1;const{fromSql:c,toSql:i,SparseVector:l}=A();return m={fromSql:c,toSql:i,SparseVector:l},m}F();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as x,b as H,H as k,n as y,c as ee,t as te,h as se}from"./normalizeProvider-CtDY37Q6.js";import{Y as re,N as S,h as W,L as ie,f as G,i as ne,a as oe,c as ae,S as $,m as ce,d as ue,b as de,T as N,e as I,v as le,R as ge,j as fe,g as P}from"./resolveDefaultsModeConfig-Ck7QP6UJ.js";function U(s){return encodeURIComponent(s).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}const R="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",M="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",O="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",K="(\\d?\\d)",Q="(\\d{4})",me=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),pe=new RegExp(`^${R}, ${K} ${M} ${Q} ${O} GMT$`),he=new RegExp(`^${R}, ${K}-${M}-(\\d\\d) ${O} GMT$`),we=new RegExp(`^${R} ${M} ( [1-9]|\\d\\d) ${O} ${Q}$`),Se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ye=s=>{if(s==null)return;let e=NaN;if(typeof s=="number")e=s;else if(typeof s=="string"){if(!/^-?\d*\.?\d+$/.test(s))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(s)}else typeof s=="object"&&s.tag===1&&(e=s.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(e*1e3))},Ee=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC3339 timestamps must be strings");const e=me.exec(s);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${s}`);const[,t,r,i,n,o,a,,u,c]=e;w(r,1,12),w(i,1,31),w(n,0,23),w(o,0,59),w(a,0,60);const d=new Date(Date.UTC(Number(t),Number(r)-1,Number(i),Number(n),Number(o),Number(a),Number(u)?Math.round(parseFloat(`0.${u}`)*1e3):0));if(d.setUTCFullYear(Number(t)),c.toUpperCase()!="Z"){const[,l,g,f]=/([+-])(\d\d):(\d\d)/.exec(c)||[void 0,"+",0,0],m=l==="-"?1:-1;d.setTime(d.getTime()+m*(Number(g)*60*60*1e3+Number(f)*60*1e3))}return d},be=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC7231 timestamps must be strings.");let e,t,r,i,n,o,a,u;if((u=pe.exec(s))?[,e,t,r,i,n,o,a]=u:(u=he.exec(s))?([,e,t,r,i,n,o,a]=u,r=(Number(r)+1900).toString()):(u=we.exec(s))&&([,t,e,i,n,o,a,r]=u),r&&o){const c=Date.UTC(Number(r),Se.indexOf(t),Number(e),Number(i),Number(n),Number(o),a?Math.round(parseFloat(`0.${a}`)*1e3):0);w(e,1,31),w(i,0,23),w(n,0,59),w(o,0,60);const d=new Date(c);return d.setUTCFullYear(Number(r)),d}throw new TypeError(`Invalid RFC7231 date-time value ${s}.`)};function w(s,e,t){const r=Number(s);if(r<e||r>t)throw new Error(`Value ${r} out of range [${e}, ${t}]`)}const Ce=s=>{const e=s.length,t=[];let r=!1,i,n=0;for(let o=0;o<e;++o){const a=s[o];switch(a){case'"':i!=="\\"&&(r=!r);break;case",":r||(t.push(s.slice(n,o)),n=o+1);break}i=a}return t.push(s.slice(n)),t.map(o=>{o=o.trim();const a=o.length;return a<2?o:(o[0]==='"'&&o[a-1]==='"'&&(o=o.slice(1,a-1)),o.replace(/\\"/g,'"'))})};class Ae extends re{settings;constructor(e){super(),this.settings=e}read(e,t){const r=S.of(e);if(r.isListSchema())return Ce(t).map(i=>this.read(r.getValueSchema(),i));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??x)(t);if(r.isTimestampSchema())switch(W(r,this.settings)){case 5:return Ee(t);case 6:return be(t);case 7:return ye(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){const i=r.getMergedTraits().mediaType;let n=t;if(i)return r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n)),(i==="application/json"||i.endsWith("+json"))&&(n=ie.from(n)),n}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new G(t,"bigDecimal"):r.isBooleanSchema()?String(t).toLowerCase()==="true":t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??H)((this.serdeContext?.base64Decoder??x)(e))}}const q=s=>{const e="#text";for(const t in s)s.hasOwnProperty(t)&&s[t][e]!==void 0?s[t]=s[t][e]:typeof s[t]=="object"&&s[t]!==null&&(s[t]=q(s[t]));return s};function ot(s){return s}const Te=s=>e=>async t=>{if(!k.isInstance(t.request))return e(t);const{request:r}=t,{handlerProtocol:i=""}=s.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let n=r.hostname;r.port!=null&&(n+=`:${r.port}`),r.headers.host=n}return e(t)},Ne={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},at=s=>({applyToStack:e=>{e.add(Te(s),Ne)}}),ke=()=>(s,e)=>async t=>{try{const r=await s(t),{clientName:i,commandName:n,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:u,overrideOutputFilterSensitiveLog:c}=a,d=u??e.inputFilterSensitiveLog,l=c??e.outputFilterSensitiveLog,{$metadata:g,...f}=r.output;return o?.info?.({clientName:i,commandName:n,input:d(t.input),output:l(f),metadata:g}),r}catch(r){const{clientName:i,commandName:n,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:u}=a,c=u??e.inputFilterSensitiveLog;throw o?.error?.({clientName:i,commandName:n,input:c(t.input),error:r,metadata:r.$metadata}),r}},Re={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},ct=s=>({applyToStack:e=>{e.add(ke(),Re)}}),Me={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},Oe=()=>s=>async e=>s(e),ut=s=>({applyToStack:e=>{e.add(Oe(),Me)}}),De=void 0;function _e(s){return s===void 0?!0:typeof s=="string"&&s.length<=50}function dt(s){const e=y(s.userAgentAppId??De),{customUserAgent:t}=s;return Object.assign(s,{customUserAgent:typeof t=="string"?[[t]]:t,userAgentAppId:async()=>{const r=await e();if(!_e(r)){const i=s.logger?.constructor?.name==="NoOpLogger"||!s.logger?console:s.logger;typeof r!="string"?i?.warn("userAgentAppId must be a string or undefined."):r.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}})}const X=(s,e=!1)=>{if(e){for(const t of s.split("."))if(!X(t))return!1;return!0}return!(!ne(s)||s.length<3||s.length>63||s!==s.toLowerCase()||oe(s))},F=":",xe="/",$e=s=>{const e=s.split(F);if(e.length<6)return null;const[t,r,i,n,o,...a]=e;if(t!=="arn"||r===""||i===""||a.join(F)==="")return null;const u=a.map(c=>c.split(xe)).flat();return{partition:r,service:i,region:n,accountId:o,resourceId:u}},Ie=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],Pe={partitions:Ie};let Ue=Pe;const Fe=s=>{const{partitions:e}=Ue;for(const r of e){const{regions:i,outputs:n}=r;for(const[o,a]of Object.entries(i))if(o===s)return{...n,...a}}for(const r of e){const{regionRegex:i,outputs:n}=r;if(new RegExp(i).test(s))return{...n}}const t=e.find(r=>r.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},ze={isVirtualHostableS3Bucket:X,parseArn:$e,partition:Fe};ae.aws=ze;function Le(s,e,t){return s.$source||(s.$source={}),s.$source[e]=t,s}function h(s,e,t){s.__aws_sdk_context?s.__aws_sdk_context.features||(s.__aws_sdk_context.features={}):s.__aws_sdk_context={features:{}},s.__aws_sdk_context.features[e]=t}const z=s=>ee.isInstance(s)?s.headers?.date??s.headers?.Date:void 0,J=s=>new Date(Date.now()+s),ve=(s,e)=>Math.abs(J(e).getTime()-s)>=3e5,L=(s,e)=>{const t=Date.parse(s);return ve(t,e)?t-Date.now():e},E=(s,e)=>{if(!e)throw new Error(`Property \`${s}\` is not resolved for AWS SDK SigV4Auth`);return e},Ve=async s=>{const e=E("context",s.context),t=E("config",s.config),r=e.endpointV2?.properties?.authSchemes?.[0],n=await E("signer",t.signer)(r),o=s?.signingRegion,a=s?.signingRegionSet,u=s?.signingName;return{config:t,signer:n,signingRegion:o,signingRegionSet:a,signingName:u}};class lt{async sign(e,t,r){if(!k.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await Ve(r),{config:n,signer:o}=i;let{signingRegion:a,signingName:u}=i;const c=r.context;if(c?.authSchemes?.length??!1){const[l,g]=c.authSchemes;l?.name==="sigv4a"&&g?.name==="sigv4"&&(a=g?.signingRegion??a,u=g?.signingName??u)}return await o.sign(e,{signingDate:J(n.systemClockOffset),signingRegion:a,signingService:u})}errorHandler(e){return t=>{const r=t.ServerTime??z(t.$response);if(r){const i=E("config",e.config),n=i.systemClockOffset;i.systemClockOffset=L(r,i.systemClockOffset),i.systemClockOffset!==n&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const r=z(e);if(r){const i=E("config",t.config);i.systemClockOffset=L(r,i.systemClockOffset)}}}const gt=s=>{let e=s.credentials,t=!!s.credentials,r;Object.defineProperty(s,"credentials",{set(c){c&&c!==e&&c!==r&&(t=!0),e=c;const d=je(s,{credentials:e,credentialDefaultProvider:s.credentialDefaultProvider}),l=Be(s,d);if(t&&!l.attributed){const g=typeof e=="object"&&e!==null;r=async f=>{const p=await l(f);return g&&(!p.$source||Object.keys(p.$source).length===0)?Le(p,"CREDENTIALS_CODE","e"):p},r.memoized=l.memoized,r.configBound=l.configBound,r.attributed=!0}else r=l},get(){return r},enumerable:!0,configurable:!0}),s.credentials=e;const{signingEscapePath:i=!0,systemClockOffset:n=s.systemClockOffset||0,sha256:o}=s;let a;return s.signer?a=y(s.signer):s.regionInfoProvider?a=()=>y(s.region)().then(async c=>[await s.regionInfoProvider(c,{useFipsEndpoint:await s.useFipsEndpoint(),useDualstackEndpoint:await s.useDualstackEndpoint()})||{},c]).then(([c,d])=>{const{signingRegion:l,signingService:g}=c;s.signingRegion=s.signingRegion||l||d,s.signingName=s.signingName||g||s.serviceId;const f={...s,credentials:s.credentials,region:s.signingRegion,service:s.signingName,sha256:o,uriEscapePath:i},m=s.signerConstructor||$;return new m(f)}):a=async c=>{c=Object.assign({},{name:"sigv4",signingName:s.signingName||s.defaultSigningName,signingRegion:await y(s.region)(),properties:{}},c);const d=c.signingRegion,l=c.signingName;s.signingRegion=s.signingRegion||d,s.signingName=s.signingName||l||s.serviceId;const g={...s,credentials:s.credentials,region:s.signingRegion,service:s.signingName,sha256:o,uriEscapePath:i},f=s.signerConstructor||$;return new f(g)},Object.assign(s,{systemClockOffset:n,signingEscapePath:i,signer:a})};function je(s,{credentials:e,credentialDefaultProvider:t}){let r;return e?e?.memoized?r=e:r=ce(e,de,ue):t?r=y(t(Object.assign({},s,{parentClientConfig:s}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function Be(s,e){if(e.configBound)return e;const t=async r=>e({...r,callerClientConfig:s});return t.memoized=e.memoized,t.configBound=!0,t}class He{queryCompat;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const r=t.getMemberSchemas(),i=Object.values(r).find(n=>!!n.getMergedTraits().httpPayload);if(i){const n=i.getMergedTraits().mediaType;return n||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(r).find(o=>{const{httpQuery:a,httpQueryParams:u,httpHeader:c,httpLabel:d,httpPrefixHeaders:l}=o.getMergedTraits();return!a&&!u&&!c&&!d&&l===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,r,i,n,o){let a=t,u=e;e.includes("#")&&([a,u]=e.split("#"));const c={$metadata:n,$fault:r.statusCode<500?"client":"server"},d=N.for(a);try{return{errorSchema:o?.(d,u)??d.getSchema(e),errorMetadata:c}}catch{i.message=i.message??i.Message??"UnknownError";const g=N.for("smithy.ts.sdk.synthetic."+a),f=g.getBaseException();if(f){const m=g.getErrorCtor(f)??Error;throw this.decorateServiceException(Object.assign(new m({name:u}),c),i)}throw this.decorateServiceException(Object.assign(new Error(u),c),i)}}decorateServiceException(e,t={}){if(this.queryCompat){const r=e.Message??t.Message,i=I(e,t);r&&(i.message=r),i.Error={...i.Error,Type:i.Error.Type,Code:i.Error.Code,Message:i.Error.message??i.Error.Message??r};const n=i.$metadata.requestId;return n&&(i.RequestId=n),i}return I(e,t)}setQueryCompatError(e,t){const r=t.headers?.["x-amzn-query-error"];if(e!==void 0&&r!=null){const[i,n]=r.split(";"),o=Object.entries(e),a={Code:i,Type:n};Object.assign(e,a);for(const[u,c]of o)a[u==="message"?"Message":u]=c;delete a.__type,e.Error=a}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(i=>S.of(i).getMergedTraits().awsQueryError?.[0]===t)}}}class Y{serdeContext;setSerdeContext(e){this.serdeContext=e}}function*We(s,e){if(s.isUnitSchema())return;const t=s.getSchema();for(let r=0;r<t[4].length;++r){const i=t[4][r],n=t[5][r],o=new S([n,0],i);!(i in e)&&!o.isIdempotencyToken()||(yield[i,o])}}class Ge{from;to;keys;constructor(e,t){this.from=e,this.to=t,this.keys=new Set(Object.keys(this.from).filter(r=>r!=="__type"))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}let C;function Ke(s){C||(C=new DOMParser);const e=C.parseFromString(s,"application/xml");if(e.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const t=r=>{if(r.nodeType===Node.TEXT_NODE&&r.textContent?.trim())return r.textContent;if(r.nodeType===Node.ELEMENT_NODE){const i=r;if(i.attributes.length===0&&i.childNodes.length===0)return"";const n={},o=Array.from(i.attributes);for(const u of o)n[`${u.name}`]=u.value;const a=Array.from(i.childNodes);for(const u of a){const c=t(u);if(c!=null){const d=u.nodeName;if(a.length===1&&o.length===0&&d==="#text")return c;n[d]?Array.isArray(n[d])?n[d].push(c):n[d]=[n[d],c]:n[d]=c}else if(a.length===1&&o.length===0)return i.textContent}return n}return null};return{[e.documentElement.nodeName]:t(e.documentElement)}}class Qe extends Y{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new Ae(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,r){const i=S.of(e),n=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(n).find(c=>!!c.getMemberTraits().eventPayload)){const c={},d=Object.keys(n)[0];return n[d].isBlobSchema()?c[d]=t:c[d]=this.read(n[d],t),c}const a=(this.serdeContext?.utf8Encoder??H)(t),u=this.parseXml(a);return this.readSchema(e,r?u[r]:u)}readSchema(e,t){const r=S.of(e);if(r.isUnitSchema())return;const i=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(t))return this.readSchema(r,[t]);if(t==null)return t;if(typeof t=="object"){const n=!!i.sparse,o=!!i.xmlFlattened;if(r.isListSchema()){const u=r.getValueSchema(),c=[],d=u.getMergedTraits().xmlName??"member",l=o?t:(t[0]??t)[d],g=Array.isArray(l)?l:[l];for(const f of g)(f!=null||n)&&c.push(this.readSchema(u,f));return c}const a={};if(r.isMapSchema()){const u=r.getKeySchema(),c=r.getValueSchema();let d;o?d=Array.isArray(t)?t:[t]:d=Array.isArray(t.entry)?t.entry:[t.entry];const l=u.getMergedTraits().xmlName??"key",g=c.getMergedTraits().xmlName??"value";for(const f of d){const m=f[l],p=f[g];(p!=null||n)&&(a[m]=this.readSchema(c,p))}return a}if(r.isStructSchema()){const u=r.isUnionSchema();let c;u&&(c=new Ge(t,a));for(const[d,l]of r.structIterator()){const g=l.getMergedTraits(),f=g.httpPayload?g.xmlName??l.getName():l.getMemberTraits().xmlName??d;u&&c.mark(f),t[f]!=null&&(a[d]=this.readSchema(l,t[f]))}return u&&c.writeUnknown(),a}if(r.isDocumentSchema())return t;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,t)}parseXml(e){if(e.length){let t;try{t=Ke(e)}catch(o){throw o&&typeof o=="object"&&Object.defineProperty(o,"$responseBodyText",{value:e}),o}const r="#text",i=Object.keys(t)[0],n=t[i];return n[r]&&(n[i]=n[r],delete n[r]),q(n)}return{}}}class qe extends Y{settings;buffer;constructor(e){super(),this.settings=e}write(e,t,r=""){this.buffer===void 0&&(this.buffer="");const i=S.of(e);if(r&&!r.endsWith(".")&&(r+="."),i.isBlobSchema())(typeof t=="string"||t instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??te)(t)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())t!=null?(this.writeKey(r),this.writeValue(String(t))):i.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(le()));else if(i.isBigIntegerSchema())t!=null&&(this.writeKey(r),this.writeValue(String(t)));else if(i.isBigDecimalSchema())t!=null&&(this.writeKey(r),this.writeValue(t instanceof G?t.string:String(t)));else if(i.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(r),W(i,this.settings)){case 5:this.writeValue(t.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(se(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(i.isDocumentSchema())Array.isArray(t)?this.write(79,t,r):t instanceof Date?this.write(4,t,r):t instanceof Uint8Array?this.write(21,t,r):t&&typeof t=="object"?this.write(143,t,r):(this.writeKey(r),this.writeValue(String(t)));else if(i.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{const n=i.getValueSchema(),o=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let a=1;for(const u of t){if(u==null)continue;const c=this.getKey("member",n.getMergedTraits().xmlName),d=o?`${r}${a}`:`${r}${c}.${a}`;this.write(n,u,d),++a}}}else if(i.isMapSchema()){if(t&&typeof t=="object"){const n=i.getKeySchema(),o=i.getValueSchema(),a=i.getMergedTraits().xmlFlattened;let u=1;for(const[c,d]of Object.entries(t)){if(d==null)continue;const l=this.getKey("key",n.getMergedTraits().xmlName),g=a?`${r}${u}.${l}`:`${r}entry.${u}.${l}`,f=this.getKey("value",o.getMergedTraits().xmlName),m=a?`${r}${u}.${f}`:`${r}entry.${u}.${f}`;this.write(n,c,g),this.write(o,d,m),++u}}}else if(i.isStructSchema()){if(t&&typeof t=="object"){let n=!1;for(const[o,a]of We(i,t)){if(t[o]==null&&!a.isIdempotencyToken())continue;const u=this.getKey(o,a.getMergedTraits().xmlName),c=`${r}${u}`;this.write(a,t[o],c),n=!0}if(!n&&i.isUnionSchema()){const{$unknown:o}=t;if(Array.isArray(o)){const[a,u]=o,c=`${r}${a}`;this.write(15,u,c)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const e=this.buffer;return delete this.buffer,e}getKey(e,t){const r=t??e;return this.settings.capitalizeKeys?r[0].toUpperCase()+r.slice(1):r}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${U(e)}=`}writeValue(e){this.buffer+=U(e)}}class ft extends ge{options;serializer;deserializer;mixin=new He;constructor(e){super({defaultNamespace:e.defaultNamespace}),this.options=e;const t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new qe(t),this.deserializer=new Qe(t)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,t,r){const i=await super.serializeRequest(e,t,r);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),(fe(e.input)==="unit"||!i.body)&&(i.body="");const n=e.name.split("#")[1]??e.name;return i.body=`Action=${n}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(e,t,r){const i=this.deserializer,n=S.of(e.output),o={};if(r.statusCode>=300){const l=await P(r.body,t);l.byteLength>0&&Object.assign(o,await i.read(15,l)),await this.handleError(e,t,r,o,this.deserializeMetadata(r))}for(const l in r.headers){const g=r.headers[l];delete r.headers[l],r.headers[l.toLowerCase()]=g}const a=e.name.split("#")[1]??e.name,u=n.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,c=await P(r.body,t);return c.byteLength>0&&Object.assign(o,await i.read(n,c,u)),{$metadata:this.deserializeMetadata(r),...o}}useNestedResult(){return!0}async handleError(e,t,r,i,n){const o=this.loadQueryErrorCode(r,i)??"Unknown",a=this.loadQueryError(i),u=this.loadQueryErrorMessage(i);a.message=u,a.Error={Type:a.Type,Code:a.Code,Message:u};const{errorSchema:c,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,a,n,this.mixin.findQueryCompatibleError),l=S.of(c),g=N.for(c[1]).getErrorCtor(c)??Error,f=new g(u),m={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(const[p,D]of l.structIterator()){const _=D.getMergedTraits().xmlName??p,Z=a[_]??i[_];m[p]=this.deserializer.readSchema(D,Z)}throw this.mixin.decorateServiceException(Object.assign(f,d,{$fault:l.getMergedTraits().error,message:u},m),i)}loadQueryErrorCode(e,t){const r=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(r!==void 0)return r;if(e.statusCode==404)return"NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){const t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}const Xe=/\d{12}\.ddb/;async function Je(s,e,t){if(t.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&h(s,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const n=await e.retryStrategy();typeof n.acquireInitialRetryToken=="function"?n.constructor?.name?.includes("Adaptive")?h(s,"RETRY_MODE_ADAPTIVE","F"):h(s,"RETRY_MODE_STANDARD","E"):h(s,"RETRY_MODE_LEGACY","D")}if(typeof e.accountIdEndpointMode=="function"){const n=s.endpointV2;switch(String(n?.url?.hostname).match(Xe)&&h(s,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":h(s,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":h(s,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":h(s,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=s.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const n=i;n.accountId&&h(s,"RESOLVED_ACCOUNT_ID","T");for(const[o,a]of Object.entries(n.$source??{}))h(s,o,a)}}const v="user-agent",A="x-amz-user-agent",V=" ",T="/",Ye=/[^!$%&'*+\-.^_`|~\w]/g,Ze=/[^!$%&'*+\-.^_`|~\w#]/g,j="-",et=1024;function tt(s){let e="";for(const t in s){const r=s[t];if(e.length+r.length+1<=et){e.length?e+=","+r:e+=r;continue}break}return e}const st=s=>(e,t)=>async r=>{const{request:i}=r;if(!k.isInstance(i))return e(r);const{headers:n}=i,o=t?.userAgent?.map(b)||[],a=(await s.defaultUserAgentProvider()).map(b);await Je(t,s,r);const u=t;a.push(`m/${tt(Object.assign({},t.__smithy_context?.features,u.__aws_sdk_context?.features))}`);const c=s?.customUserAgent?.map(b)||[],d=await s.userAgentAppId();d&&a.push(b(["app",`${d}`]));const l=[].concat([...a,...o,...c]).join(V),g=[...a.filter(f=>f.startsWith("aws-sdk-")),...c].join(V);return s.runtime!=="browser"?(g&&(n[A]=n[A]?`${n[v]} ${g}`:g),n[v]=l):n[A]=l,e({...r,request:i})},b=s=>{const e=s[0].split(T).map(o=>o.replace(Ye,j)).join(T),t=s[1]?.replace(Ze,j),r=e.indexOf(T),i=e.substring(0,r);let n=e.substring(r+1);return i==="api"&&(n=n.toLowerCase()),[i,n,t].filter(o=>o&&o.length>0).reduce((o,a,u)=>{switch(u){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},rt={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},mt=s=>({applyToStack:e=>{e.add(st(s),rt)}}),pt=({serviceId:s,clientVersion:e})=>async t=>{const r=typeof window<"u"?window.navigator:void 0,i=r?.userAgent??"",n=r?.userAgentData?.platform??B.os(i)??"other",o=void 0,a=r?.userAgentData?.brands??[],u=a[a.length-1],c=u?.brand??B.browser(i)??"unknown",d=u?.version??"unknown",l=[["aws-sdk-js",e],["ua","2.1"],[`os/${n}`,o],["lang/js"],["md/browser",`${c}_${d}`]];s&&l.push([`api/${s}`,e]);const g=await t?.userAgentAppId?.();return g&&l.push([`app/${g}`]),l},B={os(s){if(/iPhone|iPad|iPod/.test(s))return"iOS";if(/Macintosh|Mac OS X/.test(s))return"macOS";if(/Windows NT/.test(s))return"Windows";if(/Android/.test(s))return"Android";if(/Linux/.test(s))return"Linux"},browser(s){if(/EdgiOS|EdgA|Edg\//.test(s))return"Microsoft Edge";if(/Firefox\//.test(s))return"Firefox";if(/Chrome\//.test(s))return"Chrome";if(/Safari\//.test(s))return"Safari"}},ht=s=>({setRegion(e){s.region=e},region(){return s.region}}),wt=s=>({region:s.region()});export{ft as A,ze as a,lt as b,pt as c,wt as d,dt as e,mt as f,ht as g,at as h,ct as i,ut as j,ot as k,gt as r,Le as s};
|