@equinor/fusion-framework-cli 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.11](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@2.0.10...@equinor/fusion-framework-cli@2.0.11) (2023-01-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @equinor/fusion-framework-cli
|
|
9
|
+
|
|
6
10
|
## 2.0.10 (2023-01-19)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @equinor/fusion-framework-cli
|
|
@@ -8,7 +8,7 @@ Error generating stack: `+o.message+`
|
|
|
8
8
|
`+o.stack}return{value:t,source:e,stack:i,digest:null}}function ph(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Vu(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var i7=typeof WeakMap=="function"?WeakMap:Map;function X5(t,e,r){r=Kn(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){zd||(zd=!0,Yu=n),Vu(t,e)},r}function J5(t,e,r){r=Kn(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){Vu(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){Vu(t,e),typeof n!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),r}function kp(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new i7;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=y7.bind(null,t,e,r),e.then(t,t))}function Ap(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Tp(t,e,r,n,i){return(t.mode&1)===0?(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Kn(-1,1),e.tag=2,ki(r,e,1))),r.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}var o7=ni.ReactCurrentOwner,vr=!1;function Jt(t,e,r,n){e.child=t===null?I5(e,null,r,n):Aa(e,t.child,r,n)}function Ip(t,e,r,n,i){r=r.render;var o=e.ref;return _a(e,i),n=If(t,e,r,n,o,i),r=Mf(),t!==null&&!vr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ti(t,e,i)):(Be&&r&&yf(e),e.flags|=1,Jt(t,e,n,i),e.child)}function Mp(t,e,r,n,i){if(t===null){var o=r.type;return typeof o=="function"&&!Uf(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=o,Z5(t,e,o,n,i)):(t=Fl(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,(t.lanes&i)===0){var a=o.memoizedProps;if(r=r.compare,r=r!==null?r:tc,r(a,n)&&t.ref===e.ref)return ti(t,e,i)}return e.flags|=1,t=Ii(o,n),t.ref=e.ref,t.return=e,e.child=t}function Z5(t,e,r,n,i){if(t!==null){var o=t.memoizedProps;if(tc(o,n)&&t.ref===e.ref)if(vr=!1,e.pendingProps=n=o,(t.lanes&i)!==0)(t.flags&131072)!==0&&(vr=!0);else return e.lanes=t.lanes,ti(t,e,i)}return Fu(t,e,r,n,i)}function eg(t,e,r){var n=e.pendingProps,i=n.children,o=t!==null?t.memoizedState:null;if(n.mode==="hidden")if((e.mode&1)===0)e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(aa,Cr),Cr|=r;else{if((r&1073741824)===0)return t=o!==null?o.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Le(aa,Cr),Cr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,Le(aa,Cr),Cr|=n}else o!==null?(n=o.baseLanes|r,e.memoizedState=null):n=r,Le(aa,Cr),Cr|=n;return Jt(t,e,i,r),e.child}function tg(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function Fu(t,e,r,n,i){var o=yr(r)?bo:Gt.current;return o=Sa(e,o),_a(e,i),r=If(t,e,r,n,o,i),n=Mf(),t!==null&&!vr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ti(t,e,i)):(Be&&n&&yf(e),e.flags|=1,Jt(t,e,r,i),e.child)}function Pp(t,e,r,n,i){if(yr(r)){var o=!0;md(e)}else o=!1;if(_a(e,i),e.stateNode===null)Dl(t,e),A5(e,r,n),Nu(e,r,n,i),n=!0;else if(t===null){var a=e.stateNode,s=e.memoizedProps;a.props=s;var c=a.context,l=r.contextType;typeof l=="object"&&l!==null?l=qr(l):(l=yr(r)?bo:Gt.current,l=Sa(e,l));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==n||c!==l)&&Ep(e,a,n,l),mi=!1;var u=e.memoizedState;a.state=u,bd(e,n,a,i),c=e.memoizedState,s!==n||u!==c||gr.current||mi?(typeof d=="function"&&(Du(e,r,d,n),c=e.memoizedState),(s=mi||xp(e,r,s,n,u,c,l))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),a.props=n,a.state=c,a.context=l,n=s):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{a=e.stateNode,S5(t,e),s=e.memoizedProps,l=e.type===e.elementType?s:Zr(e.type,s),a.props=l,h=e.pendingProps,u=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=qr(c):(c=yr(r)?bo:Gt.current,c=Sa(e,c));var f=r.getDerivedStateFromProps;(d=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==h||u!==c)&&Ep(e,a,n,c),mi=!1,u=e.memoizedState,a.state=u,bd(e,n,a,i);var v=e.memoizedState;s!==h||u!==v||gr.current||mi?(typeof f=="function"&&(Du(e,r,f,n),v=e.memoizedState),(l=mi||xp(e,r,l,n,u,v,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,v,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,v,c)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&u===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&u===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=v),a.props=n,a.state=v,a.context=c,n=l):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&u===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&u===t.memoizedState||(e.flags|=1024),n=!1)}return Uu(t,e,r,n,o,i)}function Uu(t,e,r,n,i,o){tg(t,e);var a=(e.flags&128)!==0;if(!n&&!a)return i&&gp(e,r,!1),ti(t,e,o);n=e.stateNode,o7.current=e;var s=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&a?(e.child=Aa(e,t.child,null,o),e.child=Aa(e,null,s,o)):Jt(t,e,s,o),e.memoizedState=n.state,i&&gp(e,r,!0),e.child}function rg(t){var e=t.stateNode;e.pendingContext?vp(t,e.pendingContext,e.pendingContext!==e.context):e.context&&vp(t,e.context,!1),Sf(t,e.containerInfo)}function Rp(t,e,r,n,i){return ka(),bf(i),e.flags|=256,Jt(t,e,r,n),e.child}var $u={dehydrated:null,treeContext:null,retryLane:0};function ju(t){return{baseLanes:t,cachePool:null,transitions:null}}function ng(t,e,r){var n=e.pendingProps,i=qe.current,o=!1,a=(e.flags&128)!==0,s;if((s=a)||(s=t!==null&&t.memoizedState===null?!1:(i&2)!==0),s?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Le(qe,i&1),t===null)return Lu(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((e.mode&1)===0?e.lanes=1:t.data==="$!"?e.lanes=8:e.lanes=1073741824,null):(a=n.children,t=n.fallback,o?(n=e.mode,o=e.child,a={mode:"hidden",children:a},(n&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=a):o=g1(a,n,0,null),t=fo(t,n,r,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=ju(r),e.memoizedState=$u,t):Hf(e,a));if(i=t.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return a7(t,e,a,n,s,i,r);if(o){o=n.fallback,a=e.mode,i=t.child,s=i.sibling;var c={mode:"hidden",children:n.children};return(a&1)===0&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=Ii(i,c),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=Ii(s,o):(o=fo(o,a,r,null),o.flags|=2),o.return=e,n.return=e,n.sibling=o,e.child=n,n=o,o=e.child,a=t.child.memoizedState,a=a===null?ju(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=t.childLanes&~r,e.memoizedState=$u,n}return o=t.child,t=o.sibling,n=Ii(o,{mode:"visible",children:n.children}),(e.mode&1)===0&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function Hf(t,e){return e=g1({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function cl(t,e,r,n){return n!==null&&bf(n),Aa(e,t.child,null,r),t=Hf(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function a7(t,e,r,n,i,o,a){if(r)return e.flags&256?(e.flags&=-257,n=ph(Error(M(422))),cl(t,e,a,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=n.fallback,i=e.mode,n=g1({mode:"visible",children:n.children},i,0,null),o=fo(o,i,a,null),o.flags|=2,n.return=e,o.return=e,n.sibling=o,e.child=n,(e.mode&1)!==0&&Aa(e,t.child,null,a),e.child.memoizedState=ju(a),e.memoizedState=$u,o);if((e.mode&1)===0)return cl(t,e,a,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,o=Error(M(419)),n=ph(o,n,void 0),cl(t,e,a,n)}if(s=(a&t.childLanes)!==0,vr||s){if(n=_t,n!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(n.suspendedLanes|a))!==0?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,ei(t,i),cn(n,t,i,-1))}return Ff(),n=ph(Error(M(421))),cl(t,e,a,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=_7.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Sr=Si(i.nextSibling),Ar=e,Be=!0,tn=null,t!==null&&(Dr[Nr++]=$n,Dr[Nr++]=jn,Dr[Nr++]=wo,$n=t.id,jn=t.overflow,wo=e),e=Hf(e,n.children),e.flags|=4096,e)}function Hp(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Ou(t.return,e,r)}function mh(t,e,r,n,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i)}function ig(t,e,r){var n=e.pendingProps,i=n.revealOrder,o=n.tail;if(Jt(t,e,n.children,r),n=qe.current,(n&2)!==0)n=n&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Hp(t,r,e);else if(t.tag===19)Hp(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(Le(qe,n),(e.mode&1)===0)e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&wd(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),mh(e,!1,i,r,o);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&wd(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}mh(e,!0,r,null,o);break;case"together":mh(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Dl(t,e){(e.mode&1)===0&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ti(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Eo|=e.lanes,(r&e.childLanes)===0)return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,r=Ii(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Ii(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function s7(t,e,r){switch(e.tag){case 3:rg(e),ka();break;case 5:M5(e);break;case 1:yr(e.type)&&md(e);break;case 4:Sf(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;Le(yd,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Le(qe,qe.current&1),e.flags|=128,null):(r&e.child.childLanes)!==0?ng(t,e,r):(Le(qe,qe.current&1),t=ti(t,e,r),t!==null?t.sibling:null);Le(qe,qe.current&1);break;case 19:if(n=(r&e.childLanes)!==0,(t.flags&128)!==0){if(n)return ig(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Le(qe,qe.current),n)break;return null;case 22:case 23:return e.lanes=0,eg(t,e,r)}return ti(t,e,r)}var og,Bu,ag,sg;og=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Bu=function(){};ag=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,co(zn.current);var o=null;switch(r){case"input":i=uu(t,i),n=uu(t,n),o=[];break;case"select":i=We({},i,{value:void 0}),n=We({},n,{value:void 0}),o=[];break;case"textarea":i=mu(t,i),n=mu(t,n),o=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=fd)}gu(r,n);var a;r=null;for(l in i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var s=i[l];for(a in s)s.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Ws.hasOwnProperty(l)?o||(o=[]):(o=o||[]).push(l,null));for(l in n){var c=n[l];if(s=i!=null?i[l]:void 0,n.hasOwnProperty(l)&&c!==s&&(c!=null||s!=null))if(l==="style")if(s){for(a in s)!s.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&s[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(o||(o=[]),o.push(l,r)),r=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,s=s?s.__html:void 0,c!=null&&s!==c&&(o=o||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(Ws.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&Ne("scroll",t),o||s===c||(o=[])):(o=o||[]).push(l,c))}r&&(o=o||[]).push("style",r);var l=o;(e.updateQueue=l)&&(e.flags|=4)}};sg=function(t,e,r,n){r!==n&&(e.flags|=4)};function ts(t,e){if(!Be)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Dt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function c7(t,e,r){var n=e.pendingProps;switch(_f(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(e),null;case 1:return yr(e.type)&&pd(),Dt(e),null;case 3:return n=e.stateNode,Ta(),Ue(gr),Ue(Gt),Af(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(al(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,tn!==null&&(Ju(tn),tn=null))),Bu(t,e),Dt(e),null;case 5:kf(e);var i=co(ac.current);if(r=e.type,t!==null&&e.stateNode!=null)ag(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(M(166));return Dt(e),null}if(t=co(zn.current),al(e)){n=e.stateNode,r=e.type;var o=e.memoizedProps;switch(n[bn]=e,n[ic]=o,t=(e.mode&1)!==0,r){case"dialog":Ne("cancel",n),Ne("close",n);break;case"iframe":case"object":case"embed":Ne("load",n);break;case"video":case"audio":for(i=0;i<us.length;i++)Ne(us[i],n);break;case"source":Ne("error",n);break;case"img":case"image":case"link":Ne("error",n),Ne("load",n);break;case"details":Ne("toggle",n);break;case"input":j0(n,o),Ne("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},Ne("invalid",n);break;case"textarea":q0(n,o),Ne("invalid",n)}gu(r,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?n.textContent!==s&&(o.suppressHydrationWarning!==!0&&ol(n.textContent,s,t),i=["children",s]):typeof s=="number"&&n.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&ol(n.textContent,s,t),i=["children",""+s]):Ws.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&Ne("scroll",n)}switch(r){case"input":Xc(n),B0(n,o,!0);break;case"textarea":Xc(n),G0(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=fd)}n=i,e.updateQueue=n,n!==null&&(e.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=H4(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=a.createElement("div"),t.innerHTML="<script></script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=a.createElement(r,{is:n.is}):(t=a.createElement(r),r==="select"&&(a=t,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):t=a.createElementNS(t,r),t[bn]=e,t[ic]=n,og(t,e,!1,!1),e.stateNode=t;e:{switch(a=yu(r,n),r){case"dialog":Ne("cancel",t),Ne("close",t),i=n;break;case"iframe":case"object":case"embed":Ne("load",t),i=n;break;case"video":case"audio":for(i=0;i<us.length;i++)Ne(us[i],t);i=n;break;case"source":Ne("error",t),i=n;break;case"img":case"image":case"link":Ne("error",t),Ne("load",t),i=n;break;case"details":Ne("toggle",t),i=n;break;case"input":j0(t,n),i=uu(t,n),Ne("invalid",t);break;case"option":i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=We({},n,{value:void 0}),Ne("invalid",t);break;case"textarea":q0(t,n),i=mu(t,n),Ne("invalid",t);break;default:i=n}gu(r,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var c=s[o];o==="style"?D4(t,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&L4(t,c)):o==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Ys(t,c):typeof c=="number"&&Ys(t,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ws.hasOwnProperty(o)?c!=null&&o==="onScroll"&&Ne("scroll",t):c!=null&&nf(t,o,c,a))}switch(r){case"input":Xc(t),B0(t,n,!1);break;case"textarea":Xc(t),G0(t);break;case"option":n.value!=null&&t.setAttribute("value",""+Ri(n.value));break;case"select":t.multiple=!!n.multiple,o=n.value,o!=null?ma(t,!!n.multiple,o,!1):n.defaultValue!=null&&ma(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=fd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Dt(e),null;case 6:if(t&&e.stateNode!=null)sg(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(M(166));if(r=co(ac.current),co(zn.current),al(e)){if(n=e.stateNode,r=e.memoizedProps,n[bn]=e,(o=n.nodeValue!==r)&&(t=Ar,t!==null))switch(t.tag){case 3:ol(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ol(n.nodeValue,r,(t.mode&1)!==0)}o&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[bn]=e,e.stateNode=n}return Dt(e),null;case 13:if(Ue(qe),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Be&&Sr!==null&&(e.mode&1)!==0&&(e.flags&128)===0)C5(),ka(),e.flags|=98560,o=!1;else if(o=al(e),n!==null&&n.dehydrated!==null){if(t===null){if(!o)throw Error(M(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(M(317));o[bn]=e}else ka(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Dt(e),o=!1}else tn!==null&&(Ju(tn),tn=null),o=!0;if(!o)return e.flags&65536?e:null}return(e.flags&128)!==0?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,(e.mode&1)!==0&&(t===null||(qe.current&1)!==0?ft===0&&(ft=3):Ff())),e.updateQueue!==null&&(e.flags|=4),Dt(e),null);case 4:return Ta(),Bu(t,e),t===null&&rc(e.stateNode.containerInfo),Dt(e),null;case 10:return Ef(e.type._context),Dt(e),null;case 17:return yr(e.type)&&pd(),Dt(e),null;case 19:if(Ue(qe),o=e.memoizedState,o===null)return Dt(e),null;if(n=(e.flags&128)!==0,a=o.rendering,a===null)if(n)ts(o,!1);else{if(ft!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(a=wd(t),a!==null){for(e.flags|=128,ts(o,!1),n=a.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)o=r,t=n,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,t=a.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return Le(qe,qe.current&1|2),e.child}t=t.sibling}o.tail!==null&&nt()>Ma&&(e.flags|=128,n=!0,ts(o,!1),e.lanes=4194304)}else{if(!n)if(t=wd(a),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),ts(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Be)return Dt(e),null}else 2*nt()-o.renderingStartTime>Ma&&r!==1073741824&&(e.flags|=128,n=!0,ts(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(r=o.last,r!==null?r.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=nt(),e.sibling=null,r=qe.current,Le(qe,n?r&1|2:r&1),e):(Dt(e),null);case 22:case 23:return Vf(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&(e.mode&1)!==0?(Cr&1073741824)!==0&&(Dt(e),e.subtreeFlags&6&&(e.flags|=8192)):Dt(e),null;case 24:return null;case 25:return null}throw Error(M(156,e.tag))}function l7(t,e){switch(_f(e),e.tag){case 1:return yr(e.type)&&pd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ta(),Ue(gr),Ue(Gt),Af(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return kf(e),null;case 13:if(Ue(qe),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));ka()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ue(qe),null;case 4:return Ta(),null;case 10:return Ef(e.type._context),null;case 22:case 23:return Vf(),null;case 24:return null;default:return null}}var ll=!1,$t=!1,d7=typeof WeakSet=="function"?WeakSet:Set,B=null;function oa(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Xe(t,e,n)}else r.current=null}function qu(t,e,r){try{r()}catch(n){Xe(t,e,n)}}var Lp=!1;function h7(t,e){if(Au=dd,t=h5(),gf(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var a=0,s=-1,c=-1,l=0,d=0,h=t,u=null;t:for(;;){for(var f;h!==r||i!==0&&h.nodeType!==3||(s=a+i),h!==o||n!==0&&h.nodeType!==3||(c=a+n),h.nodeType===3&&(a+=h.nodeValue.length),(f=h.firstChild)!==null;)u=h,h=f;for(;;){if(h===t)break t;if(u===r&&++l===i&&(s=a),u===o&&++d===n&&(c=a),(f=h.nextSibling)!==null)break;h=u,u=h.parentNode}h=f}r=s===-1||c===-1?null:{start:s,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Tu={focusedElem:t,selectionRange:r},dd=!1,B=e;B!==null;)if(e=B,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,B=t;else for(;B!==null;){e=B;try{var v=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,x=v.memoizedState,m=e.stateNode,p=m.getSnapshotBeforeUpdate(e.elementType===e.type?g:Zr(e.type,g),x);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(w){Xe(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,B=t;break}B=e.return}return v=Lp,Lp=!1,v}function Os(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&qu(e,r,o)}i=i.next}while(i!==n)}}function m1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Gu(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function cg(t){var e=t.alternate;e!==null&&(t.alternate=null,cg(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[bn],delete e[ic],delete e[Pu],delete e[K9],delete e[W9])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function lg(t){return t.tag===5||t.tag===3||t.tag===4}function Op(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||lg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ku(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=fd));else if(n!==4&&(t=t.child,t!==null))for(Ku(t,e,r),t=t.sibling;t!==null;)Ku(t,e,r),t=t.sibling}function Wu(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(Wu(t,e,r),t=t.sibling;t!==null;)Wu(t,e,r),t=t.sibling}var Ct=null,en=!1;function ai(t,e,r){for(r=r.child;r!==null;)dg(t,e,r),r=r.sibling}function dg(t,e,r){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(s1,r)}catch{}switch(r.tag){case 5:$t||oa(r,e);case 6:var n=Ct,i=en;Ct=null,ai(t,e,r),Ct=n,en=i,Ct!==null&&(en?(t=Ct,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ct.removeChild(r.stateNode));break;case 18:Ct!==null&&(en?(t=Ct,r=r.stateNode,t.nodeType===8?ch(t.parentNode,r):t.nodeType===1&&ch(t,r),Zs(t)):ch(Ct,r.stateNode));break;case 4:n=Ct,i=en,Ct=r.stateNode.containerInfo,en=!0,ai(t,e,r),Ct=n,en=i;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&((o&2)!==0||(o&4)!==0)&&qu(r,e,a),i=i.next}while(i!==n)}ai(t,e,r);break;case 1:if(!$t&&(oa(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Xe(r,e,s)}ai(t,e,r);break;case 21:ai(t,e,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,ai(t,e,r),$t=n):ai(t,e,r);break;default:ai(t,e,r)}}function Dp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new d7),e.forEach(function(n){var i=b7.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Yr(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var o=t,a=e,s=a;e:for(;s!==null;){switch(s.tag){case 5:Ct=s.stateNode,en=!1;break e;case 3:Ct=s.stateNode.containerInfo,en=!0;break e;case 4:Ct=s.stateNode.containerInfo,en=!0;break e}s=s.return}if(Ct===null)throw Error(M(160));dg(o,a,i),Ct=null,en=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(l){Xe(i,e,l)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)hg(e,t),e=e.sibling}function hg(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Yr(e,t),pn(t),n&4){try{Os(3,t,t.return),m1(3,t)}catch(g){Xe(t,t.return,g)}try{Os(5,t,t.return)}catch(g){Xe(t,t.return,g)}}break;case 1:Yr(e,t),pn(t),n&512&&r!==null&&oa(r,r.return);break;case 5:if(Yr(e,t),pn(t),n&512&&r!==null&&oa(r,r.return),t.flags&32){var i=t.stateNode;try{Ys(i,"")}catch(g){Xe(t,t.return,g)}}if(n&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,a=r!==null?r.memoizedProps:o,s=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&P4(i,o),yu(s,a);var l=yu(s,o);for(a=0;a<c.length;a+=2){var d=c[a],h=c[a+1];d==="style"?D4(i,h):d==="dangerouslySetInnerHTML"?L4(i,h):d==="children"?Ys(i,h):nf(i,d,h,l)}switch(s){case"input":fu(i,o);break;case"textarea":R4(i,o);break;case"select":var u=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var f=o.value;f!=null?ma(i,!!o.multiple,f,!1):u!==!!o.multiple&&(o.defaultValue!=null?ma(i,!!o.multiple,o.defaultValue,!0):ma(i,!!o.multiple,o.multiple?[]:"",!1))}i[ic]=o}catch(g){Xe(t,t.return,g)}}break;case 6:if(Yr(e,t),pn(t),n&4){if(t.stateNode===null)throw Error(M(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(g){Xe(t,t.return,g)}}break;case 3:if(Yr(e,t),pn(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Zs(e.containerInfo)}catch(g){Xe(t,t.return,g)}break;case 4:Yr(e,t),pn(t);break;case 13:Yr(e,t),pn(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Df=nt())),n&4&&Dp(t);break;case 22:if(d=r!==null&&r.memoizedState!==null,t.mode&1?($t=(l=$t)||d,Yr(e,t),$t=l):Yr(e,t),pn(t),n&8192){if(l=t.memoizedState!==null,(t.stateNode.isHidden=l)&&!d&&(t.mode&1)!==0)for(B=t,d=t.child;d!==null;){for(h=B=d;B!==null;){switch(u=B,f=u.child,u.tag){case 0:case 11:case 14:case 15:Os(4,u,u.return);break;case 1:oa(u,u.return);var v=u.stateNode;if(typeof v.componentWillUnmount=="function"){n=u,r=u.return;try{e=n,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(g){Xe(n,r,g)}}break;case 5:oa(u,u.return);break;case 22:if(u.memoizedState!==null){Vp(h);continue}}f!==null?(f.return=u,B=f):Vp(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,l?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=h.stateNode,c=h.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,s.style.display=O4("display",a))}catch(g){Xe(t,t.return,g)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=l?"":h.memoizedProps}catch(g){Xe(t,t.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Yr(e,t),pn(t),n&4&&Dp(t);break;case 21:break;default:Yr(e,t),pn(t)}}function pn(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(lg(r)){var n=r;break e}r=r.return}throw Error(M(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Ys(i,""),n.flags&=-33);var o=Op(t);Wu(t,o,i);break;case 3:case 4:var a=n.stateNode.containerInfo,s=Op(t);Ku(t,s,a);break;default:throw Error(M(161))}}catch(c){Xe(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function u7(t,e,r){B=t,ug(t)}function ug(t,e,r){for(var n=(t.mode&1)!==0;B!==null;){var i=B,o=i.child;if(i.tag===22&&n){var a=i.memoizedState!==null||ll;if(!a){var s=i.alternate,c=s!==null&&s.memoizedState!==null||$t;s=ll;var l=$t;if(ll=a,($t=c)&&!l)for(B=i;B!==null;)a=B,c=a.child,a.tag===22&&a.memoizedState!==null?Fp(i):c!==null?(c.return=a,B=c):Fp(i);for(;o!==null;)B=o,ug(o),o=o.sibling;B=i,ll=s,$t=l}Np(t)}else(i.subtreeFlags&8772)!==0&&o!==null?(o.return=i,B=o):Np(t)}}function Np(t){for(;B!==null;){var e=B;if((e.flags&8772)!==0){var r=e.alternate;try{if((e.flags&8772)!==0)switch(e.tag){case 0:case 11:case 15:$t||m1(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!$t)if(r===null)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:Zr(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&wp(e,o,n);break;case 3:var a=e.updateQueue;if(a!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}wp(e,a,r)}break;case 5:var s=e.stateNode;if(r===null&&e.flags&4){r=s;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var l=e.alternate;if(l!==null){var d=l.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&Zs(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}$t||e.flags&512&&Gu(e)}catch(u){Xe(e,e.return,u)}}if(e===t){B=null;break}if(r=e.sibling,r!==null){r.return=e.return,B=r;break}B=e.return}}function Vp(t){for(;B!==null;){var e=B;if(e===t){B=null;break}var r=e.sibling;if(r!==null){r.return=e.return,B=r;break}B=e.return}}function Fp(t){for(;B!==null;){var e=B;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{m1(4,e)}catch(c){Xe(e,r,c)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var i=e.return;try{n.componentDidMount()}catch(c){Xe(e,i,c)}}var o=e.return;try{Gu(e)}catch(c){Xe(e,o,c)}break;case 5:var a=e.return;try{Gu(e)}catch(c){Xe(e,a,c)}}}catch(c){Xe(e,e.return,c)}if(e===t){B=null;break}var s=e.sibling;if(s!==null){s.return=e.return,B=s;break}B=e.return}}var f7=Math.ceil,Cd=ni.ReactCurrentDispatcher,Lf=ni.ReactCurrentOwner,jr=ni.ReactCurrentBatchConfig,_e=0,_t=null,ct=null,At=0,Cr=0,aa=Ui(0),ft=0,dc=null,Eo=0,v1=0,Of=0,Ds=null,pr=null,Df=0,Ma=1/0,Nn=null,zd=!1,Yu=null,Ai=null,dl=!1,xi=null,Sd=0,Ns=0,Qu=null,Nl=-1,Vl=0;function rr(){return(_e&6)!==0?nt():Nl!==-1?Nl:Nl=nt()}function Ti(t){return(t.mode&1)===0?1:(_e&2)!==0&&At!==0?At&-At:Q9.transition!==null?(Vl===0&&(Vl=Y4()),Vl):(t=Ae,t!==0||(t=window.event,t=t===void 0?16:r5(t.type)),t)}function cn(t,e,r,n){if(50<Ns)throw Ns=0,Qu=null,Error(M(185));Sc(t,r,n),((_e&2)===0||t!==_t)&&(t===_t&&((_e&2)===0&&(v1|=r),ft===4&&_i(t,At)),_r(t,n),r===1&&_e===0&&(e.mode&1)===0&&(Ma=nt()+500,u1&&$i()))}function _r(t,e){var r=t.callbackNode;Q8(t,e);var n=ld(t,t===_t?At:0);if(n===0)r!==null&&Y0(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&Y0(r),e===1)t.tag===0?Y9(Up.bind(null,t)):w5(Up.bind(null,t)),q9(function(){(_e&6)===0&&$i()}),r=null;else{switch(Q4(n)){case 1:r=lf;break;case 4:r=K4;break;case 16:r=cd;break;case 536870912:r=W4;break;default:r=cd}r=bg(r,fg.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function fg(t,e){if(Nl=-1,Vl=0,(_e&6)!==0)throw Error(M(327));var r=t.callbackNode;if(ba()&&t.callbackNode!==r)return null;var n=ld(t,t===_t?At:0);if(n===0)return null;if((n&30)!==0||(n&t.expiredLanes)!==0||e)e=kd(t,n);else{e=n;var i=_e;_e|=2;var o=mg();(_t!==t||At!==e)&&(Nn=null,Ma=nt()+500,uo(t,e));do try{v7();break}catch(s){pg(t,s)}while(1);xf(),Cd.current=o,_e=i,ct!==null?e=0:(_t=null,At=0,e=ft)}if(e!==0){if(e===2&&(i=Eu(t),i!==0&&(n=i,e=Xu(t,i))),e===1)throw r=dc,uo(t,0),_i(t,n),_r(t,nt()),r;if(e===6)_i(t,n);else{if(i=t.current.alternate,(n&30)===0&&!p7(i)&&(e=kd(t,n),e===2&&(o=Eu(t),o!==0&&(n=o,e=Xu(t,o))),e===1))throw r=dc,uo(t,0),_i(t,n),_r(t,nt()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(M(345));case 2:Zi(t,pr,Nn);break;case 3:if(_i(t,n),(n&130023424)===n&&(e=Df+500-nt(),10<e)){if(ld(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){rr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Mu(Zi.bind(null,t,pr,Nn),e);break}Zi(t,pr,Nn);break;case 4:if(_i(t,n),(n&4194240)===n)break;for(e=t.eventTimes,i=-1;0<n;){var a=31-sn(n);o=1<<a,a=e[a],a>i&&(i=a),n&=~o}if(n=i,n=nt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*f7(n/1960))-n,10<n){t.timeoutHandle=Mu(Zi.bind(null,t,pr,Nn),n);break}Zi(t,pr,Nn);break;case 5:Zi(t,pr,Nn);break;default:throw Error(M(329))}}}return _r(t,nt()),t.callbackNode===r?fg.bind(null,t):null}function Xu(t,e){var r=Ds;return t.current.memoizedState.isDehydrated&&(uo(t,e).flags|=256),t=kd(t,e),t!==2&&(e=pr,pr=r,e!==null&&Ju(e)),t}function Ju(t){pr===null?pr=t:pr.push.apply(pr,t)}function p7(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],o=i.getSnapshot;i=i.value;try{if(!dn(o(),i))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function _i(t,e){for(e&=~Of,e&=~v1,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-sn(e),n=1<<r;t[r]=-1,e&=~n}}function Up(t){if((_e&6)!==0)throw Error(M(327));ba();var e=ld(t,0);if((e&1)===0)return _r(t,nt()),null;var r=kd(t,e);if(t.tag!==0&&r===2){var n=Eu(t);n!==0&&(e=n,r=Xu(t,n))}if(r===1)throw r=dc,uo(t,0),_i(t,e),_r(t,nt()),r;if(r===6)throw Error(M(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Zi(t,pr,Nn),_r(t,nt()),null}function Nf(t,e){var r=_e;_e|=1;try{return t(e)}finally{_e=r,_e===0&&(Ma=nt()+500,u1&&$i())}}function Co(t){xi!==null&&xi.tag===0&&(_e&6)===0&&ba();var e=_e;_e|=1;var r=jr.transition,n=Ae;try{if(jr.transition=null,Ae=1,t)return t()}finally{Ae=n,jr.transition=r,_e=e,(_e&6)===0&&$i()}}function Vf(){Cr=aa.current,Ue(aa)}function uo(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,B9(r)),ct!==null)for(r=ct.return;r!==null;){var n=r;switch(_f(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&pd();break;case 3:Ta(),Ue(gr),Ue(Gt),Af();break;case 5:kf(n);break;case 4:Ta();break;case 13:Ue(qe);break;case 19:Ue(qe);break;case 10:Ef(n.type._context);break;case 22:case 23:Vf()}r=r.return}if(_t=t,ct=t=Ii(t.current,null),At=Cr=e,ft=0,dc=null,Of=v1=Eo=0,pr=Ds=null,so!==null){for(e=0;e<so.length;e++)if(r=so[e],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,o=r.pending;if(o!==null){var a=o.next;o.next=i,n.next=a}r.pending=n}so=null}return t}function pg(t,e){do{var r=ct;try{if(xf(),Ll.current=Ed,xd){for(var n=Ke.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}xd=!1}if(xo=0,yt=ut=Ke=null,Ls=!1,sc=0,Lf.current=null,r===null||r.return===null){ft=1,dc=e,ct=null;break}e:{var o=t,a=r.return,s=r,c=e;if(e=At,s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var l=c,d=s,h=d.tag;if((d.mode&1)===0&&(h===0||h===11||h===15)){var u=d.alternate;u?(d.updateQueue=u.updateQueue,d.memoizedState=u.memoizedState,d.lanes=u.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=Ap(a);if(f!==null){f.flags&=-257,Tp(f,a,s,o,e),f.mode&1&&kp(o,l,e),e=f,c=l;var v=e.updateQueue;if(v===null){var g=new Set;g.add(c),e.updateQueue=g}else v.add(c);break e}else{if((e&1)===0){kp(o,l,e),Ff();break e}c=Error(M(426))}}else if(Be&&s.mode&1){var x=Ap(a);if(x!==null){(x.flags&65536)===0&&(x.flags|=256),Tp(x,a,s,o,e),bf(Ia(c,s));break e}}o=c=Ia(c,s),ft!==4&&(ft=2),Ds===null?Ds=[o]:Ds.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var m=X5(o,c,e);bp(o,m);break e;case 1:s=c;var p=o.type,y=o.stateNode;if((o.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ai===null||!Ai.has(y)))){o.flags|=65536,e&=-e,o.lanes|=e;var w=J5(o,s,e);bp(o,w);break e}}o=o.return}while(o!==null)}gg(r)}catch(A){e=A,ct===r&&r!==null&&(ct=r=r.return);continue}break}while(1)}function mg(){var t=Cd.current;return Cd.current=Ed,t===null?Ed:t}function Ff(){(ft===0||ft===3||ft===2)&&(ft=4),_t===null||(Eo&268435455)===0&&(v1&268435455)===0||_i(_t,At)}function kd(t,e){var r=_e;_e|=2;var n=mg();(_t!==t||At!==e)&&(Nn=null,uo(t,e));do try{m7();break}catch(i){pg(t,i)}while(1);if(xf(),_e=r,Cd.current=n,ct!==null)throw Error(M(261));return _t=null,At=0,ft}function m7(){for(;ct!==null;)vg(ct)}function v7(){for(;ct!==null&&!U8();)vg(ct)}function vg(t){var e=_g(t.alternate,t,Cr);t.memoizedProps=t.pendingProps,e===null?gg(t):ct=e,Lf.current=null}function gg(t){var e=t;do{var r=e.alternate;if(t=e.return,(e.flags&32768)===0){if(r=c7(r,e,Cr),r!==null){ct=r;return}}else{if(r=l7(r,e),r!==null){r.flags&=32767,ct=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{ft=6,ct=null;return}}if(e=e.sibling,e!==null){ct=e;return}ct=e=t}while(e!==null);ft===0&&(ft=5)}function Zi(t,e,r){var n=Ae,i=jr.transition;try{jr.transition=null,Ae=1,g7(t,e,r,n)}finally{jr.transition=i,Ae=n}return null}function g7(t,e,r,n){do ba();while(xi!==null);if((_e&6)!==0)throw Error(M(327));r=t.finishedWork;var i=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(M(177));t.callbackNode=null,t.callbackPriority=0;var o=r.lanes|r.childLanes;if(X8(t,o),t===_t&&(ct=_t=null,At=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||dl||(dl=!0,bg(cd,function(){return ba(),null})),o=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||o){o=jr.transition,jr.transition=null;var a=Ae;Ae=1;var s=_e;_e|=4,Lf.current=null,h7(t,r),hg(r,t),D9(Tu),dd=!!Au,Tu=Au=null,t.current=r,u7(r),$8(),_e=s,Ae=a,jr.transition=o}else t.current=r;if(dl&&(dl=!1,xi=t,Sd=i),o=t.pendingLanes,o===0&&(Ai=null),q8(r.stateNode),_r(t,nt()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)i=e[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(zd)throw zd=!1,t=Yu,Yu=null,t;return(Sd&1)!==0&&t.tag!==0&&ba(),o=t.pendingLanes,(o&1)!==0?t===Qu?Ns++:(Ns=0,Qu=t):Ns=0,$i(),null}function ba(){if(xi!==null){var t=Q4(Sd),e=jr.transition,r=Ae;try{if(jr.transition=null,Ae=16>t?16:t,xi===null)var n=!1;else{if(t=xi,xi=null,Sd=0,(_e&6)!==0)throw Error(M(331));var i=_e;for(_e|=4,B=t.current;B!==null;){var o=B,a=o.child;if((B.flags&16)!==0){var s=o.deletions;if(s!==null){for(var c=0;c<s.length;c++){var l=s[c];for(B=l;B!==null;){var d=B;switch(d.tag){case 0:case 11:case 15:Os(8,d,o)}var h=d.child;if(h!==null)h.return=d,B=h;else for(;B!==null;){d=B;var u=d.sibling,f=d.return;if(cg(d),d===l){B=null;break}if(u!==null){u.return=f,B=u;break}B=f}}}var v=o.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}B=o}}if((o.subtreeFlags&2064)!==0&&a!==null)a.return=o,B=a;else e:for(;B!==null;){if(o=B,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:Os(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,B=m;break e}B=o.return}}var p=t.current;for(B=p;B!==null;){a=B;var y=a.child;if((a.subtreeFlags&2064)!==0&&y!==null)y.return=a,B=y;else e:for(a=p;B!==null;){if(s=B,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:m1(9,s)}}catch(A){Xe(s,s.return,A)}if(s===a){B=null;break e}var w=s.sibling;if(w!==null){w.return=s.return,B=w;break e}B=s.return}}if(_e=i,$i(),Cn&&typeof Cn.onPostCommitFiberRoot=="function")try{Cn.onPostCommitFiberRoot(s1,t)}catch{}n=!0}return n}finally{Ae=r,jr.transition=e}}return!1}function $p(t,e,r){e=Ia(r,e),e=X5(t,e,1),t=ki(t,e,1),e=rr(),t!==null&&(Sc(t,1,e),_r(t,e))}function Xe(t,e,r){if(t.tag===3)$p(t,t,r);else for(;e!==null;){if(e.tag===3){$p(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ai===null||!Ai.has(n))){t=Ia(r,t),t=J5(e,t,1),e=ki(e,t,1),t=rr(),e!==null&&(Sc(e,1,t),_r(e,t));break}}e=e.return}}function y7(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=rr(),t.pingedLanes|=t.suspendedLanes&r,_t===t&&(At&r)===r&&(ft===4||ft===3&&(At&130023424)===At&&500>nt()-Df?uo(t,0):Of|=r),_r(t,e)}function yg(t,e){e===0&&((t.mode&1)===0?e=1:(e=el,el<<=1,(el&130023424)===0&&(el=4194304)));var r=rr();t=ei(t,e),t!==null&&(Sc(t,e,r),_r(t,r))}function _7(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),yg(t,r)}function b7(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(M(314))}n!==null&&n.delete(e),yg(t,r)}var _g;_g=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||gr.current)vr=!0;else{if((t.lanes&r)===0&&(e.flags&128)===0)return vr=!1,s7(t,e,r);vr=(t.flags&131072)!==0}else vr=!1,Be&&(e.flags&1048576)!==0&&x5(e,gd,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Dl(t,e),t=e.pendingProps;var i=Sa(e,Gt.current);_a(e,r),i=If(null,e,n,t,i,r);var o=Mf();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,yr(n)?(o=!0,md(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,zf(e),i.updater=f1,e.stateNode=i,i._reactInternals=e,Nu(e,n,t,r),e=Uu(null,e,n,!0,o,r)):(e.tag=0,Be&&o&&yf(e),Jt(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Dl(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=x7(n),t=Zr(n,t),i){case 0:e=Fu(null,e,n,t,r);break e;case 1:e=Pp(null,e,n,t,r);break e;case 11:e=Ip(null,e,n,t,r);break e;case 14:e=Mp(null,e,n,Zr(n.type,t),r);break e}throw Error(M(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zr(n,i),Fu(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zr(n,i),Pp(t,e,n,i,r);case 3:e:{if(rg(e),t===null)throw Error(M(387));n=e.pendingProps,o=e.memoizedState,i=o.element,S5(t,e),bd(e,n,null,r);var a=e.memoizedState;if(n=a.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Ia(Error(M(423)),e),e=Rp(t,e,n,r,i);break e}else if(n!==i){i=Ia(Error(M(424)),e),e=Rp(t,e,n,r,i);break e}else for(Sr=Si(e.stateNode.containerInfo.firstChild),Ar=e,Be=!0,tn=null,r=I5(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ka(),n===i){e=ti(t,e,r);break e}Jt(t,e,n,r)}e=e.child}return e;case 5:return M5(e),t===null&&Lu(e),n=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,Iu(n,i)?a=null:o!==null&&Iu(n,o)&&(e.flags|=32),tg(t,e),Jt(t,e,a,r),e.child;case 6:return t===null&&Lu(e),null;case 13:return ng(t,e,r);case 4:return Sf(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Aa(e,null,n,r):Jt(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zr(n,i),Ip(t,e,n,i,r);case 7:return Jt(t,e,e.pendingProps,r),e.child;case 8:return Jt(t,e,e.pendingProps.children,r),e.child;case 12:return Jt(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,Le(yd,n._currentValue),n._currentValue=a,o!==null)if(dn(o.value,a)){if(o.children===i.children&&!gr.current){e=ti(t,e,r);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var c=s.firstContext;c!==null;){if(c.context===n){if(o.tag===1){c=Kn(-1,r&-r),c.tag=2;var l=o.updateQueue;if(l!==null){l=l.shared;var d=l.pending;d===null?c.next=c:(c.next=d.next,d.next=c),l.pending=c}}o.lanes|=r,c=o.alternate,c!==null&&(c.lanes|=r),Ou(o.return,r,e),s.lanes|=r;break}c=c.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(M(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),Ou(a,r,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Jt(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,_a(e,r),i=qr(i),n=n(i),e.flags|=1,Jt(t,e,n,r),e.child;case 14:return n=e.type,i=Zr(n,e.pendingProps),i=Zr(n.type,i),Mp(t,e,n,i,r);case 15:return Z5(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Zr(n,i),Dl(t,e),e.tag=1,yr(n)?(t=!0,md(e)):t=!1,_a(e,r),A5(e,n,i),Nu(e,n,i,r),Uu(null,e,n,!0,t,r);case 19:return ig(t,e,r);case 22:return eg(t,e,r)}throw Error(M(156,e.tag))};function bg(t,e){return G4(t,e)}function w7(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(t,e,r,n){return new w7(t,e,r,n)}function Uf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function x7(t){if(typeof t=="function")return Uf(t)?1:0;if(t!=null){if(t=t.$$typeof,t===af)return 11;if(t===sf)return 14}return 2}function Ii(t,e){var r=t.alternate;return r===null?(r=Ur(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Fl(t,e,r,n,i,o){var a=2;if(n=t,typeof t=="function")Uf(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Qo:return fo(r.children,i,o,e);case of:a=8,i|=8;break;case cu:return t=Ur(12,r,e,i|2),t.elementType=cu,t.lanes=o,t;case lu:return t=Ur(13,r,e,i),t.elementType=lu,t.lanes=o,t;case du:return t=Ur(19,r,e,i),t.elementType=du,t.lanes=o,t;case T4:return g1(r,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k4:a=10;break e;case A4:a=9;break e;case af:a=11;break e;case sf:a=14;break e;case pi:a=16,n=null;break e}throw Error(M(130,t==null?t:typeof t,""))}return e=Ur(a,r,e,i),e.elementType=t,e.type=n,e.lanes=o,e}function fo(t,e,r,n){return t=Ur(7,t,n,e),t.lanes=r,t}function g1(t,e,r,n){return t=Ur(22,t,n,e),t.elementType=T4,t.lanes=r,t.stateNode={isHidden:!1},t}function vh(t,e,r){return t=Ur(6,t,null,e),t.lanes=r,t}function gh(t,e,r){return e=Ur(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function E7(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=X1(0),this.expirationTimes=X1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=X1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $f(t,e,r,n,i,o,a,s,c){return t=new E7(t,e,r,s,c),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Ur(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},zf(o),t}function C7(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yo,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function wg(t){if(!t)return Hi;t=t._reactInternals;e:{if(Ao(t)!==t||t.tag!==1)throw Error(M(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(yr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(M(171))}if(t.tag===1){var r=t.type;if(yr(r))return b5(t,r,e)}return e}function xg(t,e,r,n,i,o,a,s,c){return t=$f(r,n,!0,t,i,o,a,s,c),t.context=wg(null),r=t.current,n=rr(),i=Ti(r),o=Kn(n,i),o.callback=e??null,ki(r,o,i),t.current.lanes=i,Sc(t,i,n),_r(t,n),t}function y1(t,e,r,n){var i=e.current,o=rr(),a=Ti(i);return r=wg(r),e.context===null?e.context=r:e.pendingContext=r,e=Kn(o,a),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=ki(i,e,a),t!==null&&(cn(t,i,a,o),Hl(t,i,a)),a}function Ad(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function jp(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function jf(t,e){jp(t,e),(t=t.alternate)&&jp(t,e)}function z7(){return null}var Eg=typeof reportError=="function"?reportError:function(t){console.error(t)};function Bf(t){this._internalRoot=t}_1.prototype.render=Bf.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));y1(t,e,null,null)};_1.prototype.unmount=Bf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Co(function(){y1(null,t,null,null)}),e[Zn]=null}};function _1(t){this._internalRoot=t}_1.prototype.unstable_scheduleHydration=function(t){if(t){var e=Z4();t={blockedOn:null,target:t,priority:e};for(var r=0;r<yi.length&&e!==0&&e<yi[r].priority;r++);yi.splice(r,0,t),r===0&&t5(t)}};function qf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function b1(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Bp(){}function S7(t,e,r,n,i){if(i){if(typeof n=="function"){var o=n;n=function(){var l=Ad(a);o.call(l)}}var a=xg(e,n,t,0,null,!1,!1,"",Bp);return t._reactRootContainer=a,t[Zn]=a.current,rc(t.nodeType===8?t.parentNode:t),Co(),a}for(;i=t.lastChild;)t.removeChild(i);if(typeof n=="function"){var s=n;n=function(){var l=Ad(c);s.call(l)}}var c=$f(t,0,!1,null,null,!1,!1,"",Bp);return t._reactRootContainer=c,t[Zn]=c.current,rc(t.nodeType===8?t.parentNode:t),Co(function(){y1(e,c,r,n)}),c}function w1(t,e,r,n,i){var o=r._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var c=Ad(a);s.call(c)}}y1(e,a,t,i)}else a=S7(r,e,t,i,n);return Ad(a)}X4=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=hs(e.pendingLanes);r!==0&&(df(e,r|1),_r(e,nt()),(_e&6)===0&&(Ma=nt()+500,$i()))}break;case 13:Co(function(){var n=ei(t,1);if(n!==null){var i=rr();cn(n,t,1,i)}}),jf(t,1)}};hf=function(t){if(t.tag===13){var e=ei(t,134217728);if(e!==null){var r=rr();cn(e,t,134217728,r)}jf(t,134217728)}};J4=function(t){if(t.tag===13){var e=Ti(t),r=ei(t,e);if(r!==null){var n=rr();cn(r,t,e,n)}jf(t,e)}};Z4=function(){return Ae};e5=function(t,e){var r=Ae;try{return Ae=t,e()}finally{Ae=r}};bu=function(t,e,r){switch(e){case"input":if(fu(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=h1(n);if(!i)throw Error(M(90));M4(n),fu(n,i)}}}break;case"textarea":R4(t,r);break;case"select":e=r.value,e!=null&&ma(t,!!r.multiple,e,!1)}};F4=Nf;U4=Co;var k7={usingClientEntryPoint:!1,Events:[Ac,ea,h1,N4,V4,Nf]},rs={findFiberByHostInstance:ao,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},A7={bundleType:rs.bundleType,version:rs.version,rendererPackageName:rs.rendererPackageName,rendererConfig:rs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ni.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=B4(t),t===null?null:t.stateNode},findFiberByHostInstance:rs.findFiberByHostInstance||z7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{s1=hl.inject(A7),Cn=hl}catch{}}Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k7;Pr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qf(e))throw Error(M(200));return C7(t,e,null,r)};Pr.createRoot=function(t,e){if(!qf(t))throw Error(M(299));var r=!1,n="",i=Eg;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=$f(t,1,!1,null,null,r,!1,n,i),t[Zn]=e.current,rc(t.nodeType===8?t.parentNode:t),new Bf(e)};Pr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=B4(e),t=t===null?null:t.stateNode,t};Pr.flushSync=function(t){return Co(t)};Pr.hydrate=function(t,e,r){if(!b1(e))throw Error(M(200));return w1(null,t,e,!0,r)};Pr.hydrateRoot=function(t,e,r){if(!qf(t))throw Error(M(405));var n=r!=null&&r.hydratedSources||null,i=!1,o="",a=Eg;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),e=xg(e,null,t,1,r??null,i,!1,o,a),t[Zn]=e.current,rc(t),n)for(t=0;t<n.length;t++)r=n[t],i=r._getVersion,i=i(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,i]:e.mutableSourceEagerHydrationData.push(r,i);return new _1(e)};Pr.render=function(t,e,r){if(!b1(e))throw Error(M(200));return w1(null,t,e,!1,r)};Pr.unmountComponentAtNode=function(t){if(!b1(t))throw Error(M(40));return t._reactRootContainer?(Co(function(){w1(null,null,t,!1,function(){t._reactRootContainer=null,t[Zn]=null})}),!0):!1};Pr.unstable_batchedUpdates=Nf;Pr.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!b1(r))throw Error(M(200));if(t==null||t._reactInternals===void 0)throw Error(M(38));return w1(t,e,r,!1,n)};Pr.version="18.2.0-next-9e3b772b8-20220608";(function(t){function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}e(),t.exports=Pr})(z8);var qp=ou;iu.createRoot=qp.createRoot,iu.hydrateRoot=qp.hydrateRoot;let T7=class{constructor(e){this.domain=e,this.level=1}_createMessage(e){return[`%c FUSION FRAMEWORK %c ${this.domain} %c %s`,"background: rgb(179, 13, 47); color: white; padding: 1px;","background: rgb(244, 244, 244); color: rgb(36, 55, 70); padding: 1px;","background: none; color: inherit",...e.reduce((r,n)=>[...r,n,`
|
|
9
9
|
`],[])]}debug(...e){this.level>3&&console.debug(...this._createMessage(e))}info(...e){this.level>2&&console.info(...this._createMessage(e))}warn(...e){this.level>1&&console.warn(...this._createMessage(e))}error(...e){this.level>0&&console.error(...this._createMessage(e))}};class Cg extends T7{formatModuleName(e){return`📦\x1B[1;32m${(typeof e=="string"?e:e.name).replace(/([A-Z])/g," $1").toUpperCase()}\x1B[0m`}}var Zu=function(t,e){return Zu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Zu(t,e)};function Wt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Zu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var lt=function(){return lt=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},lt.apply(this,arguments)};function zg(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function b(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,r,o):a(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function x1(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})}function Sg(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(d){return c([l,d])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(d){l=[6,d],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function tr(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function An(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function ri(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function wa(t){return this instanceof wa?(this.v=t,this):new wa(t)}function I7(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(u){n[u]&&(i[u]=function(f){return new Promise(function(v,g){o.push([u,f,v,g])>1||s(u,f)})})}function s(u,f){try{c(n[u](f))}catch(v){h(o[0][3],v)}}function c(u){u.value instanceof wa?Promise.resolve(u.value.v).then(l,d):h(o[0][2],u)}function l(u){s("next",u)}function d(u){s("throw",u)}function h(u,f){u(f),o.shift(),o.length&&s(o[0][0],o[0][1])}}function M7(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof tr=="function"?tr(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(a){return new Promise(function(s,c){a=t[o](a),i(s,c,a.done,a.value)})}}function i(o,a,s,c){Promise.resolve(c).then(function(l){o({value:l,done:s})},a)}}function je(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function ul(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function Te(t){return typeof t=="function"}function E1(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var yh=E1(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
10
10
|
`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
11
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function Td(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var un=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=tr(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(g){e={error:g}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}else a.remove(this);var d=this.initialTeardown;if(Te(d))try{d()}catch(g){o=g instanceof yh?g.errors:[g]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var u=tr(h),f=u.next();!f.done;f=u.next()){var v=f.value;try{Gp(v)}catch(g){o=o??[],g instanceof yh?o=ri(ri([],An(o)),An(g.errors)):o.push(g)}}}catch(g){n={error:g}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}if(o)throw new yh(o)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Gp(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&Td(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&Td(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),kg=un.EMPTY;function Ag(t){return t instanceof un||t&&"closed"in t&&Te(t.remove)&&Te(t.add)&&Te(t.unsubscribe)}function Gp(t){Te(t)?t():t.unsubscribe()}var Gf={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},e2={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=e2.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,ri([t,e],An(r))):setTimeout.apply(void 0,ri([t,e],An(r)))},clearTimeout:function(t){var e=e2.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Tg(t){e2.setTimeout(function(){throw t})}function Id(){}var fl=null;function Ul(t){if(Gf.useDeprecatedSynchronousErrorHandling){var e=!fl;if(e&&(fl={errorThrown:!1,error:null}),t(),e){var r=fl,n=r.errorThrown,i=r.error;if(fl=null,n)throw i}}else t()}var Kf=function(t){Wt(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Ag(r)&&r.add(n)):n.destination=L7,n}return e.create=function(r,n,i){return new Md(r,n,i)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(un),P7=Function.prototype.bind;function _h(t,e){return P7.call(t,e)}var R7=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){pl(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){pl(n)}else pl(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){pl(r)}},t}(),Md=function(t){Wt(e,t);function e(r,n,i){var o=t.call(this)||this,a;if(Te(r)||!r)a={next:r??void 0,error:n??void 0,complete:i??void 0};else{var s;o&&Gf.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return o.unsubscribe()},a={next:r.next&&_h(r.next,s),error:r.error&&_h(r.error,s),complete:r.complete&&_h(r.complete,s)}):a=r}return o.destination=new R7(a),o}return e}(Kf);function pl(t){Tg(t)}function H7(t){throw t}var L7={closed:!0,next:Id,error:H7,complete:Id},Wf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ji(t){return t}function O7(t){return t.length===0?ji:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var Pe=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,o=N7(e)?e:new Md(e,r,n);return Ul(function(){var a=i,s=a.operator,c=a.source;o.add(s?s.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Kp(r),new r(function(i,o){var a=new Md({next:function(s){try{e(s)}catch(c){o(c),a.unsubscribe()}},error:o,complete:i});n.subscribe(a)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Wf]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return O7(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Kp(e),new e(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},t.create=function(e){return new t(e)},t}();function Kp(t){var e;return(e=t??Gf.Promise)!==null&&e!==void 0?e:Promise}function D7(t){return t&&Te(t.next)&&Te(t.error)&&Te(t.complete)}function N7(t){return t&&t instanceof Kf||D7(t)&&Ag(t)}function V7(t){return Te(t==null?void 0:t.lift)}function mt(t){return function(e){if(V7(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Ze(t,e,r,n,i){return new F7(t,e,r,n,i)}var F7=function(t){Wt(e,t);function e(r,n,i,o,a,s){var c=t.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(l){try{n(l)}catch(d){r.error(d)}}:t.prototype._next,c._error=o?function(l){try{o(l)}catch(d){r.error(d)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(l){r.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(Kf),U7=E1(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Wn=function(t){Wt(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Wp(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new U7},e.prototype.next=function(r){var n=this;Ul(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=tr(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;Ul(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;Ul(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?kg:(this.currentObservers=null,s.push(r),new un(function(){n.currentObservers=null,Td(s,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,a=n.isStopped;i?r.error(o):a&&r.complete()},e.prototype.asObservable=function(){var r=new Pe;return r.source=this,r},e.create=function(r,n){return new Wp(r,n)},e}(Pe),Wp=function(t){Wt(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:kg},e}(Wn),C1=function(t){Wt(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,o=r._value;if(n)throw i;return this._throwIfClosed(),o},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Wn),Yf={now:function(){return(Yf.delegate||Date).now()},delegate:void 0},Ig=function(t){Wt(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=Yf);var o=t.call(this)||this;return o._bufferSize=r,o._windowTime=n,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,r),o._windowTime=Math.max(1,n),o}return e.prototype.next=function(r){var n=this,i=n.isStopped,o=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;i||(o.push(r),!a&&o.push(s.now()+c)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),c=0;c<s.length&&!r.closed;c+=o?1:2)r.next(s[c]);return this._checkFinalizedStatuses(r),n},e.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,i=r._timestampProvider,o=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var c=i.now(),l=0,d=1;d<o.length&&o[d]<=c;d+=2)l=d;l&&o.splice(0,l+1)}},e}(Wn),$7=function(t){Wt(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(un),Pd={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Pd.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,ri([t,e],An(r))):setInterval.apply(void 0,ri([t,e],An(r)))},clearInterval:function(t){var e=Pd.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},j7=function(t){Wt(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Pd.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Pd.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Td(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}($7),Yp=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=Yf.now,t}(),B7=function(t){Wt(e,t);function e(r,n){n===void 0&&(n=Yp.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Yp),Rd=new B7(j7),q7=Rd,Li=new Pe(function(t){return t.complete()});function Mg(t){return t&&Te(t.schedule)}function Qf(t){return t[t.length-1]}function Pg(t){return Te(Qf(t))?t.pop():void 0}function Xf(t){return Mg(Qf(t))?t.pop():void 0}function G7(t,e){return typeof Qf(t)=="number"?t.pop():e}var Jf=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Rg(t){return Te(t==null?void 0:t.then)}function Hg(t){return Te(t[Wf])}function Lg(t){return Symbol.asyncIterator&&Te(t==null?void 0:t[Symbol.asyncIterator])}function Og(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function K7(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Dg=K7();function Ng(t){return Te(t==null?void 0:t[Dg])}function Vg(t){return I7(this,arguments,function(){var r,n,i,o;return Sg(this,function(a){switch(a.label){case 0:r=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,wa(r.read())];case 3:return n=a.sent(),i=n.value,o=n.done,o?[4,wa(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,wa(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Fg(t){return Te(t==null?void 0:t.getReader)}function Hr(t){if(t instanceof Pe)return t;if(t!=null){if(Hg(t))return W7(t);if(Jf(t))return Y7(t);if(Rg(t))return Q7(t);if(Lg(t))return Ug(t);if(Ng(t))return X7(t);if(Fg(t))return J7(t)}throw Og(t)}function W7(t){return new Pe(function(e){var r=t[Wf]();if(Te(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Y7(t){return new Pe(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Q7(t){return new Pe(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,Tg)})}function X7(t){return new Pe(function(e){var r,n;try{for(var i=tr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}function Ug(t){return new Pe(function(e){Z7(t,e).catch(function(r){return e.error(r)})})}function J7(t){return Ug(Vg(t))}function Z7(t,e){var r,n,i,o;return x1(this,void 0,void 0,function(){var a,s;return Sg(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=M7(t),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Sn(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(o),!i)return o}function Hd(t,e){return e===void 0&&(e=0),mt(function(r,n){r.subscribe(Ze(n,function(i){return Sn(n,t,function(){return n.next(i)},e)},function(){return Sn(n,t,function(){return n.complete()},e)},function(i){return Sn(n,t,function(){return n.error(i)},e)}))})}function $g(t,e){return e===void 0&&(e=0),mt(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}function ey(t,e){return Hr(t).pipe($g(e),Hd(e))}function ty(t,e){return Hr(t).pipe($g(e),Hd(e))}function ry(t,e){return new Pe(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function ny(t,e){return new Pe(function(r){var n;return Sn(r,e,function(){n=t[Dg](),Sn(r,e,function(){var i,o,a;try{i=n.next(),o=i.value,a=i.done}catch(s){r.error(s);return}a?r.complete():r.next(o)},0,!0)}),function(){return Te(n==null?void 0:n.return)&&n.return()}})}function jg(t,e){if(!t)throw new Error("Iterable cannot be null");return new Pe(function(r){Sn(r,e,function(){var n=t[Symbol.asyncIterator]();Sn(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function iy(t,e){return jg(Vg(t),e)}function oy(t,e){if(t!=null){if(Hg(t))return ey(t,e);if(Jf(t))return ry(t,e);if(Rg(t))return ty(t,e);if(Lg(t))return jg(t,e);if(Ng(t))return ny(t,e);if(Fg(t))return iy(t,e)}throw Og(t)}function nr(t,e){return e?oy(t,e):Hr(t)}function Oi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xf(t);return nr(t,r)}function ay(t,e){var r=Te(t)?t:function(){return t},n=function(i){return i.error(r())};return new Pe(e?function(i){return e.schedule(n,0,i)}:n)}var z1=E1(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function po(t,e){var r=typeof e=="object";return new Promise(function(n,i){var o=!1,a;t.subscribe({next:function(s){a=s,o=!0},error:i,complete:function(){o?n(a):r?n(e.defaultValue):i(new z1)}})})}function on(t,e){var r=typeof e=="object";return new Promise(function(n,i){var o=new Md({next:function(a){n(a),o.unsubscribe()},error:i,complete:function(){r?n(e.defaultValue):i(new z1)}});t.subscribe(o)})}function Bg(t){return t instanceof Date&&!isNaN(t)}var sy=E1(function(t){return function(r){r===void 0&&(r=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function cy(t,e){var r=Bg(t)?{first:t}:typeof t=="number"?{each:t}:t,n=r.first,i=r.each,o=r.with,a=o===void 0?ly:o,s=r.scheduler,c=s===void 0?e??Rd:s,l=r.meta,d=l===void 0?null:l;if(n==null&&i==null)throw new TypeError("No timeout provided.");return mt(function(h,u){var f,v,g=null,x=0,m=function(p){v=Sn(u,c,function(){try{f.unsubscribe(),Hr(a({meta:d,lastValue:g,seen:x})).subscribe(u)}catch(y){u.error(y)}},p)};f=h.subscribe(Ze(u,function(p){v==null||v.unsubscribe(),x++,u.next(g=p),i>0&&m(i)},void 0,void 0,function(){v!=null&&v.closed||v==null||v.unsubscribe(),g=null})),!x&&m(n!=null?typeof n=="number"?n:+n-c.now():i)})}function ly(t){throw new sy(t)}function Ge(t,e){return mt(function(r,n){var i=0;r.subscribe(Ze(n,function(o){n.next(t.call(e,o,i++))}))})}var dy=Array.isArray;function hy(t,e){return dy(e)?t.apply(void 0,ri([],An(e))):t(e)}function qg(t){return Ge(function(e){return hy(t,e)})}var uy=Array.isArray,fy=Object.getPrototypeOf,py=Object.prototype,my=Object.keys;function vy(t){if(t.length===1){var e=t[0];if(uy(e))return{args:e,keys:null};if(gy(e)){var r=my(e);return{args:r.map(function(n){return e[n]}),keys:r}}}return{args:t,keys:null}}function gy(t){return t&&typeof t=="object"&&fy(t)===py}function yy(t,e){return t.reduce(function(r,n,i){return r[n]=e[i],r},{})}function _y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xf(t),n=Pg(t),i=vy(t),o=i.args,a=i.keys;if(o.length===0)return nr([],r);var s=new Pe(by(o,r,a?function(c){return yy(a,c)}:ji));return n?s.pipe(qg(n)):s}function by(t,e,r){return r===void 0&&(r=ji),function(n){Qp(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,c=function(d){Qp(e,function(){var h=nr(t[d],e),u=!1;h.subscribe(Ze(n,function(f){o[d]=f,u||(u=!0,s--),s||n.next(r(o.slice()))},function(){--a||n.complete()}))},n)},l=0;l<i;l++)c(l)},n)}}function Qp(t,e,r){t?Sn(r,t,e):e()}function Gg(t,e,r,n,i,o,a,s){var c=[],l=0,d=0,h=!1,u=function(){h&&!c.length&&!l&&e.complete()},f=function(g){return l<n?v(g):c.push(g)},v=function(g){o&&e.next(g),l++;var x=!1;Hr(r(g,d++)).subscribe(Ze(e,function(m){i==null||i(m),o?f(m):e.next(m)},function(){x=!0},void 0,function(){if(x)try{l--;for(var m=function(){var p=c.shift();a?Sn(e,a,function(){return v(p)}):v(p)};c.length&&l<n;)m();u()}catch(p){e.error(p)}}))};return t.subscribe(Ze(e,f,function(){h=!0,u()})),function(){s==null||s()}}function zo(t,e,r){return r===void 0&&(r=1/0),Te(e)?zo(function(n,i){return Ge(function(o,a){return e(n,o,i,a)})(Hr(t(n,i)))},r):(typeof e=="number"&&(r=e),mt(function(n,i){return Gg(n,i,t,r)}))}function wy(t){return t===void 0&&(t=1/0),zo(ji,t)}var xy=["addListener","removeListener"],Ey=["addEventListener","removeEventListener"],Cy=["on","off"];function t2(t,e,r,n){if(Te(r)&&(n=r,r=void 0),n)return t2(t,e,r).pipe(qg(n));var i=An(ky(t)?Ey.map(function(s){return function(c){return t[s](e,c,r)}}):zy(t)?xy.map(Xp(t,e)):Sy(t)?Cy.map(Xp(t,e)):[],2),o=i[0],a=i[1];if(!o&&Jf(t))return zo(function(s){return t2(s,e,r)})(Hr(t));if(!o)throw new TypeError("Invalid event target");return new Pe(function(s){var c=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return s.next(1<l.length?l:l[0])};return o(c),function(){return a(c)}})}function Xp(t,e){return function(r){return function(n){return t[r](e,n)}}}function zy(t){return Te(t.addListener)&&Te(t.removeListener)}function Sy(t){return Te(t.on)&&Te(t.off)}function ky(t){return Te(t.addEventListener)&&Te(t.removeEventListener)}function Ay(t,e,r){t===void 0&&(t=0),r===void 0&&(r=q7);var n=-1;return e!=null&&(Mg(e)?r=e:n=e),new Pe(function(i){var o=Bg(t)?+t-r.now():t;o<0&&(o=0);var a=0;return r.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function Kg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xf(t),n=G7(t,1/0),i=t;return i.length?i.length===1?Hr(i[0]):wy(n)(nr(i,r)):Li}function Kt(t,e){return mt(function(r,n){var i=0;r.subscribe(Ze(n,function(o){return t.call(e,o,i++)&&n.next(o)}))})}function Kr(t){return mt(function(e,r){var n=null,i=!1,o;n=e.subscribe(Ze(r,void 0,void 0,function(a){o=Hr(t(a,Kr(t)(e))),n?(n.unsubscribe(),n=null,o.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,o.subscribe(r))})}function Ty(t,e,r,n,i){return function(o,a){var s=r,c=e,l=0;o.subscribe(Ze(a,function(d){var h=l++;c=s?t(c,d,h):(s=!0,d),n&&a.next(c)},i&&function(){s&&a.next(c),a.complete()}))}}function Iy(t){return mt(function(e,r){var n=!1;e.subscribe(Ze(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}))})}function Wg(t,e){return e===void 0&&(e=ji),t=t??My,mt(function(r,n){var i,o=!0;r.subscribe(Ze(n,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,n.next(a))}))})}function My(t,e){return t===e}function Py(t){return t===void 0&&(t=Ry),mt(function(e,r){var n=!1;e.subscribe(Ze(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}function Ry(){return new z1}function Hy(t){return t<=0?function(){return Li}:mt(function(e,r){var n=[];e.subscribe(Ze(r,function(i){n.push(i),t<n.length&&n.shift()},function(){var i,o;try{for(var a=tr(n),s=a.next();!s.done;s=a.next()){var c=s.value;r.next(c)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}r.complete()},void 0,function(){n=null}))})}function Zf(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Kt(function(i,o){return t(i,o,n)}):ji,Hy(1),r?Iy(e):Py(function(){return new z1}))}}function Ly(t,e,r){return r===void 0&&(r=1/0),mt(function(n,i){var o=e;return Gg(n,i,function(a,s){return t(o,a,s)},r,function(a){o=a},!1,void 0,function(){return o=null})})}function r2(){return mt(function(t,e){var r,n=!1;t.subscribe(Ze(e,function(i){var o=r;r=i,n&&e.next([o,i]),n=!0}))})}function Yg(t,e){return mt(Ty(t,e,arguments.length>=2,!0))}function Bn(t,e){return mt(function(r,n){var i=null,o=0,a=!1,s=function(){return a&&!i&&n.complete()};r.subscribe(Ze(n,function(c){i==null||i.unsubscribe();var l=0,d=o++;Hr(t(c,d)).subscribe(i=Ze(n,function(h){return n.next(e?e(c,h,d,l++):h)},function(){i=null,s()}))},function(){a=!0,s()}))})}function Oy(t){return mt(function(e,r){Hr(t).subscribe(Ze(r,function(){return r.complete()},Id)),!r.closed&&e.subscribe(r)})}function Qg(t,e){return e===void 0&&(e=!1),mt(function(r,n){var i=0;r.subscribe(Ze(n,function(o){var a=t(o,i++);(a||e)&&n.next(o),!a&&n.complete()}))})}function Jp(t,e,r){var n=Te(t)||e||r?{next:t,error:e,complete:r}:t;return n?mt(function(i,o){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;i.subscribe(Ze(o,function(c){var l;(l=n.next)===null||l===void 0||l.call(n,c),o.next(c)},function(){var c;s=!1,(c=n.complete)===null||c===void 0||c.call(n),o.complete()},function(c){var l;s=!1,(l=n.error)===null||l===void 0||l.call(n,c),o.error(c)},function(){var c,l;s&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(l=n.finalize)===null||l===void 0||l.call(n)}))}):ji}function Xg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Pg(t);return mt(function(n,i){for(var o=t.length,a=new Array(o),s=t.map(function(){return!1}),c=!1,l=function(h){Hr(t[h]).subscribe(Ze(i,function(u){a[h]=u,!c&&!s[h]&&(s[h]=!0,(c=s.every(ji))&&(s=null))},Id))},d=0;d<o;d++)l(d);n.subscribe(Ze(i,function(h){if(c){var u=ri([h],An(a));i.next(r?r.apply(void 0,ri([],An(u))):u)}}))})}var mn=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class Dy extends Error{constructor(){super("It was too slow"),this.name="RequiredModuleTimeoutError"}}class Ny{constructor(e){this.logger=new Cg("ModulesConfigurator"),this._configs=[],this._afterConfiguration=[],this._afterInit=[],this._modules=new Set(e)}get modules(){return[...this._modules]}configure(...e){e.forEach(r=>this.addConfig(r))}addConfig(e){const{module:r,afterConfig:n,afterInit:i,configure:o}=e;this._modules.add(r),o&&this._configs.push((a,s)=>o(a[r.name],s)),n&&this._afterConfiguration.push(a=>n(a[r.name])),i&&this._afterInit.push(a=>i(a[r.name]))}onConfigured(e){this._afterConfiguration.push(e)}onInitialized(e){this._afterInit.push(e)}initialize(e){return mn(this,void 0,void 0,function*(){const r=yield this._configure(e),n=yield this._initialize(r,e);return yield this._postInitialize(n,e),Object.seal(Object.assign({},n,{dispose:()=>this.dispose(n)}))})}_configure(e){return mn(this,void 0,void 0,function*(){const r=yield this._createConfig(e);return yield Promise.all(this._configs.map(n=>Promise.resolve(n(r,e)))),yield this._postConfigure(r),r})}_createConfig(e){const{modules:r,logger:n,_afterConfiguration:i,_afterInit:o}=this,a=nr(r).pipe(zo(s=>mn(this,void 0,void 0,function*(){var c;n.debug(`🛠 creating configurator ${n.formatModuleName(s)}`);try{const l=yield(c=s.configure)===null||c===void 0?void 0:c.call(s,e);return n.debug(`🛠 created configurator for ${n.formatModuleName(s)}`,l),{[s.name]:l}}catch(l){throw n.error(`🛠 Failed to created configurator for ${n.formatModuleName(s)}`,l),l}})),Yg((s,c)=>Object.assign(s,c),{onAfterConfiguration(s){i.push(s)},onAfterInit(s){o.push(s)}}));return po(a)}_postConfigure(e){return mn(this,void 0,void 0,function*(){const{modules:r,logger:n,_afterConfiguration:i}=this;if(yield Promise.allSettled(r.filter(o=>!!o.postConfigure).map(o=>mn(this,void 0,void 0,function*(){var a;try{yield(a=o.postConfigure)===null||a===void 0?void 0:a.call(o,e),n.debug(`🏗📌 post configured ${n.formatModuleName(o)}`,o)}catch{n.warn(`🏗📌 post configure failed ${n.formatModuleName(o)}`)}}))),i.length)try{n.debug(`🏗📌 post configure hooks [${i.length}]`),yield Promise.allSettled(i.map(o=>Promise.resolve(o(e)))),n.debug("🏗📌 post configure hooks complete")}catch(o){n.warn("🏗📌 post configure hook failed",o)}})}_initialize(e,r){return mn(this,void 0,void 0,function*(){const{modules:n,logger:i}=this,o=n.map(d=>d.name),a=new C1({}),s=d=>o.includes(d),c=(d,h=60)=>{if(!o.includes(d))throw i.error(`🚀⌛️ Cannot not require ${i.formatModuleName(String(d))} since module is not defined!`),Error(`cannot not require [${String(d)}] since module is not defined!`);return a.value[d]?(i.debug(`🚀⌛️ ${i.formatModuleName(String(d))} is initiated, skipping queue`),Promise.resolve(a.value[d])):(i.debug(`🚀⌛️ Awaiting init ${i.formatModuleName(String(d))}, timeout ${h}s`),on(a.pipe(Kt(u=>!!u[d]),Ge(u=>u[d]),cy({each:h*1e3,with:()=>ay(()=>new Dy)}))))};nr(n).pipe(zo(d=>{const h=d.name;return i.debug(`🚀 initializing ${i.formatModuleName(d)}`),nr(Promise.resolve(d.initialize({ref:r,config:e[h],requireInstance:c,hasModule:s}))).pipe(Ge(u=>(i.debug(`🚀 initialized ${i.formatModuleName(d)}`),[h,u])))})).subscribe({next:([d,h])=>{a.next(Object.assign(a.value,{[d]:h}))},complete:()=>a.complete()});const l=yield po(a);return Object.seal(l),l})}_postInitialize(e,r){return mn(this,void 0,void 0,function*(){const{modules:n,logger:i,_afterInit:o}=this;if(yield Promise.allSettled(n.filter(a=>!!a.postInitialize).map(a=>mn(this,void 0,void 0,function*(){var s;try{i.debug(`🚀📌 post initializing moule ${i.formatModuleName(a)}`),yield(s=a.postInitialize)===null||s===void 0?void 0:s.call(a,{ref:r,modules:e,instance:e[a.name]}),i.debug(`🚀📌 post initialized moule ${i.formatModuleName(a)}`)}catch{i.warn(`🚀📌 post initialize failed moule ${i.formatModuleName(a)}`)}}))),o.length)try{i.debug(`🚀📌 post configure hooks [${o.length}]`),yield Promise.allSettled(o.map(a=>Promise.resolve(a(e)))),i.debug("🚀📌 post configure hooks complete")}catch(a){i.warn("🚀📌 post configure hook failed",a)}i.debug(`🎉 Modules initialized ${n.map(i.formatModuleName)}`,e),i.info("🟢 Modules initialized")})}dispose(e,r){return mn(this,void 0,void 0,function*(){const{modules:n}=this;yield Promise.allSettled(n.filter(i=>!!i.dispose).map(i=>mn(this,void 0,void 0,function*(){var o;yield(o=i.dispose)===null||o===void 0?void 0:o.call(i,{ref:r,modules:e,instance:e[i.name]})})))})}}var Do=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yi=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$l,jl,fs,Bl,ps,n2;class Vy{constructor(e,r){this.__type=e,$l.set(this,void 0),jl.set(this,void 0),fs.set(this,!1),Bl.set(this,void 0),ps.set(this,void 0),n2.set(this,Date.now()),Do(this,$l,r.detail,"f"),Do(this,jl,r.source,"f"),Do(this,Bl,!!r.cancelable,"f"),Do(this,ps,r.canBubble===void 0?!0:r.canBubble,"f")}get bubbles(){return Yi(this,ps,"f")&&!Yi(this,fs,"f")}get created(){return Yi(this,n2,"f")}get cancelable(){return Yi(this,Bl,"f")}get canceled(){return Yi(this,fs,"f")}get detail(){return Yi(this,$l,"f")}get source(){return Yi(this,jl,"f")}get type(){return this.__type}preventDefault(){this.cancelable&&Do(this,fs,!0,"f")}stopPropagation(){Do(this,ps,!1,"f")}}$l=new WeakMap,jl=new WeakMap,fs=new WeakMap,Bl=new WeakMap,ps=new WeakMap,n2=new WeakMap;var Fy=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class Uy{constructor({onDispatch:e,onBubble:r}){this.__onDispatch=e,this.__onBubble=r}dispatch(e,r){var n,i;return Fy(this,void 0,void 0,function*(){try{yield(n=this.__onDispatch)===null||n===void 0?void 0:n.call(this,e)}catch(a){throw a}const o=e;if(!o.dispatcher)o.dispatcher=this;else if(o.dispatcher===this)throw Error("loop detected");for(const a of r)e.cancelable?e.canceled||(yield Promise.resolve(a(e))):a(e);if(e.bubbles)try{yield(i=this.__onBubble)===null||i===void 0?void 0:i.call(this,e)}catch(a){throw a}})}}var Zp=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class $y extends Pe{get closed(){return this.__event$.closed}constructor(e){super(r=>{this.__event$.subscribe(r)}),this.__listeners=[],this.__event$=new Wn,this.__dispatcher=new Uy({onDispatch:e.onDispatch,onBubble:e.onBubble})}addEventListener(e,r){if(this.closed)throw Error("Cannot listen to events when provider is closed!");const n={type:e,handler:r};return this.__listeners.push(n),()=>{const i=this.__listeners.indexOf(n);0<=i&&this.__listeners.splice(i,1)}}dispatchEvent(e,r){return Zp(this,void 0,void 0,function*(){if(typeof e=="string"){if(!r)throw Error("invalid arguments, missing [FrameworkEventInit]");return this._dispatchEvent(new Vy(e,r))}else return this._dispatchEvent(e)})}_dispatchEvent(e){return Zp(this,void 0,void 0,function*(){if(this.closed)throw Error("Cannot dispatch events when provider is closed!");this.__event$.next(e);try{const r=this.__listeners.filter(n=>n.type===e.type).map(({handler:n})=>n);yield this.__dispatcher.dispatch(e,r)}catch(r){throw r}return e})}dispose(){this.__listeners=[],this.__event$.complete()}}var jy=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const By="event",qy={name:By,configure:t=>{const e={},r=t==null?void 0:t.event;return r&&(e.onBubble=n=>jy(void 0,void 0,void 0,function*(){yield r.dispatchEvent(n)})),e},initialize:({config:t})=>new $y(t),postInitialize({instance:t,modules:e}){t.dispatchEvent("onModulesLoaded",{detail:e,source:t})},dispose({instance:t}){t.dispose()}};class Jg{constructor(){this._operators={}}add(e,r){if(Object.keys(this._operators).includes(e))throw Error(`Operator [${e}] already defined`);return this.set(e,r)}set(e,r){return this._operators[e]=r,this}get(e){return this._operators[e]}process(e){return Object.values(this._operators).length?nr(Object.values(this._operators)).pipe(Ly((n,i)=>Promise.resolve(i(n)).then(o=>o??n),e,1),Zf()):Oi(e)}}const Gy=(t,e)=>r=>{const n=new Headers(r.headers);return n.append(t,e),Object.assign(Object.assign({},r),{headers:n})};class Zg extends Jg{setHeader(e,r){const n=Gy(e,r);return this.set("header-"+e,n)}}class Ky extends Jg{}class Wy{get clients(){return Object.assign({},this._clients)}constructor(e){this._clients={},this.defaultHttpRequestHandler=new Zg,this.defaultHttpClientCtor=e}hasClient(e){return Object.keys(this._clients).includes(e)}configureClient(e,r){const n=typeof r=="string"?o=>o.uri=String(r):r,i=typeof n=="function"?{onCreate:n}:n;return this._clients[e]=Object.assign(Object.assign({},this._clients[e]),i),this}}class Yy extends Error{constructor(e){super(e)}}const Qy=t=>new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t);class Xy{get defaultHttpRequestHandler(){return this.config.defaultHttpRequestHandler}constructor(e){this.config=e}hasClient(e){return Object.keys(this.config.clients).includes(e)}createClient(e){const r=this._resolveConfig(e),{baseUri:n,defaultScopes:i=[],onCreate:o,ctor:a=this.config.defaultHttpClientCtor,requestHandler:s=this.defaultHttpRequestHandler}=r,c={requestHandler:s},l=new a(n||"",c);return Object.assign(l,{defaultScopes:i}),o&&o(l),l}createCustomClient(e){return this.createClient(e)}_resolveConfig(e){if(typeof e=="string"){const r=this.config.clients[e];if(!r&&Qy(e))return{baseUri:e};if(!r)throw new Yy(`No registered http client for key [${e}]`);return r}return e}}function Jy(t,e){e===void 0&&(e={});var r=e.selector,n=zg(e,["selector"]);return new Pe(function(i){var o=new AbortController,a=o.signal,s=!0,c=n.signal;if(c)if(c.aborted)o.abort();else{var l=function(){a.aborted||o.abort()};c.addEventListener("abort",l),i.add(function(){return c.removeEventListener("abort",l)})}var d=lt(lt({},n),{signal:a}),h=function(u){s=!1,i.error(u)};return fetch(t,d).then(function(u){r?Hr(r(u)).subscribe(Ze(i,void 0,function(){s=!1,i.complete()},h)):(s=!1,i.next(u),i.complete())}).catch(h),function(){s&&o.abort()}})}const Zy=t=>{if(!t.ok)throw new Error("network response was not OK");if(t.status===204)return Promise.resolve();try{return t.json()}catch{throw Error("failed to parse response")}};class i2 extends Error{constructor(e,r,n){super(e,n),this.message=e,this.response=r}}var em=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};class e_{get request$(){return this._request$.asObservable()}get response$(){return this._response$.asObservable()}constructor(e,r){var n,i;this.uri=e,this._request$=new Wn,this._response$=new Wn,this._abort$=new Wn,this.requestHandler=(n=r==null?void 0:r.requestHandler)!==null&&n!==void 0?n:new Zg,this.responseHandler=(i=r==null?void 0:r.responseHandler)!==null&&i!==void 0?i:new Ky,this._init()}_init(){}fetch$(e,r){return this._fetch$(e,r)}fetch(e,r){return on(this.fetch$(e,r))}fetchAsync(e,r){return this.fetch(e,r)}json$(e,r){var n;const i=typeof(r==null?void 0:r.body)=="object"?JSON.stringify(r==null?void 0:r.body):r==null?void 0:r.body,o=(n=r==null?void 0:r.selector)!==null&&n!==void 0?n:Zy,a=new Headers(r==null?void 0:r.headers);return a.append("Content-Type","application/json"),this.fetch$(e,Object.assign(Object.assign({},r),{body:i,selector:o,headers:a}))}json(e,r){return on(this.json$(e,r))}jsonAsync(e,r){return this.json(e,r)}execute(e,r,n){return this[e](r,n)}abort(){this._abort$.next()}_fetch$(e,r){const n=r||{},{selector:i}=n,o=em(n,["selector"]);return Oi(Object.assign(Object.assign({},o),{uri:this._resolveUrl(e)})).pipe(Bn(s=>this._prepareRequest(s)),Jp(s=>this._request$.next(s)),Bn(s=>{var{uri:c,path:l}=s,d=em(s,["uri","path"]);return Jy(c,d)}),Bn(s=>this._prepareResponse(s)),Jp(s=>this._response$.next(s)),Bn(s=>{if(i)try{return i(s)}catch(c){throw new i2("failed to execute response selector",s,{cause:c})}return Oi(s)}),Oy(this._abort$))}_prepareRequest(e){return this.requestHandler.process(e)}_prepareResponse(e){return this.responseHandler.process(e)}_resolveUrl(e){const r=this.uri||window.location.origin;return new URL(e,r).href}}class t_ extends e_{constructor(){super(...arguments),this.defaultScopes=[]}fetch$(e,r){const n=Object.assign(r||{},{scopes:this.defaultScopes.concat((r==null?void 0:r.scopes)||[])});return super._fetch$(e,n)}}var tm=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const e0={name:"http",configure:()=>new Wy(t_),initialize:({config:t,hasModule:e,requireInstance:r})=>tm(void 0,void 0,void 0,function*(){const n=new Xy(t);if(e("auth")){const i=yield r("auth");n.defaultHttpRequestHandler.set("MSAL",o=>tm(void 0,void 0,void 0,function*(){const{scopes:a=[]}=o;if(a.length){const s=yield i.acquireToken({scopes:a});if(s){const c=new Headers(o.headers);return c.set("Authorization",`Bearer ${s.accessToken}`),Object.assign(Object.assign({},o),{headers:c})}}}))}return n})},r_=t=>({module:e0,configure:t}),e3=(t,e)=>({module:e0,configure:r=>{r.configureClient(t,e)}}),bh="default";class n_{constructor(){this._configs={},this.requiresAuth=!0}get defaultConfig(){return this._configs[bh]}getClientConfig(e){return this._configs[e]}configureClient(e,r){return this._configs[e]=r,this}configureDefault(e){if(this._configs[bh])throw Error("Default AuthClient already provided");this.configureClient(bh,e)}}var o2=function(t,e){return o2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},o2(t,e)};function It(t,e){o2(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var K=function(){return K=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},K.apply(this,arguments)};function rm(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function S(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})}function k(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(d){return c([l,d])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(d){l=[6,d],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function i_(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function t0(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i_(arguments[e]));return t}var a2=function(t,e){return a2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},a2(t,e)};function br(t,e){a2(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Re=function(){return Re=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Re.apply(this,arguments)};function Z(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})}function ee(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(d){return c([l,d])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(d){l=[6,d],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function S1(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var _={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Ic=[_.OPENID_SCOPE,_.PROFILE_SCOPE,_.OFFLINE_ACCESS_SCOPE],nm=S1(Ic,[_.EMAIL_SCOPE]),ln;(function(t){t.CONTENT_TYPE="Content-Type",t.RETRY_AFTER="Retry-After",t.CCS_HEADER="X-AnchorMailbox",t.WWWAuthenticate="WWW-Authenticate",t.AuthenticationInfo="Authentication-Info",t.X_MS_REQUEST_ID="x-ms-request-id"})(ln||(ln={}));var dt;(function(t){t.ID_TOKEN="idtoken",t.CLIENT_INFO="client.info",t.ADAL_ID_TOKEN="adal.idtoken",t.ERROR="error",t.ERROR_DESC="error.description",t.ACTIVE_ACCOUNT="active-account",t.ACTIVE_ACCOUNT_FILTERS="active-account-filters"})(dt||(dt={}));var Ld;(function(t){t.COMMON="common",t.ORGANIZATIONS="organizations",t.CONSUMERS="consumers"})(Ld||(Ld={}));var ne;(function(t){t.CLIENT_ID="client_id",t.REDIRECT_URI="redirect_uri",t.RESPONSE_TYPE="response_type",t.RESPONSE_MODE="response_mode",t.GRANT_TYPE="grant_type",t.CLAIMS="claims",t.SCOPE="scope",t.ERROR="error",t.ERROR_DESCRIPTION="error_description",t.ACCESS_TOKEN="access_token",t.ID_TOKEN="id_token",t.REFRESH_TOKEN="refresh_token",t.EXPIRES_IN="expires_in",t.STATE="state",t.NONCE="nonce",t.PROMPT="prompt",t.SESSION_STATE="session_state",t.CLIENT_INFO="client_info",t.CODE="code",t.CODE_CHALLENGE="code_challenge",t.CODE_CHALLENGE_METHOD="code_challenge_method",t.CODE_VERIFIER="code_verifier",t.CLIENT_REQUEST_ID="client-request-id",t.X_CLIENT_SKU="x-client-SKU",t.X_CLIENT_VER="x-client-VER",t.X_CLIENT_OS="x-client-OS",t.X_CLIENT_CPU="x-client-CPU",t.X_CLIENT_CURR_TELEM="x-client-current-telemetry",t.X_CLIENT_LAST_TELEM="x-client-last-telemetry",t.X_MS_LIB_CAPABILITY="x-ms-lib-capability",t.X_APP_NAME="x-app-name",t.X_APP_VER="x-app-ver",t.POST_LOGOUT_URI="post_logout_redirect_uri",t.ID_TOKEN_HINT="id_token_hint",t.DEVICE_CODE="device_code",t.CLIENT_SECRET="client_secret",t.CLIENT_ASSERTION="client_assertion",t.CLIENT_ASSERTION_TYPE="client_assertion_type",t.TOKEN_TYPE="token_type",t.REQ_CNF="req_cnf",t.OBO_ASSERTION="assertion",t.REQUESTED_TOKEN_USE="requested_token_use",t.ON_BEHALF_OF="on_behalf_of",t.FOCI="foci",t.CCS_HEADER="X-AnchorMailbox",t.RETURN_SPA_CODE="return_spa_code",t.NATIVE_BROKER="nativebroker",t.LOGOUT_HINT="logout_hint"})(ne||(ne={}));var sa;(function(t){t.ACCESS_TOKEN="access_token",t.XMS_CC="xms_cc"})(sa||(sa={}));var jt={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Vs;(function(t){t.ACCOUNT="account",t.SID="sid",t.LOGIN_HINT="login_hint",t.ID_TOKEN="id_token",t.DOMAIN_HINT="domain_hint",t.ORGANIZATIONS="organizations",t.CONSUMERS="consumers",t.ACCOUNT_ID="accountIdentifier",t.HOMEACCOUNT_ID="homeAccountIdentifier"})(Vs||(Vs={}));var im={PLAIN:"plain",S256:"S256"},Od;(function(t){t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post"})(Od||(Od={}));var Dd;(function(t){t.IMPLICIT_GRANT="implicit",t.AUTHORIZATION_CODE_GRANT="authorization_code",t.CLIENT_CREDENTIALS_GRANT="client_credentials",t.RESOURCE_OWNER_PASSWORD_GRANT="password",t.REFRESH_TOKEN_GRANT="refresh_token",t.DEVICE_CODE_GRANT="device_code",t.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer"})(Dd||(Dd={}));var Vn;(function(t){t.MSSTS_ACCOUNT_TYPE="MSSTS",t.ADFS_ACCOUNT_TYPE="ADFS",t.MSAV1_ACCOUNT_TYPE="MSA",t.GENERIC_ACCOUNT_TYPE="Generic"})(Vn||(Vn={}));var Tr;(function(t){t.CACHE_KEY_SEPARATOR="-",t.CLIENT_INFO_SEPARATOR="."})(Tr||(Tr={}));var de;(function(t){t.ID_TOKEN="IdToken",t.ACCESS_TOKEN="AccessToken",t.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",t.REFRESH_TOKEN="RefreshToken"})(de||(de={}));var mo;(function(t){t.ACCOUNT="Account",t.CREDENTIAL="Credential",t.ID_TOKEN="IdToken",t.ACCESS_TOKEN="AccessToken",t.REFRESH_TOKEN="RefreshToken",t.APP_METADATA="AppMetadata",t.TEMPORARY="TempCache",t.TELEMETRY="Telemetry",t.UNDEFINED="Undefined",t.THROTTLING="Throttling"})(mo||(mo={}));var qn;(function(t){t[t.ADFS=1001]="ADFS",t[t.MSA=1002]="MSA",t[t.MSSTS=1003]="MSSTS",t[t.GENERIC=1004]="GENERIC",t[t.ACCESS_TOKEN=2001]="ACCESS_TOKEN",t[t.REFRESH_TOKEN=2002]="REFRESH_TOKEN",t[t.ID_TOKEN=2003]="ID_TOKEN",t[t.APP_METADATA=3001]="APP_METADATA",t[t.UNDEFINED=9999]="UNDEFINED"})(qn||(qn={}));var s2="appmetadata",o_="client_info",Nd="1",Fs={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Or;(function(t){t.CONFIG="config",t.CACHE="cache",t.NETWORK="network",t.HARDCODED_VALUES="hardcoded_values"})(Or||(Or={}));var wt={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},Se;(function(t){t.BEARER="Bearer",t.POP="pop",t.SSH="ssh-cert"})(Se||(Se={}));var Us={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},om={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},Vd;(function(t){t.username="username",t.password="password"})(Vd||(Vd={}));var ca;(function(t){t[t.httpSuccess=200]="httpSuccess",t[t.httpBadRequest=400]="httpBadRequest"})(ca||(ca={}));var vi;(function(t){t.FAILED_AUTO_DETECTION="1",t.INTERNAL_CACHE="2",t.ENVIRONMENT_VARIABLE="3",t.IMDS="4"})(vi||(vi={}));var no;(function(t){t.CONFIGURED_MATCHES_DETECTED="1",t.CONFIGURED_NO_AUTO_DETECTION="2",t.CONFIGURED_NOT_DETECTED="3",t.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",t.AUTO_DETECTION_REQUESTED_FAILED="5"})(no||(no={}));var lo;(function(t){t.NO_CACHE_HIT="0",t.FORCE_REFRESH="1",t.NO_CACHED_ACCESS_TOKEN="2",t.CACHED_ACCESS_TOKEN_EXPIRED="3",t.REFRESH_CACHED_ACCESS_TOKEN="4"})(lo||(lo={}));var c2;(function(t){t.Jwt="JWT",t.Jwk="JWK"})(c2||(c2={}));var ml={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},postRequestFailed:{code:"post_request_failed",desc:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."}},W=function(t){br(e,t);function e(r,n,i){var o=this,a=n?r+": "+n:r;return o=t.call(this,a)||this,Object.setPrototypeOf(o,e.prototype),o.errorCode=r||_.EMPTY_STRING,o.errorMessage=n||_.EMPTY_STRING,o.subError=i||_.EMPTY_STRING,o.name="AuthError",o}return e.prototype.setCorrelationId=function(r){this.correlationId=r},e.createUnexpectedError=function(r){return new e(ml.unexpectedError.code,ml.unexpectedError.desc+": "+r)},e.createPostRequestFailed=function(r){return new e(ml.postRequestFailed.code,ml.postRequestFailed.desc+": "+r)},e}(Error);var Fd={createNewGuid:function(){var t="Crypto interface - createNewGuid() has not been implemented";throw W.createUnexpectedError(t)},base64Decode:function(){var t="Crypto interface - base64Decode() has not been implemented";throw W.createUnexpectedError(t)},base64Encode:function(){var t="Crypto interface - base64Encode() has not been implemented";throw W.createUnexpectedError(t)},generatePkceCodes:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - generatePkceCodes() has not been implemented",W.createUnexpectedError(t)})})},getPublicKeyThumbprint:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - getPublicKeyThumbprint() has not been implemented",W.createUnexpectedError(t)})})},removeTokenBindingKey:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - removeTokenBindingKey() has not been implemented",W.createUnexpectedError(t)})})},clearKeystore:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - clearKeystore() has not been implemented",W.createUnexpectedError(t)})})},signJwt:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - signJwt() has not been implemented",W.createUnexpectedError(t)})})},hashString:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - hashString() has not been implemented",W.createUnexpectedError(t)})})}};var R={clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoEmptyError:{code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},tokenParsingError:{code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},nullOrEmptyToken:{code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},networkError:{code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},unableToGetOpenidConfigError:{code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hashNotDeserialized:{code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},blankGuidGenerated:{code:"blank_guid_generated",desc:"The guid generated was blank. Please review the trace to determine the root cause."},invalidStateError:{code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},stateMismatchError:{code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},stateNotFoundError:{code:"state_not_found",desc:"State not found"},nonceMismatchError:{code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},nonceNotFoundError:{code:"nonce_not_found",desc:"nonce not found"},authTimeNotFoundError:{code:"auth_time_not_found",desc:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information."},maxAgeTranspiredError:{code:"max_age_transpired",desc:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication."},noTokensFoundError:{code:"no_tokens_found",desc:"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."},multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},multipleMatchingAccounts:{code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},multipleMatchingAppMetadata:{code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},tokenRequestCannotBeMade:{code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},appendEmptyScopeError:{code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},removeEmptyScopeError:{code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},appendScopeSetError:{code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},emptyInputScopeSetError:{code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},DeviceCodePollingCancelled:{code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},DeviceCodeExpired:{code:"device_code_expired",desc:"Device code is expired."},DeviceCodeUnknownError:{code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},NoAccountInSilentRequest:{code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},invalidCacheRecord:{code:"invalid_cache_record",desc:"Cache record object was null or undefined."},invalidCacheEnvironment:{code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},noAccountFound:{code:"no_account_found",desc:"No account found in cache for given key."},CachePluginError:{code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},noCryptoObj:{code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},unexpectedAccountType:{code:"unexpected_account_type",desc:"Unexpected account type."},unexpectedCredentialType:{code:"unexpected_credential_type",desc:"Unexpected credential type."},invalidAssertion:{code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},invalidClientCredential:{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"},tokenRefreshRequired:{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."},userTimeoutReached:{code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},tokenClaimsRequired:{code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},noAuthorizationCodeFromServer:{code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},noAzureRegionDetected:{code:"no_azure_region_detected",desc:"No azure region was detected and no fallback was made available"},accessTokenEntityNullError:{code:"access_token_entity_null",desc:"Access token entity is null, please check logs and cache to ensure a valid access token is present."},bindingKeyNotRemovedError:{code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},logoutNotSupported:{code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},keyIdMissing:{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."}},j=function(t){br(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="ClientAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createClientInfoDecodingError=function(r){return new e(R.clientInfoDecodingError.code,R.clientInfoDecodingError.desc+" Failed with error: "+r)},e.createClientInfoEmptyError=function(){return new e(R.clientInfoEmptyError.code,""+R.clientInfoEmptyError.desc)},e.createTokenParsingError=function(r){return new e(R.tokenParsingError.code,R.tokenParsingError.desc+" Failed with error: "+r)},e.createTokenNullOrEmptyError=function(r){return new e(R.nullOrEmptyToken.code,R.nullOrEmptyToken.desc+" Raw Token Value: "+r)},e.createEndpointDiscoveryIncompleteError=function(r){return new e(R.endpointResolutionError.code,R.endpointResolutionError.desc+" Detail: "+r)},e.createNetworkError=function(r,n){return new e(R.networkError.code,R.networkError.desc+" | Fetch client threw: "+n+" | Attempted to reach: "+r.split("?")[0])},e.createUnableToGetOpenidConfigError=function(r){return new e(R.unableToGetOpenidConfigError.code,R.unableToGetOpenidConfigError.desc+" Attempted to retrieve endpoints from: "+r)},e.createHashNotDeserializedError=function(r){return new e(R.hashNotDeserialized.code,R.hashNotDeserialized.desc+" Given Object: "+r)},e.createInvalidStateError=function(r,n){return new e(R.invalidStateError.code,R.invalidStateError.desc+" Invalid State: "+r+", Root Err: "+n)},e.createStateMismatchError=function(){return new e(R.stateMismatchError.code,R.stateMismatchError.desc)},e.createStateNotFoundError=function(r){return new e(R.stateNotFoundError.code,R.stateNotFoundError.desc+": "+r)},e.createNonceMismatchError=function(){return new e(R.nonceMismatchError.code,R.nonceMismatchError.desc)},e.createAuthTimeNotFoundError=function(){return new e(R.authTimeNotFoundError.code,R.authTimeNotFoundError.desc)},e.createMaxAgeTranspiredError=function(){return new e(R.maxAgeTranspiredError.code,R.maxAgeTranspiredError.desc)},e.createNonceNotFoundError=function(r){return new e(R.nonceNotFoundError.code,R.nonceNotFoundError.desc+": "+r)},e.createMultipleMatchingTokensInCacheError=function(){return new e(R.multipleMatchingTokens.code,R.multipleMatchingTokens.desc+".")},e.createMultipleMatchingAccountsInCacheError=function(){return new e(R.multipleMatchingAccounts.code,R.multipleMatchingAccounts.desc)},e.createMultipleMatchingAppMetadataInCacheError=function(){return new e(R.multipleMatchingAppMetadata.code,R.multipleMatchingAppMetadata.desc)},e.createTokenRequestCannotBeMadeError=function(){return new e(R.tokenRequestCannotBeMade.code,R.tokenRequestCannotBeMade.desc)},e.createAppendEmptyScopeToSetError=function(r){return new e(R.appendEmptyScopeError.code,R.appendEmptyScopeError.desc+" Given Scope: "+r)},e.createRemoveEmptyScopeFromSetError=function(r){return new e(R.removeEmptyScopeError.code,R.removeEmptyScopeError.desc+" Given Scope: "+r)},e.createAppendScopeSetError=function(r){return new e(R.appendScopeSetError.code,R.appendScopeSetError.desc+" Detail Error: "+r)},e.createEmptyInputScopeSetError=function(){return new e(R.emptyInputScopeSetError.code,""+R.emptyInputScopeSetError.desc)},e.createDeviceCodeCancelledError=function(){return new e(R.DeviceCodePollingCancelled.code,""+R.DeviceCodePollingCancelled.desc)},e.createDeviceCodeExpiredError=function(){return new e(R.DeviceCodeExpired.code,""+R.DeviceCodeExpired.desc)},e.createDeviceCodeUnknownError=function(){return new e(R.DeviceCodeUnknownError.code,""+R.DeviceCodeUnknownError.desc)},e.createNoAccountInSilentRequestError=function(){return new e(R.NoAccountInSilentRequest.code,""+R.NoAccountInSilentRequest.desc)},e.createNullOrUndefinedCacheRecord=function(){return new e(R.invalidCacheRecord.code,R.invalidCacheRecord.desc)},e.createInvalidCacheEnvironmentError=function(){return new e(R.invalidCacheEnvironment.code,R.invalidCacheEnvironment.desc)},e.createNoAccountFoundError=function(){return new e(R.noAccountFound.code,R.noAccountFound.desc)},e.createCachePluginError=function(){return new e(R.CachePluginError.code,""+R.CachePluginError.desc)},e.createNoCryptoObjectError=function(r){return new e(R.noCryptoObj.code,""+R.noCryptoObj.desc+r)},e.createInvalidCacheTypeError=function(){return new e(R.invalidCacheType.code,""+R.invalidCacheType.desc)},e.createUnexpectedAccountTypeError=function(){return new e(R.unexpectedAccountType.code,""+R.unexpectedAccountType.desc)},e.createUnexpectedCredentialTypeError=function(){return new e(R.unexpectedCredentialType.code,""+R.unexpectedCredentialType.desc)},e.createInvalidAssertionError=function(){return new e(R.invalidAssertion.code,""+R.invalidAssertion.desc)},e.createInvalidCredentialError=function(){return new e(R.invalidClientCredential.code,""+R.invalidClientCredential.desc)},e.createRefreshRequiredError=function(){return new e(R.tokenRefreshRequired.code,R.tokenRefreshRequired.desc)},e.createUserTimeoutReachedError=function(){return new e(R.userTimeoutReached.code,R.userTimeoutReached.desc)},e.createTokenClaimsRequiredError=function(){return new e(R.tokenClaimsRequired.code,R.tokenClaimsRequired.desc)},e.createNoAuthCodeInServerResponseError=function(){return new e(R.noAuthorizationCodeFromServer.code,R.noAuthorizationCodeFromServer.desc)},e.createBindingKeyNotRemovedError=function(){return new e(R.bindingKeyNotRemovedError.code,R.bindingKeyNotRemovedError.desc)},e.createLogoutNotSupportedError=function(){return new e(R.logoutNotSupported.code,R.logoutNotSupported.desc)},e.createKeyIdMissingError=function(){return new e(R.keyIdMissing.code,R.keyIdMissing.desc)},e}(W);var V=function(){function t(){}return t.decodeAuthToken=function(e){if(t.isEmpty(e))throw j.createTokenNullOrEmptyError(e);var r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=r.exec(e);if(!n||n.length<4)throw j.createTokenParsingError("Given token is malformed: "+JSON.stringify(e));var i={header:n[1],JWSPayload:n[2],JWSSig:n[3]};return i},t.isEmpty=function(e){return typeof e>"u"||!e||e.length===0},t.isEmptyObj=function(e){if(e&&!t.isEmpty(e))try{var r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0},t.startsWith=function(e,r){return e.indexOf(r)===0},t.endsWith=function(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length},t.queryStringToObject=function(e){var r={},n=e.split("&"),i=function(o){return decodeURIComponent(o.replace(/\+/g," "))};return n.forEach(function(o){if(o.trim()){var a=o.split(/=(.+)/g,2),s=a[0],c=a[1];s&&c&&(r[i(s)]=i(c))}}),r},t.trimArrayEntries=function(e){return e.map(function(r){return r.trim()})},t.removeEmptyStringsFromArray=function(e){return e.filter(function(r){return!t.isEmpty(r)})},t.jsonParseHelper=function(e){try{return JSON.parse(e)}catch{return null}},t.matchPattern=function(e,r){var n=new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?"));return n.test(r)},t}();var tt;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(tt||(tt={}));var r0=function(){function t(e,r,n){this.level=tt.Info;var i=function(){};this.localCallback=e.loggerCallback||i,this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level=typeof e.logLevel=="number"?e.logLevel:tt.Info,this.correlationId=e.correlationId||_.EMPTY_STRING,this.packageName=r||_.EMPTY_STRING,this.packageVersion=n||_.EMPTY_STRING}return t.prototype.clone=function(e,r,n){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:n||this.correlationId},e,r)},t.prototype.logMessage=function(e,r){if(!(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)){var n=new Date().toUTCString(),i;V.isEmpty(r.correlationId)?V.isEmpty(this.correlationId)?i="["+n+"]":i="["+n+"] : ["+this.correlationId+"]":i="["+n+"] : ["+r.correlationId+"]";var o=i+" : "+this.packageName+"@"+this.packageVersion+" : "+tt[r.logLevel]+" - "+e;this.executeCallback(r.logLevel,o,r.containsPii||!1)}},t.prototype.executeCallback=function(e,r,n){this.localCallback&&this.localCallback(e,r,n)},t.prototype.error=function(e,r){this.logMessage(e,{logLevel:tt.Error,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.errorPii=function(e,r){this.logMessage(e,{logLevel:tt.Error,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.warning=function(e,r){this.logMessage(e,{logLevel:tt.Warning,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.warningPii=function(e,r){this.logMessage(e,{logLevel:tt.Warning,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.info=function(e,r){this.logMessage(e,{logLevel:tt.Info,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.infoPii=function(e,r){this.logMessage(e,{logLevel:tt.Info,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.verbose=function(e,r){this.logMessage(e,{logLevel:tt.Verbose,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.verbosePii=function(e,r){this.logMessage(e,{logLevel:tt.Verbose,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.trace=function(e,r){this.logMessage(e,{logLevel:tt.Trace,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.tracePii=function(e,r){this.logMessage(e,{logLevel:tt.Trace,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},t}();var a_="@azure/msal-common",t3="9.0.1";var hc;(function(t){t[t.None=0]="None",t.AzurePublic="https://login.microsoftonline.com",t.AzurePpe="https://login.windows-ppe.net",t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureUsGovernment="https://login.microsoftonline.us"})(hc||(hc={}));var uc=function(){function t(){}return t.prototype.generateAccountId=function(){return t.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},t.prototype.generateCredentialId=function(){return t.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},t.prototype.generateTarget=function(){return t.generateTargetForCacheKey(this.target)},t.prototype.generateCredentialKey=function(){return t.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},t.prototype.generateType=function(){switch(this.credentialType){case de.ID_TOKEN:return qn.ID_TOKEN;case de.ACCESS_TOKEN:case de.ACCESS_TOKEN_WITH_AUTH_SCHEME:return qn.ACCESS_TOKEN;case de.REFRESH_TOKEN:return qn.REFRESH_TOKEN;default:throw j.createUnexpectedCredentialTypeError()}},t.getCredentialType=function(e){return e.indexOf(de.ACCESS_TOKEN.toLowerCase())!==-1?e.indexOf(de.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())!==-1?de.ACCESS_TOKEN_WITH_AUTH_SCHEME:de.ACCESS_TOKEN:e.indexOf(de.ID_TOKEN.toLowerCase())!==-1?de.ID_TOKEN:e.indexOf(de.REFRESH_TOKEN.toLowerCase())!==-1?de.REFRESH_TOKEN:_.NOT_DEFINED},t.generateCredentialCacheKey=function(e,r,n,i,o,a,s,c,l){var d=[this.generateAccountIdForCacheKey(e,r),this.generateCredentialIdForCacheKey(n,i,o,s),this.generateTargetForCacheKey(a),this.generateClaimsHashForCacheKey(l),this.generateSchemeForCacheKey(c)];return d.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateAccountIdForCacheKey=function(e,r){var n=[e,r];return n.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateCredentialIdForCacheKey=function(e,r,n,i){var o=e===de.REFRESH_TOKEN&&i||r,a=[e,o,n||_.EMPTY_STRING];return a.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateTargetForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},t.generateClaimsHashForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},t.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==Se.BEARER.toLowerCase()?e.toLowerCase():_.EMPTY_STRING},t}();var re={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{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"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{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."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{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."},missingNonceAuthenticationHeader:{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."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"}},Fe=function(t){br(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="ClientConfigurationError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(re.redirectUriNotSet.code,re.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(re.postLogoutUriNotSet.code,re.postLogoutUriNotSet.desc)},e.createClaimsRequestParsingError=function(r){return new e(re.claimsRequestParsingError.code,re.claimsRequestParsingError.desc+" Given value: "+r)},e.createInsecureAuthorityUriError=function(r){return new e(re.authorityUriInsecure.code,re.authorityUriInsecure.desc+" Given URI: "+r)},e.createUrlParseError=function(r){return new e(re.urlParseError.code,re.urlParseError.desc+" Given Error: "+r)},e.createUrlEmptyError=function(){return new e(re.urlEmptyError.code,re.urlEmptyError.desc)},e.createEmptyScopesArrayError=function(){return new e(re.emptyScopesError.code,""+re.emptyScopesError.desc)},e.createClientIdSingleScopeError=function(r){return new e(re.clientIdSingleScopeError.code,re.clientIdSingleScopeError.desc+" Given Scopes: "+r)},e.createInvalidPromptError=function(r){return new e(re.invalidPrompt.code,re.invalidPrompt.desc+" Given value: "+r)},e.createInvalidClaimsRequestError=function(){return new e(re.invalidClaimsRequest.code,re.invalidClaimsRequest.desc)},e.createEmptyLogoutRequestError=function(){return new e(re.logoutRequestEmptyError.code,re.logoutRequestEmptyError.desc)},e.createEmptyTokenRequestError=function(){return new e(re.tokenRequestEmptyError.code,re.tokenRequestEmptyError.desc)},e.createInvalidCodeChallengeMethodError=function(){return new e(re.invalidCodeChallengeMethod.code,re.invalidCodeChallengeMethod.desc)},e.createInvalidCodeChallengeParamsError=function(){return new e(re.invalidCodeChallengeParams.code,re.invalidCodeChallengeParams.desc)},e.createInvalidCloudDiscoveryMetadataError=function(){return new e(re.invalidCloudDiscoveryMetadata.code,re.invalidCloudDiscoveryMetadata.desc)},e.createInvalidAuthorityMetadataError=function(){return new e(re.invalidAuthorityMetadata.code,re.invalidAuthorityMetadata.desc)},e.createUntrustedAuthorityError=function(){return new e(re.untrustedAuthority.code,re.untrustedAuthority.desc)},e.createInvalidAzureCloudInstanceError=function(){return new e(re.invalidAzureCloudInstance.code,re.invalidAzureCloudInstance.desc)},e.createMissingSshJwkError=function(){return new e(re.missingSshJwk.code,re.missingSshJwk.desc)},e.createMissingSshKidError=function(){return new e(re.missingSshKid.code,re.missingSshKid.desc)},e.createMissingNonceAuthenticationHeadersError=function(){return new e(re.missingNonceAuthenticationHeader.code,re.missingNonceAuthenticationHeader.desc)},e.createInvalidAuthenticationHeaderError=function(r,n){return new e(re.invalidAuthenticationHeader.code,re.invalidAuthenticationHeader.desc+". Invalid header: "+r+". Details: "+n)},e}(j);var er=function(){function t(e){var r=this,n=e?V.trimArrayEntries(S1(e)):[],i=n?V.removeEmptyStringsFromArray(n):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(function(o){return r.scopes.add(o)})}return t.fromString=function(e){var r=e||_.EMPTY_STRING,n=r.split(" ");return new t(n)},t.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw Fe.createEmptyScopesArrayError()},t.prototype.containsScope=function(e){var r=this.printScopesLowerCase().split(" "),n=new t(r);return V.isEmpty(e)?!1:n.scopes.has(e.toLowerCase())},t.prototype.containsScopeSet=function(e){var r=this;return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(function(n){return r.containsScope(n)})},t.prototype.containsOnlyOIDCScopes=function(){var e=this,r=0;return nm.forEach(function(n){e.containsScope(n)&&(r+=1)}),this.scopes.size===r},t.prototype.appendScope=function(e){V.isEmpty(e)||this.scopes.add(e.trim())},t.prototype.appendScopes=function(e){var r=this;try{e.forEach(function(n){return r.appendScope(n)})}catch(n){throw j.createAppendScopeSetError(n)}},t.prototype.removeScope=function(e){if(V.isEmpty(e))throw j.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},t.prototype.removeOIDCScopes=function(){var e=this;nm.forEach(function(r){e.scopes.delete(r)})},t.prototype.unionScopeSets=function(e){if(!e)throw j.createEmptyInputScopeSetError();var r=new Set;return e.scopes.forEach(function(n){return r.add(n.toLowerCase())}),this.scopes.forEach(function(n){return r.add(n.toLowerCase())}),r},t.prototype.intersectingScopeSets=function(e){if(!e)throw j.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var r=this.unionScopeSets(e),n=e.getScopeCount(),i=this.getScopeCount(),o=r.size;return o<i+n},t.prototype.getScopeCount=function(){return this.scopes.size},t.prototype.asArray=function(){var e=[];return this.scopes.forEach(function(r){return e.push(r)}),e},t.prototype.printScopes=function(){if(this.scopes){var e=this.asArray();return e.join(" ")}return _.EMPTY_STRING},t.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},t}();function Ud(t,e){if(V.isEmpty(t))throw j.createClientInfoEmptyError();try{var r=e.base64Decode(t);return JSON.parse(r)}catch(n){throw j.createClientInfoDecodingError(n.message)}}function la(t){if(V.isEmpty(t))throw j.createClientInfoDecodingError("Home account ID was empty.");var e=t.split(Tr.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?_.EMPTY_STRING:e[1]}}var Fr;(function(t){t[t.Default=0]="Default",t[t.Adfs=1]="Adfs",t[t.Dsts=2]="Dsts"})(Fr||(Fr={}));var kt=function(){function t(){}return t.prototype.generateAccountId=function(){var e=[this.homeAccountId,this.environment];return e.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.prototype.generateAccountKey=function(){return t.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},t.prototype.generateType=function(){switch(this.authorityType){case Vn.ADFS_ACCOUNT_TYPE:return qn.ADFS;case Vn.MSAV1_ACCOUNT_TYPE:return qn.MSA;case Vn.MSSTS_ACCOUNT_TYPE:return qn.MSSTS;case Vn.GENERIC_ACCOUNT_TYPE:return qn.GENERIC;default:throw j.createUnexpectedAccountTypeError()}},t.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}},t.generateAccountCacheKey=function(e){var r=[e.homeAccountId,e.environment||_.EMPTY_STRING,e.tenantId||_.EMPTY_STRING];return r.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.createAccount=function(e,r,n,i,o,a,s,c){var l,d,h,u,f,v,g=new t;g.authorityType=Vn.MSSTS_ACCOUNT_TYPE,g.clientInfo=e,g.homeAccountId=r,g.nativeAccountId=c;var x=s||i&&i.getPreferredCache();if(!x)throw j.createInvalidCacheEnvironmentError();if(g.environment=x,g.realm=((l=n==null?void 0:n.claims)===null||l===void 0?void 0:l.tid)||_.EMPTY_STRING,n){g.idTokenClaims=n.claims,g.localAccountId=((d=n==null?void 0:n.claims)===null||d===void 0?void 0:d.oid)||((h=n==null?void 0:n.claims)===null||h===void 0?void 0:h.sub)||_.EMPTY_STRING;var m=(u=n==null?void 0:n.claims)===null||u===void 0?void 0:u.preferred_username,p=!((f=n==null?void 0:n.claims)===null||f===void 0)&&f.emails?n.claims.emails[0]:null;g.username=m||p||_.EMPTY_STRING,g.name=(v=n==null?void 0:n.claims)===null||v===void 0?void 0:v.name}return g.cloudGraphHostName=o,g.msGraphHost=a,g},t.createGenericAccount=function(e,r,n,i,o,a){var s,c,l,d,h=new t;h.authorityType=n&&n.authorityType===Fr.Adfs?Vn.ADFS_ACCOUNT_TYPE:Vn.GENERIC_ACCOUNT_TYPE,h.homeAccountId=e,h.realm=_.EMPTY_STRING;var u=a||n&&n.getPreferredCache();if(!u)throw j.createInvalidCacheEnvironmentError();return r&&(h.localAccountId=((s=r==null?void 0:r.claims)===null||s===void 0?void 0:s.oid)||((c=r==null?void 0:r.claims)===null||c===void 0?void 0:c.sub)||_.EMPTY_STRING,h.username=((l=r==null?void 0:r.claims)===null||l===void 0?void 0:l.upn)||_.EMPTY_STRING,h.name=((d=r==null?void 0:r.claims)===null||d===void 0?void 0:d.name)||_.EMPTY_STRING,h.idTokenClaims=r==null?void 0:r.claims),h.environment=u,h.cloudGraphHostName=i,h.msGraphHost=o,h},t.generateHomeAccountId=function(e,r,n,i,o){var a,s=!((a=o==null?void 0:o.claims)===null||a===void 0)&&a.sub?o.claims.sub:_.EMPTY_STRING;if(r===Fr.Adfs||r===Fr.Dsts)return s;if(e)try{var c=Ud(e,i);if(!V.isEmpty(c.uid)&&!V.isEmpty(c.utid))return""+c.uid+Tr.CLIENT_INFO_SEPARATOR+c.utid}catch{}return n.verbose("No client info in response"),s},t.isAccountEntity=function(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1},t.accountInfoIsEqual=function(e,r,n){if(!e||!r)return!1;var i=!0;if(n){var o=e.idTokenClaims||{},a=r.idTokenClaims||{};i=o.iat===a.iat&&o.nonce===a.nonce}return e.homeAccountId===r.homeAccountId&&e.localAccountId===r.localAccountId&&e.username===r.username&&e.tenantId===r.tenantId&&e.environment===r.environment&&e.nativeAccountId===r.nativeAccountId&&i},t}();var Tn=function(){function t(e,r){if(V.isEmpty(e))throw j.createTokenNullOrEmptyError(e);this.rawToken=e,this.claims=t.extractTokenClaims(e,r)}return t.extractTokenClaims=function(e,r){var n=V.decodeAuthToken(e);try{var i=n.JWSPayload,o=r.base64Decode(i);return JSON.parse(o)}catch(a){throw j.createTokenParsingError(a)}},t.checkMaxAge=function(e,r){var n=3e5;if(r===0||Date.now()-n>e+r)throw j.createMaxAgeTranspiredError()},t}();var Jr=function(){function t(e,r){this.clientId=e,this.cryptoImpl=r}return t.prototype.getAllAccounts=function(){var e=this,r=this.getAccountsFilteredBy(),n=Object.keys(r).map(function(a){return r[a]}),i=n.length;if(i<1)return[];var o=n.map(function(a){var s=t.toObject(new kt,a),c=s.getAccountInfo(),l=e.readIdTokenFromCache(e.clientId,c);return l&&!c.idTokenClaims&&(c.idToken=l.secret,c.idTokenClaims=new Tn(l.secret,e.cryptoImpl).claims),c});return o},t.prototype.saveCacheRecord=function(e){return Z(this,void 0,void 0,function(){return ee(this,function(r){switch(r.label){case 0:if(!e)throw j.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:r.sent(),r.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}})})},t.prototype.saveAccessToken=function(e){return Z(this,void 0,void 0,function(){var r,n,i,o,a=this;return ee(this,function(s){switch(s.label){case 0:return r=this.getCredentialsFilteredBy({clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash}),n=er.fromString(e.target),i=Object.keys(r.accessTokens).map(function(c){return r.accessTokens[c]}),i?(o=[],i.forEach(function(c){var l=er.fromString(c.target);l.intersectingScopeSets(n)&&o.push(a.removeCredential(c))}),[4,Promise.all(o)]):[3,2];case 1:s.sent(),s.label=2;case 2:return this.setAccessTokenCredential(e),[2]}})})},t.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:_.EMPTY_STRING,e?e.environment:_.EMPTY_STRING,e?e.realm:_.EMPTY_STRING,e?e.nativeAccountId:_.EMPTY_STRING)},t.prototype.getAccountsFilteredByInternal=function(e,r,n,i){var o=this,a=this.getKeys(),s={};return a.forEach(function(c){var l=o.getAccount(c);!l||!!e&&!o.matchHomeAccountId(l,e)||!!r&&!o.matchEnvironment(l,r)||!!n&&!o.matchRealm(l,n)||!!i&&!o.matchNativeAccountId(l,i)||(s[c]=l)}),s},t.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.userAssertionHash,e.tokenType,e.keyId,e.requestedClaimsHash)},t.prototype.getCredentialsFilteredByInternal=function(e,r,n,i,o,a,s,c,l,d,h){var u=this,f=this.getKeys(),v={idTokens:{},accessTokens:{},refreshTokens:{}};return f.forEach(function(g){var x=uc.getCredentialType(g);if(x!==_.NOT_DEFINED){var m=u.getSpecificCredential(g,x);if(!!m&&!(!!c&&!u.matchUserAssertionHash(m,c))&&!(typeof e=="string"&&!u.matchHomeAccountId(m,e))&&!(!!r&&!u.matchEnvironment(m,r))&&!(!!a&&!u.matchRealm(m,a))&&!(!!n&&!u.matchCredentialType(m,n))&&!(!!i&&!u.matchClientId(m,i))&&!(!!o&&!u.matchFamilyId(m,o))&&!(!!s&&!u.matchTarget(m,s))&&!((h||m.requestedClaimsHash)&&m.requestedClaimsHash!==h)&&!(n===de.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(!!l&&!u.matchTokenType(m,l)||l===Se.SSH&&d&&!u.matchKeyId(m,d)))){var p=u.updateCredentialCacheKey(g,m);switch(x){case de.ID_TOKEN:v.idTokens[p]=m;break;case de.ACCESS_TOKEN:case de.ACCESS_TOKEN_WITH_AUTH_SCHEME:v.accessTokens[p]=m;break;case de.REFRESH_TOKEN:v.refreshTokens[p]=m;break}}}}),v},t.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},t.prototype.getAppMetadataFilteredByInternal=function(e,r){var n=this,i=this.getKeys(),o={};return i.forEach(function(a){if(!!n.isAppMetadata(a)){var s=n.getAppMetadata(a);!s||!!e&&!n.matchEnvironment(s,e)||!!r&&!n.matchClientId(s,r)||(o[a]=s)}}),o},t.prototype.getAuthorityMetadataByAlias=function(e){var r=this,n=this.getAuthorityMetadataKeys(),i=null;return n.forEach(function(o){if(!(!r.isAuthorityMetadata(o)||o.indexOf(r.clientId)===-1)){var a=r.getAuthorityMetadata(o);!a||a.aliases.indexOf(e)!==-1&&(i=a)}}),i},t.prototype.removeAllAccounts=function(){return Z(this,void 0,void 0,function(){var e,r,n=this;return ee(this,function(i){switch(i.label){case 0:return e=this.getKeys(),r=[],e.forEach(function(o){var a=n.getAccount(o);!a||r.push(n.removeAccount(o))}),[4,Promise.all(r)];case 1:return i.sent(),[2,!0]}})})},t.prototype.removeAccount=function(e){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){switch(n.label){case 0:if(r=this.getAccount(e),!r)throw j.createNoAccountFoundError();return[4,this.removeAccountContext(r)];case 1:return[2,n.sent()&&this.removeItem(e,mo.ACCOUNT)]}})})},t.prototype.removeAccountContext=function(e){return Z(this,void 0,void 0,function(){var r,n,i,o=this;return ee(this,function(a){switch(a.label){case 0:return r=this.getKeys(),n=e.generateAccountId(),i=[],r.forEach(function(s){var c=uc.getCredentialType(s);if(c!==_.NOT_DEFINED){var l=o.getSpecificCredential(s,c);!!l&&n===l.generateAccountId()&&i.push(o.removeCredential(l))}}),[4,Promise.all(i)];case 1:return a.sent(),[2,!0]}})})},t.prototype.removeCredential=function(e){return Z(this,void 0,void 0,function(){var r,n,i;return ee(this,function(o){switch(o.label){case 0:if(r=e.generateCredentialKey(),e.credentialType.toLowerCase()!==de.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(e.tokenType!==Se.POP)return[3,4];if(n=e,i=n.keyId,!i)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(i)];case 2:return o.sent(),[3,4];case 3:throw o.sent(),j.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(r,mo.CREDENTIAL)]}})})},t.prototype.removeAppMetadata=function(){var e=this,r=this.getKeys();return r.forEach(function(n){e.isAppMetadata(n)&&e.removeItem(n,mo.APP_METADATA)}),!0},t.prototype.readCacheRecord=function(e,r,n,i){var o=this.readAccountFromCache(e),a=this.readIdTokenFromCache(r,e),s=this.readAccessTokenFromCache(r,e,n),c=this.readRefreshTokenFromCache(r,e,!1),l=this.readAppMetadataFromCache(i,r);return o&&a&&(o.idTokenClaims=new Tn(a.secret,this.cryptoImpl).claims),{account:o,idToken:a,accessToken:s,refreshToken:c,appMetadata:l}},t.prototype.readAccountFromCache=function(e){var r=kt.generateAccountCacheKey(e);return this.getAccount(r)},t.prototype.readAccountFromCacheWithNativeAccountId=function(e){var r={nativeAccountId:e},n=this.getAccountsFilteredBy(r),i=Object.keys(n).map(function(o){return n[o]});if(i.length<1)return null;if(i.length>1)throw j.createMultipleMatchingAccountsInCacheError();return n[0]},t.prototype.readIdTokenFromCache=function(e,r){var n={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:de.ID_TOKEN,clientId:e,realm:r.tenantId},i=this.getCredentialsFilteredBy(n),o=Object.keys(i.idTokens).map(function(s){return i.idTokens[s]}),a=o.length;if(a<1)return null;if(a>1)throw j.createMultipleMatchingTokensInCacheError();return o[0]},t.prototype.readAccessTokenFromCache=function(e,r,n){var i=new er(n.scopes||[]),o=n.authenticationScheme||Se.BEARER,a=o&&o.toLowerCase()!==Se.BEARER.toLowerCase()?de.ACCESS_TOKEN_WITH_AUTH_SCHEME:de.ACCESS_TOKEN,s={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:a,clientId:e,realm:r.tenantId,target:i.printScopesLowerCase(),tokenType:o,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},c=this.getCredentialsFilteredBy(s),l=Object.keys(c.accessTokens).map(function(h){return c.accessTokens[h]}),d=l.length;if(d<1)return null;if(d>1)throw j.createMultipleMatchingTokensInCacheError();return l[0]},t.prototype.readRefreshTokenFromCache=function(e,r,n){var i=n?Nd:void 0,o={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:de.REFRESH_TOKEN,clientId:e,familyId:i},a=this.getCredentialsFilteredBy(o),s=Object.keys(a.refreshTokens).map(function(l){return a.refreshTokens[l]}),c=s.length;return c<1?null:s[0]},t.prototype.readAppMetadataFromCache=function(e,r){var n={environment:e,clientId:r},i=this.getAppMetadataFilteredBy(n),o=Object.keys(i).map(function(s){return i[s]}),a=o.length;if(a<1)return null;if(a>1)throw j.createMultipleMatchingAppMetadataInCacheError();return o[0]},t.prototype.isAppMetadataFOCI=function(e,r){var n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===Nd)},t.prototype.matchHomeAccountId=function(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId},t.prototype.matchUserAssertionHash=function(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)},t.prototype.matchEnvironment=function(e,r){var n=this.getAuthorityMetadataByAlias(r);return!!(n&&n.aliases.indexOf(e.environment)>-1)},t.prototype.matchCredentialType=function(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()},t.prototype.matchClientId=function(e,r){return!!(e.clientId&&r===e.clientId)},t.prototype.matchFamilyId=function(e,r){return!!(e.familyId&&r===e.familyId)},t.prototype.matchRealm=function(e,r){return!!(e.realm&&r===e.realm)},t.prototype.matchNativeAccountId=function(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)},t.prototype.matchTarget=function(e,r){var n=e.credentialType!==de.ACCESS_TOKEN&&e.credentialType!==de.ACCESS_TOKEN_WITH_AUTH_SCHEME;if(n||!e.target)return!1;var i=er.fromString(e.target),o=er.fromString(r);return o.containsOnlyOIDCScopes()?o.removeScope(_.OFFLINE_ACCESS_SCOPE):o.removeOIDCScopes(),i.containsScopeSet(o)},t.prototype.matchTokenType=function(e,r){return!!(e.tokenType&&e.tokenType===r)},t.prototype.matchKeyId=function(e,r){return!!(e.keyId&&e.keyId===r)},t.prototype.isAppMetadata=function(e){return e.indexOf(s2)!==-1},t.prototype.isAuthorityMetadata=function(e){return e.indexOf(Fs.CACHE_KEY)!==-1},t.prototype.generateAuthorityMetadataCacheKey=function(e){return Fs.CACHE_KEY+"-"+this.clientId+"-"+e},t.prototype.getSpecificCredential=function(e,r){switch(r){case de.ID_TOKEN:return this.getIdTokenCredential(e);case de.ACCESS_TOKEN:case de.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case de.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},t.toObject=function(e,r){for(var n in r)e[n]=r[n];return e},t}(),s_=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.setAccount=function(){var r="Storage interface - setAccount() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAccount=function(){var r="Storage interface - getAccount() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setIdTokenCredential=function(){var r="Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getIdTokenCredential=function(){var r="Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setAccessTokenCredential=function(){var r="Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAccessTokenCredential=function(){var r="Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setRefreshTokenCredential=function(){var r="Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getRefreshTokenCredential=function(){var r="Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setAppMetadata=function(){var r="Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAppMetadata=function(){var r="Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setServerTelemetry=function(){var r="Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getServerTelemetry=function(){var r="Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setAuthorityMetadata=function(){var r="Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAuthorityMetadata=function(){var r="Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAuthorityMetadataKeys=function(){var r="Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setThrottlingCache=function(){var r="Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getThrottlingCache=function(){var r="Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.removeItem=function(){var r="Storage interface - removeItem() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.containsKey=function(){var r="Storage interface - containsKey() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getKeys=function(){var r="Storage interface - getKeys() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.clear=function(){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){throw r="Storage interface - clear() has not been implemented for the cacheStorage interface.",W.createUnexpectedError(r)})})},e.prototype.updateCredentialCacheKey=function(){var r="Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e}(Jr);var c_=300,r3={tokenRenewalOffsetSeconds:c_,preventCorsPreflight:!1,proxyUrl:_.EMPTY_STRING},l_={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:tt.Info,correlationId:_.EMPTY_STRING},d_={sendGetRequestAsync:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Network interface - sendGetRequestAsync() has not been implemented",W.createUnexpectedError(t)})})},sendPostRequestAsync:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Network interface - sendPostRequestAsync() has not been implemented",W.createUnexpectedError(t)})})}},h_={sku:_.SKU,version:t3,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},u_={clientSecret:_.EMPTY_STRING,clientAssertion:void 0},f_={azureCloudInstance:hc.None,tenant:""+_.DEFAULT_COMMON_TENANT},p_={application:{appName:"",appVersion:""}};function m_(t){var e=t.authOptions,r=t.systemOptions,n=t.loggerOptions,i=t.storageInterface,o=t.networkInterface,a=t.cryptoInterface,s=t.clientCredentials,c=t.libraryInfo,l=t.telemetry,d=t.serverTelemetryManager,h=t.persistencePlugin,u=t.serializableCache,f=Re(Re({},l_),n);return{authOptions:v_(e),systemOptions:Re(Re({},r3),r),loggerOptions:f,storageInterface:i||new s_(e.clientId,Fd),networkInterface:o||d_,cryptoInterface:a||Fd,clientCredentials:s||u_,libraryInfo:Re(Re({},h_),c),telemetry:Re(Re({},p_),l),serverTelemetryManager:d||null,persistencePlugin:h||null,serializableCache:u||null}}function v_(t){return Re({clientCapabilities:[],azureCloudOptions:f_,skipAuthorityMetadataCache:!1},t)}var So=function(t){br(e,t);function e(r,n,i){var o=t.call(this,r,n,i)||this;return o.name="ServerError",Object.setPrototypeOf(o,e.prototype),o}return e}(W);var $d=function(){function t(){}return t.generateThrottlingStorageKey=function(e){return Us.THROTTLING_PREFIX+"."+JSON.stringify(e)},t.preProcess=function(e,r){var n,i=t.generateThrottlingStorageKey(r),o=e.getThrottlingCache(i);if(o){if(o.throttleTime<Date.now()){e.removeItem(i,mo.THROTTLING);return}throw new So(((n=o.errorCodes)===null||n===void 0?void 0:n.join(" "))||_.EMPTY_STRING,o.errorMessage,o.subError)}},t.postProcess=function(e,r,n){if(t.checkResponseStatus(n)||t.checkResponseForRetryAfter(n)){var i={throttleTime:t.calculateThrottleTime(parseInt(n.headers[ln.RETRY_AFTER])),error:n.body.error,errorCodes:n.body.error_codes,errorMessage:n.body.error_description,subError:n.body.suberror};e.setThrottlingCache(t.generateThrottlingStorageKey(r),i)}},t.checkResponseStatus=function(e){return e.status===429||e.status>=500&&e.status<600},t.checkResponseForRetryAfter=function(e){return e.headers?e.headers.hasOwnProperty(ln.RETRY_AFTER)&&(e.status<200||e.status>=300):!1},t.calculateThrottleTime=function(e){var r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||Us.DEFAULT_THROTTLE_TIME_SECONDS),n+Us.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)},t.removeThrottle=function(e,r,n,i){var o={clientId:r,authority:n.authority,scopes:n.scopes,homeAccountIdentifier:i,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid},a=this.generateThrottlingStorageKey(o);return e.removeItem(a,mo.THROTTLING)},t}();var g_=function(){function t(e,r){this.networkClient=e,this.cacheManager=r}return t.prototype.sendPostRequest=function(e,r,n){return Z(this,void 0,void 0,function(){var i,o;return ee(this,function(a){switch(a.label){case 0:$d.preProcess(this.cacheManager,e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(r,n)];case 2:return i=a.sent(),[3,4];case 3:throw o=a.sent(),o instanceof W?o:j.createNetworkError(r,o);case 4:return $d.postProcess(this.cacheManager,e,i),[2,i]}})})},t}();var kr;(function(t){t.HOME_ACCOUNT_ID="home_account_id",t.UPN="UPN"})(kr||(kr={}));var n0=function(){function t(e,r){this.config=m_(e),this.logger=new r0(this.config.loggerOptions,a_,t3),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new g_(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}return t.prototype.createTokenRequestHeaders=function(e){var r={};if(r[ln.CONTENT_TYPE]=_.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case kr.HOME_ACCOUNT_ID:try{var n=la(e.credential);r[ln.CCS_HEADER]="Oid:"+n.uid+"@"+n.utid}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case kr.UPN:r[ln.CCS_HEADER]="UPN: "+e.credential;break}return r},t.prototype.executePostToTokenEndpoint=function(e,r,n,i){return Z(this,void 0,void 0,function(){var o;return ee(this,function(a){switch(a.label){case 0:return[4,this.networkManager.sendPostRequest(i,e,{body:r,headers:n,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return o=a.sent(),this.config.serverTelemetryManager&&o.status<500&&o.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,o]}})})},t.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw j.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},t}();var eo=function(){function t(){}return t.validateRedirectUri=function(e){if(V.isEmpty(e))throw Fe.createRedirectUriEmptyError()},t.validatePrompt=function(e){var r=[];for(var n in jt)r.push(jt[n]);if(r.indexOf(e)<0)throw Fe.createInvalidPromptError(e)},t.validateClaims=function(e){try{JSON.parse(e)}catch{throw Fe.createInvalidClaimsRequestError()}},t.validateCodeChallengeParams=function(e,r){if(V.isEmpty(e)||V.isEmpty(r))throw Fe.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(r)},t.validateCodeChallengeMethod=function(e){if([im.PLAIN,im.S256].indexOf(e)<0)throw Fe.createInvalidCodeChallengeMethodError()},t.sanitizeEQParams=function(e,r){return e?(r.forEach(function(n,i){e[i]&&delete e[i]}),e):{}},t}();var da=function(){function t(){this.parameters=new Map}return t.prototype.addResponseTypeCode=function(){this.parameters.set(ne.RESPONSE_TYPE,encodeURIComponent(_.CODE_RESPONSE_TYPE))},t.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(ne.RESPONSE_TYPE,encodeURIComponent(_.TOKEN_RESPONSE_TYPE+" "+_.ID_TOKEN_RESPONSE_TYPE))},t.prototype.addResponseMode=function(e){this.parameters.set(ne.RESPONSE_MODE,encodeURIComponent(e||Od.QUERY))},t.prototype.addNativeBroker=function(){this.parameters.set(ne.NATIVE_BROKER,encodeURIComponent("1"))},t.prototype.addScopes=function(e,r){r===void 0&&(r=!0);var n=r?S1(e||[],Ic):e||[],i=new er(n);this.parameters.set(ne.SCOPE,encodeURIComponent(i.printScopes()))},t.prototype.addClientId=function(e){this.parameters.set(ne.CLIENT_ID,encodeURIComponent(e))},t.prototype.addRedirectUri=function(e){eo.validateRedirectUri(e),this.parameters.set(ne.REDIRECT_URI,encodeURIComponent(e))},t.prototype.addPostLogoutRedirectUri=function(e){eo.validateRedirectUri(e),this.parameters.set(ne.POST_LOGOUT_URI,encodeURIComponent(e))},t.prototype.addIdTokenHint=function(e){this.parameters.set(ne.ID_TOKEN_HINT,encodeURIComponent(e))},t.prototype.addDomainHint=function(e){this.parameters.set(Vs.DOMAIN_HINT,encodeURIComponent(e))},t.prototype.addLoginHint=function(e){this.parameters.set(Vs.LOGIN_HINT,encodeURIComponent(e))},t.prototype.addCcsUpn=function(e){this.parameters.set(ln.CCS_HEADER,encodeURIComponent("UPN:"+e))},t.prototype.addCcsOid=function(e){this.parameters.set(ln.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},t.prototype.addSid=function(e){this.parameters.set(Vs.SID,encodeURIComponent(e))},t.prototype.addClaims=function(e,r){var n=this.addClientCapabilitiesToClaims(e,r);eo.validateClaims(n),this.parameters.set(ne.CLAIMS,encodeURIComponent(n))},t.prototype.addCorrelationId=function(e){this.parameters.set(ne.CLIENT_REQUEST_ID,encodeURIComponent(e))},t.prototype.addLibraryInfo=function(e){this.parameters.set(ne.X_CLIENT_SKU,e.sku),this.parameters.set(ne.X_CLIENT_VER,e.version),e.os&&this.parameters.set(ne.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(ne.X_CLIENT_CPU,e.cpu)},t.prototype.addApplicationTelemetry=function(e){e!=null&&e.appName&&this.parameters.set(ne.X_APP_NAME,e.appName),e!=null&&e.appVersion&&this.parameters.set(ne.X_APP_VER,e.appVersion)},t.prototype.addPrompt=function(e){eo.validatePrompt(e),this.parameters.set(""+ne.PROMPT,encodeURIComponent(e))},t.prototype.addState=function(e){V.isEmpty(e)||this.parameters.set(ne.STATE,encodeURIComponent(e))},t.prototype.addNonce=function(e){this.parameters.set(ne.NONCE,encodeURIComponent(e))},t.prototype.addCodeChallengeParams=function(e,r){if(eo.validateCodeChallengeParams(e,r),e&&r)this.parameters.set(ne.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(ne.CODE_CHALLENGE_METHOD,encodeURIComponent(r));else throw Fe.createInvalidCodeChallengeParamsError()},t.prototype.addAuthorizationCode=function(e){this.parameters.set(ne.CODE,encodeURIComponent(e))},t.prototype.addDeviceCode=function(e){this.parameters.set(ne.DEVICE_CODE,encodeURIComponent(e))},t.prototype.addRefreshToken=function(e){this.parameters.set(ne.REFRESH_TOKEN,encodeURIComponent(e))},t.prototype.addCodeVerifier=function(e){this.parameters.set(ne.CODE_VERIFIER,encodeURIComponent(e))},t.prototype.addClientSecret=function(e){this.parameters.set(ne.CLIENT_SECRET,encodeURIComponent(e))},t.prototype.addClientAssertion=function(e){V.isEmpty(e)||this.parameters.set(ne.CLIENT_ASSERTION,encodeURIComponent(e))},t.prototype.addClientAssertionType=function(e){V.isEmpty(e)||this.parameters.set(ne.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},t.prototype.addOboAssertion=function(e){this.parameters.set(ne.OBO_ASSERTION,encodeURIComponent(e))},t.prototype.addRequestTokenUse=function(e){this.parameters.set(ne.REQUESTED_TOKEN_USE,encodeURIComponent(e))},t.prototype.addGrantType=function(e){this.parameters.set(ne.GRANT_TYPE,encodeURIComponent(e))},t.prototype.addClientInfo=function(){this.parameters.set(o_,"1")},t.prototype.addExtraQueryParameters=function(e){var r=this;eo.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach(function(n){r.parameters.set(n,e[n])})},t.prototype.addClientCapabilitiesToClaims=function(e,r){var n;if(!e)n={};else try{n=JSON.parse(e)}catch{throw Fe.createInvalidClaimsRequestError()}return r&&r.length>0&&(n.hasOwnProperty(sa.ACCESS_TOKEN)||(n[sa.ACCESS_TOKEN]={}),n[sa.ACCESS_TOKEN][sa.XMS_CC]={values:r}),JSON.stringify(n)},t.prototype.addUsername=function(e){this.parameters.set(Vd.username,encodeURIComponent(e))},t.prototype.addPassword=function(e){this.parameters.set(Vd.password,encodeURIComponent(e))},t.prototype.addPopToken=function(e){V.isEmpty(e)||(this.parameters.set(ne.TOKEN_TYPE,Se.POP),this.parameters.set(ne.REQ_CNF,encodeURIComponent(e)))},t.prototype.addSshJwk=function(e){V.isEmpty(e)||(this.parameters.set(ne.TOKEN_TYPE,Se.SSH),this.parameters.set(ne.REQ_CNF,encodeURIComponent(e)))},t.prototype.addServerTelemetry=function(e){this.parameters.set(ne.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(ne.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},t.prototype.addThrottling=function(){this.parameters.set(ne.X_MS_LIB_CAPABILITY,Us.X_MS_LIB_CAPABILITY_VALUE)},t.prototype.addLogoutHint=function(e){this.parameters.set(ne.LOGOUT_HINT,encodeURIComponent(e))},t.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach(function(r,n){e.push(n+"="+r)}),e.join("&")},t}();var fc=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.createIdTokenEntity=function(r,n,i,o,a){var s=new e;return s.credentialType=de.ID_TOKEN,s.homeAccountId=r,s.environment=n,s.clientId=o,s.secret=i,s.realm=a,s},e.isIdTokenEntity=function(r){return r?r.hasOwnProperty("homeAccountId")&&r.hasOwnProperty("environment")&&r.hasOwnProperty("credentialType")&&r.hasOwnProperty("realm")&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("secret")&&r.credentialType===de.ID_TOKEN:!1},e}(uc);var Br=function(){function t(){}return t.nowSeconds=function(){return Math.round(new Date().getTime()/1e3)},t.isTokenExpired=function(e,r){var n=Number(e)||0,i=t.nowSeconds()+r;return i>n},t.wasClockTurnedBack=function(e){var r=Number(e);return r>t.nowSeconds()},t.delay=function(e,r){return new Promise(function(n){return setTimeout(function(){return n(r)},e)})},t}();var pc=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.createAccessTokenEntity=function(r,n,i,o,a,s,c,l,d,h,u,f,v,g,x){var m,p,y=new e;y.homeAccountId=r,y.credentialType=de.ACCESS_TOKEN,y.secret=i;var w=Br.nowSeconds();if(y.cachedAt=w.toString(),y.expiresOn=c.toString(),y.extendedExpiresOn=l.toString(),h&&(y.refreshOn=h.toString()),y.environment=n,y.clientId=o,y.realm=a,y.target=s,y.userAssertionHash=f,y.tokenType=V.isEmpty(u)?Se.BEARER:u,g&&(y.requestedClaims=g,y.requestedClaimsHash=x),((m=y.tokenType)===null||m===void 0?void 0:m.toLowerCase())!==Se.BEARER.toLowerCase())switch(y.credentialType=de.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case Se.POP:var A=Tn.extractTokenClaims(i,d);if(!(!((p=A==null?void 0:A.cnf)===null||p===void 0)&&p.kid))throw j.createTokenClaimsRequiredError();y.keyId=A.cnf.kid;break;case Se.SSH:y.keyId=v}return y},e.isAccessTokenEntity=function(r){return r?r.hasOwnProperty("homeAccountId")&&r.hasOwnProperty("environment")&&r.hasOwnProperty("credentialType")&&r.hasOwnProperty("realm")&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("secret")&&r.hasOwnProperty("target")&&(r.credentialType===de.ACCESS_TOKEN||r.credentialType===de.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1},e}(uc);var jd=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.createRefreshTokenEntity=function(r,n,i,o,a,s){var c=new e;return c.clientId=o,c.credentialType=de.REFRESH_TOKEN,c.environment=n,c.homeAccountId=r,c.secret=i,c.userAssertionHash=s,a&&(c.familyId=a),c},e.isRefreshTokenEntity=function(r){return r?r.hasOwnProperty("homeAccountId")&&r.hasOwnProperty("environment")&&r.hasOwnProperty("credentialType")&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("secret")&&r.credentialType===de.REFRESH_TOKEN:!1},e}(uc);var am=["interaction_required","consent_required","login_required"],y_=["message_only","additional_action","basic_action","user_password_expired","consent_required"],ms={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{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."}},an=function(t){br(e,t);function e(r,n,i){var o=t.call(this,r,n,i)||this;return o.name="InteractionRequiredAuthError",Object.setPrototypeOf(o,e.prototype),o}return e.isInteractionRequiredError=function(r,n,i){var o=!!r&&am.indexOf(r)>-1,a=!!i&&y_.indexOf(i)>-1,s=!!n&&am.some(function(c){return n.indexOf(c)>-1});return o||s||a},e.createNoTokensFoundError=function(){return new e(ms.noTokensFoundError.code,ms.noTokensFoundError.desc)},e.createNativeAccountUnavailableError=function(){return new e(ms.native_account_unavailable.code,ms.native_account_unavailable.desc)},e}(W);var ql=function(){function t(e,r,n,i,o){this.account=e||null,this.idToken=r||null,this.accessToken=n||null,this.refreshToken=i||null,this.appMetadata=o||null}return t}();var Yn=function(){function t(){}return t.setRequestState=function(e,r,n){var i=t.generateLibraryState(e,n);return V.isEmpty(r)?i:""+i+_.RESOURCE_DELIM+r},t.generateLibraryState=function(e,r){if(!e)throw j.createNoCryptoObjectError("generateLibraryState");var n={id:e.createNewGuid()};r&&(n.meta=r);var i=JSON.stringify(n);return e.base64Encode(i)},t.parseRequestState=function(e,r){if(!e)throw j.createNoCryptoObjectError("parseRequestState");if(V.isEmpty(r))throw j.createInvalidStateError(r,"Null, undefined or empty state");try{var n=r.split(_.RESOURCE_DELIM),i=n[0],o=n.length>1?n.slice(1).join(_.RESOURCE_DELIM):_.EMPTY_STRING,a=e.base64Decode(i),s=JSON.parse(a);return{userRequestState:V.isEmpty(o)?_.EMPTY_STRING:o,libraryState:s}}catch(c){throw j.createInvalidStateError(r,c)}},t}();var be=function(){function t(e){if(this._urlString=e,V.isEmpty(this._urlString))throw Fe.createUrlEmptyError();V.isEmpty(this.getHash())&&(this._urlString=t.canonicalizeUri(e))}return Object.defineProperty(t.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),t.canonicalizeUri=function(e){if(e){var r=e.toLowerCase();return V.endsWith(r,"?")?r=r.slice(0,-1):V.endsWith(r,"?/")&&(r=r.slice(0,-2)),V.endsWith(r,"/")||(r+="/"),r}return e},t.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(r){throw Fe.createUrlParseError(r)}if(!e.HostNameAndPort||!e.PathSegments)throw Fe.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Fe.createInsecureAuthorityUriError(this.urlString)},t.appendQueryString=function(e,r){return V.isEmpty(r)?e:e.indexOf("?")<0?e+"?"+r:e+"&"+r},t.removeHashFromUrl=function(e){return t.canonicalizeUri(e.split("#")[0])},t.prototype.replaceTenantPath=function(e){var r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===Ld.COMMON||n[0]===Ld.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)},t.prototype.getHash=function(){return t.parseHash(this.urlString)},t.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw Fe.createUrlParseError("Given url string: "+this.urlString);var n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},i=n.AbsolutePath.split("/");return i=i.filter(function(o){return o&&o.length>0}),n.PathSegments=i,!V.isEmpty(n.QueryString)&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n},t.getDomainFromUrl=function(e){var r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw Fe.createUrlParseError("Given url string: "+e);return n[2]},t.getAbsoluteUrl=function(e,r){if(e[0]===_.FORWARD_SLASH){var n=new t(r),i=n.getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e},t.parseHash=function(e){var r=e.indexOf("#"),n=e.indexOf("#/");return n>-1?e.substring(n+2):r>-1?e.substring(r+1):_.EMPTY_STRING},t.parseQueryString=function(e){var r=e.indexOf("?"),n=e.indexOf("/?");return n>-1?e.substring(n+2):r>-1?e.substring(r+1):_.EMPTY_STRING},t.constructAuthorityUriFromObject=function(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},t.getDeserializedHash=function(e){if(V.isEmpty(e))return{};var r=t.parseHash(e),n=V.queryStringToObject(V.isEmpty(r)?e:r);if(!n)throw j.createHashNotDeserializedError(JSON.stringify(n));return n},t.getDeserializedQueryString=function(e){if(V.isEmpty(e))return{};var r=t.parseQueryString(e),n=V.queryStringToObject(V.isEmpty(r)?e:r);if(!n)throw j.createHashNotDeserializedError(JSON.stringify(n));return n},t.hashContainsKnownProperties=function(e){if(V.isEmpty(e)||e.indexOf("=")<0)return!1;var r=t.getDeserializedHash(e);return!!(r.code||r.error_description||r.error||r.state)},t}();var l2;(function(t){t.SW="sw",t.UHW="uhw"})(l2||(l2={}));var Pa=function(){function t(e){this.cryptoUtils=e}return t.prototype.generateCnf=function(e){return Z(this,void 0,void 0,function(){var r,n,i;return ee(this,function(o){switch(o.label){case 0:return[4,this.generateKid(e)];case 1:return r=o.sent(),n=this.cryptoUtils.base64Encode(JSON.stringify(r)),i={kid:r.kid,reqCnfString:n},[4,this.cryptoUtils.hashString(n)];case 2:return[2,(i.reqCnfHash=o.sent(),i)]}})})},t.prototype.generateKid=function(e){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){switch(n.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return r=n.sent(),[2,{kid:r,xms_ksl:l2.SW}]}})})},t.prototype.signPopToken=function(e,r,n){return Z(this,void 0,void 0,function(){return ee(this,function(i){return[2,this.signPayload(e,r,n)]})})},t.prototype.signPayload=function(e,r,n,i){return Z(this,void 0,void 0,function(){var o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return o=n.resourceRequestMethod,a=n.resourceRequestUri,s=n.shrClaims,c=n.shrNonce,l=a?new be(a):void 0,d=l==null?void 0:l.getUrlComponents(),[4,this.cryptoUtils.signJwt(Re({at:e,ts:Br.nowSeconds(),m:o==null?void 0:o.toUpperCase(),u:d==null?void 0:d.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:d==null?void 0:d.AbsolutePath,q:d!=null&&d.QueryString?[[],d.QueryString]:void 0,client_claims:s||void 0},i),r,n.correlationId)];case 1:return[2,h.sent()]}})})},t}();var d2=function(){function t(){}return t.prototype.generateAppMetadataKey=function(){return t.generateAppMetadataCacheKey(this.environment,this.clientId)},t.generateAppMetadataCacheKey=function(e,r){var n=[s2,e,r];return n.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.createAppMetadataEntity=function(e,r,n){var i=new t;return i.clientId=e,i.environment=r,n&&(i.familyId=n),i},t.isAppMetadataEntity=function(e,r){return r?e.indexOf(s2)===0&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("environment"):!1},t}();var __=function(){function t(e,r){this.cache=e,this.hasChanged=r}return Object.defineProperty(t.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),t}();var Bd=function(){function t(e,r,n,i,o,a){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=i,this.serializableCache=o,this.persistencePlugin=a}return t.prototype.validateServerAuthorizationCodeResponse=function(e,r,n){if(!e.state||!r)throw e.state?j.createStateNotFoundError("Cached State"):j.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(r))throw j.createStateMismatchError();if(e.error||e.error_description||e.suberror)throw an.isInteractionRequiredError(e.error,e.error_description,e.suberror)?new an(e.error||_.EMPTY_STRING,e.error_description,e.suberror):new So(e.error||_.EMPTY_STRING,e.error_description,e.suberror);e.client_info&&Ud(e.client_info,n)},t.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(an.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new an(e.error,e.error_description,e.suberror);var r=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new So(e.error,r,e.suberror)}},t.prototype.handleServerTokenResponse=function(e,r,n,i,o,a,s,c,l){return Z(this,void 0,void 0,function(){var d,h,u,f,v,g,x;return ee(this,function(m){switch(m.label){case 0:if(e.id_token){if(d=new Tn(e.id_token||_.EMPTY_STRING,this.cryptoObj),o&&!V.isEmpty(o.nonce)&&d.claims.nonce!==o.nonce)throw j.createNonceMismatchError();if(i.maxAge||i.maxAge===0){if(h=d.claims.auth_time,!h)throw j.createAuthTimeNotFoundError();Tn.checkMaxAge(h,i.maxAge)}}this.homeAccountIdentifier=kt.generateHomeAccountId(e.client_info||_.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,d),!!o&&!!o.state&&(u=Yn.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||i.sshKid||void 0,f=this.generateCacheRecord(e,r,n,i,d,a,o),m.label=1;case 1:return m.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),v=new __(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(v)]):[3,3];case 2:m.sent(),m.label=3;case 3:return s&&!c&&f.account&&(g=f.account.generateAccountKey(),x=this.cacheStorage.getAccount(g),!x)?(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,t.generateAuthenticationResult(this.cryptoObj,r,f,!1,i,d,u,void 0,l)]):[4,this.cacheStorage.saveCacheRecord(f)];case 4:return m.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&v?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(v)]):[3,7];case 6:m.sent(),m.label=7;case 7:return[7];case 8:return[2,t.generateAuthenticationResult(this.cryptoObj,r,f,!1,i,d,u,e.spa_code,l)]}})})},t.prototype.generateCacheRecord=function(e,r,n,i,o,a,s){var c=r.getPreferredCache();if(V.isEmpty(c))throw j.createInvalidCacheEnvironmentError();var l,d;!V.isEmpty(e.id_token)&&!!o&&(l=fc.createIdTokenEntity(this.homeAccountIdentifier,c,e.id_token||_.EMPTY_STRING,this.clientId,o.claims.tid||_.EMPTY_STRING),d=this.generateAccountEntity(e,o,r,s));var h=null;if(!V.isEmpty(e.access_token)){var u=e.scope?er.fromString(e.scope):new er(i.scopes||[]),f=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,v=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,g=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,x=n+f,m=x+v,p=g&&g>0?n+g:void 0;h=pc.createAccessTokenEntity(this.homeAccountIdentifier,c,e.access_token||_.EMPTY_STRING,this.clientId,o?o.claims.tid||_.EMPTY_STRING:r.tenant,u.printScopes(),x,m,this.cryptoObj,p,e.token_type,a,e.key_id,i.claims,i.requestedClaimsHash)}var y=null;V.isEmpty(e.refresh_token)||(y=jd.createRefreshTokenEntity(this.homeAccountIdentifier,c,e.refresh_token||_.EMPTY_STRING,this.clientId,e.foci,a));var w=null;return V.isEmpty(e.foci)||(w=d2.createAppMetadataEntity(this.clientId,c,e.foci)),new ql(d,l,h,y,w)},t.prototype.generateAccountEntity=function(e,r,n,i){var o=n.authorityType,a=i?i.cloud_graph_host_name:_.EMPTY_STRING,s=i?i.msgraph_host:_.EMPTY_STRING;if(o===Fr.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),kt.createGenericAccount(this.homeAccountIdentifier,r,n,a,s);if(V.isEmpty(e.client_info)&&n.protocolMode==="AAD")throw j.createClientInfoEmptyError();return e.client_info?kt.createAccount(e.client_info,this.homeAccountIdentifier,r,n,a,s):kt.createGenericAccount(this.homeAccountIdentifier,r,n,a,s)},t.generateAuthenticationResult=function(e,r,n,i,o,a,s,c,l){var d,h,u;return Z(this,void 0,void 0,function(){var f,v,g,x,m,p,y,w,A,O,U;return ee(this,function(N){switch(N.label){case 0:if(f=_.EMPTY_STRING,v=[],g=null,m=_.EMPTY_STRING,!n.accessToken)return[3,4];if(n.accessToken.tokenType!==Se.POP)return[3,2];if(p=new Pa(e),y=n.accessToken,w=y.secret,A=y.keyId,!A)throw j.createKeyIdMissingError();return[4,p.signPopToken(w,A,o)];case 1:return f=N.sent(),[3,3];case 2:f=n.accessToken.secret,N.label=3;case 3:v=er.fromString(n.accessToken.target).asArray(),g=new Date(Number(n.accessToken.expiresOn)*1e3),x=new Date(Number(n.accessToken.extendedExpiresOn)*1e3),N.label=4;case 4:return n.appMetadata&&(m=n.appMetadata.familyId===Nd?Nd:_.EMPTY_STRING),O=(a==null?void 0:a.claims.oid)||(a==null?void 0:a.claims.sub)||_.EMPTY_STRING,U=(a==null?void 0:a.claims.tid)||_.EMPTY_STRING,[2,{authority:r.canonicalAuthority,uniqueId:O,tenantId:U,scopes:v,account:n.account?n.account.getAccountInfo():null,idToken:a?a.rawToken:_.EMPTY_STRING,idTokenClaims:a?a.claims:{},accessToken:f,fromCache:i,expiresOn:g,correlationId:o.correlationId,requestId:l||_.EMPTY_STRING,extExpiresOn:x,familyId:m,tokenType:((d=n.accessToken)===null||d===void 0?void 0:d.tokenType)||_.EMPTY_STRING,state:s?s.userRequestState:_.EMPTY_STRING,cloudGraphHostName:((h=n.account)===null||h===void 0?void 0:h.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((u=n.account)===null||u===void 0?void 0:u.msGraphHost)||_.EMPTY_STRING,code:c,fromNativeBroker:!1}]}})})},t}();var n3=function(t){br(e,t);function e(r){var n=t.call(this,r)||this;return n.includeRedirectUri=!0,n}return e.prototype.getAuthCodeUrl=function(r){return Z(this,void 0,void 0,function(){var n;return ee(this,function(i){switch(i.label){case 0:return[4,this.createAuthCodeUrlQueryString(r)];case 1:return n=i.sent(),[2,be.appendQueryString(this.authority.authorizationEndpoint,n)]}})})},e.prototype.acquireToken=function(r,n){var i;return Z(this,void 0,void 0,function(){var o,a,s,c;return ee(this,function(l){switch(l.label){case 0:if(this.logger.info("in acquireToken call"),!r||V.isEmpty(r.code))throw j.createTokenRequestCannotBeMadeError();return o=Br.nowSeconds(),[4,this.executeTokenRequest(this.authority,r)];case 1:return a=l.sent(),s=(i=a.headers)===null||i===void 0?void 0:i[ln.X_MS_REQUEST_ID],c=new Bd(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),c.validateTokenResponse(a.body),[4,c.handleServerTokenResponse(a.body,this.authority,o,r,n,void 0,void 0,void 0,s)];case 2:return[2,l.sent()]}})})},e.prototype.handleFragmentResponse=function(r,n){var i=new Bd(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),o=new be(r),a=be.getDeserializedHash(o.getHash());if(i.validateServerAuthorizationCodeResponse(a,n,this.cryptoUtils),!a.code)throw j.createNoAuthCodeInServerResponseError();return Re(Re({},a),{code:a.code})},e.prototype.getLogoutUri=function(r){if(!r)throw Fe.createEmptyLogoutRequestError();var n=this.createLogoutUrlQueryString(r);return be.appendQueryString(this.authority.endSessionEndpoint,n)},e.prototype.executeTokenRequest=function(r,n){return Z(this,void 0,void 0,function(){var i,o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return i={clientId:this.config.authOptions.clientId,authority:r.canonicalAuthority,scopes:n.scopes,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid},[4,this.createTokenRequestBody(n)];case 1:if(o=h.sent(),a=this.createTokenQueryParameters(n),s=void 0,n.clientInfo)try{c=Ud(n.clientInfo,this.cryptoUtils),s={credential:""+c.uid+Tr.CLIENT_INFO_SEPARATOR+c.utid,type:kr.HOME_ACCOUNT_ID}}catch(u){this.logger.verbose("Could not parse client info for CCS Header: "+u)}return l=this.createTokenRequestHeaders(s||n.ccsCredential),d=V.isEmpty(a)?r.tokenEndpoint:r.tokenEndpoint+"?"+a,[2,this.executePostToTokenEndpoint(d,o,l,i)]}})})},e.prototype.createTokenQueryParameters=function(r){var n=new da;return r.tokenQueryParameters&&n.addExtraQueryParameters(r.tokenQueryParameters),n.createQueryString()},e.prototype.createTokenRequestBody=function(r){return Z(this,void 0,void 0,function(){var n,i,o,a,s,c,l,l,d;return ee(this,function(h){switch(h.label){case 0:return n=new da,n.addClientId(this.config.authOptions.clientId),this.includeRedirectUri?n.addRedirectUri(r.redirectUri):eo.validateRedirectUri(r.redirectUri),n.addScopes(r.scopes),n.addAuthorizationCode(r.code),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&n.addServerTelemetry(this.serverTelemetryManager),r.codeVerifier&&n.addCodeVerifier(r.codeVerifier),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(i=this.config.clientCredentials.clientAssertion,n.addClientAssertion(i.assertion),n.addClientAssertionType(i.assertionType)),n.addGrantType(Dd.AUTHORIZATION_CODE_GRANT),n.addClientInfo(),r.authenticationScheme!==Se.POP?[3,2]:(o=new Pa(this.cryptoUtils),[4,o.generateCnf(r)]);case 1:return a=h.sent(),n.addPopToken(a.reqCnfString),[3,3];case 2:if(r.authenticationScheme===Se.SSH)if(r.sshJwk)n.addSshJwk(r.sshJwk);else throw Fe.createMissingSshJwkError();h.label=3;case 3:if(s=r.correlationId||this.config.cryptoInterface.createNewGuid(),n.addCorrelationId(s),(!V.isEmptyObj(r.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(r.claims,this.config.authOptions.clientCapabilities),c=void 0,r.clientInfo)try{l=Ud(r.clientInfo,this.cryptoUtils),c={credential:""+l.uid+Tr.CLIENT_INFO_SEPARATOR+l.utid,type:kr.HOME_ACCOUNT_ID}}catch(u){this.logger.verbose("Could not parse client info for CCS Header: "+u)}else c=r.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&c)switch(c.type){case kr.HOME_ACCOUNT_ID:try{l=la(c.credential),n.addCcsOid(l)}catch(u){this.logger.verbose("Could not parse home account ID for CCS Header: "+u)}break;case kr.UPN:n.addCcsUpn(c.credential);break}return r.tokenBodyParameters&&n.addExtraQueryParameters(r.tokenBodyParameters),r.enableSpaAuthorizationCode&&(!r.tokenBodyParameters||!r.tokenBodyParameters[ne.RETURN_SPA_CODE])&&n.addExtraQueryParameters((d={},d[ne.RETURN_SPA_CODE]="1",d)),[2,n.createQueryString()]}})})},e.prototype.createAuthCodeUrlQueryString=function(r){return Z(this,void 0,void 0,function(){var n,i,o,a,s,c,c,c,l,d;return ee(this,function(h){switch(h.label){case 0:if(n=new da,n.addClientId(this.config.authOptions.clientId),i=S1(r.scopes||[],r.extraScopesToConsent||[]),n.addScopes(i),n.addRedirectUri(r.redirectUri),o=r.correlationId||this.config.cryptoInterface.createNewGuid(),n.addCorrelationId(o),n.addResponseMode(r.responseMode),n.addResponseTypeCode(),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addClientInfo(),r.codeChallenge&&r.codeChallengeMethod&&n.addCodeChallengeParams(r.codeChallenge,r.codeChallengeMethod),r.prompt&&n.addPrompt(r.prompt),r.domainHint&&n.addDomainHint(r.domainHint),r.prompt!==jt.SELECT_ACCOUNT)if(r.sid&&r.prompt===jt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),n.addSid(r.sid);else if(r.account){if(a=this.extractAccountSid(r.account),s=this.extractLoginHint(r.account),s){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),n.addLoginHint(s);try{c=la(r.account.homeAccountId),n.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&r.prompt===jt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),n.addSid(a);try{c=la(r.account.homeAccountId),n.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(r.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),n.addLoginHint(r.loginHint),n.addCcsUpn(r.loginHint);else if(r.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),n.addLoginHint(r.account.username);try{c=la(r.account.homeAccountId),n.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else r.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),n.addLoginHint(r.loginHint),n.addCcsUpn(r.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return r.nonce&&n.addNonce(r.nonce),r.state&&n.addState(r.state),(!V.isEmpty(r.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(r.claims,this.config.authOptions.clientCapabilities),r.extraQueryParameters&&n.addExtraQueryParameters(r.extraQueryParameters),r.nativeBroker?(n.addNativeBroker(),r.authenticationScheme!==Se.POP?[3,2]:(l=new Pa(this.cryptoUtils),[4,l.generateCnf(r)])):[3,2];case 1:d=h.sent(),n.addPopToken(d.reqCnfHash),h.label=2;case 2:return[2,n.createQueryString()]}})})},e.prototype.createLogoutUrlQueryString=function(r){var n=new da;return r.postLogoutRedirectUri&&n.addPostLogoutRedirectUri(r.postLogoutRedirectUri),r.correlationId&&n.addCorrelationId(r.correlationId),r.idTokenHint&&n.addIdTokenHint(r.idTokenHint),r.state&&n.addState(r.state),r.logoutHint&&n.addLogoutHint(r.logoutHint),r.extraQueryParameters&&n.addExtraQueryParameters(r.extraQueryParameters),n.createQueryString()},e.prototype.extractAccountSid=function(r){var n;return((n=r.idTokenClaims)===null||n===void 0?void 0:n.sid)||null},e.prototype.extractLoginHint=function(r){var n;return((n=r.idTokenClaims)===null||n===void 0?void 0:n.login_hint)||null},e}(n0);var pt;(function(t){t.AcquireTokenByCode="acquireTokenByCode",t.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",t.AcquireTokenSilent="acquireTokenSilent",t.AcquireTokenSilentAsync="acquireTokenSilentAsync",t.AcquireTokenPopup="acquireTokenPopup",t.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",t.CryptoOptsSignJwt="cryptoOptsSignJwt",t.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",t.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",t.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",t.SsoSilent="ssoSilent",t.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",t.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",t.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",t.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",t.BrokerHandhshake="brokerHandshake",t.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",t.AcquireTokenByBroker="acquireTokenByBroker",t.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",t.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",t.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken"})(pt||(pt={}));var ha;(function(t){t[t.NotStarted=0]="NotStarted",t[t.InProgress=1]="InProgress",t[t.Completed=2]="Completed"})(ha||(ha={}));var i3=function(t){br(e,t);function e(r,n){return t.call(this,r,n)||this}return e.prototype.acquireToken=function(r){var n,i,o;return Z(this,void 0,void 0,function(){var a,s,c,l,d,h=this;return ee(this,function(u){switch(u.label){case 0:return a=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement(pt.RefreshTokenClientAcquireToken,r.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",r.correlationId),s=Br.nowSeconds(),[4,this.executeTokenRequest(r,this.authority)];case 1:return c=u.sent(),a==null||a.addStaticFields({refreshTokenSize:((i=c.body.refresh_token)===null||i===void 0?void 0:i.length)||0}),l=(o=c.headers)===null||o===void 0?void 0:o[ln.X_MS_REQUEST_ID],d=new Bd(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),d.validateTokenResponse(c.body),[2,d.handleServerTokenResponse(c.body,this.authority,s,r,void 0,void 0,!0,r.forceCache,l).then(function(f){return a==null||a.endMeasurement({success:!0}),f}).catch(function(f){throw h.logger.verbose("Error in fetching refresh token",r.correlationId),a==null||a.endMeasurement({errorCode:f.errorCode,subErrorCode:f.subError,success:!1}),f})]}})})},e.prototype.acquireTokenByRefreshToken=function(r){return Z(this,void 0,void 0,function(){var n,i,o;return ee(this,function(a){if(!r)throw Fe.createEmptyTokenRequestError();if(!r.account)throw j.createNoAccountInSilentRequestError();if(n=this.cacheManager.isAppMetadataFOCI(r.account.environment,this.config.authOptions.clientId),n)try{return[2,this.acquireTokenWithCachedRefreshToken(r,!0)]}catch(s){if(i=s instanceof an&&s.errorCode===ms.noTokensFoundError.code,o=s instanceof So&&s.errorCode===om.INVALID_GRANT_ERROR&&s.subError===om.CLIENT_MISMATCH_ERROR,i||o)return[2,this.acquireTokenWithCachedRefreshToken(r,!1)];throw s}return[2,this.acquireTokenWithCachedRefreshToken(r,!1)]})})},e.prototype.acquireTokenWithCachedRefreshToken=function(r,n){var i;return Z(this,void 0,void 0,function(){var o,a,s;return ee(this,function(c){if(o=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement(pt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,r.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",r.correlationId),a=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,r.account,n),!a)throw o==null||o.discardMeasurement(),an.createNoTokensFoundError();return o==null||o.endMeasurement({success:!0}),s=Re(Re({},r),{refreshToken:a.secret,authenticationScheme:r.authenticationScheme||Se.BEARER,ccsCredential:{credential:r.account.homeAccountId,type:kr.HOME_ACCOUNT_ID}}),[2,this.acquireToken(s)]})})},e.prototype.executeTokenRequest=function(r,n){var i;return Z(this,void 0,void 0,function(){var o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return o=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement(pt.RefreshTokenClientExecuteTokenRequest,r.correlationId),[4,this.createTokenRequestBody(r)];case 1:return a=h.sent(),s=this.createTokenQueryParameters(r),c=this.createTokenRequestHeaders(r.ccsCredential),l={clientId:this.config.authOptions.clientId,authority:n.canonicalAuthority,scopes:r.scopes,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},d=be.appendQueryString(n.tokenEndpoint,s),[2,this.executePostToTokenEndpoint(d,a,c,l).then(function(u){return o==null||o.endMeasurement({success:!0}),u}).catch(function(u){throw o==null||o.endMeasurement({success:!1}),u})]}})})},e.prototype.createTokenQueryParameters=function(r){var n=new da;return r.tokenQueryParameters&&n.addExtraQueryParameters(r.tokenQueryParameters),n.createQueryString()},e.prototype.createTokenRequestBody=function(r){var n;return Z(this,void 0,void 0,function(){var i,o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return i=r.correlationId,o=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement(pt.BaseClientCreateTokenRequestHeaders,i),a=new da,a.addClientId(this.config.authOptions.clientId),a.addScopes(r.scopes),a.addGrantType(Dd.REFRESH_TOKEN_GRANT),a.addClientInfo(),a.addLibraryInfo(this.config.libraryInfo),a.addApplicationTelemetry(this.config.telemetry.application),a.addThrottling(),this.serverTelemetryManager&&a.addServerTelemetry(this.serverTelemetryManager),a.addCorrelationId(i),a.addRefreshToken(r.refreshToken),this.config.clientCredentials.clientSecret&&a.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(s=this.config.clientCredentials.clientAssertion,a.addClientAssertion(s.assertion),a.addClientAssertionType(s.assertionType)),r.authenticationScheme!==Se.POP?[3,2]:(c=new Pa(this.cryptoUtils),[4,c.generateCnf(r)]);case 1:return l=h.sent(),a.addPopToken(l.reqCnfString),[3,3];case 2:if(r.authenticationScheme===Se.SSH)if(r.sshJwk)a.addSshJwk(r.sshJwk);else throw o==null||o.endMeasurement({success:!1}),Fe.createMissingSshJwkError();h.label=3;case 3:if((!V.isEmptyObj(r.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&a.addClaims(r.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&r.ccsCredential)switch(r.ccsCredential.type){case kr.HOME_ACCOUNT_ID:try{d=la(r.ccsCredential.credential),a.addCcsOid(d)}catch(u){this.logger.verbose("Could not parse home account ID for CCS Header: "+u)}break;case kr.UPN:a.addCcsUpn(r.ccsCredential.credential);break}return o==null||o.endMeasurement({success:!0}),[2,a.createQueryString()]}})})},e}(n0);var b_=function(t){br(e,t);function e(r,n){return t.call(this,r,n)||this}return e.prototype.acquireToken=function(r){return Z(this,void 0,void 0,function(){var n,i;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.acquireCachedToken(r)];case 1:return[2,o.sent()];case 2:if(n=o.sent(),n instanceof j&&n.errorCode===R.tokenRefreshRequired.code)return i=new i3(this.config,this.performanceClient),[2,i.acquireTokenByRefreshToken(r)];throw n;case 3:return[2]}})})},e.prototype.acquireCachedToken=function(r){var n,i,o,a;return Z(this,void 0,void 0,function(){var s,c;return ee(this,function(l){switch(l.label){case 0:if(!r)throw Fe.createEmptyTokenRequestError();if(r.forceRefresh)throw(n=this.serverTelemetryManager)===null||n===void 0||n.setCacheOutcome(lo.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),j.createRefreshRequiredError();if(!r.account)throw j.createNoAccountInSilentRequestError();if(s=r.authority||this.authority.getPreferredCache(),c=this.cacheManager.readCacheRecord(r.account,this.config.authOptions.clientId,r,s),c.accessToken){if(Br.wasClockTurnedBack(c.accessToken.cachedAt)||Br.isTokenExpired(c.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw(o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(lo.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),j.createRefreshRequiredError();if(c.accessToken.refreshOn&&Br.isTokenExpired(c.accessToken.refreshOn,0))throw(a=this.serverTelemetryManager)===null||a===void 0||a.setCacheOutcome(lo.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),j.createRefreshRequiredError()}else throw(i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(lo.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),j.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(c,r)];case 1:return[2,l.sent()]}})})},e.prototype.generateResultFromCacheRecord=function(r,n){return Z(this,void 0,void 0,function(){var i,o;return ee(this,function(a){switch(a.label){case 0:if(r.idToken&&(i=new Tn(r.idToken.secret,this.config.cryptoInterface)),n.maxAge||n.maxAge===0){if(o=i==null?void 0:i.claims.auth_time,!o)throw j.createAuthTimeNotFoundError();Tn.checkMaxAge(o,n.maxAge)}return[4,Bd.generateAuthenticationResult(this.cryptoUtils,this.authority,r,!0,n,i)];case 1:return[2,a.sent()]}})})},e}(n0);function w_(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}var o3={endpointMetadata:{"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"}},instanceDiscoveryMetadata:{"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"]}]}}},sm=o3.endpointMetadata,cm=o3.instanceDiscoveryMetadata;var qd;(function(t){t.AAD="AAD",t.OIDC="OIDC"})(qd||(qd={}));var h2=function(){function t(){this.expiresAt=Br.nowSeconds()+Fs.REFRESH_TIME_SECONDS}return t.prototype.updateCloudDiscoveryMetadata=function(e,r){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=r},t.prototype.updateEndpointMetadata=function(e,r){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=r,this.jwks_uri=e.jwks_uri},t.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},t.prototype.resetExpiresAt=function(){this.expiresAt=Br.nowSeconds()+Fs.REFRESH_TIME_SECONDS},t.prototype.isExpired=function(){return this.expiresAt<=Br.nowSeconds()},t.isAuthorityMetadataEntity=function(e,r){return r?e.indexOf(Fs.CACHE_KEY)===0&&r.hasOwnProperty("aliases")&&r.hasOwnProperty("preferred_cache")&&r.hasOwnProperty("preferred_network")&&r.hasOwnProperty("canonical_authority")&&r.hasOwnProperty("authorization_endpoint")&&r.hasOwnProperty("token_endpoint")&&r.hasOwnProperty("issuer")&&r.hasOwnProperty("aliasesFromNetwork")&&r.hasOwnProperty("endpointsFromNetwork")&&r.hasOwnProperty("expiresAt")&&r.hasOwnProperty("jwks_uri"):!1},t}();function x_(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}function E_(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}var C_=function(){function t(e){this.networkInterface=e}return t.prototype.detectRegion=function(e,r,n){return Z(this,void 0,void 0,function(){var i,o,a,s,c;return ee(this,function(l){switch(l.label){case 0:if(i=e,i)return[3,8];o=t.IMDS_OPTIONS,n&&(o.proxyUrl=n),l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(_.IMDS_VERSION,o)];case 2:return a=l.sent(),a.status===ca.httpSuccess&&(i=a.body,r.region_source=vi.IMDS),a.status!==ca.httpBadRequest?[3,5]:[4,this.getCurrentVersion(o)];case 3:return s=l.sent(),s?[4,this.getRegionFromIMDS(s,o)]:(r.region_source=vi.FAILED_AUTO_DETECTION,[2,null]);case 4:c=l.sent(),c.status===ca.httpSuccess&&(i=c.body,r.region_source=vi.IMDS),l.label=5;case 5:return[3,7];case 6:return l.sent(),r.region_source=vi.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:r.region_source=vi.ENVIRONMENT_VARIABLE,l.label=9;case 9:return i||(r.region_source=vi.FAILED_AUTO_DETECTION),[2,i||null]}})})},t.prototype.getRegionFromIMDS=function(e,r){return Z(this,void 0,void 0,function(){return ee(this,function(n){return[2,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?api-version="+e+"&format=text",r,_.IMDS_TIMEOUT)]})})},t.prototype.getCurrentVersion=function(e){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?format=json",e)];case 1:return r=n.sent(),r.status===ca.httpBadRequest&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?[2,r.body["newest-versions"][0]]:[2,null];case 2:return n.sent(),[2,null];case 3:return[2]}})})},t.IMDS_OPTIONS={headers:{Metadata:"true"}},t}();var Gd=function(){function t(e,r,n,i,o,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=i,this.regionDiscovery=new C_(r),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=a||_.EMPTY_STRING,this.logger=o}return Object.defineProperty(t.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;if(e.length)switch(e[0].toLowerCase()){case _.ADFS:return Fr.Adfs;case _.DSTS:return Fr.Dsts}return Fr.Default},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new be(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw j.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),t.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},t.prototype.replacePath=function(e){var r=e,n=new be(this.metadata.canonical_authority),i=n.getUrlComponents().PathSegments,o=this.canonicalAuthorityUrlComponents.PathSegments;return o.forEach(function(a,s){var c=i[s];a!==c&&(r=r.replace("/"+c+"/","/"+a+"/"))}),r},Object.defineProperty(t.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===Fr.Adfs||this.authorityType===Fr.Dsts||this.protocolMode===qd.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),t.prototype.discoveryComplete=function(){return!!this.metadata},t.prototype.resolveEndpointsAsync=function(){return Z(this,void 0,void 0,function(){var e,r,n,i;return ee(this,function(o){switch(o.label){case 0:return e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort),e||(e=new h2,e.updateCanonicalAuthority(this.canonicalAuthority)),[4,this.updateCloudDiscoveryMetadata(e)];case 1:return r=o.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network),[4,this.updateEndpointMetadata(e)];case 2:return n=o.sent(),r!==Or.CACHE&&n!==Or.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority)),i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache),this.cacheManager.setAuthorityMetadata(i,e),this.metadata=e,[2]}})})},t.prototype.updateEndpointMetadata=function(e){var r,n;return Z(this,void 0,void 0,function(){var i,o;return ee(this,function(a){switch(a.label){case 0:return i=this.getEndpointMetadataFromConfig(),i?(e.updateEndpointMetadata(i,!1),[2,Or.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,Or.CACHE]:(o=this.getEndpointMetadataFromHardcodedValues(),[4,this.getEndpointMetadataFromNetwork()]);case 1:return i=a.sent(),i?!((r=this.authorityOptions.azureRegionConfiguration)===null||r===void 0)&&r.azureRegion?[4,this.updateMetadataWithRegionalInformation(i)]:[3,3]:[3,4];case 2:i=a.sent(),a.label=3;case 3:return e.updateEndpointMetadata(i,!0),[2,Or.NETWORK];case 4:return o&&!this.authorityOptions.skipAuthorityMetadataCache?!((n=this.authorityOptions.azureRegionConfiguration)===null||n===void 0)&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(o)]:[3,6]:[3,7];case 5:o=a.sent(),a.label=6;case 6:return e.updateEndpointMetadata(o,!1),[2,Or.HARDCODED_VALUES];case 7:throw j.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},t.prototype.isAuthoritySameType=function(e){var r=new be(e.canonical_authority),n=r.getUrlComponents().PathSegments;return n.length===this.canonicalAuthorityUrlComponents.PathSegments.length},t.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Fe.createInvalidAuthorityMetadataError()}return null},t.prototype.getEndpointMetadataFromNetwork=function(){return Z(this,void 0,void 0,function(){var e,r;return ee(this,function(n){switch(n.label){case 0:e={},this.proxyUrl&&(e.proxyUrl=this.proxyUrl),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,e)];case 2:return r=n.sent(),[2,w_(r.body)?r.body:null];case 3:return n.sent(),[2,null];case 4:return[2]}})})},t.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in sm?sm[this.canonicalAuthority]:null},t.prototype.updateMetadataWithRegionalInformation=function(e){var r,n,i,o,a;return Z(this,void 0,void 0,function(){var s,c;return ee(this,function(l){switch(l.label){case 0:return[4,this.regionDiscovery.detectRegion((r=this.authorityOptions.azureRegionConfiguration)===null||r===void 0?void 0:r.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)];case 1:return s=l.sent(),c=((n=this.authorityOptions.azureRegionConfiguration)===null||n===void 0?void 0:n.azureRegion)===_.AZURE_REGION_AUTO_DISCOVER_FLAG?s:(i=this.authorityOptions.azureRegionConfiguration)===null||i===void 0?void 0:i.azureRegion,((o=this.authorityOptions.azureRegionConfiguration)===null||o===void 0?void 0:o.azureRegion)===_.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=s?no.AUTO_DETECTION_REQUESTED_SUCCESSFUL:no.AUTO_DETECTION_REQUESTED_FAILED:s?this.regionDiscoveryMetadata.region_outcome=((a=this.authorityOptions.azureRegionConfiguration)===null||a===void 0?void 0:a.azureRegion)===s?no.CONFIGURED_MATCHES_DETECTED:no.CONFIGURED_NOT_DETECTED:this.regionDiscoveryMetadata.region_outcome=no.CONFIGURED_NO_AUTO_DETECTION,c?(this.regionDiscoveryMetadata.region_used=c,[2,t.replaceWithRegionalInformation(e,c)]):[2,e]}})})},t.prototype.updateCloudDiscoveryMetadata=function(e){return Z(this,void 0,void 0,function(){var r,n,i;return ee(this,function(o){switch(o.label){case 0:return this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||_.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||_.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(e.canonical_authority||_.NOT_APPLICABLE)),r=this.getCloudDiscoveryMetadataFromConfig(),r?(this.logger.verbose("Found cloud discovery metadata in the config."),e.updateCloudDiscoveryMetadata(r,!1),[2,Or.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),n=e.isExpired(),this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!n?(this.logger.verbose("Found metadata in the cache."),[2,Or.CACHE]):(n&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(r=o.sent(),r)return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),e.updateCloudDiscoveryMetadata(r,!0),[2,Or.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),i=this.getCloudDiscoveryMetadataFromHarcodedValues(),i&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(i,!1),[2,Or.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),Fe.createUntrustedAuthorityError()}})})},t.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=t.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Fe.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},t.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return Z(this,void 0,void 0,function(){var e,r,n,i,o,a,s,c;return ee(this,function(l){switch(l.label){case 0:e=""+_.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",r={},this.proxyUrl&&(r.proxyUrl=this.proxyUrl),n=null,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(e,r)];case 2:if(i=l.sent(),o=void 0,a=void 0,x_(i.body))o=i.body,a=o.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+o.tenant_discovery_endpoint);else if(E_(i.body)){if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+i.status),o=i.body,o.error===_.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+o.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+o.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),n=t.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4];case 3:return s=l.sent(),s instanceof W?this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
|
|
11
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function Td(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var un=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=tr(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(g){e={error:g}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}else a.remove(this);var d=this.initialTeardown;if(Te(d))try{d()}catch(g){o=g instanceof yh?g.errors:[g]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var u=tr(h),f=u.next();!f.done;f=u.next()){var v=f.value;try{Gp(v)}catch(g){o=o??[],g instanceof yh?o=ri(ri([],An(o)),An(g.errors)):o.push(g)}}}catch(g){n={error:g}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}if(o)throw new yh(o)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Gp(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&Td(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&Td(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),kg=un.EMPTY;function Ag(t){return t instanceof un||t&&"closed"in t&&Te(t.remove)&&Te(t.add)&&Te(t.unsubscribe)}function Gp(t){Te(t)?t():t.unsubscribe()}var Gf={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},e2={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=e2.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,ri([t,e],An(r))):setTimeout.apply(void 0,ri([t,e],An(r)))},clearTimeout:function(t){var e=e2.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Tg(t){e2.setTimeout(function(){throw t})}function Id(){}var fl=null;function Ul(t){if(Gf.useDeprecatedSynchronousErrorHandling){var e=!fl;if(e&&(fl={errorThrown:!1,error:null}),t(),e){var r=fl,n=r.errorThrown,i=r.error;if(fl=null,n)throw i}}else t()}var Kf=function(t){Wt(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Ag(r)&&r.add(n)):n.destination=L7,n}return e.create=function(r,n,i){return new Md(r,n,i)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(un),P7=Function.prototype.bind;function _h(t,e){return P7.call(t,e)}var R7=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){pl(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){pl(n)}else pl(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){pl(r)}},t}(),Md=function(t){Wt(e,t);function e(r,n,i){var o=t.call(this)||this,a;if(Te(r)||!r)a={next:r??void 0,error:n??void 0,complete:i??void 0};else{var s;o&&Gf.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return o.unsubscribe()},a={next:r.next&&_h(r.next,s),error:r.error&&_h(r.error,s),complete:r.complete&&_h(r.complete,s)}):a=r}return o.destination=new R7(a),o}return e}(Kf);function pl(t){Tg(t)}function H7(t){throw t}var L7={closed:!0,next:Id,error:H7,complete:Id},Wf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ji(t){return t}function O7(t){return t.length===0?ji:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var Pe=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,o=N7(e)?e:new Md(e,r,n);return Ul(function(){var a=i,s=a.operator,c=a.source;o.add(s?s.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Kp(r),new r(function(i,o){var a=new Md({next:function(s){try{e(s)}catch(c){o(c),a.unsubscribe()}},error:o,complete:i});n.subscribe(a)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Wf]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return O7(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Kp(e),new e(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},t.create=function(e){return new t(e)},t}();function Kp(t){var e;return(e=t??Gf.Promise)!==null&&e!==void 0?e:Promise}function D7(t){return t&&Te(t.next)&&Te(t.error)&&Te(t.complete)}function N7(t){return t&&t instanceof Kf||D7(t)&&Ag(t)}function V7(t){return Te(t==null?void 0:t.lift)}function mt(t){return function(e){if(V7(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Ze(t,e,r,n,i){return new F7(t,e,r,n,i)}var F7=function(t){Wt(e,t);function e(r,n,i,o,a,s){var c=t.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(l){try{n(l)}catch(d){r.error(d)}}:t.prototype._next,c._error=o?function(l){try{o(l)}catch(d){r.error(d)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(l){r.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(Kf),U7=E1(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Wn=function(t){Wt(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Wp(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new U7},e.prototype.next=function(r){var n=this;Ul(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=tr(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;Ul(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;Ul(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?kg:(this.currentObservers=null,s.push(r),new un(function(){n.currentObservers=null,Td(s,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,a=n.isStopped;i?r.error(o):a&&r.complete()},e.prototype.asObservable=function(){var r=new Pe;return r.source=this,r},e.create=function(r,n){return new Wp(r,n)},e}(Pe),Wp=function(t){Wt(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:kg},e}(Wn),C1=function(t){Wt(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,o=r._value;if(n)throw i;return this._throwIfClosed(),o},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Wn),Yf={now:function(){return(Yf.delegate||Date).now()},delegate:void 0},Ig=function(t){Wt(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=Yf);var o=t.call(this)||this;return o._bufferSize=r,o._windowTime=n,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,r),o._windowTime=Math.max(1,n),o}return e.prototype.next=function(r){var n=this,i=n.isStopped,o=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;i||(o.push(r),!a&&o.push(s.now()+c)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),c=0;c<s.length&&!r.closed;c+=o?1:2)r.next(s[c]);return this._checkFinalizedStatuses(r),n},e.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,i=r._timestampProvider,o=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var c=i.now(),l=0,d=1;d<o.length&&o[d]<=c;d+=2)l=d;l&&o.splice(0,l+1)}},e}(Wn),$7=function(t){Wt(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(un),Pd={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Pd.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,ri([t,e],An(r))):setInterval.apply(void 0,ri([t,e],An(r)))},clearInterval:function(t){var e=Pd.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},j7=function(t){Wt(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Pd.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Pd.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Td(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}($7),Yp=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=Yf.now,t}(),B7=function(t){Wt(e,t);function e(r,n){n===void 0&&(n=Yp.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Yp),Rd=new B7(j7),q7=Rd,Li=new Pe(function(t){return t.complete()});function Mg(t){return t&&Te(t.schedule)}function Qf(t){return t[t.length-1]}function Pg(t){return Te(Qf(t))?t.pop():void 0}function Xf(t){return Mg(Qf(t))?t.pop():void 0}function G7(t,e){return typeof Qf(t)=="number"?t.pop():e}var Jf=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Rg(t){return Te(t==null?void 0:t.then)}function Hg(t){return Te(t[Wf])}function Lg(t){return Symbol.asyncIterator&&Te(t==null?void 0:t[Symbol.asyncIterator])}function Og(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function K7(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Dg=K7();function Ng(t){return Te(t==null?void 0:t[Dg])}function Vg(t){return I7(this,arguments,function(){var r,n,i,o;return Sg(this,function(a){switch(a.label){case 0:r=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,wa(r.read())];case 3:return n=a.sent(),i=n.value,o=n.done,o?[4,wa(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,wa(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Fg(t){return Te(t==null?void 0:t.getReader)}function Hr(t){if(t instanceof Pe)return t;if(t!=null){if(Hg(t))return W7(t);if(Jf(t))return Y7(t);if(Rg(t))return Q7(t);if(Lg(t))return Ug(t);if(Ng(t))return X7(t);if(Fg(t))return J7(t)}throw Og(t)}function W7(t){return new Pe(function(e){var r=t[Wf]();if(Te(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Y7(t){return new Pe(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Q7(t){return new Pe(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,Tg)})}function X7(t){return new Pe(function(e){var r,n;try{for(var i=tr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}function Ug(t){return new Pe(function(e){Z7(t,e).catch(function(r){return e.error(r)})})}function J7(t){return Ug(Vg(t))}function Z7(t,e){var r,n,i,o;return x1(this,void 0,void 0,function(){var a,s;return Sg(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=M7(t),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Sn(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(o),!i)return o}function Hd(t,e){return e===void 0&&(e=0),mt(function(r,n){r.subscribe(Ze(n,function(i){return Sn(n,t,function(){return n.next(i)},e)},function(){return Sn(n,t,function(){return n.complete()},e)},function(i){return Sn(n,t,function(){return n.error(i)},e)}))})}function $g(t,e){return e===void 0&&(e=0),mt(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}function ey(t,e){return Hr(t).pipe($g(e),Hd(e))}function ty(t,e){return Hr(t).pipe($g(e),Hd(e))}function ry(t,e){return new Pe(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function ny(t,e){return new Pe(function(r){var n;return Sn(r,e,function(){n=t[Dg](),Sn(r,e,function(){var i,o,a;try{i=n.next(),o=i.value,a=i.done}catch(s){r.error(s);return}a?r.complete():r.next(o)},0,!0)}),function(){return Te(n==null?void 0:n.return)&&n.return()}})}function jg(t,e){if(!t)throw new Error("Iterable cannot be null");return new Pe(function(r){Sn(r,e,function(){var n=t[Symbol.asyncIterator]();Sn(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function iy(t,e){return jg(Vg(t),e)}function oy(t,e){if(t!=null){if(Hg(t))return ey(t,e);if(Jf(t))return ry(t,e);if(Rg(t))return ty(t,e);if(Lg(t))return jg(t,e);if(Ng(t))return ny(t,e);if(Fg(t))return iy(t,e)}throw Og(t)}function nr(t,e){return e?oy(t,e):Hr(t)}function Oi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xf(t);return nr(t,r)}function ay(t,e){var r=Te(t)?t:function(){return t},n=function(i){return i.error(r())};return new Pe(e?function(i){return e.schedule(n,0,i)}:n)}var z1=E1(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function po(t,e){var r=typeof e=="object";return new Promise(function(n,i){var o=!1,a;t.subscribe({next:function(s){a=s,o=!0},error:i,complete:function(){o?n(a):r?n(e.defaultValue):i(new z1)}})})}function on(t,e){var r=typeof e=="object";return new Promise(function(n,i){var o=new Md({next:function(a){n(a),o.unsubscribe()},error:i,complete:function(){r?n(e.defaultValue):i(new z1)}});t.subscribe(o)})}function Bg(t){return t instanceof Date&&!isNaN(t)}var sy=E1(function(t){return function(r){r===void 0&&(r=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function cy(t,e){var r=Bg(t)?{first:t}:typeof t=="number"?{each:t}:t,n=r.first,i=r.each,o=r.with,a=o===void 0?ly:o,s=r.scheduler,c=s===void 0?e??Rd:s,l=r.meta,d=l===void 0?null:l;if(n==null&&i==null)throw new TypeError("No timeout provided.");return mt(function(h,u){var f,v,g=null,x=0,m=function(p){v=Sn(u,c,function(){try{f.unsubscribe(),Hr(a({meta:d,lastValue:g,seen:x})).subscribe(u)}catch(y){u.error(y)}},p)};f=h.subscribe(Ze(u,function(p){v==null||v.unsubscribe(),x++,u.next(g=p),i>0&&m(i)},void 0,void 0,function(){v!=null&&v.closed||v==null||v.unsubscribe(),g=null})),!x&&m(n!=null?typeof n=="number"?n:+n-c.now():i)})}function ly(t){throw new sy(t)}function Ge(t,e){return mt(function(r,n){var i=0;r.subscribe(Ze(n,function(o){n.next(t.call(e,o,i++))}))})}var dy=Array.isArray;function hy(t,e){return dy(e)?t.apply(void 0,ri([],An(e))):t(e)}function qg(t){return Ge(function(e){return hy(t,e)})}var uy=Array.isArray,fy=Object.getPrototypeOf,py=Object.prototype,my=Object.keys;function vy(t){if(t.length===1){var e=t[0];if(uy(e))return{args:e,keys:null};if(gy(e)){var r=my(e);return{args:r.map(function(n){return e[n]}),keys:r}}}return{args:t,keys:null}}function gy(t){return t&&typeof t=="object"&&fy(t)===py}function yy(t,e){return t.reduce(function(r,n,i){return r[n]=e[i],r},{})}function _y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xf(t),n=Pg(t),i=vy(t),o=i.args,a=i.keys;if(o.length===0)return nr([],r);var s=new Pe(by(o,r,a?function(c){return yy(a,c)}:ji));return n?s.pipe(qg(n)):s}function by(t,e,r){return r===void 0&&(r=ji),function(n){Qp(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,c=function(d){Qp(e,function(){var h=nr(t[d],e),u=!1;h.subscribe(Ze(n,function(f){o[d]=f,u||(u=!0,s--),s||n.next(r(o.slice()))},function(){--a||n.complete()}))},n)},l=0;l<i;l++)c(l)},n)}}function Qp(t,e,r){t?Sn(r,t,e):e()}function Gg(t,e,r,n,i,o,a,s){var c=[],l=0,d=0,h=!1,u=function(){h&&!c.length&&!l&&e.complete()},f=function(g){return l<n?v(g):c.push(g)},v=function(g){o&&e.next(g),l++;var x=!1;Hr(r(g,d++)).subscribe(Ze(e,function(m){i==null||i(m),o?f(m):e.next(m)},function(){x=!0},void 0,function(){if(x)try{l--;for(var m=function(){var p=c.shift();a?Sn(e,a,function(){return v(p)}):v(p)};c.length&&l<n;)m();u()}catch(p){e.error(p)}}))};return t.subscribe(Ze(e,f,function(){h=!0,u()})),function(){s==null||s()}}function zo(t,e,r){return r===void 0&&(r=1/0),Te(e)?zo(function(n,i){return Ge(function(o,a){return e(n,o,i,a)})(Hr(t(n,i)))},r):(typeof e=="number"&&(r=e),mt(function(n,i){return Gg(n,i,t,r)}))}function wy(t){return t===void 0&&(t=1/0),zo(ji,t)}var xy=["addListener","removeListener"],Ey=["addEventListener","removeEventListener"],Cy=["on","off"];function t2(t,e,r,n){if(Te(r)&&(n=r,r=void 0),n)return t2(t,e,r).pipe(qg(n));var i=An(ky(t)?Ey.map(function(s){return function(c){return t[s](e,c,r)}}):zy(t)?xy.map(Xp(t,e)):Sy(t)?Cy.map(Xp(t,e)):[],2),o=i[0],a=i[1];if(!o&&Jf(t))return zo(function(s){return t2(s,e,r)})(Hr(t));if(!o)throw new TypeError("Invalid event target");return new Pe(function(s){var c=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return s.next(1<l.length?l:l[0])};return o(c),function(){return a(c)}})}function Xp(t,e){return function(r){return function(n){return t[r](e,n)}}}function zy(t){return Te(t.addListener)&&Te(t.removeListener)}function Sy(t){return Te(t.on)&&Te(t.off)}function ky(t){return Te(t.addEventListener)&&Te(t.removeEventListener)}function Ay(t,e,r){t===void 0&&(t=0),r===void 0&&(r=q7);var n=-1;return e!=null&&(Mg(e)?r=e:n=e),new Pe(function(i){var o=Bg(t)?+t-r.now():t;o<0&&(o=0);var a=0;return r.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function Kg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Xf(t),n=G7(t,1/0),i=t;return i.length?i.length===1?Hr(i[0]):wy(n)(nr(i,r)):Li}function Kt(t,e){return mt(function(r,n){var i=0;r.subscribe(Ze(n,function(o){return t.call(e,o,i++)&&n.next(o)}))})}function Kr(t){return mt(function(e,r){var n=null,i=!1,o;n=e.subscribe(Ze(r,void 0,void 0,function(a){o=Hr(t(a,Kr(t)(e))),n?(n.unsubscribe(),n=null,o.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,o.subscribe(r))})}function Ty(t,e,r,n,i){return function(o,a){var s=r,c=e,l=0;o.subscribe(Ze(a,function(d){var h=l++;c=s?t(c,d,h):(s=!0,d),n&&a.next(c)},i&&function(){s&&a.next(c),a.complete()}))}}function Iy(t){return mt(function(e,r){var n=!1;e.subscribe(Ze(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}))})}function Wg(t,e){return e===void 0&&(e=ji),t=t??My,mt(function(r,n){var i,o=!0;r.subscribe(Ze(n,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,n.next(a))}))})}function My(t,e){return t===e}function Py(t){return t===void 0&&(t=Ry),mt(function(e,r){var n=!1;e.subscribe(Ze(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}function Ry(){return new z1}function Hy(t){return t<=0?function(){return Li}:mt(function(e,r){var n=[];e.subscribe(Ze(r,function(i){n.push(i),t<n.length&&n.shift()},function(){var i,o;try{for(var a=tr(n),s=a.next();!s.done;s=a.next()){var c=s.value;r.next(c)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}r.complete()},void 0,function(){n=null}))})}function Zf(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Kt(function(i,o){return t(i,o,n)}):ji,Hy(1),r?Iy(e):Py(function(){return new z1}))}}function Ly(t,e,r){return r===void 0&&(r=1/0),mt(function(n,i){var o=e;return Gg(n,i,function(a,s){return t(o,a,s)},r,function(a){o=a},!1,void 0,function(){return o=null})})}function r2(){return mt(function(t,e){var r,n=!1;t.subscribe(Ze(e,function(i){var o=r;r=i,n&&e.next([o,i]),n=!0}))})}function Yg(t,e){return mt(Ty(t,e,arguments.length>=2,!0))}function Bn(t,e){return mt(function(r,n){var i=null,o=0,a=!1,s=function(){return a&&!i&&n.complete()};r.subscribe(Ze(n,function(c){i==null||i.unsubscribe();var l=0,d=o++;Hr(t(c,d)).subscribe(i=Ze(n,function(h){return n.next(e?e(c,h,d,l++):h)},function(){i=null,s()}))},function(){a=!0,s()}))})}function Oy(t){return mt(function(e,r){Hr(t).subscribe(Ze(r,function(){return r.complete()},Id)),!r.closed&&e.subscribe(r)})}function Qg(t,e){return e===void 0&&(e=!1),mt(function(r,n){var i=0;r.subscribe(Ze(n,function(o){var a=t(o,i++);(a||e)&&n.next(o),!a&&n.complete()}))})}function Jp(t,e,r){var n=Te(t)||e||r?{next:t,error:e,complete:r}:t;return n?mt(function(i,o){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;i.subscribe(Ze(o,function(c){var l;(l=n.next)===null||l===void 0||l.call(n,c),o.next(c)},function(){var c;s=!1,(c=n.complete)===null||c===void 0||c.call(n),o.complete()},function(c){var l;s=!1,(l=n.error)===null||l===void 0||l.call(n,c),o.error(c)},function(){var c,l;s&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(l=n.finalize)===null||l===void 0||l.call(n)}))}):ji}function Xg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Pg(t);return mt(function(n,i){for(var o=t.length,a=new Array(o),s=t.map(function(){return!1}),c=!1,l=function(h){Hr(t[h]).subscribe(Ze(i,function(u){a[h]=u,!c&&!s[h]&&(s[h]=!0,(c=s.every(ji))&&(s=null))},Id))},d=0;d<o;d++)l(d);n.subscribe(Ze(i,function(h){if(c){var u=ri([h],An(a));i.next(r?r.apply(void 0,ri([],An(u))):u)}}))})}var mn=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class Dy extends Error{constructor(){super("It was too slow"),this.name="RequiredModuleTimeoutError"}}class Ny{constructor(e){this.logger=new Cg("ModulesConfigurator"),this._configs=[],this._afterConfiguration=[],this._afterInit=[],this._modules=new Set(e)}get modules(){return[...this._modules]}configure(...e){e.forEach(r=>this.addConfig(r))}addConfig(e){const{module:r,afterConfig:n,afterInit:i,configure:o}=e;this._modules.add(r),o&&this._configs.push((a,s)=>o(a[r.name],s)),n&&this._afterConfiguration.push(a=>n(a[r.name])),i&&this._afterInit.push(a=>i(a[r.name]))}onConfigured(e){this._afterConfiguration.push(e)}onInitialized(e){this._afterInit.push(e)}initialize(e){return mn(this,void 0,void 0,function*(){const r=yield this._configure(e),n=yield this._initialize(r,e);return yield this._postInitialize(n,e),Object.seal(Object.assign({},n,{dispose:()=>this.dispose(n)}))})}_configure(e){return mn(this,void 0,void 0,function*(){const r=yield this._createConfig(e);return yield Promise.all(this._configs.map(n=>Promise.resolve(n(r,e)))),yield this._postConfigure(r),r})}_createConfig(e){const{modules:r,logger:n,_afterConfiguration:i,_afterInit:o}=this,a=nr(r).pipe(zo(s=>mn(this,void 0,void 0,function*(){var c;n.debug(`🛠 creating configurator ${n.formatModuleName(s)}`);try{const l=yield(c=s.configure)===null||c===void 0?void 0:c.call(s,e);return n.debug(`🛠 created configurator for ${n.formatModuleName(s)}`,l),{[s.name]:l}}catch(l){throw n.error(`🛠 Failed to created configurator for ${n.formatModuleName(s)}`,l),l}})),Yg((s,c)=>Object.assign(s,c),{onAfterConfiguration(s){i.push(s)},onAfterInit(s){o.push(s)}}));return po(a)}_postConfigure(e){return mn(this,void 0,void 0,function*(){const{modules:r,logger:n,_afterConfiguration:i}=this;if(yield Promise.allSettled(r.filter(o=>!!o.postConfigure).map(o=>mn(this,void 0,void 0,function*(){var a;try{yield(a=o.postConfigure)===null||a===void 0?void 0:a.call(o,e),n.debug(`🏗📌 post configured ${n.formatModuleName(o)}`,o)}catch{n.warn(`🏗📌 post configure failed ${n.formatModuleName(o)}`)}}))),i.length)try{n.debug(`🏗📌 post configure hooks [${i.length}]`),yield Promise.allSettled(i.map(o=>Promise.resolve(o(e)))),n.debug("🏗📌 post configure hooks complete")}catch(o){n.warn("🏗📌 post configure hook failed",o)}})}_initialize(e,r){return mn(this,void 0,void 0,function*(){const{modules:n,logger:i}=this,o=n.map(d=>d.name),a=new C1({}),s=d=>o.includes(d),c=(d,h=60)=>{if(!o.includes(d))throw i.error(`🚀⌛️ Cannot not require ${i.formatModuleName(String(d))} since module is not defined!`),Error(`cannot not require [${String(d)}] since module is not defined!`);return a.value[d]?(i.debug(`🚀⌛️ ${i.formatModuleName(String(d))} is initiated, skipping queue`),Promise.resolve(a.value[d])):(i.debug(`🚀⌛️ Awaiting init ${i.formatModuleName(String(d))}, timeout ${h}s`),on(a.pipe(Kt(u=>!!u[d]),Ge(u=>u[d]),cy({each:h*1e3,with:()=>ay(()=>new Dy)}))))};nr(n).pipe(zo(d=>{const h=d.name;return i.debug(`🚀 initializing ${i.formatModuleName(d)}`),nr(Promise.resolve(d.initialize({ref:r,config:e[h],requireInstance:c,hasModule:s}))).pipe(Ge(u=>(i.debug(`🚀 initialized ${i.formatModuleName(d)}`),[h,u])))})).subscribe({next:([d,h])=>{a.next(Object.assign(a.value,{[d]:h}))},complete:()=>a.complete()});const l=yield po(a);return Object.seal(l),l})}_postInitialize(e,r){return mn(this,void 0,void 0,function*(){const{modules:n,logger:i,_afterInit:o}=this;if(yield Promise.allSettled(n.filter(a=>!!a.postInitialize).map(a=>mn(this,void 0,void 0,function*(){var s;try{i.debug(`🚀📌 post initializing moule ${i.formatModuleName(a)}`),yield(s=a.postInitialize)===null||s===void 0?void 0:s.call(a,{ref:r,modules:e,instance:e[a.name]}),i.debug(`🚀📌 post initialized moule ${i.formatModuleName(a)}`)}catch{i.warn(`🚀📌 post initialize failed moule ${i.formatModuleName(a)}`)}}))),o.length)try{i.debug(`🚀📌 post configure hooks [${o.length}]`),yield Promise.allSettled(o.map(a=>Promise.resolve(a(e)))),i.debug("🚀📌 post configure hooks complete")}catch(a){i.warn("🚀📌 post configure hook failed",a)}i.debug(`🎉 Modules initialized ${n.map(i.formatModuleName)}`,e),i.info("🟢 Modules initialized")})}dispose(e,r){return mn(this,void 0,void 0,function*(){const{modules:n}=this;yield Promise.allSettled(n.filter(i=>!!i.dispose).map(i=>mn(this,void 0,void 0,function*(){var o;yield(o=i.dispose)===null||o===void 0?void 0:o.call(i,{ref:r,modules:e,instance:e[i.name]})})))})}}globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;var Do=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yi=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$l,jl,fs,Bl,ps,n2;class Vy{constructor(e,r){this.__type=e,$l.set(this,void 0),jl.set(this,void 0),fs.set(this,!1),Bl.set(this,void 0),ps.set(this,void 0),n2.set(this,Date.now()),Do(this,$l,r.detail,"f"),Do(this,jl,r.source,"f"),Do(this,Bl,!!r.cancelable,"f"),Do(this,ps,r.canBubble===void 0?!0:r.canBubble,"f")}get bubbles(){return Yi(this,ps,"f")&&!Yi(this,fs,"f")}get created(){return Yi(this,n2,"f")}get cancelable(){return Yi(this,Bl,"f")}get canceled(){return Yi(this,fs,"f")}get detail(){return Yi(this,$l,"f")}get source(){return Yi(this,jl,"f")}get type(){return this.__type}preventDefault(){this.cancelable&&Do(this,fs,!0,"f")}stopPropagation(){Do(this,ps,!1,"f")}}$l=new WeakMap,jl=new WeakMap,fs=new WeakMap,Bl=new WeakMap,ps=new WeakMap,n2=new WeakMap;var Fy=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class Uy{constructor({onDispatch:e,onBubble:r}){this.__onDispatch=e,this.__onBubble=r}dispatch(e,r){var n,i;return Fy(this,void 0,void 0,function*(){try{yield(n=this.__onDispatch)===null||n===void 0?void 0:n.call(this,e)}catch(a){throw a}const o=e;if(!o.dispatcher)o.dispatcher=this;else if(o.dispatcher===this)throw Error("loop detected");for(const a of r)e.cancelable?e.canceled||(yield Promise.resolve(a(e))):a(e);if(e.bubbles)try{yield(i=this.__onBubble)===null||i===void 0?void 0:i.call(this,e)}catch(a){throw a}})}}var Zp=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class $y extends Pe{get closed(){return this.__event$.closed}constructor(e){super(r=>{this.__event$.subscribe(r)}),this.__listeners=[],this.__event$=new Wn,this.__dispatcher=new Uy({onDispatch:e.onDispatch,onBubble:e.onBubble})}addEventListener(e,r){if(this.closed)throw Error("Cannot listen to events when provider is closed!");const n={type:e,handler:r};return this.__listeners.push(n),()=>{const i=this.__listeners.indexOf(n);0<=i&&this.__listeners.splice(i,1)}}dispatchEvent(e,r){return Zp(this,void 0,void 0,function*(){if(typeof e=="string"){if(!r)throw Error("invalid arguments, missing [FrameworkEventInit]");return this._dispatchEvent(new Vy(e,r))}else return this._dispatchEvent(e)})}_dispatchEvent(e){return Zp(this,void 0,void 0,function*(){if(this.closed)throw Error("Cannot dispatch events when provider is closed!");this.__event$.next(e);try{const r=this.__listeners.filter(n=>n.type===e.type).map(({handler:n})=>n);yield this.__dispatcher.dispatch(e,r)}catch(r){throw r}return e})}dispose(){this.__listeners=[],this.__event$.complete()}}var jy=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const By="event",qy={name:By,configure:t=>{const e={},r=t==null?void 0:t.event;return r&&(e.onBubble=n=>jy(void 0,void 0,void 0,function*(){yield r.dispatchEvent(n)})),e},initialize:({config:t})=>new $y(t),postInitialize({instance:t,modules:e}){t.dispatchEvent("onModulesLoaded",{detail:e,source:t})},dispose({instance:t}){t.dispose()}};class Jg{constructor(){this._operators={}}add(e,r){if(Object.keys(this._operators).includes(e))throw Error(`Operator [${e}] already defined`);return this.set(e,r)}set(e,r){return this._operators[e]=r,this}get(e){return this._operators[e]}process(e){return Object.values(this._operators).length?nr(Object.values(this._operators)).pipe(Ly((n,i)=>Promise.resolve(i(n)).then(o=>o??n),e,1),Zf()):Oi(e)}}const Gy=(t,e)=>r=>{const n=new Headers(r.headers);return n.append(t,e),Object.assign(Object.assign({},r),{headers:n})};class Zg extends Jg{setHeader(e,r){const n=Gy(e,r);return this.set("header-"+e,n)}}class Ky extends Jg{}class Wy{get clients(){return Object.assign({},this._clients)}constructor(e){this._clients={},this.defaultHttpRequestHandler=new Zg,this.defaultHttpClientCtor=e}hasClient(e){return Object.keys(this._clients).includes(e)}configureClient(e,r){const n=typeof r=="string"?o=>o.uri=String(r):r,i=typeof n=="function"?{onCreate:n}:n;return this._clients[e]=Object.assign(Object.assign({},this._clients[e]),i),this}}class Yy extends Error{constructor(e){super(e)}}const Qy=t=>new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t);class Xy{get defaultHttpRequestHandler(){return this.config.defaultHttpRequestHandler}constructor(e){this.config=e}hasClient(e){return Object.keys(this.config.clients).includes(e)}createClient(e){const r=this._resolveConfig(e),{baseUri:n,defaultScopes:i=[],onCreate:o,ctor:a=this.config.defaultHttpClientCtor,requestHandler:s=this.defaultHttpRequestHandler}=r,c={requestHandler:s},l=new a(n||"",c);return Object.assign(l,{defaultScopes:i}),o&&o(l),l}createCustomClient(e){return this.createClient(e)}_resolveConfig(e){if(typeof e=="string"){const r=this.config.clients[e];if(!r&&Qy(e))return{baseUri:e};if(!r)throw new Yy(`No registered http client for key [${e}]`);return r}return e}}function Jy(t,e){e===void 0&&(e={});var r=e.selector,n=zg(e,["selector"]);return new Pe(function(i){var o=new AbortController,a=o.signal,s=!0,c=n.signal;if(c)if(c.aborted)o.abort();else{var l=function(){a.aborted||o.abort()};c.addEventListener("abort",l),i.add(function(){return c.removeEventListener("abort",l)})}var d=lt(lt({},n),{signal:a}),h=function(u){s=!1,i.error(u)};return fetch(t,d).then(function(u){r?Hr(r(u)).subscribe(Ze(i,void 0,function(){s=!1,i.complete()},h)):(s=!1,i.next(u),i.complete())}).catch(h),function(){s&&o.abort()}})}const Zy=t=>{if(!t.ok)throw new Error("network response was not OK");if(t.status===204)return Promise.resolve();try{return t.json()}catch{throw Error("failed to parse response")}};class i2 extends Error{constructor(e,r,n){super(e,n),this.message=e,this.response=r}}var em=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};class e_{get request$(){return this._request$.asObservable()}get response$(){return this._response$.asObservable()}constructor(e,r){var n,i;this.uri=e,this._request$=new Wn,this._response$=new Wn,this._abort$=new Wn,this.requestHandler=(n=r==null?void 0:r.requestHandler)!==null&&n!==void 0?n:new Zg,this.responseHandler=(i=r==null?void 0:r.responseHandler)!==null&&i!==void 0?i:new Ky,this._init()}_init(){}fetch$(e,r){return this._fetch$(e,r)}fetch(e,r){return on(this.fetch$(e,r))}fetchAsync(e,r){return this.fetch(e,r)}json$(e,r){var n;const i=typeof(r==null?void 0:r.body)=="object"?JSON.stringify(r==null?void 0:r.body):r==null?void 0:r.body,o=(n=r==null?void 0:r.selector)!==null&&n!==void 0?n:Zy,a=new Headers(r==null?void 0:r.headers);return a.append("Content-Type","application/json"),this.fetch$(e,Object.assign(Object.assign({},r),{body:i,selector:o,headers:a}))}json(e,r){return on(this.json$(e,r))}jsonAsync(e,r){return this.json(e,r)}execute(e,r,n){return this[e](r,n)}abort(){this._abort$.next()}_fetch$(e,r){const n=r||{},{selector:i}=n,o=em(n,["selector"]);return Oi(Object.assign(Object.assign({},o),{uri:this._resolveUrl(e)})).pipe(Bn(s=>this._prepareRequest(s)),Jp(s=>this._request$.next(s)),Bn(s=>{var{uri:c,path:l}=s,d=em(s,["uri","path"]);return Jy(c,d)}),Bn(s=>this._prepareResponse(s)),Jp(s=>this._response$.next(s)),Bn(s=>{if(i)try{return i(s)}catch(c){throw new i2("failed to execute response selector",s,{cause:c})}return Oi(s)}),Oy(this._abort$))}_prepareRequest(e){return this.requestHandler.process(e)}_prepareResponse(e){return this.responseHandler.process(e)}_resolveUrl(e){const r=this.uri||window.location.origin;return new URL(e,r).href}}class t_ extends e_{constructor(){super(...arguments),this.defaultScopes=[]}fetch$(e,r){const n=Object.assign(r||{},{scopes:this.defaultScopes.concat((r==null?void 0:r.scopes)||[])});return super._fetch$(e,n)}}var tm=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const e0={name:"http",configure:()=>new Wy(t_),initialize:({config:t,hasModule:e,requireInstance:r})=>tm(void 0,void 0,void 0,function*(){const n=new Xy(t);if(e("auth")){const i=yield r("auth");n.defaultHttpRequestHandler.set("MSAL",o=>tm(void 0,void 0,void 0,function*(){const{scopes:a=[]}=o;if(a.length){const s=yield i.acquireToken({scopes:a});if(s){const c=new Headers(o.headers);return c.set("Authorization",`Bearer ${s.accessToken}`),Object.assign(Object.assign({},o),{headers:c})}}}))}return n})},r_=t=>({module:e0,configure:t}),e3=(t,e)=>({module:e0,configure:r=>{r.configureClient(t,e)}}),bh="default";class n_{constructor(){this._configs={},this.requiresAuth=!0}get defaultConfig(){return this._configs[bh]}getClientConfig(e){return this._configs[e]}configureClient(e,r){return this._configs[e]=r,this}configureDefault(e){if(this._configs[bh])throw Error("Default AuthClient already provided");this.configureClient(bh,e)}}var o2=function(t,e){return o2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},o2(t,e)};function It(t,e){o2(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var K=function(){return K=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},K.apply(this,arguments)};function rm(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function S(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})}function k(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(d){return c([l,d])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(d){l=[6,d],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function i_(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function t0(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i_(arguments[e]));return t}var a2=function(t,e){return a2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},a2(t,e)};function br(t,e){a2(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Re=function(){return Re=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Re.apply(this,arguments)};function Z(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})}function ee(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(d){return c([l,d])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(d){l=[6,d],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function S1(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var _={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Ic=[_.OPENID_SCOPE,_.PROFILE_SCOPE,_.OFFLINE_ACCESS_SCOPE],nm=S1(Ic,[_.EMAIL_SCOPE]),ln;(function(t){t.CONTENT_TYPE="Content-Type",t.RETRY_AFTER="Retry-After",t.CCS_HEADER="X-AnchorMailbox",t.WWWAuthenticate="WWW-Authenticate",t.AuthenticationInfo="Authentication-Info",t.X_MS_REQUEST_ID="x-ms-request-id"})(ln||(ln={}));var dt;(function(t){t.ID_TOKEN="idtoken",t.CLIENT_INFO="client.info",t.ADAL_ID_TOKEN="adal.idtoken",t.ERROR="error",t.ERROR_DESC="error.description",t.ACTIVE_ACCOUNT="active-account",t.ACTIVE_ACCOUNT_FILTERS="active-account-filters"})(dt||(dt={}));var Ld;(function(t){t.COMMON="common",t.ORGANIZATIONS="organizations",t.CONSUMERS="consumers"})(Ld||(Ld={}));var ne;(function(t){t.CLIENT_ID="client_id",t.REDIRECT_URI="redirect_uri",t.RESPONSE_TYPE="response_type",t.RESPONSE_MODE="response_mode",t.GRANT_TYPE="grant_type",t.CLAIMS="claims",t.SCOPE="scope",t.ERROR="error",t.ERROR_DESCRIPTION="error_description",t.ACCESS_TOKEN="access_token",t.ID_TOKEN="id_token",t.REFRESH_TOKEN="refresh_token",t.EXPIRES_IN="expires_in",t.STATE="state",t.NONCE="nonce",t.PROMPT="prompt",t.SESSION_STATE="session_state",t.CLIENT_INFO="client_info",t.CODE="code",t.CODE_CHALLENGE="code_challenge",t.CODE_CHALLENGE_METHOD="code_challenge_method",t.CODE_VERIFIER="code_verifier",t.CLIENT_REQUEST_ID="client-request-id",t.X_CLIENT_SKU="x-client-SKU",t.X_CLIENT_VER="x-client-VER",t.X_CLIENT_OS="x-client-OS",t.X_CLIENT_CPU="x-client-CPU",t.X_CLIENT_CURR_TELEM="x-client-current-telemetry",t.X_CLIENT_LAST_TELEM="x-client-last-telemetry",t.X_MS_LIB_CAPABILITY="x-ms-lib-capability",t.X_APP_NAME="x-app-name",t.X_APP_VER="x-app-ver",t.POST_LOGOUT_URI="post_logout_redirect_uri",t.ID_TOKEN_HINT="id_token_hint",t.DEVICE_CODE="device_code",t.CLIENT_SECRET="client_secret",t.CLIENT_ASSERTION="client_assertion",t.CLIENT_ASSERTION_TYPE="client_assertion_type",t.TOKEN_TYPE="token_type",t.REQ_CNF="req_cnf",t.OBO_ASSERTION="assertion",t.REQUESTED_TOKEN_USE="requested_token_use",t.ON_BEHALF_OF="on_behalf_of",t.FOCI="foci",t.CCS_HEADER="X-AnchorMailbox",t.RETURN_SPA_CODE="return_spa_code",t.NATIVE_BROKER="nativebroker",t.LOGOUT_HINT="logout_hint"})(ne||(ne={}));var sa;(function(t){t.ACCESS_TOKEN="access_token",t.XMS_CC="xms_cc"})(sa||(sa={}));var jt={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Vs;(function(t){t.ACCOUNT="account",t.SID="sid",t.LOGIN_HINT="login_hint",t.ID_TOKEN="id_token",t.DOMAIN_HINT="domain_hint",t.ORGANIZATIONS="organizations",t.CONSUMERS="consumers",t.ACCOUNT_ID="accountIdentifier",t.HOMEACCOUNT_ID="homeAccountIdentifier"})(Vs||(Vs={}));var im={PLAIN:"plain",S256:"S256"},Od;(function(t){t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post"})(Od||(Od={}));var Dd;(function(t){t.IMPLICIT_GRANT="implicit",t.AUTHORIZATION_CODE_GRANT="authorization_code",t.CLIENT_CREDENTIALS_GRANT="client_credentials",t.RESOURCE_OWNER_PASSWORD_GRANT="password",t.REFRESH_TOKEN_GRANT="refresh_token",t.DEVICE_CODE_GRANT="device_code",t.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer"})(Dd||(Dd={}));var Vn;(function(t){t.MSSTS_ACCOUNT_TYPE="MSSTS",t.ADFS_ACCOUNT_TYPE="ADFS",t.MSAV1_ACCOUNT_TYPE="MSA",t.GENERIC_ACCOUNT_TYPE="Generic"})(Vn||(Vn={}));var Tr;(function(t){t.CACHE_KEY_SEPARATOR="-",t.CLIENT_INFO_SEPARATOR="."})(Tr||(Tr={}));var de;(function(t){t.ID_TOKEN="IdToken",t.ACCESS_TOKEN="AccessToken",t.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",t.REFRESH_TOKEN="RefreshToken"})(de||(de={}));var mo;(function(t){t.ACCOUNT="Account",t.CREDENTIAL="Credential",t.ID_TOKEN="IdToken",t.ACCESS_TOKEN="AccessToken",t.REFRESH_TOKEN="RefreshToken",t.APP_METADATA="AppMetadata",t.TEMPORARY="TempCache",t.TELEMETRY="Telemetry",t.UNDEFINED="Undefined",t.THROTTLING="Throttling"})(mo||(mo={}));var qn;(function(t){t[t.ADFS=1001]="ADFS",t[t.MSA=1002]="MSA",t[t.MSSTS=1003]="MSSTS",t[t.GENERIC=1004]="GENERIC",t[t.ACCESS_TOKEN=2001]="ACCESS_TOKEN",t[t.REFRESH_TOKEN=2002]="REFRESH_TOKEN",t[t.ID_TOKEN=2003]="ID_TOKEN",t[t.APP_METADATA=3001]="APP_METADATA",t[t.UNDEFINED=9999]="UNDEFINED"})(qn||(qn={}));var s2="appmetadata",o_="client_info",Nd="1",Fs={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Or;(function(t){t.CONFIG="config",t.CACHE="cache",t.NETWORK="network",t.HARDCODED_VALUES="hardcoded_values"})(Or||(Or={}));var wt={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},Se;(function(t){t.BEARER="Bearer",t.POP="pop",t.SSH="ssh-cert"})(Se||(Se={}));var Us={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},om={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},Vd;(function(t){t.username="username",t.password="password"})(Vd||(Vd={}));var ca;(function(t){t[t.httpSuccess=200]="httpSuccess",t[t.httpBadRequest=400]="httpBadRequest"})(ca||(ca={}));var vi;(function(t){t.FAILED_AUTO_DETECTION="1",t.INTERNAL_CACHE="2",t.ENVIRONMENT_VARIABLE="3",t.IMDS="4"})(vi||(vi={}));var no;(function(t){t.CONFIGURED_MATCHES_DETECTED="1",t.CONFIGURED_NO_AUTO_DETECTION="2",t.CONFIGURED_NOT_DETECTED="3",t.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",t.AUTO_DETECTION_REQUESTED_FAILED="5"})(no||(no={}));var lo;(function(t){t.NO_CACHE_HIT="0",t.FORCE_REFRESH="1",t.NO_CACHED_ACCESS_TOKEN="2",t.CACHED_ACCESS_TOKEN_EXPIRED="3",t.REFRESH_CACHED_ACCESS_TOKEN="4"})(lo||(lo={}));var c2;(function(t){t.Jwt="JWT",t.Jwk="JWK"})(c2||(c2={}));var ml={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},postRequestFailed:{code:"post_request_failed",desc:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."}},W=function(t){br(e,t);function e(r,n,i){var o=this,a=n?r+": "+n:r;return o=t.call(this,a)||this,Object.setPrototypeOf(o,e.prototype),o.errorCode=r||_.EMPTY_STRING,o.errorMessage=n||_.EMPTY_STRING,o.subError=i||_.EMPTY_STRING,o.name="AuthError",o}return e.prototype.setCorrelationId=function(r){this.correlationId=r},e.createUnexpectedError=function(r){return new e(ml.unexpectedError.code,ml.unexpectedError.desc+": "+r)},e.createPostRequestFailed=function(r){return new e(ml.postRequestFailed.code,ml.postRequestFailed.desc+": "+r)},e}(Error);var Fd={createNewGuid:function(){var t="Crypto interface - createNewGuid() has not been implemented";throw W.createUnexpectedError(t)},base64Decode:function(){var t="Crypto interface - base64Decode() has not been implemented";throw W.createUnexpectedError(t)},base64Encode:function(){var t="Crypto interface - base64Encode() has not been implemented";throw W.createUnexpectedError(t)},generatePkceCodes:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - generatePkceCodes() has not been implemented",W.createUnexpectedError(t)})})},getPublicKeyThumbprint:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - getPublicKeyThumbprint() has not been implemented",W.createUnexpectedError(t)})})},removeTokenBindingKey:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - removeTokenBindingKey() has not been implemented",W.createUnexpectedError(t)})})},clearKeystore:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - clearKeystore() has not been implemented",W.createUnexpectedError(t)})})},signJwt:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - signJwt() has not been implemented",W.createUnexpectedError(t)})})},hashString:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Crypto interface - hashString() has not been implemented",W.createUnexpectedError(t)})})}};var R={clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoEmptyError:{code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},tokenParsingError:{code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},nullOrEmptyToken:{code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},networkError:{code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},unableToGetOpenidConfigError:{code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hashNotDeserialized:{code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},blankGuidGenerated:{code:"blank_guid_generated",desc:"The guid generated was blank. Please review the trace to determine the root cause."},invalidStateError:{code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},stateMismatchError:{code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},stateNotFoundError:{code:"state_not_found",desc:"State not found"},nonceMismatchError:{code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},nonceNotFoundError:{code:"nonce_not_found",desc:"nonce not found"},authTimeNotFoundError:{code:"auth_time_not_found",desc:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information."},maxAgeTranspiredError:{code:"max_age_transpired",desc:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication."},noTokensFoundError:{code:"no_tokens_found",desc:"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."},multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},multipleMatchingAccounts:{code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},multipleMatchingAppMetadata:{code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},tokenRequestCannotBeMade:{code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},appendEmptyScopeError:{code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},removeEmptyScopeError:{code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},appendScopeSetError:{code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},emptyInputScopeSetError:{code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},DeviceCodePollingCancelled:{code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},DeviceCodeExpired:{code:"device_code_expired",desc:"Device code is expired."},DeviceCodeUnknownError:{code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},NoAccountInSilentRequest:{code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},invalidCacheRecord:{code:"invalid_cache_record",desc:"Cache record object was null or undefined."},invalidCacheEnvironment:{code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},noAccountFound:{code:"no_account_found",desc:"No account found in cache for given key."},CachePluginError:{code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},noCryptoObj:{code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},unexpectedAccountType:{code:"unexpected_account_type",desc:"Unexpected account type."},unexpectedCredentialType:{code:"unexpected_credential_type",desc:"Unexpected credential type."},invalidAssertion:{code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},invalidClientCredential:{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"},tokenRefreshRequired:{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."},userTimeoutReached:{code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},tokenClaimsRequired:{code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},noAuthorizationCodeFromServer:{code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},noAzureRegionDetected:{code:"no_azure_region_detected",desc:"No azure region was detected and no fallback was made available"},accessTokenEntityNullError:{code:"access_token_entity_null",desc:"Access token entity is null, please check logs and cache to ensure a valid access token is present."},bindingKeyNotRemovedError:{code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},logoutNotSupported:{code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},keyIdMissing:{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."}},j=function(t){br(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="ClientAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createClientInfoDecodingError=function(r){return new e(R.clientInfoDecodingError.code,R.clientInfoDecodingError.desc+" Failed with error: "+r)},e.createClientInfoEmptyError=function(){return new e(R.clientInfoEmptyError.code,""+R.clientInfoEmptyError.desc)},e.createTokenParsingError=function(r){return new e(R.tokenParsingError.code,R.tokenParsingError.desc+" Failed with error: "+r)},e.createTokenNullOrEmptyError=function(r){return new e(R.nullOrEmptyToken.code,R.nullOrEmptyToken.desc+" Raw Token Value: "+r)},e.createEndpointDiscoveryIncompleteError=function(r){return new e(R.endpointResolutionError.code,R.endpointResolutionError.desc+" Detail: "+r)},e.createNetworkError=function(r,n){return new e(R.networkError.code,R.networkError.desc+" | Fetch client threw: "+n+" | Attempted to reach: "+r.split("?")[0])},e.createUnableToGetOpenidConfigError=function(r){return new e(R.unableToGetOpenidConfigError.code,R.unableToGetOpenidConfigError.desc+" Attempted to retrieve endpoints from: "+r)},e.createHashNotDeserializedError=function(r){return new e(R.hashNotDeserialized.code,R.hashNotDeserialized.desc+" Given Object: "+r)},e.createInvalidStateError=function(r,n){return new e(R.invalidStateError.code,R.invalidStateError.desc+" Invalid State: "+r+", Root Err: "+n)},e.createStateMismatchError=function(){return new e(R.stateMismatchError.code,R.stateMismatchError.desc)},e.createStateNotFoundError=function(r){return new e(R.stateNotFoundError.code,R.stateNotFoundError.desc+": "+r)},e.createNonceMismatchError=function(){return new e(R.nonceMismatchError.code,R.nonceMismatchError.desc)},e.createAuthTimeNotFoundError=function(){return new e(R.authTimeNotFoundError.code,R.authTimeNotFoundError.desc)},e.createMaxAgeTranspiredError=function(){return new e(R.maxAgeTranspiredError.code,R.maxAgeTranspiredError.desc)},e.createNonceNotFoundError=function(r){return new e(R.nonceNotFoundError.code,R.nonceNotFoundError.desc+": "+r)},e.createMultipleMatchingTokensInCacheError=function(){return new e(R.multipleMatchingTokens.code,R.multipleMatchingTokens.desc+".")},e.createMultipleMatchingAccountsInCacheError=function(){return new e(R.multipleMatchingAccounts.code,R.multipleMatchingAccounts.desc)},e.createMultipleMatchingAppMetadataInCacheError=function(){return new e(R.multipleMatchingAppMetadata.code,R.multipleMatchingAppMetadata.desc)},e.createTokenRequestCannotBeMadeError=function(){return new e(R.tokenRequestCannotBeMade.code,R.tokenRequestCannotBeMade.desc)},e.createAppendEmptyScopeToSetError=function(r){return new e(R.appendEmptyScopeError.code,R.appendEmptyScopeError.desc+" Given Scope: "+r)},e.createRemoveEmptyScopeFromSetError=function(r){return new e(R.removeEmptyScopeError.code,R.removeEmptyScopeError.desc+" Given Scope: "+r)},e.createAppendScopeSetError=function(r){return new e(R.appendScopeSetError.code,R.appendScopeSetError.desc+" Detail Error: "+r)},e.createEmptyInputScopeSetError=function(){return new e(R.emptyInputScopeSetError.code,""+R.emptyInputScopeSetError.desc)},e.createDeviceCodeCancelledError=function(){return new e(R.DeviceCodePollingCancelled.code,""+R.DeviceCodePollingCancelled.desc)},e.createDeviceCodeExpiredError=function(){return new e(R.DeviceCodeExpired.code,""+R.DeviceCodeExpired.desc)},e.createDeviceCodeUnknownError=function(){return new e(R.DeviceCodeUnknownError.code,""+R.DeviceCodeUnknownError.desc)},e.createNoAccountInSilentRequestError=function(){return new e(R.NoAccountInSilentRequest.code,""+R.NoAccountInSilentRequest.desc)},e.createNullOrUndefinedCacheRecord=function(){return new e(R.invalidCacheRecord.code,R.invalidCacheRecord.desc)},e.createInvalidCacheEnvironmentError=function(){return new e(R.invalidCacheEnvironment.code,R.invalidCacheEnvironment.desc)},e.createNoAccountFoundError=function(){return new e(R.noAccountFound.code,R.noAccountFound.desc)},e.createCachePluginError=function(){return new e(R.CachePluginError.code,""+R.CachePluginError.desc)},e.createNoCryptoObjectError=function(r){return new e(R.noCryptoObj.code,""+R.noCryptoObj.desc+r)},e.createInvalidCacheTypeError=function(){return new e(R.invalidCacheType.code,""+R.invalidCacheType.desc)},e.createUnexpectedAccountTypeError=function(){return new e(R.unexpectedAccountType.code,""+R.unexpectedAccountType.desc)},e.createUnexpectedCredentialTypeError=function(){return new e(R.unexpectedCredentialType.code,""+R.unexpectedCredentialType.desc)},e.createInvalidAssertionError=function(){return new e(R.invalidAssertion.code,""+R.invalidAssertion.desc)},e.createInvalidCredentialError=function(){return new e(R.invalidClientCredential.code,""+R.invalidClientCredential.desc)},e.createRefreshRequiredError=function(){return new e(R.tokenRefreshRequired.code,R.tokenRefreshRequired.desc)},e.createUserTimeoutReachedError=function(){return new e(R.userTimeoutReached.code,R.userTimeoutReached.desc)},e.createTokenClaimsRequiredError=function(){return new e(R.tokenClaimsRequired.code,R.tokenClaimsRequired.desc)},e.createNoAuthCodeInServerResponseError=function(){return new e(R.noAuthorizationCodeFromServer.code,R.noAuthorizationCodeFromServer.desc)},e.createBindingKeyNotRemovedError=function(){return new e(R.bindingKeyNotRemovedError.code,R.bindingKeyNotRemovedError.desc)},e.createLogoutNotSupportedError=function(){return new e(R.logoutNotSupported.code,R.logoutNotSupported.desc)},e.createKeyIdMissingError=function(){return new e(R.keyIdMissing.code,R.keyIdMissing.desc)},e}(W);var V=function(){function t(){}return t.decodeAuthToken=function(e){if(t.isEmpty(e))throw j.createTokenNullOrEmptyError(e);var r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=r.exec(e);if(!n||n.length<4)throw j.createTokenParsingError("Given token is malformed: "+JSON.stringify(e));var i={header:n[1],JWSPayload:n[2],JWSSig:n[3]};return i},t.isEmpty=function(e){return typeof e>"u"||!e||e.length===0},t.isEmptyObj=function(e){if(e&&!t.isEmpty(e))try{var r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0},t.startsWith=function(e,r){return e.indexOf(r)===0},t.endsWith=function(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length},t.queryStringToObject=function(e){var r={},n=e.split("&"),i=function(o){return decodeURIComponent(o.replace(/\+/g," "))};return n.forEach(function(o){if(o.trim()){var a=o.split(/=(.+)/g,2),s=a[0],c=a[1];s&&c&&(r[i(s)]=i(c))}}),r},t.trimArrayEntries=function(e){return e.map(function(r){return r.trim()})},t.removeEmptyStringsFromArray=function(e){return e.filter(function(r){return!t.isEmpty(r)})},t.jsonParseHelper=function(e){try{return JSON.parse(e)}catch{return null}},t.matchPattern=function(e,r){var n=new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?"));return n.test(r)},t}();var tt;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(tt||(tt={}));var r0=function(){function t(e,r,n){this.level=tt.Info;var i=function(){};this.localCallback=e.loggerCallback||i,this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level=typeof e.logLevel=="number"?e.logLevel:tt.Info,this.correlationId=e.correlationId||_.EMPTY_STRING,this.packageName=r||_.EMPTY_STRING,this.packageVersion=n||_.EMPTY_STRING}return t.prototype.clone=function(e,r,n){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:n||this.correlationId},e,r)},t.prototype.logMessage=function(e,r){if(!(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)){var n=new Date().toUTCString(),i;V.isEmpty(r.correlationId)?V.isEmpty(this.correlationId)?i="["+n+"]":i="["+n+"] : ["+this.correlationId+"]":i="["+n+"] : ["+r.correlationId+"]";var o=i+" : "+this.packageName+"@"+this.packageVersion+" : "+tt[r.logLevel]+" - "+e;this.executeCallback(r.logLevel,o,r.containsPii||!1)}},t.prototype.executeCallback=function(e,r,n){this.localCallback&&this.localCallback(e,r,n)},t.prototype.error=function(e,r){this.logMessage(e,{logLevel:tt.Error,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.errorPii=function(e,r){this.logMessage(e,{logLevel:tt.Error,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.warning=function(e,r){this.logMessage(e,{logLevel:tt.Warning,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.warningPii=function(e,r){this.logMessage(e,{logLevel:tt.Warning,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.info=function(e,r){this.logMessage(e,{logLevel:tt.Info,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.infoPii=function(e,r){this.logMessage(e,{logLevel:tt.Info,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.verbose=function(e,r){this.logMessage(e,{logLevel:tt.Verbose,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.verbosePii=function(e,r){this.logMessage(e,{logLevel:tt.Verbose,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.trace=function(e,r){this.logMessage(e,{logLevel:tt.Trace,containsPii:!1,correlationId:r||_.EMPTY_STRING})},t.prototype.tracePii=function(e,r){this.logMessage(e,{logLevel:tt.Trace,containsPii:!0,correlationId:r||_.EMPTY_STRING})},t.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},t}();var a_="@azure/msal-common",t3="9.0.1";var hc;(function(t){t[t.None=0]="None",t.AzurePublic="https://login.microsoftonline.com",t.AzurePpe="https://login.windows-ppe.net",t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureUsGovernment="https://login.microsoftonline.us"})(hc||(hc={}));var uc=function(){function t(){}return t.prototype.generateAccountId=function(){return t.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},t.prototype.generateCredentialId=function(){return t.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},t.prototype.generateTarget=function(){return t.generateTargetForCacheKey(this.target)},t.prototype.generateCredentialKey=function(){return t.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},t.prototype.generateType=function(){switch(this.credentialType){case de.ID_TOKEN:return qn.ID_TOKEN;case de.ACCESS_TOKEN:case de.ACCESS_TOKEN_WITH_AUTH_SCHEME:return qn.ACCESS_TOKEN;case de.REFRESH_TOKEN:return qn.REFRESH_TOKEN;default:throw j.createUnexpectedCredentialTypeError()}},t.getCredentialType=function(e){return e.indexOf(de.ACCESS_TOKEN.toLowerCase())!==-1?e.indexOf(de.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())!==-1?de.ACCESS_TOKEN_WITH_AUTH_SCHEME:de.ACCESS_TOKEN:e.indexOf(de.ID_TOKEN.toLowerCase())!==-1?de.ID_TOKEN:e.indexOf(de.REFRESH_TOKEN.toLowerCase())!==-1?de.REFRESH_TOKEN:_.NOT_DEFINED},t.generateCredentialCacheKey=function(e,r,n,i,o,a,s,c,l){var d=[this.generateAccountIdForCacheKey(e,r),this.generateCredentialIdForCacheKey(n,i,o,s),this.generateTargetForCacheKey(a),this.generateClaimsHashForCacheKey(l),this.generateSchemeForCacheKey(c)];return d.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateAccountIdForCacheKey=function(e,r){var n=[e,r];return n.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateCredentialIdForCacheKey=function(e,r,n,i){var o=e===de.REFRESH_TOKEN&&i||r,a=[e,o,n||_.EMPTY_STRING];return a.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateTargetForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},t.generateClaimsHashForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},t.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==Se.BEARER.toLowerCase()?e.toLowerCase():_.EMPTY_STRING},t}();var re={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{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"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{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."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{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."},missingNonceAuthenticationHeader:{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."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"}},Fe=function(t){br(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="ClientConfigurationError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(re.redirectUriNotSet.code,re.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(re.postLogoutUriNotSet.code,re.postLogoutUriNotSet.desc)},e.createClaimsRequestParsingError=function(r){return new e(re.claimsRequestParsingError.code,re.claimsRequestParsingError.desc+" Given value: "+r)},e.createInsecureAuthorityUriError=function(r){return new e(re.authorityUriInsecure.code,re.authorityUriInsecure.desc+" Given URI: "+r)},e.createUrlParseError=function(r){return new e(re.urlParseError.code,re.urlParseError.desc+" Given Error: "+r)},e.createUrlEmptyError=function(){return new e(re.urlEmptyError.code,re.urlEmptyError.desc)},e.createEmptyScopesArrayError=function(){return new e(re.emptyScopesError.code,""+re.emptyScopesError.desc)},e.createClientIdSingleScopeError=function(r){return new e(re.clientIdSingleScopeError.code,re.clientIdSingleScopeError.desc+" Given Scopes: "+r)},e.createInvalidPromptError=function(r){return new e(re.invalidPrompt.code,re.invalidPrompt.desc+" Given value: "+r)},e.createInvalidClaimsRequestError=function(){return new e(re.invalidClaimsRequest.code,re.invalidClaimsRequest.desc)},e.createEmptyLogoutRequestError=function(){return new e(re.logoutRequestEmptyError.code,re.logoutRequestEmptyError.desc)},e.createEmptyTokenRequestError=function(){return new e(re.tokenRequestEmptyError.code,re.tokenRequestEmptyError.desc)},e.createInvalidCodeChallengeMethodError=function(){return new e(re.invalidCodeChallengeMethod.code,re.invalidCodeChallengeMethod.desc)},e.createInvalidCodeChallengeParamsError=function(){return new e(re.invalidCodeChallengeParams.code,re.invalidCodeChallengeParams.desc)},e.createInvalidCloudDiscoveryMetadataError=function(){return new e(re.invalidCloudDiscoveryMetadata.code,re.invalidCloudDiscoveryMetadata.desc)},e.createInvalidAuthorityMetadataError=function(){return new e(re.invalidAuthorityMetadata.code,re.invalidAuthorityMetadata.desc)},e.createUntrustedAuthorityError=function(){return new e(re.untrustedAuthority.code,re.untrustedAuthority.desc)},e.createInvalidAzureCloudInstanceError=function(){return new e(re.invalidAzureCloudInstance.code,re.invalidAzureCloudInstance.desc)},e.createMissingSshJwkError=function(){return new e(re.missingSshJwk.code,re.missingSshJwk.desc)},e.createMissingSshKidError=function(){return new e(re.missingSshKid.code,re.missingSshKid.desc)},e.createMissingNonceAuthenticationHeadersError=function(){return new e(re.missingNonceAuthenticationHeader.code,re.missingNonceAuthenticationHeader.desc)},e.createInvalidAuthenticationHeaderError=function(r,n){return new e(re.invalidAuthenticationHeader.code,re.invalidAuthenticationHeader.desc+". Invalid header: "+r+". Details: "+n)},e}(j);var er=function(){function t(e){var r=this,n=e?V.trimArrayEntries(S1(e)):[],i=n?V.removeEmptyStringsFromArray(n):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(function(o){return r.scopes.add(o)})}return t.fromString=function(e){var r=e||_.EMPTY_STRING,n=r.split(" ");return new t(n)},t.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw Fe.createEmptyScopesArrayError()},t.prototype.containsScope=function(e){var r=this.printScopesLowerCase().split(" "),n=new t(r);return V.isEmpty(e)?!1:n.scopes.has(e.toLowerCase())},t.prototype.containsScopeSet=function(e){var r=this;return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(function(n){return r.containsScope(n)})},t.prototype.containsOnlyOIDCScopes=function(){var e=this,r=0;return nm.forEach(function(n){e.containsScope(n)&&(r+=1)}),this.scopes.size===r},t.prototype.appendScope=function(e){V.isEmpty(e)||this.scopes.add(e.trim())},t.prototype.appendScopes=function(e){var r=this;try{e.forEach(function(n){return r.appendScope(n)})}catch(n){throw j.createAppendScopeSetError(n)}},t.prototype.removeScope=function(e){if(V.isEmpty(e))throw j.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},t.prototype.removeOIDCScopes=function(){var e=this;nm.forEach(function(r){e.scopes.delete(r)})},t.prototype.unionScopeSets=function(e){if(!e)throw j.createEmptyInputScopeSetError();var r=new Set;return e.scopes.forEach(function(n){return r.add(n.toLowerCase())}),this.scopes.forEach(function(n){return r.add(n.toLowerCase())}),r},t.prototype.intersectingScopeSets=function(e){if(!e)throw j.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var r=this.unionScopeSets(e),n=e.getScopeCount(),i=this.getScopeCount(),o=r.size;return o<i+n},t.prototype.getScopeCount=function(){return this.scopes.size},t.prototype.asArray=function(){var e=[];return this.scopes.forEach(function(r){return e.push(r)}),e},t.prototype.printScopes=function(){if(this.scopes){var e=this.asArray();return e.join(" ")}return _.EMPTY_STRING},t.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},t}();function Ud(t,e){if(V.isEmpty(t))throw j.createClientInfoEmptyError();try{var r=e.base64Decode(t);return JSON.parse(r)}catch(n){throw j.createClientInfoDecodingError(n.message)}}function la(t){if(V.isEmpty(t))throw j.createClientInfoDecodingError("Home account ID was empty.");var e=t.split(Tr.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?_.EMPTY_STRING:e[1]}}var Fr;(function(t){t[t.Default=0]="Default",t[t.Adfs=1]="Adfs",t[t.Dsts=2]="Dsts"})(Fr||(Fr={}));var kt=function(){function t(){}return t.prototype.generateAccountId=function(){var e=[this.homeAccountId,this.environment];return e.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.prototype.generateAccountKey=function(){return t.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},t.prototype.generateType=function(){switch(this.authorityType){case Vn.ADFS_ACCOUNT_TYPE:return qn.ADFS;case Vn.MSAV1_ACCOUNT_TYPE:return qn.MSA;case Vn.MSSTS_ACCOUNT_TYPE:return qn.MSSTS;case Vn.GENERIC_ACCOUNT_TYPE:return qn.GENERIC;default:throw j.createUnexpectedAccountTypeError()}},t.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}},t.generateAccountCacheKey=function(e){var r=[e.homeAccountId,e.environment||_.EMPTY_STRING,e.tenantId||_.EMPTY_STRING];return r.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.createAccount=function(e,r,n,i,o,a,s,c){var l,d,h,u,f,v,g=new t;g.authorityType=Vn.MSSTS_ACCOUNT_TYPE,g.clientInfo=e,g.homeAccountId=r,g.nativeAccountId=c;var x=s||i&&i.getPreferredCache();if(!x)throw j.createInvalidCacheEnvironmentError();if(g.environment=x,g.realm=((l=n==null?void 0:n.claims)===null||l===void 0?void 0:l.tid)||_.EMPTY_STRING,n){g.idTokenClaims=n.claims,g.localAccountId=((d=n==null?void 0:n.claims)===null||d===void 0?void 0:d.oid)||((h=n==null?void 0:n.claims)===null||h===void 0?void 0:h.sub)||_.EMPTY_STRING;var m=(u=n==null?void 0:n.claims)===null||u===void 0?void 0:u.preferred_username,p=!((f=n==null?void 0:n.claims)===null||f===void 0)&&f.emails?n.claims.emails[0]:null;g.username=m||p||_.EMPTY_STRING,g.name=(v=n==null?void 0:n.claims)===null||v===void 0?void 0:v.name}return g.cloudGraphHostName=o,g.msGraphHost=a,g},t.createGenericAccount=function(e,r,n,i,o,a){var s,c,l,d,h=new t;h.authorityType=n&&n.authorityType===Fr.Adfs?Vn.ADFS_ACCOUNT_TYPE:Vn.GENERIC_ACCOUNT_TYPE,h.homeAccountId=e,h.realm=_.EMPTY_STRING;var u=a||n&&n.getPreferredCache();if(!u)throw j.createInvalidCacheEnvironmentError();return r&&(h.localAccountId=((s=r==null?void 0:r.claims)===null||s===void 0?void 0:s.oid)||((c=r==null?void 0:r.claims)===null||c===void 0?void 0:c.sub)||_.EMPTY_STRING,h.username=((l=r==null?void 0:r.claims)===null||l===void 0?void 0:l.upn)||_.EMPTY_STRING,h.name=((d=r==null?void 0:r.claims)===null||d===void 0?void 0:d.name)||_.EMPTY_STRING,h.idTokenClaims=r==null?void 0:r.claims),h.environment=u,h.cloudGraphHostName=i,h.msGraphHost=o,h},t.generateHomeAccountId=function(e,r,n,i,o){var a,s=!((a=o==null?void 0:o.claims)===null||a===void 0)&&a.sub?o.claims.sub:_.EMPTY_STRING;if(r===Fr.Adfs||r===Fr.Dsts)return s;if(e)try{var c=Ud(e,i);if(!V.isEmpty(c.uid)&&!V.isEmpty(c.utid))return""+c.uid+Tr.CLIENT_INFO_SEPARATOR+c.utid}catch{}return n.verbose("No client info in response"),s},t.isAccountEntity=function(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1},t.accountInfoIsEqual=function(e,r,n){if(!e||!r)return!1;var i=!0;if(n){var o=e.idTokenClaims||{},a=r.idTokenClaims||{};i=o.iat===a.iat&&o.nonce===a.nonce}return e.homeAccountId===r.homeAccountId&&e.localAccountId===r.localAccountId&&e.username===r.username&&e.tenantId===r.tenantId&&e.environment===r.environment&&e.nativeAccountId===r.nativeAccountId&&i},t}();var Tn=function(){function t(e,r){if(V.isEmpty(e))throw j.createTokenNullOrEmptyError(e);this.rawToken=e,this.claims=t.extractTokenClaims(e,r)}return t.extractTokenClaims=function(e,r){var n=V.decodeAuthToken(e);try{var i=n.JWSPayload,o=r.base64Decode(i);return JSON.parse(o)}catch(a){throw j.createTokenParsingError(a)}},t.checkMaxAge=function(e,r){var n=3e5;if(r===0||Date.now()-n>e+r)throw j.createMaxAgeTranspiredError()},t}();var Jr=function(){function t(e,r){this.clientId=e,this.cryptoImpl=r}return t.prototype.getAllAccounts=function(){var e=this,r=this.getAccountsFilteredBy(),n=Object.keys(r).map(function(a){return r[a]}),i=n.length;if(i<1)return[];var o=n.map(function(a){var s=t.toObject(new kt,a),c=s.getAccountInfo(),l=e.readIdTokenFromCache(e.clientId,c);return l&&!c.idTokenClaims&&(c.idToken=l.secret,c.idTokenClaims=new Tn(l.secret,e.cryptoImpl).claims),c});return o},t.prototype.saveCacheRecord=function(e){return Z(this,void 0,void 0,function(){return ee(this,function(r){switch(r.label){case 0:if(!e)throw j.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:r.sent(),r.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}})})},t.prototype.saveAccessToken=function(e){return Z(this,void 0,void 0,function(){var r,n,i,o,a=this;return ee(this,function(s){switch(s.label){case 0:return r=this.getCredentialsFilteredBy({clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash}),n=er.fromString(e.target),i=Object.keys(r.accessTokens).map(function(c){return r.accessTokens[c]}),i?(o=[],i.forEach(function(c){var l=er.fromString(c.target);l.intersectingScopeSets(n)&&o.push(a.removeCredential(c))}),[4,Promise.all(o)]):[3,2];case 1:s.sent(),s.label=2;case 2:return this.setAccessTokenCredential(e),[2]}})})},t.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:_.EMPTY_STRING,e?e.environment:_.EMPTY_STRING,e?e.realm:_.EMPTY_STRING,e?e.nativeAccountId:_.EMPTY_STRING)},t.prototype.getAccountsFilteredByInternal=function(e,r,n,i){var o=this,a=this.getKeys(),s={};return a.forEach(function(c){var l=o.getAccount(c);!l||!!e&&!o.matchHomeAccountId(l,e)||!!r&&!o.matchEnvironment(l,r)||!!n&&!o.matchRealm(l,n)||!!i&&!o.matchNativeAccountId(l,i)||(s[c]=l)}),s},t.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.userAssertionHash,e.tokenType,e.keyId,e.requestedClaimsHash)},t.prototype.getCredentialsFilteredByInternal=function(e,r,n,i,o,a,s,c,l,d,h){var u=this,f=this.getKeys(),v={idTokens:{},accessTokens:{},refreshTokens:{}};return f.forEach(function(g){var x=uc.getCredentialType(g);if(x!==_.NOT_DEFINED){var m=u.getSpecificCredential(g,x);if(!!m&&!(!!c&&!u.matchUserAssertionHash(m,c))&&!(typeof e=="string"&&!u.matchHomeAccountId(m,e))&&!(!!r&&!u.matchEnvironment(m,r))&&!(!!a&&!u.matchRealm(m,a))&&!(!!n&&!u.matchCredentialType(m,n))&&!(!!i&&!u.matchClientId(m,i))&&!(!!o&&!u.matchFamilyId(m,o))&&!(!!s&&!u.matchTarget(m,s))&&!((h||m.requestedClaimsHash)&&m.requestedClaimsHash!==h)&&!(n===de.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(!!l&&!u.matchTokenType(m,l)||l===Se.SSH&&d&&!u.matchKeyId(m,d)))){var p=u.updateCredentialCacheKey(g,m);switch(x){case de.ID_TOKEN:v.idTokens[p]=m;break;case de.ACCESS_TOKEN:case de.ACCESS_TOKEN_WITH_AUTH_SCHEME:v.accessTokens[p]=m;break;case de.REFRESH_TOKEN:v.refreshTokens[p]=m;break}}}}),v},t.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},t.prototype.getAppMetadataFilteredByInternal=function(e,r){var n=this,i=this.getKeys(),o={};return i.forEach(function(a){if(!!n.isAppMetadata(a)){var s=n.getAppMetadata(a);!s||!!e&&!n.matchEnvironment(s,e)||!!r&&!n.matchClientId(s,r)||(o[a]=s)}}),o},t.prototype.getAuthorityMetadataByAlias=function(e){var r=this,n=this.getAuthorityMetadataKeys(),i=null;return n.forEach(function(o){if(!(!r.isAuthorityMetadata(o)||o.indexOf(r.clientId)===-1)){var a=r.getAuthorityMetadata(o);!a||a.aliases.indexOf(e)!==-1&&(i=a)}}),i},t.prototype.removeAllAccounts=function(){return Z(this,void 0,void 0,function(){var e,r,n=this;return ee(this,function(i){switch(i.label){case 0:return e=this.getKeys(),r=[],e.forEach(function(o){var a=n.getAccount(o);!a||r.push(n.removeAccount(o))}),[4,Promise.all(r)];case 1:return i.sent(),[2,!0]}})})},t.prototype.removeAccount=function(e){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){switch(n.label){case 0:if(r=this.getAccount(e),!r)throw j.createNoAccountFoundError();return[4,this.removeAccountContext(r)];case 1:return[2,n.sent()&&this.removeItem(e,mo.ACCOUNT)]}})})},t.prototype.removeAccountContext=function(e){return Z(this,void 0,void 0,function(){var r,n,i,o=this;return ee(this,function(a){switch(a.label){case 0:return r=this.getKeys(),n=e.generateAccountId(),i=[],r.forEach(function(s){var c=uc.getCredentialType(s);if(c!==_.NOT_DEFINED){var l=o.getSpecificCredential(s,c);!!l&&n===l.generateAccountId()&&i.push(o.removeCredential(l))}}),[4,Promise.all(i)];case 1:return a.sent(),[2,!0]}})})},t.prototype.removeCredential=function(e){return Z(this,void 0,void 0,function(){var r,n,i;return ee(this,function(o){switch(o.label){case 0:if(r=e.generateCredentialKey(),e.credentialType.toLowerCase()!==de.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(e.tokenType!==Se.POP)return[3,4];if(n=e,i=n.keyId,!i)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(i)];case 2:return o.sent(),[3,4];case 3:throw o.sent(),j.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(r,mo.CREDENTIAL)]}})})},t.prototype.removeAppMetadata=function(){var e=this,r=this.getKeys();return r.forEach(function(n){e.isAppMetadata(n)&&e.removeItem(n,mo.APP_METADATA)}),!0},t.prototype.readCacheRecord=function(e,r,n,i){var o=this.readAccountFromCache(e),a=this.readIdTokenFromCache(r,e),s=this.readAccessTokenFromCache(r,e,n),c=this.readRefreshTokenFromCache(r,e,!1),l=this.readAppMetadataFromCache(i,r);return o&&a&&(o.idTokenClaims=new Tn(a.secret,this.cryptoImpl).claims),{account:o,idToken:a,accessToken:s,refreshToken:c,appMetadata:l}},t.prototype.readAccountFromCache=function(e){var r=kt.generateAccountCacheKey(e);return this.getAccount(r)},t.prototype.readAccountFromCacheWithNativeAccountId=function(e){var r={nativeAccountId:e},n=this.getAccountsFilteredBy(r),i=Object.keys(n).map(function(o){return n[o]});if(i.length<1)return null;if(i.length>1)throw j.createMultipleMatchingAccountsInCacheError();return n[0]},t.prototype.readIdTokenFromCache=function(e,r){var n={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:de.ID_TOKEN,clientId:e,realm:r.tenantId},i=this.getCredentialsFilteredBy(n),o=Object.keys(i.idTokens).map(function(s){return i.idTokens[s]}),a=o.length;if(a<1)return null;if(a>1)throw j.createMultipleMatchingTokensInCacheError();return o[0]},t.prototype.readAccessTokenFromCache=function(e,r,n){var i=new er(n.scopes||[]),o=n.authenticationScheme||Se.BEARER,a=o&&o.toLowerCase()!==Se.BEARER.toLowerCase()?de.ACCESS_TOKEN_WITH_AUTH_SCHEME:de.ACCESS_TOKEN,s={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:a,clientId:e,realm:r.tenantId,target:i.printScopesLowerCase(),tokenType:o,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},c=this.getCredentialsFilteredBy(s),l=Object.keys(c.accessTokens).map(function(h){return c.accessTokens[h]}),d=l.length;if(d<1)return null;if(d>1)throw j.createMultipleMatchingTokensInCacheError();return l[0]},t.prototype.readRefreshTokenFromCache=function(e,r,n){var i=n?Nd:void 0,o={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:de.REFRESH_TOKEN,clientId:e,familyId:i},a=this.getCredentialsFilteredBy(o),s=Object.keys(a.refreshTokens).map(function(l){return a.refreshTokens[l]}),c=s.length;return c<1?null:s[0]},t.prototype.readAppMetadataFromCache=function(e,r){var n={environment:e,clientId:r},i=this.getAppMetadataFilteredBy(n),o=Object.keys(i).map(function(s){return i[s]}),a=o.length;if(a<1)return null;if(a>1)throw j.createMultipleMatchingAppMetadataInCacheError();return o[0]},t.prototype.isAppMetadataFOCI=function(e,r){var n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===Nd)},t.prototype.matchHomeAccountId=function(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId},t.prototype.matchUserAssertionHash=function(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)},t.prototype.matchEnvironment=function(e,r){var n=this.getAuthorityMetadataByAlias(r);return!!(n&&n.aliases.indexOf(e.environment)>-1)},t.prototype.matchCredentialType=function(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()},t.prototype.matchClientId=function(e,r){return!!(e.clientId&&r===e.clientId)},t.prototype.matchFamilyId=function(e,r){return!!(e.familyId&&r===e.familyId)},t.prototype.matchRealm=function(e,r){return!!(e.realm&&r===e.realm)},t.prototype.matchNativeAccountId=function(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)},t.prototype.matchTarget=function(e,r){var n=e.credentialType!==de.ACCESS_TOKEN&&e.credentialType!==de.ACCESS_TOKEN_WITH_AUTH_SCHEME;if(n||!e.target)return!1;var i=er.fromString(e.target),o=er.fromString(r);return o.containsOnlyOIDCScopes()?o.removeScope(_.OFFLINE_ACCESS_SCOPE):o.removeOIDCScopes(),i.containsScopeSet(o)},t.prototype.matchTokenType=function(e,r){return!!(e.tokenType&&e.tokenType===r)},t.prototype.matchKeyId=function(e,r){return!!(e.keyId&&e.keyId===r)},t.prototype.isAppMetadata=function(e){return e.indexOf(s2)!==-1},t.prototype.isAuthorityMetadata=function(e){return e.indexOf(Fs.CACHE_KEY)!==-1},t.prototype.generateAuthorityMetadataCacheKey=function(e){return Fs.CACHE_KEY+"-"+this.clientId+"-"+e},t.prototype.getSpecificCredential=function(e,r){switch(r){case de.ID_TOKEN:return this.getIdTokenCredential(e);case de.ACCESS_TOKEN:case de.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case de.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},t.toObject=function(e,r){for(var n in r)e[n]=r[n];return e},t}(),s_=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.setAccount=function(){var r="Storage interface - setAccount() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAccount=function(){var r="Storage interface - getAccount() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setIdTokenCredential=function(){var r="Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getIdTokenCredential=function(){var r="Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setAccessTokenCredential=function(){var r="Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAccessTokenCredential=function(){var r="Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setRefreshTokenCredential=function(){var r="Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getRefreshTokenCredential=function(){var r="Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setAppMetadata=function(){var r="Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAppMetadata=function(){var r="Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setServerTelemetry=function(){var r="Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getServerTelemetry=function(){var r="Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setAuthorityMetadata=function(){var r="Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAuthorityMetadata=function(){var r="Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getAuthorityMetadataKeys=function(){var r="Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.setThrottlingCache=function(){var r="Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getThrottlingCache=function(){var r="Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.removeItem=function(){var r="Storage interface - removeItem() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.containsKey=function(){var r="Storage interface - containsKey() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.getKeys=function(){var r="Storage interface - getKeys() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e.prototype.clear=function(){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){throw r="Storage interface - clear() has not been implemented for the cacheStorage interface.",W.createUnexpectedError(r)})})},e.prototype.updateCredentialCacheKey=function(){var r="Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";throw W.createUnexpectedError(r)},e}(Jr);var c_=300,r3={tokenRenewalOffsetSeconds:c_,preventCorsPreflight:!1,proxyUrl:_.EMPTY_STRING},l_={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:tt.Info,correlationId:_.EMPTY_STRING},d_={sendGetRequestAsync:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Network interface - sendGetRequestAsync() has not been implemented",W.createUnexpectedError(t)})})},sendPostRequestAsync:function(){return Z(this,void 0,void 0,function(){var t;return ee(this,function(e){throw t="Network interface - sendPostRequestAsync() has not been implemented",W.createUnexpectedError(t)})})}},h_={sku:_.SKU,version:t3,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},u_={clientSecret:_.EMPTY_STRING,clientAssertion:void 0},f_={azureCloudInstance:hc.None,tenant:""+_.DEFAULT_COMMON_TENANT},p_={application:{appName:"",appVersion:""}};function m_(t){var e=t.authOptions,r=t.systemOptions,n=t.loggerOptions,i=t.storageInterface,o=t.networkInterface,a=t.cryptoInterface,s=t.clientCredentials,c=t.libraryInfo,l=t.telemetry,d=t.serverTelemetryManager,h=t.persistencePlugin,u=t.serializableCache,f=Re(Re({},l_),n);return{authOptions:v_(e),systemOptions:Re(Re({},r3),r),loggerOptions:f,storageInterface:i||new s_(e.clientId,Fd),networkInterface:o||d_,cryptoInterface:a||Fd,clientCredentials:s||u_,libraryInfo:Re(Re({},h_),c),telemetry:Re(Re({},p_),l),serverTelemetryManager:d||null,persistencePlugin:h||null,serializableCache:u||null}}function v_(t){return Re({clientCapabilities:[],azureCloudOptions:f_,skipAuthorityMetadataCache:!1},t)}var So=function(t){br(e,t);function e(r,n,i){var o=t.call(this,r,n,i)||this;return o.name="ServerError",Object.setPrototypeOf(o,e.prototype),o}return e}(W);var $d=function(){function t(){}return t.generateThrottlingStorageKey=function(e){return Us.THROTTLING_PREFIX+"."+JSON.stringify(e)},t.preProcess=function(e,r){var n,i=t.generateThrottlingStorageKey(r),o=e.getThrottlingCache(i);if(o){if(o.throttleTime<Date.now()){e.removeItem(i,mo.THROTTLING);return}throw new So(((n=o.errorCodes)===null||n===void 0?void 0:n.join(" "))||_.EMPTY_STRING,o.errorMessage,o.subError)}},t.postProcess=function(e,r,n){if(t.checkResponseStatus(n)||t.checkResponseForRetryAfter(n)){var i={throttleTime:t.calculateThrottleTime(parseInt(n.headers[ln.RETRY_AFTER])),error:n.body.error,errorCodes:n.body.error_codes,errorMessage:n.body.error_description,subError:n.body.suberror};e.setThrottlingCache(t.generateThrottlingStorageKey(r),i)}},t.checkResponseStatus=function(e){return e.status===429||e.status>=500&&e.status<600},t.checkResponseForRetryAfter=function(e){return e.headers?e.headers.hasOwnProperty(ln.RETRY_AFTER)&&(e.status<200||e.status>=300):!1},t.calculateThrottleTime=function(e){var r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||Us.DEFAULT_THROTTLE_TIME_SECONDS),n+Us.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)},t.removeThrottle=function(e,r,n,i){var o={clientId:r,authority:n.authority,scopes:n.scopes,homeAccountIdentifier:i,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid},a=this.generateThrottlingStorageKey(o);return e.removeItem(a,mo.THROTTLING)},t}();var g_=function(){function t(e,r){this.networkClient=e,this.cacheManager=r}return t.prototype.sendPostRequest=function(e,r,n){return Z(this,void 0,void 0,function(){var i,o;return ee(this,function(a){switch(a.label){case 0:$d.preProcess(this.cacheManager,e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(r,n)];case 2:return i=a.sent(),[3,4];case 3:throw o=a.sent(),o instanceof W?o:j.createNetworkError(r,o);case 4:return $d.postProcess(this.cacheManager,e,i),[2,i]}})})},t}();var kr;(function(t){t.HOME_ACCOUNT_ID="home_account_id",t.UPN="UPN"})(kr||(kr={}));var n0=function(){function t(e,r){this.config=m_(e),this.logger=new r0(this.config.loggerOptions,a_,t3),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new g_(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}return t.prototype.createTokenRequestHeaders=function(e){var r={};if(r[ln.CONTENT_TYPE]=_.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case kr.HOME_ACCOUNT_ID:try{var n=la(e.credential);r[ln.CCS_HEADER]="Oid:"+n.uid+"@"+n.utid}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case kr.UPN:r[ln.CCS_HEADER]="UPN: "+e.credential;break}return r},t.prototype.executePostToTokenEndpoint=function(e,r,n,i){return Z(this,void 0,void 0,function(){var o;return ee(this,function(a){switch(a.label){case 0:return[4,this.networkManager.sendPostRequest(i,e,{body:r,headers:n,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return o=a.sent(),this.config.serverTelemetryManager&&o.status<500&&o.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,o]}})})},t.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw j.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},t}();var eo=function(){function t(){}return t.validateRedirectUri=function(e){if(V.isEmpty(e))throw Fe.createRedirectUriEmptyError()},t.validatePrompt=function(e){var r=[];for(var n in jt)r.push(jt[n]);if(r.indexOf(e)<0)throw Fe.createInvalidPromptError(e)},t.validateClaims=function(e){try{JSON.parse(e)}catch{throw Fe.createInvalidClaimsRequestError()}},t.validateCodeChallengeParams=function(e,r){if(V.isEmpty(e)||V.isEmpty(r))throw Fe.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(r)},t.validateCodeChallengeMethod=function(e){if([im.PLAIN,im.S256].indexOf(e)<0)throw Fe.createInvalidCodeChallengeMethodError()},t.sanitizeEQParams=function(e,r){return e?(r.forEach(function(n,i){e[i]&&delete e[i]}),e):{}},t}();var da=function(){function t(){this.parameters=new Map}return t.prototype.addResponseTypeCode=function(){this.parameters.set(ne.RESPONSE_TYPE,encodeURIComponent(_.CODE_RESPONSE_TYPE))},t.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(ne.RESPONSE_TYPE,encodeURIComponent(_.TOKEN_RESPONSE_TYPE+" "+_.ID_TOKEN_RESPONSE_TYPE))},t.prototype.addResponseMode=function(e){this.parameters.set(ne.RESPONSE_MODE,encodeURIComponent(e||Od.QUERY))},t.prototype.addNativeBroker=function(){this.parameters.set(ne.NATIVE_BROKER,encodeURIComponent("1"))},t.prototype.addScopes=function(e,r){r===void 0&&(r=!0);var n=r?S1(e||[],Ic):e||[],i=new er(n);this.parameters.set(ne.SCOPE,encodeURIComponent(i.printScopes()))},t.prototype.addClientId=function(e){this.parameters.set(ne.CLIENT_ID,encodeURIComponent(e))},t.prototype.addRedirectUri=function(e){eo.validateRedirectUri(e),this.parameters.set(ne.REDIRECT_URI,encodeURIComponent(e))},t.prototype.addPostLogoutRedirectUri=function(e){eo.validateRedirectUri(e),this.parameters.set(ne.POST_LOGOUT_URI,encodeURIComponent(e))},t.prototype.addIdTokenHint=function(e){this.parameters.set(ne.ID_TOKEN_HINT,encodeURIComponent(e))},t.prototype.addDomainHint=function(e){this.parameters.set(Vs.DOMAIN_HINT,encodeURIComponent(e))},t.prototype.addLoginHint=function(e){this.parameters.set(Vs.LOGIN_HINT,encodeURIComponent(e))},t.prototype.addCcsUpn=function(e){this.parameters.set(ln.CCS_HEADER,encodeURIComponent("UPN:"+e))},t.prototype.addCcsOid=function(e){this.parameters.set(ln.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},t.prototype.addSid=function(e){this.parameters.set(Vs.SID,encodeURIComponent(e))},t.prototype.addClaims=function(e,r){var n=this.addClientCapabilitiesToClaims(e,r);eo.validateClaims(n),this.parameters.set(ne.CLAIMS,encodeURIComponent(n))},t.prototype.addCorrelationId=function(e){this.parameters.set(ne.CLIENT_REQUEST_ID,encodeURIComponent(e))},t.prototype.addLibraryInfo=function(e){this.parameters.set(ne.X_CLIENT_SKU,e.sku),this.parameters.set(ne.X_CLIENT_VER,e.version),e.os&&this.parameters.set(ne.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(ne.X_CLIENT_CPU,e.cpu)},t.prototype.addApplicationTelemetry=function(e){e!=null&&e.appName&&this.parameters.set(ne.X_APP_NAME,e.appName),e!=null&&e.appVersion&&this.parameters.set(ne.X_APP_VER,e.appVersion)},t.prototype.addPrompt=function(e){eo.validatePrompt(e),this.parameters.set(""+ne.PROMPT,encodeURIComponent(e))},t.prototype.addState=function(e){V.isEmpty(e)||this.parameters.set(ne.STATE,encodeURIComponent(e))},t.prototype.addNonce=function(e){this.parameters.set(ne.NONCE,encodeURIComponent(e))},t.prototype.addCodeChallengeParams=function(e,r){if(eo.validateCodeChallengeParams(e,r),e&&r)this.parameters.set(ne.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(ne.CODE_CHALLENGE_METHOD,encodeURIComponent(r));else throw Fe.createInvalidCodeChallengeParamsError()},t.prototype.addAuthorizationCode=function(e){this.parameters.set(ne.CODE,encodeURIComponent(e))},t.prototype.addDeviceCode=function(e){this.parameters.set(ne.DEVICE_CODE,encodeURIComponent(e))},t.prototype.addRefreshToken=function(e){this.parameters.set(ne.REFRESH_TOKEN,encodeURIComponent(e))},t.prototype.addCodeVerifier=function(e){this.parameters.set(ne.CODE_VERIFIER,encodeURIComponent(e))},t.prototype.addClientSecret=function(e){this.parameters.set(ne.CLIENT_SECRET,encodeURIComponent(e))},t.prototype.addClientAssertion=function(e){V.isEmpty(e)||this.parameters.set(ne.CLIENT_ASSERTION,encodeURIComponent(e))},t.prototype.addClientAssertionType=function(e){V.isEmpty(e)||this.parameters.set(ne.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},t.prototype.addOboAssertion=function(e){this.parameters.set(ne.OBO_ASSERTION,encodeURIComponent(e))},t.prototype.addRequestTokenUse=function(e){this.parameters.set(ne.REQUESTED_TOKEN_USE,encodeURIComponent(e))},t.prototype.addGrantType=function(e){this.parameters.set(ne.GRANT_TYPE,encodeURIComponent(e))},t.prototype.addClientInfo=function(){this.parameters.set(o_,"1")},t.prototype.addExtraQueryParameters=function(e){var r=this;eo.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach(function(n){r.parameters.set(n,e[n])})},t.prototype.addClientCapabilitiesToClaims=function(e,r){var n;if(!e)n={};else try{n=JSON.parse(e)}catch{throw Fe.createInvalidClaimsRequestError()}return r&&r.length>0&&(n.hasOwnProperty(sa.ACCESS_TOKEN)||(n[sa.ACCESS_TOKEN]={}),n[sa.ACCESS_TOKEN][sa.XMS_CC]={values:r}),JSON.stringify(n)},t.prototype.addUsername=function(e){this.parameters.set(Vd.username,encodeURIComponent(e))},t.prototype.addPassword=function(e){this.parameters.set(Vd.password,encodeURIComponent(e))},t.prototype.addPopToken=function(e){V.isEmpty(e)||(this.parameters.set(ne.TOKEN_TYPE,Se.POP),this.parameters.set(ne.REQ_CNF,encodeURIComponent(e)))},t.prototype.addSshJwk=function(e){V.isEmpty(e)||(this.parameters.set(ne.TOKEN_TYPE,Se.SSH),this.parameters.set(ne.REQ_CNF,encodeURIComponent(e)))},t.prototype.addServerTelemetry=function(e){this.parameters.set(ne.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(ne.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},t.prototype.addThrottling=function(){this.parameters.set(ne.X_MS_LIB_CAPABILITY,Us.X_MS_LIB_CAPABILITY_VALUE)},t.prototype.addLogoutHint=function(e){this.parameters.set(ne.LOGOUT_HINT,encodeURIComponent(e))},t.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach(function(r,n){e.push(n+"="+r)}),e.join("&")},t}();var fc=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.createIdTokenEntity=function(r,n,i,o,a){var s=new e;return s.credentialType=de.ID_TOKEN,s.homeAccountId=r,s.environment=n,s.clientId=o,s.secret=i,s.realm=a,s},e.isIdTokenEntity=function(r){return r?r.hasOwnProperty("homeAccountId")&&r.hasOwnProperty("environment")&&r.hasOwnProperty("credentialType")&&r.hasOwnProperty("realm")&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("secret")&&r.credentialType===de.ID_TOKEN:!1},e}(uc);var Br=function(){function t(){}return t.nowSeconds=function(){return Math.round(new Date().getTime()/1e3)},t.isTokenExpired=function(e,r){var n=Number(e)||0,i=t.nowSeconds()+r;return i>n},t.wasClockTurnedBack=function(e){var r=Number(e);return r>t.nowSeconds()},t.delay=function(e,r){return new Promise(function(n){return setTimeout(function(){return n(r)},e)})},t}();var pc=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.createAccessTokenEntity=function(r,n,i,o,a,s,c,l,d,h,u,f,v,g,x){var m,p,y=new e;y.homeAccountId=r,y.credentialType=de.ACCESS_TOKEN,y.secret=i;var w=Br.nowSeconds();if(y.cachedAt=w.toString(),y.expiresOn=c.toString(),y.extendedExpiresOn=l.toString(),h&&(y.refreshOn=h.toString()),y.environment=n,y.clientId=o,y.realm=a,y.target=s,y.userAssertionHash=f,y.tokenType=V.isEmpty(u)?Se.BEARER:u,g&&(y.requestedClaims=g,y.requestedClaimsHash=x),((m=y.tokenType)===null||m===void 0?void 0:m.toLowerCase())!==Se.BEARER.toLowerCase())switch(y.credentialType=de.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case Se.POP:var A=Tn.extractTokenClaims(i,d);if(!(!((p=A==null?void 0:A.cnf)===null||p===void 0)&&p.kid))throw j.createTokenClaimsRequiredError();y.keyId=A.cnf.kid;break;case Se.SSH:y.keyId=v}return y},e.isAccessTokenEntity=function(r){return r?r.hasOwnProperty("homeAccountId")&&r.hasOwnProperty("environment")&&r.hasOwnProperty("credentialType")&&r.hasOwnProperty("realm")&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("secret")&&r.hasOwnProperty("target")&&(r.credentialType===de.ACCESS_TOKEN||r.credentialType===de.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1},e}(uc);var jd=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.createRefreshTokenEntity=function(r,n,i,o,a,s){var c=new e;return c.clientId=o,c.credentialType=de.REFRESH_TOKEN,c.environment=n,c.homeAccountId=r,c.secret=i,c.userAssertionHash=s,a&&(c.familyId=a),c},e.isRefreshTokenEntity=function(r){return r?r.hasOwnProperty("homeAccountId")&&r.hasOwnProperty("environment")&&r.hasOwnProperty("credentialType")&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("secret")&&r.credentialType===de.REFRESH_TOKEN:!1},e}(uc);var am=["interaction_required","consent_required","login_required"],y_=["message_only","additional_action","basic_action","user_password_expired","consent_required"],ms={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{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."}},an=function(t){br(e,t);function e(r,n,i){var o=t.call(this,r,n,i)||this;return o.name="InteractionRequiredAuthError",Object.setPrototypeOf(o,e.prototype),o}return e.isInteractionRequiredError=function(r,n,i){var o=!!r&&am.indexOf(r)>-1,a=!!i&&y_.indexOf(i)>-1,s=!!n&&am.some(function(c){return n.indexOf(c)>-1});return o||s||a},e.createNoTokensFoundError=function(){return new e(ms.noTokensFoundError.code,ms.noTokensFoundError.desc)},e.createNativeAccountUnavailableError=function(){return new e(ms.native_account_unavailable.code,ms.native_account_unavailable.desc)},e}(W);var ql=function(){function t(e,r,n,i,o){this.account=e||null,this.idToken=r||null,this.accessToken=n||null,this.refreshToken=i||null,this.appMetadata=o||null}return t}();var Yn=function(){function t(){}return t.setRequestState=function(e,r,n){var i=t.generateLibraryState(e,n);return V.isEmpty(r)?i:""+i+_.RESOURCE_DELIM+r},t.generateLibraryState=function(e,r){if(!e)throw j.createNoCryptoObjectError("generateLibraryState");var n={id:e.createNewGuid()};r&&(n.meta=r);var i=JSON.stringify(n);return e.base64Encode(i)},t.parseRequestState=function(e,r){if(!e)throw j.createNoCryptoObjectError("parseRequestState");if(V.isEmpty(r))throw j.createInvalidStateError(r,"Null, undefined or empty state");try{var n=r.split(_.RESOURCE_DELIM),i=n[0],o=n.length>1?n.slice(1).join(_.RESOURCE_DELIM):_.EMPTY_STRING,a=e.base64Decode(i),s=JSON.parse(a);return{userRequestState:V.isEmpty(o)?_.EMPTY_STRING:o,libraryState:s}}catch(c){throw j.createInvalidStateError(r,c)}},t}();var be=function(){function t(e){if(this._urlString=e,V.isEmpty(this._urlString))throw Fe.createUrlEmptyError();V.isEmpty(this.getHash())&&(this._urlString=t.canonicalizeUri(e))}return Object.defineProperty(t.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),t.canonicalizeUri=function(e){if(e){var r=e.toLowerCase();return V.endsWith(r,"?")?r=r.slice(0,-1):V.endsWith(r,"?/")&&(r=r.slice(0,-2)),V.endsWith(r,"/")||(r+="/"),r}return e},t.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(r){throw Fe.createUrlParseError(r)}if(!e.HostNameAndPort||!e.PathSegments)throw Fe.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Fe.createInsecureAuthorityUriError(this.urlString)},t.appendQueryString=function(e,r){return V.isEmpty(r)?e:e.indexOf("?")<0?e+"?"+r:e+"&"+r},t.removeHashFromUrl=function(e){return t.canonicalizeUri(e.split("#")[0])},t.prototype.replaceTenantPath=function(e){var r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===Ld.COMMON||n[0]===Ld.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)},t.prototype.getHash=function(){return t.parseHash(this.urlString)},t.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw Fe.createUrlParseError("Given url string: "+this.urlString);var n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},i=n.AbsolutePath.split("/");return i=i.filter(function(o){return o&&o.length>0}),n.PathSegments=i,!V.isEmpty(n.QueryString)&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n},t.getDomainFromUrl=function(e){var r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw Fe.createUrlParseError("Given url string: "+e);return n[2]},t.getAbsoluteUrl=function(e,r){if(e[0]===_.FORWARD_SLASH){var n=new t(r),i=n.getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e},t.parseHash=function(e){var r=e.indexOf("#"),n=e.indexOf("#/");return n>-1?e.substring(n+2):r>-1?e.substring(r+1):_.EMPTY_STRING},t.parseQueryString=function(e){var r=e.indexOf("?"),n=e.indexOf("/?");return n>-1?e.substring(n+2):r>-1?e.substring(r+1):_.EMPTY_STRING},t.constructAuthorityUriFromObject=function(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},t.getDeserializedHash=function(e){if(V.isEmpty(e))return{};var r=t.parseHash(e),n=V.queryStringToObject(V.isEmpty(r)?e:r);if(!n)throw j.createHashNotDeserializedError(JSON.stringify(n));return n},t.getDeserializedQueryString=function(e){if(V.isEmpty(e))return{};var r=t.parseQueryString(e),n=V.queryStringToObject(V.isEmpty(r)?e:r);if(!n)throw j.createHashNotDeserializedError(JSON.stringify(n));return n},t.hashContainsKnownProperties=function(e){if(V.isEmpty(e)||e.indexOf("=")<0)return!1;var r=t.getDeserializedHash(e);return!!(r.code||r.error_description||r.error||r.state)},t}();var l2;(function(t){t.SW="sw",t.UHW="uhw"})(l2||(l2={}));var Pa=function(){function t(e){this.cryptoUtils=e}return t.prototype.generateCnf=function(e){return Z(this,void 0,void 0,function(){var r,n,i;return ee(this,function(o){switch(o.label){case 0:return[4,this.generateKid(e)];case 1:return r=o.sent(),n=this.cryptoUtils.base64Encode(JSON.stringify(r)),i={kid:r.kid,reqCnfString:n},[4,this.cryptoUtils.hashString(n)];case 2:return[2,(i.reqCnfHash=o.sent(),i)]}})})},t.prototype.generateKid=function(e){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){switch(n.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return r=n.sent(),[2,{kid:r,xms_ksl:l2.SW}]}})})},t.prototype.signPopToken=function(e,r,n){return Z(this,void 0,void 0,function(){return ee(this,function(i){return[2,this.signPayload(e,r,n)]})})},t.prototype.signPayload=function(e,r,n,i){return Z(this,void 0,void 0,function(){var o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return o=n.resourceRequestMethod,a=n.resourceRequestUri,s=n.shrClaims,c=n.shrNonce,l=a?new be(a):void 0,d=l==null?void 0:l.getUrlComponents(),[4,this.cryptoUtils.signJwt(Re({at:e,ts:Br.nowSeconds(),m:o==null?void 0:o.toUpperCase(),u:d==null?void 0:d.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:d==null?void 0:d.AbsolutePath,q:d!=null&&d.QueryString?[[],d.QueryString]:void 0,client_claims:s||void 0},i),r,n.correlationId)];case 1:return[2,h.sent()]}})})},t}();var d2=function(){function t(){}return t.prototype.generateAppMetadataKey=function(){return t.generateAppMetadataCacheKey(this.environment,this.clientId)},t.generateAppMetadataCacheKey=function(e,r){var n=[s2,e,r];return n.join(Tr.CACHE_KEY_SEPARATOR).toLowerCase()},t.createAppMetadataEntity=function(e,r,n){var i=new t;return i.clientId=e,i.environment=r,n&&(i.familyId=n),i},t.isAppMetadataEntity=function(e,r){return r?e.indexOf(s2)===0&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("environment"):!1},t}();var __=function(){function t(e,r){this.cache=e,this.hasChanged=r}return Object.defineProperty(t.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),t}();var Bd=function(){function t(e,r,n,i,o,a){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=i,this.serializableCache=o,this.persistencePlugin=a}return t.prototype.validateServerAuthorizationCodeResponse=function(e,r,n){if(!e.state||!r)throw e.state?j.createStateNotFoundError("Cached State"):j.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(r))throw j.createStateMismatchError();if(e.error||e.error_description||e.suberror)throw an.isInteractionRequiredError(e.error,e.error_description,e.suberror)?new an(e.error||_.EMPTY_STRING,e.error_description,e.suberror):new So(e.error||_.EMPTY_STRING,e.error_description,e.suberror);e.client_info&&Ud(e.client_info,n)},t.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(an.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new an(e.error,e.error_description,e.suberror);var r=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new So(e.error,r,e.suberror)}},t.prototype.handleServerTokenResponse=function(e,r,n,i,o,a,s,c,l){return Z(this,void 0,void 0,function(){var d,h,u,f,v,g,x;return ee(this,function(m){switch(m.label){case 0:if(e.id_token){if(d=new Tn(e.id_token||_.EMPTY_STRING,this.cryptoObj),o&&!V.isEmpty(o.nonce)&&d.claims.nonce!==o.nonce)throw j.createNonceMismatchError();if(i.maxAge||i.maxAge===0){if(h=d.claims.auth_time,!h)throw j.createAuthTimeNotFoundError();Tn.checkMaxAge(h,i.maxAge)}}this.homeAccountIdentifier=kt.generateHomeAccountId(e.client_info||_.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,d),!!o&&!!o.state&&(u=Yn.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||i.sshKid||void 0,f=this.generateCacheRecord(e,r,n,i,d,a,o),m.label=1;case 1:return m.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),v=new __(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(v)]):[3,3];case 2:m.sent(),m.label=3;case 3:return s&&!c&&f.account&&(g=f.account.generateAccountKey(),x=this.cacheStorage.getAccount(g),!x)?(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,t.generateAuthenticationResult(this.cryptoObj,r,f,!1,i,d,u,void 0,l)]):[4,this.cacheStorage.saveCacheRecord(f)];case 4:return m.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&v?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(v)]):[3,7];case 6:m.sent(),m.label=7;case 7:return[7];case 8:return[2,t.generateAuthenticationResult(this.cryptoObj,r,f,!1,i,d,u,e.spa_code,l)]}})})},t.prototype.generateCacheRecord=function(e,r,n,i,o,a,s){var c=r.getPreferredCache();if(V.isEmpty(c))throw j.createInvalidCacheEnvironmentError();var l,d;!V.isEmpty(e.id_token)&&!!o&&(l=fc.createIdTokenEntity(this.homeAccountIdentifier,c,e.id_token||_.EMPTY_STRING,this.clientId,o.claims.tid||_.EMPTY_STRING),d=this.generateAccountEntity(e,o,r,s));var h=null;if(!V.isEmpty(e.access_token)){var u=e.scope?er.fromString(e.scope):new er(i.scopes||[]),f=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,v=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,g=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,x=n+f,m=x+v,p=g&&g>0?n+g:void 0;h=pc.createAccessTokenEntity(this.homeAccountIdentifier,c,e.access_token||_.EMPTY_STRING,this.clientId,o?o.claims.tid||_.EMPTY_STRING:r.tenant,u.printScopes(),x,m,this.cryptoObj,p,e.token_type,a,e.key_id,i.claims,i.requestedClaimsHash)}var y=null;V.isEmpty(e.refresh_token)||(y=jd.createRefreshTokenEntity(this.homeAccountIdentifier,c,e.refresh_token||_.EMPTY_STRING,this.clientId,e.foci,a));var w=null;return V.isEmpty(e.foci)||(w=d2.createAppMetadataEntity(this.clientId,c,e.foci)),new ql(d,l,h,y,w)},t.prototype.generateAccountEntity=function(e,r,n,i){var o=n.authorityType,a=i?i.cloud_graph_host_name:_.EMPTY_STRING,s=i?i.msgraph_host:_.EMPTY_STRING;if(o===Fr.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),kt.createGenericAccount(this.homeAccountIdentifier,r,n,a,s);if(V.isEmpty(e.client_info)&&n.protocolMode==="AAD")throw j.createClientInfoEmptyError();return e.client_info?kt.createAccount(e.client_info,this.homeAccountIdentifier,r,n,a,s):kt.createGenericAccount(this.homeAccountIdentifier,r,n,a,s)},t.generateAuthenticationResult=function(e,r,n,i,o,a,s,c,l){var d,h,u;return Z(this,void 0,void 0,function(){var f,v,g,x,m,p,y,w,A,O,U;return ee(this,function(N){switch(N.label){case 0:if(f=_.EMPTY_STRING,v=[],g=null,m=_.EMPTY_STRING,!n.accessToken)return[3,4];if(n.accessToken.tokenType!==Se.POP)return[3,2];if(p=new Pa(e),y=n.accessToken,w=y.secret,A=y.keyId,!A)throw j.createKeyIdMissingError();return[4,p.signPopToken(w,A,o)];case 1:return f=N.sent(),[3,3];case 2:f=n.accessToken.secret,N.label=3;case 3:v=er.fromString(n.accessToken.target).asArray(),g=new Date(Number(n.accessToken.expiresOn)*1e3),x=new Date(Number(n.accessToken.extendedExpiresOn)*1e3),N.label=4;case 4:return n.appMetadata&&(m=n.appMetadata.familyId===Nd?Nd:_.EMPTY_STRING),O=(a==null?void 0:a.claims.oid)||(a==null?void 0:a.claims.sub)||_.EMPTY_STRING,U=(a==null?void 0:a.claims.tid)||_.EMPTY_STRING,[2,{authority:r.canonicalAuthority,uniqueId:O,tenantId:U,scopes:v,account:n.account?n.account.getAccountInfo():null,idToken:a?a.rawToken:_.EMPTY_STRING,idTokenClaims:a?a.claims:{},accessToken:f,fromCache:i,expiresOn:g,correlationId:o.correlationId,requestId:l||_.EMPTY_STRING,extExpiresOn:x,familyId:m,tokenType:((d=n.accessToken)===null||d===void 0?void 0:d.tokenType)||_.EMPTY_STRING,state:s?s.userRequestState:_.EMPTY_STRING,cloudGraphHostName:((h=n.account)===null||h===void 0?void 0:h.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((u=n.account)===null||u===void 0?void 0:u.msGraphHost)||_.EMPTY_STRING,code:c,fromNativeBroker:!1}]}})})},t}();var n3=function(t){br(e,t);function e(r){var n=t.call(this,r)||this;return n.includeRedirectUri=!0,n}return e.prototype.getAuthCodeUrl=function(r){return Z(this,void 0,void 0,function(){var n;return ee(this,function(i){switch(i.label){case 0:return[4,this.createAuthCodeUrlQueryString(r)];case 1:return n=i.sent(),[2,be.appendQueryString(this.authority.authorizationEndpoint,n)]}})})},e.prototype.acquireToken=function(r,n){var i;return Z(this,void 0,void 0,function(){var o,a,s,c;return ee(this,function(l){switch(l.label){case 0:if(this.logger.info("in acquireToken call"),!r||V.isEmpty(r.code))throw j.createTokenRequestCannotBeMadeError();return o=Br.nowSeconds(),[4,this.executeTokenRequest(this.authority,r)];case 1:return a=l.sent(),s=(i=a.headers)===null||i===void 0?void 0:i[ln.X_MS_REQUEST_ID],c=new Bd(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),c.validateTokenResponse(a.body),[4,c.handleServerTokenResponse(a.body,this.authority,o,r,n,void 0,void 0,void 0,s)];case 2:return[2,l.sent()]}})})},e.prototype.handleFragmentResponse=function(r,n){var i=new Bd(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),o=new be(r),a=be.getDeserializedHash(o.getHash());if(i.validateServerAuthorizationCodeResponse(a,n,this.cryptoUtils),!a.code)throw j.createNoAuthCodeInServerResponseError();return Re(Re({},a),{code:a.code})},e.prototype.getLogoutUri=function(r){if(!r)throw Fe.createEmptyLogoutRequestError();var n=this.createLogoutUrlQueryString(r);return be.appendQueryString(this.authority.endSessionEndpoint,n)},e.prototype.executeTokenRequest=function(r,n){return Z(this,void 0,void 0,function(){var i,o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return i={clientId:this.config.authOptions.clientId,authority:r.canonicalAuthority,scopes:n.scopes,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid},[4,this.createTokenRequestBody(n)];case 1:if(o=h.sent(),a=this.createTokenQueryParameters(n),s=void 0,n.clientInfo)try{c=Ud(n.clientInfo,this.cryptoUtils),s={credential:""+c.uid+Tr.CLIENT_INFO_SEPARATOR+c.utid,type:kr.HOME_ACCOUNT_ID}}catch(u){this.logger.verbose("Could not parse client info for CCS Header: "+u)}return l=this.createTokenRequestHeaders(s||n.ccsCredential),d=V.isEmpty(a)?r.tokenEndpoint:r.tokenEndpoint+"?"+a,[2,this.executePostToTokenEndpoint(d,o,l,i)]}})})},e.prototype.createTokenQueryParameters=function(r){var n=new da;return r.tokenQueryParameters&&n.addExtraQueryParameters(r.tokenQueryParameters),n.createQueryString()},e.prototype.createTokenRequestBody=function(r){return Z(this,void 0,void 0,function(){var n,i,o,a,s,c,l,l,d;return ee(this,function(h){switch(h.label){case 0:return n=new da,n.addClientId(this.config.authOptions.clientId),this.includeRedirectUri?n.addRedirectUri(r.redirectUri):eo.validateRedirectUri(r.redirectUri),n.addScopes(r.scopes),n.addAuthorizationCode(r.code),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&n.addServerTelemetry(this.serverTelemetryManager),r.codeVerifier&&n.addCodeVerifier(r.codeVerifier),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(i=this.config.clientCredentials.clientAssertion,n.addClientAssertion(i.assertion),n.addClientAssertionType(i.assertionType)),n.addGrantType(Dd.AUTHORIZATION_CODE_GRANT),n.addClientInfo(),r.authenticationScheme!==Se.POP?[3,2]:(o=new Pa(this.cryptoUtils),[4,o.generateCnf(r)]);case 1:return a=h.sent(),n.addPopToken(a.reqCnfString),[3,3];case 2:if(r.authenticationScheme===Se.SSH)if(r.sshJwk)n.addSshJwk(r.sshJwk);else throw Fe.createMissingSshJwkError();h.label=3;case 3:if(s=r.correlationId||this.config.cryptoInterface.createNewGuid(),n.addCorrelationId(s),(!V.isEmptyObj(r.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(r.claims,this.config.authOptions.clientCapabilities),c=void 0,r.clientInfo)try{l=Ud(r.clientInfo,this.cryptoUtils),c={credential:""+l.uid+Tr.CLIENT_INFO_SEPARATOR+l.utid,type:kr.HOME_ACCOUNT_ID}}catch(u){this.logger.verbose("Could not parse client info for CCS Header: "+u)}else c=r.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&c)switch(c.type){case kr.HOME_ACCOUNT_ID:try{l=la(c.credential),n.addCcsOid(l)}catch(u){this.logger.verbose("Could not parse home account ID for CCS Header: "+u)}break;case kr.UPN:n.addCcsUpn(c.credential);break}return r.tokenBodyParameters&&n.addExtraQueryParameters(r.tokenBodyParameters),r.enableSpaAuthorizationCode&&(!r.tokenBodyParameters||!r.tokenBodyParameters[ne.RETURN_SPA_CODE])&&n.addExtraQueryParameters((d={},d[ne.RETURN_SPA_CODE]="1",d)),[2,n.createQueryString()]}})})},e.prototype.createAuthCodeUrlQueryString=function(r){return Z(this,void 0,void 0,function(){var n,i,o,a,s,c,c,c,l,d;return ee(this,function(h){switch(h.label){case 0:if(n=new da,n.addClientId(this.config.authOptions.clientId),i=S1(r.scopes||[],r.extraScopesToConsent||[]),n.addScopes(i),n.addRedirectUri(r.redirectUri),o=r.correlationId||this.config.cryptoInterface.createNewGuid(),n.addCorrelationId(o),n.addResponseMode(r.responseMode),n.addResponseTypeCode(),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addClientInfo(),r.codeChallenge&&r.codeChallengeMethod&&n.addCodeChallengeParams(r.codeChallenge,r.codeChallengeMethod),r.prompt&&n.addPrompt(r.prompt),r.domainHint&&n.addDomainHint(r.domainHint),r.prompt!==jt.SELECT_ACCOUNT)if(r.sid&&r.prompt===jt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),n.addSid(r.sid);else if(r.account){if(a=this.extractAccountSid(r.account),s=this.extractLoginHint(r.account),s){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),n.addLoginHint(s);try{c=la(r.account.homeAccountId),n.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&r.prompt===jt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),n.addSid(a);try{c=la(r.account.homeAccountId),n.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(r.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),n.addLoginHint(r.loginHint),n.addCcsUpn(r.loginHint);else if(r.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),n.addLoginHint(r.account.username);try{c=la(r.account.homeAccountId),n.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else r.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),n.addLoginHint(r.loginHint),n.addCcsUpn(r.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return r.nonce&&n.addNonce(r.nonce),r.state&&n.addState(r.state),(!V.isEmpty(r.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(r.claims,this.config.authOptions.clientCapabilities),r.extraQueryParameters&&n.addExtraQueryParameters(r.extraQueryParameters),r.nativeBroker?(n.addNativeBroker(),r.authenticationScheme!==Se.POP?[3,2]:(l=new Pa(this.cryptoUtils),[4,l.generateCnf(r)])):[3,2];case 1:d=h.sent(),n.addPopToken(d.reqCnfHash),h.label=2;case 2:return[2,n.createQueryString()]}})})},e.prototype.createLogoutUrlQueryString=function(r){var n=new da;return r.postLogoutRedirectUri&&n.addPostLogoutRedirectUri(r.postLogoutRedirectUri),r.correlationId&&n.addCorrelationId(r.correlationId),r.idTokenHint&&n.addIdTokenHint(r.idTokenHint),r.state&&n.addState(r.state),r.logoutHint&&n.addLogoutHint(r.logoutHint),r.extraQueryParameters&&n.addExtraQueryParameters(r.extraQueryParameters),n.createQueryString()},e.prototype.extractAccountSid=function(r){var n;return((n=r.idTokenClaims)===null||n===void 0?void 0:n.sid)||null},e.prototype.extractLoginHint=function(r){var n;return((n=r.idTokenClaims)===null||n===void 0?void 0:n.login_hint)||null},e}(n0);var pt;(function(t){t.AcquireTokenByCode="acquireTokenByCode",t.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",t.AcquireTokenSilent="acquireTokenSilent",t.AcquireTokenSilentAsync="acquireTokenSilentAsync",t.AcquireTokenPopup="acquireTokenPopup",t.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",t.CryptoOptsSignJwt="cryptoOptsSignJwt",t.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",t.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",t.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",t.SsoSilent="ssoSilent",t.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",t.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",t.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",t.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",t.BrokerHandhshake="brokerHandshake",t.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",t.AcquireTokenByBroker="acquireTokenByBroker",t.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",t.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",t.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken"})(pt||(pt={}));var ha;(function(t){t[t.NotStarted=0]="NotStarted",t[t.InProgress=1]="InProgress",t[t.Completed=2]="Completed"})(ha||(ha={}));var i3=function(t){br(e,t);function e(r,n){return t.call(this,r,n)||this}return e.prototype.acquireToken=function(r){var n,i,o;return Z(this,void 0,void 0,function(){var a,s,c,l,d,h=this;return ee(this,function(u){switch(u.label){case 0:return a=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement(pt.RefreshTokenClientAcquireToken,r.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",r.correlationId),s=Br.nowSeconds(),[4,this.executeTokenRequest(r,this.authority)];case 1:return c=u.sent(),a==null||a.addStaticFields({refreshTokenSize:((i=c.body.refresh_token)===null||i===void 0?void 0:i.length)||0}),l=(o=c.headers)===null||o===void 0?void 0:o[ln.X_MS_REQUEST_ID],d=new Bd(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),d.validateTokenResponse(c.body),[2,d.handleServerTokenResponse(c.body,this.authority,s,r,void 0,void 0,!0,r.forceCache,l).then(function(f){return a==null||a.endMeasurement({success:!0}),f}).catch(function(f){throw h.logger.verbose("Error in fetching refresh token",r.correlationId),a==null||a.endMeasurement({errorCode:f.errorCode,subErrorCode:f.subError,success:!1}),f})]}})})},e.prototype.acquireTokenByRefreshToken=function(r){return Z(this,void 0,void 0,function(){var n,i,o;return ee(this,function(a){if(!r)throw Fe.createEmptyTokenRequestError();if(!r.account)throw j.createNoAccountInSilentRequestError();if(n=this.cacheManager.isAppMetadataFOCI(r.account.environment,this.config.authOptions.clientId),n)try{return[2,this.acquireTokenWithCachedRefreshToken(r,!0)]}catch(s){if(i=s instanceof an&&s.errorCode===ms.noTokensFoundError.code,o=s instanceof So&&s.errorCode===om.INVALID_GRANT_ERROR&&s.subError===om.CLIENT_MISMATCH_ERROR,i||o)return[2,this.acquireTokenWithCachedRefreshToken(r,!1)];throw s}return[2,this.acquireTokenWithCachedRefreshToken(r,!1)]})})},e.prototype.acquireTokenWithCachedRefreshToken=function(r,n){var i;return Z(this,void 0,void 0,function(){var o,a,s;return ee(this,function(c){if(o=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement(pt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,r.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",r.correlationId),a=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,r.account,n),!a)throw o==null||o.discardMeasurement(),an.createNoTokensFoundError();return o==null||o.endMeasurement({success:!0}),s=Re(Re({},r),{refreshToken:a.secret,authenticationScheme:r.authenticationScheme||Se.BEARER,ccsCredential:{credential:r.account.homeAccountId,type:kr.HOME_ACCOUNT_ID}}),[2,this.acquireToken(s)]})})},e.prototype.executeTokenRequest=function(r,n){var i;return Z(this,void 0,void 0,function(){var o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return o=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement(pt.RefreshTokenClientExecuteTokenRequest,r.correlationId),[4,this.createTokenRequestBody(r)];case 1:return a=h.sent(),s=this.createTokenQueryParameters(r),c=this.createTokenRequestHeaders(r.ccsCredential),l={clientId:this.config.authOptions.clientId,authority:n.canonicalAuthority,scopes:r.scopes,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},d=be.appendQueryString(n.tokenEndpoint,s),[2,this.executePostToTokenEndpoint(d,a,c,l).then(function(u){return o==null||o.endMeasurement({success:!0}),u}).catch(function(u){throw o==null||o.endMeasurement({success:!1}),u})]}})})},e.prototype.createTokenQueryParameters=function(r){var n=new da;return r.tokenQueryParameters&&n.addExtraQueryParameters(r.tokenQueryParameters),n.createQueryString()},e.prototype.createTokenRequestBody=function(r){var n;return Z(this,void 0,void 0,function(){var i,o,a,s,c,l,d;return ee(this,function(h){switch(h.label){case 0:return i=r.correlationId,o=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement(pt.BaseClientCreateTokenRequestHeaders,i),a=new da,a.addClientId(this.config.authOptions.clientId),a.addScopes(r.scopes),a.addGrantType(Dd.REFRESH_TOKEN_GRANT),a.addClientInfo(),a.addLibraryInfo(this.config.libraryInfo),a.addApplicationTelemetry(this.config.telemetry.application),a.addThrottling(),this.serverTelemetryManager&&a.addServerTelemetry(this.serverTelemetryManager),a.addCorrelationId(i),a.addRefreshToken(r.refreshToken),this.config.clientCredentials.clientSecret&&a.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(s=this.config.clientCredentials.clientAssertion,a.addClientAssertion(s.assertion),a.addClientAssertionType(s.assertionType)),r.authenticationScheme!==Se.POP?[3,2]:(c=new Pa(this.cryptoUtils),[4,c.generateCnf(r)]);case 1:return l=h.sent(),a.addPopToken(l.reqCnfString),[3,3];case 2:if(r.authenticationScheme===Se.SSH)if(r.sshJwk)a.addSshJwk(r.sshJwk);else throw o==null||o.endMeasurement({success:!1}),Fe.createMissingSshJwkError();h.label=3;case 3:if((!V.isEmptyObj(r.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&a.addClaims(r.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&r.ccsCredential)switch(r.ccsCredential.type){case kr.HOME_ACCOUNT_ID:try{d=la(r.ccsCredential.credential),a.addCcsOid(d)}catch(u){this.logger.verbose("Could not parse home account ID for CCS Header: "+u)}break;case kr.UPN:a.addCcsUpn(r.ccsCredential.credential);break}return o==null||o.endMeasurement({success:!0}),[2,a.createQueryString()]}})})},e}(n0);var b_=function(t){br(e,t);function e(r,n){return t.call(this,r,n)||this}return e.prototype.acquireToken=function(r){return Z(this,void 0,void 0,function(){var n,i;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.acquireCachedToken(r)];case 1:return[2,o.sent()];case 2:if(n=o.sent(),n instanceof j&&n.errorCode===R.tokenRefreshRequired.code)return i=new i3(this.config,this.performanceClient),[2,i.acquireTokenByRefreshToken(r)];throw n;case 3:return[2]}})})},e.prototype.acquireCachedToken=function(r){var n,i,o,a;return Z(this,void 0,void 0,function(){var s,c;return ee(this,function(l){switch(l.label){case 0:if(!r)throw Fe.createEmptyTokenRequestError();if(r.forceRefresh)throw(n=this.serverTelemetryManager)===null||n===void 0||n.setCacheOutcome(lo.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),j.createRefreshRequiredError();if(!r.account)throw j.createNoAccountInSilentRequestError();if(s=r.authority||this.authority.getPreferredCache(),c=this.cacheManager.readCacheRecord(r.account,this.config.authOptions.clientId,r,s),c.accessToken){if(Br.wasClockTurnedBack(c.accessToken.cachedAt)||Br.isTokenExpired(c.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw(o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(lo.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),j.createRefreshRequiredError();if(c.accessToken.refreshOn&&Br.isTokenExpired(c.accessToken.refreshOn,0))throw(a=this.serverTelemetryManager)===null||a===void 0||a.setCacheOutcome(lo.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),j.createRefreshRequiredError()}else throw(i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(lo.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),j.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(c,r)];case 1:return[2,l.sent()]}})})},e.prototype.generateResultFromCacheRecord=function(r,n){return Z(this,void 0,void 0,function(){var i,o;return ee(this,function(a){switch(a.label){case 0:if(r.idToken&&(i=new Tn(r.idToken.secret,this.config.cryptoInterface)),n.maxAge||n.maxAge===0){if(o=i==null?void 0:i.claims.auth_time,!o)throw j.createAuthTimeNotFoundError();Tn.checkMaxAge(o,n.maxAge)}return[4,Bd.generateAuthenticationResult(this.cryptoUtils,this.authority,r,!0,n,i)];case 1:return[2,a.sent()]}})})},e}(n0);function w_(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}var o3={endpointMetadata:{"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"}},instanceDiscoveryMetadata:{"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"]}]}}},sm=o3.endpointMetadata,cm=o3.instanceDiscoveryMetadata;var qd;(function(t){t.AAD="AAD",t.OIDC="OIDC"})(qd||(qd={}));var h2=function(){function t(){this.expiresAt=Br.nowSeconds()+Fs.REFRESH_TIME_SECONDS}return t.prototype.updateCloudDiscoveryMetadata=function(e,r){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=r},t.prototype.updateEndpointMetadata=function(e,r){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=r,this.jwks_uri=e.jwks_uri},t.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},t.prototype.resetExpiresAt=function(){this.expiresAt=Br.nowSeconds()+Fs.REFRESH_TIME_SECONDS},t.prototype.isExpired=function(){return this.expiresAt<=Br.nowSeconds()},t.isAuthorityMetadataEntity=function(e,r){return r?e.indexOf(Fs.CACHE_KEY)===0&&r.hasOwnProperty("aliases")&&r.hasOwnProperty("preferred_cache")&&r.hasOwnProperty("preferred_network")&&r.hasOwnProperty("canonical_authority")&&r.hasOwnProperty("authorization_endpoint")&&r.hasOwnProperty("token_endpoint")&&r.hasOwnProperty("issuer")&&r.hasOwnProperty("aliasesFromNetwork")&&r.hasOwnProperty("endpointsFromNetwork")&&r.hasOwnProperty("expiresAt")&&r.hasOwnProperty("jwks_uri"):!1},t}();function x_(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}function E_(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}var C_=function(){function t(e){this.networkInterface=e}return t.prototype.detectRegion=function(e,r,n){return Z(this,void 0,void 0,function(){var i,o,a,s,c;return ee(this,function(l){switch(l.label){case 0:if(i=e,i)return[3,8];o=t.IMDS_OPTIONS,n&&(o.proxyUrl=n),l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(_.IMDS_VERSION,o)];case 2:return a=l.sent(),a.status===ca.httpSuccess&&(i=a.body,r.region_source=vi.IMDS),a.status!==ca.httpBadRequest?[3,5]:[4,this.getCurrentVersion(o)];case 3:return s=l.sent(),s?[4,this.getRegionFromIMDS(s,o)]:(r.region_source=vi.FAILED_AUTO_DETECTION,[2,null]);case 4:c=l.sent(),c.status===ca.httpSuccess&&(i=c.body,r.region_source=vi.IMDS),l.label=5;case 5:return[3,7];case 6:return l.sent(),r.region_source=vi.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:r.region_source=vi.ENVIRONMENT_VARIABLE,l.label=9;case 9:return i||(r.region_source=vi.FAILED_AUTO_DETECTION),[2,i||null]}})})},t.prototype.getRegionFromIMDS=function(e,r){return Z(this,void 0,void 0,function(){return ee(this,function(n){return[2,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?api-version="+e+"&format=text",r,_.IMDS_TIMEOUT)]})})},t.prototype.getCurrentVersion=function(e){return Z(this,void 0,void 0,function(){var r;return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?format=json",e)];case 1:return r=n.sent(),r.status===ca.httpBadRequest&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?[2,r.body["newest-versions"][0]]:[2,null];case 2:return n.sent(),[2,null];case 3:return[2]}})})},t.IMDS_OPTIONS={headers:{Metadata:"true"}},t}();var Gd=function(){function t(e,r,n,i,o,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=i,this.regionDiscovery=new C_(r),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=a||_.EMPTY_STRING,this.logger=o}return Object.defineProperty(t.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;if(e.length)switch(e[0].toLowerCase()){case _.ADFS:return Fr.Adfs;case _.DSTS:return Fr.Dsts}return Fr.Default},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new be(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw j.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}else throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),t.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},t.prototype.replacePath=function(e){var r=e,n=new be(this.metadata.canonical_authority),i=n.getUrlComponents().PathSegments,o=this.canonicalAuthorityUrlComponents.PathSegments;return o.forEach(function(a,s){var c=i[s];a!==c&&(r=r.replace("/"+c+"/","/"+a+"/"))}),r},Object.defineProperty(t.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===Fr.Adfs||this.authorityType===Fr.Dsts||this.protocolMode===qd.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),t.prototype.discoveryComplete=function(){return!!this.metadata},t.prototype.resolveEndpointsAsync=function(){return Z(this,void 0,void 0,function(){var e,r,n,i;return ee(this,function(o){switch(o.label){case 0:return e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort),e||(e=new h2,e.updateCanonicalAuthority(this.canonicalAuthority)),[4,this.updateCloudDiscoveryMetadata(e)];case 1:return r=o.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network),[4,this.updateEndpointMetadata(e)];case 2:return n=o.sent(),r!==Or.CACHE&&n!==Or.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority)),i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache),this.cacheManager.setAuthorityMetadata(i,e),this.metadata=e,[2]}})})},t.prototype.updateEndpointMetadata=function(e){var r,n;return Z(this,void 0,void 0,function(){var i,o;return ee(this,function(a){switch(a.label){case 0:return i=this.getEndpointMetadataFromConfig(),i?(e.updateEndpointMetadata(i,!1),[2,Or.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,Or.CACHE]:(o=this.getEndpointMetadataFromHardcodedValues(),[4,this.getEndpointMetadataFromNetwork()]);case 1:return i=a.sent(),i?!((r=this.authorityOptions.azureRegionConfiguration)===null||r===void 0)&&r.azureRegion?[4,this.updateMetadataWithRegionalInformation(i)]:[3,3]:[3,4];case 2:i=a.sent(),a.label=3;case 3:return e.updateEndpointMetadata(i,!0),[2,Or.NETWORK];case 4:return o&&!this.authorityOptions.skipAuthorityMetadataCache?!((n=this.authorityOptions.azureRegionConfiguration)===null||n===void 0)&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(o)]:[3,6]:[3,7];case 5:o=a.sent(),a.label=6;case 6:return e.updateEndpointMetadata(o,!1),[2,Or.HARDCODED_VALUES];case 7:throw j.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},t.prototype.isAuthoritySameType=function(e){var r=new be(e.canonical_authority),n=r.getUrlComponents().PathSegments;return n.length===this.canonicalAuthorityUrlComponents.PathSegments.length},t.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Fe.createInvalidAuthorityMetadataError()}return null},t.prototype.getEndpointMetadataFromNetwork=function(){return Z(this,void 0,void 0,function(){var e,r;return ee(this,function(n){switch(n.label){case 0:e={},this.proxyUrl&&(e.proxyUrl=this.proxyUrl),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,e)];case 2:return r=n.sent(),[2,w_(r.body)?r.body:null];case 3:return n.sent(),[2,null];case 4:return[2]}})})},t.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in sm?sm[this.canonicalAuthority]:null},t.prototype.updateMetadataWithRegionalInformation=function(e){var r,n,i,o,a;return Z(this,void 0,void 0,function(){var s,c;return ee(this,function(l){switch(l.label){case 0:return[4,this.regionDiscovery.detectRegion((r=this.authorityOptions.azureRegionConfiguration)===null||r===void 0?void 0:r.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)];case 1:return s=l.sent(),c=((n=this.authorityOptions.azureRegionConfiguration)===null||n===void 0?void 0:n.azureRegion)===_.AZURE_REGION_AUTO_DISCOVER_FLAG?s:(i=this.authorityOptions.azureRegionConfiguration)===null||i===void 0?void 0:i.azureRegion,((o=this.authorityOptions.azureRegionConfiguration)===null||o===void 0?void 0:o.azureRegion)===_.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=s?no.AUTO_DETECTION_REQUESTED_SUCCESSFUL:no.AUTO_DETECTION_REQUESTED_FAILED:s?this.regionDiscoveryMetadata.region_outcome=((a=this.authorityOptions.azureRegionConfiguration)===null||a===void 0?void 0:a.azureRegion)===s?no.CONFIGURED_MATCHES_DETECTED:no.CONFIGURED_NOT_DETECTED:this.regionDiscoveryMetadata.region_outcome=no.CONFIGURED_NO_AUTO_DETECTION,c?(this.regionDiscoveryMetadata.region_used=c,[2,t.replaceWithRegionalInformation(e,c)]):[2,e]}})})},t.prototype.updateCloudDiscoveryMetadata=function(e){return Z(this,void 0,void 0,function(){var r,n,i;return ee(this,function(o){switch(o.label){case 0:return this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||_.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||_.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(e.canonical_authority||_.NOT_APPLICABLE)),r=this.getCloudDiscoveryMetadataFromConfig(),r?(this.logger.verbose("Found cloud discovery metadata in the config."),e.updateCloudDiscoveryMetadata(r,!1),[2,Or.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),n=e.isExpired(),this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!n?(this.logger.verbose("Found metadata in the cache."),[2,Or.CACHE]):(n&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(r=o.sent(),r)return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),e.updateCloudDiscoveryMetadata(r,!0),[2,Or.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),i=this.getCloudDiscoveryMetadataFromHarcodedValues(),i&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(i,!1),[2,Or.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),Fe.createUntrustedAuthorityError()}})})},t.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=t.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Fe.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},t.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return Z(this,void 0,void 0,function(){var e,r,n,i,o,a,s,c;return ee(this,function(l){switch(l.label){case 0:e=""+_.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",r={},this.proxyUrl&&(r.proxyUrl=this.proxyUrl),n=null,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(e,r)];case 2:if(i=l.sent(),o=void 0,a=void 0,x_(i.body))o=i.body,a=o.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+o.tenant_discovery_endpoint);else if(E_(i.body)){if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+i.status),o=i.body,o.error===_.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+o.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+o.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),n=t.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4];case 3:return s=l.sent(),s instanceof W?this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
|
|
12
12
|
Error: `+s.errorCode+`
|
|
13
13
|
Error Description: `+s.errorMessage):(c=s,this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
|
|
14
14
|
Error: `+c.name+`
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Fusion Framework Dev Portal</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-5dbe540c.js"></script>
|
|
9
9
|
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"vite": "^4.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@equinor/fusion-framework-app": "^5.0.
|
|
39
|
-
"@equinor/fusion-framework-module-context": "^1.2.
|
|
40
|
-
"@equinor/fusion-framework-react": "^2.
|
|
38
|
+
"@equinor/fusion-framework-app": "^5.0.8",
|
|
39
|
+
"@equinor/fusion-framework-module-context": "^1.2.8",
|
|
40
|
+
"@equinor/fusion-framework-react": "^2.2.0",
|
|
41
41
|
"@equinor/fusion-react-button": "^0.5.15",
|
|
42
42
|
"@equinor/fusion-react-context-selector": "^0.1.8",
|
|
43
43
|
"@equinor/fusion-react-icon": "^0.2.15",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"react-router-dom": "^6.4.3",
|
|
53
53
|
"typescript": "^4.9.3"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "d7bdb6e942f8b4f1f6ddf126f044fe9c64609bdd"
|
|
56
56
|
}
|