/*! For license information please see component---pages-copy-azure-marketplace-landing-tsx-dc60d7b8836d724ec0dc.js.LICENSE.txt */ (self.webpackChunk_toloka_portal_gatsby_renderer=self.webpackChunk_toloka_portal_gatsby_renderer||[]).push([[8565],{87757:function(e,t,r){r(35666)},19662:function(e,t,r){var n=r(17854),o=r(60614),i=r(66330),a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not a function")}},39483:function(e,t,r){var n=r(17854),o=r(4411),i=r(66330),a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not a constructor")}},19670:function(e,t,r){var n=r(17854),o=r(70111),i=n.String,a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not an object")}},41318:function(e,t,r){var n=r(45656),o=r(51400),i=r(26244),a=function(e){return function(t,r,a){var s,c=n(t),u=i(c),l=o(a,u);if(e&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},84326:function(e,t,r){var n=r(1702),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},70648:function(e,t,r){var n=r(17854),o=r(51694),i=r(60614),a=r(84326),s=r(5112)("toStringTag"),c=n.Object,u="Arguments"==a(function(){return arguments}());e.exports=o?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(r){}}(t=c(e),s))?r:u?a(t):"Object"==(n=a(t))&&i(t.callee)?"Arguments":n}},99920:function(e,t,r){var n=r(92597),o=r(53887),i=r(31236),a=r(3070);e.exports=function(e,t,r){for(var s=o(t),c=a.f,u=i.f,l=0;l0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},80748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},82109:function(e,t,r){var n=r(17854),o=r(31236).f,i=r(68880),a=r(31320),s=r(83505),c=r(99920),u=r(54705);e.exports=function(e,t){var r,l,d,h,p,f=e.target,g=e.global,m=e.stat;if(r=g?n:m?n[f]||s(f,{}):(n[f]||{}).prototype)for(l in t){if(h=t[l],d=e.noTargetGet?(p=o(r,l))&&p.value:r[l],!u(g?l:f+(m?".":"#")+l,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;c(h,d)}(e.sham||d&&d.sham)&&i(h,"sham",!0),a(r,l,h,e)}}},47293:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},34374:function(e,t,r){var n=r(47293);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},46916:function(e,t,r){var n=r(34374),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},76530:function(e,t,r){var n=r(19781),o=r(92597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},1702:function(e,t,r){var n=r(34374),o=Function.prototype,i=o.bind,a=o.call,s=n&&i.bind(a,a);e.exports=n?function(e){return e&&s(e)}:function(e){return e&&function(){return a.apply(e,arguments)}}},35005:function(e,t,r){var n=r(17854),o=r(60614),i=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e]):n[e]&&n[e][t]}},58173:function(e,t,r){var n=r(19662);e.exports=function(e,t){var r=e[t];return null==r?void 0:n(r)}},17854:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},92597:function(e,t,r){var n=r(1702),o=r(47908),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},3501:function(e){e.exports={}},64664:function(e,t,r){var n=r(19781),o=r(47293),i=r(80317);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},68361:function(e,t,r){var n=r(17854),o=r(1702),i=r(47293),a=r(84326),s=n.Object,c=o("".split);e.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?c(e,""):s(e)}:s},42788:function(e,t,r){var n=r(1702),o=r(60614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},29909:function(e,t,r){var n,o,i,a=r(68536),s=r(17854),c=r(1702),u=r(70111),l=r(68880),d=r(92597),h=r(5465),p=r(6200),f=r(3501),g="Object already initialized",m=s.TypeError,v=s.WeakMap;if(a||h.state){var y=h.state||(h.state=new v),_=c(y.get),E=c(y.has),C=c(y.set);n=function(e,t){if(E(y,e))throw new m(g);return t.facade=e,C(y,e,t),t},o=function(e){return _(y,e)||{}},i=function(e){return E(y,e)}}else{var w=p("state");f[w]=!0,n=function(e,t){if(d(e,w))throw new m(g);return t.facade=e,l(e,w,t),t},o=function(e){return d(e,w)?e[w]:{}},i=function(e){return d(e,w)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=o(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},60614:function(e){e.exports=function(e){return"function"==typeof e}},4411:function(e,t,r){var n=r(1702),o=r(47293),i=r(60614),a=r(70648),s=r(35005),c=r(42788),u=function(){},l=[],d=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,p=n(h.exec),f=!h.exec(u),g=function(e){if(!i(e))return!1;try{return d(u,l,e),!0}catch(t){return!1}},m=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(h,c(e))}catch(t){return!0}};m.sham=!0,e.exports=!d||o((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?m:g},54705:function(e,t,r){var n=r(47293),o=r(60614),i=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r==l||r!=u&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},70111:function(e,t,r){var n=r(60614);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},31913:function(e){e.exports=!1},52190:function(e,t,r){var n=r(17854),o=r(35005),i=r(60614),a=r(47976),s=r(43307),c=n.Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=o("Symbol");return i(t)&&a(t.prototype,c(e))}},26244:function(e,t,r){var n=r(17466);e.exports=function(e){return n(e.length)}},13366:function(e,t,r){var n=r(17854);e.exports=n.Promise},30133:function(e,t,r){var n=r(7392),o=r(47293);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},68536:function(e,t,r){var n=r(17854),o=r(60614),i=r(42788),a=n.WeakMap;e.exports=o(a)&&/native code/.test(i(a))},78523:function(e,t,r){"use strict";var n=r(19662),o=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new o(e)}},3070:function(e,t,r){var n=r(17854),o=r(19781),i=r(64664),a=r(3353),s=r(19670),c=r(34948),u=n.TypeError,l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h="enumerable",p="configurable",f="writable";t.f=o?a?function(e,t,r){if(s(e),t=c(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&f in r&&!r.writable){var n=d(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:p in r?r.configurable:n.configurable,enumerable:h in r?r.enumerable:n.enumerable,writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(s(e),t=c(t),s(r),i)try{return l(e,t,r)}catch(n){}if("get"in r||"set"in r)throw u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},31236:function(e,t,r){var n=r(19781),o=r(46916),i=r(55296),a=r(79114),s=r(45656),c=r(34948),u=r(92597),l=r(64664),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=s(e),t=c(t),l)try{return d(e,t)}catch(r){}if(u(e,t))return a(!o(i.f,e,t),e[t])}},8006:function(e,t,r){var n=r(16324),o=r(80748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},25181:function(e,t){t.f=Object.getOwnPropertySymbols},47976:function(e,t,r){var n=r(1702);e.exports=n({}.isPrototypeOf)},16324:function(e,t,r){var n=r(1702),o=r(92597),i=r(45656),a=r(41318).indexOf,s=r(3501),c=n([].push);e.exports=function(e,t){var r,n=i(e),u=0,l=[];for(r in n)!o(s,r)&&o(n,r)&&c(l,r);for(;t.length>u;)o(n,r=t[u++])&&(~a(l,r)||c(l,r));return l}},55296:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},92140:function(e,t,r){var n=r(17854),o=r(46916),i=r(60614),a=r(70111),s=n.TypeError;e.exports=function(e,t){var r,n;if("string"===t&&i(r=e.toString)&&!a(n=o(r,e)))return n;if(i(r=e.valueOf)&&!a(n=o(r,e)))return n;if("string"!==t&&i(r=e.toString)&&!a(n=o(r,e)))return n;throw s("Can't convert object to primitive value")}},53887:function(e,t,r){var n=r(35005),o=r(1702),i=r(8006),a=r(25181),s=r(19670),c=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?c(t,r(e)):t}},69478:function(e,t,r){var n=r(19670),o=r(70111),i=r(78523);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},31320:function(e,t,r){var n=r(17854),o=r(60614),i=r(92597),a=r(68880),s=r(83505),c=r(42788),u=r(29909),l=r(76530).CONFIGURABLE,d=u.get,h=u.enforce,p=String(String).split("String");(e.exports=function(e,t,r,c){var u,d=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,g=!!c&&!!c.noTargetGet,m=c&&void 0!==c.name?c.name:t;o(r)&&("Symbol("===String(m).slice(0,7)&&(m="["+String(m).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!i(r,"name")||l&&r.name!==m)&&a(r,"name",m),(u=h(r)).source||(u.source=p.join("string"==typeof m?m:""))),e!==n?(d?!g&&e[t]&&(f=!0):delete e[t],f?e[t]=r:a(e,t,r)):f?e[t]=r:s(t,r)})(Function.prototype,"toString",(function(){return o(this)&&d(this).source||c(this)}))},84488:function(e,t,r){var n=r(17854).TypeError;e.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},83505:function(e,t,r){var n=r(17854),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},6200:function(e,t,r){var n=r(72309),o=r(69711),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},5465:function(e,t,r){var n=r(17854),o=r(83505),i="__core-js_shared__",a=n[i]||o(i,{});e.exports=a},72309:function(e,t,r){var n=r(31913),o=r(5465);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"})},36707:function(e,t,r){var n=r(19670),o=r(39483),i=r(5112)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||null==(r=n(a)[i])?t:o(r)}},51400:function(e,t,r){var n=r(19303),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},45656:function(e,t,r){var n=r(68361),o=r(84488);e.exports=function(e){return n(o(e))}},19303:function(e){var t=Math.ceil,r=Math.floor;e.exports=function(e){var n=+e;return n!=n||0===n?0:(n>0?r:t)(n)}},17466:function(e,t,r){var n=r(19303),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},47908:function(e,t,r){var n=r(17854),o=r(84488),i=n.Object;e.exports=function(e){return i(o(e))}},57593:function(e,t,r){var n=r(17854),o=r(46916),i=r(70111),a=r(52190),s=r(58173),c=r(92140),u=r(5112),l=n.TypeError,d=u("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,n=s(e,d);if(n){if(void 0===t&&(t="default"),r=o(n,e,t),!i(r)||a(r))return r;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},34948:function(e,t,r){var n=r(57593),o=r(52190);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},51694:function(e,t,r){var n={};n[r(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},66330:function(e,t,r){var n=r(17854).String;e.exports=function(e){try{return n(e)}catch(t){return"Object"}}},69711:function(e,t,r){var n=r(1702),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},43307:function(e,t,r){var n=r(30133);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(e,t,r){var n=r(19781),o=r(47293);e.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:function(e,t,r){var n=r(17854),o=r(72309),i=r(92597),a=r(69711),s=r(30133),c=r(43307),u=o("wks"),l=n.Symbol,d=l&&l.for,h=c?l:l&&l.withoutSetter||a;e.exports=function(e){if(!i(u,e)||!s&&"string"!=typeof u[e]){var t="Symbol."+e;s&&i(l,e)?u[e]=l[e]:u[e]=c&&d?d(t):h(t)}return u[e]}},17727:function(e,t,r){"use strict";var n=r(82109),o=r(31913),i=r(13366),a=r(47293),s=r(35005),c=r(60614),u=r(36707),l=r(69478),d=r(31320);if(n({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,s("Promise")),r=c(e);return this.then(r?function(r){return l(t,e()).then((function(){return r}))}:e,r?function(r){return l(t,e()).then((function(){throw r}))}:e)}}),!o&&c(i)){var h=s("Promise").prototype.finally;i.prototype.finally!==h&&d(i.prototype,"finally",h,{unsafe:!0})}},8201:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ca}});var n=r(14976),o=r(67911),i=r(74533),a=r(88586),s=r(92401),c=r(5283),u=r(41752),l=r(29347),d=r(31025),h=r(48647),p=r(43566),f=r(69855),g=r(67146),m=r(55730),v=r(86564),y=r(86675),_=r(37990),E=r(52893),C=r(93252),w=r(88709),T=r(51512),S=r(31583),I=r(3468),b=r(24696),A=r(25109),R=r(4511),k=r(88308),N=r(88785),P=r(41480),O=r(88493),M=r(79522),U=r(88605),x=r(83125),q=r(86365),H=r(56501),L=r(92229),D=r(39663),F=r(98894),j=r(69196),K=r(16922),G=r(7461),B=r(86457),z=function(e,t){return z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},z(e,t)};function Y(e,t){function r(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var W,V,J=function(){return J=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function $(){for(var e=[],t=0;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]>>6),i[a++]=128+(63&t)):t<65536?(i[a++]=224+(t>>>12),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<2097152?(i[a++]=240+(t>>>18),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<67108864?(i[a++]=248+(t>>>24),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):(i[a++]=252+(t>>>30),i[a++]=128+(t>>>24&63),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t));return i},e.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n251&&r<254&&o+5247&&r<252&&o+4239&&r<248&&o+3223&&r<240&&o+2191&&r<224&&o+1>>n&24),2!==n&&e.length-a!=1||(r+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0===t?r:r.substring(0,r.length-t)+(1===t?"=":"==")},e.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},e}(),wt=function(){function e(){}return e.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var r=this.base64DecToArr(t);return Et.utf8ArrToString(r)},e.prototype.base64DecToArr=function(e,t){for(var r=e.replace(/[^A-Za-z0-9\+\/]/g,de.EMPTY_STRING),n=r.length,o=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,i=new Uint8Array(o),a=void 0,s=void 0,c=0,u=0,l=0;l>>(16>>>a&24)&255;c=0}return i},e.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0},e}(),Tt={code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},St={code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},It={code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},bt={code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},At={code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},Rt={code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},kt={code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},Nt={code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},Pt={code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},Ot={code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},Mt={code:"state_not_found",desc:"State not found"},Ut={code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},xt={code:"nonce_not_found",desc:"nonce not found"},qt={code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},Ht={code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},Lt={code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},Dt={code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},Ft={code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},jt={code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},Kt={code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},Gt={code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},Bt={code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},zt={code:"device_code_expired",desc:"Device code is expired."},Yt={code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},Wt={code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},Vt={code:"invalid_cache_record",desc:"Cache record object was null or undefined."},Jt={code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},Qt={code:"no_account_found",desc:"No account found in cache for given key."},Xt={code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},Zt={code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},$t={code:"invalid_cache_type",desc:"Invalid cache type"},er={code:"unexpected_account_type",desc:"Unexpected account type."},tr={code:"unexpected_credential_type",desc:"Unexpected credential type."},rr={code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},nr={code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},or={code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},ir={code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},ar={code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},sr={code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},cr={code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},ur={code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},lr={code:"key_id_missing",desc:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."},dr=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientAuthError",Object.setPrototypeOf(o,t.prototype),o}return te(t,e),t.createClientInfoDecodingError=function(e){return new t(Tt.code,Tt.desc+" Failed with error: "+e)},t.createClientInfoEmptyError=function(){return new t(St.code,""+St.desc)},t.createTokenParsingError=function(e){return new t(It.code,It.desc+" Failed with error: "+e)},t.createTokenNullOrEmptyError=function(e){return new t(bt.code,bt.desc+" Raw Token Value: "+e)},t.createEndpointDiscoveryIncompleteError=function(e){return new t(At.code,At.desc+" Detail: "+e)},t.createNetworkError=function(e,r){return new t(Rt.code,Rt.desc+" | Fetch client threw: "+r+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToGetOpenidConfigError=function(e){return new t(kt.code,kt.desc+" Attempted to retrieve endpoints from: "+e)},t.createHashNotDeserializedError=function(e){return new t(Nt.code,Nt.desc+" Given Object: "+e)},t.createInvalidStateError=function(e,r){return new t(Pt.code,Pt.desc+" Invalid State: "+e+", Root Err: "+r)},t.createStateMismatchError=function(){return new t(Ot.code,Ot.desc)},t.createStateNotFoundError=function(e){return new t(Mt.code,Mt.desc+": "+e)},t.createNonceMismatchError=function(){return new t(Ut.code,Ut.desc)},t.createNonceNotFoundError=function(e){return new t(xt.code,xt.desc+": "+e)},t.createMultipleMatchingTokensInCacheError=function(){return new t(qt.code,qt.desc+".")},t.createMultipleMatchingAccountsInCacheError=function(){return new t(Ht.code,Ht.desc)},t.createMultipleMatchingAppMetadataInCacheError=function(){return new t(Lt.code,Lt.desc)},t.createTokenRequestCannotBeMadeError=function(){return new t(Dt.code,Dt.desc)},t.createAppendEmptyScopeToSetError=function(e){return new t(Ft.code,Ft.desc+" Given Scope: "+e)},t.createRemoveEmptyScopeFromSetError=function(e){return new t(jt.code,jt.desc+" Given Scope: "+e)},t.createAppendScopeSetError=function(e){return new t(Kt.code,Kt.desc+" Detail Error: "+e)},t.createEmptyInputScopeSetError=function(){return new t(Gt.code,""+Gt.desc)},t.createDeviceCodeCancelledError=function(){return new t(Bt.code,""+Bt.desc)},t.createDeviceCodeExpiredError=function(){return new t(zt.code,""+zt.desc)},t.createDeviceCodeUnknownError=function(){return new t(Yt.code,""+Yt.desc)},t.createNoAccountInSilentRequestError=function(){return new t(Wt.code,""+Wt.desc)},t.createNullOrUndefinedCacheRecord=function(){return new t(Vt.code,Vt.desc)},t.createInvalidCacheEnvironmentError=function(){return new t(Jt.code,Jt.desc)},t.createNoAccountFoundError=function(){return new t(Qt.code,Qt.desc)},t.createCachePluginError=function(){return new t(Xt.code,""+Xt.desc)},t.createNoCryptoObjectError=function(e){return new t(Zt.code,""+Zt.desc+e)},t.createInvalidCacheTypeError=function(){return new t($t.code,""+$t.desc)},t.createUnexpectedAccountTypeError=function(){return new t(er.code,""+er.desc)},t.createUnexpectedCredentialTypeError=function(){return new t(tr.code,""+tr.desc)},t.createInvalidAssertionError=function(){return new t(rr.code,""+rr.desc)},t.createInvalidCredentialError=function(){return new t(nr.code,""+nr.desc)},t.createRefreshRequiredError=function(){return new t(or.code,or.desc)},t.createUserTimeoutReachedError=function(){return new t(ir.code,ir.desc)},t.createTokenClaimsRequiredError=function(){return new t(ar.code,ar.desc)},t.createNoAuthCodeInServerResponseError=function(){return new t(sr.code,sr.desc)},t.createBindingKeyNotRemovedError=function(){return new t(cr.code,cr.desc)},t.createLogoutNotSupportedError=function(){return new t(ur.code,ur.desc)},t.createKeyIdMissingError=function(){return new t(lr.code,lr.desc)},t}(pt),hr=function(){function e(){}return e.decodeAuthToken=function(t){if(e.isEmpty(t))throw dr.createTokenNullOrEmptyError(t);var r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw dr.createTokenParsingError("Given token is malformed: "+JSON.stringify(t));return{header:r[1],JWSPayload:r[2],JWSSig:r[3]}},e.isEmpty=function(e){return void 0===e||!e||0===e.length},e.isEmptyObj=function(t){if(t&&!e.isEmpty(t))try{var r=JSON.parse(t);return 0===Object.keys(r).length}catch(n){}return!0},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},e.queryStringToObject=function(e){var t={},r=e.split("&"),n=function(e){return decodeURIComponent(e.replace(/\+/g," "))};return r.forEach((function(e){if(e.trim()){var r=e.split(/=(.+)/g,2),o=r[0],i=r[1];o&&i&&(t[n(o)]=n(i))}})),t},e.trimArrayEntries=function(e){return e.map((function(e){return e.trim()}))},e.removeEmptyStringsFromArray=function(t){return t.filter((function(t){return!e.isEmpty(t)}))},e.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(t){return null}},e.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},e}(),pr={code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},fr={code:"crypto_nonexistent",desc:"The crypto object or function is not available."},gr={code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},mr={code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},vr={code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},yr={code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},_r={code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},Er={code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},Cr={code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},wr={code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},Tr={code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},Sr={code:"empty_window_error",desc:"window.open returned null or undefined window object."},Ir={code:"user_cancelled",desc:"User cancelled the flow."},br={code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},Ar={code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},Rr={code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},kr={code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},Nr={code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},Pr={code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},Or={code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},Mr={code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},Ur={code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none'."},xr={code:"no_token_request_cache_error",desc:"No token request found in cache."},qr={code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},Hr={code:"no_cached_authority_error",desc:"No cached authority found."},Lr={code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},Dr={code:"invalid_cache_type",desc:"Invalid cache type"},Fr={code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},jr={code:"database_not_open",desc:"Database is not open!"},Kr={code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},Gr={code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},Br={code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},zr={code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},Yr={code:"unable_to_load_token",desc:"Error loading token to cache."},Wr={code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},Vr={code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},Jr={code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},Qr={code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},Xr={code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},Zr={code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},$r={code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},en={code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},tn={code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},rn={code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."},nn=function(e){function t(r,n){var o=e.call(this,r,n)||this;return Object.setPrototypeOf(o,t.prototype),o.name="BrowserAuthError",o}return Y(t,e),t.createPkceNotGeneratedError=function(e){return new t(pr.code,pr.desc+" Detail:"+e)},t.createCryptoNotAvailableError=function(e){return new t(fr.code,fr.desc+" Detail:"+e)},t.createHttpMethodNotImplementedError=function(e){return new t(gr.code,gr.desc+" Given Method: "+e)},t.createEmptyNavigationUriError=function(){return new t(mr.code,mr.desc)},t.createEmptyHashError=function(e){return new t(vr.code,vr.desc+" Given Url: "+e)},t.createHashDoesNotContainStateError=function(){return new t(yr.code,yr.desc)},t.createHashDoesNotContainKnownPropertiesError=function(){return new t(_r.code,_r.desc)},t.createUnableToParseStateError=function(){return new t(Er.code,Er.desc)},t.createStateInteractionTypeMismatchError=function(){return new t(Cr.code,Cr.desc)},t.createInteractionInProgressError=function(){return new t(wr.code,wr.desc)},t.createPopupWindowError=function(e){var r=Tr.desc;return r=hr.isEmpty(e)?r:r+" Details: "+e,new t(Tr.code,r)},t.createEmptyWindowCreatedError=function(){return new t(Sr.code,Sr.desc)},t.createUserCancelledError=function(){return new t(Ir.code,Ir.desc)},t.createMonitorPopupTimeoutError=function(){return new t(br.code,br.desc)},t.createMonitorIframeTimeoutError=function(){return new t(Ar.code,Ar.desc)},t.createRedirectInIframeError=function(e){return new t(Rr.code,Rr.desc+" (window.parent !== window) => "+e)},t.createBlockReloadInHiddenIframeError=function(){return new t(kr.code,kr.desc)},t.createBlockAcquireTokenInPopupsError=function(){return new t(Nr.code,Nr.desc)},t.createIframeClosedPrematurelyError=function(){return new t(Pr.code,Pr.desc)},t.createSilentLogoutUnsupportedError=function(){return new t(Or.code,Or.desc)},t.createNoAccountError=function(){return new t(Mr.code,Mr.desc)},t.createSilentPromptValueError=function(e){return new t(Ur.code,Ur.desc+" Given value: "+e)},t.createUnableToParseTokenRequestCacheError=function(){return new t(qr.code,qr.desc)},t.createNoTokenRequestCacheError=function(){return new t(xr.code,xr.desc)},t.createAuthRequestNotSetError=function(){return new t(Lr.code,Lr.desc)},t.createNoCachedAuthorityError=function(){return new t(Hr.code,Hr.desc)},t.createInvalidCacheTypeError=function(){return new t(Dr.code,""+Dr.desc)},t.createNonBrowserEnvironmentError=function(){return new t(Fr.code,Fr.desc)},t.createDatabaseNotOpenError=function(){return new t(jr.code,jr.desc)},t.createNoNetworkConnectivityError=function(){return new t(Kr.code,Kr.desc)},t.createPostRequestFailedError=function(e,r){return new t(Gr.code,Gr.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createGetRequestFailedError=function(e,r){return new t(Br.code,Br.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createFailedToParseNetworkResponseError=function(e){return new t(zr.code,zr.desc+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToLoadTokenError=function(e){return new t(Yr.code,Yr.desc+" | "+e)},t.createSigningKeyNotFoundInStorageError=function(e){return new t(Wr.code,Wr.desc+" | No match found for KeyId: "+e)},t.createAuthCodeRequiredError=function(){return new t(Vr.code,Vr.desc)},t.createAuthCodeOrNativeAccountIdRequiredError=function(){return new t(Jr.code,Jr.desc)},t.createDatabaseUnavailableError=function(){return new t(Qr.code,Qr.desc)},t.createUnableToAcquireTokenFromNativePlatformError=function(){return new t(Xr.code,Xr.desc)},t.createNativeHandshakeTimeoutError=function(){return new t(Zr.code,Zr.desc)},t.createNativeExtensionNotInstalledError=function(){return new t($r.code,$r.desc)},t.createNativeConnectionNotEstablishedError=function(){return new t(en.code,en.desc)},t.createNativeBrokerCalledBeforeInitialize=function(){return new t(tn.code,tn.desc)},t.createNativePromptParameterNotSupportedError=function(){return new t(rn.code,rn.desc)},t}(pt),on=function(){function e(e){this.base64Encode=new Ct,this.cryptoObj=e}return e.prototype.generateCodes=function(){return Q(this,void 0,void 0,(function(){var e,t;return X(this,(function(r){switch(r.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=r.sent(),[2,{verifier:e,challenge:t}]}}))}))},e.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(t){throw nn.createPkceNotGeneratedError(t)}},e.prototype.generateCodeChallengeFromVerifier=function(e){return Q(this,void 0,void 0,(function(){var t,r;return X(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=n.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw r=n.sent(),nn.createPkceNotGeneratedError(r);case 3:return[2]}}))}))},e}(),an="SHA-256",sn=new Uint8Array([1,0,1]),cn=function(){function e(e){if(this.logger=e,!this.hasCryptoAPI())throw nn.createCryptoNotAvailableError("Browser crypto or msCrypto object not available.");this._keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:an,modulusLength:2048,publicExponent:sn}}return e.prototype.sha256Digest=function(e){return Q(this,void 0,void 0,(function(){var t;return X(this,(function(r){return t=Et.stringToUtf8Arr(e),[2,this.hasIECrypto()?this.getMSCryptoDigest(an,t):this.getSubtleCryptoDigest(an,t)]}))}))},e.prototype.getRandomValues=function(e){var t=window.msCrypto||window.crypto;if(!t.getRandomValues)throw nn.createCryptoNotAvailableError("getRandomValues does not exist.");t.getRandomValues(e)},e.prototype.generateKeyPair=function(e,t){return Q(this,void 0,void 0,(function(){return X(this,(function(r){return[2,this.hasIECrypto()?this.msCryptoGenerateKey(e,t):window.crypto.subtle.generateKey(this._keygenAlgorithmOptions,e,t)]}))}))},e.prototype.exportJwk=function(e){return Q(this,void 0,void 0,(function(){return X(this,(function(t){return[2,this.hasIECrypto()?this.msCryptoExportJwk(e):window.crypto.subtle.exportKey(ct,e)]}))}))},e.prototype.importJwk=function(t,r,n){return Q(this,void 0,void 0,(function(){var o,i;return X(this,(function(a){return o=e.getJwkString(t),i=Et.stringToArrayBuffer(o),[2,this.hasIECrypto()?this.msCryptoImportKey(i,r,n):window.crypto.subtle.importKey(ct,t,this._keygenAlgorithmOptions,r,n)]}))}))},e.prototype.sign=function(e,t){return Q(this,void 0,void 0,(function(){return X(this,(function(r){return[2,this.hasIECrypto()?this.msCryptoSign(e,t):window.crypto.subtle.sign(this._keygenAlgorithmOptions,e,t)]}))}))},e.prototype.hasCryptoAPI=function(){return this.hasIECrypto()||this.hasBrowserCrypto()},e.prototype.hasIECrypto=function(){return"msCrypto"in window},e.prototype.hasBrowserCrypto=function(){return"crypto"in window},e.prototype.getSubtleCryptoDigest=function(e,t){return Q(this,void 0,void 0,(function(){return X(this,(function(r){return[2,window.crypto.subtle.digest(e,t)]}))}))},e.prototype.getMSCryptoDigest=function(e,t){return Q(this,void 0,void 0,(function(){return X(this,(function(r){return[2,new Promise((function(r,n){var o=window.msCrypto.subtle.digest(e,t.buffer);o.addEventListener("complete",(function(e){r(e.target.result)})),o.addEventListener("error",(function(e){n(e)}))}))]}))}))},e.prototype.msCryptoGenerateKey=function(e,t){return Q(this,void 0,void 0,(function(){var r=this;return X(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.generateKey(r._keygenAlgorithmOptions,e,t);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.prototype.msCryptoExportJwk=function(e){return Q(this,void 0,void 0,(function(){return X(this,(function(t){return[2,new Promise((function(t,r){var n=window.msCrypto.subtle.exportKey(ct,e);n.addEventListener("complete",(function(e){var n=e.target.result,o=Et.utf8ArrToString(new Uint8Array(n)).replace(/\r/g,de.EMPTY_STRING).replace(/\n/g,de.EMPTY_STRING).replace(/\t/g,de.EMPTY_STRING).split(" ").join(de.EMPTY_STRING).replace("\0",de.EMPTY_STRING);try{t(JSON.parse(o))}catch(e){r(e)}})),n.addEventListener("error",(function(e){r(e)}))}))]}))}))},e.prototype.msCryptoImportKey=function(e,t,r){return Q(this,void 0,void 0,(function(){var n=this;return X(this,(function(o){return[2,new Promise((function(o,i){var a=window.msCrypto.subtle.importKey(ct,e,n._keygenAlgorithmOptions,t,r);a.addEventListener("complete",(function(e){o(e.target.result)})),a.addEventListener("error",(function(e){i(e)}))}))]}))}))},e.prototype.msCryptoSign=function(e,t){return Q(this,void 0,void 0,(function(){var r=this;return X(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.sign(r._keygenAlgorithmOptions,e,t);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.getJwkString=function(e){return JSON.stringify(e,Object.keys(e).sort())},e}(),un=function(){function e(){this.dbName=lt,this.version=1,this.tableName="msal.db.keys",this.dbOpen=!1}return e.prototype.open=function(){return Q(this,void 0,void 0,(function(){var e=this;return X(this,(function(t){return[2,new Promise((function(t,r){var n=window.indexedDB.open(e.dbName,e.version);n.addEventListener("upgradeneeded",(function(t){t.target.result.createObjectStore(e.tableName)})),n.addEventListener("success",(function(r){var n=r;e.db=n.target.result,e.dbOpen=!0,t()})),n.addEventListener("error",(function(){return r(nn.createDatabaseUnavailableError())}))}))]}))}))},e.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},e.prototype.validateDbIsOpen=function(){return Q(this,void 0,void 0,(function(){return X(this,(function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}}))}))},e.prototype.getItem=function(e){return Q(this,void 0,void 0,(function(){var t=this;return X(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(nn.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).get(e);o.addEventListener("success",(function(e){var n=e;t.closeConnection(),r(n.target.result)})),o.addEventListener("error",(function(e){t.closeConnection(),n(e)}))}))]}}))}))},e.prototype.setItem=function(e,t){return Q(this,void 0,void 0,(function(){var r=this;return X(this,(function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise((function(n,o){if(!r.db)return o(nn.createDatabaseNotOpenError());var i=r.db.transaction([r.tableName],"readwrite").objectStore(r.tableName).put(t,e);i.addEventListener("success",(function(){r.closeConnection(),n()})),i.addEventListener("error",(function(e){r.closeConnection(),o(e)}))}))]}}))}))},e.prototype.removeItem=function(e){return Q(this,void 0,void 0,(function(){var t=this;return X(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(nn.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readwrite").objectStore(t.tableName).delete(e);o.addEventListener("success",(function(){t.closeConnection(),r()})),o.addEventListener("error",(function(e){t.closeConnection(),n(e)}))}))]}}))}))},e.prototype.getKeys=function(){return Q(this,void 0,void 0,(function(){var e=this;return X(this,(function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise((function(t,r){if(!e.db)return r(nn.createDatabaseNotOpenError());var n=e.db.transaction([e.tableName],"readonly").objectStore(e.tableName).getAllKeys();n.addEventListener("success",(function(r){var n=r;e.closeConnection(),t(n.target.result)})),n.addEventListener("error",(function(t){e.closeConnection(),r(t)}))}))]}}))}))},e.prototype.containsKey=function(e){return Q(this,void 0,void 0,(function(){var t=this;return X(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(nn.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).count(e);o.addEventListener("success",(function(e){var n=e;t.closeConnection(),r(1===n.target.result)})),o.addEventListener("error",(function(e){t.closeConnection(),n(e)}))}))]}}))}))},e.prototype.deleteDatabase=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return this.db&&this.dbOpen&&this.closeConnection(),[4,window.indexedDB.databases()];case 1:return e=t.sent(),e.find((function(e){return e.name===lt}))?[2,new Promise((function(e,t){var r=window.indexedDB.deleteDatabase(lt);r.addEventListener("success",(function(){return e(!0)})),r.addEventListener("error",(function(){return t(!1)}))}))]:[2,!0]}}))}))},e}(),ln=function(){function e(){this.cache=new Map}return e.prototype.getItem=function(e){return this.cache.get(e)||null},e.prototype.setItem=function(e,t){this.cache.set(e,t)},e.prototype.removeItem=function(e){this.cache.delete(e)},e.prototype.getKeys=function(){var e=[];return this.cache.forEach((function(t,r){e.push(r)})),e},e.prototype.containsKey=function(e){return this.cache.has(e)},e.prototype.clear=function(){this.cache.clear()},e}(),dn=function(){function e(e,t){this.inMemoryCache=new ln,this.indexedDBCache=new un,this.logger=e,this.storeName=t}return e.prototype.handleDatabaseAccessError=function(e){if(!(e instanceof nn&&e.errorCode===Qr.code))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},e.prototype.getItem=function(e){return Q(this,void 0,void 0,(function(){var t,r;return X(this,(function(n){switch(n.label){case 0:if(t=this.inMemoryCache.getItem(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}}))}))},e.prototype.setItem=function(e,t){return Q(this,void 0,void 0,(function(){var r;return X(this,(function(n){switch(n.label){case 0:this.inMemoryCache.setItem(e,t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2]}}))}))},e.prototype.removeItem=function(e){return Q(this,void 0,void 0,(function(){var t;return X(this,(function(r){switch(r.label){case 0:this.inMemoryCache.removeItem(e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}}))}))},e.prototype.getKeys=function(){return Q(this,void 0,void 0,(function(){var e,t;return X(this,(function(r){switch(r.label){case 0:if(0!==(e=this.inMemoryCache.getKeys()).length)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,r.sent()];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}}))}))},e.prototype.containsKey=function(e){return Q(this,void 0,void 0,(function(){var t,r;return X(this,(function(n){switch(n.label){case 0:if(t=this.inMemoryCache.containsKey(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}}))}))},e.prototype.clear=function(){return Q(this,void 0,void 0,(function(){var e,t;return X(this,(function(r){switch(r.label){case 0:this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted"),this.logger.verbose("Deleting persistent keystore "+this.storeName),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.indexedDBCache.deleteDatabase()];case 2:return(e=r.sent())&&this.logger.verbose("Persistent keystore "+this.storeName+" deleted"),[2,e];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[2,!1];case 4:return[2]}}))}))},e}();!function(e){e.asymmetricKeys="asymmetricKeys",e.symmetricKeys="symmetricKeys"}(ut||(ut={}));var hn,pn=function(){function e(e,t){this.logger=e,this.browserCrypto=new cn(this.logger),this.b64Encode=new Ct,this.b64Decode=new wt,this.guidGenerator=new _t(this.browserCrypto),this.pkceGenerator=new on(this.browserCrypto),this.cache={asymmetricKeys:new dn(this.logger,ut.asymmetricKeys),symmetricKeys:new dn(this.logger,ut.symmetricKeys)},this.performanceClient=t}return e.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},e.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},e.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},e.prototype.generatePkceCodes=function(){return Q(this,void 0,void 0,(function(){return X(this,(function(e){return[2,this.pkceGenerator.generateCodes()]}))}))},e.prototype.getPublicKeyThumbprint=function(t){var r;return Q(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l;return X(this,(function(d){switch(d.label){case 0:return n=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(W.CryptoOptsGetPublicKeyThumbprint,t.correlationId),[4,this.browserCrypto.generateKeyPair(e.EXTRACTABLE,e.POP_KEY_USAGES)];case 1:return o=d.sent(),[4,this.browserCrypto.exportJwk(o.publicKey)];case 2:return i=d.sent(),a={e:i.e,kty:i.kty,n:i.n},s=cn.getJwkString(a),[4,this.hashString(s)];case 3:return c=d.sent(),[4,this.browserCrypto.exportJwk(o.privateKey)];case 4:return u=d.sent(),[4,this.browserCrypto.importJwk(u,!1,["sign"])];case 5:return l=d.sent(),[4,this.cache.asymmetricKeys.setItem(c,{privateKey:l,publicKey:o.publicKey,requestMethod:t.resourceRequestMethod,requestUri:t.resourceRequestUri})];case 6:return d.sent(),n&&n.endMeasurement({success:!0}),[2,c]}}))}))},e.prototype.removeTokenBindingKey=function(e){return Q(this,void 0,void 0,(function(){return X(this,(function(t){switch(t.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return t.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return[2,!t.sent()]}}))}))},e.prototype.clearKeystore=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this.logger.verbose("Deleting in-memory and persistent asymmetric key stores"),[4,this.cache.asymmetricKeys.clear()];case 1:return t.sent(),this.logger.verbose("Successfully deleted asymmetric key stores"),this.logger.verbose("Deleting in-memory and persistent symmetric key stores"),[4,this.cache.symmetricKeys.clear()];case 2:return t.sent(),this.logger.verbose("Successfully deleted symmetric key stores"),[2,!0];case 3:return(e=t.sent())instanceof Error?this.logger.error("Clearing keystore failed with error: "+e.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}}))}))},e.prototype.signJwt=function(e,t,r){var n;return Q(this,void 0,void 0,(function(){var o,i,a,s,c,u,l,d,h,p,f,g,m;return X(this,(function(v){switch(v.label){case 0:return o=null===(n=this.performanceClient)||void 0===n?void 0:n.startMeasurement(W.CryptoOptsSignJwt,r),[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(!(i=v.sent()))throw nn.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(i.publicKey)];case 2:return a=v.sent(),s=cn.getJwkString(a),c=this.b64Encode.urlEncode(JSON.stringify({kid:t})),u=vt.getShrHeaderString({kid:c,alg:a.alg}),l=this.b64Encode.urlEncode(u),e.cnf={jwk:JSON.parse(s)},d=this.b64Encode.urlEncode(JSON.stringify(e)),h=l+"."+d,p=Et.stringToArrayBuffer(h),[4,this.browserCrypto.sign(i.privateKey,p)];case 3:return f=v.sent(),g=this.b64Encode.urlEncodeArr(new Uint8Array(f)),m=h+"."+g,o&&o.endMeasurement({success:!0}),[2,m]}}))}))},e.prototype.hashString=function(e){return Q(this,void 0,void 0,(function(){var t,r;return X(this,(function(n){switch(n.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return t=n.sent(),r=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(r)]}}))}))},e.POP_KEY_USAGES=["sign","verify"],e.EXTRACTABLE=!0,e}();!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose",e[e.Trace=4]="Trace"}(hn||(hn={}));var fn,gn=function(){function e(e,t,r){this.level=hn.Info;this.localCallback=e.loggerCallback||function(){},this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level="number"==typeof e.logLevel?e.logLevel:hn.Info,this.correlationId=e.correlationId||de.EMPTY_STRING,this.packageName=t||de.EMPTY_STRING,this.packageVersion=r||de.EMPTY_STRING}return e.prototype.clone=function(t,r,n){return new e({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:n||this.correlationId},t,r)},e.prototype.logMessage=function(e,t){if(!(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)){var r=(new Date).toUTCString(),n=(hr.isEmpty(t.correlationId)?hr.isEmpty(this.correlationId)?"["+r+"]":"["+r+"] : ["+this.correlationId+"]":"["+r+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+hn[t.logLevel]+" - "+e;this.executeCallback(t.logLevel,n,t.containsPii||!1)}},e.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},e.prototype.error=function(e,t){this.logMessage(e,{logLevel:hn.Error,containsPii:!1,correlationId:t||de.EMPTY_STRING})},e.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:hn.Error,containsPii:!0,correlationId:t||de.EMPTY_STRING})},e.prototype.warning=function(e,t){this.logMessage(e,{logLevel:hn.Warning,containsPii:!1,correlationId:t||de.EMPTY_STRING})},e.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:hn.Warning,containsPii:!0,correlationId:t||de.EMPTY_STRING})},e.prototype.info=function(e,t){this.logMessage(e,{logLevel:hn.Info,containsPii:!1,correlationId:t||de.EMPTY_STRING})},e.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:hn.Info,containsPii:!0,correlationId:t||de.EMPTY_STRING})},e.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:hn.Verbose,containsPii:!1,correlationId:t||de.EMPTY_STRING})},e.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:hn.Verbose,containsPii:!0,correlationId:t||de.EMPTY_STRING})},e.prototype.trace=function(e,t){this.logMessage(e,{logLevel:hn.Trace,containsPii:!1,correlationId:t||de.EMPTY_STRING})},e.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:hn.Trace,containsPii:!0,correlationId:t||de.EMPTY_STRING})},e.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},e}(),mn=function(){function e(e,t,r,n,o,i){this.authority=t,this.libraryName=n,this.libraryVersion=o,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.measurementsById=new Map}return e.prototype.startMeasurement=function(e,t){var r,n,o=this,i=t||this.generateId();t||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",i),this.logger.trace("PerformanceClient: Performance measurement started for "+e,i);var a=this.startPerformanceMeasuremeant(e,i);a.startMeasurement();var s={eventId:this.generateId(),status:V.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,appName:null===(r=this.applicationTelemetry)||void 0===r?void 0:r.appName,appVersion:null===(n=this.applicationTelemetry)||void 0===n?void 0:n.appVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:i};return this.cacheEventByCorrelationId(s),this.cacheMeasurement(s,a),{endMeasurement:function(e){var t=o.endMeasurement(re(re({},s),e));return t&&o.cacheEventByCorrelationId(t),t},flushMeasurement:function(){return o.flushMeasurements(s.name,s.correlationId)},discardMeasurement:function(){return o.discardMeasurements(s.correlationId)},measurement:a,event:s}},e.prototype.endMeasurement=function(e){var t=this.measurementsById.get(e.eventId);if(t){this.measurementsById.delete(e.eventId),t.endMeasurement();var r=t.flushMeasurement();if(null!==r)return this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+r+" ms",e.correlationId),re(re({durationMs:Math.round(r)},e),{status:V.Completed});this.logger.trace("PerformanceClient: Performance measurement not taken",e.correlationId)}else this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId);return null},e.prototype.cacheEventByCorrelationId=function(e){var t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),t.set(e.eventId,e)):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,(new Map).set(e.eventId,e)))},e.prototype.cacheMeasurement=function(e,t){this.measurementsById.set(e.eventId,t)},e.prototype.flushMeasurements=function(e,t){var r=this;this.logger.trace("PerformanceClient: Performance measurements flushed for "+e,t);var n=this.eventsByCorrelationId.get(t);if(n){this.discardMeasurements(t);var o=[];n.forEach((function(n){if(n.name!==e&&n.status!==V.Completed){r.logger.trace("PerformanceClient: Incomplete submeasurement "+n.name+" found for "+e,t);var i=r.endMeasurement(n);i&&o.push(i)}o.push(n)}));var i=o.sort((function(e,t){return e.startTimeMs-t.startTimeMs})),a=i.filter((function(t){return t.name===e&&t.status===V.Completed}));if(a.length>0){a.length>1&&this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first",t);var s=a[0];this.logger.verbose("PerformanceClient: Measurement found for "+e,t);var c=i.reduce((function(n,o){if(o.name!==e){r.logger.trace("PerformanceClient: Complete submeasurement found for "+o.name,t);var i=o.name+"DurationMs";n[i]?r.logger.verbose("PerformanceClient: Submeasurement for "+e+" already exists for "+o.name+", ignoring",t):n[i]=o.durationMs,o.accessTokenSize&&(n.accessTokenSize=o.accessTokenSize),o.idTokenSize&&(n.idTokenSize=o.idTokenSize)}return n}),s);this.emitEvents([c],c.correlationId)}else this.logger.verbose("PerformanceClient: No completed top-level measurements found for "+e,t)}else this.logger.verbose("PerformanceClient: No measurements found",t)},e.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},e.prototype.addPerformanceCallback=function(e){var t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+t),t},e.prototype.removePerformanceCallback=function(e){var t=this.callbacks.delete(e);return t?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),t},e.prototype.emitEvents=function(e,t){var r=this;this.logger.verbose("PerformanceClient: Emitting performance events",t),this.callbacks.forEach((function(n,o){r.logger.trace("PerformanceClient: Emitting event to callback "+o,t),n.apply(null,[e])}))},e}(),vn=function(){function e(){}return e.prototype.startMeasurement=function(){},e.prototype.endMeasurement=function(){},e.prototype.flushMeasurement=function(){return null},e}(),yn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return te(t,e),t.prototype.generateId=function(){return"callback-id"},t.prototype.startPerformanceMeasuremeant=function(){return new vn},t}(mn),_n={createNewGuid:function(){throw pt.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw pt.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw pt.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return ne(this,void 0,void 0,(function(){return oe(this,(function(e){throw"Crypto interface - generatePkceCodes() has not been implemented",pt.createUnexpectedError("Crypto interface - generatePkceCodes() has not been implemented")}))}))},getPublicKeyThumbprint:function(){return ne(this,void 0,void 0,(function(){return oe(this,(function(e){throw"Crypto interface - getPublicKeyThumbprint() has not been implemented",pt.createUnexpectedError("Crypto interface - getPublicKeyThumbprint() has not been implemented")}))}))},removeTokenBindingKey:function(){return ne(this,void 0,void 0,(function(){return oe(this,(function(e){throw"Crypto interface - removeTokenBindingKey() has not been implemented",pt.createUnexpectedError("Crypto interface - removeTokenBindingKey() has not been implemented")}))}))},clearKeystore:function(){return ne(this,void 0,void 0,(function(){return oe(this,(function(e){throw"Crypto interface - clearKeystore() has not been implemented",pt.createUnexpectedError("Crypto interface - clearKeystore() has not been implemented")}))}))},signJwt:function(){return ne(this,void 0,void 0,(function(){return oe(this,(function(e){throw"Crypto interface - signJwt() has not been implemented",pt.createUnexpectedError("Crypto interface - signJwt() has not been implemented")}))}))},hashString:function(){return ne(this,void 0,void 0,(function(){return oe(this,(function(e){throw"Crypto interface - hashString() has not been implemented",pt.createUnexpectedError("Crypto interface - hashString() has not been implemented")}))}))}},En=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="ServerError",Object.setPrototypeOf(i,t.prototype),i}return te(t,e),t}(pt),Cn=["interaction_required","consent_required","login_required"],wn=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Tn={code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},Sn={code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."},In=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="InteractionRequiredAuthError",Object.setPrototypeOf(i,t.prototype),i}return te(t,e),t.isInteractionRequiredError=function(e,t,r){var n=!!e&&Cn.indexOf(e)>-1,o=!!r&&wn.indexOf(r)>-1,i=!!t&&Cn.some((function(e){return t.indexOf(e)>-1}));return n||i||o},t.createNoTokensFoundError=function(){return new t(Tn.code,Tn.desc)},t.createNativeAccountUnavailableError=function(){return new t(Sn.code,Sn.desc)},t}(pt);function bn(e,t){if(hr.isEmpty(e))throw dr.createClientInfoEmptyError();try{var r=t.base64Decode(e);return JSON.parse(r)}catch(n){throw dr.createClientInfoDecodingError(n)}}function An(e){if(hr.isEmpty(e))throw dr.createClientInfoDecodingError("Home account ID was empty.");var t=e.split(_e.CLIENT_INFO_SEPARATOR,2);return{uid:t[0],utid:t.length<2?de.EMPTY_STRING:t[1]}}!function(e){e[e.Default=0]="Default",e[e.Adfs=1]="Adfs"}(fn||(fn={}));var Rn,kn=function(){function e(){}return e.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()},e.prototype.generateAccountKey=function(){return e.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},e.prototype.generateType=function(){switch(this.authorityType){case ye.ADFS_ACCOUNT_TYPE:return we.ADFS;case ye.MSAV1_ACCOUNT_TYPE:return we.MSA;case ye.MSSTS_ACCOUNT_TYPE:return we.MSSTS;case ye.GENERIC_ACCOUNT_TYPE:return we.GENERIC;default:throw dr.createUnexpectedAccountTypeError()}},e.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId}},e.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||de.EMPTY_STRING,e.tenantId||de.EMPTY_STRING].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAccount=function(t,r,n,o,i,a,s,c){var u,l,d,h,p,f,g=new e;g.authorityType=ye.MSSTS_ACCOUNT_TYPE,g.clientInfo=t,g.homeAccountId=r,g.nativeAccountId=c;var m=s||o&&o.getPreferredCache();if(!m)throw dr.createInvalidCacheEnvironmentError();return g.environment=m,g.realm=(null===(u=null==n?void 0:n.claims)||void 0===u?void 0:u.tid)||de.EMPTY_STRING,n&&(g.idTokenClaims=n.claims,g.localAccountId=(null===(l=null==n?void 0:n.claims)||void 0===l?void 0:l.oid)||(null===(d=null==n?void 0:n.claims)||void 0===d?void 0:d.sub)||de.EMPTY_STRING,g.username=(null===(h=null==n?void 0:n.claims)||void 0===h?void 0:h.preferred_username)||((null===(p=null==n?void 0:n.claims)||void 0===p?void 0:p.emails)?n.claims.emails[0]:de.EMPTY_STRING),g.name=null===(f=null==n?void 0:n.claims)||void 0===f?void 0:f.name),g.cloudGraphHostName=i,g.msGraphHost=a,g},e.createGenericAccount=function(t,r,n,o,i,a){var s,c,u,l,d=new e;d.authorityType=n&&n.authorityType===fn.Adfs?ye.ADFS_ACCOUNT_TYPE:ye.GENERIC_ACCOUNT_TYPE,d.homeAccountId=t,d.realm=de.EMPTY_STRING;var h=a||n&&n.getPreferredCache();if(!h)throw dr.createInvalidCacheEnvironmentError();return r&&(d.localAccountId=(null===(s=null==r?void 0:r.claims)||void 0===s?void 0:s.oid)||(null===(c=null==r?void 0:r.claims)||void 0===c?void 0:c.sub)||de.EMPTY_STRING,d.username=(null===(u=null==r?void 0:r.claims)||void 0===u?void 0:u.upn)||de.EMPTY_STRING,d.name=(null===(l=null==r?void 0:r.claims)||void 0===l?void 0:l.name)||de.EMPTY_STRING,d.idTokenClaims=null==r?void 0:r.claims),d.environment=h,d.cloudGraphHostName=o,d.msGraphHost=i,d},e.generateHomeAccountId=function(e,t,r,n,o){var i,a=(null===(i=null==o?void 0:o.claims)||void 0===i?void 0:i.sub)?o.claims.sub:de.EMPTY_STRING;if(t===fn.Adfs)return a;if(e)try{var s=bn(e,n);if(!hr.isEmpty(s.uid)&&!hr.isEmpty(s.utid))return""+s.uid+_e.CLIENT_INFO_SEPARATOR+s.utid}catch(c){}return r.verbose("No client info in response"),a},e.isAccountEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))},e.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var n=!0;if(r){var o=e.idTokenClaims||{},i=t.idTokenClaims||{};n=o.iat===i.iat&&o.nonce===i.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n},e}(),Nn=function(){function e(){}return e.prototype.generateAccountId=function(){return e.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},e.prototype.generateCredentialId=function(){return e.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},e.prototype.generateTarget=function(){return e.generateTargetForCacheKey(this.target)},e.prototype.generateCredentialKey=function(){return e.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},e.prototype.generateType=function(){switch(this.credentialType){case Ee.ID_TOKEN:return we.ID_TOKEN;case Ee.ACCESS_TOKEN:case Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME:return we.ACCESS_TOKEN;case Ee.REFRESH_TOKEN:return we.REFRESH_TOKEN;default:throw dr.createUnexpectedCredentialTypeError()}},e.getCredentialType=function(e){return-1!==e.indexOf(Ee.ACCESS_TOKEN.toLowerCase())?-1!==e.indexOf(Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())?Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME:Ee.ACCESS_TOKEN:-1!==e.indexOf(Ee.ID_TOKEN.toLowerCase())?Ee.ID_TOKEN:-1!==e.indexOf(Ee.REFRESH_TOKEN.toLowerCase())?Ee.REFRESH_TOKEN:de.NOT_DEFINED},e.generateCredentialCacheKey=function(e,t,r,n,o,i,a,s,c){return[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(r,n,o,a),this.generateTargetForCacheKey(i),this.generateClaimsHashForCacheKey(c),this.generateSchemeForCacheKey(s)].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()},e.generateAccountIdForCacheKey=function(e,t){return[e,t].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()},e.generateCredentialIdForCacheKey=function(e,t,r,n){return[e,e===Ee.REFRESH_TOKEN&&n||t,r||de.EMPTY_STRING].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()},e.generateTargetForCacheKey=function(e){return(e||de.EMPTY_STRING).toLowerCase()},e.generateClaimsHashForCacheKey=function(e){return(e||de.EMPTY_STRING).toLowerCase()},e.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==ke.BEARER.toLowerCase()?e.toLowerCase():de.EMPTY_STRING},e}(),Pn={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},On={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},Mn={code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},Un={code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},xn={code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},qn={code:"empty_url_error",desc:"URL was empty or null."},Hn={code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},Ln={code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},Dn={code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create' and 'none'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},Fn={code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},jn={code:"token_request_empty",desc:"Token request was empty and not found in cache."},Kn={code:"logout_request_empty",desc:"The logout request was null or undefined."},Gn={code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},Bn={code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},zn={code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},Yn={code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},Wn={code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},Vn={code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},Jn={code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},Qn={code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},Xn={code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},Zn={code:"invalid_authentication_header",desc:"Invalid authentication header provided"},$n=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientConfigurationError",Object.setPrototypeOf(o,t.prototype),o}return te(t,e),t.createRedirectUriEmptyError=function(){return new t(Pn.code,Pn.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(On.code,On.desc)},t.createClaimsRequestParsingError=function(e){return new t(Mn.code,Mn.desc+" Given value: "+e)},t.createInsecureAuthorityUriError=function(e){return new t(Un.code,Un.desc+" Given URI: "+e)},t.createUrlParseError=function(e){return new t(xn.code,xn.desc+" Given Error: "+e)},t.createUrlEmptyError=function(){return new t(qn.code,qn.desc)},t.createEmptyScopesArrayError=function(){return new t(Hn.code,""+Hn.desc)},t.createClientIdSingleScopeError=function(e){return new t(Ln.code,Ln.desc+" Given Scopes: "+e)},t.createInvalidPromptError=function(e){return new t(Dn.code,Dn.desc+" Given value: "+e)},t.createInvalidClaimsRequestError=function(){return new t(Fn.code,Fn.desc)},t.createEmptyLogoutRequestError=function(){return new t(Kn.code,Kn.desc)},t.createEmptyTokenRequestError=function(){return new t(jn.code,jn.desc)},t.createInvalidCodeChallengeMethodError=function(){return new t(Gn.code,Gn.desc)},t.createInvalidCodeChallengeParamsError=function(){return new t(Bn.code,Bn.desc)},t.createInvalidCloudDiscoveryMetadataError=function(){return new t(zn.code,zn.desc)},t.createInvalidAuthorityMetadataError=function(){return new t(Yn.code,Yn.desc)},t.createUntrustedAuthorityError=function(){return new t(Wn.code,Wn.desc)},t.createInvalidAzureCloudInstanceError=function(){return new t(Vn.code,Vn.desc)},t.createMissingSshJwkError=function(){return new t(Jn.code,Jn.desc)},t.createMissingSshKidError=function(){return new t(Qn.code,Qn.desc)},t.createMissingNonceAuthenticationHeadersError=function(){return new t(Xn.code,Xn.desc)},t.createInvalidAuthenticationHeaderError=function(e,r){return new t(Zn.code,Zn.desc+". Invalid header: "+e+". Details: "+r)},t}(dr),eo=function(){function e(e){var t=this,r=e?hr.trimArrayEntries(ie(e)):[],n=r?hr.removeEmptyStringsFromArray(r):[];this.validateInputScopes(n),this.scopes=new Set,n.forEach((function(e){return t.scopes.add(e)}))}return e.fromString=function(t){return new e((t||de.EMPTY_STRING).split(" "))},e.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw $n.createEmptyScopesArrayError()},e.prototype.containsScope=function(t){var r=new e(this.printScopesLowerCase().split(" "));return!hr.isEmpty(t)&&r.scopes.has(t.toLowerCase())},e.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((function(e){return t.containsScope(e)})))},e.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return pe.forEach((function(r){e.containsScope(r)&&(t+=1)})),this.scopes.size===t},e.prototype.appendScope=function(e){hr.isEmpty(e)||this.scopes.add(e.trim())},e.prototype.appendScopes=function(e){var t=this;try{e.forEach((function(e){return t.appendScope(e)}))}catch(r){throw dr.createAppendScopeSetError(r)}},e.prototype.removeScope=function(e){if(hr.isEmpty(e))throw dr.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},e.prototype.removeOIDCScopes=function(){var e=this;pe.forEach((function(t){e.scopes.delete(t)}))},e.prototype.unionScopeSets=function(e){if(!e)throw dr.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach((function(e){return t.add(e.toLowerCase())})),this.scopes.forEach((function(e){return t.add(e.toLowerCase())})),t},e.prototype.intersectingScopeSets=function(e){if(!e)throw dr.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size1)throw dr.createMultipleMatchingAccountsInCacheError();return r[0]},e.prototype.readIdTokenFromCache=function(e,t){var r={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:Ee.ID_TOKEN,clientId:e,realm:t.tenantId},n=this.getCredentialsFilteredBy(r),o=Object.keys(n.idTokens).map((function(e){return n.idTokens[e]})),i=o.length;if(i<1)return null;if(i>1)throw dr.createMultipleMatchingTokensInCacheError();return o[0]},e.prototype.readAccessTokenFromCache=function(e,t,r){var n=new eo(r.scopes||[]),o=r.authenticationScheme||ke.BEARER,i=o&&o.toLowerCase()!==ke.BEARER.toLowerCase()?Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME:Ee.ACCESS_TOKEN,a={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:i,clientId:e,realm:t.tenantId,target:n.printScopesLowerCase(),tokenType:o,keyId:r.sshKid,requestedClaimsHash:r.requestedClaimsHash},s=this.getCredentialsFilteredBy(a),c=Object.keys(s.accessTokens).map((function(e){return s.accessTokens[e]})),u=c.length;if(u<1)return null;if(u>1)throw dr.createMultipleMatchingTokensInCacheError();return c[0]},e.prototype.readRefreshTokenFromCache=function(e,t,r){var n=r?be:void 0,o={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:Ee.REFRESH_TOKEN,clientId:e,familyId:n},i=this.getCredentialsFilteredBy(o),a=Object.keys(i.refreshTokens).map((function(e){return i.refreshTokens[e]}));return a.length<1?null:a[0]},e.prototype.readAppMetadataFromCache=function(e,t){var r={environment:e,clientId:t},n=this.getAppMetadataFilteredBy(r),o=Object.keys(n).map((function(e){return n[e]})),i=o.length;if(i<1)return null;if(i>1)throw dr.createMultipleMatchingAppMetadataInCacheError();return o[0]},e.prototype.isAppMetadataFOCI=function(e,t){var r=this.readAppMetadataFromCache(e,t);return!(!r||r.familyId!==be)},e.prototype.matchHomeAccountId=function(e,t){return!(!e.homeAccountId||t!==e.homeAccountId)},e.prototype.matchUserAssertionHash=function(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)},e.prototype.matchEnvironment=function(e,t){var r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)},e.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},e.prototype.matchClientId=function(e,t){return!(!e.clientId||t!==e.clientId)},e.prototype.matchFamilyId=function(e,t){return!(!e.familyId||t!==e.familyId)},e.prototype.matchRealm=function(e,t){return!(!e.realm||t!==e.realm)},e.prototype.matchNativeAccountId=function(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)},e.prototype.matchTarget=function(e,t){if(e.credentialType!==Ee.ACCESS_TOKEN&&e.credentialType!==Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;var r=eo.fromString(e.target),n=eo.fromString(t);return n.containsOnlyOIDCScopes()?n.removeScope(de.OFFLINE_ACCESS_SCOPE):n.removeOIDCScopes(),r.containsScopeSet(n)},e.prototype.matchTokenType=function(e,t){return!(!e.tokenType||e.tokenType!==t)},e.prototype.matchKeyId=function(e,t){return!(!e.keyId||e.keyId!==t)},e.prototype.isAppMetadata=function(e){return-1!==e.indexOf(Ie)},e.prototype.isAuthorityMetadata=function(e){return-1!==e.indexOf(Ae)},e.prototype.generateAuthorityMetadataCacheKey=function(e){return Ae+"-"+this.clientId+"-"+e},e.prototype.getSpecificCredential=function(e,t){switch(t){case Ee.ID_TOKEN:return this.getIdTokenCredential(e);case Ee.ACCESS_TOKEN:case Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case Ee.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},e.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},e}(),no=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return te(t,e),t.prototype.setAccount=function(){throw pt.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},t.prototype.getAccount=function(){throw pt.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},t.prototype.setIdTokenCredential=function(){throw pt.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getIdTokenCredential=function(){throw pt.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAccessTokenCredential=function(){throw pt.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getAccessTokenCredential=function(){throw pt.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setRefreshTokenCredential=function(){throw pt.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getRefreshTokenCredential=function(){throw pt.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAppMetadata=function(){throw pt.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAppMetadata=function(){throw pt.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.setServerTelemetry=function(){throw pt.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.getServerTelemetry=function(){throw pt.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.setAuthorityMetadata=function(){throw pt.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadata=function(){throw pt.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadataKeys=function(){throw pt.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},t.prototype.setThrottlingCache=function(){throw pt.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.getThrottlingCache=function(){throw pt.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.removeItem=function(){throw pt.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},t.prototype.containsKey=function(){throw pt.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},t.prototype.getKeys=function(){throw pt.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},t.prototype.clear=function(){return ne(this,void 0,void 0,(function(){return oe(this,(function(e){throw"Storage interface - clear() has not been implemented for the cacheStorage interface.",pt.createUnexpectedError("Storage interface - clear() has not been implemented for the cacheStorage interface.")}))}))},t.prototype.updateCredentialCacheKey=function(){throw pt.createUnexpectedError("Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.")},t}(ro),oo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return te(t,e),t.createIdTokenEntity=function(e,r,n,o,i){var a=new t;return a.credentialType=Ee.ID_TOKEN,a.homeAccountId=e,a.environment=r,a.clientId=o,a.secret=n,a.realm=i,a},t.isIdTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===Ee.ID_TOKEN)},t}(Nn),io=function(){function e(){}return e.nowSeconds=function(){return Math.round((new Date).getTime()/1e3)},e.isTokenExpired=function(t,r){var n=Number(t)||0;return e.nowSeconds()+r>n},e.wasClockTurnedBack=function(t){return Number(t)>e.nowSeconds()},e.delay=function(e,t){return new Promise((function(r){return setTimeout((function(){return r(t)}),e)}))},e}(),ao=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return te(t,e),t.createAccessTokenEntity=function(e,r,n,o,i,a,s,c,u,l,d,h,p,f,g){var m,v,y=new t;y.homeAccountId=e,y.credentialType=Ee.ACCESS_TOKEN,y.secret=n;var _=io.nowSeconds();if(y.cachedAt=_.toString(),y.expiresOn=s.toString(),y.extendedExpiresOn=c.toString(),l&&(y.refreshOn=l.toString()),y.environment=r,y.clientId=o,y.realm=i,y.target=a,y.userAssertionHash=h,y.tokenType=hr.isEmpty(d)?ke.BEARER:d,f&&(y.requestedClaims=f,y.requestedClaimsHash=g),(null===(m=y.tokenType)||void 0===m?void 0:m.toLowerCase())!==ke.BEARER.toLowerCase())switch(y.credentialType=Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case ke.POP:var E=to.extractTokenClaims(n,u);if(!(null===(v=null==E?void 0:E.cnf)||void 0===v?void 0:v.kid))throw dr.createTokenClaimsRequiredError();y.keyId=E.cnf.kid;break;case ke.SSH:y.keyId=p}return y},t.isAccessTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===Ee.ACCESS_TOKEN||e.credentialType===Ee.ACCESS_TOKEN_WITH_AUTH_SCHEME))},t}(Nn),so=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return te(t,e),t.createRefreshTokenEntity=function(e,r,n,o,i,a){var s=new t;return s.clientId=o,s.credentialType=Ee.REFRESH_TOKEN,s.environment=r,s.homeAccountId=e,s.secret=n,s.userAssertionHash=a,i&&(s.familyId=i),s},t.isRefreshTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===Ee.REFRESH_TOKEN)},t}(Nn),co=function(){function e(){}return e.prototype.generateAppMetadataKey=function(){return e.generateAppMetadataCacheKey(this.environment,this.clientId)},e.generateAppMetadataCacheKey=function(e,t){return[Ie,e,t].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAppMetadataEntity=function(t,r,n){var o=new e;return o.clientId=t,o.environment=r,n&&(o.familyId=n),o},e.isAppMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(Ie)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))},e}(),uo=function(){function e(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return e.isServerTelemetryEntity=function(e,t){var r=0===e.indexOf(Ne.CACHE_KEY),n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n},e}(),lo=function(){function e(){this.expiresAt=io.nowSeconds()+Re}return e.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},e.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},e.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},e.prototype.resetExpiresAt=function(){this.expiresAt=io.nowSeconds()+Re},e.prototype.isExpired=function(){return this.expiresAt<=io.nowSeconds()},e.isAuthorityMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(Ae)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"))},e}(),ho=function(){function e(){}return e.isThrottlingEntity=function(e,t){var r=!1;e&&(r=0===e.indexOf(De));var n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n},e}(),po=function(){function e(){}return e.setRequestState=function(t,r,n){var o=e.generateLibraryState(t,n);return hr.isEmpty(r)?o:""+o+de.RESOURCE_DELIM+r},e.generateLibraryState=function(e,t){if(!e)throw dr.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);var n=JSON.stringify(r);return e.base64Encode(n)},e.parseRequestState=function(e,t){if(!e)throw dr.createNoCryptoObjectError("parseRequestState");if(hr.isEmpty(t))throw dr.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(de.RESOURCE_DELIM),n=r[0],o=r.length>1?r.slice(1).join(de.RESOURCE_DELIM):de.EMPTY_STRING,i=e.base64Decode(n),a=JSON.parse(i);return{userRequestState:hr.isEmpty(o)?de.EMPTY_STRING:o,libraryState:a}}catch(s){throw dr.createInvalidStateError(t,s)}},e}();!function(e){e.HOME_ACCOUNT_ID="home_account_id",e.UPN="UPN"}(Rn||(Rn={}));var fo,go,mo={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},vo={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},yo={code:"storage_not_supported",desc:"Given storage configuration option was not supported."},_o={code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},Eo={code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},Co={code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},wo=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="BrowserConfigurationAuthError",Object.setPrototypeOf(o,t.prototype),o}return Y(t,e),t.createRedirectUriEmptyError=function(){return new t(mo.code,mo.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(vo.code,vo.desc)},t.createStorageNotSupportedError=function(e){return new t(yo.code,yo.desc+" Given Location: "+e)},t.createRedirectCallbacksNotSetError=function(){return new t(_o.code,_o.desc)},t.createStubPcaInstanceCalledError=function(){return new t(Eo.code,Eo.desc)},t.createInMemoryRedirectUnavailableError=function(){return new t(Co.code,Co.desc)},t}(pt),To=function(){function e(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return e.prototype.validateWindowStorage=function(e){if(e!==Be.LocalStorage&&e!==Be.SessionStorage)throw wo.createStorageNotSupportedError(e);if(!!!window[e])throw wo.createStorageNotSupportedError(e)},e.prototype.getItem=function(e){return this.windowStorage.getItem(e)},e.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},e.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},e.prototype.getKeys=function(){return Object.keys(this.windowStorage)},e.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},e}(),So=function(){function e(t){if(this._urlString=t,hr.isEmpty(this._urlString))throw $n.createUrlEmptyError();hr.isEmpty(this.getHash())&&(this._urlString=e.canonicalizeUri(t))}return Object.defineProperty(e.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),e.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return hr.endsWith(t,"?")?t=t.slice(0,-1):hr.endsWith(t,"?/")&&(t=t.slice(0,-2)),hr.endsWith(t,"/")||(t+="/"),t}return e},e.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(t){throw $n.createUrlParseError(t)}if(!e.HostNameAndPort||!e.PathSegments)throw $n.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw $n.createInsecureAuthorityUriError(this.urlString)},e.appendQueryString=function(e,t){return hr.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},e.removeHashFromUrl=function(t){return e.canonicalizeUri(t.split("#")[0])},e.prototype.replaceTenantPath=function(t){var r=this.getUrlComponents(),n=r.PathSegments;return!t||0===n.length||n[0]!==ce.COMMON&&n[0]!==ce.ORGANIZATIONS||(n[0]=t),e.constructAuthorityUriFromObject(r)},e.prototype.getHash=function(){return e.parseHash(this.urlString)},e.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw $n.createUrlParseError("Given url string: "+this.urlString);var r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},n=r.AbsolutePath.split("/");return n=n.filter((function(e){return e&&e.length>0})),r.PathSegments=n,!hr.isEmpty(r.QueryString)&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r},e.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw $n.createUrlParseError("Given url string: "+e);return r[2]},e.getAbsoluteUrl=function(t,r){if(t[0]===de.FORWARD_SLASH){var n=new e(r).getUrlComponents();return n.Protocol+"//"+n.HostNameAndPort+t}return t},e.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):de.EMPTY_STRING},e.constructAuthorityUriFromObject=function(t){return new e(t.Protocol+"//"+t.HostNameAndPort+"/"+t.PathSegments.join("/"))},e.getDeserializedHash=function(t){if(hr.isEmpty(t))return{};var r=e.parseHash(t),n=hr.queryStringToObject(hr.isEmpty(r)?t:r);if(!n)throw dr.createHashNotDeserializedError(JSON.stringify(n));return n},e.hashContainsKnownProperties=function(t){if(hr.isEmpty(t)||t.indexOf("=")<0)return!1;var r=e.getDeserializedHash(t);return!!(r.code||r.error_description||r.error||r.state)},e}(),Io=function(){function e(){}return e.extractBrowserRequestState=function(e,t){if(hr.isEmpty(t))return null;try{return po.parseRequestState(e,t).libraryState.meta}catch(r){throw dr.createInvalidStateError(t,r)}},e.parseServerResponseFromHash=function(e){if(!e)return{};var t=new So(e);return So.getDeserializedHash(t.getHash())},e}(),bo=function(e){function t(t,r,n,o){var i=e.call(this,t,n)||this;return i.COOKIE_LIFE_MULTIPLIER=864e5,i.cacheConfig=r,i.logger=o,i.internalStorage=new ln,i.browserStorage=i.setupBrowserStorage(i.cacheConfig.cacheLocation),i.temporaryCacheStorage=i.setupTemporaryCacheStorage(i.cacheConfig.cacheLocation),i.migrateCacheEntries(),i}return Y(t,e),t.prototype.setupBrowserStorage=function(e){switch(e){case Be.LocalStorage:case Be.SessionStorage:try{return new To(e)}catch(t){this.logger.verbose(t);break}}return this.cacheConfig.cacheLocation=Be.MemoryStorage,new ln},t.prototype.setupTemporaryCacheStorage=function(e){switch(e){case Be.LocalStorage:case Be.SessionStorage:try{return new To(Be.SessionStorage)}catch(t){return this.logger.verbose(t),this.internalStorage}case Be.MemoryStorage:default:return this.internalStorage}},t.prototype.migrateCacheEntries=function(){var e=this,t=de.CACHE_PREFIX+"."+se.ID_TOKEN,r=de.CACHE_PREFIX+"."+se.CLIENT_INFO,n=de.CACHE_PREFIX+"."+se.ERROR,o=de.CACHE_PREFIX+"."+se.ERROR_DESC,i=[this.browserStorage.getItem(t),this.browserStorage.getItem(r),this.browserStorage.getItem(n),this.browserStorage.getItem(o)];[se.ID_TOKEN,se.CLIENT_INFO,se.ERROR,se.ERROR_DESC].forEach((function(t,r){return e.migrateCacheEntry(t,i[r])}))},t.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},t.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(r){return null}},t.prototype.getItem=function(e){return this.browserStorage.getItem(e)},t.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},t.prototype.getAccount=function(e){var t=this.getItem(e);if(!t)return null;var r=this.validateAndParseJson(t);return r&&kn.isAccountEntity(r)?ro.toObject(new kn,r):null},t.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e))},t.prototype.getIdTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&oo.isIdTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),ro.toObject(new oo,r)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null)},t.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},t.prototype.getAccessTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&ao.isAccessTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),ro.toObject(new ao,r)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null)},t.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},t.prototype.getRefreshTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&so.isRefreshTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),ro.toObject(new so,r)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null)},t.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},t.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&co.isAppMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),ro.toObject(new co,r)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},t.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},t.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&uo.isServerTelemetryEntity(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),ro.toObject(new uo,r)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},t.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},t.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&lo.isAuthorityMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),ro.toObject(new lo,r)):null},t.prototype.getAuthorityMetadataKeys=function(){var e=this;return this.internalStorage.getKeys().filter((function(t){return e.isAuthorityMetadata(t)}))},t.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem(We.WRAPPER_SKU,e),this.internalStorage.setItem(We.WRAPPER_VER,t)},t.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem(We.WRAPPER_SKU)||de.EMPTY_STRING,this.internalStorage.getItem(We.WRAPPER_VER)||de.EMPTY_STRING]},t.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},t.prototype.getActiveAccount=function(){var e=this.generateCacheKey(se.ACTIVE_ACCOUNT),t=this.browserStorage.getItem(e);return t&&this.getAccountInfoByFilter({localAccountId:t})[0]||null},t.prototype.setActiveAccount=function(e){var t=this.generateCacheKey(se.ACTIVE_ACCOUNT);e?(this.logger.verbose("setActiveAccount: Active account set"),this.browserStorage.setItem(t,e.localAccountId)):(this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t))},t.prototype.getAccountInfoByFilter=function(e){return this.getAllAccounts().filter((function(t){return(!e.username||e.username.toLowerCase()===t.username.toLowerCase())&&((!e.homeAccountId||e.homeAccountId===t.homeAccountId)&&((!e.localAccountId||e.localAccountId===t.localAccountId)&&((!e.tenantId||e.tenantId===t.tenantId)&&(!e.environment||e.environment===t.environment))))}))},t.prototype.getAccountInfoByHints=function(e,t){var r=this.getAllAccounts().filter((function(r){if(t){var n=r.idTokenClaims&&r.idTokenClaims.sid;return t===n}return!!e&&e===r.username}));if(1===r.length)return r[0];if(r.length>1)throw dr.createMultipleMatchingAccountsInCacheError();return null},t.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&ho.isThrottlingEntity(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),ro.toObject(new ho,r)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},t.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},t.prototype.getTemporaryCache=function(e,t){var r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){var n=this.getItemCookie(r);if(n)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),n}var o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Be.LocalStorage){var i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o},t.prototype.setTemporaryCache=function(e,t,r){var n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))},t.prototype.removeItem=function(e){return this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e)),!0},t.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},t.prototype.getKeys=function(){return $(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},t.prototype.clear=function(){return Q(this,void 0,void 0,(function(){var e=this;return X(this,(function(t){switch(t.label){case 0:return[4,this.removeAllAccounts()];case 1:return t.sent(),this.removeAppMetadata(),this.getKeys().forEach((function(t){!e.browserStorage.containsKey(t)&&!e.temporaryCacheStorage.containsKey(t)||-1===t.indexOf(de.CACHE_PREFIX)&&-1===t.indexOf(e.clientId)||e.removeItem(t)})),this.internalStorage.clear(),[2]}}))}))},t.prototype.setItemCookie=function(e,t,r){var n=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;";r&&(n+="expires="+this.getCookieExpirationTime(r)+";");this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n},t.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",r=document.cookie.split(";"),n=0;n=300)&&(t===ze.POST?i(nn.createPostRequestFailedError("Failed with status "+a.status,e)):i(nn.createGetRequestFailedError("Failed with status "+a.status,e)));try{var r=JSON.parse(a.responseText),s={headers:n.getHeaderDict(a),body:r,status:a.status};o(s)}catch(c){i(nn.createFailedToParseNetworkResponseError(e))}},a.onerror=function(){window.navigator.onLine?t===ze.POST?i(nn.createPostRequestFailedError("Failed with status "+a.status,e)):i(nn.createGetRequestFailedError("Failed with status "+a.status,e)):i(nn.createNoNetworkConnectivityError())},t===ze.POST&&r&&r.body)a.send(r.body);else{if(t!==ze.GET)throw nn.createHttpMethodNotImplementedError(t);a.send()}}))},e.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var r=t.headers;Object.keys(r).forEach((function(t){e.setRequestHeader(t,r[t])}))}},e.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return t.forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&o&&(r[n]=o)})),r},e}(),Lo=function(){function e(){}return e.clearHash=function(e){e.location.hash=de.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,de.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},e.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):de.EMPTY_STRING},e.isInIframe=function(){return window.parent!==window},e.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(et+".")},e.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},e.getHomepage=function(){var e=new So(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},e.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new qo:new Ho},e.blockReloadInHiddenIframes=function(){if(So.hashContainsKnownProperties(window.location.hash)&&e.isInIframe())throw nn.createBlockReloadInHiddenIframeError()},e.blockRedirectInIframe=function(t,r){var n=e.isInIframe();if(t===Je.Redirect&&n&&!r)throw nn.createRedirectInIframeError(n)},e.blockAcquireTokenInPopups=function(){if(e.isInPopup())throw nn.createBlockAcquireTokenInPopupsError()},e.blockNonBrowserEnvironment=function(e){if(!e)throw nn.createNonBrowserEnvironmentError()},e.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw nn.createNativeBrokerCalledBeforeInitialize()},e.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),n=e.indexOf("Edge/");return t>0||r>0||n>0},e}(),Do=function(){function e(){}return e.prototype.navigateInternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.prototype.navigateExternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise((function(e){setTimeout((function(){e(!0)}),t.timeout)}))},e}(),Fo=6e3;var jo,Ko="@azure/msal-browser",Go="2.26.0";!function(e){e.INITIALIZE_START="msal:initializeStart",e.INITIALIZE_END="msal:initializeEnd",e.ACCOUNT_ADDED="msal:accountAdded",e.ACCOUNT_REMOVED="msal:accountRemoved",e.LOGIN_START="msal:loginStart",e.LOGIN_SUCCESS="msal:loginSuccess",e.LOGIN_FAILURE="msal:loginFailure",e.ACQUIRE_TOKEN_START="msal:acquireTokenStart",e.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",e.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",e.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",e.SSO_SILENT_START="msal:ssoSilentStart",e.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",e.SSO_SILENT_FAILURE="msal:ssoSilentFailure",e.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",e.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",e.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",e.HANDLE_REDIRECT_START="msal:handleRedirectStart",e.HANDLE_REDIRECT_END="msal:handleRedirectEnd",e.POPUP_OPENED="msal:popupOpened",e.LOGOUT_START="msal:logoutStart",e.LOGOUT_SUCCESS="msal:logoutSuccess",e.LOGOUT_FAILURE="msal:logoutFailure",e.LOGOUT_END="msal:logoutEnd"}(jo||(jo={}));var Bo,zo=function(){function e(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return e.prototype.addEventCallback=function(e){if("undefined"!=typeof window){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},e.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},e.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},e.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},e.prototype.emitEvent=function(e,t,r,n){var o=this;if("undefined"!=typeof window){var i={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach((function(t,r){o.logger.verbose("Emitting event to callback "+r+": "+e),t.apply(null,[i])}))}},e.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var r=JSON.parse(t);if("object"!=typeof r||!kn.isAccountEntity(r))return;var n=ro.toObject(new kn,r).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(jo.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(jo.ACCOUNT_REMOVED,void 0,n))}catch(e){return}},e}(),Yo=(r(17727),function(){function e(){}return e.generateThrottlingStorageKey=function(e){return De+"."+JSON.stringify(e)},e.preProcess=function(t,r){var n,o=e.generateThrottlingStorageKey(r),i=t.getThrottlingCache(o);if(i){if(i.throttleTime=500&&e.status<600},e.checkResponseForRetryAfter=function(e){return!!e.headers&&(e.headers.hasOwnProperty(ae.RETRY_AFTER)&&(e.status<200||e.status>=300))},e.calculateThrottleTime=function(e){var t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||He),r+Le))},e.removeThrottle=function(e,t,r,n){var o={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:n,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},i=this.generateThrottlingStorageKey(o);return e.removeItem(i,Ce.THROTTLING)},e}()),Wo=function(){function e(e,t){this.networkClient=e,this.cacheManager=t}return e.prototype.sendPostRequest=function(e,t,r){return ne(this,void 0,void 0,(function(){var n,o;return oe(this,(function(i){switch(i.label){case 0:Yo.preProcess(this.cacheManager,e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(t,r)];case 2:return n=i.sent(),[3,4];case 3:throw(o=i.sent())instanceof pt?o:dr.createNetworkError(t,o);case 4:return Yo.postProcess(this.cacheManager,e,n),[2,n]}}))}))},e}(),Vo=function(){function e(e,t){var r,n,o,i,a,s,c,u,l,d,h,p,f,g,m;this.config=(o=(r=e).authOptions,i=r.systemOptions,a=r.loggerOptions,s=r.storageInterface,c=r.networkInterface,u=r.cryptoInterface,l=r.clientCredentials,d=r.libraryInfo,h=r.telemetry,p=r.serverTelemetryManager,f=r.persistencePlugin,g=r.serializableCache,m=re(re({},ko),a),{authOptions:(n=o,re({clientCapabilities:[],azureCloudOptions:Mo,skipAuthorityMetadataCache:!1},n)),systemOptions:re(re({},Ro),i),loggerOptions:m,storageInterface:s||new no(o.clientId,_n),networkInterface:c||No,cryptoInterface:u||_n,clientCredentials:l||Oo,libraryInfo:re(re({},Po),d),telemetry:re(re({},Uo),h),serverTelemetryManager:p||null,persistencePlugin:f||null,serializableCache:g||null}),this.logger=new gn(this.config.loggerOptions,"@azure/msal-common",Ao),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new Wo(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}return e.prototype.createTokenRequestHeaders=function(e){var t={};if(t[ae.CONTENT_TYPE]=de.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Rn.HOME_ACCOUNT_ID:try{var r=An(e.credential);t[ae.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(n){this.logger.verbose("Could not parse home account ID for CCS Header: "+n)}break;case Rn.UPN:t[ae.CCS_HEADER]="UPN: "+e.credential}return t},e.prototype.executePostToTokenEndpoint=function(e,t,r,n){return ne(this,void 0,void 0,(function(){var o;return oe(this,(function(i){switch(i.label){case 0:return[4,this.networkManager.sendPostRequest(n,e,{body:t,headers:r,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return o=i.sent(),this.config.serverTelemetryManager&&o.status<500&&429!==o.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,o]}}))}))},e.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw dr.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},e}(),Jo=function(){function e(){}return e.validateRedirectUri=function(e){if(hr.isEmpty(e))throw $n.createRedirectUriEmptyError()},e.validatePrompt=function(e){var t=[];for(var r in ge)t.push(ge[r]);if(t.indexOf(e)<0)throw $n.createInvalidPromptError(e)},e.validateClaims=function(e){try{JSON.parse(e)}catch(t){throw $n.createInvalidClaimsRequestError()}},e.validateCodeChallengeParams=function(e,t){if(hr.isEmpty(e)||hr.isEmpty(t))throw $n.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},e.validateCodeChallengeMethod=function(e){if([Te.PLAIN,Te.S256].indexOf(e)<0)throw $n.createInvalidCodeChallengeMethodError()},e.sanitizeEQParams=function(e,t){return e?(t.forEach((function(t,r){e[r]&&delete e[r]})),e):{}},e}(),Qo=function(){function e(){this.parameters=new Map}return e.prototype.addResponseTypeCode=function(){this.parameters.set(ue.RESPONSE_TYPE,encodeURIComponent(de.CODE_RESPONSE_TYPE))},e.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(ue.RESPONSE_TYPE,encodeURIComponent(de.TOKEN_RESPONSE_TYPE+" "+de.ID_TOKEN_RESPONSE_TYPE))},e.prototype.addResponseMode=function(e){this.parameters.set(ue.RESPONSE_MODE,encodeURIComponent(e||me.QUERY))},e.prototype.addNativeBroker=function(){this.parameters.set(ue.NATIVE_BROKER,encodeURIComponent("1"))},e.prototype.addScopes=function(e,t){void 0===t&&(t=!0);var r=t?ie(e||[],he):e||[],n=new eo(r);this.parameters.set(ue.SCOPE,encodeURIComponent(n.printScopes()))},e.prototype.addClientId=function(e){this.parameters.set(ue.CLIENT_ID,encodeURIComponent(e))},e.prototype.addRedirectUri=function(e){Jo.validateRedirectUri(e),this.parameters.set(ue.REDIRECT_URI,encodeURIComponent(e))},e.prototype.addPostLogoutRedirectUri=function(e){Jo.validateRedirectUri(e),this.parameters.set(ue.POST_LOGOUT_URI,encodeURIComponent(e))},e.prototype.addIdTokenHint=function(e){this.parameters.set(ue.ID_TOKEN_HINT,encodeURIComponent(e))},e.prototype.addDomainHint=function(e){this.parameters.set(fe.DOMAIN_HINT,encodeURIComponent(e))},e.prototype.addLoginHint=function(e){this.parameters.set(fe.LOGIN_HINT,encodeURIComponent(e))},e.prototype.addCcsUpn=function(e){this.parameters.set(ae.CCS_HEADER,encodeURIComponent("UPN:"+e))},e.prototype.addCcsOid=function(e){this.parameters.set(ae.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},e.prototype.addSid=function(e){this.parameters.set(fe.SID,encodeURIComponent(e))},e.prototype.addClaims=function(e,t){var r=this.addClientCapabilitiesToClaims(e,t);Jo.validateClaims(r),this.parameters.set(ue.CLAIMS,encodeURIComponent(r))},e.prototype.addCorrelationId=function(e){this.parameters.set(ue.CLIENT_REQUEST_ID,encodeURIComponent(e))},e.prototype.addLibraryInfo=function(e){this.parameters.set(ue.X_CLIENT_SKU,e.sku),this.parameters.set(ue.X_CLIENT_VER,e.version),e.os&&this.parameters.set(ue.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(ue.X_CLIENT_CPU,e.cpu)},e.prototype.addApplicationTelemetry=function(e){(null==e?void 0:e.appName)&&this.parameters.set(ue.X_APP_NAME,e.appName),(null==e?void 0:e.appVersion)&&this.parameters.set(ue.X_APP_VER,e.appVersion)},e.prototype.addPrompt=function(e){Jo.validatePrompt(e),this.parameters.set(""+ue.PROMPT,encodeURIComponent(e))},e.prototype.addState=function(e){hr.isEmpty(e)||this.parameters.set(ue.STATE,encodeURIComponent(e))},e.prototype.addNonce=function(e){this.parameters.set(ue.NONCE,encodeURIComponent(e))},e.prototype.addCodeChallengeParams=function(e,t){if(Jo.validateCodeChallengeParams(e,t),!e||!t)throw $n.createInvalidCodeChallengeParamsError();this.parameters.set(ue.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(ue.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},e.prototype.addAuthorizationCode=function(e){this.parameters.set(ue.CODE,encodeURIComponent(e))},e.prototype.addDeviceCode=function(e){this.parameters.set(ue.DEVICE_CODE,encodeURIComponent(e))},e.prototype.addRefreshToken=function(e){this.parameters.set(ue.REFRESH_TOKEN,encodeURIComponent(e))},e.prototype.addCodeVerifier=function(e){this.parameters.set(ue.CODE_VERIFIER,encodeURIComponent(e))},e.prototype.addClientSecret=function(e){this.parameters.set(ue.CLIENT_SECRET,encodeURIComponent(e))},e.prototype.addClientAssertion=function(e){hr.isEmpty(e)||this.parameters.set(ue.CLIENT_ASSERTION,encodeURIComponent(e))},e.prototype.addClientAssertionType=function(e){hr.isEmpty(e)||this.parameters.set(ue.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},e.prototype.addOboAssertion=function(e){this.parameters.set(ue.OBO_ASSERTION,encodeURIComponent(e))},e.prototype.addRequestTokenUse=function(e){this.parameters.set(ue.REQUESTED_TOKEN_USE,encodeURIComponent(e))},e.prototype.addGrantType=function(e){this.parameters.set(ue.GRANT_TYPE,encodeURIComponent(e))},e.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},e.prototype.addExtraQueryParameters=function(e){var t=this;Jo.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach((function(r){t.parameters.set(r,e[r])}))},e.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(n){throw $n.createInvalidClaimsRequestError()}else r={};return t&&t.length>0&&(r.hasOwnProperty(le.ACCESS_TOKEN)||(r[le.ACCESS_TOKEN]={}),r[le.ACCESS_TOKEN][le.XMS_CC]={values:t}),JSON.stringify(r)},e.prototype.addUsername=function(e){this.parameters.set(Pe.username,encodeURIComponent(e))},e.prototype.addPassword=function(e){this.parameters.set(Pe.password,encodeURIComponent(e))},e.prototype.addPopToken=function(e){hr.isEmpty(e)||(this.parameters.set(ue.TOKEN_TYPE,ke.POP),this.parameters.set(ue.REQ_CNF,encodeURIComponent(e)))},e.prototype.addSshJwk=function(e){hr.isEmpty(e)||(this.parameters.set(ue.TOKEN_TYPE,ke.SSH),this.parameters.set(ue.REQ_CNF,encodeURIComponent(e)))},e.prototype.addServerTelemetry=function(e){this.parameters.set(ue.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(ue.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},e.prototype.addThrottling=function(){this.parameters.set(ue.X_MS_LIB_CAPABILITY,Fe)},e.prototype.addLogoutHint=function(e){this.parameters.set(ue.LOGOUT_HINT,encodeURIComponent(e))},e.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach((function(t,r){e.push(r+"="+t)})),e.join("&")},e}(),Xo=function(e,t,r,n,o){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=n||null,this.appMetadata=o||null};!function(e){e.SW="sw",e.UHW="uhw"}(Bo||(Bo={}));var Zo=function(){function e(e){this.cryptoUtils=e}return e.prototype.generateCnf=function(e){return ne(this,void 0,void 0,(function(){var t,r,n;return oe(this,(function(o){switch(o.label){case 0:return[4,this.generateKid(e)];case 1:return t=o.sent(),r=this.cryptoUtils.base64Encode(JSON.stringify(t)),n={kid:t.kid,reqCnfString:r},[4,this.cryptoUtils.hashString(r)];case 2:return[2,(n.reqCnfHash=o.sent(),n)]}}))}))},e.prototype.generateKid=function(e){return ne(this,void 0,void 0,(function(){return oe(this,(function(t){switch(t.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return[2,{kid:t.sent(),xms_ksl:Bo.SW}]}}))}))},e.prototype.signPopToken=function(e,t,r){return ne(this,void 0,void 0,(function(){return oe(this,(function(n){return[2,this.signPayload(e,t,r)]}))}))},e.prototype.signPayload=function(e,t,r,n){return ne(this,void 0,void 0,(function(){var o,i,a,s,c,u;return oe(this,(function(l){switch(l.label){case 0:return o=r.resourceRequestMethod,i=r.resourceRequestUri,a=r.shrClaims,s=r.shrNonce,c=i?new So(i):void 0,u=null==c?void 0:c.getUrlComponents(),[4,this.cryptoUtils.signJwt(re({at:e,ts:io.nowSeconds(),m:null==o?void 0:o.toUpperCase(),u:null==u?void 0:u.HostNameAndPort,nonce:s||this.cryptoUtils.createNewGuid(),p:null==u?void 0:u.AbsolutePath,q:(null==u?void 0:u.QueryString)?[[],u.QueryString]:void 0,client_claims:a||void 0},n),t,r.correlationId)];case 1:return[2,l.sent()]}}))}))},e}(),$o=function(){function e(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(e.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),e}(),ei=function(){function e(e,t,r,n,o,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i}return e.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?dr.createStateNotFoundError("Cached State"):dr.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw dr.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(In.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new In(e.error||de.EMPTY_STRING,e.error_description,e.suberror);throw new En(e.error||de.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&bn(e.client_info,r)},e.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(In.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new In(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new En(e.error,t,e.suberror)}},e.prototype.handleServerTokenResponse=function(t,r,n,o,i,a,s,c){return ne(this,void 0,void 0,(function(){var u,l,d,h,p;return oe(this,(function(f){switch(f.label){case 0:if(t.id_token&&(u=new to(t.id_token||de.EMPTY_STRING,this.cryptoObj),i&&!hr.isEmpty(i.nonce)&&u.claims.nonce!==i.nonce))throw dr.createNonceMismatchError();this.homeAccountIdentifier=kn.generateHomeAccountId(t.client_info||de.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,u),i&&i.state&&(l=po.parseRequestState(this.cryptoObj,i.state)),t.key_id=t.key_id||o.sshKid||void 0,d=this.generateCacheRecord(t,r,n,o,u,a,i),f.label=1;case 1:return f.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),h=new $o(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(h)]):[3,3];case 2:f.sent(),f.label=3;case 3:return!s||c||!d.account||(p=d.account.generateAccountKey(),this.cacheStorage.getAccount(p))?[4,this.cacheStorage.saveCacheRecord(d)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,e.generateAuthenticationResult(this.cryptoObj,r,d,!1,o,u,l,void 0)]);case 4:return f.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&h?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(h)]):[3,7];case 6:f.sent(),f.label=7;case 7:return[7];case 8:return[2,e.generateAuthenticationResult(this.cryptoObj,r,d,!1,o,u,l,t.spa_code)]}}))}))},e.prototype.generateCacheRecord=function(e,t,r,n,o,i,a){var s,c,u=t.getPreferredCache();if(hr.isEmpty(u))throw dr.createInvalidCacheEnvironmentError();!hr.isEmpty(e.id_token)&&o&&(s=oo.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||de.EMPTY_STRING,this.clientId,o.claims.tid||de.EMPTY_STRING),c=this.generateAccountEntity(e,o,t,a));var l=null;if(!hr.isEmpty(e.access_token)){var d=e.scope?eo.fromString(e.scope):new eo(n.scopes||[]),h=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,p=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,f=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,g=r+h,m=g+p,v=f&&f>0?r+f:void 0;l=ao.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||de.EMPTY_STRING,this.clientId,o?o.claims.tid||de.EMPTY_STRING:t.tenant,d.printScopes(),g,m,this.cryptoObj,v,e.token_type,i,e.key_id,n.claims,n.requestedClaimsHash)}var y=null;hr.isEmpty(e.refresh_token)||(y=so.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||de.EMPTY_STRING,this.clientId,e.foci,i));var _=null;return hr.isEmpty(e.foci)||(_=co.createAppMetadataEntity(this.clientId,u,e.foci)),new Xo(c,s,l,y,_)},e.prototype.generateAccountEntity=function(e,t,r,n){var o=r.authorityType,i=n?n.cloud_graph_host_name:de.EMPTY_STRING,a=n?n.msgraph_host:de.EMPTY_STRING;if(o===fn.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),kn.createGenericAccount(this.homeAccountIdentifier,t,r,i,a);if(hr.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw dr.createClientInfoEmptyError();return e.client_info?kn.createAccount(e.client_info,this.homeAccountIdentifier,t,r,i,a):kn.createGenericAccount(this.homeAccountIdentifier,t,r,i,a)},e.generateAuthenticationResult=function(e,t,r,n,o,i,a,s){var c,u,l;return ne(this,void 0,void 0,(function(){var d,h,p,f,g,m,v,y,_,E,C;return oe(this,(function(w){switch(w.label){case 0:if(d=de.EMPTY_STRING,h=[],p=null,g=de.EMPTY_STRING,!r.accessToken)return[3,4];if(r.accessToken.tokenType!==ke.POP)return[3,2];if(m=new Zo(e),v=r.accessToken,y=v.secret,!(_=v.keyId))throw dr.createKeyIdMissingError();return[4,m.signPopToken(y,_,o)];case 1:return d=w.sent(),[3,3];case 2:d=r.accessToken.secret,w.label=3;case 3:h=eo.fromString(r.accessToken.target).asArray(),p=new Date(1e3*Number(r.accessToken.expiresOn)),f=new Date(1e3*Number(r.accessToken.extendedExpiresOn)),w.label=4;case 4:return r.appMetadata&&(g=r.appMetadata.familyId===be?be:de.EMPTY_STRING),E=(null==i?void 0:i.claims.oid)||(null==i?void 0:i.claims.sub)||de.EMPTY_STRING,C=(null==i?void 0:i.claims.tid)||de.EMPTY_STRING,[2,{authority:t.canonicalAuthority,uniqueId:E,tenantId:C,scopes:h,account:r.account?r.account.getAccountInfo():null,idToken:i?i.rawToken:de.EMPTY_STRING,idTokenClaims:i?i.claims:{},accessToken:d,fromCache:n,expiresOn:p,correlationId:o.correlationId,extExpiresOn:f,familyId:g,tokenType:(null===(c=r.accessToken)||void 0===c?void 0:c.tokenType)||de.EMPTY_STRING,state:a?a.userRequestState:de.EMPTY_STRING,cloudGraphHostName:(null===(u=r.account)||void 0===u?void 0:u.cloudGraphHostName)||de.EMPTY_STRING,msGraphHost:(null===(l=r.account)||void 0===l?void 0:l.msGraphHost)||de.EMPTY_STRING,code:s,fromNativeBroker:!1}]}}))}))},e}(),ti=function(e){function t(t){var r=e.call(this,t)||this;return r.includeRedirectUri=!0,r}return te(t,e),t.prototype.getAuthCodeUrl=function(e){return ne(this,void 0,void 0,(function(){var t;return oe(this,(function(r){switch(r.label){case 0:return[4,this.createAuthCodeUrlQueryString(e)];case 1:return t=r.sent(),[2,So.appendQueryString(this.authority.authorizationEndpoint,t)]}}))}))},t.prototype.acquireToken=function(e,t){return ne(this,void 0,void 0,(function(){var r,n,o;return oe(this,(function(i){switch(i.label){case 0:if(this.logger.info("in acquireToken call"),!e||hr.isEmpty(e.code))throw dr.createTokenRequestCannotBeMadeError();return r=io.nowSeconds(),[4,this.executeTokenRequest(this.authority,e)];case 1:return n=i.sent(),(o=new ei(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(n.body),[4,o.handleServerTokenResponse(n.body,this.authority,r,e,t)];case 2:return[2,i.sent()]}}))}))},t.prototype.handleFragmentResponse=function(e,t){var r=new ei(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),n=new So(e),o=So.getDeserializedHash(n.getHash());if(r.validateServerAuthorizationCodeResponse(o,t,this.cryptoUtils),!o.code)throw dr.createNoAuthCodeInServerResponseError();return re(re({},o),{code:o.code})},t.prototype.getLogoutUri=function(e){if(!e)throw $n.createEmptyLogoutRequestError();var t=this.createLogoutUrlQueryString(e);return So.appendQueryString(this.authority.endSessionEndpoint,t)},t.prototype.executeTokenRequest=function(e,t){return ne(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return oe(this,(function(u){switch(u.label){case 0:return r={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[4,this.createTokenRequestBody(t)];case 1:if(n=u.sent(),o=this.createTokenQueryParameters(t),i=void 0,t.clientInfo)try{a=bn(t.clientInfo,this.cryptoUtils),i={credential:""+a.uid+_e.CLIENT_INFO_SEPARATOR+a.utid,type:Rn.HOME_ACCOUNT_ID}}catch(l){this.logger.verbose("Could not parse client info for CCS Header: "+l)}return s=this.createTokenRequestHeaders(i||t.ccsCredential),c=hr.isEmpty(o)?e.tokenEndpoint:e.tokenEndpoint+"?"+o,[2,this.executePostToTokenEndpoint(c,n,s,r)]}}))}))},t.prototype.createTokenQueryParameters=function(e){var t=new Qo;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},t.prototype.createTokenRequestBody=function(e){return ne(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return oe(this,(function(c){switch(c.label){case 0:return(t=new Qo).addClientId(this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):Jo.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(r=this.config.clientCredentials.clientAssertion,t.addClientAssertion(r.assertion),t.addClientAssertionType(r.assertionType)),t.addGrantType(ve.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme!==ke.POP?[3,2]:[4,new Zo(this.cryptoUtils).generateCnf(e)];case 1:return n=c.sent(),t.addPopToken(n.reqCnfString),[3,3];case 2:if(e.authenticationScheme===ke.SSH){if(!e.sshJwk)throw $n.createMissingSshJwkError();t.addSshJwk(e.sshJwk)}c.label=3;case 3:if(o=e.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(o),(!hr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),i=void 0,e.clientInfo)try{a=bn(e.clientInfo,this.cryptoUtils),i={credential:""+a.uid+_e.CLIENT_INFO_SEPARATOR+a.utid,type:Rn.HOME_ACCOUNT_ID}}catch(u){this.logger.verbose("Could not parse client info for CCS Header: "+u)}else i=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&i)switch(i.type){case Rn.HOME_ACCOUNT_ID:try{a=An(i.credential),t.addCcsOid(a)}catch(u){this.logger.verbose("Could not parse home account ID for CCS Header: "+u)}break;case Rn.UPN:t.addCcsUpn(i.credential)}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[ue.RETURN_SPA_CODE]||t.addExtraQueryParameters(((s={})[ue.RETURN_SPA_CODE]="1",s)),[2,t.createQueryString()]}}))}))},t.prototype.createAuthCodeUrlQueryString=function(e){return ne(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return oe(this,(function(c){switch(c.label){case 0:if((t=new Qo).addClientId(this.config.authOptions.clientId),r=ie(e.scopes||[],e.extraScopesToConsent||[]),t.addScopes(r),t.addRedirectUri(e.redirectUri),n=e.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==ge.SELECT_ACCOUNT)if(e.sid&&e.prompt===ge.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){if(o=this.extractAccountSid(e.account),i=this.extractLoginHint(e.account)){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(i);try{a=An(e.account.homeAccountId),t.addCcsOid(a)}catch(u){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(o&&e.prompt===ge.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(o);try{a=An(e.account.homeAccountId),t.addCcsOid(a)}catch(u){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{a=An(e.account.homeAccountId),t.addCcsOid(a)}catch(u){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(!hr.isEmpty(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),e.nativeBroker?(t.addNativeBroker(),e.authenticationScheme!==ke.POP?[3,2]:[4,new Zo(this.cryptoUtils).generateCnf(e)]):[3,2];case 1:s=c.sent(),t.addPopToken(s.reqCnfHash),c.label=2;case 2:return[2,t.createQueryString()]}}))}))},t.prototype.createLogoutUrlQueryString=function(e){var t=new Qo;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},t.prototype.extractAccountSid=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.sid)||null},t.prototype.extractLoginHint=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.login_hint)||null},t}(Vo);function ri(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")}var ni={"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},oi={"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}};var ii,ai=function(){function e(e){this.networkInterface=e}return e.prototype.detectRegion=function(t,r,n){return ne(this,void 0,void 0,(function(){var o,i,a,s,c;return oe(this,(function(u){switch(u.label){case 0:if(o=t)return[3,8];i=e.IMDS_OPTIONS,n&&(i.proxyUrl=n),u.label=1;case 1:return u.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(de.IMDS_VERSION,i)];case 2:return(a=u.sent()).status===Oe.httpSuccess&&(o=a.body,r.region_source=Me.IMDS),a.status!==Oe.httpBadRequest?[3,5]:[4,this.getCurrentVersion(i)];case 3:return(s=u.sent())?[4,this.getRegionFromIMDS(s,i)]:(r.region_source=Me.FAILED_AUTO_DETECTION,[2,null]);case 4:(c=u.sent()).status===Oe.httpSuccess&&(o=c.body,r.region_source=Me.IMDS),u.label=5;case 5:return[3,7];case 6:return u.sent(),r.region_source=Me.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:r.region_source=Me.ENVIRONMENT_VARIABLE,u.label=9;case 9:return o||(r.region_source=Me.FAILED_AUTO_DETECTION),[2,o||null]}}))}))},e.prototype.getRegionFromIMDS=function(e,t){return ne(this,void 0,void 0,(function(){return oe(this,(function(r){return[2,this.networkInterface.sendGetRequestAsync(de.IMDS_ENDPOINT+"?api-version="+e+"&format=text",t,de.IMDS_TIMEOUT)]}))}))},e.prototype.getCurrentVersion=function(e){return ne(this,void 0,void 0,(function(){var t;return oe(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(de.IMDS_ENDPOINT+"?format=json",e)];case 1:return(t=r.sent()).status===Oe.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?[2,t.body["newest-versions"][0]]:[2,null];case 2:return r.sent(),[2,null];case 3:return[2]}}))}))},e.IMDS_OPTIONS={headers:{Metadata:"true"}},e}(),si=function(){function e(e,t,r,n,o){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscovery=new ai(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=o||de.EMPTY_STRING}return Object.defineProperty(e.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;return e.length&&e[0].toLowerCase()===de.ADFS?fn.Adfs:fn.Default},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new So(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw dr.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw dr.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw dr.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw dr.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw dr.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw dr.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}throw dr.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),e.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},e.prototype.replacePath=function(e){var t=e,r=new So(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((function(e,n){var o=r[n];e!==o&&(t=t.replace("/"+o+"/","/"+e+"/"))})),t},Object.defineProperty(e.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===fn.Adfs||this.protocolMode===fo.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),e.prototype.discoveryComplete=function(){return!!this.metadata},e.prototype.resolveEndpointsAsync=function(){return ne(this,void 0,void 0,(function(){var e,t,r,n;return oe(this,(function(o){switch(o.label){case 0:return(e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(e=new lo).updateCanonicalAuthority(this.canonicalAuthority),[4,this.updateCloudDiscoveryMetadata(e)];case 1:return t=o.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network),[4,this.updateEndpointMetadata(e)];case 2:return r=o.sent(),t!==Se.CACHE&&r!==Se.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority)),n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache),this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e,[2]}}))}))},e.prototype.updateEndpointMetadata=function(e){var t,r;return ne(this,void 0,void 0,(function(){var n,o;return oe(this,(function(i){switch(i.label){case 0:return(n=this.getEndpointMetadataFromConfig())?(e.updateEndpointMetadata(n,!1),[2,Se.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,Se.CACHE]:(o=this.getEndpointMetadataFromHardcodedValues(),[4,this.getEndpointMetadataFromNetwork()]);case 1:return(n=i.sent())?(null===(t=this.authorityOptions.azureRegionConfiguration)||void 0===t?void 0:t.azureRegion)?[4,this.updateMetadataWithRegionalInformation(n)]:[3,3]:[3,4];case 2:n=i.sent(),i.label=3;case 3:return e.updateEndpointMetadata(n,!0),[2,Se.NETWORK];case 4:return!o||this.authorityOptions.skipAuthorityMetadataCache?[3,7]:(null===(r=this.authorityOptions.azureRegionConfiguration)||void 0===r?void 0:r.azureRegion)?[4,this.updateMetadataWithRegionalInformation(o)]:[3,6];case 5:o=i.sent(),i.label=6;case 6:return e.updateEndpointMetadata(o,!1),[2,Se.HARDCODED_VALUES];case 7:throw dr.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}}))}))},e.prototype.isAuthoritySameType=function(e){return new So(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},e.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw $n.createInvalidAuthorityMetadataError()}return null},e.prototype.getEndpointMetadataFromNetwork=function(){return ne(this,void 0,void 0,(function(){var e,t;return oe(this,(function(r){switch(r.label){case 0:e={},this.proxyUrl&&(e.proxyUrl=this.proxyUrl),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,e)];case 2:return[2,ri((t=r.sent()).body)?t.body:null];case 3:return r.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in ni?ni[this.canonicalAuthority]:null},e.prototype.updateMetadataWithRegionalInformation=function(t){var r,n,o,i,a;return ne(this,void 0,void 0,(function(){var s,c;return oe(this,(function(u){switch(u.label){case 0:return[4,this.regionDiscovery.detectRegion(null===(r=this.authorityOptions.azureRegionConfiguration)||void 0===r?void 0:r.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)];case 1:return s=u.sent(),c=(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.azureRegion)===de.AZURE_REGION_AUTO_DISCOVER_FLAG?s:null===(o=this.authorityOptions.azureRegionConfiguration)||void 0===o?void 0:o.azureRegion,(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===de.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=s?Ue.AUTO_DETECTION_REQUESTED_SUCCESSFUL:Ue.AUTO_DETECTION_REQUESTED_FAILED:this.regionDiscoveryMetadata.region_outcome=s?(null===(a=this.authorityOptions.azureRegionConfiguration)||void 0===a?void 0:a.azureRegion)===s?Ue.CONFIGURED_MATCHES_DETECTED:Ue.CONFIGURED_NOT_DETECTED:Ue.CONFIGURED_NO_AUTO_DETECTION,c?(this.regionDiscoveryMetadata.region_used=c,[2,e.replaceWithRegionalInformation(t,c)]):[2,t]}}))}))},e.prototype.updateCloudDiscoveryMetadata=function(e){return ne(this,void 0,void 0,(function(){var t,r;return oe(this,(function(n){switch(n.label){case 0:return(t=this.getCloudDiscoveryMetadataFromConfig())?(e.updateCloudDiscoveryMetadata(t,!1),[2,Se.CONFIG]):this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!e.isExpired()?[2,Se.CACHE]:(r=this.getCloudDiscoveryMetadataFromHarcodedValues(),[4,this.getCloudDiscoveryMetadataFromNetwork()]);case 1:if(t=n.sent())return e.updateCloudDiscoveryMetadata(t,!0),[2,Se.NETWORK];if(r&&!this.options.skipAuthorityMetadataCache)return e.updateCloudDiscoveryMetadata(r,!1),[2,Se.HARDCODED_VALUES];throw $n.createUntrustedAuthorityError()}}))}))},e.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata)try{var t=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=e.getCloudDiscoveryMetadataFromNetworkResponse(t.metadata,this.hostnameAndPort);if(r)return r}catch(n){throw $n.createInvalidCloudDiscoveryMetadataError()}return this.isInKnownAuthorities()?e.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort):null},e.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return ne(this,void 0,void 0,(function(){var t,r,n,o,i;return oe(this,(function(a){switch(a.label){case 0:t=""+de.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",r={},this.proxyUrl&&(r.proxyUrl=this.proxyUrl),n=null,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(t,r)];case 2:return o=a.sent(),i=function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(o.body)?o.body.metadata:[],0===i.length?[2,null]:(n=e.getCloudDiscoveryMetadataFromNetworkResponse(i,this.hostnameAndPort),[3,4]);case 3:return a.sent(),[2,null];case 4:return n||(n=e.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,n]}}))}))},e.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in oi?oi[this.canonicalAuthority]:null},e.prototype.isInKnownAuthorities=function(){var e=this;return this.authorityOptions.knownAuthorities.filter((function(t){return So.getDomainFromUrl(t).toLowerCase()===e.hostnameAndPort})).length>0},e.generateAuthority=function(e,t){var r;if(t&&t.azureCloudInstance!==go.None){var n=t.tenant?t.tenant:de.DEFAULT_COMMON_TENANT;r=t.azureCloudInstance+"/"+n+"/"}return r||e},e.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},e.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r-1)return n}return null},e.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw dr.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},e.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},e.isPublicCloudAuthority=function(e){return de.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},e.buildRegionalAuthorityString=function(e,t,r){var n=new So(e);n.validateAsUri();var o=n.getUrlComponents(),i=t+"."+o.HostNameAndPort;this.isPublicCloudAuthority(o.HostNameAndPort)&&(i=t+"."+de.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var a=So.constructAuthorityUriFromObject(re(re({},n.getUrlComponents()),{HostNameAndPort:i})).urlString;return r?a+"?"+r:a},e.replaceWithRegionalInformation=function(t,r){return t.authorization_endpoint=e.buildRegionalAuthorityString(t.authorization_endpoint,r),t.token_endpoint=e.buildRegionalAuthorityString(t.token_endpoint,r,"allowestsrnonmsi=true"),t.end_session_endpoint&&(t.end_session_endpoint=e.buildRegionalAuthorityString(t.end_session_endpoint,r)),t},e}(),ci=function(){function e(){}return e.createDiscoveredInstance=function(t,r,n,o,i){return ne(this,void 0,void 0,(function(){var a,s;return oe(this,(function(c){switch(c.label){case 0:a=e.createInstance(t,r,n,o,i),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,a.resolveEndpointsAsync()];case 2:return c.sent(),[2,a];case 3:throw s=c.sent(),dr.createEndpointDiscoveryIncompleteError(s);case 4:return[2]}}))}))},e.createInstance=function(e,t,r,n,o){if(hr.isEmpty(e))throw $n.createUrlEmptyError();return new si(e,t,r,n,o)},e}(),ui=function(){function e(e,t){this.cacheOutcome=xe.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||de.EMPTY_STRING,this.wrapperVer=e.wrapperVer||de.EMPTY_STRING,this.telemetryCacheKey=Ne.CACHE_KEY+_e.CACHE_KEY_SEPARATOR+e.clientId}return e.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+Ne.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(Ne.VALUE_SEPARATOR),r=[e,this.getRegionDiscoveryFields()].join(Ne.VALUE_SEPARATOR);return[Ne.SCHEMA_VERSION,r,t].join(Ne.CATEGORY_SEPARATOR)},e.prototype.generateLastRequestHeaderValue=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t),n=t.failedRequests.slice(0,2*r).join(Ne.VALUE_SEPARATOR),o=t.errors.slice(0,r).join(Ne.VALUE_SEPARATOR),i=t.errors.length,a=[i,r=Ne.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),hr.isEmpty(e.subError)?hr.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(Ne.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},e.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},e.prototype.getLastRequests=function(){var e=new uo;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},e.prototype.clearTelemetryCache=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t);if(r===t.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{var n=new uo;n.failedRequests=t.failedRequests.slice(2*r),n.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n)}},e.maxErrorsToSend=function(e){var t,r=0,n=0,o=e.errors.length;for(t=0;to&&(t.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(a),n(nn.createMonitorPopupTimeoutError())))}),tt)}))},t.prototype.waitForLogoutPopup=function(e){var t=this;return new Promise((function(r){t.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var n=setInterval((function(){e.closed&&(t.logger.error("PopupHandler.waitForLogoutPopup - window closed"),t.cleanPopup(),clearInterval(n),r());var o=de.EMPTY_STRING;try{o=e.location.href}catch(i){}hr.isEmpty(o)||"about:blank"===o||(t.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(n),t.cleanPopup(e),r())}),tt)}))},t.prototype.openPopup=function(e,t){try{var r=void 0;if(t.popup?(r=t.popup,this.logger.verbosePii("Navigating popup window to: "+e),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii("Opening popup window to: "+e),r=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!r)throw nn.createEmptyWindowCreatedError();return r.focus&&r.focus(),this.currentWindow=r,window.addEventListener("beforeunload",this.unloadWindow),r}catch(n){throw this.logger.error("error opening popup "+n.message),this.browserStorage.setInteractionInProgress(!1),nn.createPopupWindowError(n.toString())}},t.prototype.openSizedPopup=function(e,t,r){var n,o,i,a,s=window.screenLeft?window.screenLeft:window.screenX,c=window.screenTop?window.screenTop:window.screenY,u=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,d=null===(n=r.popupSize)||void 0===n?void 0:n.width,h=null===(o=r.popupSize)||void 0===o?void 0:o.height,p=null===(i=r.popupPosition)||void 0===i?void 0:i.top,f=null===(a=r.popupPosition)||void 0===a?void 0:a.left;return(!d||d<0||d>u)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),d=Ze),(!h||h<0||h>l)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),h=$e),(!p||p<0||p>l)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),p=Math.max(0,l/2-$e/2+c)),(!f||f<0||f>u)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),f=Math.max(0,u/2-Ze/2+s)),window.open(e,t,"width="+d+", height="+h+", top="+p+", left="+f+", scrollbars=yes")},t.prototype.unloadWindow=function(e){this.browserStorage.cleanRequestByInteractionType(Je.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()},t.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},t.prototype.generatePopupName=function(e,t){return et+"."+this.config.auth.clientId+"."+e.join("-")+"."+t+"."+this.correlationId},t.prototype.generateLogoutPopupName=function(e){var t=e.account&&e.account.homeAccountId;return et+"."+this.config.auth.clientId+"."+t+"."+this.correlationId},t}(di),_i=function(e){function t(t,r,n,o,i){var a=e.call(this,t,r,n,o)||this;return a.browserCrypto=i,a}return Y(t,e),t.prototype.initiateAuthRequest=function(e,t){return Q(this,void 0,void 0,(function(){var r;return X(this,(function(n){switch(n.label){case 0:return this.logger.verbose("RedirectHandler.initiateAuthRequest called"),hr.isEmpty(e)?[3,7]:(t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ye.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ye.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+e),r={apiId:Ve.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1},"function"!=typeof t.onRedirectNavigate?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1===t.onRedirectNavigate(e)?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,t.navigationClient.navigateExternal(e,r)])));case 1:case 5:return n.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,t.navigationClient.navigateExternal(e,r)];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),nn.createEmptyNavigationUriError();case 8:return[2]}}))}))},t.prototype.handleCodeResponseFromHash=function(e,t,r,n){return Q(this,void 0,void 0,(function(){var o,i,a,s,c,u,l;return X(this,(function(d){switch(d.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),hr.isEmpty(e))throw nn.createEmptyHashError(e);if(this.browserStorage.setInteractionInProgress(!1),o=this.browserStorage.generateStateKey(t),!(i=this.browserStorage.getTemporaryCache(o)))throw dr.createStateNotFoundError("Cached State");try{a=this.authModule.handleFragmentResponse(e,i)}catch(h){throw h instanceof En&&h.subError===Ir.code?nn.createUserCancelledError():h}return s=this.browserStorage.generateNonceKey(i),c=this.browserStorage.getTemporaryCache(s),this.authCodeRequest.code=a.code,a.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(a.cloud_instance_host_name,r,n)]:[3,2];case 1:d.sent(),d.label=2;case 2:return a.nonce=c||void 0,a.state=i,a.client_info?this.authCodeRequest.clientInfo=a.client_info:(u=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=u),[4,this.authModule.acquireToken(this.authCodeRequest,a)];case 3:return l=d.sent(),this.browserStorage.cleanRequestByState(t),[2,l]}}))}))},t}(vi),Ei=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.acquireToken=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l=this;return X(this,(function(d){switch(d.label){case 0:return[4,this.initializeAuthorizationRequest(e,Je.Redirect)];case 1:t=d.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||de.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(Ve.acquireTokenRedirect),n=function(e){e.persisted&&(l.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),l.browserStorage.cleanRequestByState(t.state))},d.label=2;case 2:return d.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(t)];case 3:return o=d.sent(),[4,this.createAuthCodeClient(r,t.authority,t.azureCloudOptions)];case 4:return i=d.sent(),this.logger.verbose("Auth code client created"),a=new _i(i,this.browserStorage,o,this.logger,this.browserCrypto),[4,i.getAuthCodeUrl(J(J({},t),{nativeBroker:mi.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}))];case 5:return s=d.sent(),c=this.getRedirectStartPage(e.redirectStartPage),this.logger.verbosePii("Redirect start page: "+c),window.addEventListener("pageshow",n),[4,a.initiateAuthRequest(s,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:c,onRedirectNavigate:e.onRedirectNavigate})];case 6:return[2,d.sent()];case 7:throw(u=d.sent())instanceof pt&&u.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",n),r.cacheFailedRequest(u),this.browserStorage.cleanRequestByState(t.state),u;case 8:return[2]}}))}))},t.prototype.handleRedirectPromise=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d,h;return X(this,(function(p){switch(p.label){case 0:t=this.initializeServerTelemetryManager(Ve.handleRedirectPromise),p.label=1;case 1:if(p.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(r=this.getRedirectResponseHash(e||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(Je.Redirect),[2,null];n=void 0;try{o=So.getDeserializedHash(r),n=this.validateAndExtractStateFromHash(o,Je.Redirect),this.logger.verbose("State extracted from hash")}catch(f){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+f),this.browserStorage.cleanRequestByInteractionType(Je.Redirect),[2,null]}return i=this.browserStorage.getTemporaryCache(Ye.ORIGIN_URI,!0)||de.EMPTY_STRING,a=So.removeHashFromUrl(i),s=So.removeHashFromUrl(window.location.href),a===s&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(r,n,t)]):[3,3];case 2:return c=p.sent(),i.indexOf("#")>-1&&Lo.replaceHash(i),[2,c];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(r,n,t)]);case 4:return Lo.isInIframe()&&!this.config.system.allowRedirectInIframe?[3,9]:(this.browserStorage.setTemporaryCache(Ye.URL_HASH,r,!0),u={apiId:Ve.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},l=!0,i&&"null"!==i?[3,6]:(d=Lo.getHomepage(),this.browserStorage.setTemporaryCache(Ye.ORIGIN_URI,d,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(d,u)]));case 5:return l=p.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+i),[4,this.navigationClient.navigateInternal(i,u)];case 7:l=p.sent(),p.label=8;case 8:if(!l)return[2,this.handleHash(r,n,t)];p.label=9;case 9:return[2,null];case 10:throw(h=p.sent())instanceof pt&&h.setCorrelationId(this.correlationId),t.cacheFailedRequest(h),this.browserStorage.cleanRequestByInteractionType(Je.Redirect),h;case 11:return[2]}}))}))},t.prototype.getRedirectResponseHash=function(e){if(this.logger.verbose("getRedirectResponseHash called"),So.hashContainsKnownProperties(e))return Lo.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;var t=this.browserStorage.getTemporaryCache(Ye.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ye.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),t},t.prototype.handleHash=function(e,t,r){return Q(this,void 0,void 0,(function(){var n,o,i,a,s,c,u=this;return X(this,(function(l){switch(l.label){case 0:if(n=this.browserStorage.getCachedRequest(t,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),(o=So.getDeserializedHash(e)).accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw nn.createNativeConnectionNotEstablishedError();return i=new gi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ve.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,o.accountId,n.correlationId),a=po.parseRequestState(this.browserCrypto,t).userRequestState,[2,i.acquireToken(J(J({},n),{state:a,prompt:void 0})).finally((function(){u.browserStorage.cleanRequestByState(t)}))]}if(!(s=this.browserStorage.getCachedAuthority(t)))throw nn.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(r,s)];case 1:return c=l.sent(),this.logger.verbose("Auth code client created"),Yo.removeThrottle(this.browserStorage,this.config.auth.clientId,n),[4,new _i(c,this.browserStorage,n,this.logger,this.browserCrypto).handleCodeResponseFromHash(e,t,c.authority,this.networkClient)];case 2:return[2,l.sent()]}}))}))},t.prototype.logout=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a;return X(this,(function(s){switch(s.label){case 0:this.logger.verbose("logoutRedirect called"),t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(Ve.logout),s.label=1;case 1:return s.trys.push([1,10,,11]),this.eventHandler.emitEvent(jo.LOGOUT_START,Je.Redirect,e),[4,this.clearCacheOnLogout(t.account)];case 2:return s.sent(),n={apiId:Ve.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(r,e&&e.authority)];case 3:return o=s.sent(),this.logger.verbose("Auth code client created"),i=o.getLogoutUri(t),this.eventHandler.emitEvent(jo.LOGOUT_SUCCESS,Je.Redirect,t),e&&"function"==typeof e.onRedirectNavigate?!1===e.onRedirectNavigate(i)?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(i,n)]):[3,7];case 4:return s.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),s.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(i,n)];case 8:return s.sent(),[2];case 9:return[3,11];case 10:throw(a=s.sent())instanceof pt&&a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a),this.eventHandler.emitEvent(jo.LOGOUT_FAILURE,Je.Redirect,null,a),this.eventHandler.emitEvent(jo.LOGOUT_END,Je.Redirect),a;case 11:return this.eventHandler.emitEvent(jo.LOGOUT_END,Je.Redirect),[2]}}))}))},t.prototype.getRedirectStartPage=function(e){var t=e||window.location.href;return So.getAbsoluteUrl(t,Lo.getCurrentUri())},t}(di),Ci=function(e){function t(t,r,n,o,i){var a=e.call(this,t,r,n,o)||this;return a.navigateFrameWait=i,a}return Y(t,e),t.prototype.initiateAuthRequest=function(e){return Q(this,void 0,void 0,(function(){var t;return X(this,(function(r){switch(r.label){case 0:if(hr.isEmpty(e))throw this.logger.info("Navigate url is empty"),nn.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(e)]:[3,2];case 1:return t=r.sent(),[3,3];case 2:t=this.loadFrameSync(e),r.label=3;case 3:return[2,t]}}))}))},t.prototype.monitorIframeForHash=function(e,t){var r=this;return new Promise((function(n,o){ti)return r.removeHiddenIframe(e),clearInterval(a),void o(nn.createMonitorIframeTimeoutError());var t=de.EMPTY_STRING,s=e.contentWindow;try{t=s?s.location.href:de.EMPTY_STRING}catch(u){}if(!hr.isEmpty(t)){var c=s?s.location.hash:de.EMPTY_STRING;return So.hashContainsKnownProperties(c)?(r.removeHiddenIframe(e),clearInterval(a),void n(c)):void 0}}),tt)}))},t.prototype.loadFrame=function(e){var t=this;return new Promise((function(r,n){var o=t.createHiddenIframe();setTimeout((function(){o?(o.src=e,r(o)):n("Unable to load iframe")}),t.navigateFrameWait)}))},t.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},t.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},t.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},t}(vi),wi=function(e){function t(t,r,n,o,i,a,s,c,u,l){var d=e.call(this,t,r,n,o,i,a,c,u,l)||this;return d.apiId=s,d}return Y(t,e),t.prototype.acquireToken=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i;return X(this,(function(a){switch(a.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),t=this.performanceClient.startMeasurement(W.SilentIframeClientAcquireToken,e.correlationId),hr.isEmpty(e.loginHint)&&hr.isEmpty(e.sid)&&(!e.account||hr.isEmpty(e.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),e.prompt&&e.prompt!==ge.NONE)throw t.endMeasurement({success:!1}),nn.createSilentPromptValueError(e.prompt);return[4,this.initializeAuthorizationRequest(J(J({},e),{prompt:ge.NONE}),Je.Silent)];case 1:r=a.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||de.EMPTY_STRING,r.account||null),n=this.initializeServerTelemetryManager(this.apiId),a.label=2;case 2:return a.trys.push([2,5,,6]),[4,this.createAuthCodeClient(n,r.authority,r.azureCloudOptions)];case 3:return o=a.sent(),this.logger.verbose("Auth code client created"),[4,this.silentTokenHelper(o,r).then((function(e){return t.endMeasurement({success:!0,fromCache:!1}),e}))];case 4:return[2,a.sent()];case 5:throw(i=a.sent())instanceof pt&&i.setCorrelationId(this.correlationId),n.cacheFailedRequest(i),this.browserStorage.cleanRequestByState(r.state),t.endMeasurement({errorCode:i instanceof pt&&i.errorCode||void 0,subErrorCode:i instanceof pt&&i.subError||void 0,success:!1}),i;case 6:return[2]}}))}))},t.prototype.logout=function(){return Promise.reject(nn.createSilentLogoutUnsupportedError())},t.prototype.silentTokenHelper=function(e,t){return Q(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,l,d=this;return X(this,(function(h){switch(h.label){case 0:return[4,this.initializeAuthorizationCodeRequest(t)];case 1:return r=h.sent(),[4,e.getAuthCodeUrl(J(J({},t),{nativeBroker:mi.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}))];case 2:return n=h.sent(),[4,(o=new Ci(e,this.browserStorage,r,this.logger,this.config.system.navigateFrameWait)).initiateAuthRequest(n)];case 3:return i=h.sent(),[4,o.monitorIframeForHash(i,this.config.system.iframeHashTimeout)];case 4:if(a=h.sent(),s=So.getDeserializedHash(a),c=this.validateAndExtractStateFromHash(s,Je.Silent,r.correlationId),s.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw nn.createNativeConnectionNotEstablishedError();return u=new gi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,s.accountId,this.correlationId),l=po.parseRequestState(this.browserCrypto,c).userRequestState,[2,u.acquireToken(J(J({},t),{state:l,prompt:ge.NONE})).finally((function(){d.browserStorage.cleanRequestByState(c)}))]}return[2,o.handleCodeResponseFromHash(a,c,e.authority,this.networkClient)]}}))}))},t}(di),Ti=function(e){function t(t,r){return e.call(this,t,r)||this}return te(t,e),t.prototype.acquireToken=function(e){return ne(this,void 0,void 0,(function(){var t,r,n;return oe(this,(function(o){switch(o.label){case 0:return t=io.nowSeconds(),[4,this.executeTokenRequest(e,this.authority)];case 1:return r=o.sent(),(n=new ei(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(r.body),[2,n.handleServerTokenResponse(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache)]}}))}))},t.prototype.acquireTokenByRefreshToken=function(e){return ne(this,void 0,void 0,(function(){var t,r;return oe(this,(function(n){if(!e)throw $n.createEmptyTokenRequestError();if(!e.account)throw dr.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(e.account.environment,this.config.authOptions.clientId))try{return[2,this.acquireTokenWithCachedRefreshToken(e,!0)]}catch(o){if(t=o instanceof In&&o.errorCode===Tn.code,r=o instanceof En&&o.errorCode===je&&o.subError===Ke,t||r)return[2,this.acquireTokenWithCachedRefreshToken(e,!1)];throw o}return[2,this.acquireTokenWithCachedRefreshToken(e,!1)]}))}))},t.prototype.acquireTokenWithCachedRefreshToken=function(e,t){return ne(this,void 0,void 0,(function(){var r,n;return oe(this,(function(o){if(!(r=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,e.account,t)))throw In.createNoTokensFoundError();return n=re(re({},e),{refreshToken:r.secret,authenticationScheme:e.authenticationScheme||ke.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Rn.HOME_ACCOUNT_ID}}),[2,this.acquireToken(n)]}))}))},t.prototype.executeTokenRequest=function(e,t){var r;return ne(this,void 0,void 0,(function(){var n,o,i,a,s,c;return oe(this,(function(u){switch(u.label){case 0:return n=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(W.RefreshTokenClientExecuteTokenRequest,e.correlationId),[4,this.createTokenRequestBody(e)];case 1:return o=u.sent(),i=this.createTokenQueryParameters(e),a=this.createTokenRequestHeaders(e.ccsCredential),s={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},c=So.appendQueryString(t.tokenEndpoint,i),[2,this.executePostToTokenEndpoint(c,o,a,s).then((function(e){return null==n||n.endMeasurement({success:!0}),e})).catch((function(e){throw null==n||n.endMeasurement({success:!1}),e}))]}}))}))},t.prototype.createTokenQueryParameters=function(e){var t=new Qo;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},t.prototype.createTokenRequestBody=function(e){var t;return ne(this,void 0,void 0,(function(){var r,n,o,i,a,s;return oe(this,(function(c){switch(c.label){case 0:return r=e.correlationId,n=null===(t=this.performanceClient)||void 0===t?void 0:t.startMeasurement(W.BaseClientCreateTokenRequestHeaders,r),(o=new Qo).addClientId(this.config.authOptions.clientId),o.addScopes(e.scopes),o.addGrantType(ve.REFRESH_TOKEN_GRANT),o.addClientInfo(),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager),o.addCorrelationId(r),o.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(i=this.config.clientCredentials.clientAssertion,o.addClientAssertion(i.assertion),o.addClientAssertionType(i.assertionType)),e.authenticationScheme!==ke.POP?[3,2]:[4,new Zo(this.cryptoUtils).generateCnf(e)];case 1:return a=c.sent(),o.addPopToken(a.reqCnfString),[3,3];case 2:if(e.authenticationScheme===ke.SSH){if(!e.sshJwk)throw null==n||n.endMeasurement({success:!1}),$n.createMissingSshJwkError();o.addSshJwk(e.sshJwk)}c.label=3;case 3:if((!hr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Rn.HOME_ACCOUNT_ID:try{s=An(e.ccsCredential.credential),o.addCcsOid(s)}catch(u){this.logger.verbose("Could not parse home account ID for CCS Header: "+u)}break;case Rn.UPN:o.addCcsUpn(e.ccsCredential.credential)}return null==n||n.endMeasurement({success:!0}),[2,o.createQueryString()]}}))}))},t}(Vo),Si=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.acquireToken=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a=this;return X(this,(function(s){switch(s.label){case 0:return r=[J({},e)],[4,this.initializeBaseRequest(e)];case 1:return t=J.apply(void 0,r.concat([s.sent()])),n=this.performanceClient.startMeasurement(W.SilentRefreshClientAcquireToken,t.correlationId),o=this.initializeServerTelemetryManager(Ve.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(o,t.authority,t.azureCloudOptions)];case 2:return i=s.sent(),this.logger.verbose("Refresh token client created"),[2,i.acquireTokenByRefreshToken(t).then((function(e){return n.endMeasurement({success:!0,fromCache:e.fromCache}),e})).catch((function(e){throw e instanceof pt&&e.setCorrelationId(a.correlationId),o.cacheFailedRequest(e),n.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e}))]}}))}))},t.prototype.logout=function(){return Promise.reject(nn.createSilentLogoutUnsupportedError())},t.prototype.createRefreshTokenClient=function(e,t,r){return Q(this,void 0,void 0,(function(){var n;return X(this,(function(o){switch(o.label){case 0:return[4,this.getClientConfiguration(e,t,r)];case 1:return n=o.sent(),[2,new Ti(n)]}}))}))},t}(di),Ii=function(){function e(e,t,r,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=n}return e.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw nn.createUnableToLoadTokenError("Please ensure server response includes id token.");if(e.account)this.loadIdToken(t.id_token,e.account.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadAccessToken(e,t,e.account.homeAccountId,e.account.environment,e.account.tenantId,r);else{if(!e.authority)throw nn.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var n=si.generateAuthority(e.authority,e.azureCloudOptions),o={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},i=new si(n,this.config.system.networkClient,this.storage,o);if(r.clientInfo)this.logger.trace("TokenCache - homeAccountId from options"),this.loadIdToken(t.id_token,r.clientInfo,i.hostnameAndPort,i.tenant,r),this.loadAccessToken(e,t,r.clientInfo,i.hostnameAndPort,i.tenant,r);else{if(!t.client_info)throw nn.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response"),this.loadIdToken(t.id_token,t.client_info,i.hostnameAndPort,i.tenant,r),this.loadAccessToken(e,t,t.client_info,i.hostnameAndPort,i.tenant,r)}}},e.prototype.loadIdToken=function(e,t,r,n,o){var i=oo.createIdTokenEntity(t,r,e,this.config.auth.clientId,n),a=new to(e,this.cryptoObj),s=o.clientInfo?kn.createAccount(o.clientInfo,t,a,void 0,void 0,void 0,r):kn.createGenericAccount(t,a,void 0,void 0,void 0,r);if(!this.isBrowserEnvironment)throw nn.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");this.logger.verbose("TokenCache - loading id token"),this.storage.setAccount(s),this.storage.setIdTokenCredential(i)},e.prototype.loadAccessToken=function(e,t,r,n,o,i){if(t.access_token){if(!t.expires_in)throw nn.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw nn.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new eo(e.scopes).printScopes(),s=i.expiresOn||t.expires_in+(new Date).getTime()/1e3,c=i.extendedExpiresOn,u=ao.createAccessTokenEntity(r,n,t.access_token,this.config.auth.clientId,o,a,s,c,this.cryptoObj);if(!this.isBrowserEnvironment)throw nn.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(u)}else this.logger.verbose("TokenCache - No access token provided for caching")},e}(),bi=function(e){function t(t,r){return e.call(this,t,r)||this}return te(t,e),t.prototype.acquireToken=function(e){return ne(this,void 0,void 0,(function(){var t;return oe(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.acquireCachedToken(e)];case 1:return[2,r.sent()];case 2:if((t=r.sent())instanceof dr&&t.errorCode===or.code)return[2,new Ti(this.config,this.performanceClient).acquireTokenByRefreshToken(e)];throw t;case 3:return[2]}}))}))},t.prototype.acquireCachedToken=function(e){var t,r,n,o;return ne(this,void 0,void 0,(function(){var i,a;return oe(this,(function(s){switch(s.label){case 0:if(!e)throw $n.createEmptyTokenRequestError();if(e.forceRefresh)throw null===(t=this.serverTelemetryManager)||void 0===t||t.setCacheOutcome(xe.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),dr.createRefreshRequiredError();if(!e.account)throw dr.createNoAccountInSilentRequestError();if(i=e.authority||this.authority.getPreferredCache(),!(a=this.cacheManager.readCacheRecord(e.account,this.config.authOptions.clientId,e,i)).accessToken)throw null===(r=this.serverTelemetryManager)||void 0===r||r.setCacheOutcome(xe.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),dr.createRefreshRequiredError();if(io.wasClockTurnedBack(a.accessToken.cachedAt)||io.isTokenExpired(a.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null===(n=this.serverTelemetryManager)||void 0===n||n.setCacheOutcome(xe.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),dr.createRefreshRequiredError();if(a.accessToken.refreshOn&&io.isTokenExpired(a.accessToken.refreshOn,0))throw null===(o=this.serverTelemetryManager)||void 0===o||o.setCacheOutcome(xe.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),dr.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(a,e)];case 1:return[2,s.sent()]}}))}))},t.prototype.generateResultFromCacheRecord=function(e,t){return ne(this,void 0,void 0,(function(){var r;return oe(this,(function(n){switch(n.label){case 0:return e.idToken&&(r=new to(e.idToken.secret,this.config.cryptoInterface)),[4,ei.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)];case 1:return[2,n.sent()]}}))}))},t}(Vo),Ai=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.acquireToken=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i;return X(this,(function(a){switch(a.label){case 0:return t=this.performanceClient.startMeasurement(W.SilentCacheClientAcquireToken,e.correlationId),r=this.initializeServerTelemetryManager(Ve.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(r,e.authority,e.azureCloudOptions)];case 1:n=a.sent(),this.logger.verbose("Silent auth client created"),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,n.acquireCachedToken(e)];case 3:return o=a.sent(),t.endMeasurement({success:!0,fromCache:!0}),[2,o];case 4:throw(i=a.sent())instanceof nn&&i.errorCode===Wr.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),t.endMeasurement({errorCode:i instanceof pt&&i.errorCode||void 0,subErrorCode:i instanceof pt&&i.subError||void 0,success:!1}),i;case 5:return[2]}}))}))},t.prototype.logout=function(){return Promise.reject(nn.createSilentLogoutUnsupportedError())},t.prototype.createSilentFlowClient=function(e,t,r){return Q(this,void 0,void 0,(function(){var n;return X(this,(function(o){switch(o.label){case 0:return[4,this.getClientConfiguration(e,t,r)];case 1:return n=o.sent(),[2,new bi(n)]}}))}))},t.prototype.initializeSilentRequest=function(e,t){return Q(this,void 0,void 0,(function(){var r;return X(this,(function(n){switch(n.label){case 0:return r=[J({},e)],[4,this.initializeBaseRequest(e)];case 1:return[2,J.apply(void 0,[J.apply(void 0,r.concat([n.sent()])),{account:t,forceRefresh:e.forceRefresh||!1}])]}}))}))},t}(di),Ri=function(e){function t(t){var r=e.call(this,t)||this;return r.includeRedirectUri=!1,r}return Y(t,e),t}(ti),ki=function(e){function t(t,r,n,o,i,a,s,c,u,l){var d=e.call(this,t,r,n,o,i,a,c,u,l)||this;return d.apiId=s,d}return Y(t,e),t.prototype.acquireToken=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a;return X(this,(function(s){switch(s.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!e.code)throw nn.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(e,Je.Silent)];case 1:t=s.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||de.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(this.apiId),s.label=2;case 2:return s.trys.push([2,4,,5]),n=J(J({},t),{code:e.code}),[4,this.getClientConfiguration(r,t.authority)];case 3:return o=s.sent(),i=new Ri(o),this.logger.verbose("Auth code client created"),[2,new Ci(i,this.browserStorage,n,this.logger,this.config.system.navigateFrameWait).handleCodeResponseFromServer({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t.state,i.authority,this.networkClient,!1)];case 4:throw(a=s.sent())instanceof pt&&a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(t.state),a;case 5:return[2]}}))}))},t.prototype.logout=function(){return Promise.reject(nn.createSilentLogoutUnsupportedError())},t}(di),Ni=function(){function e(e,t){this.correlationId=t,this.measureName="msal.measure."+e+"."+this.correlationId,this.startMark="msal.start."+e+"."+this.correlationId,this.endMark="msal.end."+e+"."+this.correlationId}return e.supportsBrowserPerformance=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName},e.prototype.startMeasurement=function(){if(e.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(t){}},e.prototype.endMeasurement=function(){if(e.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(t){}},e.prototype.flushMeasurement=function(){if(e.supportsBrowserPerformance())try{var t=window.performance.getEntriesByName(this.measureName,"measure");if(t.length>0){var r=t[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),r}}catch(n){}return null},e}(),Pi=function(e){function t(t,r,n,o,i,a){var s=e.call(this,t,r,n,o,i,a)||this;return s.browserCrypto=new cn(s.logger),s.guidGenerator=new _t(s.browserCrypto),s}return Y(t,e),t.prototype.startPerformanceMeasuremeant=function(e,t){return new Ni(e,t)},t.prototype.generateId=function(){return this.guidGenerator.generateGuid()},t.prototype.getPageVisibility=function(){var e;return(null===(e=document.visibilityState)||void 0===e?void 0:e.toString())||null},t.prototype.startMeasurement=function(t,r){var n=this,o=this.getPageVisibility(),i=e.prototype.startMeasurement.call(this,t,r);return J(J({},i),{endMeasurement:function(e){return i.endMeasurement(J({startPageVisibility:o,endPageVisibility:n.getPageVisibility()},e))}})},t}(mn),Oi=function(){function e(e){var t,r,n;this.isBrowserEnvironment="undefined"!=typeof window,this.config=function(e,t){var r=e.auth,n=e.cache,o=e.system,i=e.telemetry,a={clientId:de.EMPTY_STRING,authority:""+de.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:de.EMPTY_STRING,authorityMetadata:de.EMPTY_STRING,redirectUri:de.EMPTY_STRING,postLogoutRedirectUri:de.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:fo.AAD,azureCloudOptions:{azureCloudInstance:go.None,tenant:de.EMPTY_STRING}},s={cacheLocation:Be.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},c={loggerCallback:function(){},logLevel:hn.Info,piiLoggingEnabled:!1},u=J(J({},Ro),{loggerOptions:c,networkClient:t?Lo.getBrowserNetworkClient():xo,navigationClient:new Do,loadFrameTimeout:0,windowHashTimeout:(null==o?void 0:o.loadFrameTimeout)||6e4,iframeHashTimeout:(null==o?void 0:o.loadFrameTimeout)||Fo,navigateFrameWait:t&&Lo.detectIEOrEdge()?500:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(null==o?void 0:o.nativeBrokerHandshakeTimeout)||2e3}),l={application:{appName:de.EMPTY_STRING,appVersion:de.EMPTY_STRING}};return{auth:J(J({},a),r),cache:J(J({},s),n),system:J(J({},u),o),telemetry:J(J({},l),i)}}(e,this.isBrowserEnvironment),this.initialized=!1,this.logger=new gn(this.config.system.loggerOptions,Ko,Go),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new Pi(this.config.auth.clientId,this.config.auth.authority,this.logger,Ko,Go,this.config.telemetry.application):new yn(this.config.auth.clientId,this.config.auth.authority,this.logger,Ko,Go,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new pn(this.logger,this.performanceClient):_n,this.eventHandler=new zo(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new bo(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(t=this.config.auth.clientId,r=this.logger,n={cacheLocation:Be.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1},new bo(t,n,_n,r)),this.tokenCache=new Ii(this.config,this.browserStorage,this.logger,this.browserCrypto)}return e.prototype.initialize=function(){return Q(this,void 0,void 0,(function(){var e,t;return X(this,(function(r){switch(r.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(this.eventHandler.emitEvent(jo.INITIALIZE_START),!this.config.system.allowNativeBroker)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),e=this,[4,mi.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout)];case 2:return e.nativeExtensionProvider=r.sent(),[3,4];case 3:return t=r.sent(),this.logger.verbose(t),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(jo.INITIALIZE_END),[2]}}))}))},e.prototype.handleRedirectPromise=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u=this;return X(this,(function(l){return this.logger.verbose("handleRedirectPromise called"),Lo.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment?(r=e||de.EMPTY_STRING,void 0===(n=this.redirectResponse.get(r))?(this.eventHandler.emitEvent(jo.HANDLE_REDIRECT_START,Je.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),o=this.browserStorage.getCachedNativeRequest(),i=void 0,o&&mi.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),a=new gi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ve.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,o.accountId,o.correlationId),i=a.handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),s=this.browserStorage.getTemporaryCache(Ye.CORRELATION_ID,!0)||de.EMPTY_STRING,c=this.createRedirectClient(s),i=c.handleRedirectPromise(e)),n=i.then((function(e){e&&(t.length0?u.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_FAILURE,Je.Redirect,null,e):u.eventHandler.emitEvent(jo.LOGIN_FAILURE,Je.Redirect,null,e),u.eventHandler.emitEvent(jo.HANDLE_REDIRECT_END,Je.Redirect),e})),this.redirectResponse.set(r,n)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,n]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])}))}))},e.prototype.acquireTokenRedirect=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a=this;return X(this,(function(s){return t=this.getRequestCorrelationId(e),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(Je.Redirect),(r=this.getAllAccounts().length>0)?this.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_START,Je.Redirect,e):this.eventHandler.emitEvent(jo.LOGIN_START,Je.Redirect,e),this.nativeExtensionProvider&&this.canUseNative(e)?(o=new gi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ve.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),e.correlationId),n=o.acquireTokenRedirect(e).catch((function(t){if(t instanceof fi&&t.isFatal())return a.nativeExtensionProvider=void 0,a.createRedirectClient(e.correlationId).acquireToken(e);throw t}))):(i=this.createRedirectClient(e.correlationId),n=i.acquireToken(e)),[2,n.catch((function(e){throw r?a.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_FAILURE,Je.Redirect,null,e):a.eventHandler.emitEvent(jo.LOGIN_FAILURE,Je.Redirect,null,e),e}))]}))}))},e.prototype.acquireTokenPopup=function(e){var t=this,r=this.getRequestCorrelationId(e),n=this.performanceClient.startMeasurement(W.AcquireTokenPopup,r);try{this.logger.verbose("acquireTokenPopup called",r),this.preflightBrowserEnvironmentCheck(Je.Popup)}catch(a){return Promise.reject(a)}var o,i=this.getAllAccounts();(i.length>0?this.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_START,Je.Popup,e):this.eventHandler.emitEvent(jo.LOGIN_START,Je.Popup,e),this.canUseNative(e))?o=this.acquireTokenNative(e,Ve.acquireTokenPopup).then((function(e){return t.browserStorage.setInteractionInProgress(!1),n.endMeasurement({success:!0,isNativeBroker:!0}),n.flushMeasurement(),e})).catch((function(r){if(r instanceof fi&&r.isFatal())return t.nativeExtensionProvider=void 0,t.createPopupClient(e.correlationId).acquireToken(e);throw r})):o=this.createPopupClient(e.correlationId).acquireToken(e);return o.then((function(e){return i.length0?t.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_FAILURE,Je.Popup,null,e):t.eventHandler.emitEvent(jo.LOGIN_FAILURE,Je.Popup,null,e),n.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),n.flushMeasurement(),Promise.reject(e)}))},e.prototype.ssoSilent=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a=this;return X(this,(function(s){return t=this.getRequestCorrelationId(e),r=J(J({},e),{prompt:ge.NONE,correlationId:t}),this.preflightBrowserEnvironmentCheck(Je.Silent),n=this.performanceClient.startMeasurement(W.SsoSilent,t),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(jo.SSO_SILENT_START,Je.Silent,r),this.canUseNative(r)?o=this.acquireTokenNative(r,Ve.ssoSilent).catch((function(e){if(e instanceof fi&&e.isFatal())return a.nativeExtensionProvider=void 0,a.createSilentIframeClient(r.correlationId).acquireToken(r);throw e})):(i=this.createSilentIframeClient(r.correlationId),o=i.acquireToken(r)),[2,o.then((function(e){return a.eventHandler.emitEvent(jo.SSO_SILENT_SUCCESS,Je.Silent,e),n.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker}),n.flushMeasurement(),e})).catch((function(e){throw a.eventHandler.emitEvent(jo.SSO_SILENT_FAILURE,Je.Silent,null,e),n.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),n.flushMeasurement(),e}))]}))}))},e.prototype.acquireTokenByCode=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i=this;return X(this,(function(a){t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(Je.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_BY_CODE_START,Je.Silent,e),r=this.performanceClient.startMeasurement(W.AcquireTokenByCode,e.correlationId);try{if(e.code)return n=e.code,(o=this.hybridAuthCodeResponses.get(n))?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),r.endMeasurement({success:!0}),r.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),o=this.acquireTokenByCodeAsync(J(J({},e),{correlationId:t})).then((function(e){return i.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Je.Silent,e),i.hybridAuthCodeResponses.delete(n),r.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker}),r.flushMeasurement(),e})).catch((function(e){throw i.hybridAuthCodeResponses.delete(n),i.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_BY_CODE_FAILURE,Je.Silent,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e})),this.hybridAuthCodeResponses.set(n,o)),[2,o];if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return[2,this.acquireTokenNative(e,Ve.acquireTokenByCode,e.nativeAccountId).catch((function(e){throw e instanceof fi&&e.isFatal()&&(i.nativeExtensionProvider=void 0),e}))];throw nn.createUnableToAcquireTokenFromNativePlatformError()}throw nn.createAuthCodeOrNativeAccountIdRequiredError()}catch(s){throw this.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_BY_CODE_FAILURE,Je.Silent,null,s),r.endMeasurement({errorCode:s instanceof pt&&s.errorCode||void 0,subErrorCode:s instanceof pt&&s.subError||void 0,success:!1}),s}return[2]}))}))},e.prototype.acquireTokenByCodeAsync=function(e){return Q(this,void 0,void 0,(function(){return X(this,(function(t){switch(t.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),[4,this.createSilentAuthCodeClient(e.correlationId).acquireToken(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.acquireTokenByRefreshToken=function(e){return Q(this,void 0,void 0,(function(){var t,r=this;return X(this,(function(n){return Lo.blockReloadInHiddenIframes(),t=this.performanceClient.startMeasurement(W.AcquireTokenByRefreshToken,e.correlationId),this.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_NETWORK_START,Je.Silent,e),[2,this.createSilentRefreshClient(e.correlationId).acquireToken(e).then((function(e){return t.endMeasurement({success:!0,fromCache:e.fromCache}),e})).catch((function(n){var o=n instanceof En,i=n instanceof In,a=n.errorCode===Xe;if(o&&a&&!i)return r.logger.verbose("Refresh token expired or invalid, attempting acquire token by iframe",e.correlationId),r.createSilentIframeClient(e.correlationId).acquireToken(e).then((function(e){return t.endMeasurement({success:!0,fromCache:e.fromCache}),e})).catch((function(e){throw t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e}));throw t.endMeasurement({success:!1}),n}))]}))}))},e.prototype.logout=function(e){return Q(this,void 0,void 0,(function(){var t;return X(this,(function(r){return t=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(J({correlationId:t},e))]}))}))},e.prototype.logoutRedirect=function(e){return Q(this,void 0,void 0,(function(){var t;return X(this,(function(r){return t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(Je.Redirect),[2,this.createRedirectClient(t).logout(e)]}))}))},e.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(Je.Popup),this.createPopupClient(t).logout(e)}catch(r){return Promise.reject(r)}},e.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},e.prototype.getAccountByUsername=function(e){var t=this.getAllAccounts();return!hr.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+e),t.filter((function(t){return t.username.toLowerCase()===e.toLowerCase()}))[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},e.prototype.getAccountByHomeId=function(e){var t=this.getAllAccounts();return!hr.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+e),t.filter((function(t){return t.homeAccountId===e}))[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},e.prototype.getAccountByLocalId=function(e){var t=this.getAllAccounts();return!hr.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+e),t.filter((function(t){return t.localAccountId===e}))[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},e.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},e.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},e.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(void 0===t&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),Lo.blockNonBrowserEnvironment(this.isBrowserEnvironment),Lo.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),Lo.blockReloadInHiddenIframes(),Lo.blockAcquireTokenInPopups(),Lo.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===Je.Redirect&&this.config.cache.cacheLocation===Be.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw wo.createInMemoryRedirectUnavailableError();e!==Je.Redirect&&e!==Je.Popup||this.preflightInteractiveRequest(t)},e.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),Lo.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},e.prototype.acquireTokenNative=function(e,t,r){return Q(this,void 0,void 0,(function(){return X(this,(function(n){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw nn.createNativeConnectionNotEstablishedError();return[2,new gi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),e.correlationId).acquireToken(e)]}))}))},e.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!mi.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case ge.NONE:case ge.CONSENT:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)},e.prototype.getNativeAccountId=function(e){var t=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return t&&t.nativeAccountId||""},e.prototype.createPopupClient=function(e){return new yi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.createRedirectClient=function(e){return new Ei(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.createSilentIframeClient=function(e){return new wi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ve.ssoSilent,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.createSilentCacheClient=function(e){return new Ai(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.createSilentRefreshClient=function(e){return new Si(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.createSilentAuthCodeClient=function(e){return new ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ve.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},e.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},e.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},e.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},e.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},e.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},e.prototype.getTokenCache=function(){return this.tokenCache},e.prototype.getLogger=function(){return this.logger},e.prototype.setLogger=function(e){this.logger=e},e.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},e.prototype.setNavigationClient=function(e){this.navigationClient=e},e.prototype.getConfiguration=function(){return this.config},e.prototype.getRequestCorrelationId=function(e){return(null==e?void 0:e.correlationId)?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():de.EMPTY_STRING},e}(),Mi=function(e){function t(t){var r=e.call(this,t)||this;return r.activeSilentTokenRequests=new Map,r}return Y(t,e),t.prototype.loginRedirect=function(e){return Q(this,void 0,void 0,(function(){var t;return X(this,(function(r){return t=this.getRequestCorrelationId(e),this.logger.verbose("loginRedirect called",t),[2,this.acquireTokenRedirect(J({correlationId:t},e||st))]}))}))},t.prototype.loginPopup=function(e){var t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup(J({correlationId:t},e||st))},t.prototype.acquireTokenSilent=function(e){return Q(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c=this;return X(this,(function(u){if(t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(W.AcquireTokenSilent,t),this.preflightBrowserEnvironmentCheck(Je.Silent),this.logger.verbose("acquireTokenSilent called",t),!(n=e.account||this.getActiveAccount()))throw nn.createNoAccountError();return o={clientId:this.config.auth.clientId,authority:e.authority||de.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:n.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},i=JSON.stringify(o),void 0===(a=this.activeSilentTokenRequests.get(i))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t),s=this.acquireTokenSilentAsync(J(J({},e),{correlationId:t}),n).then((function(e){return c.activeSilentTokenRequests.delete(i),r.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker}),r.flushMeasurement(),e})).catch((function(e){throw c.activeSilentTokenRequests.delete(i),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e})),this.activeSilentTokenRequests.set(i,s),[2,s]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.endMeasurement({success:!0}),r.discardMeasurement(),[2,a])}))}))},t.prototype.acquireTokenSilentAsync=function(e,t){return Q(this,void 0,void 0,(function(){var r,n,o,i,a,s=this;return X(this,(function(c){switch(c.label){case 0:return this.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_START,Je.Silent,e),r=this.performanceClient.startMeasurement(W.AcquireTokenSilentAsync,e.correlationId),mi.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&t.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),o=J(J({},e),{account:t}),n=this.acquireTokenNative(o,Ve.acquireTokenSilent_silentFlow).catch((function(t){return Q(s,void 0,void 0,(function(){return X(this,(function(r){if(t instanceof fi&&t.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(e.correlationId).acquireToken(e)];throw t}))}))})),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),[4,(i=this.createSilentCacheClient(e.correlationId)).initializeSilentRequest(e,t)];case 2:a=c.sent(),n=i.acquireToken(a).catch((function(){return Q(s,void 0,void 0,(function(){return X(this,(function(e){return[2,this.acquireTokenByRefreshToken(a)]}))}))})),c.label=3;case 3:return[2,n.then((function(e){return s.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_SUCCESS,Je.Silent,e),r.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker}),e})).catch((function(e){throw s.eventHandler.emitEvent(jo.ACQUIRE_TOKEN_FAILURE,Je.Silent,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e}))]}}))}))},t}(Oi),Ui=(r(15671),r(43144),r(97326),r(60136),r(6215),r(61120),r(70885)),xi=r(4942),qi=r(42982),Hi=(r(87757),r(67294)),Li={initialize:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},acquireTokenPopup:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},acquireTokenRedirect:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},acquireTokenSilent:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},acquireTokenByCode:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},getAllAccounts:function(){return[]},getAccountByHomeId:function(){return null},getAccountByUsername:function(){return null},getAccountByLocalId:function(){return null},handleRedirectPromise:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},loginPopup:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},loginRedirect:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},logout:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},logoutRedirect:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},logoutPopup:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},ssoSilent:function(){return Promise.reject(wo.createStubPcaInstanceCalledError())},addEventCallback:function(){return null},removeEventCallback:function(){},addPerformanceCallback:function(){return""},removePerformanceCallback:function(){return!1},enableAccountStorageEvents:function(){},disableAccountStorageEvents:function(){},getTokenCache:function(){throw wo.createStubPcaInstanceCalledError()},getLogger:function(){throw wo.createStubPcaInstanceCalledError()},setLogger:function(){},setActiveAccount:function(){},getActiveAccount:function(){return null},initializeWrapperLibrary:function(){},setNavigationClient:function(){},getConfiguration:function(){throw wo.createStubPcaInstanceCalledError()}},Di=function(){function e(){}return e.getInteractionStatusFromEvent=function(e,t){switch(e.eventType){case jo.LOGIN_START:return Qe.Login;case jo.SSO_SILENT_START:return Qe.SsoSilent;case jo.ACQUIRE_TOKEN_START:if(e.interactionType===Je.Redirect||e.interactionType===Je.Popup)return Qe.AcquireToken;break;case jo.HANDLE_REDIRECT_START:return Qe.HandleRedirect;case jo.LOGOUT_START:return Qe.Logout;case jo.SSO_SILENT_SUCCESS:case jo.SSO_SILENT_FAILURE:if(t&&t!==Qe.SsoSilent)break;return Qe.None;case jo.LOGOUT_END:if(t&&t!==Qe.Logout)break;return Qe.None;case jo.HANDLE_REDIRECT_END:if(t&&t!==Qe.HandleRedirect)break;return Qe.None;case jo.LOGIN_SUCCESS:case jo.LOGIN_FAILURE:case jo.ACQUIRE_TOKEN_SUCCESS:case jo.ACQUIRE_TOKEN_FAILURE:if(e.interactionType===Je.Redirect||e.interactionType===Je.Popup){if(t&&t!==Qe.Login&&t!==Qe.AcquireToken)break;return Qe.None}}return null},e}();function Fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ji(e){for(var t=1;t0&&(t.homeAccountId||t.localAccountId||t.username)&&e.filter((function(e){return(!t.username||t.username.toLowerCase()===e.username.toLowerCase())&&((!t.homeAccountId||t.homeAccountId.toLowerCase()===e.homeAccountId.toLowerCase())&&(!t.localAccountId||t.localAccountId.toLowerCase()===e.localAccountId.toLowerCase()))}))[0]||null}var Wi,Vi="1.4.2";!function(e){e.UNBLOCK_INPROGRESS="UNBLOCK_INPROGRESS",e.EVENT="EVENT"}(Wi||(Wi={}));var Ji=function(e,t){var r=t.type,n=t.payload,o=e.inProgress;switch(r){case Wi.UNBLOCK_INPROGRESS:e.inProgress===Qe.Startup&&(o=Qe.None,n.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case Wi.EVENT:var i=n.message,a=Di.getInteractionStatusFromEvent(i,e.inProgress);a&&(n.logger.info("MsalProvider - ".concat(i.eventType," results in setting inProgress from ").concat(e.inProgress," to ").concat(a)),o=a);break;default:throw new Error("Unknown action type: ".concat(r))}var s=n.instance.getAllAccounts();return o===e.inProgress||zi(s,e.accounts)?o!==e.inProgress?ji(ji({},e),{},{inProgress:o}):zi(s,e.accounts)?e:ji(ji({},e),{},{accounts:s}):ji(ji({},e),{},{inProgress:o,accounts:s})};function Qi(e){var t=e.instance,r=e.children;(0,Hi.useEffect)((function(){t.initializeWrapperLibrary(at.React,Vi)}),[t]);var n=(0,Hi.useMemo)((function(){return t.getLogger().clone("@azure/msal-react",Vi)}),[t]),o=(0,Hi.useReducer)(Ji,void 0,(function(){return{inProgress:Qe.Startup,accounts:t.getAllAccounts()}})),i=(0,Ui.Z)(o,2),a=i[0],s=i[1];(0,Hi.useEffect)((function(){var e=t.addEventCallback((function(e){s({payload:{instance:t,logger:n,message:e},type:Wi.EVENT})}));return n.verbose("MsalProvider - Registered event callback with id: ".concat(e)),t.initialize().then((function(){t.handleRedirectPromise().catch((function(){})).finally((function(){s({payload:{instance:t,logger:n},type:Wi.UNBLOCK_INPROGRESS})}))})),function(){e&&(n.verbose("MsalProvider - Removing event callback ".concat(e)),t.removeEventCallback(e))}}),[t,n]);var c={instance:t,inProgress:a.inProgress,accounts:a.accounts,logger:n};return Hi.createElement(Gi.Provider,{value:c},r)}var Xi=function(){return(0,Hi.useContext)(Gi)};function Zi(e,t){return t&&(t.username||t.homeAccountId||t.localAccountId)?!!Yi(e,t):e.length>0}function $i(e){var t=Xi().accounts,r=(0,Hi.useState)((function(){return Zi(t,e)})),n=(0,Ui.Z)(r,2),o=n[0],i=n[1];return(0,Hi.useEffect)((function(){i(Zi(t,e))}),[t,e]),o}function ea(e){var t=e.username,r=e.homeAccountId,n=e.localAccountId,o=e.children,i=Xi();return $i((0,Hi.useMemo)((function(){return{username:t,homeAccountId:r,localAccountId:n}}),[t,r,n]))&&i.inProgress!==Qe.Startup?Hi.createElement(Hi.Fragment,null,Bi(o,i)):null}function ta(e){var t=e.username,r=e.homeAccountId,n=e.localAccountId,o=e.children,i=Xi();return $i((0,Hi.useMemo)((function(){return{username:t,homeAccountId:r,localAccountId:n}}),[t,r,n]))||i.inProgress===Qe.Startup||i.inProgress===Qe.HandleRedirect?null:Hi.createElement(Hi.Fragment,null,Bi(o,i))}var ra={auth:{clientId:"882582c7-4b63-4bc0-8b36-93f6fb378b6d",authority:"https://login.microsoftonline.com/3b3e5142-8105-4c9a-9ebf-b51c7b875b71",redirectUri:"/azure-marketplace-landing",postLogoutRedirectUri:"/azure-marketplace-landing"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:function(e,t,r){if(!r)switch(e){case hn.Error:return void console.error(t);case hn.Info:return void console.info(t);case hn.Verbose:return void console.debug(t);case hn.Warning:return void console.warn(t)}}}}},na={scopes:["User.Read"]},oa=r(85893),ia=new Mi(ra),aa=function(e){var t=e.children;return(0,oa.jsx)(Qi,{instance:ia,children:t})},sa=function(){var e=Xi().instance;return(0,oa.jsxs)("div",{children:[(0,oa.jsx)(ea,{children:(0,oa.jsx)(R.r,{onClick:function(){return e.logoutRedirect()},iconPosition:"right",children:"Sign out Azure"})}),(0,oa.jsx)(ta,{children:(0,oa.jsx)(R.r,{onClick:function(){return e.loginRedirect(na).catch(console.log)},iconPosition:"right",children:"Sign in Azure"})})]})};function ca(){var e,t,r,z=(e=(0,Hi.useState)(""),t=e[0],r=e[1],(0,Hi.useEffect)((function(){var e=window.location.hash;e.startsWith("#from_azure_marketplace?token=")&&r(encodeURIComponent(e.replace("#from_azure_marketplace?token=","#azureToken=")))}),[]),t);return(0,oa.jsxs)(aa,{children:[(0,oa.jsx)(E.q,{}),(0,oa.jsx)(i.n,{}),(0,oa.jsxs)(a.i,{children:[(0,oa.jsx)(_.h,{urlSignUp:(0,n.N)(void 0,void 0,z)}),(0,oa.jsx)(u.p,{title:"E-commerce",text:"Jumpstart your AI solutions with high-quality data and ultra fast results.",buttons:[{view:"action",text:"Start now",url:(0,n.N)(void 0,void 0,z),size:"l",type:"link"},{view:"pseudo",text:"Talk to us",url:"/talk-to-us",size:"l",type:"link"}]}),(0,oa.jsx)(T.w,{offset:40}),(0,oa.jsx)(A.L,{header:{title:"Intelligent data labeling solutions for every use case",info:(0,oa.jsx)("p",{children:"Stay ahead of the AI curve with high-performance data to grow your business."})},className:"dark",children:(0,oa.jsx)(l.W,{cards:[{title:"Recommendation engines",text:"Verify and enhance automated recommendations of related products on your website",link:(0,n.N)(void 0,{retPath:"/requester/demo-creating/demoSideBySide"},z),image:"https://tlk-infra-front.azureedge.net/portal-static/images/ecommerce/business-cases/recommendation-systems/",readMore:"View live demo"},{title:"Search relevance",text:"Evaluate relevance of search results to fine-tune your product search",link:(0,n.N)(void 0,{retPath:"/requester/demo-creating/demoImageClassification"},z),image:"https://tlk-infra-front.azureedge.net/portal-static/images/ecommerce/business-cases/search-relevance/",readMore:"View live demo"},{title:"Online product catalog ",text:"Match products to categories to improve filters and navigation on your site",link:(0,n.N)(void 0,{retPath:"/requester/demo-creating/demoTextClassification"},z),image:"https://tlk-infra-front.azureedge.net/portal-static/images/ecommerce/business-cases/online-product-catalog/",readMore:"View live demo"},{title:"Price optimization ",text:"Collect competitor prices to support your dynamic pricing strategy",image:"https://tlk-infra-front.azureedge.net/portal-static/images/ecommerce/business-cases/price-optimization/",link:"/talk-to-us",readMore:"Talk to us"},{title:"Monitoring support quality",text:"Categorize support requests and responses to improve customer service",image:"https://tlk-infra-front.azureedge.net/portal-static/images/ecommerce/business-cases/customer-support/",link:"/talk-to-us",readMore:"Talk to us"},{title:"Design and marketing",text:"Test designs on users and get insights to improve your website and marketing strategies",link:(0,n.N)(void 0,{retPath:"/requester/demo-creating/demoSurvey"},z),image:"https://tlk-infra-front.azureedge.net/portal-static/images/ecommerce/business-cases/design-and-marketing/",readMore:"View live demo"}]})}),(0,oa.jsx)(A.L,{header:{title:"Success stories",info:(0,oa.jsx)("p",{children:"10+ years of industry experience solving real-world problems."})},children:(0,oa.jsx)(d.R,{list:[{icon:(0,oa.jsx)(p.n,{}),text:"Improved crowdsourced translations of product descriptions.",resultNumber:"17%",resultText:"budget reduction while achieving optimal quality.",link:"/success-stories/aliexpress",readMore:"Read the story"},{icon:(0,oa.jsx)(f.L,{}),text:(0,oa.jsxs)(oa.Fragment,{children:["Improved the accuracy",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"of a predictive tool using local shopping patterns."]}),resultNumber:"30%",resultText:"improvement in app accuracy after data collection, reaching 95%.",link:"/success-stories/bestplace",readMore:"Read the story"},{icon:(0,oa.jsx)(g.D,{}),text:(0,oa.jsxs)(oa.Fragment,{children:["Enhanced performance ",(0,oa.jsx)("br",{})," of a recommendation engine."]}),resultNumber:"6x",resultText:(0,oa.jsxs)(oa.Fragment,{children:["reduction of errors in the ",(0,oa.jsx)("br",{})," product recommender model."]}),link:"/success-stories/market-recommender-system",readMore:"Read the story"},{icon:(0,oa.jsx)(m.X,{}),text:(0,oa.jsxs)(oa.Fragment,{children:["Tuned a 3D foot sizing ",(0,oa.jsx)("br",{})," app for better accuracy."]}),resultNumber:"12%",resultText:"improvement in app accuracy with accelerated time to market.",link:"/success-stories/neatsy",readMore:"Read the story"}]})}),(0,oa.jsx)(b.l,{imagePosition:"left",title:"Support for multilingual projects",text:"On-demand access to global crowd coverage across every time zone for fast scaling in multiple languages.",info:{link:{href:"/global-crowd",text:"Learn more"},content:[{text:"100+ Countries",icon:(0,oa.jsx)(v.w,{})},{text:"40+ Languages",icon:(0,oa.jsx)(y.Q,{})}]},image:"https://tlk-infra-front.azureedge.net/portal-static/images/ecommerce/callToAction/"}),(0,oa.jsx)(S.N,{}),(0,oa.jsx)(T.w,{offset:40}),(0,oa.jsx)(A.L,{header:{title:"Why Toloka"},theme:"darkBlueGradient",children:(0,oa.jsx)(o.A,{list:[{icon:(0,oa.jsx)(P.V,{}),title:"State-of-the-art technologies",text:"Crowd management tools and quality control options backed by 10 years of industry experience and research",additional:(0,oa.jsxs)(oa.Fragment,{children:[(0,oa.jsx)(T.w,{offset:24}),(0,oa.jsx)(B.C,{inLine:!0,isSmallIcon:!0,maxItemsInRow:1,list:[{icon:(0,oa.jsx)(O.D,{}),additional:"Multiple quality control methods"},{icon:(0,oa.jsx)(M.s,{}),additional:"Adaptive crowd selection"},{icon:(0,oa.jsx)(U.k,{}),additional:"Smart matching mechanisms"}]}),(0,oa.jsx)(T.w,{offset:24}),(0,oa.jsx)(R.r,{href:"/technologies/",iconPosition:"right",children:"Learn more"})]})},{icon:(0,oa.jsx)(N.G,{}),title:"Global crowd",text:"Millions of Tolokers across every time zone for on-demand labeling, instant scaling, and multilingual projects",additional:(0,oa.jsxs)(oa.Fragment,{children:[(0,oa.jsx)(T.w,{offset:24}),(0,oa.jsx)(B.C,{inLine:!0,isSmallIcon:!0,maxItemsInRow:1,list:[{icon:(0,oa.jsx)(x.n,{}),additional:"40+ languages, 100+ countries"},{icon:(0,oa.jsx)(q.O,{}),additional:"200k+ monthly active Tolokers"},{icon:(0,oa.jsx)(H.f,{}),additional:"800+ daily active projects"}]}),(0,oa.jsx)(T.w,{offset:24}),(0,oa.jsx)(R.r,{href:"/global-crowd/",iconPosition:"right",children:"Learn more"})]})},{icon:(0,oa.jsx)(k.B,{}),title:"Robust infrastructure",text:(0,oa.jsxs)(oa.Fragment,{children:["Fault-tolerant high-load system for rapid"," ",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"knowledge enrichment that prioritizes"," ",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"data security and privacy"]}),additional:(0,oa.jsxs)(oa.Fragment,{children:[(0,oa.jsx)(T.w,{offset:24}),(0,oa.jsx)(B.C,{inLine:!0,isSmallIcon:!0,maxItemsInRow:1,list:[{icon:(0,oa.jsx)(L.c,{}),additional:"High throughput – 499M+ tasks per month"},{icon:(0,oa.jsx)(D.b,{}),additional:"GDPR-compliant, ISO 27001-certified"},{icon:(0,oa.jsx)(F.$,{}),additional:"Secure data storage options"}]}),(0,oa.jsx)(T.w,{offset:24}),(0,oa.jsx)(R.r,{href:"/security/",iconPosition:"right",children:"Learn more"})]})}],maxItemsInRow:3})}),(0,oa.jsx)(T.w,{offset:40}),(0,oa.jsx)(A.L,{header:{title:"For developers"},children:(0,oa.jsx)(o.A,{inLine:!0,list:[{icon:(0,oa.jsx)(K.F,{color:"rgba(0, 85, 217, 1)"}),title:"API",text:(0,oa.jsxs)(oa.Fragment,{children:["Our open API gives you the freedom"," ",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"to integrate directly into any pipelines"]}),link:{href:"/docs/api/concepts/about.html",text:"Learn more",iconPosition:"right"}},{icon:(0,oa.jsx)(j.O,{}),title:"Python SDK",text:(0,oa.jsxs)(oa.Fragment,{children:["Our Python toolkit covers all API"," ",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"functionality to give you the full"," ",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"power of Toloka"]}),link:{href:"https://github.com/Toloka/toloka-kit",text:"Learn more",iconPosition:"right",target:"_blank"}},{icon:(0,oa.jsx)(G.d,{}),title:"Java SDK",text:(0,oa.jsxs)(oa.Fragment,{children:["Our Java client library provides a lightweight"," ",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"interface to the Toloka API that works"," ",(0,oa.jsx)(I.p.Desktop,{children:(0,oa.jsx)("br",{})}),"in any Java enviroment"]}),link:{href:"https://github.com/Toloka/toloka-java-sdk",text:"Learn more",iconPosition:"right",target:"_blank"}}],maxItemsInRow:3})}),(0,oa.jsx)(T.w,{offset:40}),(0,oa.jsx)(s.F,{leftColumn:{title:{text:(0,oa.jsxs)(oa.Fragment,{children:["Accelerate your"," ",(0,oa.jsx)(I.p.Mobile,{children:(0,oa.jsx)("br",{})})," ","e-commerce AI"]})},text:"Let's talk about the ideal solution for your data needs.",links:[{view:"action",text:"Start now",size:"l",type:"link",url:(0,n.N)(void 0,void 0,z)},{view:"pseudo",text:"Talk to us",size:"l",type:"link",url:"/talk-to-us"}]}}),(0,oa.jsx)(A.L,{children:(0,oa.jsx)(sa,{})}),(0,oa.jsx)(T.w,{offset:40}),(0,oa.jsx)(C.$,{}),(0,oa.jsx)(w.f,{}),(0,oa.jsx)(c.j,{button:{icon:(0,oa.jsx)(h.o,{}),text:"Watch webinar",link:"/events/watch/ecom"},text:(0,oa.jsxs)(oa.Fragment,{children:["Data-Centric AI in Search Relevance and"," ",(0,oa.jsx)(I.p.MinTablet,{children:(0,oa.jsx)("br",{})}),"Recommendation Systems for E-commerce"]})})]})]})}},35666:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(P){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),a=new R(n||[]);return i._invoke=function(e,t,r){var n=d;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===f){if("throw"===o)throw i;return N()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=I(a,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=l(e,t,r);if("normal"===c.type){if(n=r.done?f:h,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=f,r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(P){return{type:"throw",arg:P}}}e.wrap=u;var d="suspendedStart",h="suspendedYield",p="executing",f="completed",g={};function m(){}function v(){}function y(){}var _={};c(_,i,(function(){return this}));var E=Object.getPrototypeOf,C=E&&E(E(k([])));C&&C!==r&&n.call(C,i)&&(_=C);var w=y.prototype=m.prototype=Object.create(_);function T(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return g;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function k(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},97326:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},15671:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{Z:function(){return n}})},43144:function(e,t,r){"use strict";function n(e,t){for(var r=0;r