jplan-pack 0.6.711 → 0.6.713

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.
@@ -8,7 +8,7 @@ Only state can be modified.`);c[0]="$state",ca=!1,r.set(a,c,r.state.value),ca=!0
8
8
  state: () => new MyClass()
9
9
  Found in store "${D.$id}".`),C&&a&&t.hydrate&&t.hydrate(D.$state,C),m=!0,g=!0,D}/*! #__NO_SIDE_EFFECTS__ */function e0(n,e,t){let r,o;if(typeof n=="string")r=n,o=e;else if(o=n,r=n.id,process.env.NODE_ENV!=="production"&&typeof r!="string")throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');function a(c,d){const h=l.hasInjectionContext();if(c=(process.env.NODE_ENV==="test"&&ts&&ts._testing?null:c)||(h?l.inject(Ry,null):null),c&&vs(c),process.env.NODE_ENV!=="production"&&!ts)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
10
10
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
11
- This will fail in production.`);c=ts,c._s.has(r)||(u_(r,o,c),process.env.NODE_ENV!=="production"&&(a._pinia=c));const m=c._s.get(r);if(process.env.NODE_ENV!=="production"&&d){const g="__hot:"+r,v=u_(g,Zn({},o),c,!0);d._hotUpdate(v),delete c.state.value[g],c._s.delete(g)}if(process.env.NODE_ENV!=="production"&&ui){const g=l.getCurrentInstance();if(g&&g.proxy&&!d){const v=g.proxy,p="_pStores"in v?v._pStores:v._pStores={};p[r]=m}}return m}return a.$id=r,a}const t0=e0({id:"customizer",state:()=>({Sidebar_drawer:!0,Customizer_drawer:!1,mini_sidebar:!1,setHorizontalLayout:!1,actTheme:"DarkJPLANTheme",fontTheme:"Roboto",inputBg:!1,boxed:!1}),getters:{},actions:{SET_SIDEBAR_DRAWER(){this.Sidebar_drawer=!this.Sidebar_drawer},SET_MINI_SIDEBAR(n){this.mini_sidebar=n},SET_CUSTOMIZER_DRAWER(n){this.Customizer_drawer=n},SET_LAYOUT(n){this.setHorizontalLayout=n},SET_THEME(n){this.actTheme=n},SET_FONT(n){this.fontTheme=n}}}),Wi=l.ref({}),Os=n=>{const e=l.computed(()=>n?Wi.value[n]||!1:Wi.value.default||!1),t=()=>{n?Wi.value[n]=!0:Wi.value.default=!0},r=()=>{n?Wi.value[n]=!1:Wi.value.default=!1};return l.onUnmounted(()=>{r()}),l.onMounted(()=>{r()}),{isDialogActive:e,openDialog:t,closeDialog:r}};var n0=Object.defineProperty,d_=Object.getOwnPropertySymbols,r0=Object.prototype.hasOwnProperty,o0=Object.prototype.propertyIsEnumerable,h_=(n,e,t)=>e in n?n0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Hy=(n,e)=>{for(var t in e||(e={}))r0.call(e,t)&&h_(n,t,e[t]);if(d_)for(var t of d_(e))o0.call(e,t)&&h_(n,t,e[t]);return n},Ul=n=>typeof n=="function",Fl=n=>typeof n=="string",$y=n=>Fl(n)&&n.trim().length>0,i0=n=>typeof n=="number",di=n=>typeof n>"u",ys=n=>typeof n=="object"&&n!==null,a0=n=>Vr(n,"tag")&&$y(n.tag),Ky=n=>window.TouchEvent&&n instanceof TouchEvent,Wy=n=>Vr(n,"component")&&zy(n.component),s0=n=>Ul(n)||ys(n),zy=n=>!di(n)&&(Fl(n)||s0(n)||Wy(n)),f_=n=>ys(n)&&["height","width","right","left","top","bottom"].every(e=>i0(n[e])),Vr=(n,e)=>(ys(n)||Ul(n))&&e in n,c0=(n=>()=>n++)(0);function Dd(n){return Ky(n)?n.targetTouches[0].clientX:n.clientX}function m_(n){return Ky(n)?n.targetTouches[0].clientY:n.clientY}var l0=n=>{di(n.remove)?n.parentNode&&n.parentNode.removeChild(n):n.remove()},Ps=n=>Wy(n)?Ps(n.component):a0(n)?l.defineComponent({render(){return n}}):typeof n=="string"?n:l.toRaw(l.unref(n)),u0=n=>{if(typeof n=="string")return n;const e=Vr(n,"props")&&ys(n.props)?n.props:{},t=Vr(n,"listeners")&&ys(n.listeners)?n.listeners:{};return{component:Ps(n),props:e,listeners:t}},d0=()=>typeof window<"u",Bl=class{constructor(){this.allHandlers={}}getHandlers(n){return this.allHandlers[n]||[]}on(n,e){const t=this.getHandlers(n);t.push(e),this.allHandlers[n]=t}off(n,e){const t=this.getHandlers(n);t.splice(t.indexOf(e)>>>0,1)}emit(n,e){this.getHandlers(n).forEach(r=>r(e))}},h0=n=>["on","off","emit"].every(e=>Vr(n,e)&&Ul(n[e]));exports.TYPE=void 0;(function(n){n.SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.INFO="info",n.DEFAULT="default"})(exports.TYPE||(exports.TYPE={}));exports.POSITION=void 0;(function(n){n.TOP_LEFT="top-left",n.TOP_CENTER="top-center",n.TOP_RIGHT="top-right",n.BOTTOM_LEFT="bottom-left",n.BOTTOM_CENTER="bottom-center",n.BOTTOM_RIGHT="bottom-right"})(exports.POSITION||(exports.POSITION={}));var Dn;(function(n){n.ADD="add",n.DISMISS="dismiss",n.UPDATE="update",n.CLEAR="clear",n.UPDATE_DEFAULTS="update_defaults"})(Dn||(Dn={}));var gr="Vue-Toastification",mr={type:{type:String,default:exports.TYPE.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},Gy={type:mr.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},nl={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:mr.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},yh={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},qy={transition:{type:[Object,String],default:`${gr}__bounce`}},f0={position:{type:String,default:exports.POSITION.TOP_RIGHT},draggable:mr.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:mr.trueBoolean,pauseOnHover:mr.trueBoolean,closeOnClick:mr.trueBoolean,timeout:yh.timeout,hideProgressBar:yh.hideProgressBar,toastClassName:mr.classNames,bodyClassName:mr.classNames,icon:Gy.customIcon,closeButton:nl.component,closeButtonClassName:nl.classNames,showCloseButtonOnHover:nl.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Bl}},m0={id:{type:[String,Number],required:!0,default:0},type:mr.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},g0={container:{type:[Object,Function],default:()=>document.body},newestOnTop:mr.trueBoolean,maxToasts:{type:Number,default:20},transition:qy.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:n=>n},filterToasts:{type:Function,default:n=>n},containerClassName:mr.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},lo={CORE_TOAST:f0,TOAST:m0,CONTAINER:g0,PROGRESS_BAR:yh,ICON:Gy,TRANSITION:qy,CLOSE_BUTTON:nl},jy=l.defineComponent({name:"VtProgressBar",props:lo.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${gr}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function p0(n,e){return l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(n.style),class:l.normalizeClass(n.cpClass)},null,6)}jy.render=p0;var _0=jy,Yy=l.defineComponent({name:"VtCloseButton",props:lo.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?Ps(this.component):"button"},classes(){const n=[`${gr}__close-button`];return this.showOnHover&&n.push("show-on-hover"),n.concat(this.classNames)}}}),v0=l.createTextVNode(" × ");function y0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.buttonComponent),l.mergeProps({"aria-label":n.ariaLabel,class:n.classes},n.$attrs),{default:l.withCtx(()=>[v0]),_:1},16,["aria-label","class"])}Yy.render=y0;var C0=Yy,Jy={},E0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},w0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),T0=[w0];function b0(n,e){return l.openBlock(),l.createElementBlock("svg",E0,T0)}Jy.render=b0;var I0=Jy,Qy={},S0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},A0=l.createElementVNode("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),k0=[A0];function N0(n,e){return l.openBlock(),l.createElementBlock("svg",S0,k0)}Qy.render=N0;var g_=Qy,Xy={},R0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},O0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),P0=[O0];function M0(n,e){return l.openBlock(),l.createElementBlock("svg",R0,P0)}Xy.render=M0;var D0=Xy,Zy={},L0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},x0=l.createElementVNode("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),U0=[x0];function F0(n,e){return l.openBlock(),l.createElementBlock("svg",L0,U0)}Zy.render=F0;var B0=Zy,eC=l.defineComponent({name:"VtIcon",props:lo.ICON,computed:{customIconChildren(){return Vr(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Fl(this.customIcon)?this.trimValue(this.customIcon):Vr(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return Vr(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:zy(this.customIcon)?Ps(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[exports.TYPE.DEFAULT]:g_,[exports.TYPE.INFO]:g_,[exports.TYPE.SUCCESS]:I0,[exports.TYPE.ERROR]:B0,[exports.TYPE.WARNING]:D0}[this.type]},iconClasses(){const n=[`${gr}__icon`];return this.hasCustomIcon?n.concat(this.customIconClass):n}},methods:{trimValue(n,e=""){return $y(n)?n.trim():e}}});function V0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.component),{class:l.normalizeClass(n.iconClasses)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.customIconChildren),1)]),_:1},8,["class"])}eC.render=V0;var H0=eC,tC=l.defineComponent({name:"VtToast",components:{ProgressBar:_0,CloseButton:C0,Icon:H0},inheritAttrs:!1,props:Object.assign({},lo.CORE_TOAST,lo.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const n=[`${gr}__toast`,`${gr}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&n.push("disable-transition"),this.rtl&&n.push(`${gr}__toast--rtl`),n},bodyClasses(){return[`${gr}__toast-${Fl(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return f_(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:Vr,getVueComponentFromObj:Ps,closeToast(){this.eventBus.emit(Dn.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const n=this.$el;n.addEventListener("touchstart",this.onDragStart,{passive:!0}),n.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const n=this.$el;n.removeEventListener("touchstart",this.onDragStart),n.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(n){this.beingDragged=!0,this.dragPos={x:Dd(n),y:m_(n)},this.dragStart=Dd(n),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(n){this.beingDragged&&(n.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Dd(n),y:m_(n)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,f_(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),$0=["role"];function K0(n,e){const t=l.resolveComponent("Icon"),r=l.resolveComponent("CloseButton"),o=l.resolveComponent("ProgressBar");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n.classes),style:l.normalizeStyle(n.draggableStyle),onClick:e[0]||(e[0]=(...a)=>n.clickHandler&&n.clickHandler(...a)),onMouseenter:e[1]||(e[1]=(...a)=>n.hoverPause&&n.hoverPause(...a)),onMouseleave:e[2]||(e[2]=(...a)=>n.hoverPlay&&n.hoverPlay(...a))},[n.icon?(l.openBlock(),l.createBlock(t,{key:0,"custom-icon":n.icon,type:n.type},null,8,["custom-icon","type"])):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{role:n.accessibility.toastRole||"alert",class:l.normalizeClass(n.bodyClasses)},[typeof n.content=="string"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(n.content),1)],2112)):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.getVueComponentFromObj(n.content)),l.mergeProps({key:1,"toast-id":n.id},n.hasProp(n.content,"props")?n.content.props:{},l.toHandlers(n.hasProp(n.content,"listeners")?n.content.listeners:{}),{onCloseToast:n.closeToast}),null,16,["toast-id","onCloseToast"]))],10,$0),n.closeButton?(l.openBlock(),l.createBlock(r,{key:1,component:n.closeButton,"class-names":n.closeButtonClassName,"show-on-hover":n.showCloseButtonOnHover,"aria-label":n.accessibility.closeButtonLabel,onClick:l.withModifiers(n.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):l.createCommentVNode("v-if",!0),n.timeout?(l.openBlock(),l.createBlock(o,{key:2,"is-running":n.isRunning,"hide-progress-bar":n.hideProgressBar,timeout:n.timeout,onCloseToast:n.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):l.createCommentVNode("v-if",!0)],38)}tC.render=K0;var W0=tC,nC=l.defineComponent({name:"VtTransition",props:lo.TRANSITION,emits:["leave"],methods:{hasProp:Vr,leave(n){n instanceof HTMLElement&&(n.style.left=n.offsetLeft+"px",n.style.top=n.offsetTop+"px",n.style.width=getComputedStyle(n).width,n.style.position="absolute")}}});function z0(n,e){return l.openBlock(),l.createBlock(l.TransitionGroup,{tag:"div","enter-active-class":n.transition.enter?n.transition.enter:`${n.transition}-enter-active`,"move-class":n.transition.move?n.transition.move:`${n.transition}-move`,"leave-active-class":n.transition.leave?n.transition.leave:`${n.transition}-leave-active`,onLeave:n.leave},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}nC.render=z0;var G0=nC,rC=l.defineComponent({name:"VueToastification",devtools:{hide:!0},components:{Toast:W0,VtTransition:G0},props:Object.assign({},lo.CORE_TOAST,lo.CONTAINER,lo.TRANSITION),data(){return{count:0,positions:Object.values(exports.POSITION),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const n=this.eventBus;n.on(Dn.ADD,this.addToast),n.on(Dn.CLEAR,this.clearToasts),n.on(Dn.DISMISS,this.dismissToast),n.on(Dn.UPDATE,this.updateToast),n.on(Dn.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(n){Ul(n)&&(n=await n()),l0(this.$el),n.appendChild(this.$el)},setToast(n){di(n.id)||(this.toasts[n.id]=n)},addToast(n){n.content=u0(n.content);const e=Object.assign({},this.defaults,n.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[n.type],n),t=this.defaults.filterBeforeCreate(e,this.toastArray);t&&this.setToast(t)},dismissToast(n){const e=this.toasts[n];!di(e)&&!di(e.onClose)&&e.onClose(),delete this.toasts[n]},clearToasts(){Object.keys(this.toasts).forEach(n=>{this.dismissToast(n)})},getPositionToasts(n){const e=this.filteredToasts.filter(t=>t.position===n).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?e.reverse():e},updateDefaults(n){di(n.container)||this.setup(n.container),this.defaults=Object.assign({},this.defaults,n)},updateToast({id:n,options:e,create:t}){this.toasts[n]?(e.timeout&&e.timeout===this.toasts[n].timeout&&e.timeout++,this.setToast(Object.assign({},this.toasts[n],e))):t&&this.addToast(Object.assign({},{id:n},e))},getClasses(n){return[`${gr}__container`,n].concat(this.defaults.containerClassName)}}});function q0(n,e){const t=l.resolveComponent("Toast"),r=l.resolveComponent("VtTransition");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.positions,o=>(l.openBlock(),l.createElementBlock("div",{key:o},[l.createVNode(r,{transition:n.defaults.transition,class:l.normalizeClass(n.getClasses(o))},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.getPositionToasts(o),a=>(l.openBlock(),l.createBlock(t,l.mergeProps({key:a.id},a),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}rC.render=q0;var j0=rC,p_=(n={},e=!0)=>{const t=n.eventBus=n.eventBus||new Bl;e&&l.nextTick(()=>{const a=l.createApp(j0,Hy({},n)),c=a.mount(document.createElement("div")),d=n.onMounted;if(di(d)||d(c,a),n.shareAppContext){const h=n.shareAppContext;h===!0?console.warn(`[${gr}] App to share context with was not provided.`):(a._context.components=h._context.components,a._context.directives=h._context.directives,a._context.mixins=h._context.mixins,a._context.provides=h._context.provides,a.config.globalProperties=h.config.globalProperties)}});const r=(a,c)=>{const d=Object.assign({},{id:c0(),type:exports.TYPE.DEFAULT},c,{content:a});return t.emit(Dn.ADD,d),d.id};r.clear=()=>t.emit(Dn.CLEAR,void 0),r.updateDefaults=a=>{t.emit(Dn.UPDATE_DEFAULTS,a)},r.dismiss=a=>{t.emit(Dn.DISMISS,a)};function o(a,{content:c,options:d},h=!1){const m=Object.assign({},d,{content:c});t.emit(Dn.UPDATE,{id:a,options:m,create:h})}return r.update=o,r.success=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.SUCCESS})),r.info=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.INFO})),r.error=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.ERROR})),r.warning=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.WARNING})),r},Y0=()=>{const n=()=>console.warn(`[${gr}] This plugin does not support SSR!`);return new Proxy(n,{get(){return n}})};function Cs(n){return d0()?h0(n)?p_({eventBus:n},!1):p_(n,!0):Y0()}var Vl=Symbol("VueToastification"),pf=new Bl,J0=(n,e)=>{(e==null?void 0:e.shareAppContext)===!0&&(e.shareAppContext=n);const t=Cs(Hy({eventBus:pf},e));n.provide(Vl,t)},Q0=n=>{const e=Cs(n);l.getCurrentInstance()&&l.provide(Vl,e)},Er=n=>{if(n)return Cs(n);const e=l.getCurrentInstance()?l.inject(Vl,void 0):void 0;return e||Cs(pf)},X0=J0;const _e=l.ref(!1),Z0={class:"d-flex align-center"},eP={key:1},tP={class:"ms-auto"},Ms=l.defineComponent({__name:"JDialog",props:{ddId:{},variant:{default:"global"},title:{},text:{},width:{default:"500"},reference:{type:Boolean},buttons:{type:Boolean,default:!0},scrim:{default:"background"}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=e,o=l.ref(!1),{isDialogActive:a,closeDialog:c}=Os(t.ddId);async function d(){try{await r("onCancel")}catch(m){console.error(m)}c()}async function h(){o.value=!0;try{await r("onSave")}catch(m){console.error(m)}o.value=!1,c()}return(m,g)=>{const v=l.resolveComponent("ExclamationCircleIcon");return l.openBlock(),l.createElementBlock(l.Fragment,null,[m.variant==="global"?(l.openBlock(),l.createBlock(Qc.VDialog,{key:0,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[0]||(g[0]=p=>l.isRef(a)?a.value=p:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(Lt.VCard,{rounded:"",loading:o.value},{default:l.withCtx(()=>[l.createVNode(Lt.VCardTitle,{class:"mt-2 px-5 d-flex"},{default:l.withCtx(()=>[l.createElementVNode("div",Z0,[m.$slots.title?l.renderSlot(m.$slots,"title",{key:0}):(l.openBlock(),l.createElementBlock("div",eP,l.toDisplayString(t.title),1))]),l.createElementVNode("div",tP,[l.renderSlot(m.$slots,"heading-actions"),l.createVNode(ot.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})])]),_:3}),l.createVNode(gi.VDivider,{class:"mx-5"}),l.createVNode(Lt.VCardText,{class:"overflow-y-scroll"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3}),m.$slots.footer?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(gi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(Lt.VCardActions,null,{default:l.withCtx(()=>[l.renderSlot(m.$slots,"footer")]),_:3})],64)):l.createCommentVNode("",!0),t.buttons?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(gi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(Lt.VCardActions,null,{default:l.withCtx(()=>[m.$slots.metadata?(l.openBlock(),l.createBlock(Je.VCol,{key:0,cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis ma-0 pa-0"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"metadata")]),_:3})):l.createCommentVNode("",!0),l.createVNode(Je.VSpacer),l.createVNode(ot.VBtn,{class:"j-btn-form",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>g[3]||(g[3]=[l.createTextVNode(" Cancel")])),_:1}),l.createVNode(ot.VBtn,{class:"j-btn-form",variant:"flat",color:"secondary",onClick:h,loading:o.value},{default:l.withCtx(()=>g[4]||(g[4]=[l.createTextVNode(" Save ")])),_:1},8,["loading"])]),_:3})],64)):l.createCommentVNode("",!0)]),_:3},8,["loading"])]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0),m.variant==="confirm"?(l.openBlock(),l.createBlock(Qc.VDialog,{key:1,scrim:"background",width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[1]||(g[1]=p=>l.isRef(a)?a.value=p:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(Lt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(v,{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(Lt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(Lt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>g[5]||(g[5]=[l.createTextVNode(" Cancel")])),_:1}),l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:h},{default:l.withCtx(()=>g[6]||(g[6]=[l.createTextVNode(" Confirm")])),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:1},8,["width","modelValue"])):l.createCommentVNode("",!0),m.variant==="empty"?(l.openBlock(),l.createBlock(Qc.VDialog,{key:2,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[2]||(g[2]=p=>l.isRef(a)?a.value=p:null),"onClick:outside":d},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0)],64)}}}),_f=l.defineComponent({__name:"DeleteAllBtn",emits:["removeAll"],setup(n,{emit:e}){const{openDialog:t}=Os("delete-all-__J"),r=e;return(o,a)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Ms,{"dd-id":"delete-all-__J",variant:"confirm",title:"Confirm delete",text:"Are you sure you want to delete all selected items?","on-save":()=>r("removeAll")},null,8,["on-save"]),l.createVNode(ot.VBtn,{onClick:l.unref(t),variant:"plain",color:"secondary","prepend-icon":"mdi-delete"},{default:l.withCtx(()=>a[0]||(a[0]=[l.createTextVNode(" Delete")])),_:1},8,["onClick"])],64))}}),oC=l.defineComponent({__name:"EditButton",emits:["editAll"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(ot.VBtn,{onClick:o[0]||(o[0]=a=>t("editAll")),variant:"plain",color:"secondary","prepend-icon":"mdi-pencil"},{default:l.withCtx(()=>o[1]||(o[1]=[l.createTextVNode(" Edit")])),_:1}))}});var nP={name:"CircleOffIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-circle-off",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20.042 16.045a9 9 0 0 0 -12.087 -12.087m-2.318 1.677a9 9 0 1 0 12.725 12.73"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 3l18 18"},null),l.createTextVNode(" ")])}},rP={name:"DotsVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},oP={name:"DotsIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},iP={name:"EraserIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-eraser",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M18 13.3l-6.3 -6.3"},null),l.createTextVNode(" ")])}},aP={name:"ExclamationCircleIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-exclamation-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 9v4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 16v.01"},null),l.createTextVNode(" ")])}},sP={name:"FilterIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-filter",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null),l.createTextVNode(" ")])}},cP={name:"GripVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-grip-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},lP={name:"HierarchyIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-hierarchy",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M6.5 17.5l5.5 -4.5l5.5 4.5"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 7l0 6"},null),l.createTextVNode(" ")])}},uP={name:"LayoutSidebarRightCollapseIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-layout-sidebar-right-collapse",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 4v16"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 10l2 2l-2 2"},null),l.createTextVNode(" ")])}},dP={name:"RefreshIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-refresh",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null),l.createTextVNode(" ")])}},hP={name:"SearchIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-search",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M21 21l-6 -6"},null),l.createTextVNode(" ")])}},fP={name:"TableIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-table",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 10h18"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 3v18"},null),l.createTextVNode(" ")])}};const iC=l.defineComponent({__name:"DotsMenu",props:{variant:{default:"text"},color:{},orientation:{},size:{}},setup(n){return(e,t)=>(l.openBlock(),l.createBlock(l.unref(Bo.VMenu),{"close-on-content-click":!0},{activator:l.withCtx(({props:r})=>[l.createVNode(l.unref(Bo.VBtn),l.mergeProps({variant:e.variant},r,{icon:""}),{default:l.withCtx(()=>[e.orientation==="y"?(l.openBlock(),l.createBlock(l.unref(rP),{key:0,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"])):(l.openBlock(),l.createBlock(l.unref(oP),{key:1,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"]))]),_:2},1040,["variant"])]),default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3}))}}),Hl=l.defineComponent({__name:"ParentCard",props:{title:{},height:{default:"100%"},loading:{type:Boolean}},setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(Lt.VCard,{"min-height":t.height,height:t.height,loading:t.loading,class:"bg-surface rounded-sm pa-5"},{default:l.withCtx(()=>[e.title?(l.openBlock(),l.createBlock(Lt.VCardTitle,{key:0,class:"pa-0"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(e.title),1)]),_:1})):l.createCommentVNode("",!0),l.renderSlot(t.$slots,"default")]),_:3},8,["min-height","height","loading"]))}}),aC=l.defineComponent({__name:"ConfirmDialog",props:{title:{},text:{},width:{},loading:{type:Boolean}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=l.ref(!1),o=l.ref(!1);l.onUnmounted(()=>{r.value=!1});const a=e;async function c(){try{await a("onCancel")}catch(h){console.error(h)}r.value=!1}async function d(){o.value=!0;try{await a("onSave")}catch(h){console.error(h)}o.value=!1,r.value=!1}return(h,m)=>(l.openBlock(),l.createBlock(Qc.VDialog,{scrim:"rgb(0,0,0,100)",width:t.width},{activator:l.withCtx(({isActive:g,props:v})=>[l.renderSlot(h.$slots,"button",l.normalizeProps(l.guardReactiveProps({isActive:g,props:v})))]),default:l.withCtx(({isActive:g})=>[l.createVNode(Lt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(l.unref(aP),{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:c,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(Lt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(Lt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:c},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.cancel")),1)]),_:1}),l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.confirm")),1)]),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:3},8,["width"]))}}),Ld="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",sC=l.defineComponent({__name:"JAvatar",props:{src:{}},setup(n){const e=n,t=l.ref(e.src),r=l.computed(()=>t.value||Ld);function o(){t.value=Ld}return(a,c)=>(l.openBlock(),l.createBlock(by.VAvatar,{size:"50"},{default:l.withCtx(()=>[l.createVNode(df.VImg,{src:r.value,"lazy-src":Ld,onError:o,width:"50",alt:"profile-placeholder"},null,8,["src"])]),_:1}))}}),xd="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",cC=l.defineComponent({__name:"AvatarPicture",props:{img:{},size:{}},setup(n){const e=n,t=l.ref(e.img),r=l.computed(()=>t.value||xd);function o(){t.value=xd}return(a,c)=>(l.openBlock(),l.createBlock(by.VAvatar,{size:a.size},{default:l.withCtx(()=>[l.createVNode(df.VImg,{src:r.value,"lazy-src":xd,onError:o,width:"40",alt:"Avatar"},null,8,["src"])]),_:1},8,["size"]))}}),mP=l.defineComponent({__name:"ContextMenu",setup(n){const e=l.ref(!1),t=l.ref({x:0,y:0}),r=a=>{a.preventDefault(),t.value={x:a.clientX,y:a.clientY},e.value=!0},o=()=>{e.value=!1};return l.onMounted(()=>{document.addEventListener("click",o)}),l.onUnmounted(()=>{document.removeEventListener("click",o)}),(a,c)=>(l.openBlock(),l.createElementBlock("div",{onContextmenu:l.withModifiers(r,["right"]),class:"relative w-full h-full"},[l.renderSlot(a.$slots,"default",{},void 0,!0),l.createVNode(hf.VMenu,{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=d=>e.value=d),style:l.normalizeStyle({top:`${t.value.y}px`,left:`${t.value.x}px`,position:"absolute"})},{default:l.withCtx(()=>[l.createVNode(Jt.VList,null,{default:l.withCtx(()=>[l.renderSlot(a.$slots,"actions",{},void 0,!0)]),_:3})]),_:3},8,["modelValue","style"])],32))}}),ba=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},lC=ba(mP,[["__scopeId","data-v-a53b15af"]]),gP={class:"d-inline-flex"},uC=l.defineComponent({__name:"UiTable",props:l.mergeModels({headers:{},items:{default:()=>[]},actions:{},loading:{type:Boolean},columns:{default:()=>[]},sortBy:{}},{selection:{},selectionModifiers:{}}),emits:["update:selection"],setup(n){const e=n,t=l.computed(()=>{var o;if(e.headers)return e.headers;if(e.columns)return(o=e.columns)==null?void 0:o.filter(a=>a.checked)}),r=l.useModel(n,"selection");return(o,a)=>(l.openBlock(),l.createBlock(Iy.VDataTable,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=c=>r.value=c),"fixed-header":"","fixed-footer":"","items-per-page":"10",headers:t.value,items:o.items,"items-length":o.items.length,loading:o.loading||!1,"item-value":"_id","return-object":"","show-select":"","sort-by":o.sortBy,height:"calc(100vh - 320px)",class:"customize-table"},{top:l.withCtx(()=>a[1]||(a[1]=[l.createElementVNode("span",{class:"mt-5"},null,-1)])),"item.avatar":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"avatar",{item:c})]),"item.active":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"active",{item:c})]),"item.image":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"image",{item:c})]),"item.picture":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"picture",{item:c})]),"item.icon":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"icon",{item:c})]),"item.actions":l.withCtx(({item:c})=>[l.createElementVNode("div",gP,[l.renderSlot(o.$slots,"actions",{item:c})])]),"no-data":l.withCtx(()=>[!o.loading&&o.items.length===0?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" This table is empty.")],64)):l.createCommentVNode("",!0)]),_:3},8,["modelValue","headers","items","items-length","loading","sort-by"]))}}),dC=6048e5,pP=864e5,__=Symbol.for("constructDateFrom");function Ho(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&__ in n?n[__](e):n instanceof Date?new n.constructor(e):new Date(e)}function wr(n,e){return Ho(e||n,n)}let _P={};function $l(){return _P}function Es(n,e){var d,h,m,g;const t=$l(),r=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,o=wr(n,e==null?void 0:e.in),a=o.getDay(),c=(a<r?7:0)+a-r;return o.setDate(o.getDate()-c),o.setHours(0,0,0,0),o}function pl(n,e){return Es(n,{...e,weekStartsOn:1})}function hC(n,e){const t=wr(n,e==null?void 0:e.in),r=t.getFullYear(),o=Ho(t,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=pl(o),c=Ho(t,0);c.setFullYear(r,0,4),c.setHours(0,0,0,0);const d=pl(c);return t.getTime()>=a.getTime()?r+1:t.getTime()>=d.getTime()?r:r-1}function v_(n){const e=wr(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function vP(n,...e){const t=Ho.bind(null,e.find(r=>typeof r=="object"));return e.map(t)}function y_(n,e){const t=wr(n,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function yP(n,e,t){const[r,o]=vP(t==null?void 0:t.in,n,e),a=y_(r),c=y_(o),d=+a-v_(a),h=+c-v_(c);return Math.round((d-h)/pP)}function CP(n,e){const t=hC(n,e),r=Ho(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),pl(r)}function EP(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function wP(n){return!(!EP(n)&&typeof n!="number"||isNaN(+wr(n)))}function TP(n,e){const t=wr(n,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const bP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IP=(n,e,t)=>{let r;const o=bP[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function rr(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const SP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},AP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},NP={date:rr({formats:SP,defaultWidth:"full"}),time:rr({formats:AP,defaultWidth:"full"}),dateTime:rr({formats:kP,defaultWidth:"full"})},RP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},OP=(n,e,t,r)=>RP[n];function wt(n){return(e,t)=>{const r=t!=null&&t.context?String(t.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const c=n.defaultFormattingWidth||n.defaultWidth,d=t!=null&&t.width?String(t.width):c;o=n.formattingValues[d]||n.formattingValues[c]}else{const c=n.defaultWidth,d=t!=null&&t.width?String(t.width):n.defaultWidth;o=n.values[d]||n.values[c]}const a=n.argumentCallback?n.argumentCallback(e):e;return o[a]}}const PP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},LP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},UP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},FP=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},BP={ordinalNumber:FP,era:wt({values:PP,defaultWidth:"wide"}),quarter:wt({values:MP,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:DP,defaultWidth:"wide"}),day:wt({values:LP,defaultWidth:"wide"}),dayPeriod:wt({values:xP,defaultWidth:"wide",formattingValues:UP,defaultFormattingWidth:"wide"})};function Tt(n){return(e,t={})=>{const r=t.width,o=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],a=e.match(o);if(!a)return null;const c=a[0],d=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],h=Array.isArray(d)?HP(d,v=>v.test(c)):VP(d,v=>v.test(c));let m;m=n.valueCallback?n.valueCallback(h):h,m=t.valueCallback?t.valueCallback(m):m;const g=e.slice(c.length);return{value:m,rest:g}}}function VP(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function HP(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function Kl(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const o=r[0],a=e.match(n.parsePattern);if(!a)return null;let c=n.valueCallback?n.valueCallback(a[0]):a[0];c=t.valueCallback?t.valueCallback(c):c;const d=e.slice(o.length);return{value:c,rest:d}}}const $P=/^(\d+)(th|st|nd|rd)?/i,KP=/\d+/i,WP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},zP={any:[/^b/i,/^(a|c)/i]},GP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qP={any:[/1/i,/2/i,/3/i,/4/i]},jP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},YP={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},JP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},QP={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},XP={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ZP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},e1={ordinalNumber:Kl({matchPattern:$P,parsePattern:KP,valueCallback:n=>parseInt(n,10)}),era:Tt({matchPatterns:WP,defaultMatchWidth:"wide",parsePatterns:zP,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:GP,defaultMatchWidth:"wide",parsePatterns:qP,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:jP,defaultMatchWidth:"wide",parsePatterns:YP,defaultParseWidth:"any"}),day:Tt({matchPatterns:JP,defaultMatchWidth:"wide",parsePatterns:QP,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:XP,defaultMatchWidth:"any",parsePatterns:ZP,defaultParseWidth:"any"})},vf={code:"en-US",formatDistance:IP,formatLong:NP,formatRelative:OP,localize:BP,match:e1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function t1(n,e){const t=wr(n,e==null?void 0:e.in);return yP(t,TP(t))+1}function n1(n,e){const t=wr(n,e==null?void 0:e.in),r=+pl(t)-+CP(t);return Math.round(r/dC)+1}function fC(n,e){var g,v,p,w;const t=wr(n,e==null?void 0:e.in),r=t.getFullYear(),o=$l(),a=(e==null?void 0:e.firstWeekContainsDate)??((v=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??o.firstWeekContainsDate??((w=(p=o.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=Ho((e==null?void 0:e.in)||n,0);c.setFullYear(r+1,0,a),c.setHours(0,0,0,0);const d=Es(c,e),h=Ho((e==null?void 0:e.in)||n,0);h.setFullYear(r,0,a),h.setHours(0,0,0,0);const m=Es(h,e);return+t>=+d?r+1:+t>=+m?r:r-1}function r1(n,e){var d,h,m,g;const t=$l(),r=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??t.firstWeekContainsDate??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=fC(n,e),a=Ho((e==null?void 0:e.in)||n,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Es(a,e)}function o1(n,e){const t=wr(n,e==null?void 0:e.in),r=+Es(t,e)-+r1(t,e);return Math.round(r/dC)+1}function Ke(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const No={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return Ke(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):Ke(t+1,2)},d(n,e){return Ke(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return Ke(n.getHours()%12||12,e.length)},H(n,e){return Ke(n.getHours(),e.length)},m(n,e){return Ke(n.getMinutes(),e.length)},s(n,e){return Ke(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),o=Math.trunc(r*Math.pow(10,t-3));return Ke(o,e.length)}},zi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},C_={G:function(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const r=n.getFullYear(),o=r>0?r:1-r;return t.ordinalNumber(o,{unit:"year"})}return No.y(n,e)},Y:function(n,e,t,r){const o=fC(n,r),a=o>0?o:1-o;if(e==="YY"){const c=a%100;return Ke(c,2)}return e==="Yo"?t.ordinalNumber(a,{unit:"year"}):Ke(a,e.length)},R:function(n,e){const t=hC(n);return Ke(t,e.length)},u:function(n,e){const t=n.getFullYear();return Ke(t,e.length)},Q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Ke(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Ke(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return No.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return Ke(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(n,e,t,r){const o=o1(n,r);return e==="wo"?t.ordinalNumber(o,{unit:"week"}):Ke(o,e.length)},I:function(n,e,t){const r=n1(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):Ke(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):No.d(n,e)},D:function(n,e,t){const r=t1(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):Ke(r,e.length)},E:function(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return Ke(a,2);case"eo":return t.ordinalNumber(a,{unit:"day"});case"eee":return t.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(o,{width:"short",context:"formatting"});case"eeee":default:return t.day(o,{width:"wide",context:"formatting"})}},c:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return Ke(a,e.length);case"co":return t.ordinalNumber(a,{unit:"day"});case"ccc":return t.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(o,{width:"narrow",context:"standalone"});case"cccccc":return t.day(o,{width:"short",context:"standalone"});case"cccc":default:return t.day(o,{width:"wide",context:"standalone"})}},i:function(n,e,t){const r=n.getDay(),o=r===0?7:r;switch(e){case"i":return String(o);case"ii":return Ke(o,e.length);case"io":return t.ordinalNumber(o,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(n,e,t){const o=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,e,t){const r=n.getHours();let o;switch(r===12?o=zi.noon:r===0?o=zi.midnight:o=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,e,t){const r=n.getHours();let o;switch(r>=17?o=zi.evening:r>=12?o=zi.afternoon:r>=4?o=zi.morning:o=zi.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return No.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):No.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):Ke(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):Ke(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):No.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):No.s(n,e)},S:function(n,e){return No.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return w_(r);case"XXXX":case"XX":return ci(r);case"XXXXX":case"XXX":default:return ci(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return w_(r);case"xxxx":case"xx":return ci(r);case"xxxxx":case"xxx":default:return ci(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+E_(r,":");case"OOOO":default:return"GMT"+ci(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+E_(r,":");case"zzzz":default:return"GMT"+ci(r,":")}},t:function(n,e,t){const r=Math.trunc(+n/1e3);return Ke(r,e.length)},T:function(n,e,t){return Ke(+n,e.length)}};function E_(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=Math.trunc(r/60),a=r%60;return a===0?t+String(o):t+String(o)+e+Ke(a,2)}function w_(n,e){return n%60===0?(n>0?"-":"+")+Ke(Math.abs(n)/60,2):ci(n,e)}function ci(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=Ke(Math.trunc(r/60),2),a=Ke(r%60,2);return t+o+e+a}const T_=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},mC=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},i1=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],o=t[2];if(!o)return T_(n,e);let a;switch(r){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",T_(r,e)).replace("{{time}}",mC(o,e))},a1={p:mC,P:i1},s1=/^D+$/,c1=/^Y+$/,l1=["D","DD","YY","YYYY"];function u1(n){return s1.test(n)}function d1(n){return c1.test(n)}function h1(n,e,t){const r=f1(n,e,t);if(console.warn(r),l1.includes(n))throw new RangeError(r)}function f1(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const m1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,g1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p1=/^'([^]*?)'?$/,_1=/''/g,v1=/[a-zA-Z]/;function y1(n,e,t){var g,v,p,w,C,T,k,I;const r=$l(),o=(t==null?void 0:t.locale)??r.locale??vf,a=(t==null?void 0:t.firstWeekContainsDate)??((v=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((w=(p=r.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=(t==null?void 0:t.weekStartsOn)??((T=(C=t==null?void 0:t.locale)==null?void 0:C.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((I=(k=r.locale)==null?void 0:k.options)==null?void 0:I.weekStartsOn)??0,d=wr(n,t==null?void 0:t.in);if(!wP(d))throw new RangeError("Invalid time value");let h=e.match(g1).map(N=>{const O=N[0];if(O==="p"||O==="P"){const L=a1[O];return L(N,o.formatLong)}return N}).join("").match(m1).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const O=N[0];if(O==="'")return{isToken:!1,value:C1(N)};if(C_[O])return{isToken:!0,value:N};if(O.match(v1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:N}});o.localize.preprocessor&&(h=o.localize.preprocessor(d,h));const m={firstWeekContainsDate:a,weekStartsOn:c,locale:o};return h.map(N=>{if(!N.isToken)return N.value;const O=N.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&d1(O)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&u1(O))&&h1(O,e,String(n));const L=C_[O[0]];return L(d,O,o.localize,m)}).join("")}function C1(n){const e=n.match(p1);return e?e[1].replace(_1,"'"):n}const b_={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},E1=(n,e,t)=>{let r;const o=t!=null&&t.addSuffix?b_[n].withPreposition:b_[n].standalone;return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:"vor "+r:r},w1={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},T1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},b1={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},I1={date:rr({formats:w1,defaultWidth:"full"}),time:rr({formats:T1,defaultWidth:"full"}),dateTime:rr({formats:b1,defaultWidth:"full"})},S1={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},A1=(n,e,t,r)=>S1[n],k1={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},N1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},Ch={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},R1={narrow:Ch.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:Ch.wide},O1={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},P1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},M1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},D1=n=>Number(n)+".",L1={ordinalNumber:D1,era:wt({values:k1,defaultWidth:"wide"}),quarter:wt({values:N1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:Ch,formattingValues:R1,defaultWidth:"wide"}),day:wt({values:O1,defaultWidth:"wide"}),dayPeriod:wt({values:P1,defaultWidth:"wide",formattingValues:M1,defaultFormattingWidth:"wide"})},x1=/^(\d+)(\.)?/i,U1=/\d+/i,F1={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},B1={any:[/^v/i,/^n/i]},V1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},H1={any:[/1/i,/2/i,/3/i,/4/i]},$1={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},K1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},W1={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},z1={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},G1={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},q1={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},j1={ordinalNumber:Kl({matchPattern:x1,parsePattern:U1,valueCallback:n=>parseInt(n)}),era:Tt({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:B1,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:V1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:$1,defaultMatchWidth:"wide",parsePatterns:K1,defaultParseWidth:"any"}),day:Tt({matchPatterns:W1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:q1,defaultParseWidth:"any"})},Y1={code:"de",formatDistance:E1,formatLong:I1,formatRelative:A1,localize:L1,match:j1,options:{weekStartsOn:1,firstWeekContainsDate:4}},J1={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},Q1=(n,e,t)=>{let r;const o=J1[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"dans "+r:"il y a "+r:r},X1={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Z1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},eM={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tM={date:rr({formats:X1,defaultWidth:"full"}),time:rr({formats:Z1,defaultWidth:"full"}),dateTime:rr({formats:eM,defaultWidth:"full"})},nM={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},rM=(n,e,t,r)=>nM[n],oM={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},iM={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},aM={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},sM={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},cM={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},lM=(n,e)=>{const t=Number(n),r=e==null?void 0:e.unit;if(t===0)return"0";const o=["year","week","hour","minute","second"];let a;return t===1?a=r&&o.includes(r)?"ère":"er":a="ème",t+a},uM=["MMM","MMMM"],dM={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&uM.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:lM,era:wt({values:oM,defaultWidth:"wide"}),quarter:wt({values:iM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:aM,defaultWidth:"wide"}),day:wt({values:sM,defaultWidth:"wide"}),dayPeriod:wt({values:cM,defaultWidth:"wide"})},hM=/^(\d+)(ième|ère|ème|er|e)?/i,fM=/\d+/i,mM={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},gM={any:[/^av/i,/^ap/i]},pM={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},_M={any:[/1/i,/2/i,/3/i,/4/i]},vM={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},yM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},CM={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},EM={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},wM={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},TM={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},bM={ordinalNumber:Kl({matchPattern:hM,parsePattern:fM,valueCallback:n=>parseInt(n)}),era:Tt({matchPatterns:mM,defaultMatchWidth:"wide",parsePatterns:gM,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:pM,defaultMatchWidth:"wide",parsePatterns:_M,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:vM,defaultMatchWidth:"wide",parsePatterns:yM,defaultParseWidth:"any"}),day:Tt({matchPatterns:CM,defaultMatchWidth:"wide",parsePatterns:EM,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:wM,defaultMatchWidth:"any",parsePatterns:TM,defaultParseWidth:"any"})},IM={code:"fr",formatDistance:Q1,formatLong:tM,formatRelative:rM,localize:dM,match:bM,options:{weekStartsOn:1,firstWeekContainsDate:4}},SM={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},AM=(n,e,t)=>{let r;const o=SM[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"em "+r:"há "+r:r},kM={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},NM={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},RM={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},OM={date:rr({formats:kM,defaultWidth:"full"}),time:rr({formats:NM,defaultWidth:"full"}),dateTime:rr({formats:RM,defaultWidth:"full"})},PM={lastWeek:n=>{const e=n.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},MM=(n,e,t,r)=>{const o=PM[n];return typeof o=="function"?o(e):o},DM={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},LM={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},xM={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},UM={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},FM={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},BM={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},VM=(n,e)=>{const t=Number(n);return(e==null?void 0:e.unit)==="week"?t+"ª":t+"º"},HM={ordinalNumber:VM,era:wt({values:DM,defaultWidth:"wide"}),quarter:wt({values:LM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:xM,defaultWidth:"wide"}),day:wt({values:UM,defaultWidth:"wide"}),dayPeriod:wt({values:FM,defaultWidth:"wide",formattingValues:BM,defaultFormattingWidth:"wide"})},$M=/^(\d+)[ºªo]?/i,KM=/\d+/i,WM={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},zM={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},GM={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},qM={any:[/1/i,/2/i,/3/i,/4/i]},jM={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},YM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},JM={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},QM={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},XM={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},ZM={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},eD={ordinalNumber:Kl({matchPattern:$M,parsePattern:KM,valueCallback:n=>parseInt(n,10)}),era:Tt({matchPatterns:WM,defaultMatchWidth:"wide",parsePatterns:zM,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:GM,defaultMatchWidth:"wide",parsePatterns:qM,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:jM,defaultMatchWidth:"wide",parsePatterns:YM,defaultParseWidth:"any"}),day:Tt({matchPatterns:JM,defaultMatchWidth:"wide",parsePatterns:QM,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:XM,defaultMatchWidth:"any",parsePatterns:ZM,defaultParseWidth:"any"})},tD={code:"pt-BR",formatDistance:AM,formatLong:OM,formatRelative:MM,localize:HM,match:eD,options:{weekStartsOn:0,firstWeekContainsDate:1}};/*!
11
+ This will fail in production.`);c=ts,c._s.has(r)||(u_(r,o,c),process.env.NODE_ENV!=="production"&&(a._pinia=c));const m=c._s.get(r);if(process.env.NODE_ENV!=="production"&&d){const g="__hot:"+r,v=u_(g,Zn({},o),c,!0);d._hotUpdate(v),delete c.state.value[g],c._s.delete(g)}if(process.env.NODE_ENV!=="production"&&ui){const g=l.getCurrentInstance();if(g&&g.proxy&&!d){const v=g.proxy,p="_pStores"in v?v._pStores:v._pStores={};p[r]=m}}return m}return a.$id=r,a}const t0=e0({id:"customizer",state:()=>({Sidebar_drawer:!0,Customizer_drawer:!1,mini_sidebar:!1,setHorizontalLayout:!1,actTheme:"DarkJPLANTheme",fontTheme:"Roboto",inputBg:!1,boxed:!1}),getters:{},actions:{SET_SIDEBAR_DRAWER(){this.Sidebar_drawer=!this.Sidebar_drawer},SET_MINI_SIDEBAR(n){this.mini_sidebar=n},SET_CUSTOMIZER_DRAWER(n){this.Customizer_drawer=n},SET_LAYOUT(n){this.setHorizontalLayout=n},SET_THEME(n){this.actTheme=n},SET_FONT(n){this.fontTheme=n}}}),Wi=l.ref({}),Os=n=>{const e=l.computed(()=>n?Wi.value[n]||!1:Wi.value.default||!1),t=()=>{n?Wi.value[n]=!0:Wi.value.default=!0},r=()=>{n?Wi.value[n]=!1:Wi.value.default=!1};return l.onUnmounted(()=>{r()}),l.onMounted(()=>{r()}),{isDialogActive:e,openDialog:t,closeDialog:r}};var n0=Object.defineProperty,d_=Object.getOwnPropertySymbols,r0=Object.prototype.hasOwnProperty,o0=Object.prototype.propertyIsEnumerable,h_=(n,e,t)=>e in n?n0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Hy=(n,e)=>{for(var t in e||(e={}))r0.call(e,t)&&h_(n,t,e[t]);if(d_)for(var t of d_(e))o0.call(e,t)&&h_(n,t,e[t]);return n},Ul=n=>typeof n=="function",Fl=n=>typeof n=="string",$y=n=>Fl(n)&&n.trim().length>0,i0=n=>typeof n=="number",di=n=>typeof n>"u",ys=n=>typeof n=="object"&&n!==null,a0=n=>Vr(n,"tag")&&$y(n.tag),Ky=n=>window.TouchEvent&&n instanceof TouchEvent,Wy=n=>Vr(n,"component")&&zy(n.component),s0=n=>Ul(n)||ys(n),zy=n=>!di(n)&&(Fl(n)||s0(n)||Wy(n)),f_=n=>ys(n)&&["height","width","right","left","top","bottom"].every(e=>i0(n[e])),Vr=(n,e)=>(ys(n)||Ul(n))&&e in n,c0=(n=>()=>n++)(0);function Dd(n){return Ky(n)?n.targetTouches[0].clientX:n.clientX}function m_(n){return Ky(n)?n.targetTouches[0].clientY:n.clientY}var l0=n=>{di(n.remove)?n.parentNode&&n.parentNode.removeChild(n):n.remove()},Ps=n=>Wy(n)?Ps(n.component):a0(n)?l.defineComponent({render(){return n}}):typeof n=="string"?n:l.toRaw(l.unref(n)),u0=n=>{if(typeof n=="string")return n;const e=Vr(n,"props")&&ys(n.props)?n.props:{},t=Vr(n,"listeners")&&ys(n.listeners)?n.listeners:{};return{component:Ps(n),props:e,listeners:t}},d0=()=>typeof window<"u",Bl=class{constructor(){this.allHandlers={}}getHandlers(n){return this.allHandlers[n]||[]}on(n,e){const t=this.getHandlers(n);t.push(e),this.allHandlers[n]=t}off(n,e){const t=this.getHandlers(n);t.splice(t.indexOf(e)>>>0,1)}emit(n,e){this.getHandlers(n).forEach(r=>r(e))}},h0=n=>["on","off","emit"].every(e=>Vr(n,e)&&Ul(n[e]));exports.TYPE=void 0;(function(n){n.SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.INFO="info",n.DEFAULT="default"})(exports.TYPE||(exports.TYPE={}));exports.POSITION=void 0;(function(n){n.TOP_LEFT="top-left",n.TOP_CENTER="top-center",n.TOP_RIGHT="top-right",n.BOTTOM_LEFT="bottom-left",n.BOTTOM_CENTER="bottom-center",n.BOTTOM_RIGHT="bottom-right"})(exports.POSITION||(exports.POSITION={}));var Dn;(function(n){n.ADD="add",n.DISMISS="dismiss",n.UPDATE="update",n.CLEAR="clear",n.UPDATE_DEFAULTS="update_defaults"})(Dn||(Dn={}));var gr="Vue-Toastification",mr={type:{type:String,default:exports.TYPE.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},Gy={type:mr.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},nl={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:mr.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},yh={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},qy={transition:{type:[Object,String],default:`${gr}__bounce`}},f0={position:{type:String,default:exports.POSITION.TOP_RIGHT},draggable:mr.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:mr.trueBoolean,pauseOnHover:mr.trueBoolean,closeOnClick:mr.trueBoolean,timeout:yh.timeout,hideProgressBar:yh.hideProgressBar,toastClassName:mr.classNames,bodyClassName:mr.classNames,icon:Gy.customIcon,closeButton:nl.component,closeButtonClassName:nl.classNames,showCloseButtonOnHover:nl.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Bl}},m0={id:{type:[String,Number],required:!0,default:0},type:mr.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},g0={container:{type:[Object,Function],default:()=>document.body},newestOnTop:mr.trueBoolean,maxToasts:{type:Number,default:20},transition:qy.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:n=>n},filterToasts:{type:Function,default:n=>n},containerClassName:mr.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},lo={CORE_TOAST:f0,TOAST:m0,CONTAINER:g0,PROGRESS_BAR:yh,ICON:Gy,TRANSITION:qy,CLOSE_BUTTON:nl},jy=l.defineComponent({name:"VtProgressBar",props:lo.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${gr}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function p0(n,e){return l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(n.style),class:l.normalizeClass(n.cpClass)},null,6)}jy.render=p0;var _0=jy,Yy=l.defineComponent({name:"VtCloseButton",props:lo.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?Ps(this.component):"button"},classes(){const n=[`${gr}__close-button`];return this.showOnHover&&n.push("show-on-hover"),n.concat(this.classNames)}}}),v0=l.createTextVNode(" × ");function y0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.buttonComponent),l.mergeProps({"aria-label":n.ariaLabel,class:n.classes},n.$attrs),{default:l.withCtx(()=>[v0]),_:1},16,["aria-label","class"])}Yy.render=y0;var C0=Yy,Jy={},E0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},w0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),T0=[w0];function b0(n,e){return l.openBlock(),l.createElementBlock("svg",E0,T0)}Jy.render=b0;var I0=Jy,Qy={},S0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},A0=l.createElementVNode("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),k0=[A0];function N0(n,e){return l.openBlock(),l.createElementBlock("svg",S0,k0)}Qy.render=N0;var g_=Qy,Xy={},R0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},O0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),P0=[O0];function M0(n,e){return l.openBlock(),l.createElementBlock("svg",R0,P0)}Xy.render=M0;var D0=Xy,Zy={},L0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},x0=l.createElementVNode("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),U0=[x0];function F0(n,e){return l.openBlock(),l.createElementBlock("svg",L0,U0)}Zy.render=F0;var B0=Zy,eC=l.defineComponent({name:"VtIcon",props:lo.ICON,computed:{customIconChildren(){return Vr(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Fl(this.customIcon)?this.trimValue(this.customIcon):Vr(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return Vr(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:zy(this.customIcon)?Ps(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[exports.TYPE.DEFAULT]:g_,[exports.TYPE.INFO]:g_,[exports.TYPE.SUCCESS]:I0,[exports.TYPE.ERROR]:B0,[exports.TYPE.WARNING]:D0}[this.type]},iconClasses(){const n=[`${gr}__icon`];return this.hasCustomIcon?n.concat(this.customIconClass):n}},methods:{trimValue(n,e=""){return $y(n)?n.trim():e}}});function V0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.component),{class:l.normalizeClass(n.iconClasses)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.customIconChildren),1)]),_:1},8,["class"])}eC.render=V0;var H0=eC,tC=l.defineComponent({name:"VtToast",components:{ProgressBar:_0,CloseButton:C0,Icon:H0},inheritAttrs:!1,props:Object.assign({},lo.CORE_TOAST,lo.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const n=[`${gr}__toast`,`${gr}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&n.push("disable-transition"),this.rtl&&n.push(`${gr}__toast--rtl`),n},bodyClasses(){return[`${gr}__toast-${Fl(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return f_(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:Vr,getVueComponentFromObj:Ps,closeToast(){this.eventBus.emit(Dn.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const n=this.$el;n.addEventListener("touchstart",this.onDragStart,{passive:!0}),n.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const n=this.$el;n.removeEventListener("touchstart",this.onDragStart),n.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(n){this.beingDragged=!0,this.dragPos={x:Dd(n),y:m_(n)},this.dragStart=Dd(n),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(n){this.beingDragged&&(n.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Dd(n),y:m_(n)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,f_(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),$0=["role"];function K0(n,e){const t=l.resolveComponent("Icon"),r=l.resolveComponent("CloseButton"),o=l.resolveComponent("ProgressBar");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n.classes),style:l.normalizeStyle(n.draggableStyle),onClick:e[0]||(e[0]=(...a)=>n.clickHandler&&n.clickHandler(...a)),onMouseenter:e[1]||(e[1]=(...a)=>n.hoverPause&&n.hoverPause(...a)),onMouseleave:e[2]||(e[2]=(...a)=>n.hoverPlay&&n.hoverPlay(...a))},[n.icon?(l.openBlock(),l.createBlock(t,{key:0,"custom-icon":n.icon,type:n.type},null,8,["custom-icon","type"])):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{role:n.accessibility.toastRole||"alert",class:l.normalizeClass(n.bodyClasses)},[typeof n.content=="string"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(n.content),1)],2112)):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.getVueComponentFromObj(n.content)),l.mergeProps({key:1,"toast-id":n.id},n.hasProp(n.content,"props")?n.content.props:{},l.toHandlers(n.hasProp(n.content,"listeners")?n.content.listeners:{}),{onCloseToast:n.closeToast}),null,16,["toast-id","onCloseToast"]))],10,$0),n.closeButton?(l.openBlock(),l.createBlock(r,{key:1,component:n.closeButton,"class-names":n.closeButtonClassName,"show-on-hover":n.showCloseButtonOnHover,"aria-label":n.accessibility.closeButtonLabel,onClick:l.withModifiers(n.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):l.createCommentVNode("v-if",!0),n.timeout?(l.openBlock(),l.createBlock(o,{key:2,"is-running":n.isRunning,"hide-progress-bar":n.hideProgressBar,timeout:n.timeout,onCloseToast:n.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):l.createCommentVNode("v-if",!0)],38)}tC.render=K0;var W0=tC,nC=l.defineComponent({name:"VtTransition",props:lo.TRANSITION,emits:["leave"],methods:{hasProp:Vr,leave(n){n instanceof HTMLElement&&(n.style.left=n.offsetLeft+"px",n.style.top=n.offsetTop+"px",n.style.width=getComputedStyle(n).width,n.style.position="absolute")}}});function z0(n,e){return l.openBlock(),l.createBlock(l.TransitionGroup,{tag:"div","enter-active-class":n.transition.enter?n.transition.enter:`${n.transition}-enter-active`,"move-class":n.transition.move?n.transition.move:`${n.transition}-move`,"leave-active-class":n.transition.leave?n.transition.leave:`${n.transition}-leave-active`,onLeave:n.leave},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}nC.render=z0;var G0=nC,rC=l.defineComponent({name:"VueToastification",devtools:{hide:!0},components:{Toast:W0,VtTransition:G0},props:Object.assign({},lo.CORE_TOAST,lo.CONTAINER,lo.TRANSITION),data(){return{count:0,positions:Object.values(exports.POSITION),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const n=this.eventBus;n.on(Dn.ADD,this.addToast),n.on(Dn.CLEAR,this.clearToasts),n.on(Dn.DISMISS,this.dismissToast),n.on(Dn.UPDATE,this.updateToast),n.on(Dn.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(n){Ul(n)&&(n=await n()),l0(this.$el),n.appendChild(this.$el)},setToast(n){di(n.id)||(this.toasts[n.id]=n)},addToast(n){n.content=u0(n.content);const e=Object.assign({},this.defaults,n.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[n.type],n),t=this.defaults.filterBeforeCreate(e,this.toastArray);t&&this.setToast(t)},dismissToast(n){const e=this.toasts[n];!di(e)&&!di(e.onClose)&&e.onClose(),delete this.toasts[n]},clearToasts(){Object.keys(this.toasts).forEach(n=>{this.dismissToast(n)})},getPositionToasts(n){const e=this.filteredToasts.filter(t=>t.position===n).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?e.reverse():e},updateDefaults(n){di(n.container)||this.setup(n.container),this.defaults=Object.assign({},this.defaults,n)},updateToast({id:n,options:e,create:t}){this.toasts[n]?(e.timeout&&e.timeout===this.toasts[n].timeout&&e.timeout++,this.setToast(Object.assign({},this.toasts[n],e))):t&&this.addToast(Object.assign({},{id:n},e))},getClasses(n){return[`${gr}__container`,n].concat(this.defaults.containerClassName)}}});function q0(n,e){const t=l.resolveComponent("Toast"),r=l.resolveComponent("VtTransition");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.positions,o=>(l.openBlock(),l.createElementBlock("div",{key:o},[l.createVNode(r,{transition:n.defaults.transition,class:l.normalizeClass(n.getClasses(o))},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.getPositionToasts(o),a=>(l.openBlock(),l.createBlock(t,l.mergeProps({key:a.id},a),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}rC.render=q0;var j0=rC,p_=(n={},e=!0)=>{const t=n.eventBus=n.eventBus||new Bl;e&&l.nextTick(()=>{const a=l.createApp(j0,Hy({},n)),c=a.mount(document.createElement("div")),d=n.onMounted;if(di(d)||d(c,a),n.shareAppContext){const h=n.shareAppContext;h===!0?console.warn(`[${gr}] App to share context with was not provided.`):(a._context.components=h._context.components,a._context.directives=h._context.directives,a._context.mixins=h._context.mixins,a._context.provides=h._context.provides,a.config.globalProperties=h.config.globalProperties)}});const r=(a,c)=>{const d=Object.assign({},{id:c0(),type:exports.TYPE.DEFAULT},c,{content:a});return t.emit(Dn.ADD,d),d.id};r.clear=()=>t.emit(Dn.CLEAR,void 0),r.updateDefaults=a=>{t.emit(Dn.UPDATE_DEFAULTS,a)},r.dismiss=a=>{t.emit(Dn.DISMISS,a)};function o(a,{content:c,options:d},h=!1){const m=Object.assign({},d,{content:c});t.emit(Dn.UPDATE,{id:a,options:m,create:h})}return r.update=o,r.success=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.SUCCESS})),r.info=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.INFO})),r.error=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.ERROR})),r.warning=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.WARNING})),r},Y0=()=>{const n=()=>console.warn(`[${gr}] This plugin does not support SSR!`);return new Proxy(n,{get(){return n}})};function Cs(n){return d0()?h0(n)?p_({eventBus:n},!1):p_(n,!0):Y0()}var Vl=Symbol("VueToastification"),pf=new Bl,J0=(n,e)=>{(e==null?void 0:e.shareAppContext)===!0&&(e.shareAppContext=n);const t=Cs(Hy({eventBus:pf},e));n.provide(Vl,t)},Q0=n=>{const e=Cs(n);l.getCurrentInstance()&&l.provide(Vl,e)},Er=n=>{if(n)return Cs(n);const e=l.getCurrentInstance()?l.inject(Vl,void 0):void 0;return e||Cs(pf)},X0=J0;const _e=l.ref(!1),Z0={class:"d-flex align-center"},eP={key:1},tP={class:"ms-auto"},Ms=l.defineComponent({__name:"JDialog",props:{ddId:{},variant:{default:"global"},title:{},text:{},width:{default:"500"},reference:{type:Boolean},buttons:{type:Boolean,default:!0},scrim:{default:"background"}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=e,o=l.ref(!1),{isDialogActive:a,closeDialog:c}=Os(t.ddId);async function d(){try{await r("onCancel")}catch(m){console.error(m)}c()}async function h(){o.value=!0;try{await r("onSave")}catch(m){console.error(m)}o.value=!1,c()}return(m,g)=>{const v=l.resolveComponent("ExclamationCircleIcon");return l.openBlock(),l.createElementBlock(l.Fragment,null,[m.variant==="global"?(l.openBlock(),l.createBlock(Qc.VDialog,{key:0,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[0]||(g[0]=p=>l.isRef(a)?a.value=p:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(Lt.VCard,{rounded:"",loading:o.value},{default:l.withCtx(()=>[l.createVNode(Lt.VCardTitle,{class:"mt-2 px-5 d-flex"},{default:l.withCtx(()=>[l.createElementVNode("div",Z0,[m.$slots.title?l.renderSlot(m.$slots,"title",{key:0}):(l.openBlock(),l.createElementBlock("div",eP,l.toDisplayString(t.title),1))]),l.createElementVNode("div",tP,[l.renderSlot(m.$slots,"heading-actions"),l.createVNode(ot.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})])]),_:3}),l.createVNode(gi.VDivider,{class:"mx-5"}),l.createVNode(Lt.VCardText,{class:"overflow-y-scroll"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3}),m.$slots.footer?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(gi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(Lt.VCardActions,null,{default:l.withCtx(()=>[l.renderSlot(m.$slots,"footer")]),_:3})],64)):l.createCommentVNode("",!0),t.buttons?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(gi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(Lt.VCardActions,null,{default:l.withCtx(()=>[m.$slots.metadata?(l.openBlock(),l.createBlock(Je.VCol,{key:0,cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis ma-0 pa-0"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"metadata")]),_:3})):l.createCommentVNode("",!0),l.createVNode(Je.VSpacer),l.createVNode(ot.VBtn,{class:"j-btn-form",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.cancel")),1)]),_:1}),l.createVNode(ot.VBtn,{class:"j-btn-form",variant:"flat",color:"secondary",onClick:h,loading:o.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.save")),1)]),_:1},8,["loading"])]),_:3})],64)):l.createCommentVNode("",!0)]),_:3},8,["loading"])]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0),m.variant==="confirm"?(l.openBlock(),l.createBlock(Qc.VDialog,{key:1,scrim:"background",width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[1]||(g[1]=p=>l.isRef(a)?a.value=p:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(Lt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(v,{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(Lt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(Lt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.cancel")),1)]),_:1}),l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:h},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.confirm")),1)]),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:1},8,["width","modelValue"])):l.createCommentVNode("",!0),m.variant==="empty"?(l.openBlock(),l.createBlock(Qc.VDialog,{key:2,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[2]||(g[2]=p=>l.isRef(a)?a.value=p:null),"onClick:outside":d},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0)],64)}}}),_f=l.defineComponent({__name:"DeleteAllBtn",emits:["removeAll"],setup(n,{emit:e}){const{openDialog:t}=Os("delete-all-__J"),r=e;return(o,a)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Ms,{"dd-id":"delete-all-__J",variant:"confirm",title:"Confirm delete",text:"Are you sure you want to delete all selected items?","on-save":()=>r("removeAll")},null,8,["on-save"]),l.createVNode(ot.VBtn,{onClick:l.unref(t),variant:"plain",color:"secondary","prepend-icon":"mdi-delete"},{default:l.withCtx(()=>a[0]||(a[0]=[l.createTextVNode(" Delete")])),_:1},8,["onClick"])],64))}}),oC=l.defineComponent({__name:"EditButton",emits:["editAll"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(ot.VBtn,{onClick:o[0]||(o[0]=a=>t("editAll")),variant:"plain",color:"secondary","prepend-icon":"mdi-pencil"},{default:l.withCtx(()=>o[1]||(o[1]=[l.createTextVNode(" Edit")])),_:1}))}});var nP={name:"CircleOffIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-circle-off",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20.042 16.045a9 9 0 0 0 -12.087 -12.087m-2.318 1.677a9 9 0 1 0 12.725 12.73"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 3l18 18"},null),l.createTextVNode(" ")])}},rP={name:"DotsVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},oP={name:"DotsIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},iP={name:"EraserIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-eraser",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M18 13.3l-6.3 -6.3"},null),l.createTextVNode(" ")])}},aP={name:"ExclamationCircleIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-exclamation-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 9v4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 16v.01"},null),l.createTextVNode(" ")])}},sP={name:"FilterIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-filter",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null),l.createTextVNode(" ")])}},cP={name:"GripVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-grip-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},lP={name:"HierarchyIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-hierarchy",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M6.5 17.5l5.5 -4.5l5.5 4.5"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 7l0 6"},null),l.createTextVNode(" ")])}},uP={name:"LayoutSidebarRightCollapseIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-layout-sidebar-right-collapse",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 4v16"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 10l2 2l-2 2"},null),l.createTextVNode(" ")])}},dP={name:"RefreshIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-refresh",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null),l.createTextVNode(" ")])}},hP={name:"SearchIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-search",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M21 21l-6 -6"},null),l.createTextVNode(" ")])}},fP={name:"TableIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-table",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 10h18"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 3v18"},null),l.createTextVNode(" ")])}};const iC=l.defineComponent({__name:"DotsMenu",props:{variant:{default:"text"},color:{},orientation:{},size:{}},setup(n){return(e,t)=>(l.openBlock(),l.createBlock(l.unref(Bo.VMenu),{"close-on-content-click":!0},{activator:l.withCtx(({props:r})=>[l.createVNode(l.unref(Bo.VBtn),l.mergeProps({variant:e.variant},r,{icon:""}),{default:l.withCtx(()=>[e.orientation==="y"?(l.openBlock(),l.createBlock(l.unref(rP),{key:0,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"])):(l.openBlock(),l.createBlock(l.unref(oP),{key:1,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"]))]),_:2},1040,["variant"])]),default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3}))}}),Hl=l.defineComponent({__name:"ParentCard",props:{title:{},height:{default:"100%"},loading:{type:Boolean}},setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(Lt.VCard,{"min-height":t.height,height:t.height,loading:t.loading,class:"bg-surface rounded-sm pa-5"},{default:l.withCtx(()=>[e.title?(l.openBlock(),l.createBlock(Lt.VCardTitle,{key:0,class:"pa-0"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(e.title),1)]),_:1})):l.createCommentVNode("",!0),l.renderSlot(t.$slots,"default")]),_:3},8,["min-height","height","loading"]))}}),aC=l.defineComponent({__name:"ConfirmDialog",props:{title:{},text:{},width:{},loading:{type:Boolean}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=l.ref(!1),o=l.ref(!1);l.onUnmounted(()=>{r.value=!1});const a=e;async function c(){try{await a("onCancel")}catch(h){console.error(h)}r.value=!1}async function d(){o.value=!0;try{await a("onSave")}catch(h){console.error(h)}o.value=!1,r.value=!1}return(h,m)=>(l.openBlock(),l.createBlock(Qc.VDialog,{scrim:"rgb(0,0,0,100)",width:t.width},{activator:l.withCtx(({isActive:g,props:v})=>[l.renderSlot(h.$slots,"button",l.normalizeProps(l.guardReactiveProps({isActive:g,props:v})))]),default:l.withCtx(({isActive:g})=>[l.createVNode(Lt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(l.unref(aP),{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:c,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(Lt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(Lt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:c},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.cancel")),1)]),_:1}),l.createVNode(ot.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.confirm")),1)]),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:3},8,["width"]))}}),Ld="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",sC=l.defineComponent({__name:"JAvatar",props:{src:{}},setup(n){const e=n,t=l.ref(e.src),r=l.computed(()=>t.value||Ld);function o(){t.value=Ld}return(a,c)=>(l.openBlock(),l.createBlock(by.VAvatar,{size:"50"},{default:l.withCtx(()=>[l.createVNode(df.VImg,{src:r.value,"lazy-src":Ld,onError:o,width:"50",alt:"profile-placeholder"},null,8,["src"])]),_:1}))}}),xd="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",cC=l.defineComponent({__name:"AvatarPicture",props:{img:{},size:{}},setup(n){const e=n,t=l.ref(e.img),r=l.computed(()=>t.value||xd);function o(){t.value=xd}return(a,c)=>(l.openBlock(),l.createBlock(by.VAvatar,{size:a.size},{default:l.withCtx(()=>[l.createVNode(df.VImg,{src:r.value,"lazy-src":xd,onError:o,width:"40",alt:"Avatar"},null,8,["src"])]),_:1},8,["size"]))}}),mP=l.defineComponent({__name:"ContextMenu",setup(n){const e=l.ref(!1),t=l.ref({x:0,y:0}),r=a=>{a.preventDefault(),t.value={x:a.clientX,y:a.clientY},e.value=!0},o=()=>{e.value=!1};return l.onMounted(()=>{document.addEventListener("click",o)}),l.onUnmounted(()=>{document.removeEventListener("click",o)}),(a,c)=>(l.openBlock(),l.createElementBlock("div",{onContextmenu:l.withModifiers(r,["right"]),class:"relative w-full h-full"},[l.renderSlot(a.$slots,"default",{},void 0,!0),l.createVNode(hf.VMenu,{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=d=>e.value=d),style:l.normalizeStyle({top:`${t.value.y}px`,left:`${t.value.x}px`,position:"absolute"})},{default:l.withCtx(()=>[l.createVNode(Jt.VList,null,{default:l.withCtx(()=>[l.renderSlot(a.$slots,"actions",{},void 0,!0)]),_:3})]),_:3},8,["modelValue","style"])],32))}}),ba=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},lC=ba(mP,[["__scopeId","data-v-a53b15af"]]),gP={class:"d-inline-flex"},uC=l.defineComponent({__name:"UiTable",props:l.mergeModels({headers:{},items:{default:()=>[]},actions:{},loading:{type:Boolean},columns:{default:()=>[]},sortBy:{}},{selection:{},selectionModifiers:{}}),emits:["update:selection"],setup(n){const e=n,t=l.computed(()=>{var o;if(e.headers)return e.headers;if(e.columns)return(o=e.columns)==null?void 0:o.filter(a=>a.checked)}),r=l.useModel(n,"selection");return(o,a)=>(l.openBlock(),l.createBlock(Iy.VDataTable,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=c=>r.value=c),"fixed-header":"","fixed-footer":"","items-per-page":"10",headers:t.value,items:o.items,"items-length":o.items.length,loading:o.loading||!1,"item-value":"_id","return-object":"","show-select":"","sort-by":o.sortBy,height:"calc(100vh - 320px)",class:"customize-table"},{top:l.withCtx(()=>a[1]||(a[1]=[l.createElementVNode("span",{class:"mt-5"},null,-1)])),"item.avatar":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"avatar",{item:c})]),"item.active":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"active",{item:c})]),"item.image":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"image",{item:c})]),"item.picture":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"picture",{item:c})]),"item.icon":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"icon",{item:c})]),"item.actions":l.withCtx(({item:c})=>[l.createElementVNode("div",gP,[l.renderSlot(o.$slots,"actions",{item:c})])]),"no-data":l.withCtx(()=>[!o.loading&&o.items.length===0?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" This table is empty.")],64)):l.createCommentVNode("",!0)]),_:3},8,["modelValue","headers","items","items-length","loading","sort-by"]))}}),dC=6048e5,pP=864e5,__=Symbol.for("constructDateFrom");function Ho(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&__ in n?n[__](e):n instanceof Date?new n.constructor(e):new Date(e)}function wr(n,e){return Ho(e||n,n)}let _P={};function $l(){return _P}function Es(n,e){var d,h,m,g;const t=$l(),r=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,o=wr(n,e==null?void 0:e.in),a=o.getDay(),c=(a<r?7:0)+a-r;return o.setDate(o.getDate()-c),o.setHours(0,0,0,0),o}function pl(n,e){return Es(n,{...e,weekStartsOn:1})}function hC(n,e){const t=wr(n,e==null?void 0:e.in),r=t.getFullYear(),o=Ho(t,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=pl(o),c=Ho(t,0);c.setFullYear(r,0,4),c.setHours(0,0,0,0);const d=pl(c);return t.getTime()>=a.getTime()?r+1:t.getTime()>=d.getTime()?r:r-1}function v_(n){const e=wr(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function vP(n,...e){const t=Ho.bind(null,e.find(r=>typeof r=="object"));return e.map(t)}function y_(n,e){const t=wr(n,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function yP(n,e,t){const[r,o]=vP(t==null?void 0:t.in,n,e),a=y_(r),c=y_(o),d=+a-v_(a),h=+c-v_(c);return Math.round((d-h)/pP)}function CP(n,e){const t=hC(n,e),r=Ho(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),pl(r)}function EP(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function wP(n){return!(!EP(n)&&typeof n!="number"||isNaN(+wr(n)))}function TP(n,e){const t=wr(n,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const bP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IP=(n,e,t)=>{let r;const o=bP[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function rr(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const SP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},AP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},NP={date:rr({formats:SP,defaultWidth:"full"}),time:rr({formats:AP,defaultWidth:"full"}),dateTime:rr({formats:kP,defaultWidth:"full"})},RP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},OP=(n,e,t,r)=>RP[n];function wt(n){return(e,t)=>{const r=t!=null&&t.context?String(t.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const c=n.defaultFormattingWidth||n.defaultWidth,d=t!=null&&t.width?String(t.width):c;o=n.formattingValues[d]||n.formattingValues[c]}else{const c=n.defaultWidth,d=t!=null&&t.width?String(t.width):n.defaultWidth;o=n.values[d]||n.values[c]}const a=n.argumentCallback?n.argumentCallback(e):e;return o[a]}}const PP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},LP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},UP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},FP=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},BP={ordinalNumber:FP,era:wt({values:PP,defaultWidth:"wide"}),quarter:wt({values:MP,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:DP,defaultWidth:"wide"}),day:wt({values:LP,defaultWidth:"wide"}),dayPeriod:wt({values:xP,defaultWidth:"wide",formattingValues:UP,defaultFormattingWidth:"wide"})};function Tt(n){return(e,t={})=>{const r=t.width,o=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],a=e.match(o);if(!a)return null;const c=a[0],d=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],h=Array.isArray(d)?HP(d,v=>v.test(c)):VP(d,v=>v.test(c));let m;m=n.valueCallback?n.valueCallback(h):h,m=t.valueCallback?t.valueCallback(m):m;const g=e.slice(c.length);return{value:m,rest:g}}}function VP(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function HP(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function Kl(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const o=r[0],a=e.match(n.parsePattern);if(!a)return null;let c=n.valueCallback?n.valueCallback(a[0]):a[0];c=t.valueCallback?t.valueCallback(c):c;const d=e.slice(o.length);return{value:c,rest:d}}}const $P=/^(\d+)(th|st|nd|rd)?/i,KP=/\d+/i,WP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},zP={any:[/^b/i,/^(a|c)/i]},GP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qP={any:[/1/i,/2/i,/3/i,/4/i]},jP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},YP={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},JP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},QP={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},XP={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ZP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},e1={ordinalNumber:Kl({matchPattern:$P,parsePattern:KP,valueCallback:n=>parseInt(n,10)}),era:Tt({matchPatterns:WP,defaultMatchWidth:"wide",parsePatterns:zP,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:GP,defaultMatchWidth:"wide",parsePatterns:qP,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:jP,defaultMatchWidth:"wide",parsePatterns:YP,defaultParseWidth:"any"}),day:Tt({matchPatterns:JP,defaultMatchWidth:"wide",parsePatterns:QP,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:XP,defaultMatchWidth:"any",parsePatterns:ZP,defaultParseWidth:"any"})},vf={code:"en-US",formatDistance:IP,formatLong:NP,formatRelative:OP,localize:BP,match:e1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function t1(n,e){const t=wr(n,e==null?void 0:e.in);return yP(t,TP(t))+1}function n1(n,e){const t=wr(n,e==null?void 0:e.in),r=+pl(t)-+CP(t);return Math.round(r/dC)+1}function fC(n,e){var g,v,p,w;const t=wr(n,e==null?void 0:e.in),r=t.getFullYear(),o=$l(),a=(e==null?void 0:e.firstWeekContainsDate)??((v=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??o.firstWeekContainsDate??((w=(p=o.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=Ho((e==null?void 0:e.in)||n,0);c.setFullYear(r+1,0,a),c.setHours(0,0,0,0);const d=Es(c,e),h=Ho((e==null?void 0:e.in)||n,0);h.setFullYear(r,0,a),h.setHours(0,0,0,0);const m=Es(h,e);return+t>=+d?r+1:+t>=+m?r:r-1}function r1(n,e){var d,h,m,g;const t=$l(),r=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??t.firstWeekContainsDate??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=fC(n,e),a=Ho((e==null?void 0:e.in)||n,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Es(a,e)}function o1(n,e){const t=wr(n,e==null?void 0:e.in),r=+Es(t,e)-+r1(t,e);return Math.round(r/dC)+1}function Ke(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const No={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return Ke(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):Ke(t+1,2)},d(n,e){return Ke(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return Ke(n.getHours()%12||12,e.length)},H(n,e){return Ke(n.getHours(),e.length)},m(n,e){return Ke(n.getMinutes(),e.length)},s(n,e){return Ke(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),o=Math.trunc(r*Math.pow(10,t-3));return Ke(o,e.length)}},zi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},C_={G:function(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const r=n.getFullYear(),o=r>0?r:1-r;return t.ordinalNumber(o,{unit:"year"})}return No.y(n,e)},Y:function(n,e,t,r){const o=fC(n,r),a=o>0?o:1-o;if(e==="YY"){const c=a%100;return Ke(c,2)}return e==="Yo"?t.ordinalNumber(a,{unit:"year"}):Ke(a,e.length)},R:function(n,e){const t=hC(n);return Ke(t,e.length)},u:function(n,e){const t=n.getFullYear();return Ke(t,e.length)},Q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Ke(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Ke(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return No.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return Ke(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(n,e,t,r){const o=o1(n,r);return e==="wo"?t.ordinalNumber(o,{unit:"week"}):Ke(o,e.length)},I:function(n,e,t){const r=n1(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):Ke(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):No.d(n,e)},D:function(n,e,t){const r=t1(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):Ke(r,e.length)},E:function(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return Ke(a,2);case"eo":return t.ordinalNumber(a,{unit:"day"});case"eee":return t.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(o,{width:"short",context:"formatting"});case"eeee":default:return t.day(o,{width:"wide",context:"formatting"})}},c:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return Ke(a,e.length);case"co":return t.ordinalNumber(a,{unit:"day"});case"ccc":return t.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(o,{width:"narrow",context:"standalone"});case"cccccc":return t.day(o,{width:"short",context:"standalone"});case"cccc":default:return t.day(o,{width:"wide",context:"standalone"})}},i:function(n,e,t){const r=n.getDay(),o=r===0?7:r;switch(e){case"i":return String(o);case"ii":return Ke(o,e.length);case"io":return t.ordinalNumber(o,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(n,e,t){const o=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,e,t){const r=n.getHours();let o;switch(r===12?o=zi.noon:r===0?o=zi.midnight:o=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,e,t){const r=n.getHours();let o;switch(r>=17?o=zi.evening:r>=12?o=zi.afternoon:r>=4?o=zi.morning:o=zi.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return No.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):No.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):Ke(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):Ke(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):No.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):No.s(n,e)},S:function(n,e){return No.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return w_(r);case"XXXX":case"XX":return ci(r);case"XXXXX":case"XXX":default:return ci(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return w_(r);case"xxxx":case"xx":return ci(r);case"xxxxx":case"xxx":default:return ci(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+E_(r,":");case"OOOO":default:return"GMT"+ci(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+E_(r,":");case"zzzz":default:return"GMT"+ci(r,":")}},t:function(n,e,t){const r=Math.trunc(+n/1e3);return Ke(r,e.length)},T:function(n,e,t){return Ke(+n,e.length)}};function E_(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=Math.trunc(r/60),a=r%60;return a===0?t+String(o):t+String(o)+e+Ke(a,2)}function w_(n,e){return n%60===0?(n>0?"-":"+")+Ke(Math.abs(n)/60,2):ci(n,e)}function ci(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=Ke(Math.trunc(r/60),2),a=Ke(r%60,2);return t+o+e+a}const T_=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},mC=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},i1=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],o=t[2];if(!o)return T_(n,e);let a;switch(r){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",T_(r,e)).replace("{{time}}",mC(o,e))},a1={p:mC,P:i1},s1=/^D+$/,c1=/^Y+$/,l1=["D","DD","YY","YYYY"];function u1(n){return s1.test(n)}function d1(n){return c1.test(n)}function h1(n,e,t){const r=f1(n,e,t);if(console.warn(r),l1.includes(n))throw new RangeError(r)}function f1(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const m1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,g1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p1=/^'([^]*?)'?$/,_1=/''/g,v1=/[a-zA-Z]/;function y1(n,e,t){var g,v,p,w,C,T,k,I;const r=$l(),o=(t==null?void 0:t.locale)??r.locale??vf,a=(t==null?void 0:t.firstWeekContainsDate)??((v=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((w=(p=r.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=(t==null?void 0:t.weekStartsOn)??((T=(C=t==null?void 0:t.locale)==null?void 0:C.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((I=(k=r.locale)==null?void 0:k.options)==null?void 0:I.weekStartsOn)??0,d=wr(n,t==null?void 0:t.in);if(!wP(d))throw new RangeError("Invalid time value");let h=e.match(g1).map(N=>{const O=N[0];if(O==="p"||O==="P"){const L=a1[O];return L(N,o.formatLong)}return N}).join("").match(m1).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const O=N[0];if(O==="'")return{isToken:!1,value:C1(N)};if(C_[O])return{isToken:!0,value:N};if(O.match(v1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:N}});o.localize.preprocessor&&(h=o.localize.preprocessor(d,h));const m={firstWeekContainsDate:a,weekStartsOn:c,locale:o};return h.map(N=>{if(!N.isToken)return N.value;const O=N.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&d1(O)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&u1(O))&&h1(O,e,String(n));const L=C_[O[0]];return L(d,O,o.localize,m)}).join("")}function C1(n){const e=n.match(p1);return e?e[1].replace(_1,"'"):n}const b_={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},E1=(n,e,t)=>{let r;const o=t!=null&&t.addSuffix?b_[n].withPreposition:b_[n].standalone;return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:"vor "+r:r},w1={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},T1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},b1={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},I1={date:rr({formats:w1,defaultWidth:"full"}),time:rr({formats:T1,defaultWidth:"full"}),dateTime:rr({formats:b1,defaultWidth:"full"})},S1={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},A1=(n,e,t,r)=>S1[n],k1={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},N1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},Ch={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},R1={narrow:Ch.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:Ch.wide},O1={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},P1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},M1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},D1=n=>Number(n)+".",L1={ordinalNumber:D1,era:wt({values:k1,defaultWidth:"wide"}),quarter:wt({values:N1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:Ch,formattingValues:R1,defaultWidth:"wide"}),day:wt({values:O1,defaultWidth:"wide"}),dayPeriod:wt({values:P1,defaultWidth:"wide",formattingValues:M1,defaultFormattingWidth:"wide"})},x1=/^(\d+)(\.)?/i,U1=/\d+/i,F1={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},B1={any:[/^v/i,/^n/i]},V1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},H1={any:[/1/i,/2/i,/3/i,/4/i]},$1={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},K1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},W1={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},z1={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},G1={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},q1={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},j1={ordinalNumber:Kl({matchPattern:x1,parsePattern:U1,valueCallback:n=>parseInt(n)}),era:Tt({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:B1,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:V1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:$1,defaultMatchWidth:"wide",parsePatterns:K1,defaultParseWidth:"any"}),day:Tt({matchPatterns:W1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:q1,defaultParseWidth:"any"})},Y1={code:"de",formatDistance:E1,formatLong:I1,formatRelative:A1,localize:L1,match:j1,options:{weekStartsOn:1,firstWeekContainsDate:4}},J1={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},Q1=(n,e,t)=>{let r;const o=J1[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"dans "+r:"il y a "+r:r},X1={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Z1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},eM={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tM={date:rr({formats:X1,defaultWidth:"full"}),time:rr({formats:Z1,defaultWidth:"full"}),dateTime:rr({formats:eM,defaultWidth:"full"})},nM={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},rM=(n,e,t,r)=>nM[n],oM={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},iM={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},aM={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},sM={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},cM={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},lM=(n,e)=>{const t=Number(n),r=e==null?void 0:e.unit;if(t===0)return"0";const o=["year","week","hour","minute","second"];let a;return t===1?a=r&&o.includes(r)?"ère":"er":a="ème",t+a},uM=["MMM","MMMM"],dM={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&uM.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:lM,era:wt({values:oM,defaultWidth:"wide"}),quarter:wt({values:iM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:aM,defaultWidth:"wide"}),day:wt({values:sM,defaultWidth:"wide"}),dayPeriod:wt({values:cM,defaultWidth:"wide"})},hM=/^(\d+)(ième|ère|ème|er|e)?/i,fM=/\d+/i,mM={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},gM={any:[/^av/i,/^ap/i]},pM={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},_M={any:[/1/i,/2/i,/3/i,/4/i]},vM={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},yM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},CM={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},EM={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},wM={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},TM={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},bM={ordinalNumber:Kl({matchPattern:hM,parsePattern:fM,valueCallback:n=>parseInt(n)}),era:Tt({matchPatterns:mM,defaultMatchWidth:"wide",parsePatterns:gM,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:pM,defaultMatchWidth:"wide",parsePatterns:_M,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:vM,defaultMatchWidth:"wide",parsePatterns:yM,defaultParseWidth:"any"}),day:Tt({matchPatterns:CM,defaultMatchWidth:"wide",parsePatterns:EM,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:wM,defaultMatchWidth:"any",parsePatterns:TM,defaultParseWidth:"any"})},IM={code:"fr",formatDistance:Q1,formatLong:tM,formatRelative:rM,localize:dM,match:bM,options:{weekStartsOn:1,firstWeekContainsDate:4}},SM={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},AM=(n,e,t)=>{let r;const o=SM[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"em "+r:"há "+r:r},kM={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},NM={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},RM={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},OM={date:rr({formats:kM,defaultWidth:"full"}),time:rr({formats:NM,defaultWidth:"full"}),dateTime:rr({formats:RM,defaultWidth:"full"})},PM={lastWeek:n=>{const e=n.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},MM=(n,e,t,r)=>{const o=PM[n];return typeof o=="function"?o(e):o},DM={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},LM={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},xM={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},UM={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},FM={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},BM={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},VM=(n,e)=>{const t=Number(n);return(e==null?void 0:e.unit)==="week"?t+"ª":t+"º"},HM={ordinalNumber:VM,era:wt({values:DM,defaultWidth:"wide"}),quarter:wt({values:LM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wt({values:xM,defaultWidth:"wide"}),day:wt({values:UM,defaultWidth:"wide"}),dayPeriod:wt({values:FM,defaultWidth:"wide",formattingValues:BM,defaultFormattingWidth:"wide"})},$M=/^(\d+)[ºªo]?/i,KM=/\d+/i,WM={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},zM={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},GM={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},qM={any:[/1/i,/2/i,/3/i,/4/i]},jM={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},YM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},JM={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},QM={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},XM={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},ZM={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},eD={ordinalNumber:Kl({matchPattern:$M,parsePattern:KM,valueCallback:n=>parseInt(n,10)}),era:Tt({matchPatterns:WM,defaultMatchWidth:"wide",parsePatterns:zM,defaultParseWidth:"any"}),quarter:Tt({matchPatterns:GM,defaultMatchWidth:"wide",parsePatterns:qM,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Tt({matchPatterns:jM,defaultMatchWidth:"wide",parsePatterns:YM,defaultParseWidth:"any"}),day:Tt({matchPatterns:JM,defaultMatchWidth:"wide",parsePatterns:QM,defaultParseWidth:"any"}),dayPeriod:Tt({matchPatterns:XM,defaultMatchWidth:"any",parsePatterns:ZM,defaultParseWidth:"any"})},tD={code:"pt-BR",formatDistance:AM,formatLong:OM,formatRelative:MM,localize:HM,match:eD,options:{weekStartsOn:0,firstWeekContainsDate:1}};/*!
12
12
  * shared v11.1.3
13
13
  * (c) 2025 kazuya kawaguchi
14
14
  * Released under the MIT License.
@@ -69,7 +69,7 @@ __p += '`),Oe&&(q+=`' +
69
69
  function print() { __p += __j.call(arguments, '') }
70
70
  `:`;
71
71
  `)+q+`return __p
72
- }`;var be=t_(function(){return Fe(E,ae+"return "+q).apply(t,b)});if(be.source=q,Ed(be))throw be;return be}function bR(i){return Ve(i).toLowerCase()}function IR(i){return Ve(i).toUpperCase()}function SR(i,s,u){if(i=Ve(i),i&&(u||s===t))return ug(i);if(!i||!(s=bn(s)))return i;var f=sr(i),_=sr(s),E=dg(f,_),b=hg(f,_)+1;return Ao(f,E,b).join("")}function AR(i,s,u){if(i=Ve(i),i&&(u||s===t))return i.slice(0,mg(i)+1);if(!i||!(s=bn(s)))return i;var f=sr(i),_=hg(f,sr(s))+1;return Ao(f,0,_).join("")}function kR(i,s,u){if(i=Ve(i),i&&(u||s===t))return i.replace(Eu,"");if(!i||!(s=bn(s)))return i;var f=sr(i),_=dg(f,sr(s));return Ao(f,_).join("")}function NR(i,s){var u=Q,f=Z;if(lt(s)){var _="separator"in s?s.separator:_;u="length"in s?Te(s.length):u,f="omission"in s?bn(s.omission):f}i=Ve(i);var E=i.length;if(Ri(i)){var b=sr(i);E=b.length}if(u>=E)return i;var S=u-Oi(f);if(S<1)return f;var M=b?Ao(b,0,S).join(""):i.slice(0,S);if(_===t)return M+f;if(b&&(S+=M.length-S),wd(_)){if(i.slice(S).search(_)){var K,W=M;for(_.global||(_=Fu(_.source,Ve(Pm.exec(_))+"g")),_.lastIndex=0;K=_.exec(W);)var q=K.index;M=M.slice(0,q===t?S:q)}}else if(i.indexOf(bn(_),S)!=S){var ee=M.lastIndexOf(_);ee>-1&&(M=M.slice(0,ee))}return M+f}function RR(i){return i=Ve(i),i&&HT.test(i)?i.replace(Nm,iI):i}var OR=Fi(function(i,s,u){return i+(u?" ":"")+s.toUpperCase()}),Id=np("toUpperCase");function e_(i,s,u){return i=Ve(i),s=u?t:s,s===t?eI(i)?cI(i):zb(i):i.match(s)||[]}var t_=Ie(function(i,s){try{return wn(i,t,s)}catch(u){return Ed(u)?u:new ye(u)}}),PR=Qr(function(i,s){return Vn(s,function(u){u=Rr(u),Yr(i,u,yd(i[u],i))}),i});function MR(i){var s=i==null?0:i.length,u=ue();return i=s?at(i,function(f){if(typeof f[1]!="function")throw new Hn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var _=-1;++_<s;){var E=i[_];if(wn(E[0],this,f))return wn(E[1],this,f)}})}function DR(i){return iS(Kn(i,v))}function Sd(i){return function(){return i}}function LR(i,s){return i==null||i!==i?s:i}var xR=op(),UR=op(!0);function mn(i){return i}function Ad(i){return Dg(typeof i=="function"?i:Kn(i,v))}function FR(i){return xg(Kn(i,v))}function BR(i,s){return Ug(i,Kn(s,v))}var VR=Ie(function(i,s){return function(u){return Ga(u,i,s)}}),HR=Ie(function(i,s){return function(u){return Ga(i,u,s)}});function kd(i,s,u){var f=Mt(s),_=dc(s,f);u==null&&!(lt(s)&&(_.length||!f.length))&&(u=s,s=i,i=this,_=dc(s,Mt(s)));var E=!(lt(u)&&"chain"in u)||!!u.chain,b=Zr(i);return Vn(_,function(S){var M=s[S];i[S]=M,b&&(i.prototype[S]=function(){var K=this.__chain__;if(E||K){var W=i(this.__wrapped__),q=W.__actions__=dn(this.__actions__);return q.push({func:M,args:arguments,thisArg:i}),W.__chain__=K,W}return M.apply(i,Eo([this.value()],arguments))})}),i}function $R(){return Bt._===this&&(Bt._=mI),this}function Nd(){}function KR(i){return i=Te(i),Ie(function(s){return Fg(s,i)})}var WR=ad(at),zR=ad(ig),GR=ad(Ou);function n_(i){return fd(i)?Pu(Rr(i)):wS(i)}function qR(i){return function(s){return i==null?t:ti(i,s)}}var jR=ap(),YR=ap(!0);function Rd(){return[]}function Od(){return!1}function JR(){return{}}function QR(){return""}function XR(){return!0}function ZR(i,s){if(i=Te(i),i<1||i>it)return[];var u=It,f=qt(i,It);s=ue(s),i-=It;for(var _=Lu(f,s);++u<i;)s(u);return _}function eO(i){return Ce(i)?at(i,Rr):In(i)?[i]:dn(wp(Ve(i)))}function tO(i){var s=++hI;return Ve(i)+s}var nO=_c(function(i,s){return i+s},0),rO=sd("ceil"),oO=_c(function(i,s){return i/s},1),iO=sd("floor");function aO(i){return i&&i.length?uc(i,mn,Gu):t}function sO(i,s){return i&&i.length?uc(i,ue(s,2),Gu):t}function cO(i){return cg(i,mn)}function lO(i,s){return cg(i,ue(s,2))}function uO(i){return i&&i.length?uc(i,mn,Ju):t}function dO(i,s){return i&&i.length?uc(i,ue(s,2),Ju):t}var hO=_c(function(i,s){return i*s},1),fO=sd("round"),mO=_c(function(i,s){return i-s},0);function gO(i){return i&&i.length?Du(i,mn):0}function pO(i,s){return i&&i.length?Du(i,ue(s,2)):0}return y.after=Fk,y.ary=Mp,y.assign=IN,y.assignIn=qp,y.assignInWith=Rc,y.assignWith=SN,y.at=AN,y.before=Dp,y.bind=yd,y.bindAll=PR,y.bindKey=Lp,y.castArray=Jk,y.chain=Rp,y.chunk=iA,y.compact=aA,y.concat=sA,y.cond=MR,y.conforms=DR,y.constant=Sd,y.countBy=gk,y.create=kN,y.curry=xp,y.curryRight=Up,y.debounce=Fp,y.defaults=NN,y.defaultsDeep=RN,y.defer=Bk,y.delay=Vk,y.difference=cA,y.differenceBy=lA,y.differenceWith=uA,y.drop=dA,y.dropRight=hA,y.dropRightWhile=fA,y.dropWhile=mA,y.fill=gA,y.filter=_k,y.flatMap=Ck,y.flatMapDeep=Ek,y.flatMapDepth=wk,y.flatten=Sp,y.flattenDeep=pA,y.flattenDepth=_A,y.flip=Hk,y.flow=xR,y.flowRight=UR,y.fromPairs=vA,y.functions=UN,y.functionsIn=FN,y.groupBy=Tk,y.initial=CA,y.intersection=EA,y.intersectionBy=wA,y.intersectionWith=TA,y.invert=VN,y.invertBy=HN,y.invokeMap=Ik,y.iteratee=Ad,y.keyBy=Sk,y.keys=Mt,y.keysIn=fn,y.map=bc,y.mapKeys=KN,y.mapValues=WN,y.matches=FR,y.matchesProperty=BR,y.memoize=Sc,y.merge=zN,y.mergeWith=jp,y.method=VR,y.methodOf=HR,y.mixin=kd,y.negate=Ac,y.nthArg=KR,y.omit=GN,y.omitBy=qN,y.once=$k,y.orderBy=Ak,y.over=WR,y.overArgs=Kk,y.overEvery=zR,y.overSome=GR,y.partial=Cd,y.partialRight=Bp,y.partition=kk,y.pick=jN,y.pickBy=Yp,y.property=n_,y.propertyOf=qR,y.pull=AA,y.pullAll=kp,y.pullAllBy=kA,y.pullAllWith=NA,y.pullAt=RA,y.range=jR,y.rangeRight=YR,y.rearg=Wk,y.reject=Ok,y.remove=OA,y.rest=zk,y.reverse=_d,y.sampleSize=Mk,y.set=JN,y.setWith=QN,y.shuffle=Dk,y.slice=PA,y.sortBy=Uk,y.sortedUniq=BA,y.sortedUniqBy=VA,y.split=CR,y.spread=Gk,y.tail=HA,y.take=$A,y.takeRight=KA,y.takeRightWhile=WA,y.takeWhile=zA,y.tap=ak,y.throttle=qk,y.thru=Tc,y.toArray=Wp,y.toPairs=Jp,y.toPairsIn=Qp,y.toPath=eO,y.toPlainObject=Gp,y.transform=XN,y.unary=jk,y.union=GA,y.unionBy=qA,y.unionWith=jA,y.uniq=YA,y.uniqBy=JA,y.uniqWith=QA,y.unset=ZN,y.unzip=vd,y.unzipWith=Np,y.update=eR,y.updateWith=tR,y.values=Hi,y.valuesIn=nR,y.without=XA,y.words=e_,y.wrap=Yk,y.xor=ZA,y.xorBy=ek,y.xorWith=tk,y.zip=nk,y.zipObject=rk,y.zipObjectDeep=ok,y.zipWith=ik,y.entries=Jp,y.entriesIn=Qp,y.extend=qp,y.extendWith=Rc,kd(y,y),y.add=nO,y.attempt=t_,y.camelCase=aR,y.capitalize=Xp,y.ceil=rO,y.clamp=rR,y.clone=Qk,y.cloneDeep=Zk,y.cloneDeepWith=eN,y.cloneWith=Xk,y.conformsTo=tN,y.deburr=Zp,y.defaultTo=LR,y.divide=oO,y.endsWith=sR,y.eq=lr,y.escape=cR,y.escapeRegExp=lR,y.every=pk,y.find=vk,y.findIndex=bp,y.findKey=ON,y.findLast=yk,y.findLastIndex=Ip,y.findLastKey=PN,y.floor=iO,y.forEach=Op,y.forEachRight=Pp,y.forIn=MN,y.forInRight=DN,y.forOwn=LN,y.forOwnRight=xN,y.get=Td,y.gt=nN,y.gte=rN,y.has=BN,y.hasIn=bd,y.head=Ap,y.identity=mn,y.includes=bk,y.indexOf=yA,y.inRange=oR,y.invoke=$N,y.isArguments=oi,y.isArray=Ce,y.isArrayBuffer=oN,y.isArrayLike=hn,y.isArrayLikeObject=gt,y.isBoolean=iN,y.isBuffer=ko,y.isDate=aN,y.isElement=sN,y.isEmpty=cN,y.isEqual=lN,y.isEqualWith=uN,y.isError=Ed,y.isFinite=dN,y.isFunction=Zr,y.isInteger=Vp,y.isLength=kc,y.isMap=Hp,y.isMatch=hN,y.isMatchWith=fN,y.isNaN=mN,y.isNative=gN,y.isNil=_N,y.isNull=pN,y.isNumber=$p,y.isObject=lt,y.isObjectLike=dt,y.isPlainObject=Xa,y.isRegExp=wd,y.isSafeInteger=vN,y.isSet=Kp,y.isString=Nc,y.isSymbol=In,y.isTypedArray=Vi,y.isUndefined=yN,y.isWeakMap=CN,y.isWeakSet=EN,y.join=bA,y.kebabCase=uR,y.last=zn,y.lastIndexOf=IA,y.lowerCase=dR,y.lowerFirst=hR,y.lt=wN,y.lte=TN,y.max=aO,y.maxBy=sO,y.mean=cO,y.meanBy=lO,y.min=uO,y.minBy=dO,y.stubArray=Rd,y.stubFalse=Od,y.stubObject=JR,y.stubString=QR,y.stubTrue=XR,y.multiply=hO,y.nth=SA,y.noConflict=$R,y.noop=Nd,y.now=Ic,y.pad=fR,y.padEnd=mR,y.padStart=gR,y.parseInt=pR,y.random=iR,y.reduce=Nk,y.reduceRight=Rk,y.repeat=_R,y.replace=vR,y.result=YN,y.round=fO,y.runInContext=P,y.sample=Pk,y.size=Lk,y.snakeCase=yR,y.some=xk,y.sortedIndex=MA,y.sortedIndexBy=DA,y.sortedIndexOf=LA,y.sortedLastIndex=xA,y.sortedLastIndexBy=UA,y.sortedLastIndexOf=FA,y.startCase=ER,y.startsWith=wR,y.subtract=mO,y.sum=gO,y.sumBy=pO,y.template=TR,y.times=ZR,y.toFinite=eo,y.toInteger=Te,y.toLength=zp,y.toLower=bR,y.toNumber=Gn,y.toSafeInteger=bN,y.toString=Ve,y.toUpper=IR,y.trim=SR,y.trimEnd=AR,y.trimStart=kR,y.truncate=NR,y.unescape=RR,y.uniqueId=tO,y.upperCase=OR,y.upperFirst=Id,y.each=Op,y.eachRight=Pp,y.first=Ap,kd(y,function(){var i={};return kr(y,function(s,u){He.call(y.prototype,u)||(i[u]=s)}),i}(),{chain:!1}),y.VERSION=r,Vn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){y[i].placeholder=y}),Vn(["drop","take"],function(i,s){Re.prototype[i]=function(u){u=u===t?1:At(Te(u),0);var f=this.__filtered__&&!s?new Re(this):this.clone();return f.__filtered__?f.__takeCount__=qt(u,f.__takeCount__):f.__views__.push({size:qt(u,It),type:i+(f.__dir__<0?"Right":"")}),f},Re.prototype[i+"Right"]=function(u){return this.reverse()[i](u).reverse()}}),Vn(["filter","map","takeWhile"],function(i,s){var u=s+1,f=u==yt||u==Gt;Re.prototype[i]=function(_){var E=this.clone();return E.__iteratees__.push({iteratee:ue(_,3),type:u}),E.__filtered__=E.__filtered__||f,E}}),Vn(["head","last"],function(i,s){var u="take"+(s?"Right":"");Re.prototype[i]=function(){return this[u](1).value()[0]}}),Vn(["initial","tail"],function(i,s){var u="drop"+(s?"":"Right");Re.prototype[i]=function(){return this.__filtered__?new Re(this):this[u](1)}}),Re.prototype.compact=function(){return this.filter(mn)},Re.prototype.find=function(i){return this.filter(i).head()},Re.prototype.findLast=function(i){return this.reverse().find(i)},Re.prototype.invokeMap=Ie(function(i,s){return typeof i=="function"?new Re(this):this.map(function(u){return Ga(u,i,s)})}),Re.prototype.reject=function(i){return this.filter(Ac(ue(i)))},Re.prototype.slice=function(i,s){i=Te(i);var u=this;return u.__filtered__&&(i>0||s<0)?new Re(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),s!==t&&(s=Te(s),u=s<0?u.dropRight(-s):u.take(s-i)),u)},Re.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Re.prototype.toArray=function(){return this.take(It)},kr(Re.prototype,function(i,s){var u=/^(?:filter|find|map|reject)|While$/.test(s),f=/^(?:head|last)$/.test(s),_=y[f?"take"+(s=="last"?"Right":""):s],E=f||/^find/.test(s);_&&(y.prototype[s]=function(){var b=this.__wrapped__,S=f?[1]:arguments,M=b instanceof Re,K=S[0],W=M||Ce(b),q=function(Ne){var Oe=_.apply(y,Eo([Ne],S));return f&&ee?Oe[0]:Oe};W&&u&&typeof K=="function"&&K.length!=1&&(M=W=!1);var ee=this.__chain__,ae=!!this.__actions__.length,de=E&&!ee,be=M&&!ae;if(!E&&W){b=be?b:new Re(this);var he=i.apply(b,S);return he.__actions__.push({func:Tc,args:[q],thisArg:t}),new $n(he,ee)}return de&&be?i.apply(this,S):(he=this.thru(q),de?f?he.value()[0]:he.value():he)})}),Vn(["pop","push","shift","sort","splice","unshift"],function(i){var s=Ys[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",f=/^(?:pop|shift)$/.test(i);y.prototype[i]=function(){var _=arguments;if(f&&!this.__chain__){var E=this.value();return s.apply(Ce(E)?E:[],_)}return this[u](function(b){return s.apply(Ce(b)?b:[],_)})}}),kr(Re.prototype,function(i,s){var u=y[s];if(u){var f=u.name+"";He.call(Li,f)||(Li[f]=[]),Li[f].push({name:s,func:u})}}),Li[pc(t,I).name]=[{name:"wrapper",func:t}],Re.prototype.clone=RI,Re.prototype.reverse=OI,Re.prototype.value=PI,y.prototype.at=sk,y.prototype.chain=ck,y.prototype.commit=lk,y.prototype.next=uk,y.prototype.plant=hk,y.prototype.reverse=fk,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=mk,y.prototype.first=y.prototype.head,Ba&&(y.prototype[Ba]=dk),y},Pi=lI();Jo?((Jo.exports=Pi)._=Pi,Au._=Pi):Bt._=Pi}).call(sB)}(is,is.exports)),is.exports}var ka=cB();const hl=aB(ka);function Na(n,e,t=[]){const r=uB(e);if(!r)return n;const o=r.split(" ");return n.filter(a=>lB(a,o,t))}function lB(n,e,t){return t.some(r=>{const o=hl.get(n,r);if(hl.isNil(o))return!1;const a=hl.toString(o).toLowerCase();return e.every(c=>a.includes(c))})}function uB(n){return hl.trim(n).toLowerCase().replace(/\s+/g," ")}const dB={class:"text-faded mt-7"},hB={class:"d-flex align-baseline mb-1"},fB={class:"me-1"},mB={class:"max-w-_form-metadataJ"},gB={key:0,class:"mb-1"},pB={key:1,class:"mb-1"},_B={class:"mb-1"},nu=l.defineComponent({__name:"FormMetadata",props:{meta:{},id:{}},setup(n){const{t:e}=Tr();return(t,r)=>(l.openBlock(),l.createElementBlock("div",dB,[l.createVNode(Je.VRow,{"no-gutters":"",class:"align-end ga-3",align:"center"},{default:l.withCtx(()=>[l.renderSlot(t.$slots,"default"),t.id?(l.openBlock(),l.createBlock(Je.VCol,{key:0,cols:"auto",class:"pa-2"},{default:l.withCtx(()=>[l.createElementVNode("p",hB,[l.createElementVNode("b",fB,l.toDisplayString(t.id.title)+": ",1),l.createElementVNode("span",mB,l.toDisplayString(t.id.key||"-"),1),l.createElementVNode("span",null,[l.createVNode(xl,{"content-to-copy":t.id.key,size:15},null,8,["content-to-copy"])])]),l.createElementVNode("p",null,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.created"))+": ",1),l.createTextVNode(l.toDisplayString(l.unref(cs)(t.meta.created_at))+" - "+l.toDisplayString(t.meta.created_by),1)])]),_:1})):l.createCommentVNode("",!0),l.createVNode(Je.VCol,{cols:"auto",class:"d-flex flex-column align-baseline px-2 mt-1"},{default:l.withCtx(()=>[t.meta.updated_at&&t.meta.updated_by?(l.openBlock(),l.createElementBlock("p",gB,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.updated"))+":  ",1),l.createTextVNode(l.toDisplayString(l.unref(cs)(t.meta.updated_at))+" - "+l.toDisplayString(t.meta.updated_by),1)])):(l.openBlock(),l.createElementBlock("p",pB,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.modified"))+":  ",1),l.createTextVNode(l.toDisplayString(l.unref(cs)(t.meta.modified_at))+" - "+l.toDisplayString(t.meta.modified_by),1)])),l.createElementVNode("p",_B,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.delegated"))+": ",1),l.createTextVNode(l.toDisplayString(t.meta.delegated_at)+" - "+l.toDisplayString(t.meta.delegated_by),1)])]),_:1})]),_:3})]))}}),vB={key:0,class:"mb-2 ms-1"},LE=l.defineComponent({__name:"JSelect",props:{modelValue:{},name:{},label:{},placeholder:{},readonly:{type:Boolean},items:{},itemTitle:{},itemValue:{},density:{},loading:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.computed(()=>t.readonly?"solo":"solo-filled"),a=l.computed(()=>{if(Array.isArray(t.items)&&t.items.length>0)if(typeof t.items[0]=="object"&&t.itemValue&&t.itemTitle){const d=t.items.find(h=>h[t.itemValue]===t.modelValue);return d?d[t.itemTitle]:""}else{const d=t.items.indexOf(t.modelValue);return d!==-1?t.items[d]:""}return""}),c=d=>{r("update:modelValue",d)};return(d,h)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[d.name?(l.openBlock(),l.createElementBlock("p",vB,l.toDisplayString(d.name),1)):l.createCommentVNode("",!0),d.label?(l.openBlock(),l.createBlock(_s.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.label),1)]),_:1})):l.createCommentVNode("",!0),d.readonly?(l.openBlock(),l.createBlock(lE,{key:3,value:a.value},null,8,["value"])):(l.openBlock(),l.createBlock(l.unref(Bo.VSelect),{key:2,modelValue:t.modelValue,"onUpdate:modelValue":[h[0]||(h[0]=m=>t.modelValue=m),c],variant:o.value,items:d.items,"item-title":d.itemTitle,"item-value":d.itemValue,loading:d.loading,placeholder:d.placeholder,density:d.density,"bg-color":"containerBg",rounded:"false","hide-details":"",class:"j-field",clearable:d.clearable},null,8,["modelValue","variant","items","item-title","item-value","loading","placeholder","density","clearable"]))],64))}}),yB={key:0,class:"mb-2 ms-1"},CB={key:3,class:"j-textarea px-4 py-3 rounded-sm bg-containerBg"},xE=l.defineComponent({__name:"JTextArea",props:{modelValue:{},name:{},label:{},readonly:{type:Boolean},rows:{},hideDetails:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.computed(()=>t.readonly?"solo":"solo-filled");return(a,c)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[a.name?(l.openBlock(),l.createElementBlock("p",yB,l.toDisplayString(a.name),1)):l.createCommentVNode("",!0),a.label?(l.openBlock(),l.createBlock(_s.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(a.label),1)]),_:1})):l.createCommentVNode("",!0),a.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(CO.VTextarea,{key:2,variant:o.value,"bg-color":"containerBg",rounded:"false",rows:a.rows,hideDetails:a.hideDetails,value:a.modelValue,"onUpdate:modelValue":c[0]||(c[0]=d=>r("update:modelValue",d)),"no-resize":""},null,8,["variant","rows","hideDetails","value"])),a.readonly?(l.openBlock(),l.createElementBlock("div",CB,l.toDisplayString(a.modelValue),1)):l.createCommentVNode("",!0)],64))}}),UE=l.defineComponent({__name:"CancelButton",props:{title:{}},emits:["cancel"],setup(n,{emit:e}){const t=e,{t:r}=Tr();return(o,a)=>(l.openBlock(),l.createBlock(ot.VBtn,{color:"secondary",variant:"outlined",onClick:a[0]||(a[0]=c=>t("cancel")),class:"me-2 j-btn-form"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(o.title?l.unref(r)("actions.cancel"):l.unref(r)("actions.back")),1)]),_:1}))}}),FE=l.defineComponent({__name:"SaveButton",props:{disabled:{type:Boolean}},emits:["onSave"],setup(n,{emit:e}){const t=e,r=l.ref(!1);async function o(){r.value=!0,await t("onSave"),r.value=!1}const{t:a}=Tr();return(c,d)=>(l.openBlock(),l.createBlock(ot.VBtn,{disabled:c.disabled,loading:r.value,color:"secondary",onClick:o,onKeydown:l.withKeys(o,["enter"]),class:"j-btn-form"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(a)("actions.save")),1)]),_:1},8,["disabled","loading"]))}}),EB={class:"mt-4"},BE=l.defineComponent({__name:"JForm",props:{title:{},metadata:{},id:{},cancelReturn:{type:Boolean}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(Hl,{title:r.title,class:"d-flex flex-column ma-0"},{default:l.withCtx(()=>[r.title?(l.openBlock(),l.createBlock(gi.VDivider,{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",EB,[l.renderSlot(r.$slots,"default")]),l.createVNode(Lt.VCardText,{class:"pa-0 mx-0 align-content-end"},{default:l.withCtx(()=>[l.createVNode(Je.VRow,{justify:"space-between",class:"mt-4"},{default:l.withCtx(()=>[l.createVNode(Je.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:l.withCtx(()=>[l.createVNode(nu,{id:r.id,meta:r.metadata},null,8,["id","meta"])]),_:1}),l.createVNode(Je.VSpacer),l.createVNode(Je.VCol,{cols:"auto",class:"align-content-end"},{default:l.withCtx(()=>[l.createVNode(UE,{"cancel-return":r.cancelReturn,onCancel:o[0]||(o[0]=a=>t("onCancel"))},null,8,["cancel-return"]),l.createVNode(FE,{onOnSave:o[1]||(o[1]=a=>t("onSave"))})]),_:1})]),_:1})]),_:1})]),_:3},8,["title"]))}}),wB={class:"d-flex align-items-center"},TB={key:0,class:"d-flex align-center"},bB={class:"ms-1"},IB={class:"d-flex"},SB={class:"d-flex mb-1 align-center"},AB={class:"min-w-100 relative"},VE=l.defineComponent({__name:"TabFormHeader",props:{id:{},readonly:{type:Boolean,default:!1}},emits:["update:isEdition","save","cancel","delete","disable"],setup(n,{emit:e}){var v;const t=n,r=e,o=l.getCurrentInstance(),a=((v=o==null?void 0:o.vnode.props)==null?void 0:v.onDisable)!==void 0,c=l.ref(t.readonly);function d(){r("cancel"),c.value=!1,r("update:isEdition",c.value)}function h(){c.value=!c.value,r("update:isEdition",c.value)}async function m(){r("delete"),r("disable")}const{t:g}=Tr();return(p,w)=>(l.openBlock(),l.createElementBlock("div",wB,[p.id?(l.openBlock(),l.createElementBlock("div",TB,[w[0]||(w[0]=l.createElementVNode("b",null,"ID:",-1)),l.createElementVNode("span",bB,l.toDisplayString(p.id),1),l.createVNode(xl,{"content-to-copy":p.id,size:20},null,8,["content-to-copy"])])):l.createCommentVNode("",!0),l.createVNode(Je.VSpacer),l.createElementVNode("div",IB,[l.createVNode(ot.VBtn,{onClick:m,variant:"text"},{default:l.withCtx(()=>[a?(l.openBlock(),l.createBlock(l.unref(nP),{key:0,size:"11",class:"me-2"})):(l.openBlock(),l.createBlock(ml.VIcon,{key:1,class:"me-2"},{default:l.withCtx(()=>w[1]||(w[1]=[l.createTextVNode("mdi-delete-outline")])),_:1})),l.createTextVNode(" "+l.toDisplayString(a?l.unref(g)("actions.disable"):l.unref(g)("actions.delete")),1)]),_:1}),l.createElementVNode("div",SB,[l.createVNode(gi.VDivider,{class:"mx-2 my-1",vertical:""}),l.createElementVNode("div",AB,[l.withDirectives(l.createVNode(ot.VBtn,{onClick:h,variant:"text",color:"secondary","prepend-icon":"mdi-pencil",width:"95"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(g)("actions.edit")),1)]),_:1},512),[[l.vShow,!c.value]]),l.withDirectives(l.createVNode(ot.VBtn,{onClick:d,variant:"text",color:"secondary",width:"95"},{default:l.withCtx(()=>[l.createVNode(ml.VIcon,{class:"pt-1 pe-2"},{default:l.withCtx(()=>w[2]||(w[2]=[l.createTextVNode("mdi-close")])),_:1}),l.createTextVNode(" "+l.toDisplayString(l.unref(g)("actions.cancel")),1)]),_:1},512),[[l.vShow,c.value]])])])])]))}}),kB={class:"d-flex flex-column"},NB={class:"height d-flex flex-column"},RB={class:"d-flex justify-between align-end"},OB=l.defineComponent({__name:"FormHeadless",props:{id:{},metadata:{},readonly:{type:Boolean,default:!1}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=e,r=l.getCurrentInstance(),o=l.computed(()=>{var c;return!!((c=r==null?void 0:r.vnode.props)!=null&&c.onOnSave)}),a=l.computed(()=>{var c;return!!((c=r==null?void 0:r.vnode.props)!=null&&c.onOnCancel)});return(c,d)=>(l.openBlock(),l.createBlock(Hl,null,{default:l.withCtx(()=>[l.createElementVNode("div",kB,[l.createElementVNode("div",NB,[l.renderSlot(c.$slots,"default",{},void 0,!0)])]),l.createElementVNode("div",RB,[l.createVNode(Je.VRow,{"no-gutters":"",justify:"space-between",class:"w-100"},{default:l.withCtx(()=>[l.createVNode(Je.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:l.withCtx(()=>[l.createVNode(nu,{id:c.id,meta:c.metadata},null,8,["id","meta"])]),_:1}),c.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Je.VCol,{key:0,class:"d-flex align-end",cols:"auto"},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(UE,{key:0,title:"Back",onCancel:d[0]||(d[0]=h=>t("onCancel"))})):l.createCommentVNode("",!0),o.value?(l.openBlock(),l.createBlock(FE,{key:1,onOnSave:d[1]||(d[1]=h=>t("onSave"))})):l.createCommentVNode("",!0)]),_:1}))]),_:1})])]),_:3}))}}),HE=ba(OB,[["__scopeId","data-v-515844c6"]]);/**
72
+ }`;var be=t_(function(){return Fe(E,ae+"return "+q).apply(t,b)});if(be.source=q,Ed(be))throw be;return be}function bR(i){return Ve(i).toLowerCase()}function IR(i){return Ve(i).toUpperCase()}function SR(i,s,u){if(i=Ve(i),i&&(u||s===t))return ug(i);if(!i||!(s=bn(s)))return i;var f=sr(i),_=sr(s),E=dg(f,_),b=hg(f,_)+1;return Ao(f,E,b).join("")}function AR(i,s,u){if(i=Ve(i),i&&(u||s===t))return i.slice(0,mg(i)+1);if(!i||!(s=bn(s)))return i;var f=sr(i),_=hg(f,sr(s))+1;return Ao(f,0,_).join("")}function kR(i,s,u){if(i=Ve(i),i&&(u||s===t))return i.replace(Eu,"");if(!i||!(s=bn(s)))return i;var f=sr(i),_=dg(f,sr(s));return Ao(f,_).join("")}function NR(i,s){var u=Q,f=Z;if(lt(s)){var _="separator"in s?s.separator:_;u="length"in s?Te(s.length):u,f="omission"in s?bn(s.omission):f}i=Ve(i);var E=i.length;if(Ri(i)){var b=sr(i);E=b.length}if(u>=E)return i;var S=u-Oi(f);if(S<1)return f;var M=b?Ao(b,0,S).join(""):i.slice(0,S);if(_===t)return M+f;if(b&&(S+=M.length-S),wd(_)){if(i.slice(S).search(_)){var K,W=M;for(_.global||(_=Fu(_.source,Ve(Pm.exec(_))+"g")),_.lastIndex=0;K=_.exec(W);)var q=K.index;M=M.slice(0,q===t?S:q)}}else if(i.indexOf(bn(_),S)!=S){var ee=M.lastIndexOf(_);ee>-1&&(M=M.slice(0,ee))}return M+f}function RR(i){return i=Ve(i),i&&HT.test(i)?i.replace(Nm,iI):i}var OR=Fi(function(i,s,u){return i+(u?" ":"")+s.toUpperCase()}),Id=np("toUpperCase");function e_(i,s,u){return i=Ve(i),s=u?t:s,s===t?eI(i)?cI(i):zb(i):i.match(s)||[]}var t_=Ie(function(i,s){try{return wn(i,t,s)}catch(u){return Ed(u)?u:new ye(u)}}),PR=Qr(function(i,s){return Vn(s,function(u){u=Rr(u),Yr(i,u,yd(i[u],i))}),i});function MR(i){var s=i==null?0:i.length,u=ue();return i=s?at(i,function(f){if(typeof f[1]!="function")throw new Hn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var _=-1;++_<s;){var E=i[_];if(wn(E[0],this,f))return wn(E[1],this,f)}})}function DR(i){return iS(Kn(i,v))}function Sd(i){return function(){return i}}function LR(i,s){return i==null||i!==i?s:i}var xR=op(),UR=op(!0);function mn(i){return i}function Ad(i){return Dg(typeof i=="function"?i:Kn(i,v))}function FR(i){return xg(Kn(i,v))}function BR(i,s){return Ug(i,Kn(s,v))}var VR=Ie(function(i,s){return function(u){return Ga(u,i,s)}}),HR=Ie(function(i,s){return function(u){return Ga(i,u,s)}});function kd(i,s,u){var f=Mt(s),_=dc(s,f);u==null&&!(lt(s)&&(_.length||!f.length))&&(u=s,s=i,i=this,_=dc(s,Mt(s)));var E=!(lt(u)&&"chain"in u)||!!u.chain,b=Zr(i);return Vn(_,function(S){var M=s[S];i[S]=M,b&&(i.prototype[S]=function(){var K=this.__chain__;if(E||K){var W=i(this.__wrapped__),q=W.__actions__=dn(this.__actions__);return q.push({func:M,args:arguments,thisArg:i}),W.__chain__=K,W}return M.apply(i,Eo([this.value()],arguments))})}),i}function $R(){return Bt._===this&&(Bt._=mI),this}function Nd(){}function KR(i){return i=Te(i),Ie(function(s){return Fg(s,i)})}var WR=ad(at),zR=ad(ig),GR=ad(Ou);function n_(i){return fd(i)?Pu(Rr(i)):wS(i)}function qR(i){return function(s){return i==null?t:ti(i,s)}}var jR=ap(),YR=ap(!0);function Rd(){return[]}function Od(){return!1}function JR(){return{}}function QR(){return""}function XR(){return!0}function ZR(i,s){if(i=Te(i),i<1||i>it)return[];var u=It,f=qt(i,It);s=ue(s),i-=It;for(var _=Lu(f,s);++u<i;)s(u);return _}function eO(i){return Ce(i)?at(i,Rr):In(i)?[i]:dn(wp(Ve(i)))}function tO(i){var s=++hI;return Ve(i)+s}var nO=_c(function(i,s){return i+s},0),rO=sd("ceil"),oO=_c(function(i,s){return i/s},1),iO=sd("floor");function aO(i){return i&&i.length?uc(i,mn,Gu):t}function sO(i,s){return i&&i.length?uc(i,ue(s,2),Gu):t}function cO(i){return cg(i,mn)}function lO(i,s){return cg(i,ue(s,2))}function uO(i){return i&&i.length?uc(i,mn,Ju):t}function dO(i,s){return i&&i.length?uc(i,ue(s,2),Ju):t}var hO=_c(function(i,s){return i*s},1),fO=sd("round"),mO=_c(function(i,s){return i-s},0);function gO(i){return i&&i.length?Du(i,mn):0}function pO(i,s){return i&&i.length?Du(i,ue(s,2)):0}return y.after=Fk,y.ary=Mp,y.assign=IN,y.assignIn=qp,y.assignInWith=Rc,y.assignWith=SN,y.at=AN,y.before=Dp,y.bind=yd,y.bindAll=PR,y.bindKey=Lp,y.castArray=Jk,y.chain=Rp,y.chunk=iA,y.compact=aA,y.concat=sA,y.cond=MR,y.conforms=DR,y.constant=Sd,y.countBy=gk,y.create=kN,y.curry=xp,y.curryRight=Up,y.debounce=Fp,y.defaults=NN,y.defaultsDeep=RN,y.defer=Bk,y.delay=Vk,y.difference=cA,y.differenceBy=lA,y.differenceWith=uA,y.drop=dA,y.dropRight=hA,y.dropRightWhile=fA,y.dropWhile=mA,y.fill=gA,y.filter=_k,y.flatMap=Ck,y.flatMapDeep=Ek,y.flatMapDepth=wk,y.flatten=Sp,y.flattenDeep=pA,y.flattenDepth=_A,y.flip=Hk,y.flow=xR,y.flowRight=UR,y.fromPairs=vA,y.functions=UN,y.functionsIn=FN,y.groupBy=Tk,y.initial=CA,y.intersection=EA,y.intersectionBy=wA,y.intersectionWith=TA,y.invert=VN,y.invertBy=HN,y.invokeMap=Ik,y.iteratee=Ad,y.keyBy=Sk,y.keys=Mt,y.keysIn=fn,y.map=bc,y.mapKeys=KN,y.mapValues=WN,y.matches=FR,y.matchesProperty=BR,y.memoize=Sc,y.merge=zN,y.mergeWith=jp,y.method=VR,y.methodOf=HR,y.mixin=kd,y.negate=Ac,y.nthArg=KR,y.omit=GN,y.omitBy=qN,y.once=$k,y.orderBy=Ak,y.over=WR,y.overArgs=Kk,y.overEvery=zR,y.overSome=GR,y.partial=Cd,y.partialRight=Bp,y.partition=kk,y.pick=jN,y.pickBy=Yp,y.property=n_,y.propertyOf=qR,y.pull=AA,y.pullAll=kp,y.pullAllBy=kA,y.pullAllWith=NA,y.pullAt=RA,y.range=jR,y.rangeRight=YR,y.rearg=Wk,y.reject=Ok,y.remove=OA,y.rest=zk,y.reverse=_d,y.sampleSize=Mk,y.set=JN,y.setWith=QN,y.shuffle=Dk,y.slice=PA,y.sortBy=Uk,y.sortedUniq=BA,y.sortedUniqBy=VA,y.split=CR,y.spread=Gk,y.tail=HA,y.take=$A,y.takeRight=KA,y.takeRightWhile=WA,y.takeWhile=zA,y.tap=ak,y.throttle=qk,y.thru=Tc,y.toArray=Wp,y.toPairs=Jp,y.toPairsIn=Qp,y.toPath=eO,y.toPlainObject=Gp,y.transform=XN,y.unary=jk,y.union=GA,y.unionBy=qA,y.unionWith=jA,y.uniq=YA,y.uniqBy=JA,y.uniqWith=QA,y.unset=ZN,y.unzip=vd,y.unzipWith=Np,y.update=eR,y.updateWith=tR,y.values=Hi,y.valuesIn=nR,y.without=XA,y.words=e_,y.wrap=Yk,y.xor=ZA,y.xorBy=ek,y.xorWith=tk,y.zip=nk,y.zipObject=rk,y.zipObjectDeep=ok,y.zipWith=ik,y.entries=Jp,y.entriesIn=Qp,y.extend=qp,y.extendWith=Rc,kd(y,y),y.add=nO,y.attempt=t_,y.camelCase=aR,y.capitalize=Xp,y.ceil=rO,y.clamp=rR,y.clone=Qk,y.cloneDeep=Zk,y.cloneDeepWith=eN,y.cloneWith=Xk,y.conformsTo=tN,y.deburr=Zp,y.defaultTo=LR,y.divide=oO,y.endsWith=sR,y.eq=lr,y.escape=cR,y.escapeRegExp=lR,y.every=pk,y.find=vk,y.findIndex=bp,y.findKey=ON,y.findLast=yk,y.findLastIndex=Ip,y.findLastKey=PN,y.floor=iO,y.forEach=Op,y.forEachRight=Pp,y.forIn=MN,y.forInRight=DN,y.forOwn=LN,y.forOwnRight=xN,y.get=Td,y.gt=nN,y.gte=rN,y.has=BN,y.hasIn=bd,y.head=Ap,y.identity=mn,y.includes=bk,y.indexOf=yA,y.inRange=oR,y.invoke=$N,y.isArguments=oi,y.isArray=Ce,y.isArrayBuffer=oN,y.isArrayLike=hn,y.isArrayLikeObject=gt,y.isBoolean=iN,y.isBuffer=ko,y.isDate=aN,y.isElement=sN,y.isEmpty=cN,y.isEqual=lN,y.isEqualWith=uN,y.isError=Ed,y.isFinite=dN,y.isFunction=Zr,y.isInteger=Vp,y.isLength=kc,y.isMap=Hp,y.isMatch=hN,y.isMatchWith=fN,y.isNaN=mN,y.isNative=gN,y.isNil=_N,y.isNull=pN,y.isNumber=$p,y.isObject=lt,y.isObjectLike=dt,y.isPlainObject=Xa,y.isRegExp=wd,y.isSafeInteger=vN,y.isSet=Kp,y.isString=Nc,y.isSymbol=In,y.isTypedArray=Vi,y.isUndefined=yN,y.isWeakMap=CN,y.isWeakSet=EN,y.join=bA,y.kebabCase=uR,y.last=zn,y.lastIndexOf=IA,y.lowerCase=dR,y.lowerFirst=hR,y.lt=wN,y.lte=TN,y.max=aO,y.maxBy=sO,y.mean=cO,y.meanBy=lO,y.min=uO,y.minBy=dO,y.stubArray=Rd,y.stubFalse=Od,y.stubObject=JR,y.stubString=QR,y.stubTrue=XR,y.multiply=hO,y.nth=SA,y.noConflict=$R,y.noop=Nd,y.now=Ic,y.pad=fR,y.padEnd=mR,y.padStart=gR,y.parseInt=pR,y.random=iR,y.reduce=Nk,y.reduceRight=Rk,y.repeat=_R,y.replace=vR,y.result=YN,y.round=fO,y.runInContext=P,y.sample=Pk,y.size=Lk,y.snakeCase=yR,y.some=xk,y.sortedIndex=MA,y.sortedIndexBy=DA,y.sortedIndexOf=LA,y.sortedLastIndex=xA,y.sortedLastIndexBy=UA,y.sortedLastIndexOf=FA,y.startCase=ER,y.startsWith=wR,y.subtract=mO,y.sum=gO,y.sumBy=pO,y.template=TR,y.times=ZR,y.toFinite=eo,y.toInteger=Te,y.toLength=zp,y.toLower=bR,y.toNumber=Gn,y.toSafeInteger=bN,y.toString=Ve,y.toUpper=IR,y.trim=SR,y.trimEnd=AR,y.trimStart=kR,y.truncate=NR,y.unescape=RR,y.uniqueId=tO,y.upperCase=OR,y.upperFirst=Id,y.each=Op,y.eachRight=Pp,y.first=Ap,kd(y,function(){var i={};return kr(y,function(s,u){He.call(y.prototype,u)||(i[u]=s)}),i}(),{chain:!1}),y.VERSION=r,Vn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){y[i].placeholder=y}),Vn(["drop","take"],function(i,s){Re.prototype[i]=function(u){u=u===t?1:At(Te(u),0);var f=this.__filtered__&&!s?new Re(this):this.clone();return f.__filtered__?f.__takeCount__=qt(u,f.__takeCount__):f.__views__.push({size:qt(u,It),type:i+(f.__dir__<0?"Right":"")}),f},Re.prototype[i+"Right"]=function(u){return this.reverse()[i](u).reverse()}}),Vn(["filter","map","takeWhile"],function(i,s){var u=s+1,f=u==yt||u==Gt;Re.prototype[i]=function(_){var E=this.clone();return E.__iteratees__.push({iteratee:ue(_,3),type:u}),E.__filtered__=E.__filtered__||f,E}}),Vn(["head","last"],function(i,s){var u="take"+(s?"Right":"");Re.prototype[i]=function(){return this[u](1).value()[0]}}),Vn(["initial","tail"],function(i,s){var u="drop"+(s?"":"Right");Re.prototype[i]=function(){return this.__filtered__?new Re(this):this[u](1)}}),Re.prototype.compact=function(){return this.filter(mn)},Re.prototype.find=function(i){return this.filter(i).head()},Re.prototype.findLast=function(i){return this.reverse().find(i)},Re.prototype.invokeMap=Ie(function(i,s){return typeof i=="function"?new Re(this):this.map(function(u){return Ga(u,i,s)})}),Re.prototype.reject=function(i){return this.filter(Ac(ue(i)))},Re.prototype.slice=function(i,s){i=Te(i);var u=this;return u.__filtered__&&(i>0||s<0)?new Re(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),s!==t&&(s=Te(s),u=s<0?u.dropRight(-s):u.take(s-i)),u)},Re.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Re.prototype.toArray=function(){return this.take(It)},kr(Re.prototype,function(i,s){var u=/^(?:filter|find|map|reject)|While$/.test(s),f=/^(?:head|last)$/.test(s),_=y[f?"take"+(s=="last"?"Right":""):s],E=f||/^find/.test(s);_&&(y.prototype[s]=function(){var b=this.__wrapped__,S=f?[1]:arguments,M=b instanceof Re,K=S[0],W=M||Ce(b),q=function(Ne){var Oe=_.apply(y,Eo([Ne],S));return f&&ee?Oe[0]:Oe};W&&u&&typeof K=="function"&&K.length!=1&&(M=W=!1);var ee=this.__chain__,ae=!!this.__actions__.length,de=E&&!ee,be=M&&!ae;if(!E&&W){b=be?b:new Re(this);var he=i.apply(b,S);return he.__actions__.push({func:Tc,args:[q],thisArg:t}),new $n(he,ee)}return de&&be?i.apply(this,S):(he=this.thru(q),de?f?he.value()[0]:he.value():he)})}),Vn(["pop","push","shift","sort","splice","unshift"],function(i){var s=Ys[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",f=/^(?:pop|shift)$/.test(i);y.prototype[i]=function(){var _=arguments;if(f&&!this.__chain__){var E=this.value();return s.apply(Ce(E)?E:[],_)}return this[u](function(b){return s.apply(Ce(b)?b:[],_)})}}),kr(Re.prototype,function(i,s){var u=y[s];if(u){var f=u.name+"";He.call(Li,f)||(Li[f]=[]),Li[f].push({name:s,func:u})}}),Li[pc(t,I).name]=[{name:"wrapper",func:t}],Re.prototype.clone=RI,Re.prototype.reverse=OI,Re.prototype.value=PI,y.prototype.at=sk,y.prototype.chain=ck,y.prototype.commit=lk,y.prototype.next=uk,y.prototype.plant=hk,y.prototype.reverse=fk,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=mk,y.prototype.first=y.prototype.head,Ba&&(y.prototype[Ba]=dk),y},Pi=lI();Jo?((Jo.exports=Pi)._=Pi,Au._=Pi):Bt._=Pi}).call(sB)}(is,is.exports)),is.exports}var ka=cB();const hl=aB(ka);function Na(n,e,t=[]){const r=uB(e);if(!r)return n;const o=r.split(" ");return n.filter(a=>lB(a,o,t))}function lB(n,e,t){return t.some(r=>{const o=hl.get(n,r);if(hl.isNil(o))return!1;const a=hl.toString(o).toLowerCase();return e.every(c=>a.includes(c))})}function uB(n){return hl.trim(n).toLowerCase().replace(/\s+/g," ")}const dB={class:"text-faded mt-7"},hB={class:"d-flex align-baseline mb-1"},fB={class:"me-1"},mB={class:"max-w-_form-metadataJ"},gB={key:0,class:"mb-1"},pB={key:1,class:"mb-1"},_B={class:"mb-1"},nu=l.defineComponent({__name:"FormMetadata",props:{meta:{},id:{}},setup(n){const{t:e}=Tr();return(t,r)=>(l.openBlock(),l.createElementBlock("div",dB,[l.createVNode(Je.VRow,{"no-gutters":"",class:"align-end ga-3",align:"center"},{default:l.withCtx(()=>[l.renderSlot(t.$slots,"default"),t.id?(l.openBlock(),l.createBlock(Je.VCol,{key:0,cols:"auto",class:"pa-2"},{default:l.withCtx(()=>[l.createElementVNode("p",hB,[l.createElementVNode("b",fB,l.toDisplayString(t.id.title)+": ",1),l.createElementVNode("span",mB,l.toDisplayString(t.id.key||"-"),1),l.createElementVNode("span",null,[l.createVNode(xl,{"content-to-copy":t.id.key,size:15},null,8,["content-to-copy"])])]),l.createElementVNode("p",null,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.created"))+": ",1),l.createTextVNode(l.toDisplayString(l.unref(cs)(t.meta.created_at))+" - "+l.toDisplayString(t.meta.created_by),1)])]),_:1})):l.createCommentVNode("",!0),l.createVNode(Je.VCol,{cols:"auto",class:"d-flex flex-column align-baseline px-2 mt-1"},{default:l.withCtx(()=>[t.meta.updated_at&&t.meta.updated_by?(l.openBlock(),l.createElementBlock("p",gB,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.updated"))+":  ",1),l.createTextVNode(l.toDisplayString(l.unref(cs)(t.meta.updated_at))+" - "+l.toDisplayString(t.meta.updated_by),1)])):(l.openBlock(),l.createElementBlock("p",pB,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.modified"))+":  ",1),l.createTextVNode(l.toDisplayString(l.unref(cs)(t.meta.modified_at))+" - "+l.toDisplayString(t.meta.modified_by),1)])),l.createElementVNode("p",_B,[l.createElementVNode("b",null,l.toDisplayString(l.unref(e)("forms.metadata.delegated"))+": ",1),l.createTextVNode(l.toDisplayString(t.meta.delegated_at)+" - "+l.toDisplayString(t.meta.delegated_by),1)])]),_:1})]),_:3})]))}}),vB={key:0,class:"mb-2 ms-1"},LE=l.defineComponent({__name:"JSelect",props:{modelValue:{},name:{},label:{},placeholder:{},readonly:{type:Boolean},items:{},itemTitle:{},itemValue:{},density:{},loading:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.computed(()=>t.readonly?"solo":"solo-filled"),a=l.computed(()=>{if(Array.isArray(t.items)&&t.items.length>0)if(typeof t.items[0]=="object"&&t.itemValue&&t.itemTitle){const d=t.items.find(h=>h[t.itemValue]===t.modelValue);return d?d[t.itemTitle]:""}else{const d=t.items.indexOf(t.modelValue);return d!==-1?t.items[d]:""}return""}),c=d=>{r("update:modelValue",d)};return(d,h)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[d.name?(l.openBlock(),l.createElementBlock("p",vB,l.toDisplayString(d.name),1)):l.createCommentVNode("",!0),d.label?(l.openBlock(),l.createBlock(_s.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.label),1)]),_:1})):l.createCommentVNode("",!0),d.readonly?(l.openBlock(),l.createBlock(lE,{key:3,value:a.value},null,8,["value"])):(l.openBlock(),l.createBlock(l.unref(Bo.VSelect),{key:2,modelValue:t.modelValue,"onUpdate:modelValue":[h[0]||(h[0]=m=>t.modelValue=m),c],variant:o.value,items:d.items,"item-title":d.itemTitle,"item-value":d.itemValue,loading:d.loading,placeholder:d.placeholder,density:d.density,"bg-color":"containerBg",rounded:"false","hide-details":"",class:"j-field",clearable:d.clearable},null,8,["modelValue","variant","items","item-title","item-value","loading","placeholder","density","clearable"]))],64))}}),yB={key:0,class:"mb-2 ms-1"},CB={key:3,class:"j-textarea px-4 py-3 rounded-sm bg-containerBg"},xE=l.defineComponent({__name:"JTextArea",props:{modelValue:{},name:{},label:{},readonly:{type:Boolean},rows:{},hideDetails:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.computed(()=>t.readonly?"solo":"solo-filled");return(a,c)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[a.name?(l.openBlock(),l.createElementBlock("p",yB,l.toDisplayString(a.name),1)):l.createCommentVNode("",!0),a.label?(l.openBlock(),l.createBlock(_s.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(a.label),1)]),_:1})):l.createCommentVNode("",!0),a.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(CO.VTextarea,{key:2,variant:o.value,"bg-color":"containerBg",rounded:"false",rows:a.rows,hideDetails:a.hideDetails,value:a.modelValue,"onUpdate:modelValue":c[0]||(c[0]=d=>r("update:modelValue",d)),"no-resize":""},null,8,["variant","rows","hideDetails","value"])),a.readonly?(l.openBlock(),l.createElementBlock("div",CB,l.toDisplayString(a.modelValue),1)):l.createCommentVNode("",!0)],64))}}),UE=l.defineComponent({__name:"CancelButton",props:{title:{}},emits:["cancel"],setup(n,{emit:e}){const t=e,{t:r}=Tr();return(o,a)=>(l.openBlock(),l.createBlock(ot.VBtn,{color:"secondary",variant:"outlined",onClick:a[0]||(a[0]=c=>t("cancel")),class:"me-2 j-btn-form"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(o.title?l.unref(r)("actions.cancel"):l.unref(r)("actions.back")),1)]),_:1}))}}),FE=l.defineComponent({__name:"SaveButton",props:{disabled:{type:Boolean}},emits:["onSave"],setup(n,{emit:e}){const t=e,r=l.ref(!1);async function o(){r.value=!0,await t("onSave"),r.value=!1}const{t:a}=Tr();return(c,d)=>(l.openBlock(),l.createBlock(ot.VBtn,{disabled:c.disabled,loading:r.value,color:"secondary",onClick:o,onKeydown:l.withKeys(o,["enter"]),class:"j-btn-form"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(a)("actions.save")),1)]),_:1},8,["disabled","loading"]))}}),EB={class:"mt-4"},BE=l.defineComponent({__name:"JForm",props:{title:{},metadata:{},id:{},cancelReturn:{type:Boolean}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(Hl,{title:r.title,class:"d-flex flex-column ma-0"},{default:l.withCtx(()=>[r.title?(l.openBlock(),l.createBlock(gi.VDivider,{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",EB,[l.renderSlot(r.$slots,"default")]),l.createVNode(Lt.VCardText,{class:"pa-0 mx-0 align-content-end"},{default:l.withCtx(()=>[l.createVNode(Je.VRow,{justify:"space-between",class:"mt-4"},{default:l.withCtx(()=>[l.createVNode(Je.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:l.withCtx(()=>[l.createVNode(nu,{id:r.id,meta:r.metadata},null,8,["id","meta"])]),_:1}),l.createVNode(Je.VSpacer),l.createVNode(Je.VCol,{cols:"auto",class:"align-content-end"},{default:l.withCtx(()=>[l.createVNode(UE,{"cancel-return":r.cancelReturn,onCancel:o[0]||(o[0]=a=>t("onCancel"))},null,8,["cancel-return"]),l.createVNode(FE,{onOnSave:o[1]||(o[1]=a=>t("onSave"))})]),_:1})]),_:1})]),_:1})]),_:3},8,["title"]))}}),wB={class:"d-flex align-items-center"},TB={key:0,class:"d-flex align-center"},bB={class:"ms-1"},IB={class:"d-flex"},SB={class:"d-flex mb-1 align-center"},AB={class:"min-w-100 relative"},VE=l.defineComponent({__name:"TabFormHeader",props:{id:{},readonly:{type:Boolean,default:!1}},emits:["update:isEdition","save","cancel","delete","disable"],setup(n,{emit:e}){var v;const t=n,r=e,o=l.getCurrentInstance(),a=((v=o==null?void 0:o.vnode.props)==null?void 0:v.onDisable)!==void 0,c=l.ref(t.readonly);function d(){r("cancel"),c.value=!1,r("update:isEdition",c.value)}function h(){c.value=!c.value,r("update:isEdition",c.value)}async function m(){r("delete"),r("disable")}const{t:g}=Tr();return(p,w)=>(l.openBlock(),l.createElementBlock("div",wB,[p.id?(l.openBlock(),l.createElementBlock("div",TB,[w[0]||(w[0]=l.createElementVNode("b",null,"ID:",-1)),l.createElementVNode("span",bB,l.toDisplayString(p.id),1),l.createVNode(xl,{"content-to-copy":p.id,size:20},null,8,["content-to-copy"])])):l.createCommentVNode("",!0),l.createVNode(Je.VSpacer),l.createElementVNode("div",IB,[l.createVNode(ot.VBtn,{onClick:m,variant:"text"},{default:l.withCtx(()=>[a?(l.openBlock(),l.createBlock(l.unref(nP),{key:0,size:"11",class:"me-2"})):(l.openBlock(),l.createBlock(ml.VIcon,{key:1,class:"me-2"},{default:l.withCtx(()=>w[1]||(w[1]=[l.createTextVNode("mdi-delete-outline")])),_:1})),l.createTextVNode(" "+l.toDisplayString(a?l.unref(g)("actions.disable"):l.unref(g)("actions.delete")),1)]),_:1}),l.createElementVNode("div",SB,[l.createVNode(gi.VDivider,{class:"mx-2 my-1",vertical:""}),l.createElementVNode("div",AB,[l.withDirectives(l.createVNode(ot.VBtn,{onClick:h,variant:"text",color:"secondary","prepend-icon":"mdi-pencil",width:"95"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(g)("actions.edit")),1)]),_:1},512),[[l.vShow,!c.value]]),l.withDirectives(l.createVNode(ot.VBtn,{onClick:d,variant:"text",color:"secondary",width:"95"},{default:l.withCtx(()=>[l.createVNode(ml.VIcon,{class:"pt-1 pe-2"},{default:l.withCtx(()=>w[2]||(w[2]=[l.createTextVNode("mdi-close")])),_:1}),l.createTextVNode(" "+l.toDisplayString(l.unref(g)("actions.cancel")),1)]),_:1},512),[[l.vShow,c.value]])])])])]))}}),kB={class:"d-flex flex-column"},NB={class:"height d-flex flex-column"},RB={class:"d-flex justify-between align-end"},OB=l.defineComponent({__name:"FormHeadless",props:{id:{},metadata:{},readonly:{type:Boolean,default:!1}},emits:["save","cancel"],setup(n,{emit:e}){const t=e,r=l.getCurrentInstance(),o=l.computed(()=>{var c;return!!((c=r==null?void 0:r.vnode.props)!=null&&c.onSave)}),a=l.computed(()=>{var c;return!!((c=r==null?void 0:r.vnode.props)!=null&&c.onCancel)});return(c,d)=>(l.openBlock(),l.createBlock(Hl,null,{default:l.withCtx(()=>[l.createElementVNode("div",kB,[l.createElementVNode("div",NB,[l.renderSlot(c.$slots,"default",{},void 0,!0)])]),l.createElementVNode("div",RB,[l.createVNode(Je.VRow,{"no-gutters":"",justify:"space-between",class:"w-100"},{default:l.withCtx(()=>[l.createVNode(Je.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:l.withCtx(()=>[l.createVNode(nu,{id:c.id,meta:c.metadata},null,8,["id","meta"])]),_:1}),c.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Je.VCol,{key:0,class:"d-flex align-end",cols:"auto"},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(UE,{key:0,title:"Back",onCancel:d[0]||(d[0]=h=>t("cancel"))})):l.createCommentVNode("",!0),o.value?(l.openBlock(),l.createBlock(FE,{key:1,onOnSave:d[1]||(d[1]=h=>t("save"))})):l.createCommentVNode("",!0)]),_:1}))]),_:1})])]),_:3}))}}),HE=ba(OB,[["__scopeId","data-v-e7e4d99c"]]);/**
73
73
  * @license @tabler/icons-vue v3.22.0 - MIT
74
74
  *
75
75
  * This source code is licensed under the MIT license.
@@ -110,4 +110,4 @@ Error Description: ${a.errorMessage}`);else{const c=a;this.logger.error(`A non-M
110
110
  Error: ${c.name}
111
111
  Error Description: ${c.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=Qt.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&Me.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==Yf.None){const o=t.tenant?t.tenant:B.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return B.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw j(io)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Aw.has(e)}static isPublicCloudAuthority(e){return B.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const o=new Me(e);o.validateAsUri();const a=o.getUrlComponents();let c=`${t}.${a.HostNameAndPort}`;this.isPublicCloudAuthority(a.HostNameAndPort)&&(c=`${t}.${B.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const d=Me.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return r?`${d}?${r}`:d}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=Qt.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=Qt.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=Qt.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const o=new Me(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(B.CIAM_AUTH_URL)){const a=o.HostNameAndPort.split(".")[0];t=`${t}${a}${B.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}Qt.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Vo.COMMON,Vo.CONSUMERS,Vo.ORGANIZATIONS]);function g2(n){var o;const r=(o=new Me(n).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case Vo.COMMON:case Vo.ORGANIZATIONS:case Vo.CONSUMERS:return;default:return r}}function Ow(n){return n.endsWith(B.FORWARD_SLASH)?n:`${n}${B.FORWARD_SLASH}`}function p2(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw Qe(Zf)}return{canonicalAuthority:n.authority?Ow(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.16.0 2024-11-05 */async function Pw(n,e,t,r,o,a,c){c==null||c.addQueueMeasurement(x.AuthorityFactoryCreateDiscoveredInstance,a);const d=Qt.transformCIAMAuthority(Ow(n)),h=new Qt(d,e,t,r,o,a,c);try{return await J(h.resolveEndpointsAsync.bind(h),x.AuthorityResolveEndpointsAsync,o,c,a)(),h}catch{throw j(io)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Ko extends ct{constructor(e,t,r,o,a){super(e,t,r),this.name="ServerError",this.errorNo=o,this.status=a,Object.setPrototypeOf(this,Ko.prototype)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class xr{static generateThrottlingStorageKey(e){return`${gs.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var a;const r=xr.generateThrottlingStorageKey(t),o=e.getThrottlingCache(r);if(o){if(o.throttleTime<Date.now()){e.removeItem(r);return}throw new Ko(((a=o.errorCodes)==null?void 0:a.join(" "))||B.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,t,r){if(xr.checkResponseStatus(r)||xr.checkResponseForRetryAfter(r)){const o={throttleTime:xr.calculateThrottleTime(parseInt(r.headers[un.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(xr.generateThrottlingStorageKey(t),o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(un.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(t||gs.DEFAULT_THROTTLE_TIME_SECONDS),r+gs.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,r,o){const a={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:o,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},c=this.generateThrottlingStorageKey(a);e.removeItem(c)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class cu extends ct{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,cu.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function Jv(n,e,t){return new cu(n,e,t)}/*! @azure/msal-common v14.16.0 2024-11-05 */class am{constructor(e,t){this.config=SV(e),this.logger=new $o(this.config.loggerOptions,sw,jf),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[un.CONTENT_TYPE]=B.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Un.HOME_ACCOUNT_ID:try{const r=da(e.credential);t[un.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Un.UPN:t[un.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,r,o,a,c){var h;c&&((h=this.performanceClient)==null||h.addQueueMeasurement(c,a));const d=await this.sendPostRequest(o,e,{body:t,headers:r},a);return this.config.serverTelemetryManager&&d.status<500&&d.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),d}async sendPostRequest(e,t,r,o){var c,d,h;xr.preProcess(this.cacheManager,e);let a;try{a=await J(this.networkClient.sendPostRequestAsync.bind(this.networkClient),x.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(t,r);const m=a.headers||{};(d=this.performanceClient)==null||d.addFields({refreshTokenSize:((c=a.body.refresh_token)==null?void 0:c.length)||0,httpVerToken:m[un.X_MS_HTTP_VERSION]||"",requestId:m[un.X_MS_REQUEST_ID]||""},o)}catch(m){if(m instanceof cu){const g=m.responseHeaders;throw g&&((h=this.performanceClient)==null||h.addFields({httpVerToken:g[un.X_MS_HTTP_VERSION]||"",requestId:g[un.X_MS_REQUEST_ID]||"",contentTypeHeader:g[un.CONTENT_TYPE]||void 0,contentLengthHeader:g[un.CONTENT_LENGTH]||void 0,httpStatus:m.httpStatus},o)),m.error}throw m instanceof ct?m:j(GE)}return xr.postProcess(this.cacheManager,e,a),a}async updateAuthority(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,o=await Pw(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const t=new ps(e.correlationId,this.performanceClient);return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.addCorrelationId(e.correlationId),t.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Pl="no_tokens_found",Mw="native_account_unavailable",sm="refresh_token_expired",_2="interaction_required",v2="consent_required",y2="login_required",lu="bad_token";/*! @azure/msal-common v14.16.0 2024-11-05 */const Qv=[_2,v2,y2,lu],C2=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],E2={[Pl]:"No refresh token found in the cache. Please sign-in.",[Mw]:"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.",[sm]:"Refresh token has expired.",[lu]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class Cr extends ct{constructor(e,t,r,o,a,c,d,h){super(e,t,r),Object.setPrototypeOf(this,Cr.prototype),this.timestamp=o||B.EMPTY_STRING,this.traceId=a||B.EMPTY_STRING,this.correlationId=c||B.EMPTY_STRING,this.claims=d||B.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=h}}function Xv(n,e,t){const r=!!n&&Qv.indexOf(n)>-1,o=!!t&&C2.indexOf(t)>-1,a=!!e&&Qv.some(c=>e.indexOf(c)>-1);return r||a||o}function Xh(n){return new Cr(n,E2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class vr{static setRequestState(e,t,r){const o=vr.generateLibraryState(e,r);return t?`${o}${B.RESOURCE_DELIM}${t}`:o}static generateLibraryState(e,t){if(!e)throw j(qh);const r={id:e.createNewGuid()};t&&(r.meta=t);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,t){if(!e)throw j(qh);if(!t)throw j(Ca);try{const r=t.split(B.RESOURCE_DELIM),o=r[0],a=r.length>1?r.slice(1).join(B.RESOURCE_DELIM):B.EMPTY_STRING,c=e.base64Decode(o),d=JSON.parse(c);return{userRequestState:a||B.EMPTY_STRING,libraryState:d}}catch{throw j(Ca)}}}/*! @azure/msal-common v14.16.0 2024-11-05 */const w2={SW:"sw",UHW:"uhw"};class wa{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.PopTokenGenerateCnf,e.correlationId);const r=await J(this.generateKid.bind(this),x.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(x.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:w2.SW}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,o){const{resourceRequestMethod:a,resourceRequestUri:c,shrClaims:d,shrNonce:h,shrOptions:m}=r,g=c?new Me(c):void 0,v=g==null?void 0:g.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Wr(),m:a==null?void 0:a.toUpperCase(),u:v==null?void 0:v.HostNameAndPort,nonce:h||this.cryptoUtils.createNewGuid(),p:v==null?void 0:v.AbsolutePath,q:v!=null&&v.QueryString?[[],v.QueryString]:void 0,client_claims:d||void 0,...o},t,m,r.correlationId)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class T2{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.16.0 2024-11-05 */function b2(n){var r,o;const e="code=",t=(r=n.error_uri)==null?void 0:r.lastIndexOf(e);return t&&t>=0?(o=n.error_uri)==null?void 0:o.substring(t+e.length):void 0}class wi{constructor(e,t,r,o,a,c,d){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=a,this.persistencePlugin=c,this.performanceClient=d}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?j(Sl,"Cached State"):j(Sl,"Server State");let r,o;try{r=decodeURIComponent(e.state)}catch{throw j(Ca,e.state)}try{o=decodeURIComponent(t)}catch{throw j(Ca,e.state)}if(r!==o)throw j(YE);if(e.error||e.error_description||e.suberror){const a=b2(e);throw Xv(e.error,e.error_description,e.suberror)?new Cr(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",a):new Ko(e.error||"",e.error_description,e.suberror,a)}}validateTokenResponse(e,t){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||B.NOT_AVAILABLE} - Timestamp: ${e.timestamp||B.NOT_AVAILABLE} - Description: ${e.error_description||B.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||B.NOT_AVAILABLE} - Trace ID: ${e.trace_id||B.NOT_AVAILABLE}`,a=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,c=new Ko(e.error,o,e.suberror,a,e.status);if(t&&e.status&&e.status>=Vc.SERVER_ERROR_RANGE_START&&e.status<=Vc.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
112
112
  ${c}`);return}else if(t&&e.status&&e.status>=Vc.CLIENT_ERROR_RANGE_START&&e.status<=Vc.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
113
- ${c}`);return}throw Xv(e.error,e.error_description,e.suberror)?new Cr(e.error,e.error_description,e.suberror,e.timestamp||B.EMPTY_STRING,e.trace_id||B.EMPTY_STRING,e.correlation_id||B.EMPTY_STRING,e.claims||B.EMPTY_STRING,a):c}}async handleServerTokenResponse(e,t,r,o,a,c,d,h,m){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(x.HandleServerTokenResponse,e.correlation_id);let g;if(e.id_token){if(g=Ii(e.id_token||B.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&g.nonce!==a.nonce)throw j(JE);if(o.maxAge||o.maxAge===0){const T=g.auth_time;if(!T)throw j(Wf);cw(T,o.maxAge)}}this.homeAccountIdentifier=Ot.generateHomeAccountId(e.client_info||B.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,g);let v;a&&a.state&&(v=vr.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,g,c,a);let w;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),w=new T2(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(w)),d&&!h&&p.account){const T=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(T,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await wi.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,void 0,m)}await this.cacheStorage.saveCacheRecord(p,o.storeInCache,o.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&w&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(w))}return wi.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,e,m)}generateCacheRecord(e,t,r,o,a,c,d){const h=t.getPreferredCache();if(!h)throw j(Gf);const m=bw(a);let g,v;e.id_token&&a&&(g=ou(this.homeAccountIdentifier,h,e.id_token,this.clientId,m||""),v=cm(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,a,e.client_info,h,m,d,void 0,this.logger));let p=null;if(e.access_token){const T=e.scope?_t.fromString(e.scope):new _t(o.scopes||[]),k=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,I=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,N=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,O=r+k,L=O+I,$=N&&N>0?r+N:void 0;p=iu(this.homeAccountIdentifier,h,e.access_token,this.clientId,m||t.tenant||"",T.printScopes(),O,L,this.cryptoObj.base64Decode,$,e.token_type,c,e.key_id,o.claims,o.requestedClaimsHash)}let w=null;if(e.refresh_token){let T;if(e.refresh_token_expires_in){const k=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;T=r+k}w=lw(this.homeAccountIdentifier,h,e.refresh_token,this.clientId,e.foci,c,T)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:h,familyId:e.foci}),{account:v,idToken:g,accessToken:p,refreshToken:w,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,a,c,d,h,m){var O,L,$,G,D;let g=B.EMPTY_STRING,v=[],p=null,w,C,T=B.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===ze.POP&&!a.popKid){const se=new wa(e),{secret:ie,keyId:Q}=r.accessToken;if(!Q)throw j(qf);g=await se.signPopToken(ie,Q,a)}else g=r.accessToken.secret;v=_t.fromString(r.accessToken.target).asArray(),p=new Date(Number(r.accessToken.expiresOn)*1e3),w=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(T=r.appMetadata.familyId===ms?ms:"");const k=(c==null?void 0:c.oid)||(c==null?void 0:c.sub)||"",I=(c==null?void 0:c.tid)||"";h!=null&&h.spa_accountid&&r.account&&(r.account.nativeAccountId=h==null?void 0:h.spa_accountid);const N=r.account?nm(r.account.getAccountInfo(),void 0,c,(O=r.idToken)==null?void 0:O.secret):null;return{authority:t.canonicalAuthority,uniqueId:k,tenantId:I,scopes:v,account:N,idToken:((L=r==null?void 0:r.idToken)==null?void 0:L.secret)||"",idTokenClaims:c||{},accessToken:g,fromCache:o,expiresOn:p,extExpiresOn:w,refreshOn:C,correlationId:a.correlationId,requestId:m||B.EMPTY_STRING,familyId:T,tokenType:(($=r.accessToken)==null?void 0:$.tokenType)||B.EMPTY_STRING,state:d?d.userRequestState:B.EMPTY_STRING,cloudGraphHostName:((G=r.account)==null?void 0:G.cloudGraphHostName)||B.EMPTY_STRING,msGraphHost:((D=r.account)==null?void 0:D.msGraphHost)||B.EMPTY_STRING,code:h==null?void 0:h.spa_code,fromNativeBroker:!1}}}function cm(n,e,t,r,o,a,c,d,h,m,g){g==null||g.verbose("setCachedAccount called");const p=n.getAccountKeys().find(I=>I.startsWith(t));let w=null;p&&(w=n.getAccount(p,g));const C=w||Ot.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:a,environment:c,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:m},e,r),T=C.tenantProfiles||[],k=d||C.realm;if(k&&!T.find(I=>I.tenantId===k)){const I=tm(t,C.localAccountId,k,o);T.push(I)}return C.tenantProfiles=T,C}/*! @azure/msal-common v14.16.0 2024-11-05 */async function Dw(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class Lw extends am{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(x.GetAuthCodeUrl,e.correlationId);const t=await J(this.createAuthCodeUrlQueryString.bind(this),x.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return Me.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,h;if((d=this.performanceClient)==null||d.addQueueMeasurement(x.AuthClientAcquireToken,e.correlationId),!e.code)throw j(ZE);const r=Wr(),o=await J(this.executeTokenRequest.bind(this),x.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(h=o.headers)==null?void 0:h[un.X_MS_REQUEST_ID],c=new wi(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(o.body),J(c.handleServerTokenResponse.bind(c),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,a)}handleFragmentResponse(e,t){if(new wi(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw j(ow);return e}getLogoutUri(e){if(!e)throw Qe(pw);const t=this.createLogoutUrlQueryString(e);return Me.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var m,g;(m=this.performanceClient)==null||m.addQueueMeasurement(x.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=Me.appendQueryString(e.tokenEndpoint,r),a=await J(this.createTokenRequestBody.bind(this),x.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let c;if(t.clientInfo)try{const v=kl(t.clientInfo,this.cryptoUtils.base64Decode);c={credential:`${v.uid}${en.CLIENT_INFO_SEPARATOR}${v.utid}`,type:Un.HOME_ACCOUNT_ID}}catch(v){this.logger.verbose("Could not parse client info for CCS Header: "+v)}const d=this.createTokenRequestHeaders(c||t.ccsCredential),h={clientId:((g=t.tokenBodyParameters)==null?void 0:g.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return J(this.executePostToTokenEndpoint.bind(this),x.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,a,d,h,t.correlationId,x.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement(x.AuthClientCreateTokenRequestBody,e.correlationId);const t=new ps(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[Ei])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):ra.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Jh(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Dw(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(c.assertionType)}if(t.addGrantType($E.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===ze.POP){const c=new wa(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await J(c.generateCnf.bind(c),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===ze.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Qe(au);(!_r.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const c=kl(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${c.uid}${en.CLIENT_INFO_SEPARATOR}${c.utid}`,type:Un.HOME_ACCOUNT_ID}}catch(c){this.logger.verbose("Could not parse client info for CCS Header: "+c)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Un.HOME_ACCOUNT_ID:try{const c=da(r.credential);t.addCcsOid(c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case Un.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Yv])&&t.addExtraQueryParameters({[Yv]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var a,c;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(a=this.performanceClient)==null||a.addQueueMeasurement(x.AuthClientCreateQueryString,t);const r=new ps(t,this.performanceClient);r.addClientId(e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[Ei])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Jh(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==Ut.SELECT_ACCOUNT)if(e.sid&&e.prompt===Ut.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let h=this.extractLoginHint(e.account);if(h&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),h=null),h){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(h);try{const m=da(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===Ut.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(d);try{const m=da(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const m=da(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===ze.POP)){const d=new wa(this.cryptoUtils);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await J(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new ps(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const I2=300;class Zh extends am{constructor(e,t){super(e,t)}async acquireToken(e){var c,d;(c=this.performanceClient)==null||c.addQueueMeasurement(x.RefreshTokenClientAcquireToken,e.correlationId);const t=Wr(),r=await J(this.executeTokenRequest.bind(this),x.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(d=r.headers)==null?void 0:d[un.X_MS_REQUEST_ID],a=new wi(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),J(a.handleServerTokenResponse.bind(a),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Qe(gw);if((r=this.performanceClient)==null||r.addQueueMeasurement(x.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw j(zf);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await J(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof Cr&&o.errorCode===Pl,c=o instanceof Ko&&o.errorCode===Lv.INVALID_GRANT_ERROR&&o.subError===Lv.CLIENT_MISMATCH_ERROR;if(a||c)return J(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return J(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=Si(this.cacheManager.getRefreshToken.bind(this.cacheManager),x.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw Xh(Pl);if(r.expiresOn&&Yh(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||I2))throw Xh(sm);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||ze.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Un.HOME_ACCOUNT_ID}};try{return await J(this.acquireToken.bind(this),x.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof Cr&&c.subError===lu){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ua(r);this.cacheManager.removeRefreshToken(d)}throw c}}async executeTokenRequest(e,t){var h,m;(h=this.performanceClient)==null||h.addQueueMeasurement(x.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=Me.appendQueryString(t.tokenEndpoint,r),a=await J(this.createTokenRequestBody.bind(this),x.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),c=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((m=e.tokenBodyParameters)==null?void 0:m.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return J(this.executePostToTokenEndpoint.bind(this),x.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,c,d,e.correlationId,x.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a,c;(o=this.performanceClient)==null||o.addQueueMeasurement(x.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new ps(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[Ei])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(c=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),r.addGrantType($E.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Jh(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await Dw(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===ze.POP){const d=new wa(this.cryptoUtils,this.performanceClient);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await J(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}else if(e.authenticationScheme===ze.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw Qe(au);if((!_r.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Un.HOME_ACCOUNT_ID:try{const d=da(e.ccsCredential.credential);r.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case Un.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class S2 extends am{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Ra]});return o===Po.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Zh(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof ru&&r.errorCode===so)return new Zh(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var h;(h=this.performanceClient)==null||h.addQueueMeasurement(x.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Po.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!_r.isEmptyObj(e.claims))throw this.setCacheOutcome(Po.FORCE_REFRESH_OR_CLAIMS,e.correlationId),j(so);if(!e.account)throw j(zf);const r=e.account.tenantId||g2(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(a){if(tV(a.cachedAt)||Yh(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Po.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),j(so);a.refreshOn&&Yh(a.refreshOn,0)&&(t=Po.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Po.NO_CACHED_ACCESS_TOKEN,e.correlationId),j(so);const c=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await J(this.generateResultFromCacheRecord.bind(this),x.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==Po.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(x.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Ii(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw j(Wf);cw(a,t.maxAge)}return wi.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const A2={sendGetRequestAsync:()=>Promise.reject(j(Se)),sendPostRequestAsync:()=>Promise.reject(j(Se))};/*! @azure/msal-common v14.16.0 2024-11-05 */const Zv=",",xw="|";function k2(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:a}=n,c=new Map([[0,[t,r]],[2,[o,a]]]);let d=[];if(e!=null&&e.length){if(d=e.split(Zv),d.length<4)return e}else d=Array.from({length:4},()=>xw);return c.forEach((h,m)=>{var g,v;h.length===2&&((g=h[0])!=null&&g.length)&&((v=h[1])!=null&&v.length)&&N2({skuArr:d,index:m,skuName:h[0],skuVersion:h[1]})}),d.join(Zv)}function N2(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(xw))}class Ns{constructor(e,t){this.cacheOutcome=Po.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||B.EMPTY_STRING,this.wrapperVer=e.wrapperVer||B.EMPTY_STRING,this.telemetryCacheKey=Kt.CACHE_KEY+en.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Kt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(Kt.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),c=[e,a].join(Kt.VALUE_SEPARATOR);return[Kt.SCHEMA_VERSION,c,o].join(Kt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Ns.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Kt.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(Kt.VALUE_SEPARATOR),a=e.errors.length,c=t<a?Kt.OVERFLOW_TRUE:Kt.OVERFLOW_FALSE,d=[a,c].join(Kt.VALUE_SEPARATOR);return[Kt.SCHEMA_VERSION,e.cacheHits,r,o,d].join(Kt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Kt.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof ct?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Kt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=Ns.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const a=e.errors.length;for(t=0;t<a;t++){const c=e.failedRequests[2*t]||B.EMPTY_STRING,d=e.failedRequests[2*t+1]||B.EMPTY_STRING,h=e.errors[t]||B.EMPTY_STRING;if(o+=c.toString().length+d.toString().length+h.length+3,o<Kt.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||B.EMPTY_STRING),e.push(this.regionSource||B.EMPTY_STRING),e.push(this.regionOutcome||B.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return k2(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Uw="missing_kid_error",Fw="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const R2={[Uw]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Fw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class lm extends ct{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,lm.prototype)}}function ey(n){return new lm(n,R2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class um{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw ey(Uw);if(!e.alg)throw ey(Fw);const t=new um({typ:e.typ||BB.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class ty{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class O2{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:m2.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new ty}}startPerformanceMeasurement(){return new ty}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dm="pkce_not_created",ef="crypto_nonexistent",uu="empty_navigate_uri",Bw="hash_empty_error",hm="no_state_in_hash",Vw="hash_does_not_contain_known_properties",Hw="unable_to_parse_state",$w="state_interaction_type_mismatch",Kw="interaction_in_progress",Ww="popup_window_error",zw="empty_window_error",Ti="user_cancelled",P2="monitor_popup_timeout",Gw="monitor_window_timeout",qw="redirect_in_iframe",jw="block_iframe_reload",Yw="block_nested_popups",M2="iframe_closed_prematurely",du="silent_logout_unsupported",Jw="no_account_error",D2="silent_prompt_value_error",Qw="no_token_request_cache_error",Xw="unable_to_parse_token_request_cache_error",fm="no_cached_authority_error",L2="auth_request_not_set_error",x2="invalid_cache_type",hu="non_browser_environment",oa="database_not_open",Ml="no_network_connectivity",Zw="post_request_failed",eT="get_request_failed",tf="failed_to_parse_response",tT="unable_to_load_token",mm="crypto_key_not_found",nT="auth_code_required",rT="auth_code_or_nativeAccountId_required",oT="spa_code_and_nativeAccountId_present",gm="database_unavailable",iT="unable_to_acquire_token_from_native_platform",aT="native_handshake_timeout",sT="native_extension_not_installed",Hs="native_connection_not_established",cT="uninitialized_public_client_application",lT="native_prompt_not_supported",uT="invalid_base64_string",dT="invalid_pop_token_request",hT="failed_to_build_headers",fT="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const oo="For more visit: aka.ms/msaljs/browser-errors",U2={[dm]:"The PKCE code challenge and verifier could not be generated.",[ef]:"The crypto object or function is not available.",[uu]:"Navigation URI is empty. Please check stack trace for more info.",[Bw]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${oo}`,[hm]:"Hash does not contain state. Please verify that the request originated from msal.",[Vw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${oo}`,[Hw]:"Unable to parse state. Please verify that the request originated from msal.",[$w]:"Hash contains state but the interaction type does not match the caller.",[Kw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${oo}`,[Ww]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[zw]:"window.open returned null or undefined window object.",[Ti]:"User cancelled the flow.",[P2]:`Token acquisition in popup failed due to timeout. ${oo}`,[Gw]:`Token acquisition in iframe failed due to timeout. ${oo}`,[qw]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[jw]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${oo}`,[Yw]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[M2]:"The iframe being monitored was closed prematurely.",[du]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Jw]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[D2]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Qw]:"No token request found in cache.",[Xw]:"The cached token request could not be parsed.",[fm]:"No cached authority found.",[L2]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[x2]:"Invalid cache type",[hu]:"Login and token requests are not supported in non-browser environments.",[oa]:"Database is not open!",[Ml]:"No network connectivity. Check your internet connection.",[Zw]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[eT]:"Network request failed. Please check the network trace to determine root cause.",[tf]:"Failed to parse network response. Check network trace.",[tT]:"Error loading token to cache.",[mm]:"Cryptographic Key or Keypair not found in browser storage.",[nT]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[rT]:"An authorization code or nativeAccountId must be provided to this flow.",[oT]:"Request cannot contain both spa code and native account id.",[gm]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[iT]:`Unable to acquire token from native platform. ${oo}`,[aT]:"Timed out while attempting to establish connection to browser extension",[sT]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Hs]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${oo}`,[cT]:`You must call and await the initialize function before attempting to call any other MSAL API. ${oo}`,[lT]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[uT]:"Invalid base64 encoded string.",[dT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[hT]:"Failed to build request headers object.",[fT]:"Failed to parse response headers"};class $s extends ct{constructor(e,t){super(e,U2[e],t),Object.setPrototypeOf(this,$s.prototype),this.name="BrowserAuthError"}}function oe(n,e){return new $s(n,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Mn={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ha={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},mi={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},_n={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},ny={GET:"GET",POST:"POST"},$e={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Oo={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},zc={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},rt={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var ce;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(ce||(ce={}));const ry={scopes:Ra},mT="jwk",nf="msal.db",F2=1,B2=`${nf}.keys`,On={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},V2=[On.Default,On.Skip,On.RefreshTokenAndNetwork],H2="msal.browser.log.level",$2="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Gc(n){return encodeURIComponent(pm(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function fu(n){return gT(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function pm(n){return gT(new TextEncoder().encode(n))}function gT(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const K2="RSASSA-PKCS1-v1_5",pT="SHA-256",W2=2048,z2=new Uint8Array([1,0,1]),oy="0123456789abcdef",iy=new Uint32Array(1),G2="crypto_subtle_undefined",_m={name:K2,hash:pT,modulusLength:W2,publicExponent:z2};function q2(n){if(!window)throw oe(hu);if(!window.crypto)throw oe(ef);if(!n&&!window.crypto.subtle)throw oe(ef,G2)}async function _T(n,e,t){e==null||e.addQueueMeasurement(x.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(pT,o)}function j2(n){return window.crypto.getRandomValues(n)}function ih(){return window.crypto.getRandomValues(iy),iy[0]}function mo(){const n=Date.now(),e=ih()*1024+(ih()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=ih();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=a>>>24,t[13]=a>>>16,t[14]=a>>>8,t[15]=a;let c="";for(let d=0;d<t.length;d++)c+=oy.charAt(t[d]>>>4),c+=oy.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(c+="-");return c}async function Y2(n,e){return window.crypto.subtle.generateKey(_m,n,e)}async function ah(n){return window.crypto.subtle.exportKey(mT,n)}async function J2(n,e,t){return window.crypto.subtle.importKey(mT,n,_m,e,t)}async function Q2(n,e){return window.crypto.subtle.sign(_m,n,e)}async function vT(n){const e=await _T(n),t=new Uint8Array(e);return fu(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Rs="storage_not_supported",rf="stubbed_public_client_application_called",Dl="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const fl={[Rs]:"Given storage configuration option was not supported.",[rf]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[Dl]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};fl[Rs],fl[rf],fl[Dl];class vm extends ct{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,vm.prototype)}}function ym(n){return new vm(n,fl[n])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function X2(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function Z2(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Cm(){return window.parent!==window}function eH(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Mn.POPUP_NAME_PREFIX}.`)===0}function co(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function tH(){const e=new Me(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function nH(){if(Me.hashContainsKnownProperties(window.location.hash)&&Cm())throw oe(jw)}function rH(n){if(Cm()&&!n)throw oe(qw)}function oH(){if(eH())throw oe(Yw)}function yT(){if(typeof window>"u")throw oe(hu)}function CT(n){if(!n)throw oe(cT)}function Em(n){yT(),nH(),oH(),CT(n)}function ay(n,e){if(Em(n),rH(e.system.allowRedirectInIframe),e.cache.cacheLocation===_n.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw ym(Dl)}function ET(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function iH(){return mo()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ll{navigateInternal(e,t){return Ll.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Ll.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class aH{async sendGetRequestAsync(e,t){let r,o={},a=0;const c=sy(t);try{r=await fetch(e,{method:ny.GET,headers:c})}catch{throw oe(window.navigator.onLine?eT:Ml)}o=cy(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch{throw Jv(oe(tf),a,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=sy(t);let a,c=0,d={};try{a=await fetch(e,{method:ny.POST,headers:o,body:r})}catch{throw oe(window.navigator.onLine?Zw:Ml)}d=cy(a.headers);try{return c=a.status,{headers:d,body:await a.json(),status:c}}catch{throw Jv(oe(tf),c,d)}}}function sy(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw oe(hT)}}function cy(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw oe(fT)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const sH=6e4,of=1e4,cH=3e4,lH=2e3;function uH({auth:n,cache:e,system:t,telemetry:r},o){const a={clientId:B.EMPTY_STRING,authority:`${B.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:B.EMPTY_STRING,authorityMetadata:B.EMPTY_STRING,redirectUri:typeof window<"u"?co():"",postLogoutRedirectUri:B.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:ho.AAD,OIDCOptions:{serverResponseType:Vs.FRAGMENT,defaultScopes:[B.OPENID_SCOPE,B.PROFILE_SCOPE,B.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Yf.None,tenant:B.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},c={cacheLocation:_n.SessionStorage,temporaryCacheLocation:_n.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===_n.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:et.Info,piiLoggingEnabled:!1},m={...{...Nw,loggerOptions:d,networkClient:o?new aH:A2,navigationClient:new Ll,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||sH,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||of,navigateFrameWait:0,redirectNavigationTimeout:cH,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||lH,pollIntervalMilliseconds:Mn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},g={application:{appName:B.EMPTY_STRING,appVersion:B.EMPTY_STRING},client:new O2};if((n==null?void 0:n.protocolMode)!==ho.OIDC&&(n!=null&&n.OIDCOptions)&&new $o(m.loggerOptions).warning(JSON.stringify(Qe(Ew))),n!=null&&n.protocolMode&&n.protocolMode!==ho.AAD&&(m!=null&&m.allowNativeBroker))throw Qe(ww);return{auth:{...a,...n,OIDCOptions:{...a.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...c,...e},system:m,telemetry:{...g,...r}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dH="@azure/msal-browser",mu="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class wm{static loggerCallback(e,t){switch(e){case et.Error:console.error(t);return;case et.Info:console.info(t);return;case et.Verbose:console.debug(t);return;case et.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var h;this.browserEnvironment=typeof window<"u",this.config=uH(e,this.browserEnvironment);let t;try{t=window[_n.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(H2),o=(h=t==null?void 0:t.getItem($2))==null?void 0:h.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,c={...this.config.system.loggerOptions},d=r&&Object.keys(et).includes(r)?et[r]:void 0;d&&(c.loggerCallback=wm.loggerCallback,c.logLevel=d),a!==void 0&&(c.piiLoggingEnabled=a),this.logger=new $o(c,dH,mu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class bi extends wm{getModuleName(){return bi.MODULE_NAME}getId(){return bi.ID}async initialize(){return this.available=typeof window<"u",this.available}}bi.MODULE_NAME="";bi.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function $r(n){return new TextDecoder().decode(hH(n))}function hH(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw oe(uT)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fH{constructor(){this.dbName=nf,this.version=F2,this.tableName=B2,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(oe(gm)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(oe(oa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(oe(oa));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),r()}),d.addEventListener("error",h=>{this.closeConnection(),o(h)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(oe(oa));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);c.addEventListener("success",()=>{this.closeConnection(),t()}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(oe(oa));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",c=>{const d=c;this.closeConnection(),e(d.target.result)}),a.addEventListener("error",c=>{this.closeConnection(),t(c)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(oe(oa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result===1)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(nf),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class af{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class mH{constructor(e){this.inMemoryCache=new af,this.indexedDBCache=new fH,this.logger=e}handleDatabaseAccessError(e){if(e instanceof $s&&e.errorCode===gm)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ta{constructor(e,t,r){this.logger=e,q2(r??!1),this.cache=new mH(this.logger),this.performanceClient=t}createNewGuid(){return mo()}base64Encode(e){return pm(e)}base64Decode(e){return $r(e)}base64UrlEncode(e){return Gc(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var g;const t=(g=this.performanceClient)==null?void 0:g.startMeasurement(x.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Y2(Ta.EXTRACTABLE,Ta.POP_KEY_USAGES),o=await ah(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},c=ly(a),d=await this.hashString(c),h=await ah(r.privateKey),m=await J2(h,!1,["sign"]);return await this.cache.setItem(d,{privateKey:m,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var O;const a=(O=this.performanceClient)==null?void 0:O.startMeasurement(x.CryptoOptsSignJwt,o),c=await this.cache.getItem(t);if(!c)throw oe(mm);const d=await ah(c.publicKey),h=ly(d),m=Gc(JSON.stringify({kid:t})),g=um.getShrHeaderString({...r==null?void 0:r.header,alg:d.alg,kid:m}),v=Gc(g);e.cnf={jwk:JSON.parse(h)};const p=Gc(JSON.stringify(e)),w=`${v}.${p}`,T=new TextEncoder().encode(w),k=await Q2(c.privateKey,T),I=fu(new Uint8Array(k)),N=`${w}.${I}`;return a&&a.end({success:!0}),N}async hashString(e){return vT(e)}}Ta.POP_KEY_USAGES=["sign","verify"];Ta.EXTRACTABLE=!0;function ly(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class gH{constructor(){if(!window.localStorage)throw ym(Rs)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class pH{constructor(){if(!window.sessionStorage)throw ym(Rs)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function wT(n,e){if(!e)return null;try{return vr.parseRequestState(n,e).libraryState.meta}catch{throw j(Ca)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const _H=24*60*60*1e3;class vH{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[c,...d]=decodeURIComponent(a).trim().split("="),h=d.join("=");if(c===t)return h}return""}setItem(e,t,r,o=!0){let a=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){const c=yH(r);a+=`expires=${c};`}o&&(a+="Secure;"),document.cookie=a}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function yH(n){const e=new Date;return new Date(e.getTime()+n*_H).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class sf extends Ea{constructor(e,t,r,o,a,c){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new af,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new vH,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=c}setupBrowserStorage(e){try{switch(e){case _n.LocalStorage:return new gH;case _n.SessionStorage:return new pH;case _n.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=_n.MemoryStorage,new af}migrateCacheEntries(){const e=`${B.CACHE_PREFIX}.${Dt.ID_TOKEN}`,t=`${B.CACHE_PREFIX}.${Dt.CLIENT_INFO}`,r=`${B.CACHE_PREFIX}.${Dt.ERROR}`,o=`${B.CACHE_PREFIX}.${Dt.ERROR_DESC}`,a=this.browserStorage.getItem(e),c=this.browserStorage.getItem(t),d=this.browserStorage.getItem(r),h=this.browserStorage.getItem(o),m=[a,c,d,h];[Dt.ID_TOKEN,Dt.CLIENT_INFO,Dt.ERROR,Dt.ERROR_DESC].forEach((v,p)=>{const w=m[p];w&&this.setTemporaryCache(v,w,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Oo.ACCOUNT_KEYS),t=this.getItem(`${Oo.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(o=>{if(this.isCredentialKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);if(c&&c.hasOwnProperty("credentialType"))switch(c.credentialType){case me.ID_TOKEN:if(Vv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,me.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${o}`);break;case me.ACCESS_TOKEN:case me.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Bv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,me.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${o}`);break;case me.REFRESH_TOKEN:if(Hv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,me.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${o}`);break}}}if(this.isAccountKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);c&&Ot.isAccountEntity(c)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${o} found, saving key to account key map`),this.addAccountKeyToMap(o))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!Ot.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):Ea.toObject(new Ot,r)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Oo.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(Oo.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(Oo.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,me.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,me.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,me.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Oo.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case me.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case me.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case me.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),j(jh)}this.setItem(`${Oo.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case me.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case me.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const a=r.accessToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case me.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const c=r.refreshToken.indexOf(e);c>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(c,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),j(jh)}this.setItem(`${Oo.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Vv(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ua(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,me.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Bv(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ua(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,me.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Hv(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ua(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,me.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!uV(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=lV(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!sV(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&dV(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(zc.WRAPPER_SKU,e),this.internalStorage.setItem(zc.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(zc.WRAPPER_SKU)||B.EMPTY_STRING,t=this.internalStorage.getItem(zc.WRAPPER_VER)||B.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(Dt.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const o=this.generateCacheKey(Dt.ACTIVE_ACCOUNT),a=this.getItem(o);if(!a)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const c=this.getAccountInfoFilteredBy({localAccountId:a});return c?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(c),c):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(Dt.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(Dt.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(o)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!cV(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===_n.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(B.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(B.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(x.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(a=>{const c=this.getAccessTokenCredential(a);c!=null&&c.requestedClaimsHash&&a.includes(c.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(a))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):_r.startsWith(e,B.CACHE_PREFIX)||_r.startsWith(e,Dt.ADAL_ID_TOKEN)?e:`${B.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=vr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${$e.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=vr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${$e.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=vr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${$e.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const c=this.generateStateKey(e);this.setTemporaryCache(c,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const h=this.generateAuthorityKey(e);if(this.setTemporaryCache(h,r,!1),a){const m={credential:a.homeAccountId,type:Un.HOME_ACCOUNT_ID};this.setTemporaryCache($e.CCS_CREDENTIAL,JSON.stringify(m),!0)}else if(o){const m={credential:o,type:Un.UPN};this.setTemporaryCache($e.CCS_CREDENTIAL,JSON.stringify(m),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey($e.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey($e.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey($e.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey($e.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey($e.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey($e.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||B.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf($e.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=wT(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=pm(JSON.stringify(e));this.setTemporaryCache($e.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache($e.REQUEST_PARAMS,!0);if(!t)throw oe(Qw);let r;try{r=JSON.parse($r(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),oe(Xw)}if(this.removeTemporaryItem(this.generateCacheKey($e.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),a=this.getTemporaryCache(o);if(!a)throw oe(fm);r.authority=a}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache($e.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${B.CACHE_PREFIX}.${$e.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${B.CACHE_PREFIX}.${$e.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw oe(Kw);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(Dt.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Dt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(Dt.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(Dt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=Ii(r,$r);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const r=ua(t);if(e!==r){const o=this.getItem(e);if(o)return this.browserStorage.removeItem(e),this.setItem(r,o),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var d,h,m;const r=ou((d=e.account)==null?void 0:d.homeAccountId,(h=e.account)==null?void 0:h.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const a=iu((m=e.account)==null?void 0:m.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,$r,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),c={idToken:r,accessToken:a};return this.saveCacheRecord(c)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof ma&&this.performanceClient&&r)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},r)}catch{}throw o}}}const CH=(n,e)=>{const t={cacheLocation:_n.MemoryStorage,temporaryCacheLocation:_n.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new sf(n,t,Al,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function EH(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function wH(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function TH(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function bH(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function IH(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function SH(n,e){e.setActiveAccount(n)}function AH(n){return n.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const fe={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.28.1 2025-01-14 */class kH{constructor(e){this.eventCallbacks=new Map,this.logger=e||new $o({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||iH();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const a={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([c,d],h)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${h}: ${e}`),c.apply(null,[a]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class TT{constructor(e,t,r,o,a,c,d,h,m){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=c,this.nativeMessageHandler=h,this.correlationId=m||mo(),this.logger=o.clone(Mn.MSAL_SKU,mu,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){Ot.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Ot.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return Me.getAbsoluteUrl(t,co())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Ns(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,c=r!=null&&r.length?r==="true":this.config.auth.instanceAware,d=t&&c?this.config.auth.authority.replace(Me.getDomainFromUrl(a),t.environment):a,h=Qt.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),m=await J(Pw,x.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(h,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!m.isAlias(t.environment))throw Qe(Tw);return m}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const NH=32;async function RH(n,e,t){n.addQueueMeasurement(x.GeneratePkceCodes,t);const r=Si(OH,x.GenerateCodeVerifier,e,n,t)(n,e,t),o=await J(PH,x.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function OH(n,e,t){try{const r=new Uint8Array(NH);return Si(j2,x.GetRandomValues,e,n,t)(r),fu(r)}catch{throw oe(dm)}}async function PH(n,e,t,r){e.addQueueMeasurement(x.GenerateCodeChallengeFromVerifier,r);try{const o=await J(_T,x.Sha256Digest,t,e,r)(n,e,r);return fu(new Uint8Array(o))}catch{throw oe(dm)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function Tm(n,e,t,r){t.addQueueMeasurement(x.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,a=[...n&&n.scopes||[]],c={...n,correlationId:n.correlationId,authority:o,scopes:a};if(!c.authenticationScheme)c.authenticationScheme=ze.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(c.authenticationScheme===ze.SSH){if(!n.sshJwk)throw Qe(au);if(!n.sshKid)throw Qe(Cw)}r.verbose(`Authentication Scheme set to "${c.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!_r.isEmptyObj(n.claims)&&(c.requestedClaimsHash=await vT(n.claims)),c}async function MH(n,e,t,r,o){r.addQueueMeasurement(x.InitializeSilentRequest,n.correlationId);const a=await J(Tm,x.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...a,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Oa extends TT{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await J(RH,x.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:B.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=B.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||mo(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=Me.getAbsoluteUrl(e.postLogoutRedirectUri,co())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=Me.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,co())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=Me.getAbsoluteUrl(co(),co())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Lw(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}=e;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await J(this.getDiscoveredAuthority.bind(this),x.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}),h=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:h.loggerCallback,piiLoggingEnabled:h.piiLoggingEnabled,logLevel:h.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Mn.MSAL_SKU,version:mu,cpu:B.EMPTY_STRING,os:B.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},a=vr.setRequestState(this.browserCrypto,e&&e.state||B.EMPTY_STRING,o),d={...await J(Tm,x.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||mo(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const h=e.account||this.browserStorage.getActiveAccount();if(h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),d.account=h),!d.loginHint&&!h){const m=this.browserStorage.getLegacyLoginHint();m&&(d.loginHint=m)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const DH="ContentError",bT="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const LH="USER_INTERACTION_REQUIRED",xH="USER_CANCEL",UH="NO_NETWORK",FH="PERSISTENT_ERROR",BH="DISABLED",VH="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const HH=-2147186943,$H={[bT]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Ur extends ct{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,Ur.prototype),this.name="NativeAuthError",this.ext=r}}function ia(n){if(n.ext&&n.ext.status&&(n.ext.status===FH||n.ext.status===BH)||n.ext&&n.ext.error&&n.ext.error===HH)return!0;switch(n.errorCode){case DH:return!0;default:return!1}}function cf(n,e,t){if(t&&t.status)switch(t.status){case VH:return Xh(Mw);case LH:return new Cr(n,e);case xH:return oe(Ti);case UH:return oe(Ml)}return new Ur(n,$H[n]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class IT extends Oa{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(rt.acquireTokenSilent_silentFlow),r=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new S2(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const c=(await J(o.acquireCachedToken.bind(o),x.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),c}catch(a){throw a instanceof $s&&a.errorCode===mm&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ga extends TT{constructor(e,t,r,o,a,c,d,h,m,g,v,p){var C;super(e,t,r,o,a,c,h,m,p),this.apiId=d,this.accountId=g,this.nativeMessageHandler=m,this.nativeStorageManager=v,this.silentCacheClient=new IT(e,this.nativeStorageManager,r,o,a,c,h,m,p),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const w=this.nativeMessageHandler.getExtensionId()===ha.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=Ns.makeExtraSkuString({libraryName:Mn.MSAL_SKU,libraryVersion:mu,extensionName:w,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[l2]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),r=Wr();try{const o=await this.initializeNativeRequest(e);try{const m=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),m}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=o,c={method:mi.GetToken,request:a},d=await this.nativeMessageHandler.sendMessage(c),h=this.validateNativeResponse(d);return await this.handleNativeResponse(h,o,r).then(m=>(t.end({success:!0,isNativeBroker:!0,requestId:m.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),m)).catch(m=>{throw t.end({success:!1,errorCode:m.errorCode,subErrorCode:m.subError,isNativeBroker:!0}),m})}catch(o){throw o instanceof Ur&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:_t.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),j(Gh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw j(Gh);try{const o=this.createSilentCacheRequest(t,r),a=await this.silentCacheClient.acquireToken(o),c={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:c}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),a={method:mi.GetToken,request:o};try{const h=await this.nativeMessageHandler.sendMessage(a);this.validateNativeResponse(h)}catch(h){if(h instanceof Ur&&(this.serverTelemetryManager.setNativeBrokerErrorCode(h.errorCode),ia(h)))throw h}this.browserStorage.setTemporaryCache($e.NATIVE_REQUEST,JSON.stringify(o),!0);const c={apiId:rt.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,c)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey($e.NATIVE_REQUEST));const c={method:mi.GetToken,request:a},d=Wr();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const h=await this.nativeMessageHandler.sendMessage(c);this.validateNativeResponse(h);const m=this.handleNativeResponse(h,a,d);this.browserStorage.setInteractionInProgress(!1);const g=await m;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),g}catch(h){throw this.browserStorage.setInteractionInProgress(!1),h}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Ii(e.id_token,$r),a=this.createHomeAccountIdentifier(e,o),c=(g=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:g.homeAccountId;if(a!==c&&e.account.id!==t.accountId)throw cf(bT);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),h=cm(this.browserStorage,d,a,$r,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),m=await this.generateAuthenticationResult(e,t,o,h,d.canonicalAuthority,r);return this.cacheAccount(h),this.cacheNativeTokens(e,t,a,o,e.access_token,m.tenantId,r),m}createHomeAccountIdentifier(e,t){return Ot.generateHomeAccountId(e.client_info||B.EMPTY_STRING,fr.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?_t.fromString(e.scope):_t.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===ze.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new wa(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw j(qf);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,a,c){const d=this.addTelemetryFromNativeResponse(e),h=e.scope?_t.fromString(e.scope):_t.fromString(t.scope),m=e.account.properties||{},g=m.UID||r.oid||r.sub||B.EMPTY_STRING,v=m.TenantId||r.tid||B.EMPTY_STRING,p=nm(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const w=await this.generatePopAccessToken(e,t),C=t.tokenType===ze.POP?ze.POP:ze.BEARER;return{authority:a,uniqueId:g,tenantId:v,scopes:h.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:w,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(c+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,a,c,d){const h=ou(r,t.authority,e.id_token||"",t.clientId,o.tid||""),m=t.tokenType===ze.POP?B.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,g=d+m,v=this.generateScopes(e,t),p=iu(r,t.authority,a,t.clientId,o.tid||c,v.printScopes(),g,0,$r,void 0,t.tokenType,void 0,t.keyId),w={idToken:h,accessToken:p};this.nativeStorageManager.saveCacheRecord(w,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw KE(Hf,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new Me(t);r.validateAsUri();const{scopes:o,...a}=e,c=new _t(o||[]);c.appendScopes(Ra);const d=()=>{switch(this.apiId){case rt.ssoSilent:case rt.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Ut.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Ut.NONE:case Ut.CONSENT:case Ut.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),oe(lT)}},h={...a,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:c.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(h.signPopToken&&e.popKid)throw oe(dT);if(this.handleExtraBrokerParams(h),h.extraParameters=h.extraParameters||{},h.extraParameters.telemetry=ha.MATS_TELEMETRY,e.authenticationScheme===ze.POP){const m={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},g=new wa(this.browserCrypto);let v;if(h.keyId)v=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:h.keyId})),h.signPopToken=!1;else{const p=await J(g.generateCnf.bind(g),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(m,this.logger);v=p.reqCnfString,h.keyId=p.kid,h.signPopToken=!0}h.reqCnf=v}return this.addRequestSKUs(h),h}handleExtraBrokerParams(e){var a;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(im)&&e.extraParameters.hasOwnProperty(Qh)&&e.extraParameters.hasOwnProperty(Ei);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Qh],r=e.extraParameters[Ei]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fr{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(x.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ha.CHANNEL_ID,extensionId:this.extensionId,responseId:mo(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Fr(e,t,r,ha.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new Fr(e,t,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ha.CHANNEL_ID,extensionId:this.extensionId,responseId:mo(),body:{method:mi.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(oe(aT)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ha.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===mi.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(oe(sT))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const a=t.body.method;if(a===mi.Response){if(!r)return;const c=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(c)}`),c.status!=="Success")r.reject(cf(c.code,c.description,c.ext));else if(c.result)c.result.code&&c.result.description?r.reject(cf(c.result.code,c.result.description,c.result.ext)):r.resolve(c.result);else throw KE(Hf,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(a===mi.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case ze.BEARER:case ze.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class bm{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(x.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof Ko&&o.subError===Ti?oe(Ti):o}return J(this.handleCodeResponseFromServer.bind(this),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(x.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await J(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(t);a&&(this.authCodeRequest.ccsCredential=a)}return await J(this.authModule.acquireToken.bind(this.authModule),x.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Un.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Un.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function ST(n,e,t){const r=Rl(n);if(!r)throw Iw(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),oe(Vw)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),oe(Bw));return r}function KH(n,e,t){if(!n.state)throw oe(hm);const r=wT(e,n.state);if(!r)throw oe(Hw);if(r.interactionType!==t)throw oe($w)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class WH extends Oa{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=h}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Ra,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,a))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var a;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(rt.acquireTokenPopup),o=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Popup);ET(o.authority);try{const c=await J(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),d=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),h=Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let m;h&&(m=this.performanceClient.startMeasurement(x.FetchAccountIdWithNativeBroker,e.correlationId));const g=await d.getAuthCodeUrl({...o,nativeBroker:h}),v=new bm(d,this.browserStorage,c,this.logger,this.performanceClient),p=this.initiateAuthRequest(g,t);this.eventHandler.emitEvent(fe.POPUP_OPENED,ce.Popup,{popupWindow:p},null);const w=await this.monitorPopupForHash(p,t.popupWindowParent),C=Si(ST,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(xr.removeThrottle(this.browserStorage,this.config.auth.clientId,c),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),m&&m.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw oe(Hs);const k=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:I}=vr.parseRequestState(this.browserCrypto,o.state);return await k.acquireToken({...o,state:I,prompt:void 0})}return await v.handleCodeResponse(C,o)}catch(c){throw(a=t.popup)==null||a.close(),c instanceof ct&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),c}}async logoutPopupAsync(e,t,r,o){var c,d,h,m;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(fe.LOGOUT_START,ce.Popup,e);const a=this.initializeServerTelemetryManager(rt.logoutPopup);try{await this.clearCacheOnLogout(e.account);const g=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{g.authority.endSessionEndpoint}catch{if((c=e.account)!=null&&c.homeAccountId&&e.postLogoutRedirectUri&&g.authority.protocolMode===ho.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Popup,e),o){const w={apiId:rt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=Me.getAbsoluteUrl(o,co());await this.navigationClient.navigateInternal(C,w)}(h=t.popup)==null||h.close();return}}const v=g.getLogoutUri(e);this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Popup,e);const p=this.openPopup(v,t);if(this.eventHandler.emitEvent(fe.POPUP_OPENED,ce.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const w={apiId:rt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=Me.getAbsoluteUrl(o,co());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,w)}else this.logger.verbose("No main window navigation requested")}catch(g){throw(m=t.popup)==null||m.close(),g instanceof ct&&(g.setCorrelationId(this.correlationId),a.cacheFailedRequest(g)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(fe.LOGOUT_FAILURE,ce.Popup,null,g),this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Popup),g}this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),oe(uu)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(oe(Ti));return}let c="";try{c=e.location.href}catch{}if(!c||c==="about:blank")return;clearInterval(a);let d="";const h=this.config.auth.OIDCOptions.serverResponseType;e&&(h===Vs.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw oe(zw);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),oe(Ww)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var w,C,T,k;const a=o.screenLeft?o.screenLeft:o.screenX,c=o.screenTop?o.screenTop:o.screenY,d=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let m=(w=r.popupSize)==null?void 0:w.width,g=(C=r.popupSize)==null?void 0:C.height,v=(T=r.popupPosition)==null?void 0:T.top,p=(k=r.popupPosition)==null?void 0:k.left;return(!m||m<0||m>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),m=Mn.POPUP_WIDTH),(!g||g<0||g>h)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),g=Mn.POPUP_HEIGHT),(!v||v<0||v>h)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),v=Math.max(0,h/2-Mn.POPUP_HEIGHT/2+c)),(!p||p<0||p>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,d/2-Mn.POPUP_WIDTH/2+a)),o.open(e,t,`width=${m}, height=${g}, top=${v}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(ce.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Mn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Mn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class uy{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache($e.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache($e.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:rt.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),oe(uu)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw j(Sl,"Cached State");let a;try{a=this.authModule.handleFragmentResponse(e,o)}catch(m){throw m instanceof Ko&&m.subError===Ti?oe(Ti):m}const c=this.browserStorage.generateNonceKey(o),d=this.browserStorage.getTemporaryCache(c);if(this.authCodeRequest.code=a.code,a.cloud_instance_host_name&&await J(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(a.cloud_instance_host_name,this.authCodeRequest.correlationId),a.nonce=d||void 0,a.state=o,a.client_info)this.authCodeRequest.clientInfo=a.client_info;else{const m=this.checkCcsCredentials();m&&(this.authCodeRequest.ccsCredential=m)}const h=await this.authModule.acquireToken(this.authCodeRequest,a);return this.browserStorage.cleanRequestByState(t),h}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache($e.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function zH(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class GH extends Oa{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.nativeStorage=h}async acquireToken(e){const t=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(rt.acquireTokenRedirect),o=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(fe.RESTORE_FROM_BFCACHE,ce.Redirect))};try{const a=await J(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),c=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new uy(c,this.browserStorage,a,this.logger,this.performanceClient),h=await c.getAuthCodeUrl({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),m=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${m}`),window.addEventListener("pageshow",o),await d.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:m,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(a){throw a instanceof ct&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),a}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(rt.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,a]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),zH()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache($e.ORIGIN_URI,!0)||B.EMPTY_STRING,d=Me.removeHashFromUrl(c),h=Me.removeHashFromUrl(window.location.href);if(d===h&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&Z2(c),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Cm()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache($e.URL_HASH,a,!0);const m={apiId:rt.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let g=!0;if(!c||c==="null"){const v=tH();this.browserStorage.setTemporaryCache($e.ORIGIN_URI,v,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),g=await this.navigationClient.navigateInternal(v,m)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),g=await this.navigationClient.navigateInternal(c,m);if(!g)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof ct&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===Vs.QUERY?t=window.location.search:t=window.location.hash);let r=Rl(t);if(r){try{KH(r,this.browserCrypto,ce.Redirect)}catch(a){return a instanceof ct&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return X2(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache($e.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey($e.URL_HASH)),o&&(r=Rl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw oe(hm);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw oe(Hs);const h=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:m}=vr.parseRequestState(this.browserCrypto,r);return h.acquireToken({...o,state:m,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const a=this.browserStorage.getCachedAuthority(r);if(!a)throw oe(fm);const c=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:a});return xr.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new uy(c,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,a;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(rt.logout);try{this.eventHandler.emitEvent(fe.LOGOUT_START,ce.Redirect,e),await this.clearCacheOnLogout(t.account);const c={apiId:rt.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===ho.OIDC)try{d.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((a=t.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Redirect,t);return}}const h=d.getLogoutUri(t);if(this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(h)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}}catch(c){throw c instanceof ct&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),this.eventHandler.emitEvent(fe.LOGOUT_FAILURE,ce.Redirect,null,c),this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Redirect),c}this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return Me.getAbsoluteUrl(t,co())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function qH(n,e,t,r,o){if(e.addQueueMeasurement(x.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),oe(uu);return o?J(YH,x.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):Si(JH,x.SilentHandlerLoadFrameSync,t,e,r)(n)}async function jH(n,e,t,r,o,a,c){return r.addQueueMeasurement(x.SilentHandlerMonitorIframeForHash,a),new Promise((d,h)=>{e<of&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${of}ms). This may result in timeouts.`);const m=window.setTimeout(()=>{window.clearInterval(g),h(oe(Gw))},e),g=window.setInterval(()=>{let v="";const p=n.contentWindow;try{v=p?p.location.href:""}catch{}if(!v||v==="about:blank")return;let w="";p&&(c===Vs.QUERY?w=p.location.search:w=p.location.hash),window.clearTimeout(m),window.clearInterval(g),d(w)},t)}).finally(()=>{Si(QH,x.RemoveHiddenIframe,o,r,a)(n)})}function YH(n,e,t,r){return t.addQueueMeasurement(x.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const c=AT();window.setTimeout(()=>{if(!c){a("Unable to load iframe");return}c.src=n,o(c)},e)})}function JH(n){const e=AT();return e.src=n,e}function AT(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function QH(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class XH extends Oa{constructor(e,t,r,o,a,c,d,h,m,g,v){super(e,t,r,o,a,c,h,g,v),this.apiId=d,this.nativeStorage=m}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Ut.NONE&&t.prompt!==Ut.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Ut.NONE}`),t.prompt=Ut.NONE):t.prompt=Ut.NONE;const r=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ce.Silent);ET(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let a;try{return a=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await J(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(a,r)}catch(c){if(c instanceof ct&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),!a||!(c instanceof ct)||c.errorCode!==Mn.INVALID_GRANT_ERROR)throw c;this.performanceClient.addFields({retryError:c.errorCode},this.correlationId);const d=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ce.Silent);return await J(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(a,d)}}logout(){return Promise.reject(oe(du))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(x.SilentIframeClientTokenHelper,r);const o=await J(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),a=await J(e.getAuthCodeUrl.bind(e),x.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),c=new bm(e,this.browserStorage,o,this.logger,this.performanceClient),d=await J(qH,x.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(a,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),h=this.config.auth.OIDCOptions.serverResponseType,m=await J(jH,x.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,h),g=Si(ST,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(m,h,this.logger);if(g.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw oe(Hs);const v=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,g.accountId,this.browserStorage,r),{userRequestState:p}=vr.parseRequestState(this.browserCrypto,t.state);return J(v.acquireToken.bind(v),x.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:p,prompt:t.prompt||Ut.NONE})}return J(c.handleCodeResponse.bind(c),x.HandleCodeResponse,this.logger,this.performanceClient,r)(g,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ZH extends Oa{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentRefreshClientAcquireToken,e.correlationId);const t=await J(Tm,x.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(rt.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return J(a.acquireTokenByRefreshToken.bind(a),x.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(c=>{throw c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c),c})}logout(){return Promise.reject(oe(du))}async createRefreshTokenClient(e){const t=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Zh(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class e${constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw oe(hu);const o=t.id_token?Ii(t.id_token,$r):void 0,a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new Qt(Qt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,a,this.logger,e.correlationId||mo()):void 0,d=this.loadAccount(e,r.clientInfo||t.client_info||"",o,c),h=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),m=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,r),g=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:h,accessToken:m,refreshToken:g},o,c)}loadAccount(e,t,r,o){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Ot.createFromAccountInfo(e.account);return this.storage.setAccount(h),h}else if(!o||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),oe(tT);const a=Ot.generateHomeAccountId(t,o.authorityType,this.logger,this.cryptoObj,r),c=r==null?void 0:r.tid,d=cm(this.storage,o,a,$r,r,t,o.hostnameAndPort,c,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,r,o){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const a=ou(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(a),a}loadAccessToken(e,t,r,o,a,c){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?_t.fromString(t.scope):new _t(e.scopes),h=c.expiresOn||t.expires_in+new Date().getTime()/1e3,m=c.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,g=iu(r,o,t.access_token,this.config.auth.clientId,a,d.printScopes(),h,m,$r);return this.storage.setAccessTokenCredential(g),g}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const o=lw(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(o),o}generateAuthenticationResult(e,t,r,o){var g,v,p;let a="",c=[],d=null,h;t!=null&&t.accessToken&&(a=t.accessToken.secret,c=_t.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),h=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const m=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:c,account:m.getAccountInfo(),idToken:((g=t.idToken)==null?void 0:g.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:h,familyId:((v=t.refreshToken)==null?void 0:v.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:m.cloudGraphHostName||"",msGraphHost:m.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class t$ extends Lw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class n$ extends Oa{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,h,m,g),this.apiId=d}async acquireToken(e){if(!e.code)throw oe(nT);const t=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,ce.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},a=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),c=new t$(a);this.logger.verbose("Auth code client created");const d=new bm(c,this.browserStorage,o,this.logger,this.performanceClient);return await J(d.handleCodeResponseFromServer.bind(d),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof ct&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(oe(du))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Mr(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function qc(n,e){try{Em(n)}catch(t){throw e.end({success:!1},t),t}}class gu{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ta(this.logger,this.performanceClient):Al,this.eventHandler=new kH(this.logger),this.browserStorage=this.isBrowserEnvironment?new sf(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,p2(this.config.auth),this.performanceClient):CH(this.config.auth.clientId,this.logger);const t={cacheLocation:_n.MemoryStorage,temporaryCacheLocation:_n.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new sf(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new e$(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new gu(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(fe.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(x.InitializeClientApplication,t);if(this.eventHandler.emitEvent(fe.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Fr.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(a){this.logger.verbose(a)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await J(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),x.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(fe.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),CT(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,a=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache($e.CORRELATION_ID,!0)||"",c=this.performanceClient.startMeasurement(x.AcquireTokenRedirect,a);this.eventHandler.emitEvent(fe.HANDLE_REDIRECT_START,ce.Redirect);let d;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const h=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);d=J(h.handleRedirectPromise.bind(h),x.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(this.performanceClient,c.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(a);d=J(h.handleRedirectPromise.bind(h),x.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(e,c)}return d.then(h=>(h?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(fe.LOGIN_SUCCESS,ce.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_SUCCESS,ce.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),c.end({success:!0,accountType:Mr(h.account)})):c.event.errorCode?c.end({success:!1}):c.discard(),this.eventHandler.emitEvent(fe.HANDLE_REDIRECT_END,ce.Redirect),h)).catch(h=>{const m=h;throw t.length>0?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,m):this.eventHandler.emitEvent(fe.LOGIN_FAILURE,ce.Redirect,null,m),this.eventHandler.emitEvent(fe.HANDLE_REDIRECT_END,ce.Redirect),c.end({success:!1},m),h})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenPreRedirect,t);r.add({accountType:Mr(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=c=>{const d=typeof o=="function"?o(c):void 0;return d!==!1?r.end({success:!0}):r.discard(),d};else{const c=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const h=typeof c=="function"?c(d):void 0;return h!==!1?r.end({success:!0}):r.discard(),h}}const a=this.getAllAccounts().length>0;try{ay(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),a?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_START,ce.Redirect,e):this.eventHandler.emitEvent(fe.LOGIN_START,ce.Redirect,e);let c;return this.nativeExtensionProvider&&this.canUseNative(e)?c=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(h=>{if(h instanceof Ur&&ia(h))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(h instanceof Cr)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),h}):c=this.createRedirectClient(t).acquireToken(e),await c}catch(c){throw r.end({success:!1},c),a?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,c):this.eventHandler.emitEvent(fe.LOGIN_FAILURE,ce.Redirect,null,c),c}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:Mr(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),qc(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(c){return Promise.reject(c)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_START,ce.Popup,e):this.eventHandler.emitEvent(fe.LOGIN_START,ce.Popup,e);let a;return this.canUseNative(e)?a=this.acquireTokenNative({...e,correlationId:t},rt.acquireTokenPopup).then(c=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Mr(c.account)}),c)).catch(c=>{if(c instanceof Ur&&ia(c))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(c instanceof Cr)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):a=this.createPopupClient(t).acquireToken(e),a.then(c=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(fe.LOGIN_SUCCESS,ce.Popup,c):this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_SUCCESS,ce.Popup,c),r.end({success:!0,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Mr(c.account)}),c)).catch(c=>(o.length>0?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Popup,null,c):this.eventHandler.emitEvent(fe.LOGIN_FAILURE,ce.Popup,null,c),r.end({success:!1},c),Promise.reject(c)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,c;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(x.SsoSilent,t),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId,accountType:Mr(e.account)}),qc(this.initialized,this.ssoSilentMeasurement),(c=this.ssoSilentMeasurement)==null||c.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(fe.SSO_SILENT_START,ce.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,rt.ssoSilent).catch(d=>{if(d instanceof Ur&&ia(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw d}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(d=>{var h;return this.eventHandler.emitEvent(fe.SSO_SILENT_SUCCESS,ce.Silent,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Mr(d.account)}),d}).catch(d=>{var h;throw this.eventHandler.emitEvent(fe.SSO_SILENT_FAILURE,ce.Silent,null,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenByCode,t);qc(this.initialized,r),this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_START,ce.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw oe(oT);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),a=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(c=>(this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ce.Silent,c),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Mr(c.account)}),c)).catch(c=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,c),r.end({success:!1},c),c}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},rt.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof Ur&&ia(a)&&(this.nativeExtensionProvider=void 0),a});return r.end({accountType:Mr(o.account),success:!0}),o}else throw oe(iT);else throw oe(rT)}catch(o){throw this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(x.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var c;return(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker}),a}).catch(a=>{var c;throw(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenFromCache,e.correlationId),t){case On.Default:case On.AccessToken:case On.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return J(r.acquireToken.bind(r),x.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(so)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenByRefreshToken,e.correlationId),t){case On.Default:case On.AccessTokenAndRefreshToken:case On.RefreshToken:case On.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return J(r.acquireToken.bind(r),x.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(so)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(x.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return J(t.acquireToken.bind(t),x.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return ay(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return Em(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return EH(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return wH(e,this.logger,this.browserStorage)}getAccountByUsername(e){return TH(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return bH(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return IH(e,this.logger,this.browserStorage)}setActiveAccount(e){SH(e,this.browserStorage)}getActiveAccount(){return AH(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Ot.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw oe(Hs);return new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Ut.NONE:case Ut.CONSENT:case Ut.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new WH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new GH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new XH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new IT(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new ZH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new n$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return yT(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(Dt.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(fe.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!Ot.isAccountEntity(o))return;const c=Ea.toObject(new Ot,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(fe.ACCOUNT_ADDED,void 0,c)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(fe.ACCOUNT_REMOVED,void 0,c))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?mo():B.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||ry})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||ry})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),qc(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw oe(Jw);r.add({accountType:Mr(o)});const a={clientId:this.config.auth.clientId,authority:e.authority||B.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},c=JSON.stringify(a),d=this.activeSilentTokenRequests.get(c);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const h=J(this.acquireTokenSilentAsync.bind(this),x.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(m=>(this.activeSilentTokenRequests.delete(c),r.end({success:!0,fromCache:m.fromCache,isNativeBroker:m.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:m.accessToken.length,idTokenSize:m.idToken.length}),m)).catch(m=>{throw this.activeSilentTokenRequests.delete(c),r.end({success:!1},m),m});return this.activeSilentTokenRequests.set(c,h),{...await h,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(x.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_START,ce.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await J(MH,x.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||On.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async d=>{if(r$(d,a))if(this.activeIframeRequest)if(a!==On.Skip){const[m,g]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${g}`,o.correlationId);const v=this.performanceClient.startMeasurement(x.AwaitConcurrentIframe,o.correlationId);v.add({awaitIframeCorrelationId:g});const p=await m;if(v.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${g} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${g} failed. Interaction is required.`),d}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),J(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let m;return this.activeIframeRequest=[new Promise(g=>{m=g}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),J(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(g=>(m(!0),g)).catch(g=>{throw m(!1),g}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_SUCCESS,ce.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,rt.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Ur&&ia(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,j(so)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),J(this.acquireTokenFromCache.bind(this),x.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===On.AccessToken)throw r;return this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_NETWORK_START,ce.Silent,e),J(this.acquireTokenByRefreshToken.bind(this),x.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function r$(n,e){const t=!(n instanceof Cr&&n.subError!==lu),r=n.errorCode===Mn.INVALID_GRANT_ERROR||n.errorCode===so,o=t&&r||n.errorCode===Pl||n.errorCode===sm,a=V2.includes(e);return o&&a}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function o$(n,e){const t=new bi(n);return await t.initialize(),gu.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Im{static async createPublicClientApplication(e){const t=await o$(e);return new Im(e,t)}constructor(e,t){this.controller=t||new gu(new bi(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const sh=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",i$=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",a$=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",lf=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",s$={auth:{clientId:i$,authority:`https://${sh}.b2clogin.com/${sh}.onmicrosoft.com/${a$}`,knownAuthorities:[`${sh}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${lf}/_/dashboard`:lf},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(n,e)=>{n===et.Error&&console.error(e)},logLevel:et.Warning}}},kT=(n,e)=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:`${lf}${n}`,extraQueryParameters:e}),zt=new Im(s$),dy=l.ref(null);function NT(){async function n(e){var t;if(e)try{const r=e.idTokenClaims;if(!(r!=null&&r.aud))throw new Error("User audience (aud) is missing in ID token claims");const o=localStorage.getItem(`msal.token.keys.${r.aud}`);if(!o)throw new Error(`Token keys para ${r.aud} não encontrados no localStorage`);const a=JSON.parse(o),c=(t=a==null?void 0:a.idToken)==null?void 0:t[0];if(!c)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(c);if(!d)throw new Error(`Dados do token para ID ${c} não encontrados no localStorage`);const h=JSON.parse(d),m=h==null?void 0:h.secret;if(!m)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),dy.value=m}catch(r){console.error("Erro ao obter token de acesso:",r)}}return{jToken:dy,setJToken:n}}let jc=null;const er=l.ref(null),Yi=l.ref(null),RT=l.ref(Math.floor(Date.now()/1e3));uf.useIntervalFn(()=>c$(),1e3);function c$(){var r,o;if(!((o=(r=er.value)==null?void 0:r.idTokenClaims)!=null&&o.exp))return;const n=Math.floor(Date.now()/1e3),e=300,t=er.value.idTokenClaims.exp;RT.value=t-n-e}function Sm(){if(jc)return jc;const{setJToken:n,jToken:e}=NT(),t=l.computed(()=>!!er.value),r=l.computed(()=>er.value);let o;async function a(p,w){if(!t.value)switch(p){case"redirect":if(w){o=w,await h();break}case"tab":default:await c();break}}const c=async()=>new Promise((p,w)=>{try{localStorage.clear();const C=process.env.JPLAN_WEBAPP__URL_AUTH,T=window.open(C);if(!T){console.error("Failed to open authentication window"),w("Failed to open authentication window");return}const k=Date.now(),I=6e4,N=setInterval(()=>{if(Date.now()-k>I||T.closed){clearInterval(N),console.error("Authentication canceled or timeout reached."),w("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(L=>L.startsWith("msal.account.keys"))&&(clearInterval(N),d(),T.close(),p())},500)}catch(C){console.error("Error in handleRedirect:",C),w(C)}}),d=async()=>{try{await zt.initialize();const p=zt.getActiveAccount();if(p)er.value=p;else{const w=await zt.handleRedirectPromise();w?(zt.setActiveAccount(w.account),er.value=zt.getActiveAccount()):console.error("Falha na autenticação")}}catch(p){console.error("Erro no processo de autenticação:",p)}er.value&&await n(er.value)},h=async()=>{try{await zt.initialize();const p=await zt.handleRedirectPromise();if(!p||zt.getAllAccounts().length===0){const w=kT(o);await zt.loginRedirect(w);return}zt.setActiveAccount(p.account),er.value=zt.getActiveAccount(),er.value&&await n(er.value),Yi.value="updated"}catch(p){console.error("handleRedirect failed",p)}};async function m(){_e.value=!0,Yi.value="updating";try{const p=await zt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});zt.setActiveAccount(p.account),await n(er.value),Yi.value="updated"}catch(p){console.error("Failed to refresh token, forcing new login.",p),Yi.value="error",localStorage.clear(),window.location.reload()}_e.value=!1}const g=async()=>{try{await zt.initialize(),localStorage.clear(),await zt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(p){console.error("Logout error",p)}};l.watch(RT,async p=>{p<=0&&Yi.value==="updated"&&await m()});const v=l.computed(()=>e.value);return jc={isAuthenticated:t,authState:Yi,account:r,token:v,refreshToken:m,handleRedirect:a,logout:g},jc}const{jToken:hy}=NT(),Am=()=>{const n=ut.create({headers:{"Content-Type":"application/json"}});l.watch(hy,o=>{n.interceptors.request.use(a=>(o&&(a.headers.Authorization=`Bearer ${o}`),a))},{immediate:!0});let e=1;n.interceptors.response.use(async o=>o,async o=>{var a;if(o.config&&o.config.headers){const c=o.config;if(((a=o.response)==null?void 0:a.status)===401&&e>0){e--;try{return c.headers.Authorization=`Bearer ${hy.value}`,await n(c)}catch(d){return Promise.reject(d)}}}return Promise.reject(o)});async function t({url:o,method:a,header:c={},body:d,baseURL:h}){try{return h&&(n.defaults.baseURL=h),(await n({url:o,method:a,headers:c,data:d})).data}catch(m){if(console.error(`Request error [${a} ${o}]:`,m),ut.isAxiosError(m)){const{response:g,message:v}=m;throw new Error(`Axios error: ${v}, Status: ${g==null?void 0:g.status}, URL: ${o}`)}throw m}}async function r({url:o,method:a,header:c,body:d,baseURL:h}){try{h&&(n.defaults.baseURL=h);const m=await n({url:o,method:a,headers:c,data:d});return{status:m.status,header:m.headers,body:m.data}}catch(m){if(ut.isAxiosError(m)){const{response:g,message:v}=m;console.error(`Raw Request Error: ${v}, Status: ${g==null?void 0:g.status}`)}return Promise.reject(m)}}return Object.assign(n,{_request:t,rawRequest:r})},{request:fy}=Am(),my=l.ref(null),gy=l.ref("default"),ch=l.ref(null),lh=l.ref({scope_type:"org"});function pu(){var v,p;const{handleRedirect:n,account:e,logout:t}=Sm();(p=(v=e.value)==null?void 0:v.idTokenClaims)==null||p.domain;const r=l.computed(()=>{var w,C;return{domain:(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.domain,environment:gy.value,...lh.value}}),o=l.computed(()=>lh.value);async function a(){var w;(!e.value||!((w=e.value.idTokenClaims)!=null&&w.email))&&await n();try{await c(),await d()}catch{}}async function c(){var w,C;try{const T=(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.email;if(!T)throw new Error("Email is undefined");const k=await fy({url:`https://api.jplan.com.br/platform/user/profile/?email=${T}`,method:"GET"});ch.value=k.data??null}catch(T){console.error("Failed to fetch user profile:",T)}}async function d(){var w;try{if(!((w=ch.value)!=null&&w.email))throw new Error("User email is undefined");const C=await fy({url:"https://api.jplan.com.br/platform/user/domain/",method:"GET"});my.value=C.data.data??[]}catch(C){console.error("Failed to fetch user domains:",C)}}function h(w){lh.value=w}function m(w){gy.value=w,h(r.value)}async function g(w,C){const T=kT(w,{request_domain:C});await zt.loginRedirect(T)}return{__init__:a,user:ch,userDomains:my,setEnv:m,setScope:h,changeDomain:g,session:r,scope:o,logout:t}}const l$={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-BXFSsVZL.js")),meta:{requiresAuth:!1}},u$={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-DHl-IhUQ.js")),meta:{requiresAuth:!1}},{isAuthenticated:py,handleRedirect:d$}=Sm(),h$=pu();function f$(n,e){n.addRoute(l$),n.addRoute(u$),n.beforeEach(async(t,r,o)=>{function a(d){return d.matched.some(h=>h.meta.requiresAuth)}if(!a(t))return o();if(!py.value){_e.value=!0;try{await d$(e,t.fullPath),await h$.__init__()}catch(d){console.error("Fail to authenticate",d),await n.push("/jplan-auth-fail")}_e.value=!1}if(py.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),o(d),localStorage.removeItem("returnRoute");return}o()}})}const{scope:_y}=pu();function m$(){const n=Am(),e=l.ref({scope_type:"org"});async function t(r){e.value=r}return l.watch(_y,()=>{n.interceptors.request.use(r=>{const o=r.headers,a=o.Authorization;a&&(o.Authorization=a);const c=_y.value;return c&&(c.scope_type&&(o["j-scope-type"]=c.scope_type,c.organization&&(o["j-scope-organization"]=c.organization),c.team&&(o["j-scope-team"]=c.team)),c.environment&&(o["j-scope-environment"]=c.environment)),r})},{immediate:!0}),Object.assign(n,{setScope:t,scope:e})}function Pa(n){const e=m$();e.defaults.baseURL=n;const t=l.ref({scope_type:"org"});async function r(o){t.value=o}return l.watch(t,()=>{e.interceptors.request.use(o=>{const a=t.value;return delete o.headers["j-scope-type"],delete o.headers["j-scope-organization"],delete o.headers["j-scope-team"],a!=null&&a.scope_type&&(o.headers["j-scope-type"]=a.scope_type),a!=null&&a.organization&&(o.headers["j-scope-organization"]=a.organization),a!=null&&a.team&&(o.headers["j-scope-team"]=a.team),o})},{immediate:!0}),Object.assign(e,{setScope:r,scope:t})}function g$(){const n=Pa("https://api.jplan.com.br/management/organization"),{error:e}=Er();return{async getOrgList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch Organization list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getOrgList:",r),e("Failed to fetch Organization list");return}},async createOrg(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Organization"),a}},async updateOrg(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e("Failed to update Organization"),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Organization"),a}},async getOrg(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e("Failed to fetch Organization"),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Organization"),a}},async activateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate Organization"),new Error(a.data.error)}catch(a){throw console.error("Error in activateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Organization"),a}},async deactivateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate Organization"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Organization"),a}}}}const Lo=g$();function p$(){const n=Pa("https://api.jplan.com.br/management/branch/"),{error:e}=Er();return{async getBranchList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error){e("Failed to fetch Branch list");return}return o.data.data}catch(r){console.error("Error in getBranchList:",r),e("Failed to fetch Branch list")}},async createBranch(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){console.error("Error in createBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Branch")}},async updateBranch(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error){e(a.data.error||"Failed to update Branch");return}return a}catch(a){console.error("Error in updateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Branch")}},async getBranch(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error){e(a.data.error||"Failed to fetch Branch");return}return a.data}catch(a){console.error("Error in getBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Branch")}},async activateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error){e(a.data.error||"Failed to activate Branch");return}}catch(a){console.error("Error in activateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Branch")}},async deactivateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error){e(a.data.error||"Failed to deactivate Branch");return}}catch(a){console.error("Error in deactivateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Branch")}}}}const xo=p$();function _$(){const n=Pa("https://api.jplan.com.br/management/team"),{error:e}=Er();return{async getTeamList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch Team list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getTeamList:",r),e("Failed to fetch Team list");return}},async createTeam(t){var r,o;try{const a=await n.post("/item",t);if(a.data.error)throw e("Failed to create Team"),new Error(a.data.error);return a}catch(a){throw console.error("Error in createTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Team"),a}},async updateTeam(t){var r,o;try{const a=await n.patch("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in updateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Team"),a}},async getTeam(t){var r,o;try{const a=await n.get(`/item/${t}`);return a.data.error&&e("Failed to fetch Team"),a.data}catch(a){console.error("Error in getTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Team");return}},async activateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate Team"),new Error(a.data.error)}catch(a){throw console.error("Error in activateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Team"),a}},async deactivateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate Team"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Team"),a}},async getTeamUserList(t,r){try{const o=r?`?filter_query=${r}`:"",a=await n.get(`/item/${t}/user/list/${o}`);if(a.data.error)throw e("Failed to fetch Team User list"),new Error(a.data.error);return a.data.data}catch(o){console.error("Error in getTeamUserList:",o),e("Failed to fetch Team User list");return}},async linkManageUser(t,r){try{const o=await n.post(`/item/${t}/user/item/`,r);if(o.data.error)throw e("Failed to link User"),new Error(o.data.error);return o.data}catch(o){console.error("Error in link User:",o),e("Failed to link User");return}},async updateManageUser(t,r){try{const o=await n.patch(`/item/${t}/user/item/`,r);if(o.data.error)throw e("Failed to update User"),new Error(o.data.error);return o.data.data}catch(o){throw console.error("Error in update User:",o),e("Failed to update User"),o}},async getManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"",c=await n.get(`/item/${t}/user/item/${r}/${a}`);if(c.data.error)throw e("Failed to fetch User"),new Error(c.data.error);return c.data.data}catch(a){console.error("Error in getUser:",a),e("Failed to fetch User");return}},async unlinkManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"";await n.delete(`/item/${t}/user/item/${r}/${a}`)}catch(a){throw console.error("Error in unlink User:",a),e("Failed to unlink User"),a}}}}const Pn=_$();let Yc=!1;const uh=l.ref(!1),qn=l.ref([]),vy=l.ref([]),ht=l.ref(null),Ji=l.ref([]),Qi=l.ref([]),OT=()=>{const n=Er(),e=async C=>{uh.value=!0;const T=C?`_active eq true and ${C}`:"_active eq true",k=await Lo.getOrgList(T);k&&(qn.value=k,Yc=!0),uh.value=!1},t=async C=>{var T;return(T=qn.value)!=null&&T.length||await e(C),qn.value};function r(C){if(!qn.value)throw new Error("Data not stored yet");const T=Na(qn.value,C,["name","description"]);return C!==""?T:qn.value}const o=C=>{vy.value=C},a=C=>{ht.value=ka.cloneDeep(C)},c=async C=>await Lo.getOrg(C),d=async()=>{if(ht.value!=null){const C=await Lo.createOrg(ht.value);return C!=null&&C.data.created_at&&(n.success("Organization created."),Yc&&qn.value.push(C.data)),C==null?void 0:C.data}},h=async()=>{if(_e.value=!0,ht.value&&ht.value.__id){const C=await Lo.updateOrg(ht.value);if(Yc&&(C!=null&&C.data.__id)){const T=qn.value.findIndex(k=>k.__id===C.data.__id);return T!==-1?(qn.value[T]=C.data,n.success("Organization updated.")):n.error("Unable to update item"),_e.value=!1,C.data}}else _e.value=!1,n.error("Unable to update item")},m=async()=>{if(_e.value=!0,ht.value&&ht.value.created_at){if(await Lo.deactivateOrg(ht.value.__id),Yc){const C=qn.value.findIndex(T=>{var k;return T.__id===((k=ht.value)==null?void 0:k.__id)});if(C!==-1)return qn.value.splice(C,1),ht.value;n.error("Unable to deactivate organization")}_e.value=!1}};async function g(C){_e.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await xo.updateBranch(T)){_e.value=!1;return}if(Ji.value.findIndex(N=>N.__id===C.__id)===-1)return n.success("Branch added successfully."),Ji.value.push(T),T;n.info("Branch already added.")}}catch(T){console.error(T)}finally{_e.value=!1}}async function v(C){if(_e.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await xo.updateBranch(T)){_e.value=!1;return}const I=Ji.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Ji.value.splice(I,1),_e.value=!1,Ji.value;throw new Error("Item not found to remove")}_e.value=!1}async function p(C){_e.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await Pn.updateTeam(T)){_e.value=!1;return}if(Qi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success("Team added successfully."),Qi.value.push(T),T;n.info("Team already added.")}}catch(T){console.error(T)}finally{_e.value=!1}}async function w(C){if(_e.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await Pn.updateTeam(T)){_e.value=!1;return}const I=Qi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Qi.value.splice(I,1),_e.value=!1,Qi.value;throw new Error("Item not found to remove")}_e.value=!1}return{data:qn,loading:uh,columns:vy,item:ht,filterData:r,__init__:e,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgBranches:Ji,orgTeams:Qi,linkBranch:g,unlinkBranch:v,linkTeam:p,unlinkTeam:w}};let Jc=!1;const jn=l.ref([]),yy=l.ref([]),kt=l.ref(null),dh=l.ref(!1),Xi=l.ref([]),PT=()=>{const n=Er(),e=async p=>{dh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Pn.getTeamList(w);C&&(jn.value=C,Jc=!0),dh.value=!1},t=async p=>(jn.value.length||await e(p),jn.value);function r(p){if(!jn.value)throw new Error("Data not stored yet");const w=Na(jn.value,p,["name","description"]);return p!==""?w:jn.value}const o=p=>{yy.value=p},a=p=>{kt.value=ka.cloneDeep(p)},c=async p=>await Pn.getTeam(p),d=async()=>{if(kt.value!=null){const p=await Pn.createTeam(kt.value);return p!=null&&p.data.created_at&&(n.success("Team created."),Jc&&jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(_e.value=!0,kt.value&&kt.value.__id){const p=await Pn.updateTeam(kt.value);if(Jc&&(p!=null&&p.data.__id)){const w=jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(jn.value[w]=p.data,n.success("Team updated.")):n.error("Unable to update item"),p.data}}else n.error("Unable to update item")},m=async()=>{if(kt.value&&kt.value.created_at&&(await Pn.deactivateTeam(kt.value.__id),Jc)){const p=jn.value.findIndex(w=>{var C;return w.__id===((C=kt.value)==null?void 0:C.__id)});if(p!==-1)return jn.value.splice(p,1),kt.value;n.error("Unable to deactivate organization")}};async function g(p){var w;if(_e.value=!0,(w=kt.value)!=null&&w.__id)if(Xi.value.findIndex(T=>T.__id===p.__id)===-1)try{const T=await Pn.linkManageUser(kt.value.__id,{team:kt.value.__id,user:p.__id,role:"string",joined_at:"string",comments:"string"}),k=await Pn.getTeamUserList(kt.value.__id);return k&&(Xi.value=k),n.success("User added successfully."),T}catch(T){console.error(T),n.error("Unable to add User.")}finally{_e.value=!1}else n.info("User already added.");else console.warn("No item selected or item ID is missing."),n.info("Please select a valid item.");_e.value=!1}async function v(p){if(_e.value=!0,kt.value&&kt.value.__id){const w=Xi.value.findIndex(C=>C.__id===p);if(w!==-1)return await Pn.unlinkManageUser(kt.value.__id,p),Xi.value.splice(w,1),_e.value=!1,Xi.value;throw new Error("Item not found to remove")}_e.value=!1}return{data:jn,loading:dh,columns:yy,item:kt,usersTeam:Xi,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,linkUser:g,unlinkUser:v}},MT=l.defineComponent({__name:"GlobalScopeFilter",setup(n){var T,k,I;const{openDialog:e}=Os("global-scope__J-"),{user:t,scope:r,session:o,setScope:a}=pu(),{getData:c,data:d}=OT(),{getData:h,data:m}=PT(),g=l.ref(!1);l.onBeforeMount(async()=>{g.value=!0,await c(),await h(),g.value=!1});const v=l.ref({scope_type:(T=r.value)==null?void 0:T.scope_type,organization:((k=r.value)==null?void 0:k.organization)??"org",team:(I=r.value)==null?void 0:I.team});function p(){var N,O,L;v.value={...r.value,scope_type:(N=r.value)==null?void 0:N.scope_type,organization:((O=r.value)==null?void 0:O.organization)??"",team:(L=r.value)==null?void 0:L.team},e()}const w=l.computed(()=>{var N;switch((N=r.value)==null?void 0:N.scope_type){case"user":return DB;case"org":return PB;case"team":return LB;default:return MB}});async function C(){var N;((N=r.value)==null?void 0:N.scope_type)!==""&&a(v.value)}return(N,O)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(ot.VBtn,{onClick:p,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(w.value),{size:"20"}))]),_:1}),l.createVNode(l.unref(Ms),{loading:g.value,title:"Scope","dd-id":"global-scope__J-",onOnSave:C},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.createVNode(Je.VRow,null,{default:l.withCtx(()=>[l.createVNode(Je.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:l.withCtx(()=>[l.createVNode(Jt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>O[3]||(O[3]=[l.createTextVNode(" User")])),_:1}),l.createVNode(Jt.VListItemSubtitle,null,{default:l.withCtx(()=>{var L;return[l.createTextVNode(l.toDisplayString(((L=l.unref(t))==null?void 0:L.name)||"Unknown"),1)]}),_:1})]),_:1})]),_:1}),l.createVNode(Je.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Jt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>O[4]||(O[4]=[l.createTextVNode(" Domain")])),_:1}),l.createVNode(Jt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).domain),1)]),_:1})]),_:1})]),_:1}),l.createVNode(Je.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Jt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>O[5]||(O[5]=[l.createTextVNode(" Environment")])),_:1}),l.createVNode(Jt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),l.createVNode(EO.VBtnToggle,{density:"compact",variant:"outlined",modelValue:v.value.scope_type,"onUpdate:modelValue":O[0]||(O[0]=L=>v.value.scope_type=L),class:"d-flex justify-center my-4"},{default:l.withCtx(()=>[l.createVNode(ot.VBtn,{value:"org",label:"Organizational",color:"secondary",class:""},{default:l.withCtx(()=>O[6]||(O[6]=[l.createTextVNode("Organizational")])),_:1}),l.createVNode(ot.VBtn,{value:"team",label:"Team",color:"secondary",class:""},{default:l.withCtx(()=>O[7]||(O[7]=[l.createTextVNode("Team")])),_:1}),l.createVNode(ot.VBtn,{value:"user",label:"User",color:"secondary",class:""},{default:l.withCtx(()=>O[8]||(O[8]=[l.createTextVNode("User")])),_:1}),l.createVNode(ot.VBtn,{value:"",label:"None",color:"lightext",class:""},{default:l.withCtx(()=>O[9]||(O[9]=[l.createTextVNode("None")])),_:1})]),_:1},8,["modelValue"]),l.createElementVNode("div",null,[l.createVNode(_s.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>O[10]||(O[10]=[l.createTextVNode("Organization")])),_:1}),l.createVNode(ss.VSelect,{items:l.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Organization",class:"min-w-50",modelValue:v.value.organization,"onUpdate:modelValue":O[1]||(O[1]=L=>v.value.organization=L),clearable:""},null,8,["items","modelValue"]),l.createVNode(_s.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>O[11]||(O[11]=[l.createTextVNode("Team")])),_:1}),l.createVNode(ss.VSelect,{items:l.unref(m),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Team",class:"min-w-50",modelValue:v.value.team,"onUpdate:modelValue":O[2]||(O[2]=L=>v.value.team=L),clearable:""},null,8,["items","modelValue"])])])]),_:1},8,["loading"])],64))}}),v$={},y$={class:"double-ring-spinner-container"};function C$(n,e){return l.openBlock(),l.createElementBlock("div",y$,e[0]||(e[0]=[l.createElementVNode("div",{class:"spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])],-1)]))}const DT=ba(v$,[["render",C$],["__scopeId","data-v-00d7a69f"]]),E$={key:0,class:"_jspinner-overlay_jj"},LT=l.defineComponent({__name:"GlobalSpinner",setup(n){return(e,t)=>l.unref(_e)?(l.openBlock(),l.createElementBlock("div",E$,t[0]||(t[0]=[l.createElementVNode("div",{class:"j-double-ring-spinner-container"},[l.createElementVNode("div",{class:"j-global-spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])])],-1)]))):l.createCommentVNode("",!0)}}),xT=l.defineComponent({__name:"SubMenu",props:{title:{}},setup(n,{expose:e}){return e({props:n}),(r,o)=>(l.openBlock(),l.createBlock(Jt.VListItem,{onClick:o[0]||(o[0]=()=>{}),density:"compact"},{append:l.withCtx(()=>[l.createVNode(l.unref(xB))]),default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.title),1)]),_:1}),l.createVNode(hf.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:l.withCtx(()=>[l.renderSlot(r.$slots,"default")]),_:3})]),_:3}))}}),w$=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:cC,ColumnSettingsDialog:Df,ConfirmDialog:aC,ContextMenu:lC,CopyButton:xl,DeleteAllBtn:_f,DotsMenu:iC,EditButton:oC,FormHeadless:HE,FormMetadata:nu,GlobalScopeFilter:MT,GlobalSpinner:LT,JAvatar:sC,JBtn:Ay,JDialog:Ms,JForm:BE,JIconBtn:Sy,JSelect:LE,JTextArea:xE,JTextField:uE,ParentCard:Hl,SearchFilter:jl,SpinnerLoader:DT,SubMenu:xT,TabFormHeader:VE,TableAdvanced:qC,TableCard:Lf,TableCardsView:cE,TableHeader:jC,UiTable:uC},Symbol.toStringTag,{value:"Module"})),T$=JO(),b$={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0},km={"pt-BR":{placeholders:{selectFilter:"Selecionar filtro",visualize:"Visualizar",actions:"Ações",search:"Pesquisar"},dialogs:{columnSettings:{title:"Configurações de coluna"}},actions:{save:"Salvar",cancel:"Cancelar",edit:"Editar",delete:"Apagar",disable:"Desabilitar",confirm:"Confirmar",back:"Voltar"},forms:{metadata:{created:"Criado",updated:"Atualizado",modified:"Modificado",delegated:"Delegado"}},$vuetify:{dataFooter:{itemsPerPageAll:"Todos",itemsPerPageText:"Itens por página:",pageText:"{0}-{1} de {2}"}}},"en-US":{placeholders:{selectFilter:"Select a filter",visualize:"Visualize",actions:"Actions",search:"Search"},dialogs:{columnSettings:{title:"Column Settings"}},actions:{save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",disable:"Disable",back:"Back",confirm:"Confirm"},forms:{metadata:{created:"Created",updated:"Updated",modified:"Modified",delegated:"Delegated"}},$vuetify:{dataFooter:{itemsPerPageAll:"All",itemsPerPageText:"Items per page:",pageText:"{0}-{1} of {2}"}}}},I$=Object.keys(km),Cy=navigator.language,S$=I$.includes(Cy)?Cy:"pt-BR",UT=px({locale:S$,fallbackLocale:"en-US",messages:km});let hh=!1;const fh=l.ref(!1),Yn=l.ref([]),Ey=l.ref([]),Ht=l.ref(null),Zi=l.ref([]),A$=()=>{const n=Er(),e=async p=>{fh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await xo.getBranchList(w);C&&(Yn.value=C,hh=!0),fh.value=!1},t=async p=>(Yn.value.length||await e(p),Yn.value);function r(p){if(!Yn.value)throw new Error("Data not stored yet");const w=Na(Yn.value,p,["name","description"]);return p!==""?w:Yn.value}const o=p=>{Ey.value=p},a=p=>{Ht.value=ka.cloneDeep(p)},c=async p=>await xo.getBranch(p),d=async()=>{if(Ht.value!=null){const p=await xo.createBranch(Ht.value);return p!=null&&p.data.created_at&&(n.success("Branch created."),hh&&Yn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(Ht.value&&Ht.value.__id){const p=await xo.updateBranch(Ht.value);if(hh&&p){const w=Yn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Yn.value[w]=p.data,n.success("Branch updated.")):n.error("Unable to update item"),p}}else n.error("Unable to update item")},m=async()=>{if(Ht.value&&Ht.value.created_at){await xo.deactivateBranch(Ht.value.__id);const p=Yn.value.findIndex(w=>{var C;return w.__id===((C=Ht.value)==null?void 0:C.__id)});if(p!==-1)return Yn.value.splice(p,1),Ht.value;n.error("Unable to deactivate Domain")}};async function g(p){_e.value=!0;try{if(Ht.value&&Ht.value.__id){const w={...p,branch:Ht.value.__id};if(!await Pn.updateTeam(w)){n.error("Unable to link team");return}if(Zi.value.findIndex(k=>k.__id===p.__id)===-1)return n.success("Team added successfully."),Zi.value.push(w),w;n.info("Team already added.")}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{_e.value=!1}}async function v(p){if(_e.value=!0,Ht.value&&Ht.value.__id){const w={...p,branch:null};if(!await Pn.updateTeam(w))return;const T=Zi.value.findIndex(k=>k.__id===p.__id);if(T!==-1)return Zi.value.splice(T,1),_e.value=!1,Zi.value;throw new Error("Item not found to remove")}_e.value=!1}return{data:Yn,columns:Ey,item:Ht,loading:fh,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,branchTeams:Zi,linkTeam:g,unlinkTeam:v}};function k$(){const n=Pa("https://api.jplan.com.br/management/division"),{error:e}=Er();return{async getDivisionList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch Division list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getDivisionList:",r),e("Failed to fetch Division list");return}},async createDivision(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Division"),a}},async updateDivision(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e("Failed to update Division"),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Division"),a}},async getDivision(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e("Failed to fetch Division"),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Division"),a}},async activateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate Division"),new Error(a.data.error)}catch(a){throw console.error("Error in activateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Division"),a}},async deactivateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate Division"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Division"),a}}}}const aa=k$();let mh=!1;const gh=l.ref(!1),Jn=l.ref([]),wy=l.ref([]),$t=l.ref(null),ea=l.ref([]),N$=()=>{const n=Er(),e=async p=>{gh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await aa.getDivisionList(w);C&&(Jn.value=C,mh=!0),gh.value=!1},t=async p=>(Jn.value.length||await e(p),Jn.value);function r(p){if(!Jn.value)throw new Error("Data not stored yet");const w=Na(Jn.value,p,["name","description"]);return p!==""?w:Jn.value}const o=p=>{wy.value=p},a=p=>{$t.value=ka.cloneDeep(p)},c=async p=>await aa.getDivision(p),d=async()=>{if($t.value!=null){const p=await aa.createDivision($t.value);return p!=null&&p.data.created_at&&(n.success("Division created."),mh&&Jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(_e.value=!0,$t.value&&$t.value.__id){const p=await aa.updateDivision($t.value);if(mh&&(p!=null&&p.data.__id)){const w=Jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Jn.value[w]=p.data,n.success("Updated Division.")):n.error("Unable to update item"),_e.value=!1,p}}else _e.value=!1,n.error("Unable to update item")},m=async()=>{if(_e.value=!0,$t.value&&$t.value.created_at){await aa.deactivateDivision($t.value.__id);const p=Jn.value.findIndex(w=>{var C;return w.__id===((C=$t.value)==null?void 0:C.__id)});if(p!==-1)return Jn.value.splice(p,1),$t.value;n.error("Unable to deactivate Division")}_e.value=!1};async function g(p){_e.value=!0;try{if($t.value&&$t.value.__id){const w={...p,division:$t.value.__id};return await Lo.updateOrg(w)?(ea.value.findIndex(k=>k.__id===p.__id)===-1?(n.success("Organization added successfully."),ea.value.push(w)):n.info("Organization already added."),w):void 0}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{_e.value=!1}}async function v(p){if(_e.value=!0,$t.value&&$t.value.__id){const w={...p,division:null};if(!await Lo.updateOrg(w))return;const T=ea.value.findIndex(k=>k.__id===p.__id);if(T!==-1)ea.value.splice(T,1);else throw new Error("Item não encontrado para remoção")}else throw new Error("Item não está definido");return _e.value=!1,ea.value}return{data:Jn,columns:wy,item:$t,loading:gh,__init__:e,filterData:r,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgs:ea,linkDivision:g,unlinkDivision:v}};function R$(){const n=Pa("https://api.jplan.com.br/management/user"),{error:e}=Er();return{async getManageUserList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch User list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getManageUserList:",r),e("Failed to fetch User list");return}},async createManageUser(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create User"),a}},async updateManageUser(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e("Failed to update User"),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update User"),a}},async getManageUser(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e("Failed to fetch User"),new Error(a.data.error);return a.data}catch(a){console.error("Error in getManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch User");return}},async activateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate User"),new Error(a.data.error)}catch(a){throw console.error("Error in activateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate User"),a}},async deactivateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate User"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate User"),a}}}}const sa=R$();let ph=!1,_h=l.ref(!1);const Qn=l.ref([]),Ty=l.ref([]),Xn=l.ref(null),O$=l.ref(null),P$=l.ref([]),M$=()=>{const n=Er(),e=async g=>{_h.value=!0;const v=g?`_active eq true and ${g}`:"_active eq true",p=await sa.getManageUserList(v);p&&(Qn.value=p,ph=!0),_h.value=!1},t=async g=>(Qn.value.length||await e(g),Qn.value);function r(g){if(!Qn.value)throw new Error("Data not stored yet");const v=Na(Qn.value,g,["name","description"]);return g!==""?v:Qn.value}return{data:Qn,loading:_h,columns:Ty,item:Xn,filterData:r,__init__:e,getData:t,setColumns:g=>{Ty.value=g},setItem:g=>{Xn.value=ka.cloneDeep(g)},getItem:async g=>await sa.getManageUser(g),createItem:async()=>{if(Xn.value!=null){const g=crypto.randomUUID(),v=await sa.createManageUser({...Xn.value,__id:g});return v!=null&&v.data.created_at&&(n.success("User created."),ph&&Qn.value.push(v.data)),v==null?void 0:v.data}},updateItem:async()=>{if(_e.value=!0,Xn.value&&Xn.value.created_at){const g=await sa.updateManageUser(Xn.value);if(ph&&(g!=null&&g.data)){const v=Qn.value.findIndex(p=>p.__id===(g==null?void 0:g.data.__id));if(v!==-1)Qn.value[v]=g==null?void 0:g.data,n.success("User created.");else throw new Error("Unable to find item after update")}return _e.value=!1,g==null?void 0:g.data}},removeItem:async()=>{if(Xn.value&&Xn.value.created_at){try{await sa.deactivateManageUser(Xn.value.__id)}catch{n.error("Unable to deactivate user");return}const g=Qn.value.findIndex(v=>{var p;return v.__id===((p=Xn.value)==null?void 0:p.__id)});if(g!==-1)return Qn.value.splice(g,1),Xn.value}},userOrg:O$,userTeams:P$}},D$={defaultI18n:!0},L$=(n,e)=>{({...D$,...e},n.use(T$)),n.use(X0,b$),e.defaultI18n&&n.use(UT),Object.entries(w$).forEach(([t,r])=>{n.component(t,r)}),Object.entries(TO).forEach(([t,r])=>{n.provide(t,r)})},x$={install:L$};exports.ContextMenu=lC;exports.EmptyListImg=Ph;exports.EventBus=Bl;exports.FormHeadless=HE;exports.HttpCore=iB;exports.I18nMessages=km;exports.SpinnerLoader=DT;exports.TableCardsView=cE;exports.TableHeader=jC;exports.__spinner=_e;exports._export_sfc=ba;exports._sfc_main=uC;exports._sfc_main$1=qC;exports._sfc_main$10=_f;exports._sfc_main$11=oC;exports._sfc_main$12=Sy;exports._sfc_main$13=LE;exports._sfc_main$14=xE;exports._sfc_main$15=uE;exports._sfc_main$16=BE;exports._sfc_main$17=VE;exports._sfc_main$18=Hl;exports._sfc_main$19=sC;exports._sfc_main$2=Df;exports._sfc_main$20=cC;exports._sfc_main$21=Ms;exports._sfc_main$22=xT;exports._sfc_main$23=MT;exports._sfc_main$24=LT;exports._sfc_main$3=Lf;exports._sfc_main$4=jl;exports._sfc_main$5=aC;exports._sfc_main$6=xl;exports._sfc_main$7=iC;exports._sfc_main$8=nu;exports._sfc_main$9=Ay;exports.branchInstance=xo;exports.coreClient=Am;exports.createToastInterface=Cs;exports.dateFormat=cs;exports.divisionInstance=aa;exports.filterQuery=Na;exports.globalEventBus=pf;exports.i18n=UT;exports.index=x$;exports.manageUserInstance=sa;exports.msal=zt;exports.orgInstance=Lo;exports.provideToast=Q0;exports.scopedClient=Pa;exports.setupAuthGuard=f$;exports.teamInstance=Pn;exports.toastInjectionKey=Vl;exports.useAuth=Sm;exports.useBranchStore=A$;exports.useCustomizer=t0;exports.useDialog=Os;exports.useDivisionStore=N$;exports.useManageUserStore=M$;exports.useOrganizationStore=OT;exports.useSession=pu;exports.useTeamStore=PT;exports.useToast=Er;
113
+ ${c}`);return}throw Xv(e.error,e.error_description,e.suberror)?new Cr(e.error,e.error_description,e.suberror,e.timestamp||B.EMPTY_STRING,e.trace_id||B.EMPTY_STRING,e.correlation_id||B.EMPTY_STRING,e.claims||B.EMPTY_STRING,a):c}}async handleServerTokenResponse(e,t,r,o,a,c,d,h,m){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(x.HandleServerTokenResponse,e.correlation_id);let g;if(e.id_token){if(g=Ii(e.id_token||B.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&g.nonce!==a.nonce)throw j(JE);if(o.maxAge||o.maxAge===0){const T=g.auth_time;if(!T)throw j(Wf);cw(T,o.maxAge)}}this.homeAccountIdentifier=Ot.generateHomeAccountId(e.client_info||B.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,g);let v;a&&a.state&&(v=vr.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,g,c,a);let w;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),w=new T2(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(w)),d&&!h&&p.account){const T=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(T,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await wi.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,void 0,m)}await this.cacheStorage.saveCacheRecord(p,o.storeInCache,o.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&w&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(w))}return wi.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,e,m)}generateCacheRecord(e,t,r,o,a,c,d){const h=t.getPreferredCache();if(!h)throw j(Gf);const m=bw(a);let g,v;e.id_token&&a&&(g=ou(this.homeAccountIdentifier,h,e.id_token,this.clientId,m||""),v=cm(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,a,e.client_info,h,m,d,void 0,this.logger));let p=null;if(e.access_token){const T=e.scope?_t.fromString(e.scope):new _t(o.scopes||[]),k=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,I=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,N=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,O=r+k,L=O+I,$=N&&N>0?r+N:void 0;p=iu(this.homeAccountIdentifier,h,e.access_token,this.clientId,m||t.tenant||"",T.printScopes(),O,L,this.cryptoObj.base64Decode,$,e.token_type,c,e.key_id,o.claims,o.requestedClaimsHash)}let w=null;if(e.refresh_token){let T;if(e.refresh_token_expires_in){const k=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;T=r+k}w=lw(this.homeAccountIdentifier,h,e.refresh_token,this.clientId,e.foci,c,T)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:h,familyId:e.foci}),{account:v,idToken:g,accessToken:p,refreshToken:w,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,a,c,d,h,m){var O,L,$,G,D;let g=B.EMPTY_STRING,v=[],p=null,w,C,T=B.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===ze.POP&&!a.popKid){const se=new wa(e),{secret:ie,keyId:Q}=r.accessToken;if(!Q)throw j(qf);g=await se.signPopToken(ie,Q,a)}else g=r.accessToken.secret;v=_t.fromString(r.accessToken.target).asArray(),p=new Date(Number(r.accessToken.expiresOn)*1e3),w=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(T=r.appMetadata.familyId===ms?ms:"");const k=(c==null?void 0:c.oid)||(c==null?void 0:c.sub)||"",I=(c==null?void 0:c.tid)||"";h!=null&&h.spa_accountid&&r.account&&(r.account.nativeAccountId=h==null?void 0:h.spa_accountid);const N=r.account?nm(r.account.getAccountInfo(),void 0,c,(O=r.idToken)==null?void 0:O.secret):null;return{authority:t.canonicalAuthority,uniqueId:k,tenantId:I,scopes:v,account:N,idToken:((L=r==null?void 0:r.idToken)==null?void 0:L.secret)||"",idTokenClaims:c||{},accessToken:g,fromCache:o,expiresOn:p,extExpiresOn:w,refreshOn:C,correlationId:a.correlationId,requestId:m||B.EMPTY_STRING,familyId:T,tokenType:(($=r.accessToken)==null?void 0:$.tokenType)||B.EMPTY_STRING,state:d?d.userRequestState:B.EMPTY_STRING,cloudGraphHostName:((G=r.account)==null?void 0:G.cloudGraphHostName)||B.EMPTY_STRING,msGraphHost:((D=r.account)==null?void 0:D.msGraphHost)||B.EMPTY_STRING,code:h==null?void 0:h.spa_code,fromNativeBroker:!1}}}function cm(n,e,t,r,o,a,c,d,h,m,g){g==null||g.verbose("setCachedAccount called");const p=n.getAccountKeys().find(I=>I.startsWith(t));let w=null;p&&(w=n.getAccount(p,g));const C=w||Ot.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:a,environment:c,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:m},e,r),T=C.tenantProfiles||[],k=d||C.realm;if(k&&!T.find(I=>I.tenantId===k)){const I=tm(t,C.localAccountId,k,o);T.push(I)}return C.tenantProfiles=T,C}/*! @azure/msal-common v14.16.0 2024-11-05 */async function Dw(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class Lw extends am{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(x.GetAuthCodeUrl,e.correlationId);const t=await J(this.createAuthCodeUrlQueryString.bind(this),x.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return Me.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,h;if((d=this.performanceClient)==null||d.addQueueMeasurement(x.AuthClientAcquireToken,e.correlationId),!e.code)throw j(ZE);const r=Wr(),o=await J(this.executeTokenRequest.bind(this),x.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(h=o.headers)==null?void 0:h[un.X_MS_REQUEST_ID],c=new wi(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(o.body),J(c.handleServerTokenResponse.bind(c),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,a)}handleFragmentResponse(e,t){if(new wi(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw j(ow);return e}getLogoutUri(e){if(!e)throw Qe(pw);const t=this.createLogoutUrlQueryString(e);return Me.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var m,g;(m=this.performanceClient)==null||m.addQueueMeasurement(x.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=Me.appendQueryString(e.tokenEndpoint,r),a=await J(this.createTokenRequestBody.bind(this),x.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let c;if(t.clientInfo)try{const v=kl(t.clientInfo,this.cryptoUtils.base64Decode);c={credential:`${v.uid}${en.CLIENT_INFO_SEPARATOR}${v.utid}`,type:Un.HOME_ACCOUNT_ID}}catch(v){this.logger.verbose("Could not parse client info for CCS Header: "+v)}const d=this.createTokenRequestHeaders(c||t.ccsCredential),h={clientId:((g=t.tokenBodyParameters)==null?void 0:g.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return J(this.executePostToTokenEndpoint.bind(this),x.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,a,d,h,t.correlationId,x.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement(x.AuthClientCreateTokenRequestBody,e.correlationId);const t=new ps(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[Ei])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):ra.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Jh(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Dw(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(c.assertionType)}if(t.addGrantType($E.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===ze.POP){const c=new wa(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await J(c.generateCnf.bind(c),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===ze.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Qe(au);(!_r.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const c=kl(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${c.uid}${en.CLIENT_INFO_SEPARATOR}${c.utid}`,type:Un.HOME_ACCOUNT_ID}}catch(c){this.logger.verbose("Could not parse client info for CCS Header: "+c)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Un.HOME_ACCOUNT_ID:try{const c=da(r.credential);t.addCcsOid(c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case Un.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Yv])&&t.addExtraQueryParameters({[Yv]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var a,c;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(a=this.performanceClient)==null||a.addQueueMeasurement(x.AuthClientCreateQueryString,t);const r=new ps(t,this.performanceClient);r.addClientId(e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[Ei])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Jh(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==Ut.SELECT_ACCOUNT)if(e.sid&&e.prompt===Ut.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let h=this.extractLoginHint(e.account);if(h&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),h=null),h){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(h);try{const m=da(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===Ut.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(d);try{const m=da(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const m=da(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===ze.POP)){const d=new wa(this.cryptoUtils);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await J(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new ps(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const I2=300;class Zh extends am{constructor(e,t){super(e,t)}async acquireToken(e){var c,d;(c=this.performanceClient)==null||c.addQueueMeasurement(x.RefreshTokenClientAcquireToken,e.correlationId);const t=Wr(),r=await J(this.executeTokenRequest.bind(this),x.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(d=r.headers)==null?void 0:d[un.X_MS_REQUEST_ID],a=new wi(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),J(a.handleServerTokenResponse.bind(a),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Qe(gw);if((r=this.performanceClient)==null||r.addQueueMeasurement(x.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw j(zf);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await J(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof Cr&&o.errorCode===Pl,c=o instanceof Ko&&o.errorCode===Lv.INVALID_GRANT_ERROR&&o.subError===Lv.CLIENT_MISMATCH_ERROR;if(a||c)return J(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return J(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=Si(this.cacheManager.getRefreshToken.bind(this.cacheManager),x.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw Xh(Pl);if(r.expiresOn&&Yh(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||I2))throw Xh(sm);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||ze.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Un.HOME_ACCOUNT_ID}};try{return await J(this.acquireToken.bind(this),x.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof Cr&&c.subError===lu){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ua(r);this.cacheManager.removeRefreshToken(d)}throw c}}async executeTokenRequest(e,t){var h,m;(h=this.performanceClient)==null||h.addQueueMeasurement(x.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=Me.appendQueryString(t.tokenEndpoint,r),a=await J(this.createTokenRequestBody.bind(this),x.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),c=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((m=e.tokenBodyParameters)==null?void 0:m.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return J(this.executePostToTokenEndpoint.bind(this),x.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,c,d,e.correlationId,x.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a,c;(o=this.performanceClient)==null||o.addQueueMeasurement(x.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new ps(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[Ei])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(c=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),r.addGrantType($E.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Jh(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await Dw(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===ze.POP){const d=new wa(this.cryptoUtils,this.performanceClient);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await J(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}else if(e.authenticationScheme===ze.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw Qe(au);if((!_r.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Un.HOME_ACCOUNT_ID:try{const d=da(e.ccsCredential.credential);r.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case Un.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class S2 extends am{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Ra]});return o===Po.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Zh(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof ru&&r.errorCode===so)return new Zh(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var h;(h=this.performanceClient)==null||h.addQueueMeasurement(x.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Po.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!_r.isEmptyObj(e.claims))throw this.setCacheOutcome(Po.FORCE_REFRESH_OR_CLAIMS,e.correlationId),j(so);if(!e.account)throw j(zf);const r=e.account.tenantId||g2(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(a){if(tV(a.cachedAt)||Yh(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Po.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),j(so);a.refreshOn&&Yh(a.refreshOn,0)&&(t=Po.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Po.NO_CACHED_ACCESS_TOKEN,e.correlationId),j(so);const c=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await J(this.generateResultFromCacheRecord.bind(this),x.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==Po.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(x.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Ii(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw j(Wf);cw(a,t.maxAge)}return wi.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const A2={sendGetRequestAsync:()=>Promise.reject(j(Se)),sendPostRequestAsync:()=>Promise.reject(j(Se))};/*! @azure/msal-common v14.16.0 2024-11-05 */const Zv=",",xw="|";function k2(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:a}=n,c=new Map([[0,[t,r]],[2,[o,a]]]);let d=[];if(e!=null&&e.length){if(d=e.split(Zv),d.length<4)return e}else d=Array.from({length:4},()=>xw);return c.forEach((h,m)=>{var g,v;h.length===2&&((g=h[0])!=null&&g.length)&&((v=h[1])!=null&&v.length)&&N2({skuArr:d,index:m,skuName:h[0],skuVersion:h[1]})}),d.join(Zv)}function N2(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(xw))}class Ns{constructor(e,t){this.cacheOutcome=Po.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||B.EMPTY_STRING,this.wrapperVer=e.wrapperVer||B.EMPTY_STRING,this.telemetryCacheKey=Kt.CACHE_KEY+en.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Kt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(Kt.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),c=[e,a].join(Kt.VALUE_SEPARATOR);return[Kt.SCHEMA_VERSION,c,o].join(Kt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Ns.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Kt.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(Kt.VALUE_SEPARATOR),a=e.errors.length,c=t<a?Kt.OVERFLOW_TRUE:Kt.OVERFLOW_FALSE,d=[a,c].join(Kt.VALUE_SEPARATOR);return[Kt.SCHEMA_VERSION,e.cacheHits,r,o,d].join(Kt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Kt.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof ct?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Kt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=Ns.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const a=e.errors.length;for(t=0;t<a;t++){const c=e.failedRequests[2*t]||B.EMPTY_STRING,d=e.failedRequests[2*t+1]||B.EMPTY_STRING,h=e.errors[t]||B.EMPTY_STRING;if(o+=c.toString().length+d.toString().length+h.length+3,o<Kt.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||B.EMPTY_STRING),e.push(this.regionSource||B.EMPTY_STRING),e.push(this.regionOutcome||B.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return k2(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Uw="missing_kid_error",Fw="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const R2={[Uw]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Fw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class lm extends ct{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,lm.prototype)}}function ey(n){return new lm(n,R2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class um{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw ey(Uw);if(!e.alg)throw ey(Fw);const t=new um({typ:e.typ||BB.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class ty{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class O2{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:m2.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new ty}}startPerformanceMeasurement(){return new ty}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dm="pkce_not_created",ef="crypto_nonexistent",uu="empty_navigate_uri",Bw="hash_empty_error",hm="no_state_in_hash",Vw="hash_does_not_contain_known_properties",Hw="unable_to_parse_state",$w="state_interaction_type_mismatch",Kw="interaction_in_progress",Ww="popup_window_error",zw="empty_window_error",Ti="user_cancelled",P2="monitor_popup_timeout",Gw="monitor_window_timeout",qw="redirect_in_iframe",jw="block_iframe_reload",Yw="block_nested_popups",M2="iframe_closed_prematurely",du="silent_logout_unsupported",Jw="no_account_error",D2="silent_prompt_value_error",Qw="no_token_request_cache_error",Xw="unable_to_parse_token_request_cache_error",fm="no_cached_authority_error",L2="auth_request_not_set_error",x2="invalid_cache_type",hu="non_browser_environment",oa="database_not_open",Ml="no_network_connectivity",Zw="post_request_failed",eT="get_request_failed",tf="failed_to_parse_response",tT="unable_to_load_token",mm="crypto_key_not_found",nT="auth_code_required",rT="auth_code_or_nativeAccountId_required",oT="spa_code_and_nativeAccountId_present",gm="database_unavailable",iT="unable_to_acquire_token_from_native_platform",aT="native_handshake_timeout",sT="native_extension_not_installed",Hs="native_connection_not_established",cT="uninitialized_public_client_application",lT="native_prompt_not_supported",uT="invalid_base64_string",dT="invalid_pop_token_request",hT="failed_to_build_headers",fT="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const oo="For more visit: aka.ms/msaljs/browser-errors",U2={[dm]:"The PKCE code challenge and verifier could not be generated.",[ef]:"The crypto object or function is not available.",[uu]:"Navigation URI is empty. Please check stack trace for more info.",[Bw]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${oo}`,[hm]:"Hash does not contain state. Please verify that the request originated from msal.",[Vw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${oo}`,[Hw]:"Unable to parse state. Please verify that the request originated from msal.",[$w]:"Hash contains state but the interaction type does not match the caller.",[Kw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${oo}`,[Ww]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[zw]:"window.open returned null or undefined window object.",[Ti]:"User cancelled the flow.",[P2]:`Token acquisition in popup failed due to timeout. ${oo}`,[Gw]:`Token acquisition in iframe failed due to timeout. ${oo}`,[qw]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[jw]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${oo}`,[Yw]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[M2]:"The iframe being monitored was closed prematurely.",[du]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Jw]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[D2]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Qw]:"No token request found in cache.",[Xw]:"The cached token request could not be parsed.",[fm]:"No cached authority found.",[L2]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[x2]:"Invalid cache type",[hu]:"Login and token requests are not supported in non-browser environments.",[oa]:"Database is not open!",[Ml]:"No network connectivity. Check your internet connection.",[Zw]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[eT]:"Network request failed. Please check the network trace to determine root cause.",[tf]:"Failed to parse network response. Check network trace.",[tT]:"Error loading token to cache.",[mm]:"Cryptographic Key or Keypair not found in browser storage.",[nT]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[rT]:"An authorization code or nativeAccountId must be provided to this flow.",[oT]:"Request cannot contain both spa code and native account id.",[gm]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[iT]:`Unable to acquire token from native platform. ${oo}`,[aT]:"Timed out while attempting to establish connection to browser extension",[sT]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Hs]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${oo}`,[cT]:`You must call and await the initialize function before attempting to call any other MSAL API. ${oo}`,[lT]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[uT]:"Invalid base64 encoded string.",[dT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[hT]:"Failed to build request headers object.",[fT]:"Failed to parse response headers"};class $s extends ct{constructor(e,t){super(e,U2[e],t),Object.setPrototypeOf(this,$s.prototype),this.name="BrowserAuthError"}}function oe(n,e){return new $s(n,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Mn={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ha={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},mi={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},_n={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},ny={GET:"GET",POST:"POST"},$e={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Oo={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},zc={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},rt={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var ce;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(ce||(ce={}));const ry={scopes:Ra},mT="jwk",nf="msal.db",F2=1,B2=`${nf}.keys`,On={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},V2=[On.Default,On.Skip,On.RefreshTokenAndNetwork],H2="msal.browser.log.level",$2="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Gc(n){return encodeURIComponent(pm(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function fu(n){return gT(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function pm(n){return gT(new TextEncoder().encode(n))}function gT(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const K2="RSASSA-PKCS1-v1_5",pT="SHA-256",W2=2048,z2=new Uint8Array([1,0,1]),oy="0123456789abcdef",iy=new Uint32Array(1),G2="crypto_subtle_undefined",_m={name:K2,hash:pT,modulusLength:W2,publicExponent:z2};function q2(n){if(!window)throw oe(hu);if(!window.crypto)throw oe(ef);if(!n&&!window.crypto.subtle)throw oe(ef,G2)}async function _T(n,e,t){e==null||e.addQueueMeasurement(x.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(pT,o)}function j2(n){return window.crypto.getRandomValues(n)}function ih(){return window.crypto.getRandomValues(iy),iy[0]}function mo(){const n=Date.now(),e=ih()*1024+(ih()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=ih();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=a>>>24,t[13]=a>>>16,t[14]=a>>>8,t[15]=a;let c="";for(let d=0;d<t.length;d++)c+=oy.charAt(t[d]>>>4),c+=oy.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(c+="-");return c}async function Y2(n,e){return window.crypto.subtle.generateKey(_m,n,e)}async function ah(n){return window.crypto.subtle.exportKey(mT,n)}async function J2(n,e,t){return window.crypto.subtle.importKey(mT,n,_m,e,t)}async function Q2(n,e){return window.crypto.subtle.sign(_m,n,e)}async function vT(n){const e=await _T(n),t=new Uint8Array(e);return fu(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Rs="storage_not_supported",rf="stubbed_public_client_application_called",Dl="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const fl={[Rs]:"Given storage configuration option was not supported.",[rf]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[Dl]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};fl[Rs],fl[rf],fl[Dl];class vm extends ct{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,vm.prototype)}}function ym(n){return new vm(n,fl[n])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function X2(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function Z2(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Cm(){return window.parent!==window}function eH(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Mn.POPUP_NAME_PREFIX}.`)===0}function co(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function tH(){const e=new Me(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function nH(){if(Me.hashContainsKnownProperties(window.location.hash)&&Cm())throw oe(jw)}function rH(n){if(Cm()&&!n)throw oe(qw)}function oH(){if(eH())throw oe(Yw)}function yT(){if(typeof window>"u")throw oe(hu)}function CT(n){if(!n)throw oe(cT)}function Em(n){yT(),nH(),oH(),CT(n)}function ay(n,e){if(Em(n),rH(e.system.allowRedirectInIframe),e.cache.cacheLocation===_n.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw ym(Dl)}function ET(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function iH(){return mo()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ll{navigateInternal(e,t){return Ll.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Ll.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class aH{async sendGetRequestAsync(e,t){let r,o={},a=0;const c=sy(t);try{r=await fetch(e,{method:ny.GET,headers:c})}catch{throw oe(window.navigator.onLine?eT:Ml)}o=cy(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch{throw Jv(oe(tf),a,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=sy(t);let a,c=0,d={};try{a=await fetch(e,{method:ny.POST,headers:o,body:r})}catch{throw oe(window.navigator.onLine?Zw:Ml)}d=cy(a.headers);try{return c=a.status,{headers:d,body:await a.json(),status:c}}catch{throw Jv(oe(tf),c,d)}}}function sy(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw oe(hT)}}function cy(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw oe(fT)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const sH=6e4,of=1e4,cH=3e4,lH=2e3;function uH({auth:n,cache:e,system:t,telemetry:r},o){const a={clientId:B.EMPTY_STRING,authority:`${B.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:B.EMPTY_STRING,authorityMetadata:B.EMPTY_STRING,redirectUri:typeof window<"u"?co():"",postLogoutRedirectUri:B.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:ho.AAD,OIDCOptions:{serverResponseType:Vs.FRAGMENT,defaultScopes:[B.OPENID_SCOPE,B.PROFILE_SCOPE,B.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Yf.None,tenant:B.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},c={cacheLocation:_n.SessionStorage,temporaryCacheLocation:_n.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===_n.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:et.Info,piiLoggingEnabled:!1},m={...{...Nw,loggerOptions:d,networkClient:o?new aH:A2,navigationClient:new Ll,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||sH,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||of,navigateFrameWait:0,redirectNavigationTimeout:cH,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||lH,pollIntervalMilliseconds:Mn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},g={application:{appName:B.EMPTY_STRING,appVersion:B.EMPTY_STRING},client:new O2};if((n==null?void 0:n.protocolMode)!==ho.OIDC&&(n!=null&&n.OIDCOptions)&&new $o(m.loggerOptions).warning(JSON.stringify(Qe(Ew))),n!=null&&n.protocolMode&&n.protocolMode!==ho.AAD&&(m!=null&&m.allowNativeBroker))throw Qe(ww);return{auth:{...a,...n,OIDCOptions:{...a.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...c,...e},system:m,telemetry:{...g,...r}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dH="@azure/msal-browser",mu="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class wm{static loggerCallback(e,t){switch(e){case et.Error:console.error(t);return;case et.Info:console.info(t);return;case et.Verbose:console.debug(t);return;case et.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var h;this.browserEnvironment=typeof window<"u",this.config=uH(e,this.browserEnvironment);let t;try{t=window[_n.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(H2),o=(h=t==null?void 0:t.getItem($2))==null?void 0:h.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,c={...this.config.system.loggerOptions},d=r&&Object.keys(et).includes(r)?et[r]:void 0;d&&(c.loggerCallback=wm.loggerCallback,c.logLevel=d),a!==void 0&&(c.piiLoggingEnabled=a),this.logger=new $o(c,dH,mu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class bi extends wm{getModuleName(){return bi.MODULE_NAME}getId(){return bi.ID}async initialize(){return this.available=typeof window<"u",this.available}}bi.MODULE_NAME="";bi.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function $r(n){return new TextDecoder().decode(hH(n))}function hH(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw oe(uT)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fH{constructor(){this.dbName=nf,this.version=F2,this.tableName=B2,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(oe(gm)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(oe(oa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(oe(oa));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),r()}),d.addEventListener("error",h=>{this.closeConnection(),o(h)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(oe(oa));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);c.addEventListener("success",()=>{this.closeConnection(),t()}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(oe(oa));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",c=>{const d=c;this.closeConnection(),e(d.target.result)}),a.addEventListener("error",c=>{this.closeConnection(),t(c)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(oe(oa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result===1)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(nf),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class af{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class mH{constructor(e){this.inMemoryCache=new af,this.indexedDBCache=new fH,this.logger=e}handleDatabaseAccessError(e){if(e instanceof $s&&e.errorCode===gm)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ta{constructor(e,t,r){this.logger=e,q2(r??!1),this.cache=new mH(this.logger),this.performanceClient=t}createNewGuid(){return mo()}base64Encode(e){return pm(e)}base64Decode(e){return $r(e)}base64UrlEncode(e){return Gc(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var g;const t=(g=this.performanceClient)==null?void 0:g.startMeasurement(x.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Y2(Ta.EXTRACTABLE,Ta.POP_KEY_USAGES),o=await ah(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},c=ly(a),d=await this.hashString(c),h=await ah(r.privateKey),m=await J2(h,!1,["sign"]);return await this.cache.setItem(d,{privateKey:m,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var O;const a=(O=this.performanceClient)==null?void 0:O.startMeasurement(x.CryptoOptsSignJwt,o),c=await this.cache.getItem(t);if(!c)throw oe(mm);const d=await ah(c.publicKey),h=ly(d),m=Gc(JSON.stringify({kid:t})),g=um.getShrHeaderString({...r==null?void 0:r.header,alg:d.alg,kid:m}),v=Gc(g);e.cnf={jwk:JSON.parse(h)};const p=Gc(JSON.stringify(e)),w=`${v}.${p}`,T=new TextEncoder().encode(w),k=await Q2(c.privateKey,T),I=fu(new Uint8Array(k)),N=`${w}.${I}`;return a&&a.end({success:!0}),N}async hashString(e){return vT(e)}}Ta.POP_KEY_USAGES=["sign","verify"];Ta.EXTRACTABLE=!0;function ly(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class gH{constructor(){if(!window.localStorage)throw ym(Rs)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class pH{constructor(){if(!window.sessionStorage)throw ym(Rs)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function wT(n,e){if(!e)return null;try{return vr.parseRequestState(n,e).libraryState.meta}catch{throw j(Ca)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const _H=24*60*60*1e3;class vH{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[c,...d]=decodeURIComponent(a).trim().split("="),h=d.join("=");if(c===t)return h}return""}setItem(e,t,r,o=!0){let a=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){const c=yH(r);a+=`expires=${c};`}o&&(a+="Secure;"),document.cookie=a}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function yH(n){const e=new Date;return new Date(e.getTime()+n*_H).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class sf extends Ea{constructor(e,t,r,o,a,c){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new af,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new vH,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=c}setupBrowserStorage(e){try{switch(e){case _n.LocalStorage:return new gH;case _n.SessionStorage:return new pH;case _n.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=_n.MemoryStorage,new af}migrateCacheEntries(){const e=`${B.CACHE_PREFIX}.${Dt.ID_TOKEN}`,t=`${B.CACHE_PREFIX}.${Dt.CLIENT_INFO}`,r=`${B.CACHE_PREFIX}.${Dt.ERROR}`,o=`${B.CACHE_PREFIX}.${Dt.ERROR_DESC}`,a=this.browserStorage.getItem(e),c=this.browserStorage.getItem(t),d=this.browserStorage.getItem(r),h=this.browserStorage.getItem(o),m=[a,c,d,h];[Dt.ID_TOKEN,Dt.CLIENT_INFO,Dt.ERROR,Dt.ERROR_DESC].forEach((v,p)=>{const w=m[p];w&&this.setTemporaryCache(v,w,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Oo.ACCOUNT_KEYS),t=this.getItem(`${Oo.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(o=>{if(this.isCredentialKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);if(c&&c.hasOwnProperty("credentialType"))switch(c.credentialType){case me.ID_TOKEN:if(Vv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,me.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${o}`);break;case me.ACCESS_TOKEN:case me.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Bv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,me.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${o}`);break;case me.REFRESH_TOKEN:if(Hv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,me.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${o}`);break}}}if(this.isAccountKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);c&&Ot.isAccountEntity(c)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${o} found, saving key to account key map`),this.addAccountKeyToMap(o))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!Ot.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):Ea.toObject(new Ot,r)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Oo.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(Oo.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(Oo.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,me.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,me.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,me.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Oo.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case me.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case me.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case me.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),j(jh)}this.setItem(`${Oo.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case me.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case me.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const a=r.accessToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case me.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const c=r.refreshToken.indexOf(e);c>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(c,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),j(jh)}this.setItem(`${Oo.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Vv(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ua(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,me.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Bv(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ua(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,me.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Hv(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,me.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ua(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,me.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!uV(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=lV(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!sV(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&dV(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(zc.WRAPPER_SKU,e),this.internalStorage.setItem(zc.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(zc.WRAPPER_SKU)||B.EMPTY_STRING,t=this.internalStorage.getItem(zc.WRAPPER_VER)||B.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(Dt.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const o=this.generateCacheKey(Dt.ACTIVE_ACCOUNT),a=this.getItem(o);if(!a)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const c=this.getAccountInfoFilteredBy({localAccountId:a});return c?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(c),c):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(Dt.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(Dt.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(o)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!cV(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===_n.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(B.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(B.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(x.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(a=>{const c=this.getAccessTokenCredential(a);c!=null&&c.requestedClaimsHash&&a.includes(c.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(a))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):_r.startsWith(e,B.CACHE_PREFIX)||_r.startsWith(e,Dt.ADAL_ID_TOKEN)?e:`${B.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=vr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${$e.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=vr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${$e.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=vr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${$e.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const c=this.generateStateKey(e);this.setTemporaryCache(c,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const h=this.generateAuthorityKey(e);if(this.setTemporaryCache(h,r,!1),a){const m={credential:a.homeAccountId,type:Un.HOME_ACCOUNT_ID};this.setTemporaryCache($e.CCS_CREDENTIAL,JSON.stringify(m),!0)}else if(o){const m={credential:o,type:Un.UPN};this.setTemporaryCache($e.CCS_CREDENTIAL,JSON.stringify(m),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey($e.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey($e.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey($e.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey($e.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey($e.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey($e.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||B.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf($e.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=wT(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=pm(JSON.stringify(e));this.setTemporaryCache($e.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache($e.REQUEST_PARAMS,!0);if(!t)throw oe(Qw);let r;try{r=JSON.parse($r(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),oe(Xw)}if(this.removeTemporaryItem(this.generateCacheKey($e.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),a=this.getTemporaryCache(o);if(!a)throw oe(fm);r.authority=a}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache($e.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${B.CACHE_PREFIX}.${$e.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${B.CACHE_PREFIX}.${$e.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw oe(Kw);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(Dt.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Dt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(Dt.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(Dt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=Ii(r,$r);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const r=ua(t);if(e!==r){const o=this.getItem(e);if(o)return this.browserStorage.removeItem(e),this.setItem(r,o),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var d,h,m;const r=ou((d=e.account)==null?void 0:d.homeAccountId,(h=e.account)==null?void 0:h.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const a=iu((m=e.account)==null?void 0:m.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,$r,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),c={idToken:r,accessToken:a};return this.saveCacheRecord(c)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof ma&&this.performanceClient&&r)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},r)}catch{}throw o}}}const CH=(n,e)=>{const t={cacheLocation:_n.MemoryStorage,temporaryCacheLocation:_n.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new sf(n,t,Al,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function EH(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function wH(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function TH(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function bH(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function IH(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function SH(n,e){e.setActiveAccount(n)}function AH(n){return n.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const fe={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.28.1 2025-01-14 */class kH{constructor(e){this.eventCallbacks=new Map,this.logger=e||new $o({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||iH();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const a={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([c,d],h)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${h}: ${e}`),c.apply(null,[a]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class TT{constructor(e,t,r,o,a,c,d,h,m){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=c,this.nativeMessageHandler=h,this.correlationId=m||mo(),this.logger=o.clone(Mn.MSAL_SKU,mu,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){Ot.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Ot.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return Me.getAbsoluteUrl(t,co())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Ns(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,c=r!=null&&r.length?r==="true":this.config.auth.instanceAware,d=t&&c?this.config.auth.authority.replace(Me.getDomainFromUrl(a),t.environment):a,h=Qt.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),m=await J(Pw,x.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(h,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!m.isAlias(t.environment))throw Qe(Tw);return m}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const NH=32;async function RH(n,e,t){n.addQueueMeasurement(x.GeneratePkceCodes,t);const r=Si(OH,x.GenerateCodeVerifier,e,n,t)(n,e,t),o=await J(PH,x.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function OH(n,e,t){try{const r=new Uint8Array(NH);return Si(j2,x.GetRandomValues,e,n,t)(r),fu(r)}catch{throw oe(dm)}}async function PH(n,e,t,r){e.addQueueMeasurement(x.GenerateCodeChallengeFromVerifier,r);try{const o=await J(_T,x.Sha256Digest,t,e,r)(n,e,r);return fu(new Uint8Array(o))}catch{throw oe(dm)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function Tm(n,e,t,r){t.addQueueMeasurement(x.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,a=[...n&&n.scopes||[]],c={...n,correlationId:n.correlationId,authority:o,scopes:a};if(!c.authenticationScheme)c.authenticationScheme=ze.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(c.authenticationScheme===ze.SSH){if(!n.sshJwk)throw Qe(au);if(!n.sshKid)throw Qe(Cw)}r.verbose(`Authentication Scheme set to "${c.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!_r.isEmptyObj(n.claims)&&(c.requestedClaimsHash=await vT(n.claims)),c}async function MH(n,e,t,r,o){r.addQueueMeasurement(x.InitializeSilentRequest,n.correlationId);const a=await J(Tm,x.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...a,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Oa extends TT{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await J(RH,x.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:B.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=B.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||mo(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=Me.getAbsoluteUrl(e.postLogoutRedirectUri,co())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=Me.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,co())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=Me.getAbsoluteUrl(co(),co())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Lw(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}=e;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await J(this.getDiscoveredAuthority.bind(this),x.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}),h=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:h.loggerCallback,piiLoggingEnabled:h.piiLoggingEnabled,logLevel:h.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Mn.MSAL_SKU,version:mu,cpu:B.EMPTY_STRING,os:B.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},a=vr.setRequestState(this.browserCrypto,e&&e.state||B.EMPTY_STRING,o),d={...await J(Tm,x.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||mo(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const h=e.account||this.browserStorage.getActiveAccount();if(h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),d.account=h),!d.loginHint&&!h){const m=this.browserStorage.getLegacyLoginHint();m&&(d.loginHint=m)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const DH="ContentError",bT="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const LH="USER_INTERACTION_REQUIRED",xH="USER_CANCEL",UH="NO_NETWORK",FH="PERSISTENT_ERROR",BH="DISABLED",VH="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const HH=-2147186943,$H={[bT]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Ur extends ct{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,Ur.prototype),this.name="NativeAuthError",this.ext=r}}function ia(n){if(n.ext&&n.ext.status&&(n.ext.status===FH||n.ext.status===BH)||n.ext&&n.ext.error&&n.ext.error===HH)return!0;switch(n.errorCode){case DH:return!0;default:return!1}}function cf(n,e,t){if(t&&t.status)switch(t.status){case VH:return Xh(Mw);case LH:return new Cr(n,e);case xH:return oe(Ti);case UH:return oe(Ml)}return new Ur(n,$H[n]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class IT extends Oa{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(rt.acquireTokenSilent_silentFlow),r=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new S2(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const c=(await J(o.acquireCachedToken.bind(o),x.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),c}catch(a){throw a instanceof $s&&a.errorCode===mm&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ga extends TT{constructor(e,t,r,o,a,c,d,h,m,g,v,p){var C;super(e,t,r,o,a,c,h,m,p),this.apiId=d,this.accountId=g,this.nativeMessageHandler=m,this.nativeStorageManager=v,this.silentCacheClient=new IT(e,this.nativeStorageManager,r,o,a,c,h,m,p),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const w=this.nativeMessageHandler.getExtensionId()===ha.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=Ns.makeExtraSkuString({libraryName:Mn.MSAL_SKU,libraryVersion:mu,extensionName:w,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[l2]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),r=Wr();try{const o=await this.initializeNativeRequest(e);try{const m=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),m}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=o,c={method:mi.GetToken,request:a},d=await this.nativeMessageHandler.sendMessage(c),h=this.validateNativeResponse(d);return await this.handleNativeResponse(h,o,r).then(m=>(t.end({success:!0,isNativeBroker:!0,requestId:m.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),m)).catch(m=>{throw t.end({success:!1,errorCode:m.errorCode,subErrorCode:m.subError,isNativeBroker:!0}),m})}catch(o){throw o instanceof Ur&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:_t.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),j(Gh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw j(Gh);try{const o=this.createSilentCacheRequest(t,r),a=await this.silentCacheClient.acquireToken(o),c={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:c}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),a={method:mi.GetToken,request:o};try{const h=await this.nativeMessageHandler.sendMessage(a);this.validateNativeResponse(h)}catch(h){if(h instanceof Ur&&(this.serverTelemetryManager.setNativeBrokerErrorCode(h.errorCode),ia(h)))throw h}this.browserStorage.setTemporaryCache($e.NATIVE_REQUEST,JSON.stringify(o),!0);const c={apiId:rt.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,c)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey($e.NATIVE_REQUEST));const c={method:mi.GetToken,request:a},d=Wr();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const h=await this.nativeMessageHandler.sendMessage(c);this.validateNativeResponse(h);const m=this.handleNativeResponse(h,a,d);this.browserStorage.setInteractionInProgress(!1);const g=await m;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),g}catch(h){throw this.browserStorage.setInteractionInProgress(!1),h}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Ii(e.id_token,$r),a=this.createHomeAccountIdentifier(e,o),c=(g=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:g.homeAccountId;if(a!==c&&e.account.id!==t.accountId)throw cf(bT);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),h=cm(this.browserStorage,d,a,$r,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),m=await this.generateAuthenticationResult(e,t,o,h,d.canonicalAuthority,r);return this.cacheAccount(h),this.cacheNativeTokens(e,t,a,o,e.access_token,m.tenantId,r),m}createHomeAccountIdentifier(e,t){return Ot.generateHomeAccountId(e.client_info||B.EMPTY_STRING,fr.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?_t.fromString(e.scope):_t.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===ze.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new wa(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw j(qf);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,a,c){const d=this.addTelemetryFromNativeResponse(e),h=e.scope?_t.fromString(e.scope):_t.fromString(t.scope),m=e.account.properties||{},g=m.UID||r.oid||r.sub||B.EMPTY_STRING,v=m.TenantId||r.tid||B.EMPTY_STRING,p=nm(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const w=await this.generatePopAccessToken(e,t),C=t.tokenType===ze.POP?ze.POP:ze.BEARER;return{authority:a,uniqueId:g,tenantId:v,scopes:h.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:w,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(c+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,a,c,d){const h=ou(r,t.authority,e.id_token||"",t.clientId,o.tid||""),m=t.tokenType===ze.POP?B.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,g=d+m,v=this.generateScopes(e,t),p=iu(r,t.authority,a,t.clientId,o.tid||c,v.printScopes(),g,0,$r,void 0,t.tokenType,void 0,t.keyId),w={idToken:h,accessToken:p};this.nativeStorageManager.saveCacheRecord(w,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw KE(Hf,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new Me(t);r.validateAsUri();const{scopes:o,...a}=e,c=new _t(o||[]);c.appendScopes(Ra);const d=()=>{switch(this.apiId){case rt.ssoSilent:case rt.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Ut.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Ut.NONE:case Ut.CONSENT:case Ut.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),oe(lT)}},h={...a,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:c.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(h.signPopToken&&e.popKid)throw oe(dT);if(this.handleExtraBrokerParams(h),h.extraParameters=h.extraParameters||{},h.extraParameters.telemetry=ha.MATS_TELEMETRY,e.authenticationScheme===ze.POP){const m={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},g=new wa(this.browserCrypto);let v;if(h.keyId)v=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:h.keyId})),h.signPopToken=!1;else{const p=await J(g.generateCnf.bind(g),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(m,this.logger);v=p.reqCnfString,h.keyId=p.kid,h.signPopToken=!0}h.reqCnf=v}return this.addRequestSKUs(h),h}handleExtraBrokerParams(e){var a;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(im)&&e.extraParameters.hasOwnProperty(Qh)&&e.extraParameters.hasOwnProperty(Ei);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Qh],r=e.extraParameters[Ei]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fr{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(x.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ha.CHANNEL_ID,extensionId:this.extensionId,responseId:mo(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Fr(e,t,r,ha.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new Fr(e,t,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ha.CHANNEL_ID,extensionId:this.extensionId,responseId:mo(),body:{method:mi.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(oe(aT)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ha.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===mi.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(oe(sT))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const a=t.body.method;if(a===mi.Response){if(!r)return;const c=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(c)}`),c.status!=="Success")r.reject(cf(c.code,c.description,c.ext));else if(c.result)c.result.code&&c.result.description?r.reject(cf(c.result.code,c.result.description,c.result.ext)):r.resolve(c.result);else throw KE(Hf,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(a===mi.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case ze.BEARER:case ze.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class bm{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(x.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof Ko&&o.subError===Ti?oe(Ti):o}return J(this.handleCodeResponseFromServer.bind(this),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(x.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await J(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(t);a&&(this.authCodeRequest.ccsCredential=a)}return await J(this.authModule.acquireToken.bind(this.authModule),x.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Un.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Un.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function ST(n,e,t){const r=Rl(n);if(!r)throw Iw(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),oe(Vw)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),oe(Bw));return r}function KH(n,e,t){if(!n.state)throw oe(hm);const r=wT(e,n.state);if(!r)throw oe(Hw);if(r.interactionType!==t)throw oe($w)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class WH extends Oa{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=h}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Ra,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,a))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var a;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(rt.acquireTokenPopup),o=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Popup);ET(o.authority);try{const c=await J(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),d=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),h=Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let m;h&&(m=this.performanceClient.startMeasurement(x.FetchAccountIdWithNativeBroker,e.correlationId));const g=await d.getAuthCodeUrl({...o,nativeBroker:h}),v=new bm(d,this.browserStorage,c,this.logger,this.performanceClient),p=this.initiateAuthRequest(g,t);this.eventHandler.emitEvent(fe.POPUP_OPENED,ce.Popup,{popupWindow:p},null);const w=await this.monitorPopupForHash(p,t.popupWindowParent),C=Si(ST,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(xr.removeThrottle(this.browserStorage,this.config.auth.clientId,c),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),m&&m.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw oe(Hs);const k=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:I}=vr.parseRequestState(this.browserCrypto,o.state);return await k.acquireToken({...o,state:I,prompt:void 0})}return await v.handleCodeResponse(C,o)}catch(c){throw(a=t.popup)==null||a.close(),c instanceof ct&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),c}}async logoutPopupAsync(e,t,r,o){var c,d,h,m;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(fe.LOGOUT_START,ce.Popup,e);const a=this.initializeServerTelemetryManager(rt.logoutPopup);try{await this.clearCacheOnLogout(e.account);const g=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{g.authority.endSessionEndpoint}catch{if((c=e.account)!=null&&c.homeAccountId&&e.postLogoutRedirectUri&&g.authority.protocolMode===ho.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Popup,e),o){const w={apiId:rt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=Me.getAbsoluteUrl(o,co());await this.navigationClient.navigateInternal(C,w)}(h=t.popup)==null||h.close();return}}const v=g.getLogoutUri(e);this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Popup,e);const p=this.openPopup(v,t);if(this.eventHandler.emitEvent(fe.POPUP_OPENED,ce.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const w={apiId:rt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=Me.getAbsoluteUrl(o,co());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,w)}else this.logger.verbose("No main window navigation requested")}catch(g){throw(m=t.popup)==null||m.close(),g instanceof ct&&(g.setCorrelationId(this.correlationId),a.cacheFailedRequest(g)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(fe.LOGOUT_FAILURE,ce.Popup,null,g),this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Popup),g}this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),oe(uu)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(oe(Ti));return}let c="";try{c=e.location.href}catch{}if(!c||c==="about:blank")return;clearInterval(a);let d="";const h=this.config.auth.OIDCOptions.serverResponseType;e&&(h===Vs.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw oe(zw);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),oe(Ww)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var w,C,T,k;const a=o.screenLeft?o.screenLeft:o.screenX,c=o.screenTop?o.screenTop:o.screenY,d=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let m=(w=r.popupSize)==null?void 0:w.width,g=(C=r.popupSize)==null?void 0:C.height,v=(T=r.popupPosition)==null?void 0:T.top,p=(k=r.popupPosition)==null?void 0:k.left;return(!m||m<0||m>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),m=Mn.POPUP_WIDTH),(!g||g<0||g>h)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),g=Mn.POPUP_HEIGHT),(!v||v<0||v>h)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),v=Math.max(0,h/2-Mn.POPUP_HEIGHT/2+c)),(!p||p<0||p>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,d/2-Mn.POPUP_WIDTH/2+a)),o.open(e,t,`width=${m}, height=${g}, top=${v}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(ce.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Mn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Mn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class uy{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache($e.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache($e.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:rt.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),oe(uu)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw j(Sl,"Cached State");let a;try{a=this.authModule.handleFragmentResponse(e,o)}catch(m){throw m instanceof Ko&&m.subError===Ti?oe(Ti):m}const c=this.browserStorage.generateNonceKey(o),d=this.browserStorage.getTemporaryCache(c);if(this.authCodeRequest.code=a.code,a.cloud_instance_host_name&&await J(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(a.cloud_instance_host_name,this.authCodeRequest.correlationId),a.nonce=d||void 0,a.state=o,a.client_info)this.authCodeRequest.clientInfo=a.client_info;else{const m=this.checkCcsCredentials();m&&(this.authCodeRequest.ccsCredential=m)}const h=await this.authModule.acquireToken(this.authCodeRequest,a);return this.browserStorage.cleanRequestByState(t),h}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache($e.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function zH(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class GH extends Oa{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.nativeStorage=h}async acquireToken(e){const t=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(rt.acquireTokenRedirect),o=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(fe.RESTORE_FROM_BFCACHE,ce.Redirect))};try{const a=await J(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),c=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new uy(c,this.browserStorage,a,this.logger,this.performanceClient),h=await c.getAuthCodeUrl({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),m=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${m}`),window.addEventListener("pageshow",o),await d.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:m,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(a){throw a instanceof ct&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),a}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(rt.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,a]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),zH()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache($e.ORIGIN_URI,!0)||B.EMPTY_STRING,d=Me.removeHashFromUrl(c),h=Me.removeHashFromUrl(window.location.href);if(d===h&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&Z2(c),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Cm()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache($e.URL_HASH,a,!0);const m={apiId:rt.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let g=!0;if(!c||c==="null"){const v=tH();this.browserStorage.setTemporaryCache($e.ORIGIN_URI,v,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),g=await this.navigationClient.navigateInternal(v,m)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),g=await this.navigationClient.navigateInternal(c,m);if(!g)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof ct&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===Vs.QUERY?t=window.location.search:t=window.location.hash);let r=Rl(t);if(r){try{KH(r,this.browserCrypto,ce.Redirect)}catch(a){return a instanceof ct&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return X2(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache($e.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey($e.URL_HASH)),o&&(r=Rl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw oe(hm);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw oe(Hs);const h=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:m}=vr.parseRequestState(this.browserCrypto,r);return h.acquireToken({...o,state:m,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const a=this.browserStorage.getCachedAuthority(r);if(!a)throw oe(fm);const c=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:a});return xr.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new uy(c,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,a;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(rt.logout);try{this.eventHandler.emitEvent(fe.LOGOUT_START,ce.Redirect,e),await this.clearCacheOnLogout(t.account);const c={apiId:rt.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===ho.OIDC)try{d.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((a=t.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Redirect,t);return}}const h=d.getLogoutUri(t);if(this.eventHandler.emitEvent(fe.LOGOUT_SUCCESS,ce.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(h)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}}catch(c){throw c instanceof ct&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),this.eventHandler.emitEvent(fe.LOGOUT_FAILURE,ce.Redirect,null,c),this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Redirect),c}this.eventHandler.emitEvent(fe.LOGOUT_END,ce.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return Me.getAbsoluteUrl(t,co())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function qH(n,e,t,r,o){if(e.addQueueMeasurement(x.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),oe(uu);return o?J(YH,x.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):Si(JH,x.SilentHandlerLoadFrameSync,t,e,r)(n)}async function jH(n,e,t,r,o,a,c){return r.addQueueMeasurement(x.SilentHandlerMonitorIframeForHash,a),new Promise((d,h)=>{e<of&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${of}ms). This may result in timeouts.`);const m=window.setTimeout(()=>{window.clearInterval(g),h(oe(Gw))},e),g=window.setInterval(()=>{let v="";const p=n.contentWindow;try{v=p?p.location.href:""}catch{}if(!v||v==="about:blank")return;let w="";p&&(c===Vs.QUERY?w=p.location.search:w=p.location.hash),window.clearTimeout(m),window.clearInterval(g),d(w)},t)}).finally(()=>{Si(QH,x.RemoveHiddenIframe,o,r,a)(n)})}function YH(n,e,t,r){return t.addQueueMeasurement(x.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const c=AT();window.setTimeout(()=>{if(!c){a("Unable to load iframe");return}c.src=n,o(c)},e)})}function JH(n){const e=AT();return e.src=n,e}function AT(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function QH(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class XH extends Oa{constructor(e,t,r,o,a,c,d,h,m,g,v){super(e,t,r,o,a,c,h,g,v),this.apiId=d,this.nativeStorage=m}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Ut.NONE&&t.prompt!==Ut.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Ut.NONE}`),t.prompt=Ut.NONE):t.prompt=Ut.NONE;const r=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ce.Silent);ET(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let a;try{return a=await J(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await J(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(a,r)}catch(c){if(c instanceof ct&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),!a||!(c instanceof ct)||c.errorCode!==Mn.INVALID_GRANT_ERROR)throw c;this.performanceClient.addFields({retryError:c.errorCode},this.correlationId);const d=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ce.Silent);return await J(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(a,d)}}logout(){return Promise.reject(oe(du))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(x.SilentIframeClientTokenHelper,r);const o=await J(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),a=await J(e.getAuthCodeUrl.bind(e),x.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),c=new bm(e,this.browserStorage,o,this.logger,this.performanceClient),d=await J(qH,x.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(a,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),h=this.config.auth.OIDCOptions.serverResponseType,m=await J(jH,x.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,h),g=Si(ST,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(m,h,this.logger);if(g.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw oe(Hs);const v=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,g.accountId,this.browserStorage,r),{userRequestState:p}=vr.parseRequestState(this.browserCrypto,t.state);return J(v.acquireToken.bind(v),x.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:p,prompt:t.prompt||Ut.NONE})}return J(c.handleCodeResponse.bind(c),x.HandleCodeResponse,this.logger,this.performanceClient,r)(g,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ZH extends Oa{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentRefreshClientAcquireToken,e.correlationId);const t=await J(Tm,x.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(rt.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return J(a.acquireTokenByRefreshToken.bind(a),x.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(c=>{throw c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c),c})}logout(){return Promise.reject(oe(du))}async createRefreshTokenClient(e){const t=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Zh(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class e${constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw oe(hu);const o=t.id_token?Ii(t.id_token,$r):void 0,a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new Qt(Qt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,a,this.logger,e.correlationId||mo()):void 0,d=this.loadAccount(e,r.clientInfo||t.client_info||"",o,c),h=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),m=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,r),g=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:h,accessToken:m,refreshToken:g},o,c)}loadAccount(e,t,r,o){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Ot.createFromAccountInfo(e.account);return this.storage.setAccount(h),h}else if(!o||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),oe(tT);const a=Ot.generateHomeAccountId(t,o.authorityType,this.logger,this.cryptoObj,r),c=r==null?void 0:r.tid,d=cm(this.storage,o,a,$r,r,t,o.hostnameAndPort,c,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,r,o){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const a=ou(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(a),a}loadAccessToken(e,t,r,o,a,c){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?_t.fromString(t.scope):new _t(e.scopes),h=c.expiresOn||t.expires_in+new Date().getTime()/1e3,m=c.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,g=iu(r,o,t.access_token,this.config.auth.clientId,a,d.printScopes(),h,m,$r);return this.storage.setAccessTokenCredential(g),g}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const o=lw(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(o),o}generateAuthenticationResult(e,t,r,o){var g,v,p;let a="",c=[],d=null,h;t!=null&&t.accessToken&&(a=t.accessToken.secret,c=_t.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),h=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const m=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:c,account:m.getAccountInfo(),idToken:((g=t.idToken)==null?void 0:g.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:h,familyId:((v=t.refreshToken)==null?void 0:v.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:m.cloudGraphHostName||"",msGraphHost:m.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class t$ extends Lw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class n$ extends Oa{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,h,m,g),this.apiId=d}async acquireToken(e){if(!e.code)throw oe(nT);const t=await J(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,ce.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},a=await J(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),c=new t$(a);this.logger.verbose("Auth code client created");const d=new bm(c,this.browserStorage,o,this.logger,this.performanceClient);return await J(d.handleCodeResponseFromServer.bind(d),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof ct&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(oe(du))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Mr(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function qc(n,e){try{Em(n)}catch(t){throw e.end({success:!1},t),t}}class gu{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ta(this.logger,this.performanceClient):Al,this.eventHandler=new kH(this.logger),this.browserStorage=this.isBrowserEnvironment?new sf(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,p2(this.config.auth),this.performanceClient):CH(this.config.auth.clientId,this.logger);const t={cacheLocation:_n.MemoryStorage,temporaryCacheLocation:_n.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new sf(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new e$(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new gu(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(fe.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(x.InitializeClientApplication,t);if(this.eventHandler.emitEvent(fe.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Fr.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(a){this.logger.verbose(a)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await J(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),x.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(fe.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),CT(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,a=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache($e.CORRELATION_ID,!0)||"",c=this.performanceClient.startMeasurement(x.AcquireTokenRedirect,a);this.eventHandler.emitEvent(fe.HANDLE_REDIRECT_START,ce.Redirect);let d;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const h=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);d=J(h.handleRedirectPromise.bind(h),x.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(this.performanceClient,c.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(a);d=J(h.handleRedirectPromise.bind(h),x.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(e,c)}return d.then(h=>(h?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(fe.LOGIN_SUCCESS,ce.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_SUCCESS,ce.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),c.end({success:!0,accountType:Mr(h.account)})):c.event.errorCode?c.end({success:!1}):c.discard(),this.eventHandler.emitEvent(fe.HANDLE_REDIRECT_END,ce.Redirect),h)).catch(h=>{const m=h;throw t.length>0?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,m):this.eventHandler.emitEvent(fe.LOGIN_FAILURE,ce.Redirect,null,m),this.eventHandler.emitEvent(fe.HANDLE_REDIRECT_END,ce.Redirect),c.end({success:!1},m),h})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenPreRedirect,t);r.add({accountType:Mr(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=c=>{const d=typeof o=="function"?o(c):void 0;return d!==!1?r.end({success:!0}):r.discard(),d};else{const c=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const h=typeof c=="function"?c(d):void 0;return h!==!1?r.end({success:!0}):r.discard(),h}}const a=this.getAllAccounts().length>0;try{ay(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),a?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_START,ce.Redirect,e):this.eventHandler.emitEvent(fe.LOGIN_START,ce.Redirect,e);let c;return this.nativeExtensionProvider&&this.canUseNative(e)?c=new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(h=>{if(h instanceof Ur&&ia(h))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(h instanceof Cr)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),h}):c=this.createRedirectClient(t).acquireToken(e),await c}catch(c){throw r.end({success:!1},c),a?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,c):this.eventHandler.emitEvent(fe.LOGIN_FAILURE,ce.Redirect,null,c),c}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:Mr(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),qc(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(c){return Promise.reject(c)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_START,ce.Popup,e):this.eventHandler.emitEvent(fe.LOGIN_START,ce.Popup,e);let a;return this.canUseNative(e)?a=this.acquireTokenNative({...e,correlationId:t},rt.acquireTokenPopup).then(c=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Mr(c.account)}),c)).catch(c=>{if(c instanceof Ur&&ia(c))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(c instanceof Cr)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):a=this.createPopupClient(t).acquireToken(e),a.then(c=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(fe.LOGIN_SUCCESS,ce.Popup,c):this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_SUCCESS,ce.Popup,c),r.end({success:!0,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Mr(c.account)}),c)).catch(c=>(o.length>0?this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Popup,null,c):this.eventHandler.emitEvent(fe.LOGIN_FAILURE,ce.Popup,null,c),r.end({success:!1},c),Promise.reject(c)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,c;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(x.SsoSilent,t),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId,accountType:Mr(e.account)}),qc(this.initialized,this.ssoSilentMeasurement),(c=this.ssoSilentMeasurement)==null||c.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(fe.SSO_SILENT_START,ce.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,rt.ssoSilent).catch(d=>{if(d instanceof Ur&&ia(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw d}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(d=>{var h;return this.eventHandler.emitEvent(fe.SSO_SILENT_SUCCESS,ce.Silent,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Mr(d.account)}),d}).catch(d=>{var h;throw this.eventHandler.emitEvent(fe.SSO_SILENT_FAILURE,ce.Silent,null,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenByCode,t);qc(this.initialized,r),this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_START,ce.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw oe(oT);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),a=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(c=>(this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ce.Silent,c),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Mr(c.account)}),c)).catch(c=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,c),r.end({success:!1},c),c}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},rt.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof Ur&&ia(a)&&(this.nativeExtensionProvider=void 0),a});return r.end({accountType:Mr(o.account),success:!0}),o}else throw oe(iT);else throw oe(rT)}catch(o){throw this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(x.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var c;return(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker}),a}).catch(a=>{var c;throw(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenFromCache,e.correlationId),t){case On.Default:case On.AccessToken:case On.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return J(r.acquireToken.bind(r),x.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(so)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenByRefreshToken,e.correlationId),t){case On.Default:case On.AccessTokenAndRefreshToken:case On.RefreshToken:case On.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return J(r.acquireToken.bind(r),x.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(so)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(x.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return J(t.acquireToken.bind(t),x.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return ay(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return Em(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return EH(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return wH(e,this.logger,this.browserStorage)}getAccountByUsername(e){return TH(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return bH(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return IH(e,this.logger,this.browserStorage)}setActiveAccount(e){SH(e,this.browserStorage)}getActiveAccount(){return AH(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Ot.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw oe(Hs);return new ga(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Ut.NONE:case Ut.CONSENT:case Ut.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new WH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new GH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new XH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new IT(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new ZH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new n$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rt.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return yT(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(Dt.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(fe.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!Ot.isAccountEntity(o))return;const c=Ea.toObject(new Ot,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(fe.ACCOUNT_ADDED,void 0,c)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(fe.ACCOUNT_REMOVED,void 0,c))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?mo():B.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||ry})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||ry})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),qc(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw oe(Jw);r.add({accountType:Mr(o)});const a={clientId:this.config.auth.clientId,authority:e.authority||B.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},c=JSON.stringify(a),d=this.activeSilentTokenRequests.get(c);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const h=J(this.acquireTokenSilentAsync.bind(this),x.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(m=>(this.activeSilentTokenRequests.delete(c),r.end({success:!0,fromCache:m.fromCache,isNativeBroker:m.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:m.accessToken.length,idTokenSize:m.idToken.length}),m)).catch(m=>{throw this.activeSilentTokenRequests.delete(c),r.end({success:!1},m),m});return this.activeSilentTokenRequests.set(c,h),{...await h,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(x.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_START,ce.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await J(MH,x.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||On.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async d=>{if(r$(d,a))if(this.activeIframeRequest)if(a!==On.Skip){const[m,g]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${g}`,o.correlationId);const v=this.performanceClient.startMeasurement(x.AwaitConcurrentIframe,o.correlationId);v.add({awaitIframeCorrelationId:g});const p=await m;if(v.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${g} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${g} failed. Interaction is required.`),d}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),J(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let m;return this.activeIframeRequest=[new Promise(g=>{m=g}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),J(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(g=>(m(!0),g)).catch(g=>{throw m(!1),g}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_SUCCESS,ce.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_FAILURE,ce.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,rt.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Ur&&ia(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,j(so)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),J(this.acquireTokenFromCache.bind(this),x.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===On.AccessToken)throw r;return this.eventHandler.emitEvent(fe.ACQUIRE_TOKEN_NETWORK_START,ce.Silent,e),J(this.acquireTokenByRefreshToken.bind(this),x.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function r$(n,e){const t=!(n instanceof Cr&&n.subError!==lu),r=n.errorCode===Mn.INVALID_GRANT_ERROR||n.errorCode===so,o=t&&r||n.errorCode===Pl||n.errorCode===sm,a=V2.includes(e);return o&&a}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function o$(n,e){const t=new bi(n);return await t.initialize(),gu.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Im{static async createPublicClientApplication(e){const t=await o$(e);return new Im(e,t)}constructor(e,t){this.controller=t||new gu(new bi(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const sh=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",i$=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",a$=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",lf=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",s$={auth:{clientId:i$,authority:`https://${sh}.b2clogin.com/${sh}.onmicrosoft.com/${a$}`,knownAuthorities:[`${sh}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${lf}/_/dashboard`:lf},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(n,e)=>{n===et.Error&&console.error(e)},logLevel:et.Warning}}},kT=(n,e)=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:`${lf}${n}`,extraQueryParameters:e}),zt=new Im(s$),dy=l.ref(null);function NT(){async function n(e){var t;if(e)try{const r=e.idTokenClaims;if(!(r!=null&&r.aud))throw new Error("User audience (aud) is missing in ID token claims");const o=localStorage.getItem(`msal.token.keys.${r.aud}`);if(!o)throw new Error(`Token keys para ${r.aud} não encontrados no localStorage`);const a=JSON.parse(o),c=(t=a==null?void 0:a.idToken)==null?void 0:t[0];if(!c)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(c);if(!d)throw new Error(`Dados do token para ID ${c} não encontrados no localStorage`);const h=JSON.parse(d),m=h==null?void 0:h.secret;if(!m)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),dy.value=m}catch(r){console.error("Erro ao obter token de acesso:",r)}}return{jToken:dy,setJToken:n}}let jc=null;const er=l.ref(null),Yi=l.ref(null),RT=l.ref(Math.floor(Date.now()/1e3));uf.useIntervalFn(()=>c$(),1e3);function c$(){var r,o;if(!((o=(r=er.value)==null?void 0:r.idTokenClaims)!=null&&o.exp))return;const n=Math.floor(Date.now()/1e3),e=300,t=er.value.idTokenClaims.exp;RT.value=t-n-e}function Sm(){if(jc)return jc;const{setJToken:n,jToken:e}=NT(),t=l.computed(()=>!!er.value),r=l.computed(()=>er.value);let o;async function a(p,w){if(!t.value)switch(p){case"redirect":if(w){o=w,await h();break}case"tab":default:await c();break}}const c=async()=>new Promise((p,w)=>{try{localStorage.clear();const C=process.env.JPLAN_WEBAPP__URL_AUTH,T=window.open(C);if(!T){console.error("Failed to open authentication window"),w("Failed to open authentication window");return}const k=Date.now(),I=6e4,N=setInterval(()=>{if(Date.now()-k>I||T.closed){clearInterval(N),console.error("Authentication canceled or timeout reached."),w("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(L=>L.startsWith("msal.account.keys"))&&(clearInterval(N),d(),T.close(),p())},500)}catch(C){console.error("Error in handleRedirect:",C),w(C)}}),d=async()=>{try{await zt.initialize();const p=zt.getActiveAccount();if(p)er.value=p;else{const w=await zt.handleRedirectPromise();w?(zt.setActiveAccount(w.account),er.value=zt.getActiveAccount()):console.error("Falha na autenticação")}}catch(p){console.error("Erro no processo de autenticação:",p)}er.value&&await n(er.value)},h=async()=>{try{await zt.initialize();const p=await zt.handleRedirectPromise();if(!p||zt.getAllAccounts().length===0){const w=kT(o);await zt.loginRedirect(w);return}zt.setActiveAccount(p.account),er.value=zt.getActiveAccount(),er.value&&await n(er.value),Yi.value="updated"}catch(p){console.error("handleRedirect failed",p)}};async function m(){_e.value=!0,Yi.value="updating";try{const p=await zt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});zt.setActiveAccount(p.account),await n(er.value),Yi.value="updated"}catch(p){console.error("Failed to refresh token, forcing new login.",p),Yi.value="error",localStorage.clear(),window.location.reload()}_e.value=!1}const g=async()=>{try{await zt.initialize(),localStorage.clear(),await zt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(p){console.error("Logout error",p)}};l.watch(RT,async p=>{p<=0&&Yi.value==="updated"&&await m()});const v=l.computed(()=>e.value);return jc={isAuthenticated:t,authState:Yi,account:r,token:v,refreshToken:m,handleRedirect:a,logout:g},jc}const{jToken:hy}=NT(),Am=()=>{const n=ut.create({headers:{"Content-Type":"application/json"}});l.watch(hy,o=>{n.interceptors.request.use(a=>(o&&(a.headers.Authorization=`Bearer ${o}`),a))},{immediate:!0});let e=1;n.interceptors.response.use(async o=>o,async o=>{var a;if(o.config&&o.config.headers){const c=o.config;if(((a=o.response)==null?void 0:a.status)===401&&e>0){e--;try{return c.headers.Authorization=`Bearer ${hy.value}`,await n(c)}catch(d){return Promise.reject(d)}}}return Promise.reject(o)});async function t({url:o,method:a,header:c={},body:d,baseURL:h}){try{return h&&(n.defaults.baseURL=h),(await n({url:o,method:a,headers:c,data:d})).data}catch(m){if(console.error(`Request error [${a} ${o}]:`,m),ut.isAxiosError(m)){const{response:g,message:v}=m;throw new Error(`Axios error: ${v}, Status: ${g==null?void 0:g.status}, URL: ${o}`)}throw m}}async function r({url:o,method:a,header:c,body:d,baseURL:h}){try{h&&(n.defaults.baseURL=h);const m=await n({url:o,method:a,headers:c,data:d});return{status:m.status,header:m.headers,body:m.data}}catch(m){if(ut.isAxiosError(m)){const{response:g,message:v}=m;console.error(`Raw Request Error: ${v}, Status: ${g==null?void 0:g.status}`)}return Promise.reject(m)}}return Object.assign(n,{_request:t,rawRequest:r})},{request:fy}=Am(),my=l.ref(null),gy=l.ref("default"),ch=l.ref(null),lh=l.ref({scope_type:"org"});function pu(){var v,p;const{handleRedirect:n,account:e,logout:t}=Sm();(p=(v=e.value)==null?void 0:v.idTokenClaims)==null||p.domain;const r=l.computed(()=>{var w,C;return{domain:(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.domain,environment:gy.value,...lh.value}}),o=l.computed(()=>lh.value);async function a(){var w;(!e.value||!((w=e.value.idTokenClaims)!=null&&w.email))&&await n();try{await c(),await d()}catch{}}async function c(){var w,C;try{const T=(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.email;if(!T)throw new Error("Email is undefined");const k=await fy({url:`https://api.jplan.com.br/platform/user/profile/?email=${T}`,method:"GET"});ch.value=k.data??null}catch(T){console.error("Failed to fetch user profile:",T)}}async function d(){var w;try{if(!((w=ch.value)!=null&&w.email))throw new Error("User email is undefined");const C=await fy({url:"https://api.jplan.com.br/platform/user/domain/",method:"GET"});my.value=C.data.data??[]}catch(C){console.error("Failed to fetch user domains:",C)}}function h(w){lh.value=w}function m(w){gy.value=w,h(r.value)}async function g(w,C){const T=kT(w,{request_domain:C});await zt.loginRedirect(T)}return{__init__:a,user:ch,userDomains:my,setEnv:m,setScope:h,changeDomain:g,session:r,scope:o,logout:t}}const l$={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-Ba-mUxsk.js")),meta:{requiresAuth:!1}},u$={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-DHl-IhUQ.js")),meta:{requiresAuth:!1}},{isAuthenticated:py,handleRedirect:d$}=Sm(),h$=pu();function f$(n,e){n.addRoute(l$),n.addRoute(u$),n.beforeEach(async(t,r,o)=>{function a(d){return d.matched.some(h=>h.meta.requiresAuth)}if(!a(t))return o();if(!py.value){_e.value=!0;try{await d$(e,t.fullPath),await h$.__init__()}catch(d){console.error("Fail to authenticate",d),await n.push("/jplan-auth-fail")}_e.value=!1}if(py.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),o(d),localStorage.removeItem("returnRoute");return}o()}})}const{scope:_y}=pu();function m$(){const n=Am(),e=l.ref({scope_type:"org"});async function t(r){e.value=r}return l.watch(_y,()=>{n.interceptors.request.use(r=>{const o=r.headers,a=o.Authorization;a&&(o.Authorization=a);const c=_y.value;return c&&(c.scope_type&&(o["j-scope-type"]=c.scope_type,c.organization&&(o["j-scope-organization"]=c.organization),c.team&&(o["j-scope-team"]=c.team)),c.environment&&(o["j-scope-environment"]=c.environment)),r})},{immediate:!0}),Object.assign(n,{setScope:t,scope:e})}function Pa(n){const e=m$();e.defaults.baseURL=n;const t=l.ref({scope_type:"org"});async function r(o){t.value=o}return l.watch(t,()=>{e.interceptors.request.use(o=>{const a=t.value;return delete o.headers["j-scope-type"],delete o.headers["j-scope-organization"],delete o.headers["j-scope-team"],a!=null&&a.scope_type&&(o.headers["j-scope-type"]=a.scope_type),a!=null&&a.organization&&(o.headers["j-scope-organization"]=a.organization),a!=null&&a.team&&(o.headers["j-scope-team"]=a.team),o})},{immediate:!0}),Object.assign(e,{setScope:r,scope:t})}function g$(){const n=Pa("https://api.jplan.com.br/management/organization"),{error:e}=Er();return{async getOrgList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch Organization list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getOrgList:",r),e("Failed to fetch Organization list");return}},async createOrg(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Organization"),a}},async updateOrg(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e("Failed to update Organization"),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Organization"),a}},async getOrg(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e("Failed to fetch Organization"),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Organization"),a}},async activateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate Organization"),new Error(a.data.error)}catch(a){throw console.error("Error in activateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Organization"),a}},async deactivateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate Organization"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Organization"),a}}}}const Lo=g$();function p$(){const n=Pa("https://api.jplan.com.br/management/branch/"),{error:e}=Er();return{async getBranchList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error){e("Failed to fetch Branch list");return}return o.data.data}catch(r){console.error("Error in getBranchList:",r),e("Failed to fetch Branch list")}},async createBranch(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){console.error("Error in createBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Branch")}},async updateBranch(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error){e(a.data.error||"Failed to update Branch");return}return a}catch(a){console.error("Error in updateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Branch")}},async getBranch(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error){e(a.data.error||"Failed to fetch Branch");return}return a.data}catch(a){console.error("Error in getBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Branch")}},async activateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error){e(a.data.error||"Failed to activate Branch");return}}catch(a){console.error("Error in activateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Branch")}},async deactivateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error){e(a.data.error||"Failed to deactivate Branch");return}}catch(a){console.error("Error in deactivateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Branch")}}}}const xo=p$();function _$(){const n=Pa("https://api.jplan.com.br/management/team"),{error:e}=Er();return{async getTeamList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch Team list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getTeamList:",r),e("Failed to fetch Team list");return}},async createTeam(t){var r,o;try{const a=await n.post("/item",t);if(a.data.error)throw e("Failed to create Team"),new Error(a.data.error);return a}catch(a){throw console.error("Error in createTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Team"),a}},async updateTeam(t){var r,o;try{const a=await n.patch("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in updateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Team"),a}},async getTeam(t){var r,o;try{const a=await n.get(`/item/${t}`);return a.data.error&&e("Failed to fetch Team"),a.data}catch(a){console.error("Error in getTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Team");return}},async activateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate Team"),new Error(a.data.error)}catch(a){throw console.error("Error in activateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Team"),a}},async deactivateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate Team"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Team"),a}},async getTeamUserList(t,r){try{const o=r?`?filter_query=${r}`:"",a=await n.get(`/item/${t}/user/list/${o}`);if(a.data.error)throw e("Failed to fetch Team User list"),new Error(a.data.error);return a.data.data}catch(o){console.error("Error in getTeamUserList:",o),e("Failed to fetch Team User list");return}},async linkManageUser(t,r){try{const o=await n.post(`/item/${t}/user/item/`,r);if(o.data.error)throw e("Failed to link User"),new Error(o.data.error);return o.data}catch(o){console.error("Error in link User:",o),e("Failed to link User");return}},async updateManageUser(t,r){try{const o=await n.patch(`/item/${t}/user/item/`,r);if(o.data.error)throw e("Failed to update User"),new Error(o.data.error);return o.data.data}catch(o){throw console.error("Error in update User:",o),e("Failed to update User"),o}},async getManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"",c=await n.get(`/item/${t}/user/item/${r}/${a}`);if(c.data.error)throw e("Failed to fetch User"),new Error(c.data.error);return c.data.data}catch(a){console.error("Error in getUser:",a),e("Failed to fetch User");return}},async unlinkManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"";await n.delete(`/item/${t}/user/item/${r}/${a}`)}catch(a){throw console.error("Error in unlink User:",a),e("Failed to unlink User"),a}}}}const Pn=_$();let Yc=!1;const uh=l.ref(!1),qn=l.ref([]),vy=l.ref([]),ht=l.ref(null),Ji=l.ref([]),Qi=l.ref([]),OT=()=>{const n=Er(),e=async C=>{uh.value=!0;const T=C?`_active eq true and ${C}`:"_active eq true",k=await Lo.getOrgList(T);k&&(qn.value=k,Yc=!0),uh.value=!1},t=async C=>{var T;return(T=qn.value)!=null&&T.length||await e(C),qn.value};function r(C){if(!qn.value)throw new Error("Data not stored yet");const T=Na(qn.value,C,["name","description"]);return C!==""?T:qn.value}const o=C=>{vy.value=C},a=C=>{ht.value=ka.cloneDeep(C)},c=async C=>await Lo.getOrg(C),d=async()=>{if(ht.value!=null){const C=await Lo.createOrg(ht.value);return C!=null&&C.data.created_at&&(n.success("Organization created."),Yc&&qn.value.push(C.data)),C==null?void 0:C.data}},h=async()=>{if(_e.value=!0,ht.value&&ht.value.__id){const C=await Lo.updateOrg(ht.value);if(Yc&&(C!=null&&C.data.__id)){const T=qn.value.findIndex(k=>k.__id===C.data.__id);return T!==-1?(qn.value[T]=C.data,n.success("Organization updated.")):n.error("Unable to update item"),_e.value=!1,C.data}}else _e.value=!1,n.error("Unable to update item")},m=async()=>{if(_e.value=!0,ht.value&&ht.value.created_at){if(await Lo.deactivateOrg(ht.value.__id),Yc){const C=qn.value.findIndex(T=>{var k;return T.__id===((k=ht.value)==null?void 0:k.__id)});if(C!==-1)return qn.value.splice(C,1),ht.value;n.error("Unable to deactivate organization")}_e.value=!1}};async function g(C){_e.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await xo.updateBranch(T)){_e.value=!1;return}if(Ji.value.findIndex(N=>N.__id===C.__id)===-1)return n.success("Branch added successfully."),Ji.value.push(T),T;n.info("Branch already added.")}}catch(T){console.error(T)}finally{_e.value=!1}}async function v(C){if(_e.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await xo.updateBranch(T)){_e.value=!1;return}const I=Ji.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Ji.value.splice(I,1),_e.value=!1,Ji.value;throw new Error("Item not found to remove")}_e.value=!1}async function p(C){_e.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await Pn.updateTeam(T)){_e.value=!1;return}if(Qi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success("Team added successfully."),Qi.value.push(T),T;n.info("Team already added.")}}catch(T){console.error(T)}finally{_e.value=!1}}async function w(C){if(_e.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await Pn.updateTeam(T)){_e.value=!1;return}const I=Qi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Qi.value.splice(I,1),_e.value=!1,Qi.value;throw new Error("Item not found to remove")}_e.value=!1}return{data:qn,loading:uh,columns:vy,item:ht,filterData:r,__init__:e,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgBranches:Ji,orgTeams:Qi,linkBranch:g,unlinkBranch:v,linkTeam:p,unlinkTeam:w}};let Jc=!1;const jn=l.ref([]),yy=l.ref([]),kt=l.ref(null),dh=l.ref(!1),Xi=l.ref([]),PT=()=>{const n=Er(),e=async p=>{dh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Pn.getTeamList(w);C&&(jn.value=C,Jc=!0),dh.value=!1},t=async p=>(jn.value.length||await e(p),jn.value);function r(p){if(!jn.value)throw new Error("Data not stored yet");const w=Na(jn.value,p,["name","description"]);return p!==""?w:jn.value}const o=p=>{yy.value=p},a=p=>{kt.value=ka.cloneDeep(p)},c=async p=>await Pn.getTeam(p),d=async()=>{if(kt.value!=null){const p=await Pn.createTeam(kt.value);return p!=null&&p.data.created_at&&(n.success("Team created."),Jc&&jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(_e.value=!0,kt.value&&kt.value.__id){const p=await Pn.updateTeam(kt.value);if(Jc&&(p!=null&&p.data.__id)){const w=jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(jn.value[w]=p.data,n.success("Team updated.")):n.error("Unable to update item"),p.data}}else n.error("Unable to update item")},m=async()=>{if(kt.value&&kt.value.created_at&&(await Pn.deactivateTeam(kt.value.__id),Jc)){const p=jn.value.findIndex(w=>{var C;return w.__id===((C=kt.value)==null?void 0:C.__id)});if(p!==-1)return jn.value.splice(p,1),kt.value;n.error("Unable to deactivate organization")}};async function g(p){var w;if(_e.value=!0,(w=kt.value)!=null&&w.__id)if(Xi.value.findIndex(T=>T.__id===p.__id)===-1)try{const T=await Pn.linkManageUser(kt.value.__id,{team:kt.value.__id,user:p.__id,role:"string",joined_at:"string",comments:"string"}),k=await Pn.getTeamUserList(kt.value.__id);return k&&(Xi.value=k),n.success("User added successfully."),T}catch(T){console.error(T),n.error("Unable to add User.")}finally{_e.value=!1}else n.info("User already added.");else console.warn("No item selected or item ID is missing."),n.info("Please select a valid item.");_e.value=!1}async function v(p){if(_e.value=!0,kt.value&&kt.value.__id){const w=Xi.value.findIndex(C=>C.__id===p);if(w!==-1)return await Pn.unlinkManageUser(kt.value.__id,p),Xi.value.splice(w,1),_e.value=!1,Xi.value;throw new Error("Item not found to remove")}_e.value=!1}return{data:jn,loading:dh,columns:yy,item:kt,usersTeam:Xi,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,linkUser:g,unlinkUser:v}},MT=l.defineComponent({__name:"GlobalScopeFilter",setup(n){var T,k,I;const{openDialog:e}=Os("global-scope__J-"),{user:t,scope:r,session:o,setScope:a}=pu(),{getData:c,data:d}=OT(),{getData:h,data:m}=PT(),g=l.ref(!1);l.onBeforeMount(async()=>{g.value=!0,await c(),await h(),g.value=!1});const v=l.ref({scope_type:(T=r.value)==null?void 0:T.scope_type,organization:((k=r.value)==null?void 0:k.organization)??"org",team:(I=r.value)==null?void 0:I.team});function p(){var N,O,L;v.value={...r.value,scope_type:(N=r.value)==null?void 0:N.scope_type,organization:((O=r.value)==null?void 0:O.organization)??"",team:(L=r.value)==null?void 0:L.team},e()}const w=l.computed(()=>{var N;switch((N=r.value)==null?void 0:N.scope_type){case"user":return DB;case"org":return PB;case"team":return LB;default:return MB}});async function C(){var N;((N=r.value)==null?void 0:N.scope_type)!==""&&a(v.value)}return(N,O)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(ot.VBtn,{onClick:p,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(w.value),{size:"20"}))]),_:1}),l.createVNode(l.unref(Ms),{loading:g.value,title:"Scope","dd-id":"global-scope__J-",onOnSave:C},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.createVNode(Je.VRow,null,{default:l.withCtx(()=>[l.createVNode(Je.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:l.withCtx(()=>[l.createVNode(Jt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>O[3]||(O[3]=[l.createTextVNode(" User")])),_:1}),l.createVNode(Jt.VListItemSubtitle,null,{default:l.withCtx(()=>{var L;return[l.createTextVNode(l.toDisplayString(((L=l.unref(t))==null?void 0:L.name)||"Unknown"),1)]}),_:1})]),_:1})]),_:1}),l.createVNode(Je.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Jt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>O[4]||(O[4]=[l.createTextVNode(" Domain")])),_:1}),l.createVNode(Jt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).domain),1)]),_:1})]),_:1})]),_:1}),l.createVNode(Je.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Jt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>O[5]||(O[5]=[l.createTextVNode(" Environment")])),_:1}),l.createVNode(Jt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),l.createVNode(EO.VBtnToggle,{density:"compact",variant:"outlined",modelValue:v.value.scope_type,"onUpdate:modelValue":O[0]||(O[0]=L=>v.value.scope_type=L),class:"d-flex justify-center my-4"},{default:l.withCtx(()=>[l.createVNode(ot.VBtn,{value:"org",label:"Organizational",color:"secondary",class:""},{default:l.withCtx(()=>O[6]||(O[6]=[l.createTextVNode("Organizational")])),_:1}),l.createVNode(ot.VBtn,{value:"team",label:"Team",color:"secondary",class:""},{default:l.withCtx(()=>O[7]||(O[7]=[l.createTextVNode("Team")])),_:1}),l.createVNode(ot.VBtn,{value:"user",label:"User",color:"secondary",class:""},{default:l.withCtx(()=>O[8]||(O[8]=[l.createTextVNode("User")])),_:1}),l.createVNode(ot.VBtn,{value:"",label:"None",color:"lightext",class:""},{default:l.withCtx(()=>O[9]||(O[9]=[l.createTextVNode("None")])),_:1})]),_:1},8,["modelValue"]),l.createElementVNode("div",null,[l.createVNode(_s.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>O[10]||(O[10]=[l.createTextVNode("Organization")])),_:1}),l.createVNode(ss.VSelect,{items:l.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Organization",class:"min-w-50",modelValue:v.value.organization,"onUpdate:modelValue":O[1]||(O[1]=L=>v.value.organization=L),clearable:""},null,8,["items","modelValue"]),l.createVNode(_s.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>O[11]||(O[11]=[l.createTextVNode("Team")])),_:1}),l.createVNode(ss.VSelect,{items:l.unref(m),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Team",class:"min-w-50",modelValue:v.value.team,"onUpdate:modelValue":O[2]||(O[2]=L=>v.value.team=L),clearable:""},null,8,["items","modelValue"])])])]),_:1},8,["loading"])],64))}}),v$={},y$={class:"double-ring-spinner-container"};function C$(n,e){return l.openBlock(),l.createElementBlock("div",y$,e[0]||(e[0]=[l.createElementVNode("div",{class:"spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])],-1)]))}const DT=ba(v$,[["render",C$],["__scopeId","data-v-00d7a69f"]]),E$={key:0,class:"_jspinner-overlay_jj"},LT=l.defineComponent({__name:"GlobalSpinner",setup(n){return(e,t)=>l.unref(_e)?(l.openBlock(),l.createElementBlock("div",E$,t[0]||(t[0]=[l.createElementVNode("div",{class:"j-double-ring-spinner-container"},[l.createElementVNode("div",{class:"j-global-spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])])],-1)]))):l.createCommentVNode("",!0)}}),xT=l.defineComponent({__name:"SubMenu",props:{title:{}},setup(n,{expose:e}){return e({props:n}),(r,o)=>(l.openBlock(),l.createBlock(Jt.VListItem,{onClick:o[0]||(o[0]=()=>{}),density:"compact"},{append:l.withCtx(()=>[l.createVNode(l.unref(xB))]),default:l.withCtx(()=>[l.createVNode(Jt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.title),1)]),_:1}),l.createVNode(hf.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:l.withCtx(()=>[l.renderSlot(r.$slots,"default")]),_:3})]),_:3}))}}),w$=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:cC,ColumnSettingsDialog:Df,ConfirmDialog:aC,ContextMenu:lC,CopyButton:xl,DeleteAllBtn:_f,DotsMenu:iC,EditButton:oC,FormHeadless:HE,FormMetadata:nu,GlobalScopeFilter:MT,GlobalSpinner:LT,JAvatar:sC,JBtn:Ay,JDialog:Ms,JForm:BE,JIconBtn:Sy,JSelect:LE,JTextArea:xE,JTextField:uE,ParentCard:Hl,SearchFilter:jl,SpinnerLoader:DT,SubMenu:xT,TabFormHeader:VE,TableAdvanced:qC,TableCard:Lf,TableCardsView:cE,TableHeader:jC,UiTable:uC},Symbol.toStringTag,{value:"Module"})),T$=JO(),b$={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0},km={"pt-BR":{placeholders:{selectFilter:"Selecionar filtro",visualize:"Visualizar",actions:"Ações",search:"Pesquisar"},dialogs:{columnSettings:{title:"Configurações de coluna"}},actions:{save:"Salvar",cancel:"Cancelar",edit:"Editar",delete:"Apagar",disable:"Desabilitar",confirm:"Confirmar",back:"Voltar"},forms:{metadata:{created:"Criado",updated:"Atualizado",modified:"Modificado",delegated:"Delegado"}},$vuetify:{dataFooter:{itemsPerPageAll:"Todos",itemsPerPageText:"Itens por página:",pageText:"{0}-{1} de {2}"}}},"en-US":{placeholders:{selectFilter:"Select a filter",visualize:"Visualize",actions:"Actions",search:"Search"},dialogs:{columnSettings:{title:"Column Settings"}},actions:{save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",disable:"Disable",back:"Back",confirm:"Confirm"},forms:{metadata:{created:"Created",updated:"Updated",modified:"Modified",delegated:"Delegated"}},$vuetify:{dataFooter:{itemsPerPageAll:"All",itemsPerPageText:"Items per page:",pageText:"{0}-{1} of {2}"}}}},I$=Object.keys(km),Cy=navigator.language,S$=I$.includes(Cy)?Cy:"pt-BR",UT=px({locale:S$,fallbackLocale:"en-US",messages:km});let hh=!1;const fh=l.ref(!1),Yn=l.ref([]),Ey=l.ref([]),Ht=l.ref(null),Zi=l.ref([]),A$=()=>{const n=Er(),e=async p=>{fh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await xo.getBranchList(w);C&&(Yn.value=C,hh=!0),fh.value=!1},t=async p=>(Yn.value.length||await e(p),Yn.value);function r(p){if(!Yn.value)throw new Error("Data not stored yet");const w=Na(Yn.value,p,["name","description"]);return p!==""?w:Yn.value}const o=p=>{Ey.value=p},a=p=>{Ht.value=ka.cloneDeep(p)},c=async p=>await xo.getBranch(p),d=async()=>{if(Ht.value!=null){const p=await xo.createBranch(Ht.value);return p!=null&&p.data.created_at&&(n.success("Branch created."),hh&&Yn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(Ht.value&&Ht.value.__id){const p=await xo.updateBranch(Ht.value);if(hh&&p){const w=Yn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Yn.value[w]=p.data,n.success("Branch updated.")):n.error("Unable to update item"),p}}else n.error("Unable to update item")},m=async()=>{if(Ht.value&&Ht.value.created_at){await xo.deactivateBranch(Ht.value.__id);const p=Yn.value.findIndex(w=>{var C;return w.__id===((C=Ht.value)==null?void 0:C.__id)});if(p!==-1)return Yn.value.splice(p,1),Ht.value;n.error("Unable to deactivate Domain")}};async function g(p){_e.value=!0;try{if(Ht.value&&Ht.value.__id){const w={...p,branch:Ht.value.__id};if(!await Pn.updateTeam(w)){n.error("Unable to link team");return}if(Zi.value.findIndex(k=>k.__id===p.__id)===-1)return n.success("Team added successfully."),Zi.value.push(w),w;n.info("Team already added.")}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{_e.value=!1}}async function v(p){if(_e.value=!0,Ht.value&&Ht.value.__id){const w={...p,branch:null};if(!await Pn.updateTeam(w))return;const T=Zi.value.findIndex(k=>k.__id===p.__id);if(T!==-1)return Zi.value.splice(T,1),_e.value=!1,Zi.value;throw new Error("Item not found to remove")}_e.value=!1}return{data:Yn,columns:Ey,item:Ht,loading:fh,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,branchTeams:Zi,linkTeam:g,unlinkTeam:v}};function k$(){const n=Pa("https://api.jplan.com.br/management/division"),{error:e}=Er();return{async getDivisionList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch Division list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getDivisionList:",r),e("Failed to fetch Division list");return}},async createDivision(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create Division"),a}},async updateDivision(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e("Failed to update Division"),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update Division"),a}},async getDivision(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e("Failed to fetch Division"),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch Division"),a}},async activateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate Division"),new Error(a.data.error)}catch(a){throw console.error("Error in activateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate Division"),a}},async deactivateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate Division"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate Division"),a}}}}const aa=k$();let mh=!1;const gh=l.ref(!1),Jn=l.ref([]),wy=l.ref([]),$t=l.ref(null),ea=l.ref([]),N$=()=>{const n=Er(),e=async p=>{gh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await aa.getDivisionList(w);C&&(Jn.value=C,mh=!0),gh.value=!1},t=async p=>(Jn.value.length||await e(p),Jn.value);function r(p){if(!Jn.value)throw new Error("Data not stored yet");const w=Na(Jn.value,p,["name","description"]);return p!==""?w:Jn.value}const o=p=>{wy.value=p},a=p=>{$t.value=ka.cloneDeep(p)},c=async p=>await aa.getDivision(p),d=async()=>{if($t.value!=null){const p=await aa.createDivision($t.value);return p!=null&&p.data.created_at&&(n.success("Division created."),mh&&Jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(_e.value=!0,$t.value&&$t.value.__id){const p=await aa.updateDivision($t.value);if(mh&&(p!=null&&p.data.__id)){const w=Jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Jn.value[w]=p.data,n.success("Updated Division.")):n.error("Unable to update item"),_e.value=!1,p}}else _e.value=!1,n.error("Unable to update item")},m=async()=>{if(_e.value=!0,$t.value&&$t.value.created_at){await aa.deactivateDivision($t.value.__id);const p=Jn.value.findIndex(w=>{var C;return w.__id===((C=$t.value)==null?void 0:C.__id)});if(p!==-1)return Jn.value.splice(p,1),$t.value;n.error("Unable to deactivate Division")}_e.value=!1};async function g(p){_e.value=!0;try{if($t.value&&$t.value.__id){const w={...p,division:$t.value.__id};return await Lo.updateOrg(w)?(ea.value.findIndex(k=>k.__id===p.__id)===-1?(n.success("Organization added successfully."),ea.value.push(w)):n.info("Organization already added."),w):void 0}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{_e.value=!1}}async function v(p){if(_e.value=!0,$t.value&&$t.value.__id){const w={...p,division:null};if(!await Lo.updateOrg(w))return;const T=ea.value.findIndex(k=>k.__id===p.__id);if(T!==-1)ea.value.splice(T,1);else throw new Error("Item não encontrado para remoção")}else throw new Error("Item não está definido");return _e.value=!1,ea.value}return{data:Jn,columns:wy,item:$t,loading:gh,__init__:e,filterData:r,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgs:ea,linkDivision:g,unlinkDivision:v}};function R$(){const n=Pa("https://api.jplan.com.br/management/user"),{error:e}=Er();return{async getManageUserList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e("Failed to fetch User list"),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getManageUserList:",r),e("Failed to fetch User list");return}},async createManageUser(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to create User"),a}},async updateManageUser(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e("Failed to update User"),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to update User"),a}},async getManageUser(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e("Failed to fetch User"),new Error(a.data.error);return a.data}catch(a){console.error("Error in getManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to fetch User");return}},async activateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e("Failed to activate User"),new Error(a.data.error)}catch(a){throw console.error("Error in activateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to activate User"),a}},async deactivateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e("Failed to deactivate User"),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||"Failed to deactivate User"),a}}}}const sa=R$();let ph=!1,_h=l.ref(!1);const Qn=l.ref([]),Ty=l.ref([]),Xn=l.ref(null),O$=l.ref(null),P$=l.ref([]),M$=()=>{const n=Er(),e=async g=>{_h.value=!0;const v=g?`_active eq true and ${g}`:"_active eq true",p=await sa.getManageUserList(v);p&&(Qn.value=p,ph=!0),_h.value=!1},t=async g=>(Qn.value.length||await e(g),Qn.value);function r(g){if(!Qn.value)throw new Error("Data not stored yet");const v=Na(Qn.value,g,["name","description"]);return g!==""?v:Qn.value}return{data:Qn,loading:_h,columns:Ty,item:Xn,filterData:r,__init__:e,getData:t,setColumns:g=>{Ty.value=g},setItem:g=>{Xn.value=ka.cloneDeep(g)},getItem:async g=>await sa.getManageUser(g),createItem:async()=>{if(Xn.value!=null){const g=crypto.randomUUID(),v=await sa.createManageUser({...Xn.value,__id:g});return v!=null&&v.data.created_at&&(n.success("User created."),ph&&Qn.value.push(v.data)),v==null?void 0:v.data}},updateItem:async()=>{if(_e.value=!0,Xn.value&&Xn.value.created_at){const g=await sa.updateManageUser(Xn.value);if(ph&&(g!=null&&g.data)){const v=Qn.value.findIndex(p=>p.__id===(g==null?void 0:g.data.__id));if(v!==-1)Qn.value[v]=g==null?void 0:g.data,n.success("User created.");else throw new Error("Unable to find item after update")}return _e.value=!1,g==null?void 0:g.data}},removeItem:async()=>{if(Xn.value&&Xn.value.created_at){try{await sa.deactivateManageUser(Xn.value.__id)}catch{n.error("Unable to deactivate user");return}const g=Qn.value.findIndex(v=>{var p;return v.__id===((p=Xn.value)==null?void 0:p.__id)});if(g!==-1)return Qn.value.splice(g,1),Xn.value}},userOrg:O$,userTeams:P$}},D$={defaultI18n:!0},L$=(n,e)=>{({...D$,...e},n.use(T$)),n.use(X0,b$),e.defaultI18n&&n.use(UT),Object.entries(w$).forEach(([t,r])=>{n.component(t,r)}),Object.entries(TO).forEach(([t,r])=>{n.provide(t,r)})},x$={install:L$};exports.ContextMenu=lC;exports.EmptyListImg=Ph;exports.EventBus=Bl;exports.FormHeadless=HE;exports.HttpCore=iB;exports.I18nMessages=km;exports.SpinnerLoader=DT;exports.TableCardsView=cE;exports.TableHeader=jC;exports.__spinner=_e;exports._export_sfc=ba;exports._sfc_main=uC;exports._sfc_main$1=qC;exports._sfc_main$10=_f;exports._sfc_main$11=oC;exports._sfc_main$12=Sy;exports._sfc_main$13=LE;exports._sfc_main$14=xE;exports._sfc_main$15=uE;exports._sfc_main$16=BE;exports._sfc_main$17=VE;exports._sfc_main$18=Hl;exports._sfc_main$19=sC;exports._sfc_main$2=Df;exports._sfc_main$20=cC;exports._sfc_main$21=Ms;exports._sfc_main$22=xT;exports._sfc_main$23=MT;exports._sfc_main$24=LT;exports._sfc_main$3=Lf;exports._sfc_main$4=jl;exports._sfc_main$5=aC;exports._sfc_main$6=xl;exports._sfc_main$7=iC;exports._sfc_main$8=nu;exports._sfc_main$9=Ay;exports.branchInstance=xo;exports.coreClient=Am;exports.createToastInterface=Cs;exports.dateFormat=cs;exports.divisionInstance=aa;exports.filterQuery=Na;exports.globalEventBus=pf;exports.i18n=UT;exports.index=x$;exports.manageUserInstance=sa;exports.msal=zt;exports.orgInstance=Lo;exports.provideToast=Q0;exports.scopedClient=Pa;exports.setupAuthGuard=f$;exports.teamInstance=Pn;exports.toastInjectionKey=Vl;exports.useAuth=Sm;exports.useBranchStore=A$;exports.useCustomizer=t0;exports.useDialog=Os;exports.useDivisionStore=N$;exports.useManageUserStore=M$;exports.useOrganizationStore=OT;exports.useSession=pu;exports.useTeamStore=PT;exports.useToast=Er;