chapterhouse 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/copilot/agents.js +3 -2
- package/dist/copilot/orchestrator.js +48 -10
- package/dist/copilot/orchestrator.test.js +59 -14
- package/dist/copilot/tools.js +183 -7
- package/dist/copilot/tools.memory.test.js +125 -1
- package/dist/daemon.js +6 -0
- package/dist/memory/action-items.js +100 -0
- package/dist/memory/action-items.test.js +83 -0
- package/dist/memory/eot.js +28 -3
- package/dist/memory/eot.test.js +108 -0
- package/dist/memory/hot-tier.js +60 -1
- package/dist/memory/hot-tier.test.js +38 -0
- package/dist/memory/housekeeping-scheduler.js +152 -0
- package/dist/memory/housekeeping-scheduler.test.js +187 -0
- package/dist/memory/index.js +1 -0
- package/dist/memory/recall.js +59 -0
- package/dist/memory/recall.test.js +27 -0
- package/dist/memory/tiering.js +33 -3
- package/dist/store/db.js +103 -16
- package/dist/store/db.test.js +61 -5
- package/package.json +1 -1
- package/web/dist/assets/index-BTI_m0OE.css +10 -0
- package/web/dist/assets/{index-B_cCSHan.js → index-D4-uRAi6.js} +4 -4
- package/web/dist/assets/index-D4-uRAi6.js.map +1 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-B_cCSHan.js.map +0 -1
- package/web/dist/assets/index-DhY5yWmC.css +0 -10
|
@@ -68,7 +68,7 @@ Error generating stack: `+s.message+`
|
|
|
68
68
|
|
|
69
69
|
_(cancelled)_`,pending:!1,activities:s.activities.map(o=>o.kind==="thinking"&&o.active?{...o,active:!1}:o),parts:s.parts.map(o=>o.type==="text"?{...o,text:o.text+`
|
|
70
70
|
|
|
71
|
-
_(cancelled)_`}:o.type==="thinking"?{...o,active:!1}:o)}:s)}}}),clearMessages:n=>t(r=>({messagesBySession:{...r.messagesBySession,[n]:[]}})),dropInterruptedBubble:n=>t(r=>{const i=r.messagesBySession[n]??[];let s=-1;for(let o=i.length-1;o>=0;o--){const a=i[o];if(a.role==="assistant"&&a.pending){s=o;break}}return s===-1?r:{messagesBySession:{...r.messagesBySession,[n]:i.filter((o,a)=>a!==s)}}}),seedMessages:(n,r)=>t(i=>{const s=i.messagesBySession[r];if(s&&s.some(c=>c.role==="user"))return i;const o=n.map(c=>{const u=c.id!==void 0?String(c.id):sd(),h=c.ts?new Date(c.ts).getTime():Date.now(),d=c.turnId??c.turn_id??void 0;return c.role==="user"?{role:"user",id:u,content:c.content,ts:h,turnId:d}:{role:"assistant",id:u,content:c.content,ts:h,pending:!1,activities:[],parts:EZ(c.content,[]),turnId:d}}),a=new Set(o.map(c=>c.turnId).filter(c=>!!c)),l=(s??[]).filter(c=>c.role==="assistant"&&c.pending===!0&&(!c.turnId||!a.has(c.turnId)));return{messagesBySession:{...i.messagesBySession,[r]:[...o,...l]}}}),applyActivity:(n,r,i)=>t(s=>{const o=s.messagesBySession[i]??[];return{messagesBySession:{...s.messagesBySession,[i]:o.map(a=>a.id!==n||a.role!=="assistant"?a:{...a,activities:TZ(a.activities,r),parts:AZ(a.parts,r)})}}}),tagUserMessageTurnId:(n,r,i)=>t(s=>{const o=s.messagesBySession[i]??[];return{messagesBySession:{...s.messagesBySession,[i]:o.map(a=>a.id===n&&a.role==="user"?{...a,turnId:r}:a)}}}),applyTurnEvent:(n,r,i)=>t(s=>{const o=s.messagesBySession[i]??[];switch(r.type){case"turn:started":{if(o.some(l=>l.role==="assistant"&&l.turnId===n))return{messagesBySession:s.messagesBySession};const a=sd();return{messagesBySession:{...s.messagesBySession,[i]:[...o,{role:"assistant",id:a,content:"",ts:r._ts??Date.now(),pending:!0,activities:[],parts:[],turnId:n}]}}}case"turn:delta":{const a=r.part;return{messagesBySession:{...s.messagesBySession,[i]:o.map(l=>{if(l.role!=="assistant"||l.turnId!==n||!l.pending||r._seq!==void 0&&l.lastAppliedSeq!==void 0&&r._seq<=l.lastAppliedSeq)return l;let c;if(a.type==="text"){const h=l.parts.findIndex(d=>d.type==="text");h===-1?c=[...l.parts,{type:"text",text:a.text}]:c=l.parts.map((d,f)=>f===h?{type:"text",text:d.text+a.text}:d)}else c=PZ(l.parts,a);const u=c.find(h=>h.type==="text");return{...l,content:(u==null?void 0:u.text)??l.content,parts:c,lastAppliedSeq:r._seq??l.lastAppliedSeq}})}}}case"turn:queued":return{messagesBySession:{...s.messagesBySession,[i]:o.map(a=>a.role==="user"&&a.turnId===n?{...a,deliveryStatus:"queued-backend",queuePosition:r.position}:a)}};case"turn:interrupted":return{messagesBySession:{...s.messagesBySession,[i]:o.filter(a=>!(a.role==="assistant"&&a.turnId===n&&a.pending))}};case"turn:complete":{const a=l1(o,n);return{messagesBySession:{...s.messagesBySession,[i]:o.map((l,c)=>{if(c!==a||l.role!=="assistant")return l;let u=!1;const h=l.parts.map(f=>f.type==="text"?(u=!0,{...f,text:r.finalMessage}):f.type==="thinking"?{...f,active:!1}:f);!u&&r.finalMessage&&h.push({type:"text",text:r.finalMessage});const d=l.activities.map(f=>f.kind==="thinking"?{...f,active:!1}:f);return{...l,content:r.finalMessage,pending:!1,activities:d,parts:h}})}}}case"turn:error":{const a=l1(o,n);return{messagesBySession:{...s.messagesBySession,[i]:o.map((l,c)=>{if(c!==a||l.role!=="assistant")return l;const u=`**Error:** ${r.error}`,h=l.parts.findIndex(f=>f.type==="text"),d=h===-1?[...l.parts,{type:"text",text:u}]:l.parts.map((f,p)=>p===h?{type:"text",text:u}:f);return{...l,content:u,pending:!1,parts:d}})}}}default:return s}}),currentModel:null,setCurrentModel:n=>t({currentModel:n})}));/*! @azure/msal-common v16.6.0 2026-05-07 */const IZ="msal.js.common",wR="https://login.microsoftonline.com/common/",RZ="login.microsoftonline.com",SR="common",NZ="adfs",$Z="dstsv2",MZ=`${wR}discovery/instance?api-version=1.1&authorization_endpoint=`,c1=".ciamlogin.com",QZ=".onmicrosoft.com",bb="|",kR="openid",vR="profile",nk="offline_access",LZ="email",rk="S256",DZ="application/x-www-form-urlencoded;charset=utf-8",Oc="Not Available",wb="/",u1="http://169.254.169.254/metadata/instance/compute/location",zZ="2020-06-01",BZ=2e3,jZ="TryAutoDetect",UZ="login.microsoft.com",ZZ=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],h1=240,FZ="invalid_instance",d1=200,XZ=400,f1=400,WZ=499,VZ=500,HZ=599,Za={GET:"GET",POST:"POST"},jl=[kR,vR,nk],p1=[...jl,LZ],On={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},g1={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},zs={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},od={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},yn={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",NO_SESSION:"no_session"},ik={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},sk={QUERY:"query",FRAGMENT:"fragment"},xR={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},YZ="MSSTS",qZ="ADFS",CR="Generic",ER="-",Sb=".",Ut={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},ok="appmetadata",GZ="client_info",op="1",kb="authority-metadata",KZ=3600*24,Pr={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},m1=5,JZ=330,eF=50,_R="server-telemetry",O1="|",oa=",",tF="1",nF="0",rF="unknown_error",Be={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},iF=60,sF=3600,TR="throttling",oF="retry-after, h429",aF="invalid_grant",lF="client_mismatch",aa={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Gm={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},hs={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},cF={Pop:"pop"},AR=300;/*! @azure/msal-common v16.6.0 2026-05-07 */const Lo="client_id",PR="redirect_uri",uF="response_type",hF="response_mode",dF="grant_type",fF="claims",pF="scope",gF="refresh_token",mF="state",OF="nonce",yF="prompt",bF="code",wF="code_challenge",SF="code_challenge_method",kF="code_verifier",vF="client-request-id",xF="x-client-SKU",CF="x-client-VER",EF="x-client-OS",_F="x-client-CPU",TF="x-client-current-telemetry",AF="x-client-last-telemetry",PF="x-ms-lib-capability",IF="x-app-name",RF="x-app-ver",NF="post_logout_redirect_uri",$F="id_token_hint",MF="client_secret",QF="client_assertion",LF="client_assertion_type",IR="token_type",RR="req_cnf",y1="return_spa_code",DF="nativebroker",zF="logout_hint",BF="sid",jF="login_hint",UF="domain_hint",ZF="x-client-xtra-sku",Iu="brk_client_id",ap="brk_redirect_uri",vb="instance_aware",FF="ear_jwk",XF="ear_jwe_crypto",WF="resource",VF="clidata";/*! @azure/msal-common v16.6.0 2026-05-07 */function ak(t){return`See https://aka.ms/msal.js.errors#${t} for details`}class He extends Error{constructor(e,n,r){const i=n||(e?ak(e):""),s=i?`${e}: ${i}`:e;super(s),Object.setPrototypeOf(this,He.prototype),this.errorCode=e||"",this.errorMessage=i||"",this.subError=r||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function xb(t,e){return new He(t,e||ak(t))}/*! @azure/msal-common v16.6.0 2026-05-07 */class lk extends He{constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,lk.prototype)}}function et(t){return new lk(t)}/*! @azure/msal-common v16.6.0 2026-05-07 */class jr{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},r=e.split("&"),i=s=>decodeURIComponent(s.replace(/\+/g," "));return r.forEach(s=>{if(s.trim()){const[o,a]=s.split(/=(.+)/g,2);o&&a&&(n[i(o)]=i(a))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}}/*! @azure/msal-common v16.6.0 2026-05-07 */class ck extends He{constructor(e,n){super(e,n),this.name="ClientAuthError",Object.setPrototypeOf(this,ck.prototype)}}function Y(t,e){return new ck(t,e)}/*! @azure/msal-common v16.6.0 2026-05-07 */const HF="redirect_uri_empty",YF="authority_uri_insecure",ad="url_parse_error",qF="empty_url_error",GF="empty_input_scopes_error",NR="invalid_claims",KF="token_request_empty",JF="logout_request_empty",$R="pkce_params_missing",MR="invalid_cloud_discovery_metadata",e5="invalid_authority_metadata",t5="untrusted_authority",uk="missing_ssh_jwk",n5="missing_ssh_kid",r5="cannot_set_OIDCOptions",i5="cannot_allow_platform_broker",s5="authority_mismatch",o5="invalid_request_method_for_EAR";/*! @azure/msal-common v16.6.0 2026-05-07 */const QR="client_info_decoding_error",a5="client_info_empty_error",LR="token_parsing_error",l5="null_or_empty_token",ds="endpoints_resolution_error",c5="network_error",u5="openid_config_error",h5="hash_not_deserialized",Ru="invalid_state",d5="state_mismatch",b1="state_not_found",f5="nonce_mismatch",DR="auth_time_not_found",p5="max_age_transpired",g5="multiple_matching_appMetadata",m5="request_cannot_be_made",O5="cannot_remove_empty_scope",y5="cannot_append_scopeset",w1="empty_input_scopeset",zR="no_account_in_silent_request",b5="invalid_cache_record",BR="invalid_cache_environment",S1="no_account_found",jR="no_crypto_object",Es="token_refresh_required",w5="token_claims_cnf_required_for_signedjwt",S5="authorization_code_missing_from_server_response",k5="binding_key_not_removed",v5="end_session_endpoint_not_supported",UR="key_id_missing",Ce="method_not_implemented",x5="resource_parameter_required",C5="misplaced_resource_parameter";/*! @azure/msal-common v16.6.0 2026-05-07 */class rn{constructor(e){const n=e?jr.trimArrayEntries([...e]):[],r=n?jr.removeEmptyStringsFromArray(n):[];if(!r||!r.length)throw et(GF);this.scopes=new Set,r.forEach(i=>this.scopes.add(i))}static fromString(e){const r=(e||"").split(" ");return new rn(r)}static createSearchScopes(e){const n=e&&e.length>0?e:[...jl],r=new rn(n);return r.containsOnlyOIDCScopes()?r.removeScope(nk):r.removeOIDCScopes(),r}containsScope(e){const n=this.printScopesLowerCase().split(" "),r=new rn(n);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return p1.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw Y(y5)}}removeScope(e){if(!e)throw Y(O5);this.scopes.delete(e.trim())}removeOIDCScopes(){p1.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Y(w1);const n=new Set;return e.scopes.forEach(r=>n.add(r.toLowerCase())),this.scopes.forEach(r=>n.add(r.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw Y(w1);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),r=e.getScopeCount(),i=this.getScopeCount();return n.size<i+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(n=>e.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v16.6.0 2026-05-07 */function $g(t,e,n){if(!e)return;const r=t.get(Lo);r&&t.has(Iu)&&(n==null||n.addFields({embeddedClientId:r,embeddedRedirectUri:t.get(PR)},e))}function hk(t,e){t.set(uF,e)}function E5(t,e){t.set(hF,e||sk.QUERY)}function _5(t){t.set(DF,"1")}function dk(t,e,n=!0,r=jl){n&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const i=n?[...e||[],...r]:e||[],s=new rn(i);t.set(pF,s.printScopes())}function fk(t,e){t.set(Lo,e)}function pk(t,e){t.set(PR,e)}function T5(t,e){t.set(NF,e)}function A5(t,e){t.set($F,e)}function P5(t,e){t.set(UF,e)}function ld(t,e){t.set(jF,e)}function lp(t,e){t.set(On.CCS_HEADER,`UPN:${e}`)}function Gc(t,e){t.set(On.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function k1(t,e){t.set(BF,e)}function gk(t,e,n,r){const i=r&&t.has(Iu)?void 0:n;if(!jr.isEmptyObj(e)||i&&i.length>0){const s=YR(e,i);try{JSON.parse(s)}catch{throw et(NR)}t.set(fF,s)}}function bh(t,e){t.set(vF,e)}function mk(t,e){t.set(xF,e.sku),t.set(CF,e.version),e.os&&t.set(EF,e.os),e.cpu&&t.set(_F,e.cpu)}function Ok(t,e){e!=null&&e.appName&&t.set(IF,e.appName),e!=null&&e.appVersion&&t.set(RF,e.appVersion)}function I5(t,e){t.set(yF,e)}function ZR(t,e){e&&t.set(mF,e)}function R5(t,e){t.set(OF,e)}function yk(t,e,n){if(e&&n)t.set(wF,e),t.set(SF,n);else throw et($R)}function N5(t,e){t.set(bF,e)}function $5(t,e){t.set(gF,e)}function M5(t,e){t.set(kF,e)}function FR(t,e){t.set(MF,e)}function XR(t,e){e&&t.set(QF,e)}function WR(t,e){e&&t.set(LF,e)}function VR(t,e){t.set(dF,e)}function bk(t){t.set(GZ,"1")}function Q5(t){t.set(VF,"1")}function HR(t){t.has(vb)||t.set(vb,"true")}function bi(t,e){Object.entries(e).forEach(([n,r])=>{!t.has(n)&&r&&t.set(n,r)})}function YR(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw et(NR)}return e&&e.length>0&&(n.hasOwnProperty(od.ACCESS_TOKEN)||(n[od.ACCESS_TOKEN]={}),n[od.ACCESS_TOKEN][od.XMS_CC]={values:e}),JSON.stringify(n)}function wk(t,e){e&&(t.set(IR,Be.POP),t.set(RR,e))}function qR(t,e){e&&(t.set(IR,Be.SSH),t.set(RR,e))}function GR(t,e){t.set(TF,e.generateCurrentRequestHeaderValue()),t.set(AF,e.generateLastRequestHeaderValue())}function KR(t){t.set(PF,oF)}function L5(t,e){t.set(zF,e)}function Mg(t,e,n){t.has(Iu)||t.set(Iu,e),t.has(ap)||t.set(ap,n)}function D5(t,e){t.set(FF,encodeURIComponent(e)),t.set(XF,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function JR(t,e){e&&t.set(WF,e)}/*! @azure/msal-common v16.6.0 2026-05-07 */function v1(t){if(!t)return t;let e=t.toLowerCase();return jr.endsWith(e,"?")?e=e.slice(0,-1):jr.endsWith(e,"?/")&&(e=e.slice(0,-2)),jr.endsWith(e,"/")||(e+="/"),e}function eN(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function cp(t){if(!t||t.indexOf("=")<0)return null;try{const e=eN(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw Y(h5)}return null}function Nu(t){const e=new Array;return t.forEach((n,r)=>{e.push(`${r}=${encodeURIComponent(n)}`)}),e.join("&")}function x1(t){if(!t)return t;const e=t.split("#")[0];try{const n=new URL(e),r=n.origin+n.pathname+n.search;return v1(r)}catch{return v1(e)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const up={createNewGuid:()=>{throw Y(Ce)},base64Decode:()=>{throw Y(Ce)},base64Encode:()=>{throw Y(Ce)},base64UrlEncode:()=>{throw Y(Ce)},encodeKid:()=>{throw Y(Ce)},async getPublicKeyThumbprint(){throw Y(Ce)},async removeTokenBindingKey(){throw Y(Ce)},async clearKeystore(){throw Y(Ce)},async signJwt(){throw Y(Ce)},async hashString(){throw Y(Ce)}};/*! @azure/msal-common v16.6.0 2026-05-07 */var at;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(at||(at={}));const z5=50,B5=500,po=new Map;function j5(t,e){po.delete(t),po.set(t,e)}function U5(t,e){const n=Date.now();let r=po.get(t);if(r)j5(t,r);else if(r={logs:[],firstEventTime:n},po.set(t,r),po.size>z5){const i=po.keys().next().value;i&&po.delete(i)}r.logs.push({...e,milliseconds:n-r.firstEventTime}),r.logs.length>B5&&r.logs.shift()}function Z5(t){if(t.length!==6)return!1;for(let e=0;e<t.length;e++){const n=t[e];if(!(n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"))return!1}return!0}class ki{constructor(e,n,r){this.level=at.Info;const i=()=>{},s=e||ki.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||i,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:at.Info,this.packageName=n||"",this.packageVersion=r||""}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:at.Info}}clone(e,n){return new ki({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,n)}logMessage(e,n){const r=n.correlationId;if(Z5(e)){const l={hash:e,level:n.logLevel,containsPii:n.containsPii||!1,milliseconds:0};U5(r,l)}if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const a=`${`[${new Date().toUTCString()}] : [${r}]`} : ${this.packageName}@${this.packageVersion} : ${at[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,a,n.containsPii||!1)}executeCallback(e,n,r){this.localCallback&&this.localCallback(e,n,r)}error(e,n){this.logMessage(e,{logLevel:at.Error,containsPii:!1,correlationId:n})}errorPii(e,n){this.logMessage(e,{logLevel:at.Error,containsPii:!0,correlationId:n})}warning(e,n){this.logMessage(e,{logLevel:at.Warning,containsPii:!1,correlationId:n})}warningPii(e,n){this.logMessage(e,{logLevel:at.Warning,containsPii:!0,correlationId:n})}info(e,n){this.logMessage(e,{logLevel:at.Info,containsPii:!1,correlationId:n})}infoPii(e,n){this.logMessage(e,{logLevel:at.Info,containsPii:!0,correlationId:n})}verbose(e,n){this.logMessage(e,{logLevel:at.Verbose,containsPii:!1,correlationId:n})}verbosePii(e,n){this.logMessage(e,{logLevel:at.Verbose,containsPii:!0,correlationId:n})}trace(e,n){this.logMessage(e,{logLevel:at.Trace,containsPii:!1,correlationId:n})}tracePii(e,n){this.logMessage(e,{logLevel:at.Trace,containsPii:!0,correlationId:n})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v16.6.0 2026-05-07 */const Qg="@azure/msal-common",wh="16.6.0";/*! @azure/msal-common v16.6.0 2026-05-07 */const Sk={None:"none"};/*! @azure/msal-common v16.6.0 2026-05-07 */function C1(t,e){return!!t&&!!e&&t===e.split(".")[1]}function Ul(t,e,n,r){if(r){const{oid:i,sub:s,tid:o,name:a,tfp:l,acr:c,preferred_username:u,upn:h,login_hint:d}=r,f=o||l||c||"";return{tenantId:f,localAccountId:i||s||"",name:a,username:u||h||"",loginHint:d,isHomeTenant:C1(f,t),upn:h}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:C1(n,t)}}function hp(t,e,n,r){let i=t;if(e){const{isHomeTenant:s,...o}=e;i={...t,...o}}if(n){const{isHomeTenant:s,...o}=Ul(t.homeAccountId,t.localAccountId,t.tenantId,n);return i={...i,...o,idTokenClaims:n,idToken:r},i}return i}/*! @azure/msal-common v16.6.0 2026-05-07 */function di(t,e){const n=F5(t);try{const r=e(n);return JSON.parse(r)}catch{throw Y(LR)}}function Di(t){if(!t.signin_state)return!1;const e=["kmsi","dvc_dmjd"];return t.signin_state.some(n=>e.includes(n.trim().toLowerCase()))}function F5(t){if(!t)throw Y(l5);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw Y(LR);return n[2]}function tN(t,e){if(e===0||Date.now()-3e5>t+e)throw Y(p5)}/*! @azure/msal-common v16.6.0 2026-05-07 */class Le{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw et(qF);e.includes("#")||(this._urlString=Le.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return jr.endsWith(n,"?")?n=n.slice(0,-1):jr.endsWith(n,"?/")&&(n=n.slice(0,-2)),jr.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw et(ad)}if(!e.HostNameAndPort||!e.PathSegments)throw et(ad);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw et(YF)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return Le.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),r=n.PathSegments;return e&&r.length!==0&&(r[0]===zs.COMMON||r[0]===zs.ORGANIZATIONS)&&(r[0]=e),Le.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw et(ad);const r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let i=r.AbsolutePath.split("/");return i=i.filter(s=>s&&s.length>0),r.PathSegments=i,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(n);if(!r)throw et(ad);return r[2]}static getAbsoluteUrl(e,n){if(e[0]===wb){const i=new Le(n).getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new Le(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}}/*! @azure/msal-common v16.6.0 2026-05-07 */const X5=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function W5(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}const V5=X5.reduce((t,{host:e,issuerHost:n})=>(t[e]=W5(e,n||e),t),{}),nN={endpointMetadata:V5,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},E1=nN.endpointMetadata,kk=nN.instanceDiscoveryMetadata,rN=new Set;kk.metadata.forEach(t=>{t.aliases.forEach(e=>{rN.add(e)})});function H5(t,e,n){var s;let r;const i=t.canonicalAuthority;if(i){const o=new Le(i).getUrlComponents().HostNameAndPort;r=_1(e,n,o,(s=t.cloudDiscoveryMetadata)==null?void 0:s.metadata)||_1(e,n,o,kk.metadata)||t.knownAuthorities}return r||[]}function _1(t,e,n,r,i){if(t.trace("1bmquz",e),n&&r){const s=dp(r,n);if(s)return t.trace("1fotbt",e),s.aliases;t.trace("14avvj",e)}return null}function Y5(t){return dp(kk.metadata,t)}function dp(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(r.aliases.includes(e))return r}return null}/*! @azure/msal-common v16.6.0 2026-05-07 */const Cb="cache_quota_exceeded",q5="cache_error_unknown";/*! @azure/msal-common v16.6.0 2026-05-07 */class Fa extends Error{constructor(e,n){const r=n||ak(e);super(r),Object.setPrototypeOf(this,Fa.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}function Eb(t){return t instanceof Error?t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.message.includes("exceeded the quota")?new Fa(Cb):new Fa(t.name,t.message):new Fa(q5)}/*! @azure/msal-common v16.6.0 2026-05-07 */function fp(t,e){if(!t)throw Y(a5);try{const n=e(t);return JSON.parse(n)}catch{throw Y(QR)}}function Xa(t){if(!t)throw Y(QR);const e=t.split(Sb,2);return{uid:e[0],utid:e.length<2?"":e[1]}}/*! @azure/msal-common v16.6.0 2026-05-07 */const $r={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v16.6.0 2026-05-07 */function vk(t){return t&&(t.tid||t.tfp||t.acr)||null}/*! @azure/msal-common v16.6.0 2026-05-07 */const Dn={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v16.6.0 2026-05-07 */function Do(t){const e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(Ul(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(n=>[n.tenantId,n])),dataBoundary:t.dataBoundary}}function G5(t,e,n){var p,g,y,m,O,b,S;let r;e.authorityType===$r.Adfs?r=qZ:e.protocolMode===Dn.OIDC?r=CR:r=YZ;let i,s;t.clientInfo&&n&&(i=fp(t.clientInfo,n),i.xms_tdbr&&(s=i.xms_tdbr==="EU"?"EU":"None"));const o=t.environment||e&&e.getPreferredCache();if(!o)throw Y(BR);const a=((p=t.idTokenClaims)==null?void 0:p.preferred_username)||((g=t.idTokenClaims)==null?void 0:g.upn),l=(y=t.idTokenClaims)!=null&&y.emails?t.idTokenClaims.emails[0]:null,c=a||l||"",u=(m=t.idTokenClaims)==null?void 0:m.login_hint,h=(i==null?void 0:i.utid)||vk(t.idTokenClaims)||"",d=(i==null?void 0:i.uid)||((O=t.idTokenClaims)==null?void 0:O.oid)||((b=t.idTokenClaims)==null?void 0:b.sub)||"";let f;return t.tenantProfiles?f=t.tenantProfiles:f=[Ul(t.homeAccountId,d,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:o,realm:h,localAccountId:d,username:c,authorityType:r,loginHint:u,clientInfo:t.clientInfo,name:((S=t.idTokenClaims)==null?void 0:S.name)||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:f,dataBoundary:s}}function K5(t,e,n){var i;const r=Array.from(((i=t.tenantProfiles)==null?void 0:i.values())||[]);return r.length===0&&t.tenantId&&t.localAccountId&&r.push(Ul(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||CR,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:n,tenantProfiles:r,dataBoundary:t.dataBoundary}}function iN(t,e,n,r,i,s){if(!(e===$r.Adfs||e===$r.Dsts)){if(t)try{const o=fp(t,r.base64Decode);if(o.uid&&o.utid)return`${o.uid}.${o.utid}`}catch{}n.warning("1ub6wv",i)}return(s==null?void 0:s.sub)||""}function J5(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}/*! @azure/msal-common v16.6.0 2026-05-07 */class _b{constructor(e,n,r,i,s){this.clientId=e,this.cryptoImpl=n,this.commonLogger=r.clone(Qg,wh),this.staticAuthorityOptions=s,this.performanceClient=i}getAllAccounts(e={},n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){if(Object.keys(e).length===0||Object.values(e).every(i=>i==null||i===""))return this.commonLogger.warning("1skb02",n),null;const r=this.getAllAccounts(e,n);return r.length>1?r.sort((s,o)=>{const a=s.idTokenClaims?1:0;return(o.idTokenClaims?1:0)-a})[0]:r.length===1?r[0]:null}getBaseAccountInfo(e,n){const r=this.getAccountsFilteredBy(e,n);return r.length>0?Do(r[0]):null}buildTenantProfiles(e,n,r){return e.flatMap(i=>this.getTenantProfilesFromAccountEntity(i,n,r==null?void 0:r.tenantId,r))}getTenantedAccountInfoByFilter(e,n,r,i,s){let o=null,a;if(s&&!this.tenantProfileMatchesFilter(r,s))return null;const l=this.getIdToken(e,i,n,r.tenantId);return l&&(a=di(l.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(a,s))?null:(o=hp(e,r,a,l==null?void 0:l.secret),o)}getTenantProfilesFromAccountEntity(e,n,r,i){const s=Do(e);let o=s.tenantProfiles||new Map;const a=this.getTokenKeys();if(r){const c=o.get(r);if(c)o=new Map([[r,c]]);else return[]}const l=[];return o.forEach(c=>{const u=this.getTenantedAccountInfoByFilter(s,a,c,n,i);u&&l.push(u)}),l}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant||n.username&&!(this.matchUsername(e.username,n.username)||!this.matchUsername(e.upn,n.username))||n.loginHint&&!this.matchLoginHintWithTenantProfile(e,n.loginHint)||n.upn&&e.upn!==n.upn)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)&&!this.matchUsername(e.upn,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,r,i,s){var o;if(!e)throw Y(b5);try{e.account&&await this.setAccount(e.account,n,r,i),e.idToken&&(s==null?void 0:s.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,n,r),e.accessToken&&(s==null?void 0:s.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,n,r),e.refreshToken&&(s==null?void 0:s.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n,r),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(a){throw(o=this.commonLogger)==null||o.error("0j476p",n),a instanceof He?a:Eb(a)}}async saveAccessToken(e,n,r){const i={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),o=rn.fromString(e.target);s.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,i,!1))return;const l=this.getAccessTokenCredential(a,n);l&&this.credentialMatchesFilter(l,i,n)&&rn.fromString(l.target).intersectingScopeSets(o)&&this.removeAccessToken(a,n)}),await this.setAccessTokenCredential(e,n,r)}getAccountsFilteredBy(e,n){const r=this.getAccountKeys(),i=[];return r.forEach(s=>{var c;const o=this.getAccount(s,n);if(!o||e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId)||e.environment&&!this.matchEnvironment(o,e.environment,n)||e.realm&&!this.matchRealm(o,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(o,e.authorityType))return;const a={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name,username:e==null?void 0:e.username,loginHint:e==null?void 0:e.loginHint,upn:e==null?void 0:e.upn},l=(c=o.tenantProfiles)==null?void 0:c.filter(u=>this.tenantProfileMatchesFilter(u,a));l&&l.length===0||i.push(o)}),i}credentialMatchesFilter(e,n,r){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment,r)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||e.credentialType===Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===Be.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e,n){const r=this.getKeys(),i={};return r.forEach(s=>{if(!this.isAppMetadata(s))return;const o=this.getAppMetadata(s,n);o&&(e.environment&&!this.matchEnvironment(o,e.environment,n)||e.clientId&&!this.matchClientId(o,e.clientId)||(i[s]=o))}),i}getAuthorityMetadataByAlias(e,n){const r=this.getAuthorityMetadataKeys();let i=null;return r.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;const o=this.getAuthorityMetadata(s,n);o&&o.aliases.indexOf(e)!==-1&&(i=o)}),i}removeAllAccounts(e){this.getAllAccounts({},e).forEach(r=>{this.removeAccount(r,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const r=this.getAccountKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.filter(i).forEach(s=>{this.removeItem(s,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const r=this.getTokenKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.idToken.filter(i).forEach(s=>{this.removeIdToken(s,n)}),r.accessToken.filter(i).forEach(s=>{this.removeAccessToken(s,n)}),r.refreshToken.filter(i).forEach(s=>{this.removeRefreshToken(s,n)})}removeAccessToken(e,n){const r=this.getAccessTokenCredential(e,n);if(r&&(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),r.credentialType.toLowerCase()===Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&r.tokenType===Be.POP)){const s=r.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,n).catch(()=>{var o;this.commonLogger.error("0cx291",n),(o=this.performanceClient)==null||o.incrementFields({removeTokenBindingKeyFailure:1},n)})}}removeAppMetadata(e){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r,e)}),!0}getIdToken(e,n,r,i){this.commonLogger.trace("1drz22",n);const s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ut.ID_TOKEN,clientId:this.clientId,realm:i},o=this.getIdTokensByFilter(s,n,r),a=o.size;if(a<1)return this.commonLogger.info("1atvtd",n),null;if(a>1){let l=o;if(!i){const c=new Map;o.forEach((h,d)=>{h.realm===e.tenantId&&c.set(d,h)});const u=c.size;if(u<1)return this.commonLogger.info("0ooalx",n),o.values().next().value??null;if(u===1)return this.commonLogger.info("1eq2vc",n),c.values().next().value??null;l=c}return this.commonLogger.info("1ws328",n),l.forEach((c,u)=>{this.removeIdToken(u,n)}),this.performanceClient.addFields({multiMatchedID:o.size},n),null}return this.commonLogger.info("1sm769",n),o.values().next().value??null}getIdTokensByFilter(e,n,r){const i=r&&r.idToken||this.getTokenKeys().idToken,s=new Map;return i.forEach(o=>{if(!this.idTokenKeyMatchesFilter(o,{clientId:this.clientId,...e}))return;const a=this.getIdTokenCredential(o,n);a&&this.credentialMatchesFilter(a,e,n)&&s.set(o,a)}),s}idTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,r,i){const s=n.correlationId;this.commonLogger.trace("1t7hz1",s);const o=rn.createSearchScopes(n.scopes),a=n.authenticationScheme||Be.BEARER,l=a.toLowerCase()!==Be.BEARER.toLowerCase()?Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME:Ut.ACCESS_TOKEN,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:l,clientId:this.clientId,realm:i||e.tenantId,target:o,tokenType:a,keyId:n.sshKid},u=r&&r.accessToken||this.getTokenKeys().accessToken,h=[];u.forEach(f=>{if(this.accessTokenKeyMatchesFilter(f,c,!0)){const p=this.getAccessTokenCredential(f,s);p&&this.credentialMatchesFilter(p,c,s)&&h.push(p)}});const d=h.length;return d<1?(this.commonLogger.info("1nckna",s),null):d>1?(this.commonLogger.info("1wkfwp",s),h.forEach(f=>{this.removeAccessToken(this.generateCredentialKey(f),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("06yt98",s),h[0])}accessTokenKeyMatchesFilter(e,n,r){const i=e.toLowerCase();if(n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&i.indexOf(n.realm.toLowerCase())===-1)return!1;if(n.target){const s=n.target.asArray();for(let o=0;o<s.length;o++){if(r&&!i.includes(s[o].toLowerCase()))return!1;if(!r&&i.includes(s[o].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,n){const r=this.getTokenKeys(),i=[];return r.accessToken.forEach(s=>{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;const o=this.getAccessTokenCredential(s,n);o&&this.credentialMatchesFilter(o,e,n)&&i.push(o)}),i}getRefreshToken(e,n,r,i){this.commonLogger.trace("0x53vi",r);const s=n?op:void 0,o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ut.REFRESH_TOKEN,clientId:this.clientId,familyId:s},a=i&&i.refreshToken||this.getTokenKeys().refreshToken,l=[];a.forEach(u=>{if(this.refreshTokenKeyMatchesFilter(u,o)){const h=this.getRefreshTokenCredential(u,r);h&&this.credentialMatchesFilter(h,o,r)&&l.push(h)}});const c=l.length;return c<1?(this.commonLogger.info("0dlw11",r),null):(c>1&&this.performanceClient.addFields({multiMatchedRT:c},r),this.commonLogger.info("0wcnep",r),l[0])}refreshTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.familyId&&r.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,n){const r={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(r,n),s=Object.keys(i).map(a=>i[a]),o=s.length;if(o<1)return null;if(o>1)throw Y(g5);return s[0]}isAppMetadataFOCI(e,n){const r=this.readAppMetadataFromCache(e,n);return!!(r&&r.familyId===op)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const r=e.oid||e.sub;return n===r}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){var r;return n.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,n){return!!(e&&typeof e=="string"&&(n==null?void 0:n.toLowerCase())===e.toLowerCase())}matchLoginHintWithTenantProfile(e,n){return e.loginHint===n||e.username===n||e.upn===n}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n,r){if(this.staticAuthorityOptions){const s=H5(this.staticAuthorityOptions,this.commonLogger,r);if(s.includes(n)&&s.includes(e.environment))return!0}const i=this.getAuthorityMetadataByAlias(n,r);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return!!(e.login_hint===n||e.preferred_username===n||e.upn===n||e.emails&&e.emails.includes(n))}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==Ut.ACCESS_TOKEN&&e.credentialType!==Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:rn.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(ok)!==-1}isAuthorityMetadata(e){return e.indexOf(kb)!==-1}generateAuthorityMetadataCacheKey(e){return`${kb}-${this.clientId}-${e}`}static toObject(e,n){for(const r in n)e[r]=n[r];return e}}class e3 extends _b{async setAccount(){throw Y(Ce)}getAccount(){throw Y(Ce)}async setIdTokenCredential(){throw Y(Ce)}getIdTokenCredential(){throw Y(Ce)}async setAccessTokenCredential(){throw Y(Ce)}getAccessTokenCredential(){throw Y(Ce)}async setRefreshTokenCredential(){throw Y(Ce)}getRefreshTokenCredential(){throw Y(Ce)}setAppMetadata(){throw Y(Ce)}getAppMetadata(){throw Y(Ce)}setServerTelemetry(){throw Y(Ce)}getServerTelemetry(){throw Y(Ce)}setAuthorityMetadata(){throw Y(Ce)}getAuthorityMetadata(){throw Y(Ce)}getAuthorityMetadataKeys(){throw Y(Ce)}setThrottlingCache(){throw Y(Ce)}getThrottlingCache(){throw Y(Ce)}removeItem(){throw Y(Ce)}getKeys(){throw Y(Ce)}getAccountKeys(){throw Y(Ce)}getTokenKeys(){throw Y(Ce)}generateCredentialKey(){throw Y(Ce)}generateAccountKey(){throw Y(Ce)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const t3={InProgress:1};/*! @azure/msal-common v16.6.0 2026-05-07 */class sN{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:t3.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-common v16.6.0 2026-05-07 */const oN={tokenRenewalOffsetSeconds:AR,preventCorsPreflight:!1},n3={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:at.Info,correlationId:""},r3={async sendGetRequestAsync(){throw Y(Ce)},async sendPostRequestAsync(){throw Y(Ce)}},i3={sku:IZ,version:wh,cpu:"",os:""},s3={clientSecret:"",clientAssertion:void 0},o3={azureCloudInstance:Sk.None,tenant:`${SR}`},a3={application:{appName:"",appVersion:""}};function xk({authOptions:t,systemOptions:e,loggerOptions:n,storageInterface:r,networkInterface:i,cryptoInterface:s,clientCredentials:o,libraryInfo:a,telemetry:l,serverTelemetryManager:c,persistencePlugin:u,serializableCache:h}){const d={...n3,...n};return{authOptions:l3(t),systemOptions:{...oN,...e},loggerOptions:d,storageInterface:r||new e3(t.clientId,up,new ki(d),new sN),networkInterface:i||r3,cryptoInterface:s||up,clientCredentials:o||s3,libraryInfo:{...i3,...a},telemetry:{...a3,...l},serverTelemetryManager:c||null,persistencePlugin:u||null,serializableCache:h||null}}function l3(t){return{clientCapabilities:[],azureCloudOptions:o3,instanceAware:!1,isMcp:!1,...t}}function aN(t){return t.authOptions.authority.options.protocolMode===Dn.OIDC}/*! @azure/msal-common v16.6.0 2026-05-07 */class c3{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v16.6.0 2026-05-07 */function Wr(){return Math.round(new Date().getTime()/1e3)}function pp(t){return t.getTime()/1e3}function ff(t){return t?new Date(Number(t)*1e3):new Date}function gp(t,e){const n=Number(t)||0;return Wr()+e>n}function T1(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function u3(t){return Number(t)>Wr()}/*! @azure/msal-common v16.6.0 2026-05-07 */function Lg(t,e,n,r,i){return{credentialType:Ut.ID_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,realm:i,lastUpdatedAt:Date.now().toString()}}function Dg(t,e,n,r,i,s,o,a,l,c,u,h,d){var p,g;const f={homeAccountId:t,credentialType:Ut.ACCESS_TOKEN,secret:n,cachedAt:Wr().toString(),expiresOn:o.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:r,realm:i,target:s,tokenType:u||Be.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(f.userAssertionHash=h),c&&(f.refreshOn=c.toString()),((p=f.tokenType)==null?void 0:p.toLowerCase())!==Be.BEARER.toLowerCase())switch(f.credentialType=Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME,f.tokenType){case Be.POP:const y=di(n,l);if(!((g=y==null?void 0:y.cnf)!=null&&g.kid))throw Y(w5);f.keyId=y.cnf.kid;break;case Be.SSH:f.keyId=d}return f}function h3(t,e,n,r,i,s,o){const a={credentialType:Ut.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,lastUpdatedAt:Date.now().toString()};return s&&(a.userAssertionHash=s),i&&(a.familyId=i),o&&(a.expiresOn=o.toString()),a}function zg(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function A1(t){return t?zg(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===Ut.ACCESS_TOKEN||t.credentialType===Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function d3(t){return t?zg(t)&&t.hasOwnProperty("realm")&&t.credentialType===Ut.ID_TOKEN:!1}function P1(t){return t?zg(t)&&t.credentialType===Ut.REFRESH_TOKEN:!1}function f3(t,e){const n=t.indexOf(_R)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&r}function p3(t,e){let n=!1;t&&(n=t.indexOf(TR)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),n&&r}function g3({environment:t,clientId:e}){return[ok,t,e].join(ER).toLowerCase()}function m3(t,e){return e?t.indexOf(ok)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function O3(t,e){return e?t.indexOf(kb)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function I1(){return Wr()+KZ}function cd(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function Km(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function R1(t){return t.expiresAt<=Wr()}/*! @azure/msal-common v16.6.0 2026-05-07 */const y3="networkClientSendPostRequestAsync",b3="refreshTokenClientExecutePostToTokenEndpoint",w3="authorizationCodeClientExecutePostToTokenEndpoint",S3="refreshTokenClientExecuteTokenRequest",k3="refreshTokenClientAcquireToken",Jm="refreshTokenClientAcquireTokenWithCachedRefreshToken",v3="refreshTokenClientCreateTokenRequestBody",x3="silentFlowClientGenerateResultFromCacheRecord",Ck="getAuthCodeUrl",lN="handleCodeResponseFromServer",C3="authClientExecuteTokenRequest",E3="authClientCreateTokenRequestBody",_3="updateTokenEndpointAuthority",Sh="popTokenGenerateCnf",Ek="handleServerTokenResponse",T3="authorityResolveEndpointsAsync",A3="authorityGetCloudDiscoveryMetadataFromNetwork",P3="authorityUpdateCloudDiscoveryMetadata",I3="authorityGetEndpointMetadataFromNetwork",R3="authorityUpdateEndpointMetadata",N1="authorityUpdateMetadataWithRegionalInformation",N3="regionDiscoveryDetectRegion",$1="regionDiscoveryGetRegionFromIMDS",$3="regionDiscoveryGetCurrentVersion",M3="cacheManagerGetRefreshToken",Q3="setUserData";/*! @azure/msal-common v16.6.0 2026-05-07 */const Jn=(t,e,n,r,i)=>(...s)=>{n.trace("1plfzx",i);const o=r.startMeasurement(e,i);i&&r.incrementFields({[`ext.${e}CallCount`]:1},i);try{const a=t(...s);return o.end({success:!0}),n.trace("1g8n6a",i),a}catch(a){n.trace("0cfd8i",i);try{n.trace(JSON.stringify(a),i)}catch{n.trace("00dty7",i)}throw o.end({success:!1},a),a}},Z=(t,e,n,r,i)=>(...s)=>{n.trace("1plfzx",i);const o=r.startMeasurement(e,i);return i&&r.incrementFields({[`ext.${e}CallCount`]:1},i),t(...s).then(a=>(n.trace("1g8n6a",i),o.end({success:!0}),a)).catch(a=>{n.trace("0cfd8i",i);try{n.trace(JSON.stringify(a),i)}catch{n.trace("00dty7",i)}throw o.end({success:!1},a),a})};/*! @azure/msal-common v16.6.0 2026-05-07 */const L3={SW:"sw"};class gl{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){const r=await Z(this.generateKid.bind(this),Sh,n,this.performanceClient,e.correlationId)(e),i=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:i}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:L3.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,i){const{resourceRequestMethod:s,resourceRequestUri:o,shrClaims:a,shrNonce:l,shrOptions:c}=r,u=o?new Le(o):void 0,h=u==null?void 0:u.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Wr(),m:s==null?void 0:s.toUpperCase(),u:h==null?void 0:h.HostNameAndPort,nonce:l||this.cryptoUtils.createNewGuid(),p:h==null?void 0:h.AbsolutePath,q:h!=null&&h.QueryString?[[],h.QueryString]:void 0,client_claims:a||void 0,...i},n,c,r.correlationId)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const Tb="no_tokens_found",D3="native_account_unavailable",cN="refresh_token_expired",uN="ux_not_allowed",z3="interaction_required",B3="consent_required",j3="login_required",_k="bad_token",U3="interrupted_user";/*! @azure/msal-common v16.6.0 2026-05-07 */const M1=[z3,B3,j3,_k,uN,U3],Z3=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"];class vr extends He{constructor(e,n,r,i,s,o,a,l){super(e,n,r),Object.setPrototypeOf(this,vr.prototype),this.timestamp=i||"",this.traceId=s||"",this.correlationId=o||"",this.claims=a||"",this.name="InteractionRequiredAuthError",this.errorNo=l}}function hN(t,e,n){const r=!!t&&M1.indexOf(t)>-1,i=!!n&&Z3.indexOf(n)>-1,s=!!e&&M1.some(o=>e.indexOf(o)>-1);return r||s||i}function mp(t,e){return new vr(t,e)}/*! @azure/msal-common v16.6.0 2026-05-07 */class Go extends He{constructor(e,n,r,i,s){super(e,n,r),this.name="ServerError",this.errorNo=i,this.status=s,Object.setPrototypeOf(this,Go.prototype)}}/*! @azure/msal-common v16.6.0 2026-05-07 */function Tk(t,e,n){const r=F3(t,n);return e?`${r}${bb}${e}`:r}function F3(t,e){if(!t)throw Y(jR);const n={id:t.createNewGuid()};e&&(n.meta=e);const r=JSON.stringify(n);return t.base64Encode(r)}function kh(t,e){if(!t)throw Y(jR);if(!e)throw Y(Ru);try{const n=e.split(bb),r=n[0],i=n.length>1?n.slice(1).join(bb):"",s=t(r),o=JSON.parse(s);return{userRequestState:i||"",libraryState:o}}catch{throw Y(Ru)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class zo{constructor(e,n,r,i,s,o,a){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=i,this.performanceClient=s,this.serializableCache=o,this.persistencePlugin=a}validateTokenResponse(e,n,r){var i;if(e.error||e.error_description||e.suberror){const s=`Error(s): ${e.error_codes||Oc} - Timestamp: ${e.timestamp||Oc} - Description: ${e.error_description||Oc} - Correlation ID: ${e.correlation_id||Oc} - Trace ID: ${e.trace_id||Oc}`,o=(i=e.error_codes)!=null&&i.length?e.error_codes[0]:void 0,a=new Go(e.error,s,e.suberror,o,e.status);if(r&&e.status&&e.status>=VZ&&e.status<=HZ){this.logger.warning("16ks7j",n);return}else if(r&&e.status&&e.status>=XZ&&e.status<=WZ){this.logger.warning("0g61x3",n);return}throw hN(e.error,e.error_description,e.suberror)?new vr(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",o):a}}async handleServerTokenResponse(e,n,r,i,s,o,a,l,c,u){var g;let h;if(e.id_token){if(h=di(e.id_token||"",this.cryptoObj.base64Decode),o&&o.nonce&&h.nonce!==o.nonce)throw Y(f5);if(i.maxAge||i.maxAge===0){const y=h.auth_time;if(!y)throw Y(DR);tN(y,i.maxAge)}}this.homeAccountIdentifier=iN(e.client_info||"",n.authorityType,this.logger,this.cryptoObj,i.correlationId,h);let d;o&&o.state&&(d=kh(this.cryptoObj.base64Decode,o.state)),e.key_id=e.key_id||i.sshKid||void 0;const f=this.generateCacheRecord(e,n,r,i,h,a,o);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("0jbz5k",i.correlationId),p=new c3(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),l&&!c&&f.account&&this.cacheStorage.getAllAccounts({homeAccountId:f.account.homeAccountId,environment:f.account.environment},i.correlationId).length<1)return this.logger.warning("1gmt66",i.correlationId),(g=this.performanceClient)==null||g.addFields({acntLoggedOut:!0},i.correlationId),await zo.generateAuthenticationResult(this.cryptoObj,n,f,!1,i,this.performanceClient,h,d,void 0,u);await this.cacheStorage.saveCacheRecord(f,i.correlationId,Di(h||{}),s,i.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("1bh17u",i.correlationId),await this.persistencePlugin.afterCacheAccess(p))}return zo.generateAuthenticationResult(this.cryptoObj,n,f,!1,i,this.performanceClient,h,d,e,u)}generateCacheRecord(e,n,r,i,s,o,a){var g;const l=n.getPreferredCache();if(!l)throw Y(BR);const c=vk(s);let u,h;e.id_token&&s&&(u=Lg(this.homeAccountIdentifier,l,e.id_token,this.clientId,c||""),h=dN(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,i.correlationId,s,e.client_info,l,c,a,void 0,this.logger,this.performanceClient));let d=null;if(e.access_token){const y=e.scope?rn.fromString(e.scope):new rn(i.scopes||[]),m=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,O=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,b=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,S=r+m,x=S+O,k=b&&b>0?r+b:void 0;d=Dg(this.homeAccountIdentifier,l,e.access_token,this.clientId,c||n.tenant||"",y.printScopes(),S,x,this.cryptoObj.base64Decode,k,e.token_type,o,e.key_id);const E=i.resource||null;E&&(d.resource=E)}let f=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){const m=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=r+m,(g=this.performanceClient)==null||g.addFields({ntwkRtExpiresOnSeconds:y},i.correlationId)}f=h3(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,o,y)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:l,familyId:e.foci}),{account:h,idToken:u,accessToken:d,refreshToken:f,appMetadata:p}}static async generateAuthenticationResult(e,n,r,i,s,o,a,l,c,u){var S,x,k,E,I;let h="",d=[],f=null,p,g,y="";if(r.accessToken){if(r.accessToken.tokenType===Be.POP&&!s.popKid){const Q=new gl(e,o),{secret:T,keyId:D}=r.accessToken;if(!D)throw Y(UR);h=await Q.signPopToken(T,D,s)}else h=r.accessToken.secret;d=rn.fromString(r.accessToken.target).asArray(),f=ff(r.accessToken.expiresOn),p=ff(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(g=ff(r.accessToken.refreshOn))}r.appMetadata&&(y=r.appMetadata.familyId===op?op:"");const m=(a==null?void 0:a.oid)||(a==null?void 0:a.sub)||"",O=(a==null?void 0:a.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const b=r.account?hp(Do(r.account),void 0,a,(S=r.idToken)==null?void 0:S.secret):null;return{authority:n.canonicalAuthority,uniqueId:m,tenantId:O,scopes:d,account:b,idToken:((x=r==null?void 0:r.idToken)==null?void 0:x.secret)||"",idTokenClaims:a||{},accessToken:h,fromCache:i,expiresOn:f,extExpiresOn:p,refreshOn:g,correlationId:s.correlationId,requestId:u||"",familyId:y,tokenType:((k=r.accessToken)==null?void 0:k.tokenType)||"",state:l?l.userRequestState:"",cloudGraphHostName:((E=r.account)==null?void 0:E.cloudGraphHostName)||"",msGraphHost:((I=r.account)==null?void 0:I.msGraphHost)||"",code:c==null?void 0:c.spa_code,fromPlatformBroker:!1}}}function dN(t,e,n,r,i,s,o,a,l,c,u,h,d){h==null||h.verbose("09jz0t",i);const f=a||e.getPreferredCache(),p=t.getAccountsFilteredBy({homeAccountId:n,environment:f},i);d==null||d.addFields({cacheMatchedAccounts:p.length},i),p.length>1&&(h==null||h.warning("0x7ad1",i));const y=(p.length===1?p[0]:null)||G5({homeAccountId:n,idTokenClaims:s,clientInfo:o,environment:a,cloudGraphHostName:c==null?void 0:c.cloud_graph_host_name,msGraphHost:c==null?void 0:c.msgraph_host,nativeAccountId:u},e,r),m=y.tenantProfiles||[],O=l||y.realm;if(O&&!m.find(b=>b.tenantId===O)){const b=Ul(n,y.localAccountId,O,s);m.push(b)}return y.tenantProfiles=m,y}/*! @azure/msal-common v16.6.0 2026-05-07 */const Lr={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v16.6.0 2026-05-07 */async function fN(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v16.6.0 2026-05-07 */function Bg(t,e,n){var r;return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.extraParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class ai{static generateThrottlingStorageKey(e){return`${TR}.${JSON.stringify(e)}`}static preProcess(e,n,r){var o;const i=ai.generateThrottlingStorageKey(n),s=e.getThrottlingCache(i,r);if(s){if(s.throttleTime<Date.now()){e.removeItem(i,r);return}throw new Go(((o=s.errorCodes)==null?void 0:o.join(" "))||"",s.errorMessage,s.subError)}}static postProcess(e,n,r,i){if(ai.checkResponseStatus(r)||ai.checkResponseForRetryAfter(r)){const s={throttleTime:ai.calculateThrottleTime(parseInt(r.headers[On.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(ai.generateThrottlingStorageKey(n),s,i)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(On.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||iF),r+sF)*1e3)}static removeThrottle(e,n,r,i){const s=Bg(n,r,i),o=this.generateThrottlingStorageKey(s);e.removeItem(o,r.correlationId)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class jg extends He{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,jg.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function Qc(t,e,n,r){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${r==null?void 0:r.name}, error.message:${r==null?void 0:r.message}`,new jg(t,e,n)}/*! @azure/msal-common v16.6.0 2026-05-07 */function pN(t,e,n){const r={};if(r[On.CONTENT_TYPE]=DZ,!e&&n)switch(n.type){case Lr.HOME_ACCOUNT_ID:try{const i=Xa(n.credential);r[On.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch{t.verbose("1qhtee","")}break;case Lr.UPN:r[On.CCS_HEADER]=`UPN: ${n.credential}`;break}return r}function gN(t,e,n,r){const i=new Map;return t.embeddedClientId&&Mg(i,e,n),t.extraQueryParameters&&bi(i,t.extraQueryParameters),bh(i,t.correlationId),$g(i,t.correlationId,r),Nu(i)}async function mN(t,e,n,r,i,s,o,a,l,c){const u=await X3(r,t,{body:e,headers:n},i,s,o,a,l);return c&&u.status<500&&u.status!==429&&c.clearTelemetryCache(),u}async function X3(t,e,n,r,i,s,o,a){var c;ai.preProcess(i,t,r);let l;try{l=await Z(s.sendPostRequestAsync.bind(s),y3,o,a,r)(e,n);const u=l.headers||{};a==null||a.addFields({refreshTokenSize:((c=l.body.refresh_token)==null?void 0:c.length)||0,httpVerToken:u[On.X_MS_HTTP_VERSION]||"",requestId:u[On.X_MS_REQUEST_ID]||""},r)}catch(u){if(u instanceof jg){const h=u.responseHeaders;throw h&&(a==null||a.addFields({httpVerToken:h[On.X_MS_HTTP_VERSION]||"",requestId:h[On.X_MS_REQUEST_ID]||"",contentTypeHeader:h[On.CONTENT_TYPE]||void 0,contentLengthHeader:h[On.CONTENT_LENGTH]||void 0,httpStatus:u.httpStatus},r)),u.error}throw u instanceof He?u:Y(c5)}return ai.postProcess(i,t,l,r),l}/*! @azure/msal-common v16.6.0 2026-05-07 */function W3(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v16.6.0 2026-05-07 */function V3(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}/*! @azure/msal-common v16.6.0 2026-05-07 */function H3(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}/*! @azure/msal-common v16.6.0 2026-05-07 */class Ug{constructor(e,n,r,i){this.networkInterface=e,this.logger=n,this.performanceClient=r,this.correlationId=i}async detectRegion(e,n){let r=e;if(r)n.region_source=aa.ENVIRONMENT_VARIABLE;else{const i=Ug.IMDS_OPTIONS;try{const s=await Z(this.getRegionFromIMDS.bind(this),$1,this.logger,this.performanceClient,this.correlationId)(zZ,i);if(s.status===d1&&(r=s.body,n.region_source=aa.IMDS),s.status===f1){const o=await Z(this.getCurrentVersion.bind(this),$3,this.logger,this.performanceClient,this.correlationId)(i);if(!o)return n.region_source=aa.FAILED_AUTO_DETECTION,null;const a=await Z(this.getRegionFromIMDS.bind(this),$1,this.logger,this.performanceClient,this.correlationId)(o,i);a.status===d1&&(r=a.body,n.region_source=aa.IMDS)}}catch{return n.region_source=aa.FAILED_AUTO_DETECTION,null}}return r||(n.region_source=aa.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,n){return this.networkInterface.sendGetRequestAsync(`${u1}?api-version=${e}&format=text`,n,BZ)}async getCurrentVersion(e){try{const n=await this.networkInterface.sendGetRequestAsync(`${u1}?format=json`,e);return n.status===f1&&n.body&&n.body["newest-versions"]&&n.body["newest-versions"].length>0?n.body["newest-versions"][0]:null}catch{return null}}}Ug.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v16.6.0 2026-05-07 */class _n{constructor(e,n,r,i,s,o,a,l){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=r,this.authorityOptions=i,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=a,this.correlationId=o,this.managedIdentity=l||!1,this.regionDiscovery=new Ug(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(c1))return $r.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case NZ:return $r.Adfs;case $Z:return $r.Dsts}return $r.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Le(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Y(ds)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Y(ds)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Y(ds)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Y(v5);return this.replacePath(this.metadata.end_session_endpoint)}else throw Y(ds)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Y(ds)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Y(ds)}canReplaceTenant(e){return e.PathSegments.length===1&&!_n.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===$r.Default&&this.protocolMode!==Dn.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const i=new Le(this.metadata.canonical_authority).getUrlComponents(),s=i.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,l)=>{let c=s[l];if(l===0&&this.canReplaceTenant(i)){const u=new Le(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];c!==u&&(this.logger.verbose("1q3g2x",this.correlationId),c=u)}a!==c&&(n=n.replace(`/${c}/`,`/${a}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===$r.Adfs||this.protocolMode===Dn.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var i;const e=this.getCurrentMetadataEntity(),n=await Z(this.updateCloudDiscoveryMetadata.bind(this),P3,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await Z(this.updateEndpointMetadata.bind(this),R3,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:r}),(i=this.performanceClient)==null||i.addFields({cloudDiscoverySource:n,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:I1(),jwks_uri:""}),e}updateCachedMetadata(e,n,r){n!==Pr.CACHE&&(r==null?void 0:r.source)!==Pr.CACHE&&(e.expiresAt=I1(),e.canonical_authority=this.canonicalAuthority);const i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(i,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){var i,s;const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===Pr.HARDCODED_VALUES&&(i=this.authorityOptions.azureRegionConfiguration)!=null&&i.azureRegion&&n.metadata){const o=await Z(this.updateMetadataWithRegionalInformation.bind(this),N1,this.logger,this.performanceClient,this.correlationId)(n.metadata);cd(e,o,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let r=await Z(this.getEndpointMetadataFromNetwork.bind(this),I3,this.logger,this.performanceClient,this.correlationId)();if(r)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(r=await Z(this.updateMetadataWithRegionalInformation.bind(this),N1,this.logger,this.performanceClient,this.correlationId)(r)),cd(e,r,!0),Pr.NETWORK;throw Y(u5,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("1fi0kc",this.correlationId);const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("06t0uj",this.correlationId),cd(e,n,!1),{source:Pr.CONFIG};this.logger.verbose("151k0p",this.correlationId);const r=this.getEndpointMetadataFromHardcodedValues();if(r)return cd(e,r,!1),{source:Pr.HARDCODED_VALUES,metadata:r};this.logger.verbose("1imop5",this.correlationId);const i=R1(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("16uq31",""),{source:Pr.CACHE}):(i&&this.logger.verbose("0uoibc",""),null)}isAuthoritySameType(e){return new Le(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw et(e5)}return null}async getEndpointMetadataFromNetwork(){const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose("1y65x6",this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(n,e);return W3(r.body)?r.body:(this.logger.verbose("1koyv8",this.correlationId),null)}catch{return this.logger.verbose("0a9wik",this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in E1?E1[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,i;const n=(r=this.authorityOptions.azureRegionConfiguration)==null?void 0:r.azureRegion;if(n){if(n!==jZ)return this.regionDiscoveryMetadata.region_outcome=Gm.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,_n.replaceWithRegionalInformation(e,n);const s=await Z(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),N3,this.logger,this.performanceClient,this.correlationId)((i=this.authorityOptions.azureRegionConfiguration)==null?void 0:i.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=Gm.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,_n.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=Gm.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const r=await Z(this.getCloudDiscoveryMetadataFromNetwork.bind(this),A3,this.logger,this.performanceClient,this.correlationId)();if(r)return Km(e,r,!0),Pr.NETWORK;throw et(t5)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("0jhlgt",this.correlationId),this.logger.verbosePii("1fy7uz",this.correlationId),this.logger.verbosePii("08zabj",this.correlationId),this.logger.verbosePii("1o1kv3",this.correlationId);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("1nakio",this.correlationId),Km(e,n,!1),Pr.CONFIG;this.logger.verbose("1x74aj",this.correlationId);const r=Y5(this.hostnameAndPort);if(r)return this.logger.verbose("0by47c",this.correlationId),Km(e,r,!1),Pr.HARDCODED_VALUES;this.logger.verbose("0r2fzy",this.correlationId);const i=R1(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("1uffgh",""),Pr.CACHE):(i&&this.logger.verbose("0uoibc",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===$r.Ciam)return this.logger.verbose("04y84h",this.correlationId),_n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("0gszr3",this.correlationId);try{this.logger.verbose("1iifkx",this.correlationId);const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=dp(e.metadata,this.hostnameAndPort);if(this.logger.verbose("0q67e3",""),n)return this.logger.verbose("0hzfao",this.correlationId),n;this.logger.verbose("1ajz3u",this.correlationId)}catch{throw this.logger.verbose("1wq5tu",this.correlationId),et(MR)}}return this.isInKnownAuthorities()?(this.logger.verbose("0mt9al",this.correlationId),_n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){const e=`${MZ}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let r=null;try{const i=await this.networkInterface.sendGetRequestAsync(e,n);let s,o;if(V3(i.body))s=i.body,o=s.metadata,this.logger.verbosePii("1vglyt",this.correlationId);else if(H3(i.body)){if(this.logger.warning("062uto",this.correlationId),s=i.body,s.error===FZ)return this.logger.error("1x90tm",this.correlationId),null;this.logger.warning("0wchdm",this.correlationId),this.logger.warning("1s5mpv",this.correlationId),this.logger.warning("1yhqpw",this.correlationId),o=[]}else return this.logger.error("0768g0",this.correlationId),null;this.logger.verbose("1lrobr",this.correlationId),r=dp(o,this.hostnameAndPort)}catch(i){return i instanceof He?this.logger.error("0vwhc7",this.correlationId):this.logger.error("0s2z41",this.correlationId),null}return r||(this.logger.warning("0jp28q",this.correlationId),this.logger.verbose("130sd8",this.correlationId),r=_n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&Le.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==Sk.None){const i=n.tenant?n.tenant:SR;r=`${n.azureCloudInstance}/${i}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return RZ;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Y(ds)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return rN.has(e)}static isPublicCloudAuthority(e){return ZZ.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const i=new Le(e);i.validateAsUri();const s=i.getUrlComponents();let o=`${n}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(o=`${n}.${UZ}`);const a=Le.constructAuthorityUriFromObject({...i.getUrlComponents(),HostNameAndPort:o}).urlString;return r?`${a}?${r}`:a}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=_n.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=_n.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=_n.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const i=new Le(e).getUrlComponents();if(i.PathSegments.length===0&&i.HostNameAndPort.endsWith(c1)){const s=i.HostNameAndPort.split(".")[0];n=`${n}${s}${QZ}`}return n}}_n.reservedTenantDomains=new Set(["{tenant}","{tenantid}",zs.COMMON,zs.CONSUMERS,zs.ORGANIZATIONS]);function Y3(t){var i;const r=(i=new Le(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:i.toLowerCase();switch(r){case zs.COMMON:case zs.ORGANIZATIONS:case zs.CONSUMERS:return;default:return r}}function ON(t){return t.endsWith(wb)?t:`${t}${wb}`}function q3(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw et(MR)}return{canonicalAuthority:t.authority?ON(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v16.6.0 2026-05-07 */async function yN(t,e,n,r,i,s,o){const a=_n.transformCIAMAuthority(ON(t)),l=new _n(a,e,n,r,i,s,o);try{return await Z(l.resolveEndpointsAsync.bind(l),T3,i,o,s)(),l}catch{throw Y(ds)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class bN{constructor(e,n){var r;this.includeRedirectUri=!0,this.config=xk(e),this.logger=new ki(this.config.loggerOptions,Qg,wh),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=n,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,n,r){var l;if(!e.code)throw Y(m5);r&&r.cloud_instance_host_name&&await Z(this.updateTokenEndpointAuthority.bind(this),_3,this.logger,this.performanceClient,e.correlationId)(r.cloud_instance_host_name,e.correlationId);const i=Wr(),s=await Z(this.executeTokenRequest.bind(this),C3,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),o=(l=s.headers)==null?void 0:l[On.X_MS_REQUEST_ID],a=new zo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(s.body,e.correlationId),Z(a.handleServerTokenResponse.bind(a),Ek,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,i,e,n,r,void 0,void 0,void 0,o)}getLogoutUri(e){if(!e)throw et(JF);const n=this.createLogoutUrlQueryString(e);return Le.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n,r){const i=gN(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Le.appendQueryString(e.tokenEndpoint,i),o=await Z(this.createTokenRequestBody.bind(this),E3,this.logger,this.performanceClient,n.correlationId)(n);let a;if(n.clientInfo)try{const u=fp(n.clientInfo,this.cryptoUtils.base64Decode);a={credential:`${u.uid}${Sb}${u.utid}`,type:Lr.HOME_ACCOUNT_ID}}catch{this.logger.verbose("0wznt3",n.correlationId)}const l=pN(this.logger,this.config.systemOptions.preventCorsPreflight,a||n.ccsCredential),c=Bg(this.config.authOptions.clientId,n);return Z(mN,w3,this.logger,this.performanceClient,n.correlationId)(s,o,l,c,n.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,r)}async createTokenRequestBody(e){var i;const n=new Map;if(fk(n,e.embeddedClientId||((i=e.extraParameters)==null?void 0:i[Lo])||this.config.authOptions.clientId),this.includeRedirectUri)pk(n,e.redirectUri);else if(!e.redirectUri)throw et(HF);if(dk(n,e.scopes,!0,this.oidcDefaultScopes),JR(n,e.resource),N5(n,e.code),mk(n,this.config.libraryInfo),Ok(n,this.config.telemetry.application),KR(n),this.serverTelemetryManager&&!aN(this.config)&&GR(n,this.serverTelemetryManager),e.codeVerifier&&M5(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&FR(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;XR(n,await fN(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),WR(n,s.assertionType)}if(VR(n,xR.AUTHORIZATION_CODE_GRANT),bk(n),e.authenticationScheme===Be.POP){const s=new gl(this.cryptoUtils,this.performanceClient);let o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Z(s.generateCnf.bind(s),Sh,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,wk(n,o)}else if(e.authenticationScheme===Be.SSH)if(e.sshJwk)qR(n,e.sshJwk);else throw et(uk);let r;if(e.clientInfo)try{const s=fp(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${Sb}${s.utid}`,type:Lr.HOME_ACCOUNT_ID}}catch{this.logger.verbose("0wznt3",e.correlationId)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Lr.HOME_ACCOUNT_ID:try{const s=Xa(r.credential);Gc(n,s)}catch{this.logger.verbose("1qhtee",e.correlationId)}break;case Lr.UPN:lp(n,r.credential);break}return e.embeddedClientId&&Mg(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&bi(n,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[y1])&&bi(n,{[y1]:"1"}),$g(n,e.correlationId,this.performanceClient),gk(n,e.claims,this.config.authOptions.clientCapabilities,e.skipBrokerClaims),Nu(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&T5(n,e.postLogoutRedirectUri),e.correlationId&&bh(n,e.correlationId),e.idTokenHint&&A5(n,e.idTokenHint),e.state&&ZR(n,e.state),e.logoutHint&&L5(n,e.logoutHint),e.extraQueryParameters&&bi(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&HR(n),Nu(n)}async updateTokenEndpointAuthority(e,n){const r=`https://${e}/${this.authority.tenant}/`,i=await yN(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=i}}/*! @azure/msal-common v16.6.0 2026-05-07 */const G3=300;class K3{constructor(e,n){this.config=xk(e),this.logger=new ki(this.config.loggerOptions,Qg,wh),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=n}async acquireToken(e,n){var a;const r=Wr(),i=await Z(this.executeTokenRequest.bind(this),S3,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=(a=i.headers)==null?void 0:a[On.X_MS_REQUEST_ID],o=new zo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body,e.correlationId),Z(o.handleServerTokenResponse.bind(o),Ek,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,r,e,n,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,n){if(!e)throw et(KF);if(!e.account)throw Y(zR);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Z(this.acquireTokenWithCachedRefreshToken.bind(this),Jm,this.logger,this.performanceClient,e.correlationId)(e,!0,n)}catch(i){const s=i instanceof vr&&i.errorCode===Tb,o=i instanceof Go&&i.errorCode===aF&&i.subError===lF;if(s||o)return Z(this.acquireTokenWithCachedRefreshToken.bind(this),Jm,this.logger,this.performanceClient,e.correlationId)(e,!1,n);throw i}return Z(this.acquireTokenWithCachedRefreshToken.bind(this),Jm,this.logger,this.performanceClient,e.correlationId)(e,!1,n)}async acquireTokenWithCachedRefreshToken(e,n,r){var o;const i=Jn(this.cacheManager.getRefreshToken.bind(this.cacheManager),M3,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0);if(!i)throw mp(Tb);if(i.expiresOn){const a=e.refreshTokenExpirationOffsetSeconds||G3;if((o=this.performanceClient)==null||o.addFields({cacheRtExpiresOnSeconds:Number(i.expiresOn),rtOffsetSeconds:a},e.correlationId),gp(i.expiresOn,a))throw mp(cN)}const s={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||Be.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Lr.HOME_ACCOUNT_ID}};try{return await Z(this.acquireToken.bind(this),k3,this.logger,this.performanceClient,e.correlationId)(s,r)}catch(a){if(a instanceof vr&&a.subError===_k){this.logger.verbose("1pg3ap",e.correlationId);const l=this.cacheManager.generateCredentialKey(i);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw a}}async executeTokenRequest(e,n){const r=gN(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),i=Le.appendQueryString(n.tokenEndpoint,r),s=await Z(this.createTokenRequestBody.bind(this),v3,this.logger,this.performanceClient,e.correlationId)(e),o=pN(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),a=Bg(this.config.authOptions.clientId,e);return Z(mN,b3,this.logger,this.performanceClient,e.correlationId)(i,s,o,a,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){var r,i;const n=new Map;if(fk(n,e.embeddedClientId||((r=e.extraParameters)==null?void 0:r[Lo])||this.config.authOptions.clientId),e.redirectUri&&pk(n,e.redirectUri),dk(n,e.scopes,!0,(i=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:i.defaultScopes),VR(n,xR.REFRESH_TOKEN_GRANT),bk(n),mk(n,this.config.libraryInfo),Ok(n,this.config.telemetry.application),KR(n),this.serverTelemetryManager&&!aN(this.config)&&GR(n,this.serverTelemetryManager),$5(n,e.refreshToken),this.config.clientCredentials.clientSecret&&FR(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;XR(n,await fN(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),WR(n,s.assertionType)}if(e.authenticationScheme===Be.POP){const s=new gl(this.cryptoUtils,this.performanceClient);let o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Z(s.generateCnf.bind(s),Sh,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,wk(n,o)}else if(e.authenticationScheme===Be.SSH)if(e.sshJwk)qR(n,e.sshJwk);else throw et(uk);if(this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Lr.HOME_ACCOUNT_ID:try{const s=Xa(e.ccsCredential.credential);Gc(n,s)}catch{this.logger.verbose("1qhtee",e.correlationId)}break;case Lr.UPN:lp(n,e.ccsCredential.credential);break}return e.embeddedClientId&&Mg(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&bi(n,{...e.extraParameters}),$g(n,e.correlationId,this.performanceClient),gk(n,e.claims,this.config.authOptions.clientCapabilities,e.skipBrokerClaims),Nu(n)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class J3{constructor(e,n){this.config=xk(e),this.logger=new ki(this.config.loggerOptions,Qg,wh),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=n}async acquireCachedToken(e){let n=hs.NOT_APPLICABLE;if(e.forceRefresh||!jr.isEmptyObj(e.claims))throw this.setCacheOutcome(hs.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Y(Es);if(!e.account)throw Y(zR);const r=e.account.tenantId||Y3(e.authority),i=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,i,r);if(s){if(u3(s.cachedAt)||gp(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(hs.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Y(Es);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(hs.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(Es)}else s.refreshOn&&gp(s.refreshOn,0)&&(n=hs.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(hs.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(Es);const o=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,i,r),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(o,e.correlationId)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Z(this.generateResultFromCacheRecord.bind(this),x3,this.logger,this.performanceClient,e.correlationId)(a,e),n]}setCacheOutcome(e,n){var r,i;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(i=this.performanceClient)==null||i.addFields({cacheOutcome:e},n),e!==hs.NOT_APPLICABLE&&this.logger.info("09ingz",n)}async generateResultFromCacheRecord(e,n){let r;if(e.idToken&&(r=di(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw Y(DR);tN(i,n.maxAge)}return zo.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,this.performanceClient,r)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const e4={sendGetRequestAsync:()=>Promise.reject(Y(Ce)),sendPostRequestAsync:()=>Promise.reject(Y(Ce))};/*! @azure/msal-common v16.6.0 2026-05-07 */function t4(t,e,n,r){var a,l;const i=e.correlationId,s=new Map;fk(s,e.embeddedClientId||((a=e.extraQueryParameters)==null?void 0:a[Lo])||t.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(dk(s,o,!0,(l=t.authority.options.OIDCOptions)==null?void 0:l.defaultScopes),JR(s,e.resource),pk(s,e.redirectUri),bh(s,i),E5(s,e.responseMode),bk(s),Q5(s),e.prompt&&(I5(s,e.prompt),r==null||r.addFields({prompt:e.prompt},i)),e.domainHint&&(P5(s,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},i)),e.prompt!==yn.SELECT_ACCOUNT)if(e.sid&&e.prompt===yn.NONE)n.verbose("1tvqyx",e.correlationId),k1(s,e.sid),r==null||r.addFields({sidFromRequest:!0},i);else if(e.account){const c=i4(e.account);let u=s4(e.account);if(u&&e.domainHint&&(n.warning("0wkg3v",e.correlationId),u=null),u){n.verbose("1eyfsw",e.correlationId),ld(s,u),r==null||r.addFields({loginHintFromClaim:!0},i);try{const h=Xa(e.account.homeAccountId);Gc(s,h)}catch{n.verbose("12ugck",e.correlationId)}}else if(c&&e.prompt===yn.NONE){n.verbose("1rmd8s",e.correlationId),k1(s,c),r==null||r.addFields({sidFromClaim:!0},i);try{const h=Xa(e.account.homeAccountId);Gc(s,h)}catch{n.verbose("12ugck",e.correlationId)}}else if(e.loginHint)n.verbose("0y3007",e.correlationId),ld(s,e.loginHint),lp(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i);else if(e.account.username){n.verbose("02f507",e.correlationId),ld(s,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},i);try{const h=Xa(e.account.homeAccountId);Gc(s,h)}catch{n.verbose("12ugck",e.correlationId)}}}else e.loginHint&&(n.verbose("0g01ey",e.correlationId),ld(s,e.loginHint),lp(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i));else n.verbose("169k9v",e.correlationId);return e.nonce&&R5(s,e.nonce),e.state&&ZR(s,e.state),e.embeddedClientId&&Mg(s,t.clientId,t.redirectUri),gk(s,e.claims,t.clientCapabilities,e.skipBrokerClaims),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(vb))&&HR(s),s}function Ak(t,e){const n=Nu(e);return Le.appendQueryString(t.authorizationEndpoint,n)}function n4(t,e){if(Pk(t,e),!t.code)throw Y(S5);return t}function Pk(t,e){if(!t.state||!e)throw t.state?Y(b1,"Cached State"):Y(b1,"Server State");let n,r;try{n=decodeURIComponent(t.state)}catch{throw Y(Ru,t.state)}try{r=decodeURIComponent(e)}catch{throw Y(Ru,t.state)}if(n!==r)throw Y(d5);if(t.error||t.error_description||t.suberror){const i=r4(t);throw hN(t.error,t.error_description,t.suberror)?new vr(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",i):new Go(t.error||"",t.error_description,t.suberror,i)}}function r4(t){var r,i;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(i=t.error_uri)==null?void 0:i.substring(n+e.length):void 0}function i4(t){var e;return((e=t.idTokenClaims)==null?void 0:e.sid)||null}function s4(t){var e;return t.loginHint||((e=t.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v16.6.0 2026-05-07 */function wN(t,e){if(t){if(e.resource&&(Q1(e.extraParameters)||Q1(e.extraQueryParameters)))throw Y(C5);if(!e.resource)throw Y(x5)}}function Q1(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}/*! @azure/msal-common v16.6.0 2026-05-07 */const Ab="unexpected_error";/*! @azure/msal-common v16.6.0 2026-05-07 */const L1=",",SN="|";function o4(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:i,extensionVersion:s}=t,o=new Map([[0,[n,r]],[2,[i,s]]]);let a=[];if(e!=null&&e.length){if(a=e.split(L1),a.length<4)return e}else a=Array.from({length:4},()=>SN);return o.forEach((l,c)=>{var u,h;l.length===2&&((u=l[0])!=null&&u.length)&&((h=l[1])!=null&&h.length)&&a4({skuArr:a,index:c,skuName:l[0],skuVersion:l[1]})}),a.join(L1)}function a4(t){const{skuArr:e,index:n,skuName:r,skuVersion:i}=t;n>=e.length||(e[n]=[r,i].join(SN))}class $u{constructor(e,n){this.cacheOutcome=hs.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=_R+ER+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${oa}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const i=n.join(oa),s=this.getRegionDiscoveryFields(),o=[e,s].join(oa);return[m1,o,i].join(O1)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=$u.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(oa),i=e.errors.slice(0,n).join(oa),s=e.errors.length,o=n<s?tF:nF,a=[s,o].join(oa);return[m1,e.cacheHits,r,i,a].join(O1)}cacheFailedRequest(e){const n=this.getLastRequests();n.errors.length>=eF&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof He?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(rF),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=$u.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const i={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,i=0;const s=e.errors.length;for(n=0;n<s;n++){const o=e.failedRequests[2*n]||"",a=e.failedRequests[2*n+1]||"",l=e.errors[n]||"";if(i+=o.toString().length+a.toString().length+l.length+3,i<JZ)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||""),e.push(this.regionSource||""),e.push(this.regionOutcome||""),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 n=this.getLastRequests();n.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return o4(e)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class Ik extends He{constructor(e,n){super(e,n),this.name="JoseHeaderError",Object.setPrototypeOf(this,Ik.prototype)}}function D1(t){return new Ik(t)}/*! @azure/msal-common v16.6.0 2026-05-07 */const l4="missing_kid_error",c4="missing_alg_error";/*! @azure/msal-common v16.6.0 2026-05-07 */class Rk{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw D1(l4);if(!e.alg)throw D1(c4);const n=new Rk({typ:e.typ||cF.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(n)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const u4="acquireTokenFromCache",h4="acquireTokenByRefreshToken",d4="acquireTokenSilentAsync",f4="cryptoOptsGetPublicKeyThumbprint",p4="cryptoOptsSignJwt",g4="silentCacheClientAcquireToken",m4="silentIframeClientAcquireToken",O4="awaitConcurrentIframe",y4="silentRefreshClientAcquireToken",To="standardInteractionClientGetDiscoveredAuthority",Nk="nativeInteractionClientAcquireToken",b4="nativeInteractionClientAcquireToken",w4="refreshTokenClientAcquireTokenByRefreshToken",z1="acquireTokenBySilentIframe",$k="initializeBaseRequest",S4="initializeSilentRequest",k4="initializeCache",B1="silentIframeClientTokenHelper",eO="silentHandlerInitiateAuthRequest",Op="silentHandlerMonitorIframeForHash",v4="silentHandlerLoadFrameSync",zi="standardInteractionClientCreateAuthCodeClient",Zg="standardInteractionClientGetClientConfiguration",Mu="standardInteractionClientInitializeAuthorizationRequest",x4="silentFlowClientAcquireCachedToken",C4="getStandardParams",E4="handleCodeResponse",Mk="handleResponseEar",kN="handleResponsePlatformBroker",Wa="handleResponseCode",_4="authClientAcquireToken",Kc="deserializeResponse",T4="authorityFactoryCreateDiscoveredInstance",A4="acquireTokenByCodeAsync",P4="handleRedirectPromise",I4="handleNativeRedirectPromise",R4="nativeMessageHandlerHandshake",j1="removeHiddenIframe",N4="importExistingCache",Bo="generatePkceCodes",$4="generateCodeVerifier",M4="generateCodeChallengeFromVerifier",Q4="sha256Digest",L4="getRandomValues",U1="generateHKDF",D4="generateBaseKey",z4="base64Decode",B4="urlEncodeArr",j4="encrypt",Z1="decrypt",Qk="generateEarKey",U4="decryptEarResponse",Z4="waitForBridgeLateResponse";/*! @azure/msal-browser v5.10.0 2026-05-07 */function Fg(t){return`See https://aka.ms/msal.js.errors#${t} for details`}class vh extends He{constructor(e,n){super(e,Fg(e),n),Object.setPrototypeOf(this,vh.prototype),this.name="BrowserAuthError"}}function se(t,e){return new vh(t,e)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const hr={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",MSAL_SKU:"msal.js.browser"},dr={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS",MICROSOFT_ENTRA_BROKERID:"MicrosoftEntra",DOM_API_NAME:"DOM API",PLATFORM_DOM_APIS:"get-token-and-sign-out",PLATFORM_DOM_PROVIDER:"PlatformAuthDOMHandler",PLATFORM_EXTENSION_PROVIDER:"PlatformAuthExtensionHandler"},yc={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Ur={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},F1={GET:"GET",POST:"POST"},ws={SIGNIN:"signin",SIGNOUT:"signout"},_t={ORIGIN_URI:"request.origin",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",VERIFIER:"code.verifier",INTERACTION_STATUS_KEY:"interaction.status",NATIVE_REQUEST:"request.native"},ud={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},$e={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962,hydrateCache:963,loadExternalTokens:964},X1={861:"acquireTokenRedirect",862:"acquireTokenPopup",863:"ssoSilent",864:"acquireTokenSilent_authCode",865:"handleRedirectPromise",866:"acquireTokenByCode",61:"acquireTokenSilent_silentFlow",961:"logout",962:"logoutPopup",963:"hydrateCache",964:"loadExternalTokens"},F4=t=>typeof t=="number"&&t in X1?X1[t]:"unknown";var ge;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(ge||(ge={}));const W1={scopes:jl},vN="jwk",Pb="msal.db",X4=1,W4=`${Pb}.keys`,dn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},V4=[dn.Default,dn.Skip,dn.RefreshTokenAndNetwork];/*! @azure/msal-browser v5.10.0 2026-05-07 */function hd(t){return encodeURIComponent(Qu(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function Fs(t){return xN(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qu(t){return xN(new TextEncoder().encode(t))}function xN(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const CN="pkce_not_created",EN="ear_jwk_empty",H4="ear_jwe_empty",V1="crypto_nonexistent",Lk="empty_navigate_uri",Y4="hash_empty_error",Dk="no_state_in_hash",q4="hash_does_not_contain_known_properties",_N="unable_to_parse_state",G4="state_interaction_type_mismatch",K4="interaction_in_progress",J4="interaction_in_progress_cancelled",eX="popup_window_error",tX="empty_window_error",Ib="user_cancelled",nX="redirect_bridge_empty_response",rX="redirect_in_iframe",iX="block_iframe_reload",sX="block_nested_popups",zk="silent_logout_unsupported",oX="no_account_error",aX="no_token_request_cache_error",lX="unable_to_parse_token_request_cache_error",TN="non_browser_environment",bc="database_not_open",Rb="no_network_connectivity",cX="post_request_failed",uX="get_request_failed",H1="failed_to_parse_response",AN="crypto_key_not_found",hX="auth_code_required",dX="auth_code_or_nativeAccountId_required",fX="spa_code_and_nativeAccountId_present",PN="database_unavailable",pX="unable_to_acquire_token_from_native_platform",gX="native_handshake_timeout",mX="native_extension_not_installed",IN="native_connection_not_established",pf="uninitialized_public_client_application",OX="native_prompt_not_supported",yX="invalid_base64_string",bX="invalid_pop_token_request",wX="failed_to_build_headers",SX="failed_to_parse_headers",tO="failed_to_decrypt_ear_response",yp="timed_out",kX="empty_response";/*! @azure/msal-browser v5.10.0 2026-05-07 */function gn(t){return new TextDecoder().decode(Bs(t))}function Bs(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw se(yX)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const vX="RSASSA-PKCS1-v1_5",Zl="AES-GCM",RN="HKDF",Bk="SHA-256",xX=2048,CX=new Uint8Array([1,0,1]),Y1="0123456789abcdef",q1=new Uint32Array(1),jk="raw",NN="encrypt",Uk="decrypt",EX="deriveKey",_X="crypto_subtle_undefined",Zk={name:vX,hash:Bk,modulusLength:xX,publicExponent:CX};function TX(t){if(!window)throw se(TN);if(!window.crypto)throw se(V1);if(!t&&!window.crypto.subtle)throw se(V1,_X)}async function $N(t){const n=new TextEncoder().encode(t);return window.crypto.subtle.digest(Bk,n)}function AX(t){return window.crypto.getRandomValues(t)}function nO(){return window.crypto.getRandomValues(q1),q1[0]}function Xs(){const t=Date.now(),e=nO()*1024+(nO()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),i=e&2**30-1,s=nO();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s;let o="";for(let a=0;a<n.length;a++)o+=Y1.charAt(n[a]>>>4),o+=Y1.charAt(n[a]&15),(a===3||a===5||a===7||a===9)&&(o+="-");return o}async function PX(t,e){return window.crypto.subtle.generateKey(Zk,t,e)}async function rO(t){return window.crypto.subtle.exportKey(vN,t)}async function IX(t,e,n){return window.crypto.subtle.importKey(vN,t,Zk,e,n)}async function RX(t,e){return window.crypto.subtle.sign(Zk,t,e)}async function Fk(){const t=await MN(),n={alg:"dir",kty:"oct",k:Fs(new Uint8Array(t))};return Qu(JSON.stringify(n))}async function NX(t){const e=gn(t),r=JSON.parse(e).k,i=Bs(r);return window.crypto.subtle.importKey(jk,i,Zl,!1,[Uk])}async function $X(t,e){const n=e.split(".");if(n.length!==5)throw se(tO,"jwe_length");const r=await NX(t).catch(()=>{throw se(tO,"import_key")});try{const i=new TextEncoder().encode(n[0]),s=Bs(n[2]),o=Bs(n[3]),a=Bs(n[4]),l=a.byteLength*8,c=new Uint8Array(o.length+a.length);c.set(o),c.set(a,o.length);const u=await window.crypto.subtle.decrypt({name:Zl,iv:s,tagLength:l,additionalData:i},r,c);return new TextDecoder().decode(u)}catch{throw se(tO,"decrypt")}}async function MN(){const t=await window.crypto.subtle.generateKey({name:Zl,length:256},!0,[NN,Uk]);return window.crypto.subtle.exportKey(jk,t)}async function G1(t){return window.crypto.subtle.importKey(jk,t,RN,!1,[EX])}async function QN(t,e,n){return window.crypto.subtle.deriveKey({name:RN,salt:e,hash:Bk,info:new TextEncoder().encode(n)},t,{name:Zl,length:256},!1,[NN,Uk])}async function MX(t,e,n){const r=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(16)),s=await QN(t,i,n),o=await window.crypto.subtle.encrypt({name:Zl,iv:new Uint8Array(12)},s,r);return{data:Fs(new Uint8Array(o)),nonce:Fs(i)}}async function K1(t,e,n,r){const i=Bs(r),s=await QN(t,Bs(e),n),o=await window.crypto.subtle.decrypt({name:Zl,iv:new Uint8Array(12)},s,i);return new TextDecoder().decode(o)}async function QX(t){const e=await $N(t),n=new Uint8Array(e);return Fs(n)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Xk extends He{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Xk.prototype)}}function Wk(t){return new Xk(t,Fg(t))}/*! @azure/msal-browser v5.10.0 2026-05-07 */const LN="storage_not_supported",LX="in_mem_redirect_unavailable";/*! @azure/msal-browser v5.10.0 2026-05-07 */function DX(){const t=window.location.hash,e=window.location.search;let n=!1,r=!1,i="",s;if(t&&t.length>1){const u=t.charAt(0)==="#"?t.substring(1):t,h=new URLSearchParams(u);h.has("state")&&(n=!0,i=u,s=h)}if(e&&e.length>1){const u=e.charAt(0)==="?"?e.substring(1):e,h=new URLSearchParams(u);h.has("state")&&(r=!0,i=u,s=h)}if(n&&r){const u=e.charAt(0)==="?"?e.substring(1):e,h=t.charAt(0)==="#"?t.substring(1):t;i=`${u}${h}`,s=new URLSearchParams(i)}if(!i||!s)throw se(kX);const o=s.get("state");if(!o)throw se(Dk);const{libraryState:a}=kh(gn,o),{id:l,meta:c}=a;if(!l||!c)throw se(_N,"missing_library_state");return{params:s,payload:i,urlHash:t,urlQuery:e,hasResponseInHash:n,hasResponseInQuery:r,libraryState:{id:l,meta:c}}}function DN(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function zX(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Xg(){return window.parent!==window}function BX(){if(Xg())return!1;try{const{libraryState:t}=DX(),{meta:e}=t;return e.interactionType===ge.Popup}catch{return!1}}let Ss=null;function jX(t,e){Ss&&(t.verbose("18y01k",e),clearTimeout(Ss.timeoutId),Ss.channel.close(),Ss.reject(se(J4)),Ss=null)}async function Ia(t,e,n,r,i,s){return new Promise((o,a)=>{e.verbose("1rf6em",r.correlationId);const l=r.correlationId;i.addFields({redirectBridgeTimeoutMs:t,lateResponseExperimentEnabled:(s==null?void 0:s.iframeTimeoutTelemetry)||!1},l);const{libraryState:c}=kh(n.base64Decode,r.state||""),u=new BroadcastChannel(c.id);let h,d=!1,f,p;const g=window.setTimeout(()=>{Ss=null,s!=null&&s.iframeTimeoutTelemetry?(p=i.startMeasurement(Z4,l),d=!0,f=window.setTimeout(()=>{p==null||p.end({success:!1}),clearTimeout(f),u.close()},6e4)):u.close(),a(se(yp,"redirect_bridge_timeout"))},t);Ss={timeoutId:g,channel:u,reject:a},u.onmessage=y=>{h=y.data.payload;const m=y!=null&&y.data&&typeof y.data.v=="number"?y.data.v:void 0;if(d){p==null||p.end({success:!!h}),clearTimeout(f),u.close();return}i.addFields({redirectBridgeMessageVersion:m},l),Ss=null,clearTimeout(g),u.close(),h?o(h):a(se(nX))}})}function _s(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function UX(){const e=new Le(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function ZX(){if(cp(window.location.hash)&&Xg())throw se(iX)}function FX(t){if(Xg()&&!t)throw se(rX)}function XX(){if(BX())throw se(sX)}function zN(){if(typeof window>"u")throw se(TN)}function BN(t){if(!t)throw se(pf)}function Vk(t){zN(),ZX(),XX(),BN(t)}function J1(t,e){if(Vk(t),FX(e.system.allowRedirectInIframe),e.cache.cacheLocation===Ur.MemoryStorage)throw Wk(LX)}function jN(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function Nb(){return Xs()}/*! @azure/msal-browser v5.10.0 2026-05-07 */class WX{constructor(){this.dbName=Pb,this.version=X4,this.tableName=W4,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",i=>{i.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",i=>{const s=i;this.db=s.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(se(PN)))})}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((n,r)=>{if(!this.db)return r(se(bc));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);o.addEventListener("success",a=>{const l=a;this.closeConnection(),n(l.target.result)}),o.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,i)=>{if(!this.db)return i(se(bc));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",l=>{this.closeConnection(),i(l)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(se(bc));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);o.addEventListener("success",()=>{this.closeConnection(),n()}),o.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(se(bc));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();s.addEventListener("success",o=>{const a=o;this.closeConnection(),e(a.target.result)}),s.addEventListener("error",o=>{this.closeConnection(),n(o)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(se(bc));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);o.addEventListener("success",a=>{const l=a;this.closeConnection(),n(l.target.result===1)}),o.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(Pb),i=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(i),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(i),e(!0))),r.addEventListener("error",()=>(clearTimeout(i),n(!1)))})}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Wg{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class VX{constructor(e){this.inMemoryCache=new Wg,this.indexedDBCache=new WX,this.logger=e}handleDatabaseAccessError(e,n){if(e instanceof vh&&e.errorCode===PN)this.logger.error("1wx7zz",n);else throw e}async getItem(e,n){const r=this.inMemoryCache.getItem(e);if(!r)try{return this.logger.verbose("0naxpl",n),await this.indexedDBCache.getItem(e)}catch(i){this.handleDatabaseAccessError(i,n)}return r}async setItem(e,n,r){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(i){this.handleDatabaseAccessError(i,r)}}async removeItem(e,n){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(r){this.handleDatabaseAccessError(r,n)}}async getKeys(e){const n=this.inMemoryCache.getKeys();if(n.length===0)try{return this.logger.verbose("1iqrbq",e),await this.indexedDBCache.getKeys()}catch(r){this.handleDatabaseAccessError(r,e)}return n}async containsKey(e,n){const r=this.inMemoryCache.containsKey(e);if(!r)try{return this.logger.verbose("03zl2j",n),await this.indexedDBCache.containsKey(e)}catch(i){this.handleDatabaseAccessError(i,n)}return r}clearInMemory(e){this.logger.verbose("03r21p",e),this.inMemoryCache.clear(),this.logger.verbose("0uksk1",e)}async clearPersistent(e){try{this.logger.verbose("0rdqut",e);const n=await this.indexedDBCache.deleteDatabase();return n&&this.logger.verbose("149ouc",e),n}catch(n){return this.handleDatabaseAccessError(n,e),!1}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Hi{constructor(e,n,r){this.logger=e,TX(r??!1),this.cache=new VX(this.logger),this.performanceClient=n}createNewGuid(){return Xs()}base64Encode(e){return Qu(e)}base64Decode(e){return gn(e)}base64UrlEncode(e){return hd(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var u;const n=(u=this.performanceClient)==null?void 0:u.startMeasurement(f4,e.correlationId),r=await PX(Hi.EXTRACTABLE,Hi.POP_KEY_USAGES),i=await rO(r.publicKey),s={e:i.e,kty:i.kty,n:i.n},o=eC(s),a=await this.hashString(o),l=await rO(r.privateKey),c=await IX(l,!1,["sign"]);return await this.cache.setItem(a,{privateKey:c,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri},e.correlationId),n&&n.end({success:!0}),a}async removeTokenBindingKey(e,n){if(await this.cache.removeItem(e,n),await this.cache.containsKey(e,n))throw Y(k5)}async clearKeystore(e){this.cache.clearInMemory(e);try{return await this.cache.clearPersistent(e),!0}catch(n){return n instanceof Error?this.logger.error("1owpn8",e):this.logger.error("0yrmwo",e),!1}}async signJwt(e,n,r,i){var b;const s=(b=this.performanceClient)==null?void 0:b.startMeasurement(p4,i),o=await this.cache.getItem(n,i||"");if(!o)throw se(AN);const a=await rO(o.publicKey),l=eC(a),c=hd(JSON.stringify({kid:n})),u=Rk.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:c}),h=hd(u);e.cnf={jwk:JSON.parse(l)};const d=hd(JSON.stringify(e)),f=`${h}.${d}`,g=new TextEncoder().encode(f),y=await RX(o.privateKey,g),m=Fs(new Uint8Array(y)),O=`${f}.${m}`;return s&&s.end({success:!0}),O}async hashString(e){return QX(e)}}Hi.POP_KEY_USAGES=["sign","verify"];Hi.EXTRACTABLE=!0;function eC(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v5.10.0 2026-05-07 */const HX="acquireTokenSilent",YX="acquireTokenByCode",qX="acquireTokenPopup",GX="acquireTokenPreRedirect",iO="acquireTokenRedirect",KX="ssoSilent",JX="initializeClientApplication",eW="localStorageUpdated",tW="ssoCapable";/*! @azure/msal-browser v5.10.0 2026-05-07 */const Qt="msal",Vg="browser",tC="|",en=3,gf=3,nW=`${Qt}.${Vg}.log.level`,rW=`${Qt}.${Vg}.log.pii`,iW=`${Qt}.${Vg}.platform.auth.dom`,nC=`${Qt}.version`,rC="account.keys",iC="token.keys",sC=`${Qt}.${Vg}.sso.capable`;function Va(t=gf){return t<1?`${Qt}.${rC}`:`${Qt}.${t}.${rC}`}function Ha(t,e=en){return e<1?`${Qt}.${iC}.${t}`:`${Qt}.${e}.${iC}.${t}`}/*! @azure/msal-browser v5.10.0 2026-05-07 */const sW=24*60*60*1e3,$b={Lax:"Lax",None:"None"};class UN{initialize(){return Promise.resolve()}getItem(e){const n=encodeURIComponent(e),r=document.cookie.split(";");for(let i=0;i<r.length;i++){const s=r[i].trim(),o=s.indexOf("=");if((o===-1?s:s.substring(0,o))===n){const l=o===-1?"":s.substring(o+1);try{return decodeURIComponent(l)}catch{return l}}}return""}getUserData(){throw Y(Ce)}setItem(e,n,r,i=!0,s=$b.Lax){let o=`${encodeURIComponent(e)}=${encodeURIComponent(n)};path=/;SameSite=${s};`;if(r){const a=oW(r);o+=`expires=${a};`}(i||s===$b.None)&&(o+="Secure;"),document.cookie=o}async setUserData(){return Promise.reject(Y(Ce))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),n=[];return e.forEach(r=>{const i=r.trim(),s=i.indexOf("="),o=s===-1?i:i.substring(0,s);try{n.push(decodeURIComponent(o))}catch{}}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function oW(t){const e=new Date;return new Date(e.getTime()+t*sW).toUTCString()}/*! @azure/msal-browser v5.10.0 2026-05-07 */function gs(t,e){const n=t.getItem(Va(e));return n?JSON.parse(n):[]}function Ir(t,e,n){const r=e.getItem(Ha(t,n));if(r){const i=JSON.parse(r);if(i&&i.hasOwnProperty("idToken")&&i.hasOwnProperty("accessToken")&&i.hasOwnProperty("refreshToken"))return i}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function mf(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}/*! @azure/msal-browser v5.10.0 2026-05-07 */const oC="msal.cache.encryption",aW="msal.broadcast.cache";class lW{constructor(e,n,r){if(!window.localStorage)throw Wk(LN);this.memoryStorage=new Wg,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=r,this.broadcast=new BroadcastChannel(aW)}async initialize(e){const n=new UN,r=n.getItem(oC);let i={key:"",id:""};if(r)try{i=JSON.parse(r)}catch{}if(i.key&&i.id){const s=Jn(Bs,z4,this.logger,this.performanceClient,e)(i.key);this.encryptionCookie={id:i.id,key:await Z(G1,U1,this.logger,this.performanceClient,e)(s)}}else{const s=Xs(),o=await Z(MN,D4,this.logger,this.performanceClient,e)(),a=Jn(Fs,B4,this.logger,this.performanceClient,e)(new Uint8Array(o));this.encryptionCookie={id:s,key:await Z(G1,U1,this.logger,this.performanceClient,e)(o)};const l={id:s,key:a};n.setItem(oC,JSON.stringify(l),0,!0,$b.None)}await Z(this.importExistingCache.bind(this),N4,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",s=>{this.updateCache(s,e)}),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw se(pf);return this.memoryStorage.getItem(e)}async decryptData(e,n,r){if(!this.initialized||!this.encryptionCookie)throw se(pf);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const i=await Z(K1,Z1,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!i)return null;try{return{...JSON.parse(i),lastUpdatedAt:n.lastUpdatedAt}}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,r,i,s){if(!this.initialized||!this.encryptionCookie)throw se(pf);if(s)this.setItem(e,n);else{const{data:o,nonce:a}=await Z(MX,j4,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n,this.getContext(e)),l={id:this.encryptionCookie.id,nonce:a,data:o,lastUpdatedAt:i};this.setItem(e,JSON.stringify(l))}this.memoryStorage.setItem(e,n),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),gs(this).forEach(r=>this.removeItem(r));const n=Ir(this.clientId,this);n.idToken.forEach(r=>this.removeItem(r)),n.accessToken.forEach(r=>this.removeItem(r)),n.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(Qt)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=gs(this);n=await this.importArray(n,e),n.length?this.setItem(Va(),JSON.stringify(n)):this.removeItem(Va());const r=Ir(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(Ha(this.clientId),JSON.stringify(r)):this.removeItem(Ha(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let i;try{i=JSON.parse(r)}catch{return null}return mf(i)?i.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):(this.performanceClient.incrementFields({encryptedCacheCount:1},n),Z(K1,Z1,this.logger,this.performanceClient,n)(this.encryptionCookie.key,i.nonce,this.getContext(e),i.data)):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),r)}async importArray(e,n){const r=[],i=[];return e.forEach(s=>{const o=this.getItemFromEncryptedCache(s,n).then(a=>{a?(this.memoryStorage.setItem(s,a),r.push(s)):this.removeItem(s)});i.push(o)}),await Promise.all(i),r}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e,n){this.logger.trace("17cxcm",n);const r=this.performanceClient.startMeasurement(eW);r.add({isBackground:!0});const{key:i,value:s,context:o}=e.data;if(!i){this.logger.error("0e10qr",n),r.end({success:!1,errorCode:"noKey"});return}if(o&&o!==this.clientId){this.logger.trace("04rtdy",n),r.end({success:!1,errorCode:"contextMismatch"});return}s?(this.memoryStorage.setItem(i,s),this.logger.verbose("1vzsgt",n)):(this.memoryStorage.removeItem(i),this.logger.verbose("04ypih",n)),r.end({success:!0})}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class cW{constructor(){if(!window.sessionStorage)throw Wk(LN)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const be={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_SUCCESS:"msal:loginSuccess",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",BROKERED_REQUEST_START:"msal:brokeredRequestStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",BROKERED_REQUEST_SUCCESS:"msal:brokeredRequestSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",BROKERED_REQUEST_FAILURE:"msal:brokeredRequestFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",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",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};/*! @azure/msal-browser v5.10.0 2026-05-07 */const uW="@azure/msal-browser",jo="5.10.0";/*! @azure/msal-browser v5.10.0 2026-05-07 */function ls(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Mb extends _b{constructor(e,n,r,i,s,o,a){super(e,r,i,s,a),this.cacheConfig=n,this.logger=i,this.internalStorage=new Wg,this.browserStorage=aC(e,n.cacheLocation,i,s),this.temporaryCacheStorage=aC(e,Ur.SessionStorage,i,s),this.cookieStorage=new UN,this.eventHandler=o}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){let n=gs(this.browserStorage),r=Ir(this.clientId,this.browserStorage);this.performanceClient.addFields({preMigrateAcntCount:n.length,preMigrateATCount:r.accessToken.length,preMigrateITCount:r.idToken.length,preMigrateRTCount:r.refreshToken.length},e);for(let s=0;s<gf;s++){const o=s;await this.removeStaleAccounts(s,o,e)}for(let s=0;s<en;s++){const o=s;await this.migrateIdTokens(s,o,e)}const i=this.getKMSIValues();for(let s=0;s<en;s++)await this.migrateAccessTokens(s,i,e),await this.migrateRefreshTokens(s,i,e);n=gs(this.browserStorage),r=Ir(this.clientId,this.browserStorage),this.performanceClient.addFields({postMigrateAcntCount:n.length,postMigrateATCount:r.accessToken.length,postMigrateITCount:r.idToken.length,postMigrateRTCount:r.refreshToken.length},e)}async updateOldEntry(e,n){const r=this.browserStorage.getItem(e),i=this.validateAndParseJson(r||"");if(!i)return this.browserStorage.removeItem(e),null;if(!i.lastUpdatedAt)i.lastUpdatedAt=Date.now().toString(),this.setItem(e,JSON.stringify(i),n);else if(T1(i.lastUpdatedAt,this.cacheConfig.cacheRetentionDays))return this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},n),null;const s=mf(i)?await this.browserStorage.decryptData(e,i,n):i;return!s||!zg(s)?(this.performanceClient.incrementFields({invalidCacheCount:1},n),null):(A1(s)||P1(s))&&s.expiresOn&&gp(s.expiresOn,AR)?(this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},n),null):s}async removeStaleAccounts(e,n,r){const i=gs(this.browserStorage,e);if(i.length!==0){for(const s of[...i]){this.performanceClient.incrementFields({oldAcntCount:1},r);const o=this.browserStorage.getItem(s),a=this.validateAndParseJson(o||"");if(!a){ls(i,s);continue}if(a.lastUpdatedAt)T1(a.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)&&(await this.removeAccountOldSchema(s,a,n,r),ls(i,s));else{a.lastUpdatedAt=Date.now().toString(),this.setItem(s,JSON.stringify(a),r);continue}}this.setAccountKeys(i,r,e)}}async removeAccountOldSchema(e,n,r,i){const s=mf(n)?await this.browserStorage.decryptData(e,n,i):n,o=s==null?void 0:s.homeAccountId;if(o){const a=this.getTokenKeys(r);[...a.idToken].filter(l=>l.includes(o)).forEach(l=>{this.browserStorage.removeItem(l),ls(a.idToken,l)}),[...a.accessToken].filter(l=>l.includes(o)).forEach(l=>{this.browserStorage.removeItem(l),ls(a.accessToken,l)}),[...a.refreshToken].filter(l=>l.includes(o)).forEach(l=>{this.browserStorage.removeItem(l),ls(a.refreshToken,l)}),this.setTokenKeys(a,i,r)}this.performanceClient.incrementFields({expiredAcntRemovedCount:1},i),this.browserStorage.removeItem(e)}getKMSIValues(){const e={},n=this.getTokenKeys().idToken;for(const r of n){const i=this.browserStorage.getUserData(r);if(i){const s=JSON.parse(i),o=di(s.secret,gn);o&&(e[s.homeAccountId]=Di(o))}}return e}async migrateIdTokens(e,n,r){const i=Ir(this.clientId,this.browserStorage,e);if(i.idToken.length===0)return;const s=Ir(this.clientId,this.browserStorage,en),o=gs(this.browserStorage),a=gs(this.browserStorage,n);for(const l of[...i.idToken]){this.performanceClient.incrementFields({oldITCount:1},r);const c=await this.updateOldEntry(l,r);if(!c){ls(i.idToken,l);continue}const u=o.find(O=>O.includes(c.homeAccountId)),h=a.find(O=>O.includes(c.homeAccountId));let d=null;if(u)d=this.getAccount(u,r);else if(h){const O=this.browserStorage.getItem(h),b=this.validateAndParseJson(O||"");d=b&&mf(b)?await this.browserStorage.decryptData(h,b,r):b}if(!d){this.performanceClient.incrementFields({skipITMigrateCount:1},r);continue}const f=di(c.secret,gn),p=this.generateCredentialKey(c),g=this.getIdTokenCredential(p,r),y=Object.keys(f).includes("signin_state"),m=g&&Object.keys(di(g.secret,gn)||{}).includes("signin_state");if(!g||c.lastUpdatedAt>g.lastUpdatedAt&&(y||!m)){const O=d.tenantProfiles||[],b=vk(f)||d.realm;if(b&&!O.find(k=>k.tenantId===b)){const k=Ul(d.homeAccountId,d.localAccountId,b,f);O.push(k)}d.tenantProfiles=O;const S=this.generateAccountKey(Do(d)),x=Di(f);await this.setUserData(S,JSON.stringify(d),r,d.lastUpdatedAt,x),o.includes(S)||o.push(S),await this.setUserData(p,JSON.stringify(c),r,c.lastUpdatedAt,x),this.performanceClient.incrementFields({migratedITCount:1},r),s.idToken.includes(p)||s.idToken.push(p)}}this.setTokenKeys(i,r,e),this.setTokenKeys(s,r),this.setAccountKeys(o,r)}async migrateAccessTokens(e,n,r){const i=Ir(this.clientId,this.browserStorage,e);if(i.accessToken.length===0)return;const s=Ir(this.clientId,this.browserStorage,en);for(const o of[...i.accessToken]){this.performanceClient.incrementFields({oldATCount:1},r);const a=await this.updateOldEntry(o,r);if(!a){ls(i.accessToken,o);continue}if(!(a.homeAccountId in n)){this.performanceClient.incrementFields({skipATMigrateCount:1},r);continue}const l=this.generateCredentialKey(a),c=n[a.homeAccountId];if(!s.accessToken.includes(l))await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedATCount:1},r),s.accessToken.push(l);else{const u=this.getAccessTokenCredential(l,r);(!u||a.lastUpdatedAt>u.lastUpdatedAt)&&(await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedATCount:1},r))}}this.setTokenKeys(i,r,e),this.setTokenKeys(s,r)}async migrateRefreshTokens(e,n,r){const i=Ir(this.clientId,this.browserStorage,e);if(i.refreshToken.length===0)return;const s=Ir(this.clientId,this.browserStorage,en);for(const o of[...i.refreshToken]){this.performanceClient.incrementFields({oldRTCount:1},r);const a=await this.updateOldEntry(o,r);if(!a){ls(i.refreshToken,o);continue}if(!(a.homeAccountId in n)){this.performanceClient.incrementFields({skipRTMigrateCount:1},r);continue}const l=this.generateCredentialKey(a),c=n[a.homeAccountId];if(!s.refreshToken.includes(l))await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedRTCount:1},r),s.refreshToken.push(l);else{const u=this.getRefreshTokenCredential(l,r);(!u||a.lastUpdatedAt>u.lastUpdatedAt)&&(await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedRTCount:1},r))}}this.setTokenKeys(i,r,e),this.setTokenKeys(s,r)}trackVersionChanges(e){const n=this.browserStorage.getItem(nC);n&&(this.logger.info("1wuc87",e),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==jo&&this.setItem(nC,jo,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,r){const i=new Array(en+1).fill(0),s=[],o=20;for(let a=0;a<=o;a++)try{if(this.browserStorage.setItem(e,n),a>0)for(let l=0;l<=en;l++){const c=i.slice(0,l).reduce((h,d)=>h+d,0);if(c>=a)break;const u=a>c+i[l]?c+i[l]:a;a>c&&i[l]>0&&this.removeAccessTokenKeys(s.slice(c,u),r,l)}break}catch(l){const c=Eb(l);if(c.errorCode===Cb&&a<o){if(!s.length)for(let u=0;u<=en;u++)if(e===Ha(this.clientId,u)){const h=JSON.parse(n).accessToken;s.push(...h),i[u]=h.length}else{const h=this.getTokenKeys(u).accessToken;s.push(...h),i[u]=h.length}if(s.length<=a)throw c;this.removeAccessToken(s[a],r,!1)}else throw c}}async setUserData(e,n,r,i,s){const o=new Array(en+1).fill(0),a=[],l=20;for(let c=0;c<=l;c++)try{if(await Z(this.browserStorage.setUserData.bind(this.browserStorage),Q3,this.logger,this.performanceClient,r)(e,n,r,i,s),c>0)for(let u=0;u<=en;u++){const h=o.slice(0,u).reduce((f,p)=>f+p,0);if(h>=c)break;const d=c>h+o[u]?h+o[u]:c;c>h&&o[u]>0&&this.removeAccessTokenKeys(a.slice(h,d),r,u)}break}catch(u){const h=Eb(u);if(h.errorCode===Cb&&c<l){if(!a.length)for(let d=0;d<=en;d++){const f=this.getTokenKeys(d).accessToken;a.push(...f),o[d]=f.length}if(a.length<=c)throw h;this.removeAccessToken(a[c],r,!1)}else throw h}}getAccount(e,n){this.logger.trace("1lfvm6",n);const r=this.browserStorage.getUserData(e);if(!r)return this.removeAccountKeyFromMap(e,n),null;const i=this.validateAndParseJson(r);if(!i||!J5(i))return null;const s=_b.toObject({},i);return this.performanceClient.addFields({accountCachedBy:F4(s.cachedByApiId)},n),s}async setAccount(e,n,r,i){this.logger.trace("1bz3wr",n);const s=this.generateAccountKey(Do(e)),o=Date.now().toString();e.lastUpdatedAt=o,e.cachedByApiId=i,await this.setUserData(s,JSON.stringify(e),n,o,r),this.addAccountKeyToMap(s,n),this.performanceClient.addFields({kmsi:r},n)}setAccountKeys(e,n,r=gf){e.length===0?this.removeItem(Va(r)):this.setItem(Va(r),JSON.stringify(e),n)}getAccountKeys(){return gs(this.browserStorage)}addAccountKeyToMap(e,n){this.logger.trace("0rb85k",n),this.logger.tracePii("1l9bdo",n);const r=this.getAccountKeys();return r.indexOf(e)===-1?(r.push(e),this.setItem(Va(),JSON.stringify(r),n),this.logger.verbose("0xia39",n),!0):(this.logger.verbose("0161kk",n),!1)}removeAccountKeyFromMap(e,n){this.logger.trace("1jpigu",n),this.logger.tracePii("1xzspl",n);const r=this.getAccountKeys(),i=r.indexOf(e);i>-1?(r.splice(i,1),this.setAccountKeys(r,n)):this.logger.trace("1dytu2",n)}removeAccount(e,n){const r=this.getActiveAccount(n);(r==null?void 0:r.homeAccountId)===e.homeAccountId&&(r==null?void 0:r.environment)===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(i=>{i.includes(e.homeAccountId)&&i.includes(e.environment)&&this.browserStorage.removeItem(i)})}removeIdToken(e,n){super.removeIdToken(e,n);const r=this.getTokenKeys(),i=r.idToken.indexOf(e);i>-1&&(this.logger.info("05udv9",n),r.idToken.splice(i,1),this.setTokenKeys(r,n))}removeAccessToken(e,n,r=!0){super.removeAccessToken(e,n),r&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,r=en){this.logger.trace("17o18n",n);const i=this.getTokenKeys(r);let s=0;if(e.forEach(o=>{const a=i.accessToken.indexOf(o);a>-1&&(i.accessToken.splice(a,1),s++)}),s>0){this.logger.info("15i5d5",n),this.setTokenKeys(i,n,r);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const r=this.getTokenKeys(),i=r.refreshToken.indexOf(e);i>-1&&(this.logger.info("1f4fq3",n),r.refreshToken.splice(i,1),this.setTokenKeys(r,n))}getTokenKeys(e=en){return Ir(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,r=en){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(Ha(this.clientId,r));return}else this.setItem(Ha(this.clientId,r),JSON.stringify(e),n)}getIdTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("1jukz6",n),this.removeIdToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!d3(i)?(this.logger.trace("1jukz6",n),null):(this.logger.trace("01ju66",n),i)}async setIdTokenCredential(e,n,r){this.logger.trace("13hjll",n);const i=this.generateCredentialKey(e),s=Date.now().toString();e.lastUpdatedAt=s,await this.setUserData(i,JSON.stringify(e),n,s,r);const o=this.getTokenKeys();o.idToken.indexOf(i)===-1&&(this.logger.info("07jy92",n),o.idToken.push(i),this.setTokenKeys(o,n))}getAccessTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("0bqvx8",n),this.removeAccessTokenKeys([e],n),null;const i=this.validateAndParseJson(r);return!i||!A1(i)?(this.logger.trace("0bqvx8",n),null):(this.logger.trace("1o81rl",n),i)}async setAccessTokenCredential(e,n,r){this.logger.trace("1pondb",n);const i=this.generateCredentialKey(e),s=Date.now().toString();e.lastUpdatedAt=s,await this.setUserData(i,JSON.stringify(e),n,s,r);const o=this.getTokenKeys(),a=o.accessToken.indexOf(i);a!==-1&&o.accessToken.splice(a,1),this.logger.trace("1onhey",n),o.accessToken.push(i),this.setTokenKeys(o,n)}getRefreshTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("0jlizt",n),this.removeRefreshToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!P1(i)?(this.logger.trace("0jlizt",n),null):(this.logger.trace("0nokxi",n),i)}async setRefreshTokenCredential(e,n,r){this.logger.trace("0tcg8d",n);const i=this.generateCredentialKey(e),s=Date.now().toString();e.lastUpdatedAt=s,await this.setUserData(i,JSON.stringify(e),n,s,r);const o=this.getTokenKeys();o.refreshToken.indexOf(i)===-1&&(this.logger.info("0eckjs",n),o.refreshToken.push(i),this.setTokenKeys(o,n))}getAppMetadata(e,n){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("1q101h",n),null;const i=this.validateAndParseJson(r);return!i||!m3(e,i)?(this.logger.trace("1q101h",n),null):(this.logger.trace("19pvg2",n),i)}setAppMetadata(e,n){this.logger.trace("0cyma6",n);const r=g3(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e,n){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("0jk19c",n),null;const i=this.validateAndParseJson(r);return!i||!f3(e,i)?(this.logger.trace("0jk19c",n),null):(this.logger.trace("12jguk",n),i)}setServerTelemetry(e,n,r){this.logger.trace("1poh61",r),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e,n){const r=this.internalStorage.getItem(e);if(!r)return this.logger.trace("1r39oe",n),null;const i=this.validateAndParseJson(r);return i&&O3(e,i)?(this.logger.trace("1ohvk3",n),i):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(ud.WRAPPER_SKU,e),this.internalStorage.setItem(ud.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(ud.WRAPPER_SKU)||"",n=this.internalStorage.getItem(ud.WRAPPER_VER)||"";return[e,n]}setAuthorityMetadata(e,n,r){this.logger.trace("07w8n2",r),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(g1.ACTIVE_ACCOUNT_FILTERS),r=this.browserStorage.getItem(n);if(!r)return this.logger.trace("08gw0e",e),null;const i=this.validateAndParseJson(r);return i?(this.logger.trace("1t3ch7",e),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId,tenantId:i.tenantId},e)):(this.logger.trace("0me1up",e),null)}setActiveAccount(e,n){const r=this.generateCacheKey(g1.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("0rsj80",n);const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.setItem(r,JSON.stringify(i),n)}else this.logger.verbose("1bp5z5",n),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(be.ACTIVE_ACCOUNT_CHANGED,n)}getThrottlingCache(e,n){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("1h4wa6",n),null;const i=this.validateAndParseJson(r);return!i||!p3(e,i)?(this.logger.trace("1h4wa6",n),null):(this.logger.trace("0of6n8",n),i)}setThrottlingCache(e,n,r){this.logger.trace("0wfgh6",r),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n,r){this.logger.trace("1ordf8",n);const i=r?this.generateCacheKey(e):e;return this.temporaryCacheStorage.getItem(i)}setTemporaryCache(e,n,r){const i=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(i,n)}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e)}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(Qt)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(Qt)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}generateCacheKey(e){return jr.startsWith(e,Qt)?e:`${Qt}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===Ut.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==Be.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${Qt}.${en}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",r].join(tC).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${Qt}.${gf}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(tC).toLowerCase()}resetRequestCache(e){this.logger.trace("0h0ynu",e),this.removeTemporaryItem(this.generateCacheKey(_t.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(_t.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(_t.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(_t.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(_t.NATIVE_REQUEST)),this.setInteractionInProgress(!1,void 0)}cacheAuthorizeRequest(e,n,r){this.logger.trace("1tzef5",n);const i=Qu(JSON.stringify(e));if(this.setTemporaryCache(_t.REQUEST_PARAMS,i,!0),r){const s=Qu(r);this.setTemporaryCache(_t.VERIFIER,s,!0)}}getCachedRequest(e){this.logger.trace("0uen20",e);const n=this.getTemporaryCache(_t.REQUEST_PARAMS,e,!0);if(!n)throw se(aX);const r=this.getTemporaryCache(_t.VERIFIER,e,!0);let i,s="";try{i=JSON.parse(gn(n)),r&&(s=gn(r))}catch{throw this.logger.errorPii("0ewsey",e),this.logger.error("0tvdic",e),se(lX)}return[i,s]}getCachedNativeRequest(){this.logger.trace("1yxcdm","");const e=this.getTemporaryCache(_t.NATIVE_REQUEST,"",!0);if(!e)return this.logger.trace("0mnxd4",""),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("0rrkip",""),null)}isInteractionInProgress(e){var r;const n=(r=this.getInteractionInProgress())==null?void 0:r.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${Qt}.${_t.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,"",!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("0jjyys",""),this.removeTemporaryItem(e),this.resetRequestCache(""),DN(window),null}}setInteractionInProgress(e,n=ws.SIGNIN,r=!1,i=""){var o;const s=`${Qt}.${_t.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())if(r)this.logger.warning("1pmscr",i),jX(this.logger,i),this.removeTemporaryItem(s);else throw se(K4);this.setTemporaryCache(s,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&((o=this.getInteractionInProgress())==null?void 0:o.clientId)===this.clientId&&this.removeTemporaryItem(s)}async hydrateCache(e,n){const r=Lg(e.account.homeAccountId,e.account.environment,e.idToken,this.clientId,e.tenantId),i=Dg(e.account.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?pp(e.expiresOn):0,e.extExpiresOn?pp(e.extExpiresOn):0,gn,void 0,e.tokenType,void 0,n.sshKid);n.resource&&(i.resource=n.resource);const s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId,Di(di(e.idToken,gn)),$e.hydrateCache)}async saveCacheRecord(e,n,r,i,s){try{await super.saveCacheRecord(e,n,r,i,s)}catch(o){if(o instanceof Fa&&this.performanceClient&&n)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},n)}catch{}throw o}}}function aC(t,e,n,r){try{switch(e){case Ur.LocalStorage:return new lW(t,n,r);case Ur.SessionStorage:return new cW;case Ur.MemoryStorage:default:break}}catch(i){n.error(i,"")}return new Wg}const hW=(t,e,n,r)=>{const i={cacheLocation:Ur.MemoryStorage,cacheRetentionDays:5};return new Mb(t,i,up,e,n,r)};/*! @azure/msal-browser v5.10.0 2026-05-07 */function dW(t,e,n,r,i){return t.verbose("1yd030",r),n?e.getAllAccounts(i,r):[]}function fW(t,e,n,r){e.trace("0u7b90",r);const i=n.getAccountInfoFilteredBy(t,r);return i?(e.verbose("0btgll",r),i):(e.verbose("0ltaj5",r),null)}function pW(t,e,n){e.setActiveAccount(t,n)}function gW(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const mW="msal.broadcast.event";class OW{constructor(e){this.eventCallbacks=new Map,this.logger=e||new ki({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(mW)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,r){if(typeof window<"u"){const i=r||Nb();return this.eventCallbacks.has(i)?(this.logger.error("1578i0",""),null):(this.eventCallbacks.set(i,[e,n||[]]),this.logger.verbose("1cnec4",""),i)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose("12zotd","")}emitEvent(e,n,r,i,s){var a;const o={eventType:e,interactionType:r||null,payload:i||null,error:s||null,correlationId:n,timestamp:Date.now()};switch(e){case be.LOGIN_SUCCESS:case be.LOGOUT_SUCCESS:case be.ACTIVE_ACCOUNT_CHANGED:(a=this.broadcastChannel)==null||a.postMessage(o)}this.invokeCallbacks(o)}invokeCallbacks(e){this.eventCallbacks.forEach(([n,r],i)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose("15jpwk",""),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class ZN{constructor(e,n,r,i,s,o,a,l,c){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=o,this.platformAuthProvider=c,this.correlationId=l,this.logger=i.clone(hr.MSAL_SKU,jo),this.performanceClient=a}}function bp(t,e,n,r){n.verbose("0bd1la",r);const i=t||e||"";return Le.getAbsoluteUrl(i,_s())}function Sn(t,e,n,r,i,s){i.verbose("1p12tq",n);const o={clientId:e,correlationId:n,apiId:t,forceRefresh:!1,wrapperSKU:r.getWrapperMetadata()[0],wrapperVer:r.getWrapperMetadata()[1]};return new $u(o,r)}async function Bi(t,e,n,r,i,s,o,a,l){const c=a&&a.hasOwnProperty("instance_aware")?a.instance_aware:void 0,u={protocolMode:t.system.protocolMode,OIDCOptions:t.auth.OIDCOptions,knownAuthorities:t.auth.knownAuthorities,cloudDiscoveryMetadata:t.auth.cloudDiscoveryMetadata,authorityMetadata:t.auth.authorityMetadata},h=s||t.auth.authority,d=c!=null&&c.length?c==="true":t.auth.instanceAware,f=l&&d?t.auth.authority.replace(Le.getDomainFromUrl(h),l.environment):h,p=_n.generateAuthority(f,o||t.auth.azureCloudOptions),g=await Z(yN,T4,i,n,e)(p,t.system.networkClient,r,u,i,e,n);if(l&&!g.isAlias(l.environment))throw et(s5);return g}async function Hk(t,e,n,r,i){if(i)try{t.removeAccount(i,r),n.verbose("0s4z6h",r)}catch{n.error("0mgg1d",r)}else try{n.verbose("0zj631",r),t.clear(r),await e.clearKeystore(r)}catch{n.error("12ih0c",r)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */async function Yk(t,e,n,r,i){const s=t.authority||e.auth.authority,o=[...t&&t.scopes||[]],a={...t,correlationId:t.correlationId,authority:s,scopes:o};if(!a.authenticationScheme)a.authenticationScheme=Be.BEARER,r.verbose("1l4fwv",i);else{if(a.authenticationScheme===Be.SSH){if(!t.sshJwk)throw et(uk);if(!t.sshKid)throw et(n5)}r.verbose("1ecmns",i)}return a}async function yW(t,e,n,r,i){const s=await Z(Yk,$k,i,r,t.correlationId)(t,n,r,i,t.correlationId);return{...t,...s,account:e,forceRefresh:t.forceRefresh||!1}}function FN(t,e){let n;const r=t.httpMethod;if(e===Dn.EAR){if(r&&r!==Za.POST)throw et(o5);n=Za.POST}else n=r||Za.GET;return n}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Fl extends ZN{initializeLogoutRequest(e){this.logger.verbose("0546u4",this.correlationId);const n={correlationId:this.correlationId,...e};if(e)if(e.logoutHint)this.logger.verbose("12k4l4",this.correlationId);else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("0st5di",this.correlationId),n.logoutHint=r)}else this.logger.verbose("0pdtc3",this.correlationId);else this.logger.verbose("07ndze",this.correlationId);return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("1vamm6",n.correlationId),n.postLogoutRedirectUri=Le.getAbsoluteUrl(e.postLogoutRedirectUri,_s())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("15m5g7",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("1f4xlz",n.correlationId),n.postLogoutRedirectUri=Le.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,_s())):(this.logger.verbose("17s5rf",n.correlationId),n.postLogoutRedirectUri=Le.getAbsoluteUrl(_s(),_s())):this.logger.verbose("0ljv63",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("0mvp54",this.correlationId)}else this.logger.verbose("1e7bdp",this.correlationId);return null}async createAuthCodeClient(e){const n=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)(e);return new bN(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:o}=e,a=e.authority||await Z(Bi,To,this.logger,this.performanceClient,this.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,i,s,o),l=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri,isMcp:this.config.auth.isMcp},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:l.loggerCallback,piiLoggingEnabled:l.piiLoggingEnabled,logLevel:l.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:hr.MSAL_SKU,version:jo,cpu:"",os:""},telemetry:this.config.telemetry}}}async function Lu(t,e,n,r,i,s,o,a){const l=bp(t.redirectUri,n.auth.redirectUri,s,a);new URL(l).origin!==new URL(window.location.href).origin&&(s.warning("08qbvw",a),o.addFields({isRedirectUriCrossOrigin:!0},a));const c={interactionType:e},u=Tk(r,t&&t.state||"",c),d={...await Z(Yk,$k,s,o,a)({...t,correlationId:a},n,o,s,a),redirectUri:l,state:u,nonce:t.nonce||Xs(),responseMode:n.auth.OIDCOptions.responseMode},f={...d,httpMethod:FN(d,n.system.protocolMode)};if(t.loginHint||t.sid)return f;const p=t.account||i.getActiveAccount(a);return p&&(s.verbose("1eqlb3",a),s.verbosePii("0tf99t",a),f.account=p),f}/*! @azure/msal-browser v5.10.0 2026-05-07 */function bW(t,e){if(!e)return null;try{return kh(t.base64Decode,e).libraryState.meta}catch{throw Y(Ru)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function Jc(t,e,n,r){const i=cp(t);if(!i)throw eN(t)?(n.error("13pl0s",r),n.errorPii("1097vx",r),se(q4)):(n.error("18h0l1",r),se(Y4));return i}function wW(t,e,n){if(!t.state)throw se(Dk);const r=bW(e,t.state);if(!r)throw se(_N);if(r.interactionType!==n)throw se(G4)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class XN{constructor(e,n,r,i,s){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=i,this.performanceClient=s}async handleCodeResponse(e,n,r){let i;try{i=n4(e,n.state)}catch(s){throw s instanceof Go&&s.subError===Ib?se(Ib):s}return Z(this.handleCodeResponseFromServer.bind(this),lN,this.logger,this.performanceClient,n.correlationId)(i,n,r)}async handleCodeResponseFromServer(e,n,r,i=!0){if(this.logger.trace("0mf2hb",n.correlationId),this.authCodeRequest.code=e.code,i&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const o=this.createCcsCredentials(n);o&&(this.authCodeRequest.ccsCredential=o)}return await Z(this.authModule.acquireToken.bind(this.authModule),_4,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,r,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Lr.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Lr.UPN}:null}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const SW="ContentError",kW="PageException",vW="user_switch";/*! @azure/msal-browser v5.10.0 2026-05-07 */const xW="USER_INTERACTION_REQUIRED",CW="USER_CANCEL",EW="NO_NETWORK",_W="DISABLED",TW="ACCOUNT_UNAVAILABLE",AW="UX_NOT_ALLOWED";/*! @azure/msal-browser v5.10.0 2026-05-07 */const PW=-2147186943;class li extends He{constructor(e,n,r){super(e,n||Fg(e)),Object.setPrototypeOf(this,li.prototype),this.name="NativeAuthError",this.ext=r}}function ua(t){if(t.ext&&t.ext.status&&t.ext.status===_W||t.ext&&t.ext.error&&t.ext.error===PW)return!0;switch(t.errorCode){case SW:case kW:return!0;default:return!1}}function wp(t,e,n){if(n&&n.status)switch(n.status){case TW:return mp(D3,Fg(t));case xW:return new vr(t,e);case CW:return se(Ib);case EW:return se(Rb);case AW:return mp(uN)}return new li(t,e,n)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class WN extends Fl{async acquireToken(e){const n=Sn($e.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),r=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),i=new J3(r,this.performanceClient);this.logger.verbose("0wa871",this.correlationId);try{const o=(await Z(i.acquireCachedToken.bind(i),x4,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(s){throw s instanceof vh&&s.errorCode===AN&&this.logger.verbose("06wena",this.correlationId),s}}logout(e){this.logger.verbose("1rkurh",this.correlationId);const n=this.initializeLogoutRequest(e);return Hk(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,n.account)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Of extends ZN{constructor(e,n,r,i,s,o,a,l,c,u,h,d){super(e,n,r,i,s,o,l,d,c),this.apiId=a,this.accountId=u,this.platformAuthProvider=c,this.nativeStorageManager=h,this.silentCacheClient=new WN(e,this.nativeStorageManager,r,i,s,o,l,d,c);const f=this.platformAuthProvider.getExtensionName();this.skus=$u.makeExtraSkuString({libraryName:hr.MSAL_SKU,libraryVersion:jo,extensionName:f,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[ZF]:this.skus}}async acquireToken(e,n){this.logger.trace("03qeos",this.correlationId);const r=this.performanceClient.startMeasurement(Nk,this.correlationId),i=Wr(),s=Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const o=await this.initializePlatformRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch(l){if(n===dn.AccessToken)throw this.logger.info("0eitbc",this.correlationId),r.end({success:!1,brokerErrorCode:"cache_request_failed"}),l;this.logger.info("0957j1",this.correlationId)}const a=await this.platformAuthProvider.sendMessage(o);return await this.handleNativeResponse(a,o,i).then(l=>(r.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),s.clearNativeBrokerErrorCode(),l)).catch(l=>{throw r.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError}),l})}catch(o){throw o instanceof li&&s.setNativeBrokerErrorCode(o.errorCode),r.end({success:!1}),o}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:rn.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("1ndf3e",this.correlationId),Y(S1);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},this.correlationId);if(!r)throw Y(S1);try{const i=this.createSilentCacheRequest(n,r),s=await this.silentCacheClient.acquireToken(i),o=this.browserStorage.getIdToken(r,this.correlationId,this.browserStorage.getTokenKeys(),r.tenantId),a=di((o==null?void 0:o.secret)||"",gn),l=hp(r,void 0,a,o==null?void 0:o.secret);return{...s,idToken:(o==null?void 0:o.secret)||"",idTokenClaims:a,account:l}}catch(i){throw i}}async acquireTokenRedirect(e,n,r){this.logger.trace("0luikq",this.correlationId);const i=await this.initializePlatformRequest(e),s=(r==null?void 0:r.navigateToLoginRequestUrl)??!0;try{await this.platformAuthProvider.sendMessage(i)}catch(l){if(l instanceof li&&(Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).setNativeBrokerErrorCode(l.errorCode),ua(l)))throw l}this.browserStorage.setTemporaryCache(_t.NATIVE_REQUEST,JSON.stringify(i),!0);const o={apiId:$e.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=s?window.location.href:bp(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId);n.end({success:!0}),await this.navigationClient.navigateExternal(a,o)}async handleRedirectPromise(){var s,o;if(this.logger.trace("1c5lhw",this.correlationId),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",this.correlationId),null;const e=this.browserStorage.getCachedNativeRequest();if(!e)return this.logger.verbose("0a6zjb",this.correlationId),(s=this.performanceClient)==null||s.addFields({errorCode:"no_cached_request"},this.correlationId),null;const{prompt:n,...r}=e;n&&this.logger.verbose("0ac34v",this.correlationId),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(_t.NATIVE_REQUEST));const i=Wr();try{this.logger.verbose("003x5a",this.correlationId);const a=await this.platformAuthProvider.sendMessage(r),l=await this.handleNativeResponse(a,r,i);return Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).clearNativeBrokerErrorCode(),(o=this.performanceClient)==null||o.addFields({isNativeBroker:!0},this.correlationId),l}catch(a){throw a}}logout(){return this.logger.trace("0u2sjm",this.correlationId),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var u,h;this.logger.trace("1bojln",this.correlationId);const i=di(e.id_token,gn),s=this.createHomeAccountIdentifier(e,i),o=(u=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:u.homeAccountId;if((h=n.extraParameters)!=null&&h.child_client_id&&e.account.id!==n.accountId)this.logger.info("1ub1in",this.correlationId);else if(s!==o&&e.account.id!==n.accountId)throw wp(vW);const a=await Bi(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,n.authority),l=dN(this.browserStorage,a,s,gn,this.correlationId,i,e.client_info,a.getPreferredCache(),i.tid,void 0,e.account.id,this.logger,this.performanceClient);e.expires_in=Number(e.expires_in);const c=await this.generateAuthenticationResult(e,n,i,l,a.canonicalAuthority,r);return await this.cacheAccount(l,Di(i)),await this.cacheNativeTokens(e,n,s,i,c.tenantId,r,a.getPreferredCache()),c}createHomeAccountIdentifier(e,n){return iN(e.client_info||"",$r.Default,this.logger,this.browserCrypto,this.correlationId,n)}generateScopes(e,n){return n?rn.fromString(n):rn.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===Be.POP&&n.signPopToken){if(e.shr)return this.logger.trace("0coqhu",this.correlationId),e.shr;const r=new gl(this.browserCrypto,this.performanceClient),i={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce,correlationId:this.correlationId};if(!n.keyId)throw Y(UR);return r.signPopToken(e.access_token,n.keyId,i)}else return e.access_token}async generateAuthenticationResult(e,n,r,i,s,o){const a=this.addTelemetryFromNativeResponse(e.properties.MATS),l=this.generateScopes(n.scope,e.scope),c=e.account.properties||{},u=c.UID||r.oid||r.sub||"",h=c.TenantId||r.tid||"",d=hp(Do(i),void 0,r,e.id_token);d.nativeAccountId!==e.account.id&&(d.nativeAccountId=e.account.id);const f=await this.generatePopAccessToken(e,n),p=n.tokenType===Be.POP?Be.POP:Be.BEARER;return{authority:s,uniqueId:u,tenantId:h,scopes:l.asArray(),account:d,idToken:e.id_token,idTokenClaims:r,accessToken:f,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:ff(o+e.expires_in),tokenType:p,correlationId:this.correlationId,state:e.state,fromPlatformBroker:!0,...n.resource&&{resource:n.resource}}}async cacheAccount(e,n){await this.browserStorage.setAccount(e,this.correlationId,n,this.apiId),this.browserStorage.removeAccountContext(Do(e),this.correlationId)}async cacheNativeTokens(e,n,r,i,s,o,a){var p;const l=Lg(r,a,e.id_token||"",n.clientId,i.tid||""),c=n.tokenType===Be.POP?h1:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=o+c,h=this.generateScopes(e.scope,n.scope),d=Dg(r,a,e.access_token,n.clientId,i.tid||s,h.printScopes(),u,0,gn,void 0,n.tokenType,void 0,n.keyId);l&&((p=n.storeInCache)==null?void 0:p.idToken)!==!1&&await this.browserStorage.setIdTokenCredential(l,this.correlationId,Di(i));const f={accessToken:d};return this.nativeStorageManager.saveCacheRecord(f,this.correlationId,Di(i),this.apiId,n.storeInCache)}getExpiresInValue(e,n){return e===Be.POP?h1:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("0b3l57",this.correlationId)}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("1okqev",this.correlationId),!1):!!e.is_cached}async initializePlatformRequest(e){this.logger.trace("1xdm2a",this.correlationId);const n=await this.getCanonicalAuthority(e),r=e.skipBrokerClaims&&e.embeddedClientId?void 0:this.config.auth.clientCapabilities,{scopes:i,claims:s,...o}=e,a=new rn(i||[]);a.appendScopes(jl);const l=r&&r.length?YR(s,r):s,c={...o,claims:l,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:a.printScopes(),redirectUri:bp(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw se(bX);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=dr.MATS_TELEMETRY,e.authenticationScheme===Be.POP){const u={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce,correlationId:this.correlationId},h=new gl(this.browserCrypto,this.performanceClient);let d;if(c.keyId)d=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const f=await Z(h.generateCnf.bind(h),Sh,this.logger,this.performanceClient,this.correlationId)(u,this.logger);d=f.reqCnfString,c.keyId=f.kid,c.signPopToken=!0}c.reqCnf=d}return this.addRequestSKUs(c),c}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority,{azureCloudOptions:r,account:i}=e;i&&await Bi(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,n,r,void 0,i);const s=new Le(n);return s.validateAsUri(),s}getPrompt(e){switch(this.apiId){case $e.ssoSilent:case $e.acquireTokenSilent_silentFlow:return this.logger.trace("12n1y2",this.correlationId),yn.NONE}if(!e){this.logger.trace("0uid1p",this.correlationId);return}switch(e){case yn.NONE:case yn.CONSENT:case yn.LOGIN:return this.logger.trace("0i0hco",this.correlationId),e;default:throw this.logger.trace("0w3tpw",this.correlationId),se(OX)}}handleExtraBrokerParams(e){var s;const n=e.extraParameters&&e.extraParameters.hasOwnProperty(Iu)&&e.extraParameters.hasOwnProperty(ap)&&e.extraParameters.hasOwnProperty(Lo);if(!e.embeddedClientId&&!n)return;let r="";const i=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[ap],r=e.extraParameters[Lo]),e.extraParameters={child_client_id:r,child_redirect_uri:i},(s=this.performanceClient)==null||s.addFields({embeddedClientId:r,embeddedRedirectUri:i},this.correlationId)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const IW=new Map([["e","AAD"],["m","MSA"]]);function RW(t){var e,n,r,i,s;if(!t)return null;try{const l=(/%(?:[0-9A-Fa-f]{2})/.test(t)?decodeURIComponent(t):t).split("|");return l.length<5?null:{accountType:IW.get(((e=l[0])==null?void 0:e.trim())||"")||"",error:((n=l[1])==null?void 0:n.trim())||"",subError:((r=l[2])==null?void 0:r.trim())||"",cloudInstance:((i=l[3])==null?void 0:i.trim())||"",callerDataBoundary:((s=l[4])==null?void 0:s.trim())||""}}catch{return null}}function VN(t,e,n){const r=RW(t.clientdata);r!=null&&r.accountType&&n.addFields({accountType:r.accountType},e),r!=null&&r.error&&n.addFields({serverErrorNo:r.error},e),r!=null&&r.subError&&n.addFields({serverSubErrorNo:r.subError},e)}async function qk(t,e,n,r,i){const s=t4({...t.auth,authority:e},n,r,i);if(mk(s,{sku:hr.MSAL_SKU,version:jo,os:"",cpu:""}),t.system.protocolMode!==Dn.OIDC&&Ok(s,t.telemetry.application),n.platformBroker&&(_5(s),i.addFields({isPlatformAuthorizeRequest:!0},n.correlationId),n.authenticationScheme===Be.POP)){const o=new Hi(r,i),a=new gl(o,i);let l;n.popKid?l=o.encodeKid(n.popKid):l=(await Z(a.generateCnf.bind(a),Sh,r,i,n.correlationId)(n,r)).reqCnfString,wk(s,l)}return $g(s,n.correlationId,i),s}async function Gk(t,e,n,r,i){if(!n.codeChallenge)throw et($R);const s=await Z(qk,C4,r,i,n.correlationId)(t,e,n,r,i);return hk(s,ik.CODE),yk(s,n.codeChallenge,rk),bi(s,{...n.extraQueryParameters,...n.extraParameters}),Ak(e,s)}async function Kk(t,e,n,r,i,s){if(!r.earJwk)throw se(EN);const o=await qk(e,n,r,i,s);hk(o,ik.IDTOKEN_TOKEN_REFRESHTOKEN),D5(o,r.earJwk),yk(o,r.codeChallenge,rk),bi(o,{...r.extraParameters});const a=new Map;bi(a,r.extraQueryParameters||{}),bh(a,r.correlationId);const l=Ak(n,a);return HN(t,l,o)}async function Jk(t,e,n,r,i,s){const o=await qk(e,n,r,i,s);hk(o,ik.CODE),yk(o,r.codeChallenge,r.codeChallengeMethod||rk),bi(o,{...r.extraParameters});const a=new Map;bi(a,r.extraQueryParameters||{}),bh(a,r.correlationId);const l=Ak(n,a);return HN(t,l,o)}function HN(t,e,n){const r=t.createElement("form");return r.method="post",r.action=e,n.forEach((i,s)=>{const o=t.createElement("input");o.hidden=!0,o.name=s,o.value=i,r.appendChild(o)}),t.body.appendChild(r),r}async function YN(t,e,n,r,i,s,o,a,l,c){if(a.verbose("11qcow",t.correlationId),!c)throw se(IN);const u=new Hi(a,l),h=new Of(r,i,u,a,o,r.system.navigationClient,n,l,c,e,s,t.correlationId),{userRequestState:d}=kh(u.base64Decode,t.state);return Z(h.acquireToken.bind(h),Nk,a,l,t.correlationId)({...t,state:d,prompt:void 0})}async function Ya(t,e,n,r,i,s,o,a,l,c,u,h){if(ai.removeThrottle(o,i.auth.clientId,t),VN(e,t.correlationId,u),e.accountId)return Z(YN,kN,c,u,t.correlationId)(t,e.accountId,r,i,o,a,l,c,u,h);const d={...t,code:e.code||"",codeVerifier:n},f=new XN(s,o,d,c,u);return await Z(f.handleCodeResponse.bind(f),E4,c,u,t.correlationId)(e,t,r)}async function ev(t,e,n,r,i,s,o,a,l,c,u){if(ai.removeThrottle(s,r.auth.clientId,t),VN(e,t.correlationId,c),Pk(e,t.state),!e.ear_jwe)throw se(H4);if(!t.earJwk)throw se(EN);const h=JSON.parse(await Z($X,U4,l,c,t.correlationId)(t.earJwk,e.ear_jwe));if(h.accountId)return Z(YN,kN,l,c,t.correlationId)(t,h.accountId,n,r,s,o,a,l,c,u);const d=new zo(r.auth.clientId,s,new Hi(l,c),l,c,null,null);d.validateTokenResponse(h,t.correlationId);const f={code:"",state:t.state,nonce:t.nonce,client_info:h.client_info,cloud_graph_host_name:h.cloud_graph_host_name,cloud_instance_host_name:h.cloud_instance_host_name,cloud_instance_name:h.cloud_instance_name,msgraph_host:h.msgraph_host};return await Z(d.handleServerTokenResponse.bind(d),Ek,l,c,t.correlationId)(h,i,Wr(),t,n,f,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const NW=32;async function Uo(t,e,n){const r=Jn($W,$4,e,t,n)(t,e,n),i=await Z(MW,M4,e,t,n)(r,t,e,n);return{verifier:r,challenge:i}}function $W(t,e,n){try{const r=new Uint8Array(NW);return Jn(AX,L4,e,t,n)(r),Fs(r)}catch{throw se(CN)}}async function MW(t,e,n,r){try{const i=await Z($N,Q4,n,e,r)(t);return Fs(new Uint8Array(i))}catch{throw se(CN)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Sp{navigateInternal(e,n){return Sp.defaultNavigateWindow(e,n)}navigateExternal(e,n){return Sp.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((r,i)=>{setTimeout(()=>{i(se(yp,"failed_to_redirect"))},n.timeout)})}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class QW{async sendGetRequestAsync(e,n){let r,i={},s=0;const o=lC(n);try{r=await fetch(e,{method:F1.GET,headers:o})}catch(a){throw Qc(se(window.navigator.onLine?uX:Rb),void 0,void 0,a)}i=cC(r.headers);try{return s=r.status,{headers:i,body:await r.json(),status:s}}catch(a){throw Qc(se(H1),s,i,a)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",i=lC(n);let s,o=0,a={};try{s=await fetch(e,{method:F1.POST,headers:i,body:r})}catch(l){throw Qc(se(window.navigator.onLine?cX:Rb),void 0,void 0,l)}a=cC(s.headers);try{return o=s.status,{headers:a,body:await s.json(),status:o}}catch(l){throw Qc(se(H1),o,a,l)}}}function lC(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,i])=>{e.append(r,i)}),e}catch(e){throw Qc(se(wX),void 0,void 0,e)}}function cC(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw se(SX)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const LW=6e4,DW=1e4,zW=3e4,qN=2e3;function BW({auth:t,cache:e,system:n,experimental:r,telemetry:i},s){const o={clientId:"",authority:`${wR}`,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:"",postLogoutRedirectUri:"",clientCapabilities:[],OIDCOptions:{responseMode:sk.FRAGMENT,defaultScopes:[kR,vR,nk]},azureCloudOptions:{azureCloudInstance:Sk.None,tenant:""},instanceAware:!1,isMcp:!1,verifySSO:!1},a={cacheLocation:Ur.SessionStorage,cacheRetentionDays:5},l={loggerCallback:()=>{},logLevel:at.Info,piiLoggingEnabled:!1},u={...{...oN,loggerOptions:l,networkClient:s?new QW:e4,navigationClient:new Sp,popupBridgeTimeout:(n==null?void 0:n.popupBridgeTimeout)||LW,iframeBridgeTimeout:(n==null?void 0:n.iframeBridgeTimeout)||DW,redirectNavigationTimeout:zW,allowRedirectInIframe:!1,navigatePopups:!0,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||qN,protocolMode:Dn.AAD},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||l},h={application:{appName:"",appVersion:""},client:new sN},d={iframeTimeoutTelemetry:!1};if((n==null?void 0:n.protocolMode)!==Dn.OIDC&&(t!=null&&t.OIDCOptions)&&new ki(u.loggerOptions).warning(JSON.stringify(et(r5)),""),n!=null&&n.protocolMode&&n.protocolMode===Dn.OIDC&&(u!=null&&u.allowPlatformBroker))throw et(i5);return{auth:{...o,...t,OIDCOptions:{...o.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...a,...e},system:u,experimental:{...d,...r},telemetry:{...h,...i}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class kp{constructor(e,n,r,i){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=this.performanceClient.startMeasurement(R4),this.platformAuthType=dr.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace("0on4p2",e.correlationId);const n={method:yc.GetToken,request:e},r={channel:dr.CHANNEL_ID,extensionId:this.extensionId,responseId:Xs(),body:n};this.logger.trace("1qadfi",e.correlationId),this.logger.tracePii("1xm533",e.correlationId),this.messageChannel.port1.postMessage(r);const i=await new Promise((o,a)=>{this.resolvers.set(r.responseId,{resolve:o,reject:a})});return this.validatePlatformBrokerResponse(i)}static async createProvider(e,n,r,i){e.trace("15zfnw",i);try{const s=new kp(e,n,r,dr.PREFERRED_EXTENSION_ID);return await s.sendHandshakeRequest(i),s}catch{const o=new kp(e,n,r);return await o.sendHandshakeRequest(i),o}}async sendHandshakeRequest(e){this.logger.trace("1dpg9o",e),window.addEventListener("message",this.windowListener,!1);const n={channel:dr.CHANNEL_ID,extensionId:this.extensionId,responseId:Xs(),body:{method:yc.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=r=>{this.onChannelMessage(r)},window.postMessage(n,window.origin,[this.messageChannel.port2]),new Promise((r,i)=>{this.handshakeResolvers.set(n.responseId,{resolve:r,reject:i}),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}),i(se(gX)),this.handshakeResolvers.delete(n.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){const n=Nb();if(this.logger.trace("0jpn5u",n),e.source!==window)return;const r=e.data;if(!(!r.channel||r.channel!==dr.CHANNEL_ID)&&!(r.extensionId&&r.extensionId!==this.extensionId)&&r.body.method===yc.HandshakeRequest){const i=this.handshakeResolvers.get(r.responseId);if(!i){this.logger.trace("07buhm",n);return}this.logger.verbose(r.extensionId?"0xrkug":"No extension installed",n),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),i.reject(se(mX))}}onChannelMessage(e){const n=Nb();this.logger.trace("1py8yf",n);const r=e.data,i=this.resolvers.get(r.responseId),s=this.handshakeResolvers.get(r.responseId);try{const o=r.body.method;if(o===yc.Response){if(!i)return;const a=r.body.response;if(this.logger.trace("19hpgm",n),this.logger.tracePii("179a24",n),a.status!=="Success")i.reject(wp(a.code,a.description,a.ext));else if(a.result)a.result.code&&a.result.description?i.reject(wp(a.result.code,a.result.description,a.result.ext)):i.resolve(a.result);else throw xb(Ab,"Event does not contain result.");this.resolvers.delete(r.responseId)}else if(o===yc.HandshakeResponse){if(!s){this.logger.trace("082qnt",n);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=r.extensionId,this.extensionVersion=r.body.version,this.logger.verbose("0yf5ib",n),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),s.resolve(),this.handshakeResolvers.delete(r.responseId)}}catch(o){this.logger.error("0xf978",n),this.logger.errorPii("04i99o",n),this.logger.errorPii("0xdvsy",n),i?i.reject(o):s&&s.reject(o)}}validatePlatformBrokerResponse(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 xb(Ab,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){var e;return this.getExtensionId()===dr.PREFERRED_EXTENSION_ID?"chrome":(e=this.getExtensionId())!=null&&e.length?"unknown":void 0}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class tv{constructor(e,n,r){this.logger=e,this.performanceClient=n,this.correlationId=r,this.platformAuthType=dr.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,r){var i;if(e.trace("12mj4a",r),(i=window.navigator)!=null&&i.platformAuthentication){const s=await window.navigator.platformAuthentication.getSupportedContracts(dr.MICROSOFT_ENTRA_BROKERID);if(s!=null&&s.includes(dr.PLATFORM_DOM_APIS))return e.trace("1h5q1r",r),new tv(e,n,r)}}getExtensionId(){return dr.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return dr.DOM_API_NAME}async sendMessage(e){this.logger.trace("02bcil",e.correlationId);try{const n=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(r,e.correlationId)}catch(n){throw this.logger.error("11im7g",e.correlationId),n}}initializePlatformDOMRequest(e){this.logger.trace("15d6yv",e.correlationId);const{accountId:n,clientId:r,authority:i,scope:s,redirectUri:o,correlationId:a,state:l,storeInCache:c,embeddedClientId:u,extraParameters:h,...d}=e,f=this.getDOMExtraParams(d,a);return{accountId:n,brokerId:this.getExtensionId(),authority:i,clientId:r,correlationId:a||this.correlationId,extraParameters:{...h,...f},isSecurityTokenService:!1,redirectUri:o,scope:s,state:l,storeInCache:c,embeddedClientId:u}}validatePlatformBrokerResponse(e,n){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace("0h4vei",n),this.convertToPlatformBrokerResponse(e,n);if(e.hasOwnProperty("error")){const r=e;if(r.isSuccess===!1&&r.error&&r.error.code)throw this.logger.trace("0g92vm",n),wp(r.error.code,r.error.description,{error:parseInt(r.error.errorCode),protocol_error:r.error.protocolError,status:r.error.status,properties:r.error.properties})}}throw xb(Ab,"Response missing expected properties.")}convertToPlatformBrokerResponse(e,n){return this.logger.trace("14913t",n),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e,n){try{const r={};for(const[i,s]of Object.entries(e))s&&(typeof s=="object"?r[i]=JSON.stringify(s):r[i]=String(s));return r}catch{return this.logger.error("0eu9o3",n),this.logger.errorPii("17rpl5",n),{}}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */async function jW(t,e,n,r){t.trace("134j0v",n);const i=UW();t.trace("04c81g",n);let s;try{i&&(s=await tv.createProvider(t,e,n)),s||(t.trace("0l3na8",n),s=await kp.createProvider(t,r||qN,e,n))}catch(o){t.trace("0icbd7",o)}return s}function UW(){let t;try{return t=window[Ur.SessionStorage],(t==null?void 0:t.getItem(iW))==="true"}catch{return!1}}function Du(t,e,n,r,i){if(e.trace("0uko3r",n),!t.system.allowPlatformBroker)return e.trace("04hozs",n),!1;if(!r)return e.trace("0kvv1r",n),!1;if(i)switch(i){case Be.BEARER:case Be.POP:return e.trace("18tev1",n),!0;default:return e.trace("1dd2nh",n),!1}return!0}/*! @azure/msal-browser v5.10.0 2026-05-07 */class ZW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.nativeStorage=l,this.eventHandler=s}acquireToken(e,n){let r;try{if(r={popupName:this.generatePopupName(e.scopes||jl,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:!this.config.system.navigatePopups},this.correlationId),this.config.system.navigatePopups){const s={...e,httpMethod:FN(e,this.config.system.protocolMode)};return this.logger.verbose("1f9ok3",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(s,r,n)}else return this.logger.verbose("162h4u",this.correlationId),this.acquireTokenPopupAsync(e,r,n)}catch(i){return Promise.reject(i)}}logout(e){try{this.logger.verbose("068rup",this.correlationId);const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},i=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.navigatePopups?(this.logger.verbose("1a28da",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,i,s)):(this.logger.verbose("1phd8u",this.correlationId),this.logoutPopupAsync(n,r,i,s))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,r){this.logger.verbose("1g77pg",this.correlationId);const i=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(e,ge.Popup,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);n.popup&&jN(i.authority);const s=Du(this.config,this.logger,this.correlationId,this.platformAuthProvider,e.authenticationScheme);return i.platformBroker=s,this.config.system.protocolMode===Dn.EAR?this.executeEarFlow(i,n,r):this.executeCodeFlow(i,n,r)}async executeCodeFlow(e,n,r){var l;const i=e.correlationId,s=Sn($e.acquireTokenPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=r||await Z(Uo,Bo,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),a={...e,codeChallenge:o.challenge};try{const c=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,i)({serverTelemetryManager:s,requestAuthority:a.authority,requestAzureCloudOptions:a.azureCloudOptions,requestExtraQueryParameters:a.extraQueryParameters,account:a.account});if(a.httpMethod===Za.POST)return await this.executeCodeFlowWithPost(a,n,c,o.verifier);{const u=await Z(Gk,Ck,this.logger,this.performanceClient,i)(this.config,c.authority,a,this.logger,this.performanceClient),h=this.initiateAuthRequest(u,n);this.eventHandler.emitEvent(be.POPUP_OPENED,i,ge.Popup,{popupWindow:h},null);const d=await Ia(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient),f=Jn(Jc,Kc,this.logger,this.performanceClient,this.correlationId)(d,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return await Z(Ya,Wa,this.logger,this.performanceClient,i)(e,f,o.verifier,$e.acquireTokenPopup,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(c){throw(l=n.popup)==null||l.close(),c instanceof He&&(c.setCorrelationId(this.correlationId),s.cacheFailedRequest(c)),c}}async executeEarFlow(e,n,r){const{correlationId:i,authority:s,azureCloudOptions:o,extraQueryParameters:a,account:l}=e,c=await Z(Bi,To,this.logger,this.performanceClient,i)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,s,o,a,l),u=await Z(Fk,Qk,this.logger,this.performanceClient,i)(),h=r||await Z(Uo,Bo,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),d={...e,earJwk:u,codeChallenge:h.challenge},f=n.popup||this.openPopup("about:blank",n);(await Kk(f.document,this.config,c,d,this.logger,this.performanceClient)).submit();const g=await Z(Ia,Op,this.logger,this.performanceClient,i)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,d,this.performanceClient),y=Jn(Jc,Kc,this.logger,this.performanceClient,this.correlationId)(g,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);if(!y.ear_jwe&&y.code){const m=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,i)({serverTelemetryManager:Sn($e.acquireTokenPopup,this.config.auth.clientId,i,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:c});return Z(Ya,Wa,this.logger,this.performanceClient,i)(d,y,h.verifier,$e.acquireTokenPopup,this.config,m,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return Z(ev,Mk,this.logger,this.performanceClient,i)(d,y,$e.acquireTokenPopup,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,r,i){const s=e.correlationId,o=await Z(Bi,To,this.logger,this.performanceClient,s)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger),a=n.popup||this.openPopup("about:blank",n);(await Jk(a.document,this.config,o,e,this.logger,this.performanceClient)).submit();const c=await Z(Ia,Op,this.logger,this.performanceClient,s)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient),u=Jn(Jc,Kc,this.logger,this.performanceClient,this.correlationId)(c,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return Z(Ya,Wa,this.logger,this.performanceClient,s)(e,u,i,$e.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,r,i){var o,a,l;this.logger.verbose("0b7yrk",this.correlationId),this.eventHandler.emitEvent(be.LOGOUT_START,this.correlationId,ge.Popup,e);const s=Sn($e.logoutPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{await Hk(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,e.account);const c=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:r,account:e.account||void 0});try{c.authority.endSessionEndpoint}catch{if((o=e.account)!=null&&o.homeAccountId&&e.postLogoutRedirectUri&&c.authority.protocolMode===Dn.OIDC){if(this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,e.correlationId,ge.Popup,e),i){const d={apiId:$e.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=Le.getAbsoluteUrl(i,_s());await this.navigationClient.navigateInternal(f,d)}(a=n.popup)==null||a.close();return}}e.state=Tk(this.browserCrypto,e.state||"",{interactionType:ge.Popup});const u=c.getLogoutUri(e);this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,e.correlationId,ge.Popup,e);const h=this.openPopup(u,n);if(this.eventHandler.emitEvent(be.POPUP_OPENED,e.correlationId,ge.Popup,{popupWindow:h},null),await Ia(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient).catch(()=>{}),i){const d={apiId:$e.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=Le.getAbsoluteUrl(i,_s());this.logger.verbose("0qcur2",this.correlationId),this.logger.verbosePii("0oj7lk",this.correlationId),await this.navigationClient.navigateInternal(f,d)}else this.logger.verbose("03zgcf",this.correlationId)}catch(c){throw(l=n.popup)==null||l.close(),c instanceof He&&(c.setCorrelationId(this.correlationId),s.cacheFailedRequest(c)),this.eventHandler.emitEvent(be.LOGOUT_FAILURE,this.correlationId,ge.Popup,null,c),this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Popup),c}this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii("1kcr9k",this.correlationId),this.openPopup(e,n);throw this.logger.error("1l7hyp",this.correlationId),se(Lk)}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii("0cgeo7",this.correlationId),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii("0c2awd",this.correlationId),r=this.openSizedPopup(e,n)),!r)throw se(tX);return r.focus&&r.focus(),this.currentWindow=r,r}catch{throw this.logger.error("0dxfb9",this.correlationId),se(eX)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:i}){var f,p,g,y;const s=i.screenLeft?i.screenLeft:i.screenX,o=i.screenTop?i.screenTop:i.screenY,a=i.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=i.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let c=(f=r.popupSize)==null?void 0:f.width,u=(p=r.popupSize)==null?void 0:p.height,h=(g=r.popupPosition)==null?void 0:g.top,d=(y=r.popupPosition)==null?void 0:y.left;return(!c||c<0||c>a)&&(this.logger.verbose("08vfmo",this.correlationId),c=hr.POPUP_WIDTH),(!u||u<0||u>l)&&(this.logger.verbose("09cxa0",this.correlationId),u=hr.POPUP_HEIGHT),(!h||h<0||h>l)&&(this.logger.verbose("1qh4wo",this.correlationId),h=Math.max(0,l/2-hr.POPUP_HEIGHT/2+o)),(!d||d<0||d>a)&&(this.logger.verbose("1sz3en",this.correlationId),d=Math.max(0,a/2-hr.POPUP_WIDTH/2+s)),i.open(e,n,`width=${c}, height=${u}, top=${h}, left=${d}, scrollbars=yes`)}generatePopupName(e,n){return`${hr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${hr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function FW(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class XW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.nativeStorage=l}async acquireToken(e){const n=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(e,ge.Redirect,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);n.platformBroker=Du(this.config,this.logger,this.correlationId,this.platformAuthProvider,e.authenticationScheme);const r=s=>{s.persisted&&(this.logger.verbose("0udvtt",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),this.eventHandler.emitEvent(be.RESTORE_FROM_BFCACHE,this.correlationId,ge.Redirect))},i=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii("0zao0a",this.correlationId),this.browserStorage.setTemporaryCache(_t.ORIGIN_URI,i,!0),window.addEventListener("pageshow",r);try{this.config.system.protocolMode===Dn.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n)}catch(s){throw s instanceof He&&s.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),s}}async executeCodeFlow(e){const n=e.correlationId,r=Sn($e.acquireTokenRedirect,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),i=await Z(Uo,Bo,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),s={...e,codeChallenge:i.challenge};this.browserStorage.cacheAuthorizeRequest(s,this.correlationId,i.verifier);try{if(s.httpMethod===Za.POST)return await this.executeCodeFlowWithPost(s);{const o=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:s.authority,requestAzureCloudOptions:s.azureCloudOptions,requestExtraQueryParameters:s.extraQueryParameters,account:s.account}),a=await Z(Gk,Ck,this.logger,this.performanceClient,e.correlationId)(this.config,o.authority,s,this.logger,this.performanceClient);return await this.initiateAuthRequest(a)}}catch(o){throw o instanceof He&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}async executeEarFlow(e){const{correlationId:n,authority:r,azureCloudOptions:i,extraQueryParameters:s,account:o}=e,a=await Z(Bi,To,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,i,s,o),l=await Z(Fk,Qk,this.logger,this.performanceClient,n)(),c=await Z(Uo,Bo,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),u={...e,earJwk:l,codeChallenge:c.challenge};return this.browserStorage.cacheAuthorizeRequest(u,this.correlationId,c.verifier),(await Kk(document,this.config,a,u,this.logger,this.performanceClient)).submit(),new Promise((d,f)=>{setTimeout(()=>{f(se(yp,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,r=await Z(Bi,To,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger);return this.browserStorage.cacheAuthorizeRequest(e,this.correlationId),(await Jk(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise((s,o)=>{setTimeout(()=>{o(se(yp,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e,n,r,i){const s=Sn($e.handleRedirectPromise,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=(i==null?void 0:i.navigateToLoginRequestUrl)??!0;try{const[a,l]=this.getRedirectResponse((i==null?void 0:i.hash)||"");if(!a)return this.logger.info("1qmv0q",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),FW()!=="back_forward"?r.event.errorCode="no_server_response":this.logger.verbose("1eqegq",this.correlationId),null;const c=this.browserStorage.getTemporaryCache(_t.ORIGIN_URI,this.correlationId,!0)||"",u=x1(c),h=x1(window.location.href);if(u===h&&o)return this.logger.verbose("11yred",this.correlationId),c.indexOf("#")>-1&&zX(c),await this.handleResponse(a,e,n,s);if(o){if(!Xg()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(_t.URL_HASH,l,!0);const d={apiId:$e.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let f=!0;if(!c||c==="null"){const p=UX();this.browserStorage.setTemporaryCache(_t.ORIGIN_URI,p,!0),this.logger.warning("1dutq1",this.correlationId),f=await this.navigationClient.navigateInternal(p,d)}else this.logger.verbose("08jpy1",this.correlationId),f=await this.navigationClient.navigateInternal(c,d);if(!f)return await this.handleResponse(a,e,n,s)}}else return this.logger.verbose("0v4sdv",this.correlationId),await this.handleResponse(a,e,n,s);return null}catch(a){throw a instanceof He&&(a.setCorrelationId(this.correlationId),s.cacheFailedRequest(a)),a}}getRedirectResponse(e){this.logger.verbose("1c5i8m",this.correlationId);let n=e;n||(this.config.auth.OIDCOptions.responseMode===sk.QUERY?n=window.location.search:n=window.location.hash);let r=cp(n);if(r){try{wW(r,this.browserCrypto,ge.Redirect)}catch(s){return s instanceof He&&this.logger.error("0bkq6p",this.correlationId),[null,""]}return DN(window),this.logger.verbose("00uvho",this.correlationId),[r,n]}const i=this.browserStorage.getTemporaryCache(_t.URL_HASH,this.correlationId,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(_t.URL_HASH)),i&&(r=cp(i),r)?(this.logger.verbose("001671",this.correlationId),[r,i]):[null,""]}async handleResponse(e,n,r,i){if(!e.state)throw se(Dk);const{authority:o,azureCloudOptions:a,extraQueryParameters:l,account:c}=n;if(e.ear_jwe){const h=await Z(Bi,To,this.logger,this.performanceClient,n.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,a,l,c);return Z(ev,Mk,this.logger,this.performanceClient,n.correlationId)(n,e,$e.acquireTokenRedirect,this.config,h,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const u=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:n.authority});return Z(Ya,Wa,this.logger,this.performanceClient,n.correlationId)(n,e,r,$e.acquireTokenRedirect,this.config,u,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e){if(this.logger.verbose("0yaw2e",this.correlationId),e){this.logger.infoPii("1luf83",this.correlationId);const n={apiId:$e.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},r=this.config.auth.onRedirectNavigate;if(typeof r=="function")if(this.logger.verbose("1nehvl",this.correlationId),r(e)!==!1){this.logger.verbose("1a0jxh",this.correlationId),await this.navigationClient.navigateExternal(e,n);return}else{this.logger.verbose("09k5h5",this.correlationId);return}else{this.logger.verbose("0klwf7",this.correlationId),await this.navigationClient.navigateExternal(e,n);return}}else throw this.logger.info("0rlh4e",this.correlationId),se(Lk)}async logout(e){var i,s;this.logger.verbose("1rkurh",this.correlationId);const n=this.initializeLogoutRequest(e),r=Sn($e.logout,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{this.eventHandler.emitEvent(be.LOGOUT_START,this.correlationId,ge.Redirect,e),await Hk(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,n.account);const o={apiId:$e.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await Z(this.createAuthCodeClient.bind(this),zi,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(a.authority.protocolMode===Dn.OIDC)try{a.authority.endSessionEndpoint}catch{if((i=n.account)!=null&&i.homeAccountId){this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,this.correlationId,ge.Redirect,n);return}}n.state=Tk(this.browserCrypto,n.state||"",{interactionType:ge.Redirect});const l=a.getLogoutUri(n);(s=n.account)!=null&&s.homeAccountId&&this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,this.correlationId,ge.Redirect,n);const c=this.config.auth.onRedirectNavigate;if(typeof c=="function")if(c(l)!==!1){this.logger.verbose("06v57e",this.correlationId),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),await this.navigationClient.navigateExternal(l,o);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("0xqes1",this.correlationId);else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),await this.navigationClient.navigateExternal(l,o);return}}catch(o){throw o instanceof He&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.eventHandler.emitEvent(be.LOGOUT_FAILURE,this.correlationId,ge.Redirect,null,o),this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Redirect),o}this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return Le.getAbsoluteUrl(n,_s())}}/*! @azure/msal-browser v5.10.0 2026-05-07 */async function WW(t,e,n,r){if(!t)throw n.info("1l7hyp",r),se(Lk);return Jn(YW,v4,n,e,r)(t)}async function VW(t,e,n,r,i){const s=nv();if(!s.contentDocument)throw"No document associated with iframe!";return(await Jk(s.contentDocument,t,e,n,r,i)).submit(),s}async function HW(t,e,n,r,i){const s=nv();if(!s.contentDocument)throw"No document associated with iframe!";return(await Kk(s.contentDocument,t,e,n,r,i)).submit(),s}function YW(t){const e=nv();return e.src=t,e}function nv(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),t.setAttribute("allow","local-network-access *"),document.body.appendChild(t),t}function uC(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class qW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u,h){super(e,n,r,i,s,o,l,u,h),this.apiId=a,this.nativeStorage=c}async acquireToken(e){!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("1kl318",this.correlationId);const n={...e};n.prompt?n.prompt!==yn.NONE&&n.prompt!==yn.NO_SESSION&&(this.logger.warning("0bmctg",this.correlationId),n.prompt=yn.NONE):n.prompt=yn.NONE;const r=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(n,ge.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);return r.platformBroker=Du(this.config,this.logger,this.correlationId,this.platformAuthProvider,r.authenticationScheme),jN(r.authority),this.config.system.protocolMode===Dn.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let n;const r=Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{return n=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await Z(this.silentTokenHelper.bind(this),B1,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(i){if(i instanceof He&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),!n||!(i instanceof He)||i.errorCode!==hr.INVALID_GRANT_ERROR)throw i;return this.performanceClient.addFields({retryError:i.errorCode},this.correlationId),await Z(this.silentTokenHelper.bind(this),B1,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const{correlationId:n,authority:r,azureCloudOptions:i,extraQueryParameters:s,account:o}=e,a=await Z(Bi,To,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,i,s,o),l=await Z(Fk,Qk,this.logger,this.performanceClient,n)(),c=await Z(Uo,Bo,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),u={...e,earJwk:l,codeChallenge:c.challenge},h=await Z(HW,eO,this.logger,this.performanceClient,n)(this.config,a,u,this.logger,this.performanceClient),d=this.config.auth.OIDCOptions.responseMode;let f;try{f=await Z(Ia,Op,this.logger,this.performanceClient,n)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient,this.config.experimental)}finally{Jn(uC,j1,this.logger,this.performanceClient,n)(h)}const p=Jn(Jc,Kc,this.logger,this.performanceClient,n)(f,d,this.logger,this.correlationId);if(!p.ear_jwe&&p.code){const g=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,n)({serverTelemetryManager:Sn(this.apiId,this.config.auth.clientId,n,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:a});return Z(Ya,Wa,this.logger,this.performanceClient,n)(u,p,c.verifier,this.apiId,this.config,g,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return Z(ev,Mk,this.logger,this.performanceClient,n)(u,p,this.apiId,this.config,a,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async verifySso(e){const n={...e};n.prompt||(n.prompt=yn.NONE);const r=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(n,ge.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId),i=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),{serverParams:s}=await this.silentAuthorizeHelper(i,r),o=r.correlationId;return Pk(s,r.state),s.code?(this.logger.verbose("0kkkcj",o),!0):(this.logger.warning("0y34ti",o),!1)}logout(){return Promise.reject(se(zk))}async silentTokenHelper(e,n){const{serverParams:r,pkceCodes:i}=await this.silentAuthorizeHelper(e,n);return Z(Ya,Wa,this.logger,this.performanceClient,n.correlationId)(n,r,i.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async silentAuthorizeHelper(e,n){const r=n.correlationId,i=await Z(Uo,Bo,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...n,codeChallenge:i.challenge};let o;if(n.httpMethod===Za.POST)o=await Z(VW,eO,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);else{const u=await Z(Gk,Ck,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);o=await Z(WW,eO,this.logger,this.performanceClient,r)(u,this.performanceClient,this.logger,r)}const a=this.config.auth.OIDCOptions.responseMode;let l;try{l=await Z(Ia,Op,this.logger,this.performanceClient,r)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,n,this.performanceClient,this.config.experimental)}finally{Jn(uC,j1,this.logger,this.performanceClient,r)(o)}return{serverParams:Jn(Jc,Kc,this.logger,this.performanceClient,r)(l,a,this.logger,this.correlationId),pkceCodes:i,silentRequest:s}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class GW extends Fl{async acquireToken(e){const n=await Z(Yk,$k,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger,this.correlationId),r={...e,...n};e.redirectUri&&(r.redirectUri=bp(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId));const i=Sn($e.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),s=await this.createRefreshTokenClient({serverTelemetryManager:i,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return Z(s.acquireTokenByRefreshToken.bind(s),w4,this.logger,this.performanceClient,e.correlationId)(r,$e.acquireTokenSilent_silentFlow).catch(o=>{throw o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o),o})}logout(){return Promise.reject(se(zk))}async createRefreshTokenClient(e){const n=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new K3(n,this.performanceClient)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class KW extends bN{constructor(e,n){super(e,n),this.includeRedirectUri=!1}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class JW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,l,c,u),this.apiId=a}async acquireToken(e){if(!e.code)throw se(hX);const n=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(e,ge.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId),r=Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const i={...n,code:e.code},s=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),o=new KW(s,this.performanceClient);this.logger.verbose("1uic5e",this.correlationId);const a=new XN(o,this.browserStorage,i,this.logger,this.performanceClient);return await Z(a.handleCodeResponseFromServer.bind(a),lN,this.logger,this.performanceClient,this.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,this.apiId,!1)}catch(i){throw i instanceof He&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),i}}logout(){return Promise.reject(se(zk))}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function eV(t,e,n,r){var a;const i=((a=window.msal)==null?void 0:a.clientIds)||[],s=i.length,o=i.filter(l=>l===t).length;o>1&&n.warning("1e88vg",r),e.add({msalInstanceCount:s,sameClientIdInstanceCount:o})}/*! @azure/msal-browser v5.10.0 2026-05-07 */function dd(t,e,n,r){try{Vk(t),wN(n.auth.isMcp,r)}catch(i){throw e.end({success:!1},i,r.account),i}}class rv{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 Hi(this.logger,this.performanceClient):up,this.eventHandler=new OW(this.logger),this.browserStorage=this.isBrowserEnvironment?new Mb(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,q3(this.config.auth)):hW(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:Ur.MemoryStorage,cacheRetentionDays:5};this.nativeInternalStorage=new Mb(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.activeSilentTokenRequests=new Map,this.trackStateChange=this.trackStateChange.bind(this),this.trackStateChangeWithMeasurement=this.trackStateChangeWithMeasurement.bind(this)}static async createController(e,n){const r=new rv(e);return await r.initialize(n),r}trackStateChange(e,n){e&&(n.type==="visibilitychange"?(this.logger.info("16v6hv",e),this.performanceClient.incrementFields({visibilityChangeCount:1},e)):n.type==="online"?(this.logger.info("0zirfd",e),this.performanceClient.incrementFields({onlineStatusChangeCount:1},e)):n.type==="offline"&&(this.logger.info("1xk9ef",e),this.performanceClient.incrementFields({onlineStatusChangeCount:1},e)))}async initialize(e){const n=this.getRequestCorrelationId(e);if(this.logger.trace("1f7joy",n),this.initialized){this.logger.info("061m5x",n);return}if(!this.isBrowserEnvironment){this.logger.info("19fvpi",n),this.initialized=!0,this.eventHandler.emitEvent(be.INITIALIZE_END,n);return}const r=this.config.system.allowPlatformBroker,i=this.performanceClient.startMeasurement(JX,n);if(this.eventHandler.emitEvent(be.INITIALIZE_START,n),this.logMultipleInstances(i,n),i.add({isMcp:this.config.auth.isMcp}),await Z(this.browserStorage.initialize.bind(this.browserStorage),k4,this.logger,this.performanceClient,n)(n),r)try{this.platformAuthProvider=await jW(this.logger,this.performanceClient,n,this.config.system.nativeBrokerHandshakeTimeout)}catch(s){this.logger.verbose(s,n)}this.config.cache.cacheLocation===Ur.LocalStorage&&this.eventHandler.subscribeCrossTab(),!this.config.system.navigatePopups&&await this.preGeneratePkceCodes(n),this.initialized=!0,this.eventHandler.emitEvent(be.INITIALIZE_END,n),i.end({allowPlatformBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("02l8bm",""),BN(this.initialized),this.isBrowserEnvironment){const n=(e==null?void 0:e.hash)||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("1wn9kp","")):this.logger.verbose("0w0gm3",""),r}return this.logger.verbose("12xi63",""),null}async handleRedirectPromiseInternal(e){var c;if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",""),null;if(((c=this.browserStorage.getInteractionInProgress())==null?void 0:c.type)===ws.SIGNOUT)return this.logger.verbose("1ywcv2",""),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const r=this.getAllAccounts(),i=this.browserStorage.getCachedNativeRequest(),s=i&&!(e!=null&&e.hash);let o,a,l;try{if(s&&this.platformAuthProvider){const u=(i==null?void 0:i.correlationId)||"";this.eventHandler.emitEvent(be.HANDLE_REDIRECT_START,u,ge.Redirect),o=this.performanceClient.startMeasurement(iO,u),this.logger.trace("12v7is",u),o.add({isPlatformBrokerRequest:!0});const h=new Of(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,i.accountId,this.nativeInternalStorage,i.correlationId);a=Z(h.handleRedirectPromise.bind(h),I4,this.logger,this.performanceClient,o.event.correlationId)()}else{const[u,h]=this.browserStorage.getCachedRequest("");l=u;const d=u.correlationId;this.eventHandler.emitEvent(be.HANDLE_REDIRECT_START,d,ge.Redirect),o=this.performanceClient.startMeasurement(iO,d),this.logger.trace("0znzs5",d);const f=this.createRedirectClient(d);a=Z(f.handleRedirectPromise.bind(f),P4,this.logger,this.performanceClient,o.event.correlationId)(u,h,o,e)}}catch(u){throw this.browserStorage.resetRequestCache(""),u}return a.then(u=>(u?(this.browserStorage.resetRequestCache(u.correlationId),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,u.correlationId,ge.Redirect,u),this.logger.verbose("0ui8f5",u.correlationId),r.length<this.getAllAccounts().length&&(this.eventHandler.emitEvent(be.LOGIN_SUCCESS,u.correlationId,ge.Redirect,u.account),this.logger.verbose("16im3l",u.correlationId)),o.end({success:!0},void 0,u.account),this.verifySsoCapability(l,ge.Redirect)):o.event.errorCode?o.end({success:!1},void 0):o.discard(),this.eventHandler.emitEvent(be.HANDLE_REDIRECT_END,o.event.correlationId,ge.Redirect),u)).catch(u=>{this.browserStorage.resetRequestCache(o.event.correlationId);const h=u;throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,o.event.correlationId,ge.Redirect,null,h),this.eventHandler.emitEvent(be.HANDLE_REDIRECT_END,o.event.correlationId,ge.Redirect),o.end({success:!1},h),u})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("0os66p",n);const r=this.performanceClient.startMeasurement(GX,n);r.add({scenarioId:e.scenarioId});const i=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=s=>{const o=typeof i=="function"?i(s):void 0;return r.add({navigateCallbackResult:o!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,o};try{J1(this.initialized,this.config),wN(this.config.auth.isMcp,e),this.browserStorage.setInteractionInProgress(!0,ws.SIGNIN),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Redirect,e);let s;if(this.platformAuthProvider&&this.canUsePlatformBroker(e)){const o=new Of(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n);s=Z(o.acquireTokenRedirect.bind(o),b4,this.logger,this.performanceClient,n)(e,r).catch(a=>{if(r.add({brokerErrorName:a.name,brokerErrorCode:a.errorCode}),a instanceof li&&ua(a))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(a instanceof vr)return this.logger.verbose("1ipyz4",n),this.createRedirectClient(n).acquireToken(e);throw a})}else s=this.createRedirectClient(n).acquireToken(e);return await s}catch(s){throw this.browserStorage.resetRequestCache(n),r.event.status===2?this.performanceClient.startMeasurement(iO,n).end({success:!1},s,e.account):r.end({success:!1},s,e.account),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Redirect,null,s),s}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(qX,n);r.add({scenarioId:e.scenarioId});try{this.logger.verbose("0ch87b",n),dd(this.initialized,r,this.config,e),this.browserStorage.setInteractionInProgress(!0,ws.SIGNIN,e.overrideInteractionInProgress,n)}catch(a){return Promise.reject(a)}const i=this.getAllAccounts();this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Popup,e);let s;const o=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?(r.add({isPlatformBrokerRequest:!0}),s=this.acquireTokenNative({...e,correlationId:n},$e.acquireTokenPopup).then(a=>(r.end({success:!0,isNativeBroker:!0},void 0,a.account),a)).catch(a=>{if(r.add({brokerErrorName:a.name,brokerErrorCode:a.errorCode}),a instanceof li&&ua(a))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,o);if(a instanceof vr)return this.logger.verbose("0yy5fw",n),this.createPopupClient(n).acquireToken(e,o);throw a})):s=this.createPopupClient(n).acquireToken(e,o),s.then(a=>{const l=i.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,n,ge.Popup,a),l&&this.eventHandler.emitEvent(be.LOGIN_SUCCESS,n,ge.Popup,a.account),r.end({success:!0,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length},void 0,a.account),this.verifySsoCapability(e,ge.Popup),a}).catch(a=>(this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Popup,null,a),r.end({success:!1},a,e.account),Promise.reject(a))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.navigatePopups||await this.preGeneratePkceCodes(n)})}trackStateChangeWithMeasurement(e){const n=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;n&&(e.type==="visibilitychange"?(this.logger.info("0yzimq",n.event.correlationId),n.increment({visibilityChangeCount:1})):e.type==="online"?(this.logger.info("1caf53",n.event.correlationId),n.increment({onlineStatusChangeCount:1})):e.type==="offline"&&(this.logger.info("0fdyk7",n.event.correlationId),n.increment({onlineStatusChangeCount:1})))}addStateChangeListeners(e){document.addEventListener("visibilitychange",e),window.addEventListener("online",e),window.addEventListener("offline",e)}removeStateChangeListeners(e){document.removeEventListener("visibilitychange",e),window.removeEventListener("online",e),window.removeEventListener("offline",e)}getCachedSsoCapable(){try{const e=window.localStorage.getItem(sC);if(e){const n=JSON.parse(e);if(n&&typeof n.ssoCapable=="boolean"&&n.expiresOn&&Date.now()<n.expiresOn)return n.ssoCapable}}catch{}}verifySsoCapability(e,n){if(!this.config.auth.verifySSO)return;const r=sC,i=24*60*60*1e3;if(this.getCachedSsoCapable()!==void 0){this.logger.verbose("13poou","");return}const o=Xs(),a=this.performanceClient.startMeasurement(tW,o);a.add({"ext.interactionType":n}),this.logger.verbose("0pbr0i",o),setTimeout(()=>{const l={...e,correlationId:o};this.createSilentIframeClient(o).verifySso(l).then(u=>{this.logger.verbose("1gd1iv",o);try{const h=JSON.stringify({ssoCapable:u,expiresOn:Date.now()+i});window.localStorage.setItem(r,h)}catch{this.logger.warning("18lmoj",o)}a.end({fromCache:!1,success:u},void 0)}).catch(u=>{this.logger.warning("05g83w",o);try{window.localStorage.removeItem(r)}catch{this.logger.warning("0nlf9q",o)}a.end({fromCache:!1,success:!1},u)})},0)}async ssoSilent(e){var o,a,l;const n=this.getRequestCorrelationId(e),r={...e,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(KX,n),(o=this.ssoSilentMeasurement)==null||o.add({scenarioId:e.scenarioId,ssoCapable:this.getCachedSsoCapable()}),dd(this.initialized,this.ssoSilentMeasurement,this.config,r),(a=this.ssoSilentMeasurement)==null||a.increment({visibilityChangeCount:0,onlineStatusChangeCount:0}),this.addStateChangeListeners(this.trackStateChangeWithMeasurement);const i=this.getAllAccounts();this.logger.verbose("0w1b45",n),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Silent,r);let s;return this.canUsePlatformBroker(r)?((l=this.ssoSilentMeasurement)==null||l.add({isPlatformBrokerRequest:!0}),s=this.acquireTokenNative(r,$e.ssoSilent).catch(c=>{var u;if((u=this.ssoSilentMeasurement)==null||u.add({brokerErrorName:c.name,brokerErrorCode:c.errorCode}),c instanceof li&&ua(c))return this.platformAuthProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw c})):s=this.createSilentIframeClient(r.correlationId).acquireToken(r),s.then(c=>{var h;const u=i.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,n,ge.Silent,c),u&&this.eventHandler.emitEvent(be.LOGIN_SUCCESS,n,ge.Silent,c.account),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:c.fromPlatformBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length},void 0,c.account),c}).catch(c=>{var u;throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Silent,null,c),(u=this.ssoSilentMeasurement)==null||u.end({success:!1},c,e.account),c}).finally(()=>{this.removeStateChangeListeners(this.trackStateChangeWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("0ch6ga",n);const r=this.performanceClient.startMeasurement(YX,n);dd(this.initialized,r,this.config,e),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw se(fX);if(e.code){const i=e.code;let s=this.hybridAuthCodeResponses.get(i);return s?(this.logger.verbose("0qgp28",n),r.discard()):(this.logger.verbose("06eh73",n),s=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(o=>(this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,n,ge.Silent,o),this.hybridAuthCodeResponses.delete(i),r.end({success:!0,accessTokenSize:o.accessToken.length,idTokenSize:o.idToken.length},void 0,o.account),o)).catch(o=>{throw this.hybridAuthCodeResponses.delete(i),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Silent,null,o),r.end({success:!1},o),o}),this.hybridAuthCodeResponses.set(i,s)),await s}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){r.add({isPlatformBrokerRequest:!0});const i=await this.acquireTokenNative({...e,correlationId:n},$e.acquireTokenByCode,e.nativeAccountId).catch(s=>{throw r.add({brokerErrorName:s.name,brokerErrorCode:s.errorCode}),s instanceof li&&ua(s)&&(this.platformAuthProvider=void 0),s});return r.end({success:!0},void 0,i.account),i}else throw se(pX);else throw se(dX)}catch(i){throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Silent,null,i),r.end({success:!1},i),i}}async acquireTokenByCodeAsync(e){var s;const n=this.getRequestCorrelationId(e);return this.logger.trace("10d9hy",n),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(A4,n),(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.increment({visibilityChangeCount:0,onlineStatusChangeCount:0}),this.addStateChangeListeners(this.trackStateChangeWithMeasurement),await this.createSilentAuthCodeClient(n).acquireToken(e).then(o=>{var a;return(a=this.acquireTokenByCodeAsyncMeasurement)==null||a.end({success:!0,fromCache:o.fromCache}),o}).catch(o=>{var a;throw(a=this.acquireTokenByCodeAsyncMeasurement)==null||a.end({success:!1},o),o}).finally(()=>{this.removeStateChangeListeners(this.trackStateChangeWithMeasurement)})}async acquireTokenFromCache(e,n){switch(n){case dn.Default:case dn.AccessToken:case dn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return Z(r.acquireToken.bind(r),g4,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(Es)}}async acquireTokenByRefreshToken(e,n){switch(n){case dn.Default:case dn.AccessTokenAndRefreshToken:case dn.RefreshToken:case dn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return Z(r.acquireToken.bind(r),y4,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(Es)}}async acquireTokenBySilentIframe(e){const n=this.createSilentIframeClient(e.correlationId);return Z(n.acquireToken.bind(n),m4,this.logger,this.performanceClient,e.correlationId)(e)}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return J1(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return Vk(this.initialized),this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment)return;const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){return dW(this.logger,this.browserStorage,this.isBrowserEnvironment,this.getRequestCorrelationId(),e)}getAccount(e){return fW(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}setActiveAccount(e){pW(e,this.browserStorage,this.getRequestCorrelationId())}getActiveAccount(){return gW(this.browserStorage,this.getRequestCorrelationId())}async hydrateCache(e,n){this.logger.verbose("16jycr",e.correlationId);const r=K5(e.account,e.cloudGraphHostName,e.msGraphHost);if(await this.browserStorage.setAccount(r,e.correlationId,Di(e.idTokenClaims),$e.hydrateCache),e.fromPlatformBroker){this.logger.verbose("1i5atf",e.correlationId);const i=Lg(e.account.homeAccountId,e.account.environment,e.idToken,this.config.auth.clientId,e.tenantId),s=Dg(e.account.homeAccountId,e.account.environment,e.accessToken,this.config.auth.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?pp(e.expiresOn):0,e.extExpiresOn?pp(e.extExpiresOn):0,gn,void 0,e.tokenType,void 0,n.sshKid);n.resource&&(s.resource=n.resource);const o=Di(e.idTokenClaims);await this.browserStorage.setIdTokenCredential(i,e.correlationId,o),await this.nativeInternalStorage.setAccessTokenCredential(s,e.correlationId,o)}else return this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r,i){const s=this.getRequestCorrelationId(e);if(this.logger.trace("0b9y3p",s),!this.platformAuthProvider)throw se(IN);const o=new Of(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,s);return Z(o.acquireToken.bind(o),Nk,this.logger,this.performanceClient,s)(e,i)}canUsePlatformBroker(e,n){const r=this.getRequestCorrelationId(e);if(this.logger.trace("1n9lbl",r),!this.platformAuthProvider)return this.logger.trace("0vnu11",r),!1;if(!Du(this.config,this.logger,r,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("0yoy1g",r),!1;if(e.prompt)switch(e.prompt){case yn.NONE:case yn.CONSENT:case yn.LOGIN:this.logger.trace("0vdv8e",r);break;default:return this.logger.trace("0pdzw6",r),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("16lbtk",r),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||(!e.loginHint&&!e.sid?this.getActiveAccount():null);return n&&n.nativeAccountId||""}createPopupClient(e){return new ZW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createRedirectClient(e){return new XW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentIframeClient(e){return new qW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.ssoSilent,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentCacheClient(e){return new WN(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentRefreshClient(e){return new GW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentAuthCodeClient(e){return new JW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.acquireTokenByCode,this.performanceClient,e,this.platformAuthProvider)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return zN(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}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?Xs():""}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("0lz9hf",n),this.acquireTokenRedirect({correlationId:n,...e||W1})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("0qw7v5",n),this.acquireTokenPopup({correlationId:n,...e||W1})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(HX,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId,ssoCapable:this.getCachedSsoCapable()}),dd(this.initialized,r,this.config,e),this.logger.verbose("0x1c4s",n);const i=e.account||this.getActiveAccount();if(!i)throw se(oX);return this.acquireTokenSilentDeduped(e,i,n).then(s=>(r.end({success:!0,fromCache:s.fromCache,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length},void 0,s.account),{...s,state:e.state,correlationId:n})).catch(s=>{throw s instanceof He&&s.setCorrelationId(n),r.end({success:!1},s,i),s})}async acquireTokenSilentDeduped(e,n,r){const i=Bg(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},n.homeAccountId),s=JSON.stringify(i),o=this.activeSilentTokenRequests.get(s);if(typeof o>"u"){this.logger.verbose("0fcjbk",r),this.performanceClient.addFields({deduped:!1},r);const a=Z(this.acquireTokenSilentAsync.bind(this),d4,this.logger,this.performanceClient,r)({...e,correlationId:r},n);return this.activeSilentTokenRequests.set(s,a),a.finally(()=>{this.activeSilentTokenRequests.delete(s)})}else return this.logger.verbose("1yq7nb",r),this.performanceClient.addFields({deduped:!0},r),o}async acquireTokenSilentAsync(e,n){const r=a=>this.trackStateChange(e.correlationId,a);this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,e.correlationId,ge.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0,onlineStatusChangeCount:0},e.correlationId),this.addStateChangeListeners(r);const i=await Z(yW,S4,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||dn.Default;return this.acquireTokenSilentNoIframe(i,s).catch(async a=>{if(tV(a,s)){const c=`${a.errorCode}${a.subError?`|${a.subError}`:""}`;if(this.performanceClient.addFields({silentRefreshReason:c},e.correlationId),this.activeIframeRequest)if(s!==dn.Skip){const[u,h]=this.activeIframeRequest;this.logger.verbose("1w8fso",i.correlationId);const d=this.performanceClient.startMeasurement(O4,i.correlationId);d.add({awaitIframeCorrelationId:h});const f=await u;if(d.end({success:f}),f)return this.logger.verbose("0ywzzi",i.correlationId),this.acquireTokenSilentNoIframe(i,s);throw this.logger.info("17y14q",i.correlationId),a}else return this.logger.warning("1bd4p8",i.correlationId),Z(this.acquireTokenBySilentIframe.bind(this),z1,this.logger,this.performanceClient,i.correlationId)(i);else{let u;return this.activeIframeRequest=[new Promise(h=>{u=h}),i.correlationId],this.logger.verbose("0rh08z",i.correlationId),Z(this.acquireTokenBySilentIframe.bind(this),z1,this.logger,this.performanceClient,i.correlationId)(i).then(h=>(u(!0),h)).catch(h=>{throw u(!1),h}).finally(()=>{this.activeIframeRequest=void 0})}}else throw a}).then(a=>(this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,e.correlationId,ge.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromPlatformBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,e.correlationId,ge.Silent,null,a),a}).finally(()=>{this.removeStateChangeListeners(r)})}async acquireTokenSilentNoIframe(e,n){return Du(this.config,this.logger,e.correlationId,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("0sczo4",e.correlationId),this.performanceClient.addFields({isPlatformBrokerRequest:!0},e.correlationId),this.acquireTokenNative(e,$e.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async r=>{throw this.performanceClient.addFields({brokerErrorName:r.name,brokerErrorCode:r.errorCode},e.correlationId),r instanceof li&&ua(r)?(this.logger.verbose("07rkmb",e.correlationId),this.platformAuthProvider=void 0,Y(Es)):r})):(this.logger.verbose("0ox81t",e.correlationId),n===dn.AccessToken&&this.logger.verbose("0fvwxe",e.correlationId),Z(this.acquireTokenFromCache.bind(this),u4,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===dn.AccessToken)throw r;return this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_NETWORK_START,e.correlationId,ge.Silent,e),Z(this.acquireTokenByRefreshToken.bind(this),h4,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("1x6uj6",e),this.pkceCode=await Z(Uo,Bo,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,n?this.logger.verbose("12js1o",e):this.logger.verbose("1oe9ci",e),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e,n){const r=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("1qtz3l",n),window.msal.clientIds.push(r),eV(r,e,this.logger,n)}}function tV(t,e){const n=!(t instanceof vr&&t.subError!==_k),r=t.errorCode===hr.INVALID_GRANT_ERROR||t.errorCode===Es,i=n&&r||t.errorCode===Tb||t.errorCode===cN,s=V4.includes(e);return i&&s}/*! @azure/msal-browser v5.10.0 2026-05-07 */class iv{static loggerCallback(e,n){switch(e){case at.Error:console.error(n);return;case at.Info:console.info(n);return;case at.Verbose:console.debug(n);return;case at.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var l;this.browserEnvironment=typeof window<"u",this.config=BW(e,this.browserEnvironment);let n;try{n=window[Ur.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(nW),i=(l=n==null?void 0:n.getItem(rW))==null?void 0:l.toLowerCase(),s=i==="true"?!0:i==="false"?!1:void 0,o={...this.config.system.loggerOptions},a=r&&Object.keys(at).includes(r)?at[r]:void 0;a&&(o.loggerCallback=iv.loggerCallback,o.logLevel=a),s!==void 0&&(o.piiLoggingEnabled=s),this.logger=new ki(o,uW,jo),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class ml extends iv{getModuleName(){return ml.MODULE_NAME}getId(){return ml.ID}async initialize(e){return this.available=typeof window<"u",this.available}}ml.MODULE_NAME="";ml.ID="StandardOperatingContext";/*! @azure/msal-browser v5.10.0 2026-05-07 */class nV{constructor(e,n){this.controller=n||new rv(new ml(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,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}getAccount(e){return this.controller.getAccount(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)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}const rV=["openid","profile","email"];let sO=null,ji=null,wc=null,qa=null;function iV(t){return`https://login.microsoftonline.com/${t}`}function Qb(t){return{scopes:rV,...t?{account:t}:{},redirectStartPage:window.location.href}}function sv(){if(!ji)throw new Error("MSAL has not been initialized");return ji}function Xl(t){return t.getActiveAccount()??t.getAllAccounts()[0]??null}function sV(t){const e=t.idToken||t.accessToken;if(!e)throw new Error("Microsoft login succeeded but did not return a usable token");return e}function hC(t,...e){for(const n of e){const r=t[n];if(typeof r=="string"&&r.trim().length>0)return r}return null}async function oV(t){const e=`${t.entraTenantId}:${t.entraClientId}`;if(wc&&sO===e){await wc;return}sO=e;const n=new nV({auth:{clientId:t.entraClientId,authority:iV(t.entraTenantId),redirectUri:window.location.origin,postLogoutRedirectUri:window.location.origin},cache:{cacheLocation:"sessionStorage"}});ji=n,wc=(async()=>{await n.initialize();const r=await n.handleRedirectPromise();qa=r;const i=(r==null?void 0:r.account)??Xl(n);i&&n.setActiveAccount(i)})().catch(r=>{throw ji===n&&(ji=null),sO=null,wc=null,r}),await wc}async function GN(){const t=sv(),e=Xl(t);await t.loginRedirect({...Qb(e??void 0),...e?{}:{prompt:"select_account"}})}async function aV(){const t=sv(),e=Xl(t);if(!e)throw await GN(),new Error("Authentication redirect started");try{const n=await t.acquireTokenSilent({...Qb(e),account:e});return qa=n,n.account&&t.setActiveAccount(n.account),sV(n)}catch(n){throw n instanceof vr?(await t.acquireTokenRedirect({...Qb(e),account:e}),new Error("Authentication redirect started")):n}}function dC(){return ji?Xl(ji)!==null:!1}function fC(){if(!ji)return null;const t=Xl(ji);if(!t)return null;const e=t.idTokenClaims??(qa==null?void 0:qa.idTokenClaims)??{},n=hC(e,"preferred_username","email","upn")??t.username;return{name:hC(e,"name")??t.name??n,email:n}}async function lV(){const t=sv(),e=Xl(t);qa=null,await t.logoutRedirect({account:e??void 0,postLogoutRedirectUri:window.location.origin})}var pC;function F(t,e,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,l);const c=o.prototype,u=Object.keys(c);for(let h=0;h<u.length;h++){const d=u[h];d in a||(a[d]=c[d].bind(a))}}const i=(n==null?void 0:n.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:t});function o(a){var l;const c=n!=null&&n.Parent?new s:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>{var l,c;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(c=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:c.has(t)}}),Object.defineProperty(o,"name",{value:t}),o}class Ga extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class KN extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(pC=globalThis).__zod_globalConfig??(pC.__zod_globalConfig={});const ov=globalThis.__zod_globalConfig;function Yi(t){return ov}function JN(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,i])=>e.indexOf(+r)===-1).map(([r,i])=>i)}function Lb(t,e){return typeof e=="bigint"?e.toString():e}function Hg(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function av(t){return t==null}function lv(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function cV(t,e){const n=t/e,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const gC=Symbol("evaluating");function je(t,e,n){let r;Object.defineProperty(t,e,{get(){if(r!==gC)return r===void 0&&(r=gC,r=n()),r},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function Ko(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ro(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function mC(t){return JSON.stringify(t)}function uV(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const e$="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function zu(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const hV=Hg(()=>{var t;if(ov.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ol(t){if(zu(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(zu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function t$(t){return Ol(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const dV=new Set(["string","number","symbol"]);function yl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function io(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n!=null&&n.parent)&&(r._zod.parent=t),r}function fe(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function fV(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const pV={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function gV(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=ro(t._zod.def,{get shape(){const o={};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=n.shape[a])}return Ko(this,"shape",o),o},checks:[]});return io(t,s)}function mV(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=ro(t._zod.def,{get shape(){const o={...t._zod.def.shape};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a]}return Ko(this,"shape",o),o},checks:[]});return io(t,s)}function OV(t,e){if(!Ol(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const s=t._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=ro(t._zod.def,{get shape(){const s={...t._zod.def.shape,...e};return Ko(this,"shape",s),s}});return io(t,i)}function yV(t,e){if(!Ol(e))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ro(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Ko(this,"shape",r),r}});return io(t,n)}function bV(t,e){var r;if((r=t._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=ro(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return Ko(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return io(t,n)}function wV(t,e,n){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=ro(e._zod.def,{get shape(){const a=e._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=t?new t({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=t?new t({type:"optional",innerType:a[c]}):a[c];return Ko(this,"shape",l),l},checks:[]});return io(e,o)}function SV(t,e,n){const r=ro(e._zod.def,{get shape(){const i=e._zod.def.shape,s={...i};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new t({type:"nonoptional",innerType:i[o]});return Ko(this,"shape",s),s}});return io(e,r)}function Ra(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function kV(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Na(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function fd(t){return typeof t=="string"?t:t==null?void 0:t.message}function qi(t,e,n){var l,c,u,h,d,f;const r=t.message?t.message:fd((u=(c=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:c.error)==null?void 0:u.call(c,t))??fd((h=e==null?void 0:e.error)==null?void 0:h.call(e,t))??fd((d=n.customError)==null?void 0:d.call(n,t))??fd((f=n.localeError)==null?void 0:f.call(n,t))??"Invalid input",{inst:i,continue:s,input:o,...a}=t;return a.path??(a.path=[]),a.message=r,e!=null&&e.reportInput&&(a.input=o),a}function cv(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Bu(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}const n$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Lb,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},r$=F("$ZodError",n$),i$=F("$ZodError",n$,{Parent:Error});function vV(t,e=n=>n.message){const n={},r=[];for(const i of t.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}function xV(t,e=n=>n.message){const n={_errors:[]},r=(i,s=[])=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a},[...s,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...s,...o.path]);else{const a=[...s,...o.path];if(a.length===0)n._errors.push(e(o));else{let l=n,c=0;for(;c<a.length;){const u=a[c];c===a.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(e(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}}};return r(t),n}const uv=t=>(e,n,r,i)=>{const s=r?{...r,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Ga;if(o.issues.length){const a=new((i==null?void 0:i.Err)??t)(o.issues.map(l=>qi(l,s,Yi())));throw e$(a,i==null?void 0:i.callee),a}return o.value},hv=t=>async(e,n,r,i)=>{const s=r?{...r,async:!0}:{async:!0};let o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new((i==null?void 0:i.Err)??t)(o.issues.map(l=>qi(l,s,Yi())));throw e$(a,i==null?void 0:i.callee),a}return o.value},Yg=t=>(e,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Ga;return s.issues.length?{success:!1,error:new(t??r$)(s.issues.map(o=>qi(o,i,Yi())))}:{success:!0,data:s.value}},CV=Yg(i$),qg=t=>async(e,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=e._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(o=>qi(o,i,Yi())))}:{success:!0,data:s.value}},EV=qg(i$),_V=t=>(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return uv(t)(e,n,i)},TV=t=>(e,n,r)=>uv(t)(e,n,r),AV=t=>async(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return hv(t)(e,n,i)},PV=t=>async(e,n,r)=>hv(t)(e,n,r),IV=t=>(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Yg(t)(e,n,i)},RV=t=>(e,n,r)=>Yg(t)(e,n,r),NV=t=>async(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return qg(t)(e,n,i)},$V=t=>async(e,n,r)=>qg(t)(e,n,r),MV=/^[cC][0-9a-z]{6,}$/,QV=/^[0-9a-z]+$/,LV=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,DV=/^[0-9a-vA-V]{20}$/,zV=/^[A-Za-z0-9]{27}$/,BV=/^[a-zA-Z0-9_-]{21}$/,jV=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UV=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,OC=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ZV=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,FV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function XV(){return new RegExp(FV,"u")}const WV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VV=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,HV=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YV=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qV=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s$=/^[A-Za-z0-9_-]*$/,GV=/^https?$/,KV=/^\+[1-9]\d{6,14}$/,o$="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",JV=new RegExp(`^${o$}$`);function a$(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eH(t){return new RegExp(`^${a$(t)}$`)}function tH(t){const e=a$({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${o$}T(?:${r})$`)}const nH=t=>{const e=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},rH=/^-?\d+$/,l$=/^-?\d+(?:\.\d+)?$/,iH=/^(?:true|false)$/i,sH=/^null$/i,oH=/^[^A-Z]*$/,aH=/^[^a-z]*$/,jn=F("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),c$={number:"number",bigint:"bigint",object:"date"},u$=F("$ZodCheckLessThan",(t,e)=>{jn.init(t,e);const n=c$[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),h$=F("$ZodCheckGreaterThan",(t,e)=>{jn.init(t,e);const n=c$[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),lH=F("$ZodCheckMultipleOf",(t,e)=>{jn.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):cV(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),cH=F("$ZodCheckNumberFormat",(t,e)=>{var o;jn.init(t,e),e.format=e.format||"float64";const n=(o=e.format)==null?void 0:o.includes("int"),r=n?"int":"number",[i,s]=pV[e.format];t._zod.onattach.push(a=>{const l=a._zod.bag;l.format=e.format,l.minimum=i,l.maximum=s,n&&(l.pattern=rH)}),t._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}l<i&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),l>s&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),uH=F("$ZodCheckMaxLength",(t,e)=>{var n;jn.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!av(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const o=cv(i);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),hH=F("$ZodCheckMinLength",(t,e)=>{var n;jn.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!av(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const o=cv(i);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),dH=F("$ZodCheckLengthEquals",(t,e)=>{var n;jn.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!av(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{const i=r.value,s=i.length;if(s===e.length)return;const o=cv(i),a=s>e.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Gg=F("$ZodCheckStringFormat",(t,e)=>{var n,r;jn.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),fH=F("$ZodCheckRegex",(t,e)=>{Gg.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),pH=F("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=oH),Gg.init(t,e)}),gH=F("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=aH),Gg.init(t,e)}),mH=F("$ZodCheckIncludes",(t,e)=>{jn.init(t,e);const n=yl(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),OH=F("$ZodCheckStartsWith",(t,e)=>{jn.init(t,e);const n=new RegExp(`^${yl(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),yH=F("$ZodCheckEndsWith",(t,e)=>{jn.init(t,e);const n=new RegExp(`.*${yl(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),bH=F("$ZodCheckOverwrite",(t,e)=>{jn.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class wH{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
71
|
+
_(cancelled)_`}:o.type==="thinking"?{...o,active:!1}:o)}:s)}}}),clearMessages:n=>t(r=>({messagesBySession:{...r.messagesBySession,[n]:[]}})),dropInterruptedBubble:n=>t(r=>{const i=r.messagesBySession[n]??[];let s=-1;for(let o=i.length-1;o>=0;o--){const a=i[o];if(a.role==="assistant"&&a.pending){s=o;break}}return s===-1?r:{messagesBySession:{...r.messagesBySession,[n]:i.filter((o,a)=>a!==s)}}}),seedMessages:(n,r)=>t(i=>{const s=i.messagesBySession[r];if(s&&s.some(c=>c.role==="user"))return i;const o=n.map(c=>{const u=c.id!==void 0?String(c.id):sd(),h=c.ts?new Date(c.ts).getTime():Date.now(),d=c.turnId??c.turn_id??void 0;return c.role==="user"?{role:"user",id:u,content:c.content,ts:h,turnId:d}:{role:"assistant",id:u,content:c.content,ts:h,pending:!1,activities:[],parts:EZ(c.content,[]),turnId:d,agentSlug:c.agentSlug,agentDisplayName:c.agentDisplayName}}),a=new Set(o.map(c=>c.turnId).filter(c=>!!c)),l=(s??[]).filter(c=>c.role==="assistant"&&c.pending===!0&&(!c.turnId||!a.has(c.turnId)));return{messagesBySession:{...i.messagesBySession,[r]:[...o,...l]}}}),applyActivity:(n,r,i)=>t(s=>{const o=s.messagesBySession[i]??[];return{messagesBySession:{...s.messagesBySession,[i]:o.map(a=>a.id!==n||a.role!=="assistant"?a:{...a,activities:TZ(a.activities,r),parts:AZ(a.parts,r)})}}}),tagUserMessageTurnId:(n,r,i)=>t(s=>{const o=s.messagesBySession[i]??[];return{messagesBySession:{...s.messagesBySession,[i]:o.map(a=>a.id===n&&a.role==="user"?{...a,turnId:r}:a)}}}),applyTurnEvent:(n,r,i)=>t(s=>{const o=s.messagesBySession[i]??[];switch(r.type){case"turn:started":{if(o.some(l=>l.role==="assistant"&&l.turnId===n))return{messagesBySession:s.messagesBySession};const a=sd();return{messagesBySession:{...s.messagesBySession,[i]:[...o,{role:"assistant",id:a,content:"",ts:r._ts??Date.now(),pending:!0,activities:[],parts:[],turnId:n,agentSlug:r.agentSlug,agentDisplayName:r.agentDisplayName}]}}}case"turn:delta":{const a=r.part;return{messagesBySession:{...s.messagesBySession,[i]:o.map(l=>{if(l.role!=="assistant"||l.turnId!==n||!l.pending||r._seq!==void 0&&l.lastAppliedSeq!==void 0&&r._seq<=l.lastAppliedSeq)return l;let c;if(a.type==="text"){const h=l.parts.findIndex(d=>d.type==="text");h===-1?c=[...l.parts,{type:"text",text:a.text}]:c=l.parts.map((d,f)=>f===h?{type:"text",text:d.text+a.text}:d)}else c=PZ(l.parts,a);const u=c.find(h=>h.type==="text");return{...l,content:(u==null?void 0:u.text)??l.content,parts:c,lastAppliedSeq:r._seq??l.lastAppliedSeq}})}}}case"turn:queued":return{messagesBySession:{...s.messagesBySession,[i]:o.map(a=>a.role==="user"&&a.turnId===n?{...a,deliveryStatus:"queued-backend",queuePosition:r.position}:a)}};case"turn:interrupted":return{messagesBySession:{...s.messagesBySession,[i]:o.filter(a=>!(a.role==="assistant"&&a.turnId===n&&a.pending))}};case"turn:complete":{const a=l1(o,n);return{messagesBySession:{...s.messagesBySession,[i]:o.map((l,c)=>{if(c!==a||l.role!=="assistant")return l;let u=!1;const h=l.parts.map(f=>f.type==="text"?(u=!0,{...f,text:r.finalMessage}):f.type==="thinking"?{...f,active:!1}:f);!u&&r.finalMessage&&h.push({type:"text",text:r.finalMessage});const d=l.activities.map(f=>f.kind==="thinking"?{...f,active:!1}:f);return{...l,content:r.finalMessage,pending:!1,activities:d,parts:h}})}}}case"turn:error":{const a=l1(o,n);return{messagesBySession:{...s.messagesBySession,[i]:o.map((l,c)=>{if(c!==a||l.role!=="assistant")return l;const u=`**Error:** ${r.error}`,h=l.parts.findIndex(f=>f.type==="text"),d=h===-1?[...l.parts,{type:"text",text:u}]:l.parts.map((f,p)=>p===h?{type:"text",text:u}:f);return{...l,content:u,pending:!1,parts:d}})}}}default:return s}}),currentModel:null,setCurrentModel:n=>t({currentModel:n})}));/*! @azure/msal-common v16.6.0 2026-05-07 */const IZ="msal.js.common",wR="https://login.microsoftonline.com/common/",RZ="login.microsoftonline.com",SR="common",NZ="adfs",$Z="dstsv2",MZ=`${wR}discovery/instance?api-version=1.1&authorization_endpoint=`,c1=".ciamlogin.com",QZ=".onmicrosoft.com",bb="|",kR="openid",vR="profile",nk="offline_access",LZ="email",rk="S256",DZ="application/x-www-form-urlencoded;charset=utf-8",Oc="Not Available",wb="/",u1="http://169.254.169.254/metadata/instance/compute/location",zZ="2020-06-01",BZ=2e3,jZ="TryAutoDetect",UZ="login.microsoft.com",ZZ=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],h1=240,FZ="invalid_instance",d1=200,XZ=400,f1=400,WZ=499,VZ=500,HZ=599,Za={GET:"GET",POST:"POST"},jl=[kR,vR,nk],p1=[...jl,LZ],On={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},g1={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},zs={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},od={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},yn={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",NO_SESSION:"no_session"},ik={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},sk={QUERY:"query",FRAGMENT:"fragment"},xR={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},YZ="MSSTS",qZ="ADFS",CR="Generic",ER="-",Sb=".",Ut={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},ok="appmetadata",GZ="client_info",op="1",kb="authority-metadata",KZ=3600*24,Pr={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},m1=5,JZ=330,eF=50,_R="server-telemetry",O1="|",oa=",",tF="1",nF="0",rF="unknown_error",Be={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},iF=60,sF=3600,TR="throttling",oF="retry-after, h429",aF="invalid_grant",lF="client_mismatch",aa={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Gm={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},hs={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},cF={Pop:"pop"},AR=300;/*! @azure/msal-common v16.6.0 2026-05-07 */const Lo="client_id",PR="redirect_uri",uF="response_type",hF="response_mode",dF="grant_type",fF="claims",pF="scope",gF="refresh_token",mF="state",OF="nonce",yF="prompt",bF="code",wF="code_challenge",SF="code_challenge_method",kF="code_verifier",vF="client-request-id",xF="x-client-SKU",CF="x-client-VER",EF="x-client-OS",_F="x-client-CPU",TF="x-client-current-telemetry",AF="x-client-last-telemetry",PF="x-ms-lib-capability",IF="x-app-name",RF="x-app-ver",NF="post_logout_redirect_uri",$F="id_token_hint",MF="client_secret",QF="client_assertion",LF="client_assertion_type",IR="token_type",RR="req_cnf",y1="return_spa_code",DF="nativebroker",zF="logout_hint",BF="sid",jF="login_hint",UF="domain_hint",ZF="x-client-xtra-sku",Iu="brk_client_id",ap="brk_redirect_uri",vb="instance_aware",FF="ear_jwk",XF="ear_jwe_crypto",WF="resource",VF="clidata";/*! @azure/msal-common v16.6.0 2026-05-07 */function ak(t){return`See https://aka.ms/msal.js.errors#${t} for details`}class He extends Error{constructor(e,n,r){const i=n||(e?ak(e):""),s=i?`${e}: ${i}`:e;super(s),Object.setPrototypeOf(this,He.prototype),this.errorCode=e||"",this.errorMessage=i||"",this.subError=r||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function xb(t,e){return new He(t,e||ak(t))}/*! @azure/msal-common v16.6.0 2026-05-07 */class lk extends He{constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,lk.prototype)}}function et(t){return new lk(t)}/*! @azure/msal-common v16.6.0 2026-05-07 */class jr{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},r=e.split("&"),i=s=>decodeURIComponent(s.replace(/\+/g," "));return r.forEach(s=>{if(s.trim()){const[o,a]=s.split(/=(.+)/g,2);o&&a&&(n[i(o)]=i(a))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}}/*! @azure/msal-common v16.6.0 2026-05-07 */class ck extends He{constructor(e,n){super(e,n),this.name="ClientAuthError",Object.setPrototypeOf(this,ck.prototype)}}function Y(t,e){return new ck(t,e)}/*! @azure/msal-common v16.6.0 2026-05-07 */const HF="redirect_uri_empty",YF="authority_uri_insecure",ad="url_parse_error",qF="empty_url_error",GF="empty_input_scopes_error",NR="invalid_claims",KF="token_request_empty",JF="logout_request_empty",$R="pkce_params_missing",MR="invalid_cloud_discovery_metadata",e5="invalid_authority_metadata",t5="untrusted_authority",uk="missing_ssh_jwk",n5="missing_ssh_kid",r5="cannot_set_OIDCOptions",i5="cannot_allow_platform_broker",s5="authority_mismatch",o5="invalid_request_method_for_EAR";/*! @azure/msal-common v16.6.0 2026-05-07 */const QR="client_info_decoding_error",a5="client_info_empty_error",LR="token_parsing_error",l5="null_or_empty_token",ds="endpoints_resolution_error",c5="network_error",u5="openid_config_error",h5="hash_not_deserialized",Ru="invalid_state",d5="state_mismatch",b1="state_not_found",f5="nonce_mismatch",DR="auth_time_not_found",p5="max_age_transpired",g5="multiple_matching_appMetadata",m5="request_cannot_be_made",O5="cannot_remove_empty_scope",y5="cannot_append_scopeset",w1="empty_input_scopeset",zR="no_account_in_silent_request",b5="invalid_cache_record",BR="invalid_cache_environment",S1="no_account_found",jR="no_crypto_object",Es="token_refresh_required",w5="token_claims_cnf_required_for_signedjwt",S5="authorization_code_missing_from_server_response",k5="binding_key_not_removed",v5="end_session_endpoint_not_supported",UR="key_id_missing",Ce="method_not_implemented",x5="resource_parameter_required",C5="misplaced_resource_parameter";/*! @azure/msal-common v16.6.0 2026-05-07 */class rn{constructor(e){const n=e?jr.trimArrayEntries([...e]):[],r=n?jr.removeEmptyStringsFromArray(n):[];if(!r||!r.length)throw et(GF);this.scopes=new Set,r.forEach(i=>this.scopes.add(i))}static fromString(e){const r=(e||"").split(" ");return new rn(r)}static createSearchScopes(e){const n=e&&e.length>0?e:[...jl],r=new rn(n);return r.containsOnlyOIDCScopes()?r.removeScope(nk):r.removeOIDCScopes(),r}containsScope(e){const n=this.printScopesLowerCase().split(" "),r=new rn(n);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return p1.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw Y(y5)}}removeScope(e){if(!e)throw Y(O5);this.scopes.delete(e.trim())}removeOIDCScopes(){p1.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Y(w1);const n=new Set;return e.scopes.forEach(r=>n.add(r.toLowerCase())),this.scopes.forEach(r=>n.add(r.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw Y(w1);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),r=e.getScopeCount(),i=this.getScopeCount();return n.size<i+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(n=>e.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v16.6.0 2026-05-07 */function $g(t,e,n){if(!e)return;const r=t.get(Lo);r&&t.has(Iu)&&(n==null||n.addFields({embeddedClientId:r,embeddedRedirectUri:t.get(PR)},e))}function hk(t,e){t.set(uF,e)}function E5(t,e){t.set(hF,e||sk.QUERY)}function _5(t){t.set(DF,"1")}function dk(t,e,n=!0,r=jl){n&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const i=n?[...e||[],...r]:e||[],s=new rn(i);t.set(pF,s.printScopes())}function fk(t,e){t.set(Lo,e)}function pk(t,e){t.set(PR,e)}function T5(t,e){t.set(NF,e)}function A5(t,e){t.set($F,e)}function P5(t,e){t.set(UF,e)}function ld(t,e){t.set(jF,e)}function lp(t,e){t.set(On.CCS_HEADER,`UPN:${e}`)}function Gc(t,e){t.set(On.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function k1(t,e){t.set(BF,e)}function gk(t,e,n,r){const i=r&&t.has(Iu)?void 0:n;if(!jr.isEmptyObj(e)||i&&i.length>0){const s=YR(e,i);try{JSON.parse(s)}catch{throw et(NR)}t.set(fF,s)}}function bh(t,e){t.set(vF,e)}function mk(t,e){t.set(xF,e.sku),t.set(CF,e.version),e.os&&t.set(EF,e.os),e.cpu&&t.set(_F,e.cpu)}function Ok(t,e){e!=null&&e.appName&&t.set(IF,e.appName),e!=null&&e.appVersion&&t.set(RF,e.appVersion)}function I5(t,e){t.set(yF,e)}function ZR(t,e){e&&t.set(mF,e)}function R5(t,e){t.set(OF,e)}function yk(t,e,n){if(e&&n)t.set(wF,e),t.set(SF,n);else throw et($R)}function N5(t,e){t.set(bF,e)}function $5(t,e){t.set(gF,e)}function M5(t,e){t.set(kF,e)}function FR(t,e){t.set(MF,e)}function XR(t,e){e&&t.set(QF,e)}function WR(t,e){e&&t.set(LF,e)}function VR(t,e){t.set(dF,e)}function bk(t){t.set(GZ,"1")}function Q5(t){t.set(VF,"1")}function HR(t){t.has(vb)||t.set(vb,"true")}function bi(t,e){Object.entries(e).forEach(([n,r])=>{!t.has(n)&&r&&t.set(n,r)})}function YR(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw et(NR)}return e&&e.length>0&&(n.hasOwnProperty(od.ACCESS_TOKEN)||(n[od.ACCESS_TOKEN]={}),n[od.ACCESS_TOKEN][od.XMS_CC]={values:e}),JSON.stringify(n)}function wk(t,e){e&&(t.set(IR,Be.POP),t.set(RR,e))}function qR(t,e){e&&(t.set(IR,Be.SSH),t.set(RR,e))}function GR(t,e){t.set(TF,e.generateCurrentRequestHeaderValue()),t.set(AF,e.generateLastRequestHeaderValue())}function KR(t){t.set(PF,oF)}function L5(t,e){t.set(zF,e)}function Mg(t,e,n){t.has(Iu)||t.set(Iu,e),t.has(ap)||t.set(ap,n)}function D5(t,e){t.set(FF,encodeURIComponent(e)),t.set(XF,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function JR(t,e){e&&t.set(WF,e)}/*! @azure/msal-common v16.6.0 2026-05-07 */function v1(t){if(!t)return t;let e=t.toLowerCase();return jr.endsWith(e,"?")?e=e.slice(0,-1):jr.endsWith(e,"?/")&&(e=e.slice(0,-2)),jr.endsWith(e,"/")||(e+="/"),e}function eN(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function cp(t){if(!t||t.indexOf("=")<0)return null;try{const e=eN(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw Y(h5)}return null}function Nu(t){const e=new Array;return t.forEach((n,r)=>{e.push(`${r}=${encodeURIComponent(n)}`)}),e.join("&")}function x1(t){if(!t)return t;const e=t.split("#")[0];try{const n=new URL(e),r=n.origin+n.pathname+n.search;return v1(r)}catch{return v1(e)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const up={createNewGuid:()=>{throw Y(Ce)},base64Decode:()=>{throw Y(Ce)},base64Encode:()=>{throw Y(Ce)},base64UrlEncode:()=>{throw Y(Ce)},encodeKid:()=>{throw Y(Ce)},async getPublicKeyThumbprint(){throw Y(Ce)},async removeTokenBindingKey(){throw Y(Ce)},async clearKeystore(){throw Y(Ce)},async signJwt(){throw Y(Ce)},async hashString(){throw Y(Ce)}};/*! @azure/msal-common v16.6.0 2026-05-07 */var at;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(at||(at={}));const z5=50,B5=500,po=new Map;function j5(t,e){po.delete(t),po.set(t,e)}function U5(t,e){const n=Date.now();let r=po.get(t);if(r)j5(t,r);else if(r={logs:[],firstEventTime:n},po.set(t,r),po.size>z5){const i=po.keys().next().value;i&&po.delete(i)}r.logs.push({...e,milliseconds:n-r.firstEventTime}),r.logs.length>B5&&r.logs.shift()}function Z5(t){if(t.length!==6)return!1;for(let e=0;e<t.length;e++){const n=t[e];if(!(n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"))return!1}return!0}class ki{constructor(e,n,r){this.level=at.Info;const i=()=>{},s=e||ki.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||i,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:at.Info,this.packageName=n||"",this.packageVersion=r||""}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:at.Info}}clone(e,n){return new ki({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,n)}logMessage(e,n){const r=n.correlationId;if(Z5(e)){const l={hash:e,level:n.logLevel,containsPii:n.containsPii||!1,milliseconds:0};U5(r,l)}if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const a=`${`[${new Date().toUTCString()}] : [${r}]`} : ${this.packageName}@${this.packageVersion} : ${at[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,a,n.containsPii||!1)}executeCallback(e,n,r){this.localCallback&&this.localCallback(e,n,r)}error(e,n){this.logMessage(e,{logLevel:at.Error,containsPii:!1,correlationId:n})}errorPii(e,n){this.logMessage(e,{logLevel:at.Error,containsPii:!0,correlationId:n})}warning(e,n){this.logMessage(e,{logLevel:at.Warning,containsPii:!1,correlationId:n})}warningPii(e,n){this.logMessage(e,{logLevel:at.Warning,containsPii:!0,correlationId:n})}info(e,n){this.logMessage(e,{logLevel:at.Info,containsPii:!1,correlationId:n})}infoPii(e,n){this.logMessage(e,{logLevel:at.Info,containsPii:!0,correlationId:n})}verbose(e,n){this.logMessage(e,{logLevel:at.Verbose,containsPii:!1,correlationId:n})}verbosePii(e,n){this.logMessage(e,{logLevel:at.Verbose,containsPii:!0,correlationId:n})}trace(e,n){this.logMessage(e,{logLevel:at.Trace,containsPii:!1,correlationId:n})}tracePii(e,n){this.logMessage(e,{logLevel:at.Trace,containsPii:!0,correlationId:n})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v16.6.0 2026-05-07 */const Qg="@azure/msal-common",wh="16.6.0";/*! @azure/msal-common v16.6.0 2026-05-07 */const Sk={None:"none"};/*! @azure/msal-common v16.6.0 2026-05-07 */function C1(t,e){return!!t&&!!e&&t===e.split(".")[1]}function Ul(t,e,n,r){if(r){const{oid:i,sub:s,tid:o,name:a,tfp:l,acr:c,preferred_username:u,upn:h,login_hint:d}=r,f=o||l||c||"";return{tenantId:f,localAccountId:i||s||"",name:a,username:u||h||"",loginHint:d,isHomeTenant:C1(f,t),upn:h}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:C1(n,t)}}function hp(t,e,n,r){let i=t;if(e){const{isHomeTenant:s,...o}=e;i={...t,...o}}if(n){const{isHomeTenant:s,...o}=Ul(t.homeAccountId,t.localAccountId,t.tenantId,n);return i={...i,...o,idTokenClaims:n,idToken:r},i}return i}/*! @azure/msal-common v16.6.0 2026-05-07 */function di(t,e){const n=F5(t);try{const r=e(n);return JSON.parse(r)}catch{throw Y(LR)}}function Di(t){if(!t.signin_state)return!1;const e=["kmsi","dvc_dmjd"];return t.signin_state.some(n=>e.includes(n.trim().toLowerCase()))}function F5(t){if(!t)throw Y(l5);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw Y(LR);return n[2]}function tN(t,e){if(e===0||Date.now()-3e5>t+e)throw Y(p5)}/*! @azure/msal-common v16.6.0 2026-05-07 */class Le{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw et(qF);e.includes("#")||(this._urlString=Le.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return jr.endsWith(n,"?")?n=n.slice(0,-1):jr.endsWith(n,"?/")&&(n=n.slice(0,-2)),jr.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw et(ad)}if(!e.HostNameAndPort||!e.PathSegments)throw et(ad);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw et(YF)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return Le.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),r=n.PathSegments;return e&&r.length!==0&&(r[0]===zs.COMMON||r[0]===zs.ORGANIZATIONS)&&(r[0]=e),Le.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw et(ad);const r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let i=r.AbsolutePath.split("/");return i=i.filter(s=>s&&s.length>0),r.PathSegments=i,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(n);if(!r)throw et(ad);return r[2]}static getAbsoluteUrl(e,n){if(e[0]===wb){const i=new Le(n).getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new Le(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}}/*! @azure/msal-common v16.6.0 2026-05-07 */const X5=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function W5(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}const V5=X5.reduce((t,{host:e,issuerHost:n})=>(t[e]=W5(e,n||e),t),{}),nN={endpointMetadata:V5,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},E1=nN.endpointMetadata,kk=nN.instanceDiscoveryMetadata,rN=new Set;kk.metadata.forEach(t=>{t.aliases.forEach(e=>{rN.add(e)})});function H5(t,e,n){var s;let r;const i=t.canonicalAuthority;if(i){const o=new Le(i).getUrlComponents().HostNameAndPort;r=_1(e,n,o,(s=t.cloudDiscoveryMetadata)==null?void 0:s.metadata)||_1(e,n,o,kk.metadata)||t.knownAuthorities}return r||[]}function _1(t,e,n,r,i){if(t.trace("1bmquz",e),n&&r){const s=dp(r,n);if(s)return t.trace("1fotbt",e),s.aliases;t.trace("14avvj",e)}return null}function Y5(t){return dp(kk.metadata,t)}function dp(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(r.aliases.includes(e))return r}return null}/*! @azure/msal-common v16.6.0 2026-05-07 */const Cb="cache_quota_exceeded",q5="cache_error_unknown";/*! @azure/msal-common v16.6.0 2026-05-07 */class Fa extends Error{constructor(e,n){const r=n||ak(e);super(r),Object.setPrototypeOf(this,Fa.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}function Eb(t){return t instanceof Error?t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.message.includes("exceeded the quota")?new Fa(Cb):new Fa(t.name,t.message):new Fa(q5)}/*! @azure/msal-common v16.6.0 2026-05-07 */function fp(t,e){if(!t)throw Y(a5);try{const n=e(t);return JSON.parse(n)}catch{throw Y(QR)}}function Xa(t){if(!t)throw Y(QR);const e=t.split(Sb,2);return{uid:e[0],utid:e.length<2?"":e[1]}}/*! @azure/msal-common v16.6.0 2026-05-07 */const $r={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v16.6.0 2026-05-07 */function vk(t){return t&&(t.tid||t.tfp||t.acr)||null}/*! @azure/msal-common v16.6.0 2026-05-07 */const Dn={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v16.6.0 2026-05-07 */function Do(t){const e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(Ul(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(n=>[n.tenantId,n])),dataBoundary:t.dataBoundary}}function G5(t,e,n){var p,g,y,m,O,b,S;let r;e.authorityType===$r.Adfs?r=qZ:e.protocolMode===Dn.OIDC?r=CR:r=YZ;let i,s;t.clientInfo&&n&&(i=fp(t.clientInfo,n),i.xms_tdbr&&(s=i.xms_tdbr==="EU"?"EU":"None"));const o=t.environment||e&&e.getPreferredCache();if(!o)throw Y(BR);const a=((p=t.idTokenClaims)==null?void 0:p.preferred_username)||((g=t.idTokenClaims)==null?void 0:g.upn),l=(y=t.idTokenClaims)!=null&&y.emails?t.idTokenClaims.emails[0]:null,c=a||l||"",u=(m=t.idTokenClaims)==null?void 0:m.login_hint,h=(i==null?void 0:i.utid)||vk(t.idTokenClaims)||"",d=(i==null?void 0:i.uid)||((O=t.idTokenClaims)==null?void 0:O.oid)||((b=t.idTokenClaims)==null?void 0:b.sub)||"";let f;return t.tenantProfiles?f=t.tenantProfiles:f=[Ul(t.homeAccountId,d,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:o,realm:h,localAccountId:d,username:c,authorityType:r,loginHint:u,clientInfo:t.clientInfo,name:((S=t.idTokenClaims)==null?void 0:S.name)||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:f,dataBoundary:s}}function K5(t,e,n){var i;const r=Array.from(((i=t.tenantProfiles)==null?void 0:i.values())||[]);return r.length===0&&t.tenantId&&t.localAccountId&&r.push(Ul(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||CR,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:n,tenantProfiles:r,dataBoundary:t.dataBoundary}}function iN(t,e,n,r,i,s){if(!(e===$r.Adfs||e===$r.Dsts)){if(t)try{const o=fp(t,r.base64Decode);if(o.uid&&o.utid)return`${o.uid}.${o.utid}`}catch{}n.warning("1ub6wv",i)}return(s==null?void 0:s.sub)||""}function J5(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}/*! @azure/msal-common v16.6.0 2026-05-07 */class _b{constructor(e,n,r,i,s){this.clientId=e,this.cryptoImpl=n,this.commonLogger=r.clone(Qg,wh),this.staticAuthorityOptions=s,this.performanceClient=i}getAllAccounts(e={},n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){if(Object.keys(e).length===0||Object.values(e).every(i=>i==null||i===""))return this.commonLogger.warning("1skb02",n),null;const r=this.getAllAccounts(e,n);return r.length>1?r.sort((s,o)=>{const a=s.idTokenClaims?1:0;return(o.idTokenClaims?1:0)-a})[0]:r.length===1?r[0]:null}getBaseAccountInfo(e,n){const r=this.getAccountsFilteredBy(e,n);return r.length>0?Do(r[0]):null}buildTenantProfiles(e,n,r){return e.flatMap(i=>this.getTenantProfilesFromAccountEntity(i,n,r==null?void 0:r.tenantId,r))}getTenantedAccountInfoByFilter(e,n,r,i,s){let o=null,a;if(s&&!this.tenantProfileMatchesFilter(r,s))return null;const l=this.getIdToken(e,i,n,r.tenantId);return l&&(a=di(l.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(a,s))?null:(o=hp(e,r,a,l==null?void 0:l.secret),o)}getTenantProfilesFromAccountEntity(e,n,r,i){const s=Do(e);let o=s.tenantProfiles||new Map;const a=this.getTokenKeys();if(r){const c=o.get(r);if(c)o=new Map([[r,c]]);else return[]}const l=[];return o.forEach(c=>{const u=this.getTenantedAccountInfoByFilter(s,a,c,n,i);u&&l.push(u)}),l}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant||n.username&&!(this.matchUsername(e.username,n.username)||!this.matchUsername(e.upn,n.username))||n.loginHint&&!this.matchLoginHintWithTenantProfile(e,n.loginHint)||n.upn&&e.upn!==n.upn)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)&&!this.matchUsername(e.upn,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,r,i,s){var o;if(!e)throw Y(b5);try{e.account&&await this.setAccount(e.account,n,r,i),e.idToken&&(s==null?void 0:s.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,n,r),e.accessToken&&(s==null?void 0:s.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,n,r),e.refreshToken&&(s==null?void 0:s.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n,r),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(a){throw(o=this.commonLogger)==null||o.error("0j476p",n),a instanceof He?a:Eb(a)}}async saveAccessToken(e,n,r){const i={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),o=rn.fromString(e.target);s.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,i,!1))return;const l=this.getAccessTokenCredential(a,n);l&&this.credentialMatchesFilter(l,i,n)&&rn.fromString(l.target).intersectingScopeSets(o)&&this.removeAccessToken(a,n)}),await this.setAccessTokenCredential(e,n,r)}getAccountsFilteredBy(e,n){const r=this.getAccountKeys(),i=[];return r.forEach(s=>{var c;const o=this.getAccount(s,n);if(!o||e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId)||e.environment&&!this.matchEnvironment(o,e.environment,n)||e.realm&&!this.matchRealm(o,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(o,e.authorityType))return;const a={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name,username:e==null?void 0:e.username,loginHint:e==null?void 0:e.loginHint,upn:e==null?void 0:e.upn},l=(c=o.tenantProfiles)==null?void 0:c.filter(u=>this.tenantProfileMatchesFilter(u,a));l&&l.length===0||i.push(o)}),i}credentialMatchesFilter(e,n,r){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment,r)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||e.credentialType===Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===Be.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e,n){const r=this.getKeys(),i={};return r.forEach(s=>{if(!this.isAppMetadata(s))return;const o=this.getAppMetadata(s,n);o&&(e.environment&&!this.matchEnvironment(o,e.environment,n)||e.clientId&&!this.matchClientId(o,e.clientId)||(i[s]=o))}),i}getAuthorityMetadataByAlias(e,n){const r=this.getAuthorityMetadataKeys();let i=null;return r.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;const o=this.getAuthorityMetadata(s,n);o&&o.aliases.indexOf(e)!==-1&&(i=o)}),i}removeAllAccounts(e){this.getAllAccounts({},e).forEach(r=>{this.removeAccount(r,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const r=this.getAccountKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.filter(i).forEach(s=>{this.removeItem(s,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const r=this.getTokenKeys(),i=s=>s.includes(e.homeAccountId)&&s.includes(e.environment);r.idToken.filter(i).forEach(s=>{this.removeIdToken(s,n)}),r.accessToken.filter(i).forEach(s=>{this.removeAccessToken(s,n)}),r.refreshToken.filter(i).forEach(s=>{this.removeRefreshToken(s,n)})}removeAccessToken(e,n){const r=this.getAccessTokenCredential(e,n);if(r&&(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),r.credentialType.toLowerCase()===Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&r.tokenType===Be.POP)){const s=r.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,n).catch(()=>{var o;this.commonLogger.error("0cx291",n),(o=this.performanceClient)==null||o.incrementFields({removeTokenBindingKeyFailure:1},n)})}}removeAppMetadata(e){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r,e)}),!0}getIdToken(e,n,r,i){this.commonLogger.trace("1drz22",n);const s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ut.ID_TOKEN,clientId:this.clientId,realm:i},o=this.getIdTokensByFilter(s,n,r),a=o.size;if(a<1)return this.commonLogger.info("1atvtd",n),null;if(a>1){let l=o;if(!i){const c=new Map;o.forEach((h,d)=>{h.realm===e.tenantId&&c.set(d,h)});const u=c.size;if(u<1)return this.commonLogger.info("0ooalx",n),o.values().next().value??null;if(u===1)return this.commonLogger.info("1eq2vc",n),c.values().next().value??null;l=c}return this.commonLogger.info("1ws328",n),l.forEach((c,u)=>{this.removeIdToken(u,n)}),this.performanceClient.addFields({multiMatchedID:o.size},n),null}return this.commonLogger.info("1sm769",n),o.values().next().value??null}getIdTokensByFilter(e,n,r){const i=r&&r.idToken||this.getTokenKeys().idToken,s=new Map;return i.forEach(o=>{if(!this.idTokenKeyMatchesFilter(o,{clientId:this.clientId,...e}))return;const a=this.getIdTokenCredential(o,n);a&&this.credentialMatchesFilter(a,e,n)&&s.set(o,a)}),s}idTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,r,i){const s=n.correlationId;this.commonLogger.trace("1t7hz1",s);const o=rn.createSearchScopes(n.scopes),a=n.authenticationScheme||Be.BEARER,l=a.toLowerCase()!==Be.BEARER.toLowerCase()?Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME:Ut.ACCESS_TOKEN,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:l,clientId:this.clientId,realm:i||e.tenantId,target:o,tokenType:a,keyId:n.sshKid},u=r&&r.accessToken||this.getTokenKeys().accessToken,h=[];u.forEach(f=>{if(this.accessTokenKeyMatchesFilter(f,c,!0)){const p=this.getAccessTokenCredential(f,s);p&&this.credentialMatchesFilter(p,c,s)&&h.push(p)}});const d=h.length;return d<1?(this.commonLogger.info("1nckna",s),null):d>1?(this.commonLogger.info("1wkfwp",s),h.forEach(f=>{this.removeAccessToken(this.generateCredentialKey(f),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("06yt98",s),h[0])}accessTokenKeyMatchesFilter(e,n,r){const i=e.toLowerCase();if(n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&i.indexOf(n.realm.toLowerCase())===-1)return!1;if(n.target){const s=n.target.asArray();for(let o=0;o<s.length;o++){if(r&&!i.includes(s[o].toLowerCase()))return!1;if(!r&&i.includes(s[o].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,n){const r=this.getTokenKeys(),i=[];return r.accessToken.forEach(s=>{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;const o=this.getAccessTokenCredential(s,n);o&&this.credentialMatchesFilter(o,e,n)&&i.push(o)}),i}getRefreshToken(e,n,r,i){this.commonLogger.trace("0x53vi",r);const s=n?op:void 0,o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ut.REFRESH_TOKEN,clientId:this.clientId,familyId:s},a=i&&i.refreshToken||this.getTokenKeys().refreshToken,l=[];a.forEach(u=>{if(this.refreshTokenKeyMatchesFilter(u,o)){const h=this.getRefreshTokenCredential(u,r);h&&this.credentialMatchesFilter(h,o,r)&&l.push(h)}});const c=l.length;return c<1?(this.commonLogger.info("0dlw11",r),null):(c>1&&this.performanceClient.addFields({multiMatchedRT:c},r),this.commonLogger.info("0wcnep",r),l[0])}refreshTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.familyId&&r.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,n){const r={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(r,n),s=Object.keys(i).map(a=>i[a]),o=s.length;if(o<1)return null;if(o>1)throw Y(g5);return s[0]}isAppMetadataFOCI(e,n){const r=this.readAppMetadataFromCache(e,n);return!!(r&&r.familyId===op)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const r=e.oid||e.sub;return n===r}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){var r;return n.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,n){return!!(e&&typeof e=="string"&&(n==null?void 0:n.toLowerCase())===e.toLowerCase())}matchLoginHintWithTenantProfile(e,n){return e.loginHint===n||e.username===n||e.upn===n}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n,r){if(this.staticAuthorityOptions){const s=H5(this.staticAuthorityOptions,this.commonLogger,r);if(s.includes(n)&&s.includes(e.environment))return!0}const i=this.getAuthorityMetadataByAlias(n,r);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return!!(e.login_hint===n||e.preferred_username===n||e.upn===n||e.emails&&e.emails.includes(n))}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==Ut.ACCESS_TOKEN&&e.credentialType!==Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:rn.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(ok)!==-1}isAuthorityMetadata(e){return e.indexOf(kb)!==-1}generateAuthorityMetadataCacheKey(e){return`${kb}-${this.clientId}-${e}`}static toObject(e,n){for(const r in n)e[r]=n[r];return e}}class e3 extends _b{async setAccount(){throw Y(Ce)}getAccount(){throw Y(Ce)}async setIdTokenCredential(){throw Y(Ce)}getIdTokenCredential(){throw Y(Ce)}async setAccessTokenCredential(){throw Y(Ce)}getAccessTokenCredential(){throw Y(Ce)}async setRefreshTokenCredential(){throw Y(Ce)}getRefreshTokenCredential(){throw Y(Ce)}setAppMetadata(){throw Y(Ce)}getAppMetadata(){throw Y(Ce)}setServerTelemetry(){throw Y(Ce)}getServerTelemetry(){throw Y(Ce)}setAuthorityMetadata(){throw Y(Ce)}getAuthorityMetadata(){throw Y(Ce)}getAuthorityMetadataKeys(){throw Y(Ce)}setThrottlingCache(){throw Y(Ce)}getThrottlingCache(){throw Y(Ce)}removeItem(){throw Y(Ce)}getKeys(){throw Y(Ce)}getAccountKeys(){throw Y(Ce)}getTokenKeys(){throw Y(Ce)}generateCredentialKey(){throw Y(Ce)}generateAccountKey(){throw Y(Ce)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const t3={InProgress:1};/*! @azure/msal-common v16.6.0 2026-05-07 */class sN{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:t3.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-common v16.6.0 2026-05-07 */const oN={tokenRenewalOffsetSeconds:AR,preventCorsPreflight:!1},n3={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:at.Info,correlationId:""},r3={async sendGetRequestAsync(){throw Y(Ce)},async sendPostRequestAsync(){throw Y(Ce)}},i3={sku:IZ,version:wh,cpu:"",os:""},s3={clientSecret:"",clientAssertion:void 0},o3={azureCloudInstance:Sk.None,tenant:`${SR}`},a3={application:{appName:"",appVersion:""}};function xk({authOptions:t,systemOptions:e,loggerOptions:n,storageInterface:r,networkInterface:i,cryptoInterface:s,clientCredentials:o,libraryInfo:a,telemetry:l,serverTelemetryManager:c,persistencePlugin:u,serializableCache:h}){const d={...n3,...n};return{authOptions:l3(t),systemOptions:{...oN,...e},loggerOptions:d,storageInterface:r||new e3(t.clientId,up,new ki(d),new sN),networkInterface:i||r3,cryptoInterface:s||up,clientCredentials:o||s3,libraryInfo:{...i3,...a},telemetry:{...a3,...l},serverTelemetryManager:c||null,persistencePlugin:u||null,serializableCache:h||null}}function l3(t){return{clientCapabilities:[],azureCloudOptions:o3,instanceAware:!1,isMcp:!1,...t}}function aN(t){return t.authOptions.authority.options.protocolMode===Dn.OIDC}/*! @azure/msal-common v16.6.0 2026-05-07 */class c3{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v16.6.0 2026-05-07 */function Wr(){return Math.round(new Date().getTime()/1e3)}function pp(t){return t.getTime()/1e3}function ff(t){return t?new Date(Number(t)*1e3):new Date}function gp(t,e){const n=Number(t)||0;return Wr()+e>n}function T1(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function u3(t){return Number(t)>Wr()}/*! @azure/msal-common v16.6.0 2026-05-07 */function Lg(t,e,n,r,i){return{credentialType:Ut.ID_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,realm:i,lastUpdatedAt:Date.now().toString()}}function Dg(t,e,n,r,i,s,o,a,l,c,u,h,d){var p,g;const f={homeAccountId:t,credentialType:Ut.ACCESS_TOKEN,secret:n,cachedAt:Wr().toString(),expiresOn:o.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:r,realm:i,target:s,tokenType:u||Be.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(f.userAssertionHash=h),c&&(f.refreshOn=c.toString()),((p=f.tokenType)==null?void 0:p.toLowerCase())!==Be.BEARER.toLowerCase())switch(f.credentialType=Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME,f.tokenType){case Be.POP:const y=di(n,l);if(!((g=y==null?void 0:y.cnf)!=null&&g.kid))throw Y(w5);f.keyId=y.cnf.kid;break;case Be.SSH:f.keyId=d}return f}function h3(t,e,n,r,i,s,o){const a={credentialType:Ut.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,lastUpdatedAt:Date.now().toString()};return s&&(a.userAssertionHash=s),i&&(a.familyId=i),o&&(a.expiresOn=o.toString()),a}function zg(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function A1(t){return t?zg(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===Ut.ACCESS_TOKEN||t.credentialType===Ut.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function d3(t){return t?zg(t)&&t.hasOwnProperty("realm")&&t.credentialType===Ut.ID_TOKEN:!1}function P1(t){return t?zg(t)&&t.credentialType===Ut.REFRESH_TOKEN:!1}function f3(t,e){const n=t.indexOf(_R)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&r}function p3(t,e){let n=!1;t&&(n=t.indexOf(TR)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),n&&r}function g3({environment:t,clientId:e}){return[ok,t,e].join(ER).toLowerCase()}function m3(t,e){return e?t.indexOf(ok)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function O3(t,e){return e?t.indexOf(kb)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function I1(){return Wr()+KZ}function cd(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function Km(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function R1(t){return t.expiresAt<=Wr()}/*! @azure/msal-common v16.6.0 2026-05-07 */const y3="networkClientSendPostRequestAsync",b3="refreshTokenClientExecutePostToTokenEndpoint",w3="authorizationCodeClientExecutePostToTokenEndpoint",S3="refreshTokenClientExecuteTokenRequest",k3="refreshTokenClientAcquireToken",Jm="refreshTokenClientAcquireTokenWithCachedRefreshToken",v3="refreshTokenClientCreateTokenRequestBody",x3="silentFlowClientGenerateResultFromCacheRecord",Ck="getAuthCodeUrl",lN="handleCodeResponseFromServer",C3="authClientExecuteTokenRequest",E3="authClientCreateTokenRequestBody",_3="updateTokenEndpointAuthority",Sh="popTokenGenerateCnf",Ek="handleServerTokenResponse",T3="authorityResolveEndpointsAsync",A3="authorityGetCloudDiscoveryMetadataFromNetwork",P3="authorityUpdateCloudDiscoveryMetadata",I3="authorityGetEndpointMetadataFromNetwork",R3="authorityUpdateEndpointMetadata",N1="authorityUpdateMetadataWithRegionalInformation",N3="regionDiscoveryDetectRegion",$1="regionDiscoveryGetRegionFromIMDS",$3="regionDiscoveryGetCurrentVersion",M3="cacheManagerGetRefreshToken",Q3="setUserData";/*! @azure/msal-common v16.6.0 2026-05-07 */const Jn=(t,e,n,r,i)=>(...s)=>{n.trace("1plfzx",i);const o=r.startMeasurement(e,i);i&&r.incrementFields({[`ext.${e}CallCount`]:1},i);try{const a=t(...s);return o.end({success:!0}),n.trace("1g8n6a",i),a}catch(a){n.trace("0cfd8i",i);try{n.trace(JSON.stringify(a),i)}catch{n.trace("00dty7",i)}throw o.end({success:!1},a),a}},Z=(t,e,n,r,i)=>(...s)=>{n.trace("1plfzx",i);const o=r.startMeasurement(e,i);return i&&r.incrementFields({[`ext.${e}CallCount`]:1},i),t(...s).then(a=>(n.trace("1g8n6a",i),o.end({success:!0}),a)).catch(a=>{n.trace("0cfd8i",i);try{n.trace(JSON.stringify(a),i)}catch{n.trace("00dty7",i)}throw o.end({success:!1},a),a})};/*! @azure/msal-common v16.6.0 2026-05-07 */const L3={SW:"sw"};class gl{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){const r=await Z(this.generateKid.bind(this),Sh,n,this.performanceClient,e.correlationId)(e),i=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:i}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:L3.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,i){const{resourceRequestMethod:s,resourceRequestUri:o,shrClaims:a,shrNonce:l,shrOptions:c}=r,u=o?new Le(o):void 0,h=u==null?void 0:u.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Wr(),m:s==null?void 0:s.toUpperCase(),u:h==null?void 0:h.HostNameAndPort,nonce:l||this.cryptoUtils.createNewGuid(),p:h==null?void 0:h.AbsolutePath,q:h!=null&&h.QueryString?[[],h.QueryString]:void 0,client_claims:a||void 0,...i},n,c,r.correlationId)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const Tb="no_tokens_found",D3="native_account_unavailable",cN="refresh_token_expired",uN="ux_not_allowed",z3="interaction_required",B3="consent_required",j3="login_required",_k="bad_token",U3="interrupted_user";/*! @azure/msal-common v16.6.0 2026-05-07 */const M1=[z3,B3,j3,_k,uN,U3],Z3=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"];class vr extends He{constructor(e,n,r,i,s,o,a,l){super(e,n,r),Object.setPrototypeOf(this,vr.prototype),this.timestamp=i||"",this.traceId=s||"",this.correlationId=o||"",this.claims=a||"",this.name="InteractionRequiredAuthError",this.errorNo=l}}function hN(t,e,n){const r=!!t&&M1.indexOf(t)>-1,i=!!n&&Z3.indexOf(n)>-1,s=!!e&&M1.some(o=>e.indexOf(o)>-1);return r||s||i}function mp(t,e){return new vr(t,e)}/*! @azure/msal-common v16.6.0 2026-05-07 */class Go extends He{constructor(e,n,r,i,s){super(e,n,r),this.name="ServerError",this.errorNo=i,this.status=s,Object.setPrototypeOf(this,Go.prototype)}}/*! @azure/msal-common v16.6.0 2026-05-07 */function Tk(t,e,n){const r=F3(t,n);return e?`${r}${bb}${e}`:r}function F3(t,e){if(!t)throw Y(jR);const n={id:t.createNewGuid()};e&&(n.meta=e);const r=JSON.stringify(n);return t.base64Encode(r)}function kh(t,e){if(!t)throw Y(jR);if(!e)throw Y(Ru);try{const n=e.split(bb),r=n[0],i=n.length>1?n.slice(1).join(bb):"",s=t(r),o=JSON.parse(s);return{userRequestState:i||"",libraryState:o}}catch{throw Y(Ru)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class zo{constructor(e,n,r,i,s,o,a){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=i,this.performanceClient=s,this.serializableCache=o,this.persistencePlugin=a}validateTokenResponse(e,n,r){var i;if(e.error||e.error_description||e.suberror){const s=`Error(s): ${e.error_codes||Oc} - Timestamp: ${e.timestamp||Oc} - Description: ${e.error_description||Oc} - Correlation ID: ${e.correlation_id||Oc} - Trace ID: ${e.trace_id||Oc}`,o=(i=e.error_codes)!=null&&i.length?e.error_codes[0]:void 0,a=new Go(e.error,s,e.suberror,o,e.status);if(r&&e.status&&e.status>=VZ&&e.status<=HZ){this.logger.warning("16ks7j",n);return}else if(r&&e.status&&e.status>=XZ&&e.status<=WZ){this.logger.warning("0g61x3",n);return}throw hN(e.error,e.error_description,e.suberror)?new vr(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",o):a}}async handleServerTokenResponse(e,n,r,i,s,o,a,l,c,u){var g;let h;if(e.id_token){if(h=di(e.id_token||"",this.cryptoObj.base64Decode),o&&o.nonce&&h.nonce!==o.nonce)throw Y(f5);if(i.maxAge||i.maxAge===0){const y=h.auth_time;if(!y)throw Y(DR);tN(y,i.maxAge)}}this.homeAccountIdentifier=iN(e.client_info||"",n.authorityType,this.logger,this.cryptoObj,i.correlationId,h);let d;o&&o.state&&(d=kh(this.cryptoObj.base64Decode,o.state)),e.key_id=e.key_id||i.sshKid||void 0;const f=this.generateCacheRecord(e,n,r,i,h,a,o);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("0jbz5k",i.correlationId),p=new c3(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),l&&!c&&f.account&&this.cacheStorage.getAllAccounts({homeAccountId:f.account.homeAccountId,environment:f.account.environment},i.correlationId).length<1)return this.logger.warning("1gmt66",i.correlationId),(g=this.performanceClient)==null||g.addFields({acntLoggedOut:!0},i.correlationId),await zo.generateAuthenticationResult(this.cryptoObj,n,f,!1,i,this.performanceClient,h,d,void 0,u);await this.cacheStorage.saveCacheRecord(f,i.correlationId,Di(h||{}),s,i.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("1bh17u",i.correlationId),await this.persistencePlugin.afterCacheAccess(p))}return zo.generateAuthenticationResult(this.cryptoObj,n,f,!1,i,this.performanceClient,h,d,e,u)}generateCacheRecord(e,n,r,i,s,o,a){var g;const l=n.getPreferredCache();if(!l)throw Y(BR);const c=vk(s);let u,h;e.id_token&&s&&(u=Lg(this.homeAccountIdentifier,l,e.id_token,this.clientId,c||""),h=dN(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,i.correlationId,s,e.client_info,l,c,a,void 0,this.logger,this.performanceClient));let d=null;if(e.access_token){const y=e.scope?rn.fromString(e.scope):new rn(i.scopes||[]),m=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,O=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,b=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,S=r+m,x=S+O,k=b&&b>0?r+b:void 0;d=Dg(this.homeAccountIdentifier,l,e.access_token,this.clientId,c||n.tenant||"",y.printScopes(),S,x,this.cryptoObj.base64Decode,k,e.token_type,o,e.key_id);const E=i.resource||null;E&&(d.resource=E)}let f=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){const m=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=r+m,(g=this.performanceClient)==null||g.addFields({ntwkRtExpiresOnSeconds:y},i.correlationId)}f=h3(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,o,y)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:l,familyId:e.foci}),{account:h,idToken:u,accessToken:d,refreshToken:f,appMetadata:p}}static async generateAuthenticationResult(e,n,r,i,s,o,a,l,c,u){var S,x,k,E,I;let h="",d=[],f=null,p,g,y="";if(r.accessToken){if(r.accessToken.tokenType===Be.POP&&!s.popKid){const Q=new gl(e,o),{secret:T,keyId:D}=r.accessToken;if(!D)throw Y(UR);h=await Q.signPopToken(T,D,s)}else h=r.accessToken.secret;d=rn.fromString(r.accessToken.target).asArray(),f=ff(r.accessToken.expiresOn),p=ff(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(g=ff(r.accessToken.refreshOn))}r.appMetadata&&(y=r.appMetadata.familyId===op?op:"");const m=(a==null?void 0:a.oid)||(a==null?void 0:a.sub)||"",O=(a==null?void 0:a.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const b=r.account?hp(Do(r.account),void 0,a,(S=r.idToken)==null?void 0:S.secret):null;return{authority:n.canonicalAuthority,uniqueId:m,tenantId:O,scopes:d,account:b,idToken:((x=r==null?void 0:r.idToken)==null?void 0:x.secret)||"",idTokenClaims:a||{},accessToken:h,fromCache:i,expiresOn:f,extExpiresOn:p,refreshOn:g,correlationId:s.correlationId,requestId:u||"",familyId:y,tokenType:((k=r.accessToken)==null?void 0:k.tokenType)||"",state:l?l.userRequestState:"",cloudGraphHostName:((E=r.account)==null?void 0:E.cloudGraphHostName)||"",msGraphHost:((I=r.account)==null?void 0:I.msGraphHost)||"",code:c==null?void 0:c.spa_code,fromPlatformBroker:!1}}}function dN(t,e,n,r,i,s,o,a,l,c,u,h,d){h==null||h.verbose("09jz0t",i);const f=a||e.getPreferredCache(),p=t.getAccountsFilteredBy({homeAccountId:n,environment:f},i);d==null||d.addFields({cacheMatchedAccounts:p.length},i),p.length>1&&(h==null||h.warning("0x7ad1",i));const y=(p.length===1?p[0]:null)||G5({homeAccountId:n,idTokenClaims:s,clientInfo:o,environment:a,cloudGraphHostName:c==null?void 0:c.cloud_graph_host_name,msGraphHost:c==null?void 0:c.msgraph_host,nativeAccountId:u},e,r),m=y.tenantProfiles||[],O=l||y.realm;if(O&&!m.find(b=>b.tenantId===O)){const b=Ul(n,y.localAccountId,O,s);m.push(b)}return y.tenantProfiles=m,y}/*! @azure/msal-common v16.6.0 2026-05-07 */const Lr={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v16.6.0 2026-05-07 */async function fN(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v16.6.0 2026-05-07 */function Bg(t,e,n){var r;return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.extraParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class ai{static generateThrottlingStorageKey(e){return`${TR}.${JSON.stringify(e)}`}static preProcess(e,n,r){var o;const i=ai.generateThrottlingStorageKey(n),s=e.getThrottlingCache(i,r);if(s){if(s.throttleTime<Date.now()){e.removeItem(i,r);return}throw new Go(((o=s.errorCodes)==null?void 0:o.join(" "))||"",s.errorMessage,s.subError)}}static postProcess(e,n,r,i){if(ai.checkResponseStatus(r)||ai.checkResponseForRetryAfter(r)){const s={throttleTime:ai.calculateThrottleTime(parseInt(r.headers[On.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(ai.generateThrottlingStorageKey(n),s,i)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(On.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||iF),r+sF)*1e3)}static removeThrottle(e,n,r,i){const s=Bg(n,r,i),o=this.generateThrottlingStorageKey(s);e.removeItem(o,r.correlationId)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class jg extends He{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,jg.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function Qc(t,e,n,r){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${r==null?void 0:r.name}, error.message:${r==null?void 0:r.message}`,new jg(t,e,n)}/*! @azure/msal-common v16.6.0 2026-05-07 */function pN(t,e,n){const r={};if(r[On.CONTENT_TYPE]=DZ,!e&&n)switch(n.type){case Lr.HOME_ACCOUNT_ID:try{const i=Xa(n.credential);r[On.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch{t.verbose("1qhtee","")}break;case Lr.UPN:r[On.CCS_HEADER]=`UPN: ${n.credential}`;break}return r}function gN(t,e,n,r){const i=new Map;return t.embeddedClientId&&Mg(i,e,n),t.extraQueryParameters&&bi(i,t.extraQueryParameters),bh(i,t.correlationId),$g(i,t.correlationId,r),Nu(i)}async function mN(t,e,n,r,i,s,o,a,l,c){const u=await X3(r,t,{body:e,headers:n},i,s,o,a,l);return c&&u.status<500&&u.status!==429&&c.clearTelemetryCache(),u}async function X3(t,e,n,r,i,s,o,a){var c;ai.preProcess(i,t,r);let l;try{l=await Z(s.sendPostRequestAsync.bind(s),y3,o,a,r)(e,n);const u=l.headers||{};a==null||a.addFields({refreshTokenSize:((c=l.body.refresh_token)==null?void 0:c.length)||0,httpVerToken:u[On.X_MS_HTTP_VERSION]||"",requestId:u[On.X_MS_REQUEST_ID]||""},r)}catch(u){if(u instanceof jg){const h=u.responseHeaders;throw h&&(a==null||a.addFields({httpVerToken:h[On.X_MS_HTTP_VERSION]||"",requestId:h[On.X_MS_REQUEST_ID]||"",contentTypeHeader:h[On.CONTENT_TYPE]||void 0,contentLengthHeader:h[On.CONTENT_LENGTH]||void 0,httpStatus:u.httpStatus},r)),u.error}throw u instanceof He?u:Y(c5)}return ai.postProcess(i,t,l,r),l}/*! @azure/msal-common v16.6.0 2026-05-07 */function W3(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v16.6.0 2026-05-07 */function V3(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}/*! @azure/msal-common v16.6.0 2026-05-07 */function H3(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}/*! @azure/msal-common v16.6.0 2026-05-07 */class Ug{constructor(e,n,r,i){this.networkInterface=e,this.logger=n,this.performanceClient=r,this.correlationId=i}async detectRegion(e,n){let r=e;if(r)n.region_source=aa.ENVIRONMENT_VARIABLE;else{const i=Ug.IMDS_OPTIONS;try{const s=await Z(this.getRegionFromIMDS.bind(this),$1,this.logger,this.performanceClient,this.correlationId)(zZ,i);if(s.status===d1&&(r=s.body,n.region_source=aa.IMDS),s.status===f1){const o=await Z(this.getCurrentVersion.bind(this),$3,this.logger,this.performanceClient,this.correlationId)(i);if(!o)return n.region_source=aa.FAILED_AUTO_DETECTION,null;const a=await Z(this.getRegionFromIMDS.bind(this),$1,this.logger,this.performanceClient,this.correlationId)(o,i);a.status===d1&&(r=a.body,n.region_source=aa.IMDS)}}catch{return n.region_source=aa.FAILED_AUTO_DETECTION,null}}return r||(n.region_source=aa.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,n){return this.networkInterface.sendGetRequestAsync(`${u1}?api-version=${e}&format=text`,n,BZ)}async getCurrentVersion(e){try{const n=await this.networkInterface.sendGetRequestAsync(`${u1}?format=json`,e);return n.status===f1&&n.body&&n.body["newest-versions"]&&n.body["newest-versions"].length>0?n.body["newest-versions"][0]:null}catch{return null}}}Ug.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v16.6.0 2026-05-07 */class _n{constructor(e,n,r,i,s,o,a,l){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=r,this.authorityOptions=i,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=a,this.correlationId=o,this.managedIdentity=l||!1,this.regionDiscovery=new Ug(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(c1))return $r.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case NZ:return $r.Adfs;case $Z:return $r.Dsts}return $r.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Le(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Y(ds)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Y(ds)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Y(ds)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Y(v5);return this.replacePath(this.metadata.end_session_endpoint)}else throw Y(ds)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Y(ds)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Y(ds)}canReplaceTenant(e){return e.PathSegments.length===1&&!_n.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===$r.Default&&this.protocolMode!==Dn.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const i=new Le(this.metadata.canonical_authority).getUrlComponents(),s=i.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,l)=>{let c=s[l];if(l===0&&this.canReplaceTenant(i)){const u=new Le(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];c!==u&&(this.logger.verbose("1q3g2x",this.correlationId),c=u)}a!==c&&(n=n.replace(`/${c}/`,`/${a}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===$r.Adfs||this.protocolMode===Dn.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var i;const e=this.getCurrentMetadataEntity(),n=await Z(this.updateCloudDiscoveryMetadata.bind(this),P3,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await Z(this.updateEndpointMetadata.bind(this),R3,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:r}),(i=this.performanceClient)==null||i.addFields({cloudDiscoverySource:n,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:I1(),jwks_uri:""}),e}updateCachedMetadata(e,n,r){n!==Pr.CACHE&&(r==null?void 0:r.source)!==Pr.CACHE&&(e.expiresAt=I1(),e.canonical_authority=this.canonicalAuthority);const i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(i,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){var i,s;const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===Pr.HARDCODED_VALUES&&(i=this.authorityOptions.azureRegionConfiguration)!=null&&i.azureRegion&&n.metadata){const o=await Z(this.updateMetadataWithRegionalInformation.bind(this),N1,this.logger,this.performanceClient,this.correlationId)(n.metadata);cd(e,o,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let r=await Z(this.getEndpointMetadataFromNetwork.bind(this),I3,this.logger,this.performanceClient,this.correlationId)();if(r)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(r=await Z(this.updateMetadataWithRegionalInformation.bind(this),N1,this.logger,this.performanceClient,this.correlationId)(r)),cd(e,r,!0),Pr.NETWORK;throw Y(u5,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("1fi0kc",this.correlationId);const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("06t0uj",this.correlationId),cd(e,n,!1),{source:Pr.CONFIG};this.logger.verbose("151k0p",this.correlationId);const r=this.getEndpointMetadataFromHardcodedValues();if(r)return cd(e,r,!1),{source:Pr.HARDCODED_VALUES,metadata:r};this.logger.verbose("1imop5",this.correlationId);const i=R1(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("16uq31",""),{source:Pr.CACHE}):(i&&this.logger.verbose("0uoibc",""),null)}isAuthoritySameType(e){return new Le(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw et(e5)}return null}async getEndpointMetadataFromNetwork(){const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose("1y65x6",this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(n,e);return W3(r.body)?r.body:(this.logger.verbose("1koyv8",this.correlationId),null)}catch{return this.logger.verbose("0a9wik",this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in E1?E1[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,i;const n=(r=this.authorityOptions.azureRegionConfiguration)==null?void 0:r.azureRegion;if(n){if(n!==jZ)return this.regionDiscoveryMetadata.region_outcome=Gm.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,_n.replaceWithRegionalInformation(e,n);const s=await Z(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),N3,this.logger,this.performanceClient,this.correlationId)((i=this.authorityOptions.azureRegionConfiguration)==null?void 0:i.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=Gm.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,_n.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=Gm.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const r=await Z(this.getCloudDiscoveryMetadataFromNetwork.bind(this),A3,this.logger,this.performanceClient,this.correlationId)();if(r)return Km(e,r,!0),Pr.NETWORK;throw et(t5)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("0jhlgt",this.correlationId),this.logger.verbosePii("1fy7uz",this.correlationId),this.logger.verbosePii("08zabj",this.correlationId),this.logger.verbosePii("1o1kv3",this.correlationId);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("1nakio",this.correlationId),Km(e,n,!1),Pr.CONFIG;this.logger.verbose("1x74aj",this.correlationId);const r=Y5(this.hostnameAndPort);if(r)return this.logger.verbose("0by47c",this.correlationId),Km(e,r,!1),Pr.HARDCODED_VALUES;this.logger.verbose("0r2fzy",this.correlationId);const i=R1(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("1uffgh",""),Pr.CACHE):(i&&this.logger.verbose("0uoibc",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===$r.Ciam)return this.logger.verbose("04y84h",this.correlationId),_n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("0gszr3",this.correlationId);try{this.logger.verbose("1iifkx",this.correlationId);const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=dp(e.metadata,this.hostnameAndPort);if(this.logger.verbose("0q67e3",""),n)return this.logger.verbose("0hzfao",this.correlationId),n;this.logger.verbose("1ajz3u",this.correlationId)}catch{throw this.logger.verbose("1wq5tu",this.correlationId),et(MR)}}return this.isInKnownAuthorities()?(this.logger.verbose("0mt9al",this.correlationId),_n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){const e=`${MZ}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let r=null;try{const i=await this.networkInterface.sendGetRequestAsync(e,n);let s,o;if(V3(i.body))s=i.body,o=s.metadata,this.logger.verbosePii("1vglyt",this.correlationId);else if(H3(i.body)){if(this.logger.warning("062uto",this.correlationId),s=i.body,s.error===FZ)return this.logger.error("1x90tm",this.correlationId),null;this.logger.warning("0wchdm",this.correlationId),this.logger.warning("1s5mpv",this.correlationId),this.logger.warning("1yhqpw",this.correlationId),o=[]}else return this.logger.error("0768g0",this.correlationId),null;this.logger.verbose("1lrobr",this.correlationId),r=dp(o,this.hostnameAndPort)}catch(i){return i instanceof He?this.logger.error("0vwhc7",this.correlationId):this.logger.error("0s2z41",this.correlationId),null}return r||(this.logger.warning("0jp28q",this.correlationId),this.logger.verbose("130sd8",this.correlationId),r=_n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&Le.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==Sk.None){const i=n.tenant?n.tenant:SR;r=`${n.azureCloudInstance}/${i}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return RZ;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Y(ds)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return rN.has(e)}static isPublicCloudAuthority(e){return ZZ.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const i=new Le(e);i.validateAsUri();const s=i.getUrlComponents();let o=`${n}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(o=`${n}.${UZ}`);const a=Le.constructAuthorityUriFromObject({...i.getUrlComponents(),HostNameAndPort:o}).urlString;return r?`${a}?${r}`:a}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=_n.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=_n.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=_n.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const i=new Le(e).getUrlComponents();if(i.PathSegments.length===0&&i.HostNameAndPort.endsWith(c1)){const s=i.HostNameAndPort.split(".")[0];n=`${n}${s}${QZ}`}return n}}_n.reservedTenantDomains=new Set(["{tenant}","{tenantid}",zs.COMMON,zs.CONSUMERS,zs.ORGANIZATIONS]);function Y3(t){var i;const r=(i=new Le(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:i.toLowerCase();switch(r){case zs.COMMON:case zs.ORGANIZATIONS:case zs.CONSUMERS:return;default:return r}}function ON(t){return t.endsWith(wb)?t:`${t}${wb}`}function q3(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw et(MR)}return{canonicalAuthority:t.authority?ON(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v16.6.0 2026-05-07 */async function yN(t,e,n,r,i,s,o){const a=_n.transformCIAMAuthority(ON(t)),l=new _n(a,e,n,r,i,s,o);try{return await Z(l.resolveEndpointsAsync.bind(l),T3,i,o,s)(),l}catch{throw Y(ds)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class bN{constructor(e,n){var r;this.includeRedirectUri=!0,this.config=xk(e),this.logger=new ki(this.config.loggerOptions,Qg,wh),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=n,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,n,r){var l;if(!e.code)throw Y(m5);r&&r.cloud_instance_host_name&&await Z(this.updateTokenEndpointAuthority.bind(this),_3,this.logger,this.performanceClient,e.correlationId)(r.cloud_instance_host_name,e.correlationId);const i=Wr(),s=await Z(this.executeTokenRequest.bind(this),C3,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),o=(l=s.headers)==null?void 0:l[On.X_MS_REQUEST_ID],a=new zo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(s.body,e.correlationId),Z(a.handleServerTokenResponse.bind(a),Ek,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,i,e,n,r,void 0,void 0,void 0,o)}getLogoutUri(e){if(!e)throw et(JF);const n=this.createLogoutUrlQueryString(e);return Le.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n,r){const i=gN(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Le.appendQueryString(e.tokenEndpoint,i),o=await Z(this.createTokenRequestBody.bind(this),E3,this.logger,this.performanceClient,n.correlationId)(n);let a;if(n.clientInfo)try{const u=fp(n.clientInfo,this.cryptoUtils.base64Decode);a={credential:`${u.uid}${Sb}${u.utid}`,type:Lr.HOME_ACCOUNT_ID}}catch{this.logger.verbose("0wznt3",n.correlationId)}const l=pN(this.logger,this.config.systemOptions.preventCorsPreflight,a||n.ccsCredential),c=Bg(this.config.authOptions.clientId,n);return Z(mN,w3,this.logger,this.performanceClient,n.correlationId)(s,o,l,c,n.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,r)}async createTokenRequestBody(e){var i;const n=new Map;if(fk(n,e.embeddedClientId||((i=e.extraParameters)==null?void 0:i[Lo])||this.config.authOptions.clientId),this.includeRedirectUri)pk(n,e.redirectUri);else if(!e.redirectUri)throw et(HF);if(dk(n,e.scopes,!0,this.oidcDefaultScopes),JR(n,e.resource),N5(n,e.code),mk(n,this.config.libraryInfo),Ok(n,this.config.telemetry.application),KR(n),this.serverTelemetryManager&&!aN(this.config)&&GR(n,this.serverTelemetryManager),e.codeVerifier&&M5(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&FR(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;XR(n,await fN(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),WR(n,s.assertionType)}if(VR(n,xR.AUTHORIZATION_CODE_GRANT),bk(n),e.authenticationScheme===Be.POP){const s=new gl(this.cryptoUtils,this.performanceClient);let o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Z(s.generateCnf.bind(s),Sh,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,wk(n,o)}else if(e.authenticationScheme===Be.SSH)if(e.sshJwk)qR(n,e.sshJwk);else throw et(uk);let r;if(e.clientInfo)try{const s=fp(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${Sb}${s.utid}`,type:Lr.HOME_ACCOUNT_ID}}catch{this.logger.verbose("0wznt3",e.correlationId)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Lr.HOME_ACCOUNT_ID:try{const s=Xa(r.credential);Gc(n,s)}catch{this.logger.verbose("1qhtee",e.correlationId)}break;case Lr.UPN:lp(n,r.credential);break}return e.embeddedClientId&&Mg(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&bi(n,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[y1])&&bi(n,{[y1]:"1"}),$g(n,e.correlationId,this.performanceClient),gk(n,e.claims,this.config.authOptions.clientCapabilities,e.skipBrokerClaims),Nu(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&T5(n,e.postLogoutRedirectUri),e.correlationId&&bh(n,e.correlationId),e.idTokenHint&&A5(n,e.idTokenHint),e.state&&ZR(n,e.state),e.logoutHint&&L5(n,e.logoutHint),e.extraQueryParameters&&bi(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&HR(n),Nu(n)}async updateTokenEndpointAuthority(e,n){const r=`https://${e}/${this.authority.tenant}/`,i=await yN(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=i}}/*! @azure/msal-common v16.6.0 2026-05-07 */const G3=300;class K3{constructor(e,n){this.config=xk(e),this.logger=new ki(this.config.loggerOptions,Qg,wh),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=n}async acquireToken(e,n){var a;const r=Wr(),i=await Z(this.executeTokenRequest.bind(this),S3,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=(a=i.headers)==null?void 0:a[On.X_MS_REQUEST_ID],o=new zo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body,e.correlationId),Z(o.handleServerTokenResponse.bind(o),Ek,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,r,e,n,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,n){if(!e)throw et(KF);if(!e.account)throw Y(zR);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Z(this.acquireTokenWithCachedRefreshToken.bind(this),Jm,this.logger,this.performanceClient,e.correlationId)(e,!0,n)}catch(i){const s=i instanceof vr&&i.errorCode===Tb,o=i instanceof Go&&i.errorCode===aF&&i.subError===lF;if(s||o)return Z(this.acquireTokenWithCachedRefreshToken.bind(this),Jm,this.logger,this.performanceClient,e.correlationId)(e,!1,n);throw i}return Z(this.acquireTokenWithCachedRefreshToken.bind(this),Jm,this.logger,this.performanceClient,e.correlationId)(e,!1,n)}async acquireTokenWithCachedRefreshToken(e,n,r){var o;const i=Jn(this.cacheManager.getRefreshToken.bind(this.cacheManager),M3,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0);if(!i)throw mp(Tb);if(i.expiresOn){const a=e.refreshTokenExpirationOffsetSeconds||G3;if((o=this.performanceClient)==null||o.addFields({cacheRtExpiresOnSeconds:Number(i.expiresOn),rtOffsetSeconds:a},e.correlationId),gp(i.expiresOn,a))throw mp(cN)}const s={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||Be.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Lr.HOME_ACCOUNT_ID}};try{return await Z(this.acquireToken.bind(this),k3,this.logger,this.performanceClient,e.correlationId)(s,r)}catch(a){if(a instanceof vr&&a.subError===_k){this.logger.verbose("1pg3ap",e.correlationId);const l=this.cacheManager.generateCredentialKey(i);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw a}}async executeTokenRequest(e,n){const r=gN(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),i=Le.appendQueryString(n.tokenEndpoint,r),s=await Z(this.createTokenRequestBody.bind(this),v3,this.logger,this.performanceClient,e.correlationId)(e),o=pN(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),a=Bg(this.config.authOptions.clientId,e);return Z(mN,b3,this.logger,this.performanceClient,e.correlationId)(i,s,o,a,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){var r,i;const n=new Map;if(fk(n,e.embeddedClientId||((r=e.extraParameters)==null?void 0:r[Lo])||this.config.authOptions.clientId),e.redirectUri&&pk(n,e.redirectUri),dk(n,e.scopes,!0,(i=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:i.defaultScopes),VR(n,xR.REFRESH_TOKEN_GRANT),bk(n),mk(n,this.config.libraryInfo),Ok(n,this.config.telemetry.application),KR(n),this.serverTelemetryManager&&!aN(this.config)&&GR(n,this.serverTelemetryManager),$5(n,e.refreshToken),this.config.clientCredentials.clientSecret&&FR(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;XR(n,await fN(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),WR(n,s.assertionType)}if(e.authenticationScheme===Be.POP){const s=new gl(this.cryptoUtils,this.performanceClient);let o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Z(s.generateCnf.bind(s),Sh,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,wk(n,o)}else if(e.authenticationScheme===Be.SSH)if(e.sshJwk)qR(n,e.sshJwk);else throw et(uk);if(this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Lr.HOME_ACCOUNT_ID:try{const s=Xa(e.ccsCredential.credential);Gc(n,s)}catch{this.logger.verbose("1qhtee",e.correlationId)}break;case Lr.UPN:lp(n,e.ccsCredential.credential);break}return e.embeddedClientId&&Mg(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&bi(n,{...e.extraParameters}),$g(n,e.correlationId,this.performanceClient),gk(n,e.claims,this.config.authOptions.clientCapabilities,e.skipBrokerClaims),Nu(n)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class J3{constructor(e,n){this.config=xk(e),this.logger=new ki(this.config.loggerOptions,Qg,wh),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=n}async acquireCachedToken(e){let n=hs.NOT_APPLICABLE;if(e.forceRefresh||!jr.isEmptyObj(e.claims))throw this.setCacheOutcome(hs.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Y(Es);if(!e.account)throw Y(zR);const r=e.account.tenantId||Y3(e.authority),i=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,i,r);if(s){if(u3(s.cachedAt)||gp(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(hs.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Y(Es);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(hs.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(Es)}else s.refreshOn&&gp(s.refreshOn,0)&&(n=hs.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(hs.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(Es);const o=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,i,r),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(o,e.correlationId)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Z(this.generateResultFromCacheRecord.bind(this),x3,this.logger,this.performanceClient,e.correlationId)(a,e),n]}setCacheOutcome(e,n){var r,i;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(i=this.performanceClient)==null||i.addFields({cacheOutcome:e},n),e!==hs.NOT_APPLICABLE&&this.logger.info("09ingz",n)}async generateResultFromCacheRecord(e,n){let r;if(e.idToken&&(r=di(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw Y(DR);tN(i,n.maxAge)}return zo.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,this.performanceClient,r)}}/*! @azure/msal-common v16.6.0 2026-05-07 */const e4={sendGetRequestAsync:()=>Promise.reject(Y(Ce)),sendPostRequestAsync:()=>Promise.reject(Y(Ce))};/*! @azure/msal-common v16.6.0 2026-05-07 */function t4(t,e,n,r){var a,l;const i=e.correlationId,s=new Map;fk(s,e.embeddedClientId||((a=e.extraQueryParameters)==null?void 0:a[Lo])||t.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(dk(s,o,!0,(l=t.authority.options.OIDCOptions)==null?void 0:l.defaultScopes),JR(s,e.resource),pk(s,e.redirectUri),bh(s,i),E5(s,e.responseMode),bk(s),Q5(s),e.prompt&&(I5(s,e.prompt),r==null||r.addFields({prompt:e.prompt},i)),e.domainHint&&(P5(s,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},i)),e.prompt!==yn.SELECT_ACCOUNT)if(e.sid&&e.prompt===yn.NONE)n.verbose("1tvqyx",e.correlationId),k1(s,e.sid),r==null||r.addFields({sidFromRequest:!0},i);else if(e.account){const c=i4(e.account);let u=s4(e.account);if(u&&e.domainHint&&(n.warning("0wkg3v",e.correlationId),u=null),u){n.verbose("1eyfsw",e.correlationId),ld(s,u),r==null||r.addFields({loginHintFromClaim:!0},i);try{const h=Xa(e.account.homeAccountId);Gc(s,h)}catch{n.verbose("12ugck",e.correlationId)}}else if(c&&e.prompt===yn.NONE){n.verbose("1rmd8s",e.correlationId),k1(s,c),r==null||r.addFields({sidFromClaim:!0},i);try{const h=Xa(e.account.homeAccountId);Gc(s,h)}catch{n.verbose("12ugck",e.correlationId)}}else if(e.loginHint)n.verbose("0y3007",e.correlationId),ld(s,e.loginHint),lp(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i);else if(e.account.username){n.verbose("02f507",e.correlationId),ld(s,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},i);try{const h=Xa(e.account.homeAccountId);Gc(s,h)}catch{n.verbose("12ugck",e.correlationId)}}}else e.loginHint&&(n.verbose("0g01ey",e.correlationId),ld(s,e.loginHint),lp(s,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},i));else n.verbose("169k9v",e.correlationId);return e.nonce&&R5(s,e.nonce),e.state&&ZR(s,e.state),e.embeddedClientId&&Mg(s,t.clientId,t.redirectUri),gk(s,e.claims,t.clientCapabilities,e.skipBrokerClaims),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(vb))&&HR(s),s}function Ak(t,e){const n=Nu(e);return Le.appendQueryString(t.authorizationEndpoint,n)}function n4(t,e){if(Pk(t,e),!t.code)throw Y(S5);return t}function Pk(t,e){if(!t.state||!e)throw t.state?Y(b1,"Cached State"):Y(b1,"Server State");let n,r;try{n=decodeURIComponent(t.state)}catch{throw Y(Ru,t.state)}try{r=decodeURIComponent(e)}catch{throw Y(Ru,t.state)}if(n!==r)throw Y(d5);if(t.error||t.error_description||t.suberror){const i=r4(t);throw hN(t.error,t.error_description,t.suberror)?new vr(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",i):new Go(t.error||"",t.error_description,t.suberror,i)}}function r4(t){var r,i;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(i=t.error_uri)==null?void 0:i.substring(n+e.length):void 0}function i4(t){var e;return((e=t.idTokenClaims)==null?void 0:e.sid)||null}function s4(t){var e;return t.loginHint||((e=t.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v16.6.0 2026-05-07 */function wN(t,e){if(t){if(e.resource&&(Q1(e.extraParameters)||Q1(e.extraQueryParameters)))throw Y(C5);if(!e.resource)throw Y(x5)}}function Q1(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}/*! @azure/msal-common v16.6.0 2026-05-07 */const Ab="unexpected_error";/*! @azure/msal-common v16.6.0 2026-05-07 */const L1=",",SN="|";function o4(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:i,extensionVersion:s}=t,o=new Map([[0,[n,r]],[2,[i,s]]]);let a=[];if(e!=null&&e.length){if(a=e.split(L1),a.length<4)return e}else a=Array.from({length:4},()=>SN);return o.forEach((l,c)=>{var u,h;l.length===2&&((u=l[0])!=null&&u.length)&&((h=l[1])!=null&&h.length)&&a4({skuArr:a,index:c,skuName:l[0],skuVersion:l[1]})}),a.join(L1)}function a4(t){const{skuArr:e,index:n,skuName:r,skuVersion:i}=t;n>=e.length||(e[n]=[r,i].join(SN))}class $u{constructor(e,n){this.cacheOutcome=hs.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=_R+ER+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${oa}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const i=n.join(oa),s=this.getRegionDiscoveryFields(),o=[e,s].join(oa);return[m1,o,i].join(O1)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=$u.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(oa),i=e.errors.slice(0,n).join(oa),s=e.errors.length,o=n<s?tF:nF,a=[s,o].join(oa);return[m1,e.cacheHits,r,i,a].join(O1)}cacheFailedRequest(e){const n=this.getLastRequests();n.errors.length>=eF&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof He?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(rF),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=$u.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const i={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,i=0;const s=e.errors.length;for(n=0;n<s;n++){const o=e.failedRequests[2*n]||"",a=e.failedRequests[2*n+1]||"",l=e.errors[n]||"";if(i+=o.toString().length+a.toString().length+l.length+3,i<JZ)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||""),e.push(this.regionSource||""),e.push(this.regionOutcome||""),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 n=this.getLastRequests();n.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return o4(e)}}/*! @azure/msal-common v16.6.0 2026-05-07 */class Ik extends He{constructor(e,n){super(e,n),this.name="JoseHeaderError",Object.setPrototypeOf(this,Ik.prototype)}}function D1(t){return new Ik(t)}/*! @azure/msal-common v16.6.0 2026-05-07 */const l4="missing_kid_error",c4="missing_alg_error";/*! @azure/msal-common v16.6.0 2026-05-07 */class Rk{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw D1(l4);if(!e.alg)throw D1(c4);const n=new Rk({typ:e.typ||cF.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(n)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const u4="acquireTokenFromCache",h4="acquireTokenByRefreshToken",d4="acquireTokenSilentAsync",f4="cryptoOptsGetPublicKeyThumbprint",p4="cryptoOptsSignJwt",g4="silentCacheClientAcquireToken",m4="silentIframeClientAcquireToken",O4="awaitConcurrentIframe",y4="silentRefreshClientAcquireToken",To="standardInteractionClientGetDiscoveredAuthority",Nk="nativeInteractionClientAcquireToken",b4="nativeInteractionClientAcquireToken",w4="refreshTokenClientAcquireTokenByRefreshToken",z1="acquireTokenBySilentIframe",$k="initializeBaseRequest",S4="initializeSilentRequest",k4="initializeCache",B1="silentIframeClientTokenHelper",eO="silentHandlerInitiateAuthRequest",Op="silentHandlerMonitorIframeForHash",v4="silentHandlerLoadFrameSync",zi="standardInteractionClientCreateAuthCodeClient",Zg="standardInteractionClientGetClientConfiguration",Mu="standardInteractionClientInitializeAuthorizationRequest",x4="silentFlowClientAcquireCachedToken",C4="getStandardParams",E4="handleCodeResponse",Mk="handleResponseEar",kN="handleResponsePlatformBroker",Wa="handleResponseCode",_4="authClientAcquireToken",Kc="deserializeResponse",T4="authorityFactoryCreateDiscoveredInstance",A4="acquireTokenByCodeAsync",P4="handleRedirectPromise",I4="handleNativeRedirectPromise",R4="nativeMessageHandlerHandshake",j1="removeHiddenIframe",N4="importExistingCache",Bo="generatePkceCodes",$4="generateCodeVerifier",M4="generateCodeChallengeFromVerifier",Q4="sha256Digest",L4="getRandomValues",U1="generateHKDF",D4="generateBaseKey",z4="base64Decode",B4="urlEncodeArr",j4="encrypt",Z1="decrypt",Qk="generateEarKey",U4="decryptEarResponse",Z4="waitForBridgeLateResponse";/*! @azure/msal-browser v5.10.0 2026-05-07 */function Fg(t){return`See https://aka.ms/msal.js.errors#${t} for details`}class vh extends He{constructor(e,n){super(e,Fg(e),n),Object.setPrototypeOf(this,vh.prototype),this.name="BrowserAuthError"}}function se(t,e){return new vh(t,e)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const hr={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",MSAL_SKU:"msal.js.browser"},dr={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS",MICROSOFT_ENTRA_BROKERID:"MicrosoftEntra",DOM_API_NAME:"DOM API",PLATFORM_DOM_APIS:"get-token-and-sign-out",PLATFORM_DOM_PROVIDER:"PlatformAuthDOMHandler",PLATFORM_EXTENSION_PROVIDER:"PlatformAuthExtensionHandler"},yc={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Ur={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},F1={GET:"GET",POST:"POST"},ws={SIGNIN:"signin",SIGNOUT:"signout"},_t={ORIGIN_URI:"request.origin",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",VERIFIER:"code.verifier",INTERACTION_STATUS_KEY:"interaction.status",NATIVE_REQUEST:"request.native"},ud={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},$e={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962,hydrateCache:963,loadExternalTokens:964},X1={861:"acquireTokenRedirect",862:"acquireTokenPopup",863:"ssoSilent",864:"acquireTokenSilent_authCode",865:"handleRedirectPromise",866:"acquireTokenByCode",61:"acquireTokenSilent_silentFlow",961:"logout",962:"logoutPopup",963:"hydrateCache",964:"loadExternalTokens"},F4=t=>typeof t=="number"&&t in X1?X1[t]:"unknown";var ge;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(ge||(ge={}));const W1={scopes:jl},vN="jwk",Pb="msal.db",X4=1,W4=`${Pb}.keys`,dn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},V4=[dn.Default,dn.Skip,dn.RefreshTokenAndNetwork];/*! @azure/msal-browser v5.10.0 2026-05-07 */function hd(t){return encodeURIComponent(Qu(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function Fs(t){return xN(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qu(t){return xN(new TextEncoder().encode(t))}function xN(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const CN="pkce_not_created",EN="ear_jwk_empty",H4="ear_jwe_empty",V1="crypto_nonexistent",Lk="empty_navigate_uri",Y4="hash_empty_error",Dk="no_state_in_hash",q4="hash_does_not_contain_known_properties",_N="unable_to_parse_state",G4="state_interaction_type_mismatch",K4="interaction_in_progress",J4="interaction_in_progress_cancelled",eX="popup_window_error",tX="empty_window_error",Ib="user_cancelled",nX="redirect_bridge_empty_response",rX="redirect_in_iframe",iX="block_iframe_reload",sX="block_nested_popups",zk="silent_logout_unsupported",oX="no_account_error",aX="no_token_request_cache_error",lX="unable_to_parse_token_request_cache_error",TN="non_browser_environment",bc="database_not_open",Rb="no_network_connectivity",cX="post_request_failed",uX="get_request_failed",H1="failed_to_parse_response",AN="crypto_key_not_found",hX="auth_code_required",dX="auth_code_or_nativeAccountId_required",fX="spa_code_and_nativeAccountId_present",PN="database_unavailable",pX="unable_to_acquire_token_from_native_platform",gX="native_handshake_timeout",mX="native_extension_not_installed",IN="native_connection_not_established",pf="uninitialized_public_client_application",OX="native_prompt_not_supported",yX="invalid_base64_string",bX="invalid_pop_token_request",wX="failed_to_build_headers",SX="failed_to_parse_headers",tO="failed_to_decrypt_ear_response",yp="timed_out",kX="empty_response";/*! @azure/msal-browser v5.10.0 2026-05-07 */function gn(t){return new TextDecoder().decode(Bs(t))}function Bs(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw se(yX)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const vX="RSASSA-PKCS1-v1_5",Zl="AES-GCM",RN="HKDF",Bk="SHA-256",xX=2048,CX=new Uint8Array([1,0,1]),Y1="0123456789abcdef",q1=new Uint32Array(1),jk="raw",NN="encrypt",Uk="decrypt",EX="deriveKey",_X="crypto_subtle_undefined",Zk={name:vX,hash:Bk,modulusLength:xX,publicExponent:CX};function TX(t){if(!window)throw se(TN);if(!window.crypto)throw se(V1);if(!t&&!window.crypto.subtle)throw se(V1,_X)}async function $N(t){const n=new TextEncoder().encode(t);return window.crypto.subtle.digest(Bk,n)}function AX(t){return window.crypto.getRandomValues(t)}function nO(){return window.crypto.getRandomValues(q1),q1[0]}function Xs(){const t=Date.now(),e=nO()*1024+(nO()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),i=e&2**30-1,s=nO();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s;let o="";for(let a=0;a<n.length;a++)o+=Y1.charAt(n[a]>>>4),o+=Y1.charAt(n[a]&15),(a===3||a===5||a===7||a===9)&&(o+="-");return o}async function PX(t,e){return window.crypto.subtle.generateKey(Zk,t,e)}async function rO(t){return window.crypto.subtle.exportKey(vN,t)}async function IX(t,e,n){return window.crypto.subtle.importKey(vN,t,Zk,e,n)}async function RX(t,e){return window.crypto.subtle.sign(Zk,t,e)}async function Fk(){const t=await MN(),n={alg:"dir",kty:"oct",k:Fs(new Uint8Array(t))};return Qu(JSON.stringify(n))}async function NX(t){const e=gn(t),r=JSON.parse(e).k,i=Bs(r);return window.crypto.subtle.importKey(jk,i,Zl,!1,[Uk])}async function $X(t,e){const n=e.split(".");if(n.length!==5)throw se(tO,"jwe_length");const r=await NX(t).catch(()=>{throw se(tO,"import_key")});try{const i=new TextEncoder().encode(n[0]),s=Bs(n[2]),o=Bs(n[3]),a=Bs(n[4]),l=a.byteLength*8,c=new Uint8Array(o.length+a.length);c.set(o),c.set(a,o.length);const u=await window.crypto.subtle.decrypt({name:Zl,iv:s,tagLength:l,additionalData:i},r,c);return new TextDecoder().decode(u)}catch{throw se(tO,"decrypt")}}async function MN(){const t=await window.crypto.subtle.generateKey({name:Zl,length:256},!0,[NN,Uk]);return window.crypto.subtle.exportKey(jk,t)}async function G1(t){return window.crypto.subtle.importKey(jk,t,RN,!1,[EX])}async function QN(t,e,n){return window.crypto.subtle.deriveKey({name:RN,salt:e,hash:Bk,info:new TextEncoder().encode(n)},t,{name:Zl,length:256},!1,[NN,Uk])}async function MX(t,e,n){const r=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(16)),s=await QN(t,i,n),o=await window.crypto.subtle.encrypt({name:Zl,iv:new Uint8Array(12)},s,r);return{data:Fs(new Uint8Array(o)),nonce:Fs(i)}}async function K1(t,e,n,r){const i=Bs(r),s=await QN(t,Bs(e),n),o=await window.crypto.subtle.decrypt({name:Zl,iv:new Uint8Array(12)},s,i);return new TextDecoder().decode(o)}async function QX(t){const e=await $N(t),n=new Uint8Array(e);return Fs(n)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Xk extends He{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Xk.prototype)}}function Wk(t){return new Xk(t,Fg(t))}/*! @azure/msal-browser v5.10.0 2026-05-07 */const LN="storage_not_supported",LX="in_mem_redirect_unavailable";/*! @azure/msal-browser v5.10.0 2026-05-07 */function DX(){const t=window.location.hash,e=window.location.search;let n=!1,r=!1,i="",s;if(t&&t.length>1){const u=t.charAt(0)==="#"?t.substring(1):t,h=new URLSearchParams(u);h.has("state")&&(n=!0,i=u,s=h)}if(e&&e.length>1){const u=e.charAt(0)==="?"?e.substring(1):e,h=new URLSearchParams(u);h.has("state")&&(r=!0,i=u,s=h)}if(n&&r){const u=e.charAt(0)==="?"?e.substring(1):e,h=t.charAt(0)==="#"?t.substring(1):t;i=`${u}${h}`,s=new URLSearchParams(i)}if(!i||!s)throw se(kX);const o=s.get("state");if(!o)throw se(Dk);const{libraryState:a}=kh(gn,o),{id:l,meta:c}=a;if(!l||!c)throw se(_N,"missing_library_state");return{params:s,payload:i,urlHash:t,urlQuery:e,hasResponseInHash:n,hasResponseInQuery:r,libraryState:{id:l,meta:c}}}function DN(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function zX(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Xg(){return window.parent!==window}function BX(){if(Xg())return!1;try{const{libraryState:t}=DX(),{meta:e}=t;return e.interactionType===ge.Popup}catch{return!1}}let Ss=null;function jX(t,e){Ss&&(t.verbose("18y01k",e),clearTimeout(Ss.timeoutId),Ss.channel.close(),Ss.reject(se(J4)),Ss=null)}async function Ia(t,e,n,r,i,s){return new Promise((o,a)=>{e.verbose("1rf6em",r.correlationId);const l=r.correlationId;i.addFields({redirectBridgeTimeoutMs:t,lateResponseExperimentEnabled:(s==null?void 0:s.iframeTimeoutTelemetry)||!1},l);const{libraryState:c}=kh(n.base64Decode,r.state||""),u=new BroadcastChannel(c.id);let h,d=!1,f,p;const g=window.setTimeout(()=>{Ss=null,s!=null&&s.iframeTimeoutTelemetry?(p=i.startMeasurement(Z4,l),d=!0,f=window.setTimeout(()=>{p==null||p.end({success:!1}),clearTimeout(f),u.close()},6e4)):u.close(),a(se(yp,"redirect_bridge_timeout"))},t);Ss={timeoutId:g,channel:u,reject:a},u.onmessage=y=>{h=y.data.payload;const m=y!=null&&y.data&&typeof y.data.v=="number"?y.data.v:void 0;if(d){p==null||p.end({success:!!h}),clearTimeout(f),u.close();return}i.addFields({redirectBridgeMessageVersion:m},l),Ss=null,clearTimeout(g),u.close(),h?o(h):a(se(nX))}})}function _s(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function UX(){const e=new Le(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function ZX(){if(cp(window.location.hash)&&Xg())throw se(iX)}function FX(t){if(Xg()&&!t)throw se(rX)}function XX(){if(BX())throw se(sX)}function zN(){if(typeof window>"u")throw se(TN)}function BN(t){if(!t)throw se(pf)}function Vk(t){zN(),ZX(),XX(),BN(t)}function J1(t,e){if(Vk(t),FX(e.system.allowRedirectInIframe),e.cache.cacheLocation===Ur.MemoryStorage)throw Wk(LX)}function jN(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function Nb(){return Xs()}/*! @azure/msal-browser v5.10.0 2026-05-07 */class WX{constructor(){this.dbName=Pb,this.version=X4,this.tableName=W4,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",i=>{i.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",i=>{const s=i;this.db=s.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(se(PN)))})}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((n,r)=>{if(!this.db)return r(se(bc));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);o.addEventListener("success",a=>{const l=a;this.closeConnection(),n(l.target.result)}),o.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,i)=>{if(!this.db)return i(se(bc));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",l=>{this.closeConnection(),i(l)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(se(bc));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);o.addEventListener("success",()=>{this.closeConnection(),n()}),o.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(se(bc));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();s.addEventListener("success",o=>{const a=o;this.closeConnection(),e(a.target.result)}),s.addEventListener("error",o=>{this.closeConnection(),n(o)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(se(bc));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);o.addEventListener("success",a=>{const l=a;this.closeConnection(),n(l.target.result===1)}),o.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(Pb),i=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(i),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(i),e(!0))),r.addEventListener("error",()=>(clearTimeout(i),n(!1)))})}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Wg{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class VX{constructor(e){this.inMemoryCache=new Wg,this.indexedDBCache=new WX,this.logger=e}handleDatabaseAccessError(e,n){if(e instanceof vh&&e.errorCode===PN)this.logger.error("1wx7zz",n);else throw e}async getItem(e,n){const r=this.inMemoryCache.getItem(e);if(!r)try{return this.logger.verbose("0naxpl",n),await this.indexedDBCache.getItem(e)}catch(i){this.handleDatabaseAccessError(i,n)}return r}async setItem(e,n,r){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(i){this.handleDatabaseAccessError(i,r)}}async removeItem(e,n){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(r){this.handleDatabaseAccessError(r,n)}}async getKeys(e){const n=this.inMemoryCache.getKeys();if(n.length===0)try{return this.logger.verbose("1iqrbq",e),await this.indexedDBCache.getKeys()}catch(r){this.handleDatabaseAccessError(r,e)}return n}async containsKey(e,n){const r=this.inMemoryCache.containsKey(e);if(!r)try{return this.logger.verbose("03zl2j",n),await this.indexedDBCache.containsKey(e)}catch(i){this.handleDatabaseAccessError(i,n)}return r}clearInMemory(e){this.logger.verbose("03r21p",e),this.inMemoryCache.clear(),this.logger.verbose("0uksk1",e)}async clearPersistent(e){try{this.logger.verbose("0rdqut",e);const n=await this.indexedDBCache.deleteDatabase();return n&&this.logger.verbose("149ouc",e),n}catch(n){return this.handleDatabaseAccessError(n,e),!1}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Hi{constructor(e,n,r){this.logger=e,TX(r??!1),this.cache=new VX(this.logger),this.performanceClient=n}createNewGuid(){return Xs()}base64Encode(e){return Qu(e)}base64Decode(e){return gn(e)}base64UrlEncode(e){return hd(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var u;const n=(u=this.performanceClient)==null?void 0:u.startMeasurement(f4,e.correlationId),r=await PX(Hi.EXTRACTABLE,Hi.POP_KEY_USAGES),i=await rO(r.publicKey),s={e:i.e,kty:i.kty,n:i.n},o=eC(s),a=await this.hashString(o),l=await rO(r.privateKey),c=await IX(l,!1,["sign"]);return await this.cache.setItem(a,{privateKey:c,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri},e.correlationId),n&&n.end({success:!0}),a}async removeTokenBindingKey(e,n){if(await this.cache.removeItem(e,n),await this.cache.containsKey(e,n))throw Y(k5)}async clearKeystore(e){this.cache.clearInMemory(e);try{return await this.cache.clearPersistent(e),!0}catch(n){return n instanceof Error?this.logger.error("1owpn8",e):this.logger.error("0yrmwo",e),!1}}async signJwt(e,n,r,i){var b;const s=(b=this.performanceClient)==null?void 0:b.startMeasurement(p4,i),o=await this.cache.getItem(n,i||"");if(!o)throw se(AN);const a=await rO(o.publicKey),l=eC(a),c=hd(JSON.stringify({kid:n})),u=Rk.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:c}),h=hd(u);e.cnf={jwk:JSON.parse(l)};const d=hd(JSON.stringify(e)),f=`${h}.${d}`,g=new TextEncoder().encode(f),y=await RX(o.privateKey,g),m=Fs(new Uint8Array(y)),O=`${f}.${m}`;return s&&s.end({success:!0}),O}async hashString(e){return QX(e)}}Hi.POP_KEY_USAGES=["sign","verify"];Hi.EXTRACTABLE=!0;function eC(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v5.10.0 2026-05-07 */const HX="acquireTokenSilent",YX="acquireTokenByCode",qX="acquireTokenPopup",GX="acquireTokenPreRedirect",iO="acquireTokenRedirect",KX="ssoSilent",JX="initializeClientApplication",eW="localStorageUpdated",tW="ssoCapable";/*! @azure/msal-browser v5.10.0 2026-05-07 */const Qt="msal",Vg="browser",tC="|",en=3,gf=3,nW=`${Qt}.${Vg}.log.level`,rW=`${Qt}.${Vg}.log.pii`,iW=`${Qt}.${Vg}.platform.auth.dom`,nC=`${Qt}.version`,rC="account.keys",iC="token.keys",sC=`${Qt}.${Vg}.sso.capable`;function Va(t=gf){return t<1?`${Qt}.${rC}`:`${Qt}.${t}.${rC}`}function Ha(t,e=en){return e<1?`${Qt}.${iC}.${t}`:`${Qt}.${e}.${iC}.${t}`}/*! @azure/msal-browser v5.10.0 2026-05-07 */const sW=24*60*60*1e3,$b={Lax:"Lax",None:"None"};class UN{initialize(){return Promise.resolve()}getItem(e){const n=encodeURIComponent(e),r=document.cookie.split(";");for(let i=0;i<r.length;i++){const s=r[i].trim(),o=s.indexOf("=");if((o===-1?s:s.substring(0,o))===n){const l=o===-1?"":s.substring(o+1);try{return decodeURIComponent(l)}catch{return l}}}return""}getUserData(){throw Y(Ce)}setItem(e,n,r,i=!0,s=$b.Lax){let o=`${encodeURIComponent(e)}=${encodeURIComponent(n)};path=/;SameSite=${s};`;if(r){const a=oW(r);o+=`expires=${a};`}(i||s===$b.None)&&(o+="Secure;"),document.cookie=o}async setUserData(){return Promise.reject(Y(Ce))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),n=[];return e.forEach(r=>{const i=r.trim(),s=i.indexOf("="),o=s===-1?i:i.substring(0,s);try{n.push(decodeURIComponent(o))}catch{}}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function oW(t){const e=new Date;return new Date(e.getTime()+t*sW).toUTCString()}/*! @azure/msal-browser v5.10.0 2026-05-07 */function gs(t,e){const n=t.getItem(Va(e));return n?JSON.parse(n):[]}function Ir(t,e,n){const r=e.getItem(Ha(t,n));if(r){const i=JSON.parse(r);if(i&&i.hasOwnProperty("idToken")&&i.hasOwnProperty("accessToken")&&i.hasOwnProperty("refreshToken"))return i}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function mf(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}/*! @azure/msal-browser v5.10.0 2026-05-07 */const oC="msal.cache.encryption",aW="msal.broadcast.cache";class lW{constructor(e,n,r){if(!window.localStorage)throw Wk(LN);this.memoryStorage=new Wg,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=r,this.broadcast=new BroadcastChannel(aW)}async initialize(e){const n=new UN,r=n.getItem(oC);let i={key:"",id:""};if(r)try{i=JSON.parse(r)}catch{}if(i.key&&i.id){const s=Jn(Bs,z4,this.logger,this.performanceClient,e)(i.key);this.encryptionCookie={id:i.id,key:await Z(G1,U1,this.logger,this.performanceClient,e)(s)}}else{const s=Xs(),o=await Z(MN,D4,this.logger,this.performanceClient,e)(),a=Jn(Fs,B4,this.logger,this.performanceClient,e)(new Uint8Array(o));this.encryptionCookie={id:s,key:await Z(G1,U1,this.logger,this.performanceClient,e)(o)};const l={id:s,key:a};n.setItem(oC,JSON.stringify(l),0,!0,$b.None)}await Z(this.importExistingCache.bind(this),N4,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",s=>{this.updateCache(s,e)}),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw se(pf);return this.memoryStorage.getItem(e)}async decryptData(e,n,r){if(!this.initialized||!this.encryptionCookie)throw se(pf);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const i=await Z(K1,Z1,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!i)return null;try{return{...JSON.parse(i),lastUpdatedAt:n.lastUpdatedAt}}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,r,i,s){if(!this.initialized||!this.encryptionCookie)throw se(pf);if(s)this.setItem(e,n);else{const{data:o,nonce:a}=await Z(MX,j4,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n,this.getContext(e)),l={id:this.encryptionCookie.id,nonce:a,data:o,lastUpdatedAt:i};this.setItem(e,JSON.stringify(l))}this.memoryStorage.setItem(e,n),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),gs(this).forEach(r=>this.removeItem(r));const n=Ir(this.clientId,this);n.idToken.forEach(r=>this.removeItem(r)),n.accessToken.forEach(r=>this.removeItem(r)),n.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(Qt)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=gs(this);n=await this.importArray(n,e),n.length?this.setItem(Va(),JSON.stringify(n)):this.removeItem(Va());const r=Ir(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(Ha(this.clientId),JSON.stringify(r)):this.removeItem(Ha(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let i;try{i=JSON.parse(r)}catch{return null}return mf(i)?i.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):(this.performanceClient.incrementFields({encryptedCacheCount:1},n),Z(K1,Z1,this.logger,this.performanceClient,n)(this.encryptionCookie.key,i.nonce,this.getContext(e),i.data)):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),r)}async importArray(e,n){const r=[],i=[];return e.forEach(s=>{const o=this.getItemFromEncryptedCache(s,n).then(a=>{a?(this.memoryStorage.setItem(s,a),r.push(s)):this.removeItem(s)});i.push(o)}),await Promise.all(i),r}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e,n){this.logger.trace("17cxcm",n);const r=this.performanceClient.startMeasurement(eW);r.add({isBackground:!0});const{key:i,value:s,context:o}=e.data;if(!i){this.logger.error("0e10qr",n),r.end({success:!1,errorCode:"noKey"});return}if(o&&o!==this.clientId){this.logger.trace("04rtdy",n),r.end({success:!1,errorCode:"contextMismatch"});return}s?(this.memoryStorage.setItem(i,s),this.logger.verbose("1vzsgt",n)):(this.memoryStorage.removeItem(i),this.logger.verbose("04ypih",n)),r.end({success:!0})}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class cW{constructor(){if(!window.sessionStorage)throw Wk(LN)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const be={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_SUCCESS:"msal:loginSuccess",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",BROKERED_REQUEST_START:"msal:brokeredRequestStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",BROKERED_REQUEST_SUCCESS:"msal:brokeredRequestSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",BROKERED_REQUEST_FAILURE:"msal:brokeredRequestFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",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",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};/*! @azure/msal-browser v5.10.0 2026-05-07 */const uW="@azure/msal-browser",jo="5.10.0";/*! @azure/msal-browser v5.10.0 2026-05-07 */function ls(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Mb extends _b{constructor(e,n,r,i,s,o,a){super(e,r,i,s,a),this.cacheConfig=n,this.logger=i,this.internalStorage=new Wg,this.browserStorage=aC(e,n.cacheLocation,i,s),this.temporaryCacheStorage=aC(e,Ur.SessionStorage,i,s),this.cookieStorage=new UN,this.eventHandler=o}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){let n=gs(this.browserStorage),r=Ir(this.clientId,this.browserStorage);this.performanceClient.addFields({preMigrateAcntCount:n.length,preMigrateATCount:r.accessToken.length,preMigrateITCount:r.idToken.length,preMigrateRTCount:r.refreshToken.length},e);for(let s=0;s<gf;s++){const o=s;await this.removeStaleAccounts(s,o,e)}for(let s=0;s<en;s++){const o=s;await this.migrateIdTokens(s,o,e)}const i=this.getKMSIValues();for(let s=0;s<en;s++)await this.migrateAccessTokens(s,i,e),await this.migrateRefreshTokens(s,i,e);n=gs(this.browserStorage),r=Ir(this.clientId,this.browserStorage),this.performanceClient.addFields({postMigrateAcntCount:n.length,postMigrateATCount:r.accessToken.length,postMigrateITCount:r.idToken.length,postMigrateRTCount:r.refreshToken.length},e)}async updateOldEntry(e,n){const r=this.browserStorage.getItem(e),i=this.validateAndParseJson(r||"");if(!i)return this.browserStorage.removeItem(e),null;if(!i.lastUpdatedAt)i.lastUpdatedAt=Date.now().toString(),this.setItem(e,JSON.stringify(i),n);else if(T1(i.lastUpdatedAt,this.cacheConfig.cacheRetentionDays))return this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},n),null;const s=mf(i)?await this.browserStorage.decryptData(e,i,n):i;return!s||!zg(s)?(this.performanceClient.incrementFields({invalidCacheCount:1},n),null):(A1(s)||P1(s))&&s.expiresOn&&gp(s.expiresOn,AR)?(this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},n),null):s}async removeStaleAccounts(e,n,r){const i=gs(this.browserStorage,e);if(i.length!==0){for(const s of[...i]){this.performanceClient.incrementFields({oldAcntCount:1},r);const o=this.browserStorage.getItem(s),a=this.validateAndParseJson(o||"");if(!a){ls(i,s);continue}if(a.lastUpdatedAt)T1(a.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)&&(await this.removeAccountOldSchema(s,a,n,r),ls(i,s));else{a.lastUpdatedAt=Date.now().toString(),this.setItem(s,JSON.stringify(a),r);continue}}this.setAccountKeys(i,r,e)}}async removeAccountOldSchema(e,n,r,i){const s=mf(n)?await this.browserStorage.decryptData(e,n,i):n,o=s==null?void 0:s.homeAccountId;if(o){const a=this.getTokenKeys(r);[...a.idToken].filter(l=>l.includes(o)).forEach(l=>{this.browserStorage.removeItem(l),ls(a.idToken,l)}),[...a.accessToken].filter(l=>l.includes(o)).forEach(l=>{this.browserStorage.removeItem(l),ls(a.accessToken,l)}),[...a.refreshToken].filter(l=>l.includes(o)).forEach(l=>{this.browserStorage.removeItem(l),ls(a.refreshToken,l)}),this.setTokenKeys(a,i,r)}this.performanceClient.incrementFields({expiredAcntRemovedCount:1},i),this.browserStorage.removeItem(e)}getKMSIValues(){const e={},n=this.getTokenKeys().idToken;for(const r of n){const i=this.browserStorage.getUserData(r);if(i){const s=JSON.parse(i),o=di(s.secret,gn);o&&(e[s.homeAccountId]=Di(o))}}return e}async migrateIdTokens(e,n,r){const i=Ir(this.clientId,this.browserStorage,e);if(i.idToken.length===0)return;const s=Ir(this.clientId,this.browserStorage,en),o=gs(this.browserStorage),a=gs(this.browserStorage,n);for(const l of[...i.idToken]){this.performanceClient.incrementFields({oldITCount:1},r);const c=await this.updateOldEntry(l,r);if(!c){ls(i.idToken,l);continue}const u=o.find(O=>O.includes(c.homeAccountId)),h=a.find(O=>O.includes(c.homeAccountId));let d=null;if(u)d=this.getAccount(u,r);else if(h){const O=this.browserStorage.getItem(h),b=this.validateAndParseJson(O||"");d=b&&mf(b)?await this.browserStorage.decryptData(h,b,r):b}if(!d){this.performanceClient.incrementFields({skipITMigrateCount:1},r);continue}const f=di(c.secret,gn),p=this.generateCredentialKey(c),g=this.getIdTokenCredential(p,r),y=Object.keys(f).includes("signin_state"),m=g&&Object.keys(di(g.secret,gn)||{}).includes("signin_state");if(!g||c.lastUpdatedAt>g.lastUpdatedAt&&(y||!m)){const O=d.tenantProfiles||[],b=vk(f)||d.realm;if(b&&!O.find(k=>k.tenantId===b)){const k=Ul(d.homeAccountId,d.localAccountId,b,f);O.push(k)}d.tenantProfiles=O;const S=this.generateAccountKey(Do(d)),x=Di(f);await this.setUserData(S,JSON.stringify(d),r,d.lastUpdatedAt,x),o.includes(S)||o.push(S),await this.setUserData(p,JSON.stringify(c),r,c.lastUpdatedAt,x),this.performanceClient.incrementFields({migratedITCount:1},r),s.idToken.includes(p)||s.idToken.push(p)}}this.setTokenKeys(i,r,e),this.setTokenKeys(s,r),this.setAccountKeys(o,r)}async migrateAccessTokens(e,n,r){const i=Ir(this.clientId,this.browserStorage,e);if(i.accessToken.length===0)return;const s=Ir(this.clientId,this.browserStorage,en);for(const o of[...i.accessToken]){this.performanceClient.incrementFields({oldATCount:1},r);const a=await this.updateOldEntry(o,r);if(!a){ls(i.accessToken,o);continue}if(!(a.homeAccountId in n)){this.performanceClient.incrementFields({skipATMigrateCount:1},r);continue}const l=this.generateCredentialKey(a),c=n[a.homeAccountId];if(!s.accessToken.includes(l))await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedATCount:1},r),s.accessToken.push(l);else{const u=this.getAccessTokenCredential(l,r);(!u||a.lastUpdatedAt>u.lastUpdatedAt)&&(await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedATCount:1},r))}}this.setTokenKeys(i,r,e),this.setTokenKeys(s,r)}async migrateRefreshTokens(e,n,r){const i=Ir(this.clientId,this.browserStorage,e);if(i.refreshToken.length===0)return;const s=Ir(this.clientId,this.browserStorage,en);for(const o of[...i.refreshToken]){this.performanceClient.incrementFields({oldRTCount:1},r);const a=await this.updateOldEntry(o,r);if(!a){ls(i.refreshToken,o);continue}if(!(a.homeAccountId in n)){this.performanceClient.incrementFields({skipRTMigrateCount:1},r);continue}const l=this.generateCredentialKey(a),c=n[a.homeAccountId];if(!s.refreshToken.includes(l))await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedRTCount:1},r),s.refreshToken.push(l);else{const u=this.getRefreshTokenCredential(l,r);(!u||a.lastUpdatedAt>u.lastUpdatedAt)&&(await this.setUserData(l,JSON.stringify(a),r,a.lastUpdatedAt,c),this.performanceClient.incrementFields({migratedRTCount:1},r))}}this.setTokenKeys(i,r,e),this.setTokenKeys(s,r)}trackVersionChanges(e){const n=this.browserStorage.getItem(nC);n&&(this.logger.info("1wuc87",e),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==jo&&this.setItem(nC,jo,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,r){const i=new Array(en+1).fill(0),s=[],o=20;for(let a=0;a<=o;a++)try{if(this.browserStorage.setItem(e,n),a>0)for(let l=0;l<=en;l++){const c=i.slice(0,l).reduce((h,d)=>h+d,0);if(c>=a)break;const u=a>c+i[l]?c+i[l]:a;a>c&&i[l]>0&&this.removeAccessTokenKeys(s.slice(c,u),r,l)}break}catch(l){const c=Eb(l);if(c.errorCode===Cb&&a<o){if(!s.length)for(let u=0;u<=en;u++)if(e===Ha(this.clientId,u)){const h=JSON.parse(n).accessToken;s.push(...h),i[u]=h.length}else{const h=this.getTokenKeys(u).accessToken;s.push(...h),i[u]=h.length}if(s.length<=a)throw c;this.removeAccessToken(s[a],r,!1)}else throw c}}async setUserData(e,n,r,i,s){const o=new Array(en+1).fill(0),a=[],l=20;for(let c=0;c<=l;c++)try{if(await Z(this.browserStorage.setUserData.bind(this.browserStorage),Q3,this.logger,this.performanceClient,r)(e,n,r,i,s),c>0)for(let u=0;u<=en;u++){const h=o.slice(0,u).reduce((f,p)=>f+p,0);if(h>=c)break;const d=c>h+o[u]?h+o[u]:c;c>h&&o[u]>0&&this.removeAccessTokenKeys(a.slice(h,d),r,u)}break}catch(u){const h=Eb(u);if(h.errorCode===Cb&&c<l){if(!a.length)for(let d=0;d<=en;d++){const f=this.getTokenKeys(d).accessToken;a.push(...f),o[d]=f.length}if(a.length<=c)throw h;this.removeAccessToken(a[c],r,!1)}else throw h}}getAccount(e,n){this.logger.trace("1lfvm6",n);const r=this.browserStorage.getUserData(e);if(!r)return this.removeAccountKeyFromMap(e,n),null;const i=this.validateAndParseJson(r);if(!i||!J5(i))return null;const s=_b.toObject({},i);return this.performanceClient.addFields({accountCachedBy:F4(s.cachedByApiId)},n),s}async setAccount(e,n,r,i){this.logger.trace("1bz3wr",n);const s=this.generateAccountKey(Do(e)),o=Date.now().toString();e.lastUpdatedAt=o,e.cachedByApiId=i,await this.setUserData(s,JSON.stringify(e),n,o,r),this.addAccountKeyToMap(s,n),this.performanceClient.addFields({kmsi:r},n)}setAccountKeys(e,n,r=gf){e.length===0?this.removeItem(Va(r)):this.setItem(Va(r),JSON.stringify(e),n)}getAccountKeys(){return gs(this.browserStorage)}addAccountKeyToMap(e,n){this.logger.trace("0rb85k",n),this.logger.tracePii("1l9bdo",n);const r=this.getAccountKeys();return r.indexOf(e)===-1?(r.push(e),this.setItem(Va(),JSON.stringify(r),n),this.logger.verbose("0xia39",n),!0):(this.logger.verbose("0161kk",n),!1)}removeAccountKeyFromMap(e,n){this.logger.trace("1jpigu",n),this.logger.tracePii("1xzspl",n);const r=this.getAccountKeys(),i=r.indexOf(e);i>-1?(r.splice(i,1),this.setAccountKeys(r,n)):this.logger.trace("1dytu2",n)}removeAccount(e,n){const r=this.getActiveAccount(n);(r==null?void 0:r.homeAccountId)===e.homeAccountId&&(r==null?void 0:r.environment)===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(i=>{i.includes(e.homeAccountId)&&i.includes(e.environment)&&this.browserStorage.removeItem(i)})}removeIdToken(e,n){super.removeIdToken(e,n);const r=this.getTokenKeys(),i=r.idToken.indexOf(e);i>-1&&(this.logger.info("05udv9",n),r.idToken.splice(i,1),this.setTokenKeys(r,n))}removeAccessToken(e,n,r=!0){super.removeAccessToken(e,n),r&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,r=en){this.logger.trace("17o18n",n);const i=this.getTokenKeys(r);let s=0;if(e.forEach(o=>{const a=i.accessToken.indexOf(o);a>-1&&(i.accessToken.splice(a,1),s++)}),s>0){this.logger.info("15i5d5",n),this.setTokenKeys(i,n,r);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const r=this.getTokenKeys(),i=r.refreshToken.indexOf(e);i>-1&&(this.logger.info("1f4fq3",n),r.refreshToken.splice(i,1),this.setTokenKeys(r,n))}getTokenKeys(e=en){return Ir(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,r=en){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(Ha(this.clientId,r));return}else this.setItem(Ha(this.clientId,r),JSON.stringify(e),n)}getIdTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("1jukz6",n),this.removeIdToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!d3(i)?(this.logger.trace("1jukz6",n),null):(this.logger.trace("01ju66",n),i)}async setIdTokenCredential(e,n,r){this.logger.trace("13hjll",n);const i=this.generateCredentialKey(e),s=Date.now().toString();e.lastUpdatedAt=s,await this.setUserData(i,JSON.stringify(e),n,s,r);const o=this.getTokenKeys();o.idToken.indexOf(i)===-1&&(this.logger.info("07jy92",n),o.idToken.push(i),this.setTokenKeys(o,n))}getAccessTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("0bqvx8",n),this.removeAccessTokenKeys([e],n),null;const i=this.validateAndParseJson(r);return!i||!A1(i)?(this.logger.trace("0bqvx8",n),null):(this.logger.trace("1o81rl",n),i)}async setAccessTokenCredential(e,n,r){this.logger.trace("1pondb",n);const i=this.generateCredentialKey(e),s=Date.now().toString();e.lastUpdatedAt=s,await this.setUserData(i,JSON.stringify(e),n,s,r);const o=this.getTokenKeys(),a=o.accessToken.indexOf(i);a!==-1&&o.accessToken.splice(a,1),this.logger.trace("1onhey",n),o.accessToken.push(i),this.setTokenKeys(o,n)}getRefreshTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("0jlizt",n),this.removeRefreshToken(e,n),null;const i=this.validateAndParseJson(r);return!i||!P1(i)?(this.logger.trace("0jlizt",n),null):(this.logger.trace("0nokxi",n),i)}async setRefreshTokenCredential(e,n,r){this.logger.trace("0tcg8d",n);const i=this.generateCredentialKey(e),s=Date.now().toString();e.lastUpdatedAt=s,await this.setUserData(i,JSON.stringify(e),n,s,r);const o=this.getTokenKeys();o.refreshToken.indexOf(i)===-1&&(this.logger.info("0eckjs",n),o.refreshToken.push(i),this.setTokenKeys(o,n))}getAppMetadata(e,n){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("1q101h",n),null;const i=this.validateAndParseJson(r);return!i||!m3(e,i)?(this.logger.trace("1q101h",n),null):(this.logger.trace("19pvg2",n),i)}setAppMetadata(e,n){this.logger.trace("0cyma6",n);const r=g3(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e,n){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("0jk19c",n),null;const i=this.validateAndParseJson(r);return!i||!f3(e,i)?(this.logger.trace("0jk19c",n),null):(this.logger.trace("12jguk",n),i)}setServerTelemetry(e,n,r){this.logger.trace("1poh61",r),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e,n){const r=this.internalStorage.getItem(e);if(!r)return this.logger.trace("1r39oe",n),null;const i=this.validateAndParseJson(r);return i&&O3(e,i)?(this.logger.trace("1ohvk3",n),i):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(ud.WRAPPER_SKU,e),this.internalStorage.setItem(ud.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(ud.WRAPPER_SKU)||"",n=this.internalStorage.getItem(ud.WRAPPER_VER)||"";return[e,n]}setAuthorityMetadata(e,n,r){this.logger.trace("07w8n2",r),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(g1.ACTIVE_ACCOUNT_FILTERS),r=this.browserStorage.getItem(n);if(!r)return this.logger.trace("08gw0e",e),null;const i=this.validateAndParseJson(r);return i?(this.logger.trace("1t3ch7",e),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId,tenantId:i.tenantId},e)):(this.logger.trace("0me1up",e),null)}setActiveAccount(e,n){const r=this.generateCacheKey(g1.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("0rsj80",n);const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.setItem(r,JSON.stringify(i),n)}else this.logger.verbose("1bp5z5",n),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(be.ACTIVE_ACCOUNT_CHANGED,n)}getThrottlingCache(e,n){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("1h4wa6",n),null;const i=this.validateAndParseJson(r);return!i||!p3(e,i)?(this.logger.trace("1h4wa6",n),null):(this.logger.trace("0of6n8",n),i)}setThrottlingCache(e,n,r){this.logger.trace("0wfgh6",r),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n,r){this.logger.trace("1ordf8",n);const i=r?this.generateCacheKey(e):e;return this.temporaryCacheStorage.getItem(i)}setTemporaryCache(e,n,r){const i=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(i,n)}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e)}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(Qt)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(Qt)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}generateCacheKey(e){return jr.startsWith(e,Qt)?e:`${Qt}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===Ut.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==Be.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${Qt}.${en}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",r].join(tC).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${Qt}.${gf}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(tC).toLowerCase()}resetRequestCache(e){this.logger.trace("0h0ynu",e),this.removeTemporaryItem(this.generateCacheKey(_t.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(_t.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(_t.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(_t.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(_t.NATIVE_REQUEST)),this.setInteractionInProgress(!1,void 0)}cacheAuthorizeRequest(e,n,r){this.logger.trace("1tzef5",n);const i=Qu(JSON.stringify(e));if(this.setTemporaryCache(_t.REQUEST_PARAMS,i,!0),r){const s=Qu(r);this.setTemporaryCache(_t.VERIFIER,s,!0)}}getCachedRequest(e){this.logger.trace("0uen20",e);const n=this.getTemporaryCache(_t.REQUEST_PARAMS,e,!0);if(!n)throw se(aX);const r=this.getTemporaryCache(_t.VERIFIER,e,!0);let i,s="";try{i=JSON.parse(gn(n)),r&&(s=gn(r))}catch{throw this.logger.errorPii("0ewsey",e),this.logger.error("0tvdic",e),se(lX)}return[i,s]}getCachedNativeRequest(){this.logger.trace("1yxcdm","");const e=this.getTemporaryCache(_t.NATIVE_REQUEST,"",!0);if(!e)return this.logger.trace("0mnxd4",""),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("0rrkip",""),null)}isInteractionInProgress(e){var r;const n=(r=this.getInteractionInProgress())==null?void 0:r.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${Qt}.${_t.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,"",!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("0jjyys",""),this.removeTemporaryItem(e),this.resetRequestCache(""),DN(window),null}}setInteractionInProgress(e,n=ws.SIGNIN,r=!1,i=""){var o;const s=`${Qt}.${_t.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())if(r)this.logger.warning("1pmscr",i),jX(this.logger,i),this.removeTemporaryItem(s);else throw se(K4);this.setTemporaryCache(s,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&((o=this.getInteractionInProgress())==null?void 0:o.clientId)===this.clientId&&this.removeTemporaryItem(s)}async hydrateCache(e,n){const r=Lg(e.account.homeAccountId,e.account.environment,e.idToken,this.clientId,e.tenantId),i=Dg(e.account.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?pp(e.expiresOn):0,e.extExpiresOn?pp(e.extExpiresOn):0,gn,void 0,e.tokenType,void 0,n.sshKid);n.resource&&(i.resource=n.resource);const s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId,Di(di(e.idToken,gn)),$e.hydrateCache)}async saveCacheRecord(e,n,r,i,s){try{await super.saveCacheRecord(e,n,r,i,s)}catch(o){if(o instanceof Fa&&this.performanceClient&&n)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},n)}catch{}throw o}}}function aC(t,e,n,r){try{switch(e){case Ur.LocalStorage:return new lW(t,n,r);case Ur.SessionStorage:return new cW;case Ur.MemoryStorage:default:break}}catch(i){n.error(i,"")}return new Wg}const hW=(t,e,n,r)=>{const i={cacheLocation:Ur.MemoryStorage,cacheRetentionDays:5};return new Mb(t,i,up,e,n,r)};/*! @azure/msal-browser v5.10.0 2026-05-07 */function dW(t,e,n,r,i){return t.verbose("1yd030",r),n?e.getAllAccounts(i,r):[]}function fW(t,e,n,r){e.trace("0u7b90",r);const i=n.getAccountInfoFilteredBy(t,r);return i?(e.verbose("0btgll",r),i):(e.verbose("0ltaj5",r),null)}function pW(t,e,n){e.setActiveAccount(t,n)}function gW(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const mW="msal.broadcast.event";class OW{constructor(e){this.eventCallbacks=new Map,this.logger=e||new ki({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(mW)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,r){if(typeof window<"u"){const i=r||Nb();return this.eventCallbacks.has(i)?(this.logger.error("1578i0",""),null):(this.eventCallbacks.set(i,[e,n||[]]),this.logger.verbose("1cnec4",""),i)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose("12zotd","")}emitEvent(e,n,r,i,s){var a;const o={eventType:e,interactionType:r||null,payload:i||null,error:s||null,correlationId:n,timestamp:Date.now()};switch(e){case be.LOGIN_SUCCESS:case be.LOGOUT_SUCCESS:case be.ACTIVE_ACCOUNT_CHANGED:(a=this.broadcastChannel)==null||a.postMessage(o)}this.invokeCallbacks(o)}invokeCallbacks(e){this.eventCallbacks.forEach(([n,r],i)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose("15jpwk",""),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class ZN{constructor(e,n,r,i,s,o,a,l,c){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=o,this.platformAuthProvider=c,this.correlationId=l,this.logger=i.clone(hr.MSAL_SKU,jo),this.performanceClient=a}}function bp(t,e,n,r){n.verbose("0bd1la",r);const i=t||e||"";return Le.getAbsoluteUrl(i,_s())}function Sn(t,e,n,r,i,s){i.verbose("1p12tq",n);const o={clientId:e,correlationId:n,apiId:t,forceRefresh:!1,wrapperSKU:r.getWrapperMetadata()[0],wrapperVer:r.getWrapperMetadata()[1]};return new $u(o,r)}async function Bi(t,e,n,r,i,s,o,a,l){const c=a&&a.hasOwnProperty("instance_aware")?a.instance_aware:void 0,u={protocolMode:t.system.protocolMode,OIDCOptions:t.auth.OIDCOptions,knownAuthorities:t.auth.knownAuthorities,cloudDiscoveryMetadata:t.auth.cloudDiscoveryMetadata,authorityMetadata:t.auth.authorityMetadata},h=s||t.auth.authority,d=c!=null&&c.length?c==="true":t.auth.instanceAware,f=l&&d?t.auth.authority.replace(Le.getDomainFromUrl(h),l.environment):h,p=_n.generateAuthority(f,o||t.auth.azureCloudOptions),g=await Z(yN,T4,i,n,e)(p,t.system.networkClient,r,u,i,e,n);if(l&&!g.isAlias(l.environment))throw et(s5);return g}async function Hk(t,e,n,r,i){if(i)try{t.removeAccount(i,r),n.verbose("0s4z6h",r)}catch{n.error("0mgg1d",r)}else try{n.verbose("0zj631",r),t.clear(r),await e.clearKeystore(r)}catch{n.error("12ih0c",r)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */async function Yk(t,e,n,r,i){const s=t.authority||e.auth.authority,o=[...t&&t.scopes||[]],a={...t,correlationId:t.correlationId,authority:s,scopes:o};if(!a.authenticationScheme)a.authenticationScheme=Be.BEARER,r.verbose("1l4fwv",i);else{if(a.authenticationScheme===Be.SSH){if(!t.sshJwk)throw et(uk);if(!t.sshKid)throw et(n5)}r.verbose("1ecmns",i)}return a}async function yW(t,e,n,r,i){const s=await Z(Yk,$k,i,r,t.correlationId)(t,n,r,i,t.correlationId);return{...t,...s,account:e,forceRefresh:t.forceRefresh||!1}}function FN(t,e){let n;const r=t.httpMethod;if(e===Dn.EAR){if(r&&r!==Za.POST)throw et(o5);n=Za.POST}else n=r||Za.GET;return n}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Fl extends ZN{initializeLogoutRequest(e){this.logger.verbose("0546u4",this.correlationId);const n={correlationId:this.correlationId,...e};if(e)if(e.logoutHint)this.logger.verbose("12k4l4",this.correlationId);else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("0st5di",this.correlationId),n.logoutHint=r)}else this.logger.verbose("0pdtc3",this.correlationId);else this.logger.verbose("07ndze",this.correlationId);return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("1vamm6",n.correlationId),n.postLogoutRedirectUri=Le.getAbsoluteUrl(e.postLogoutRedirectUri,_s())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("15m5g7",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("1f4xlz",n.correlationId),n.postLogoutRedirectUri=Le.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,_s())):(this.logger.verbose("17s5rf",n.correlationId),n.postLogoutRedirectUri=Le.getAbsoluteUrl(_s(),_s())):this.logger.verbose("0ljv63",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("0mvp54",this.correlationId)}else this.logger.verbose("1e7bdp",this.correlationId);return null}async createAuthCodeClient(e){const n=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)(e);return new bN(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:o}=e,a=e.authority||await Z(Bi,To,this.logger,this.performanceClient,this.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,i,s,o),l=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri,isMcp:this.config.auth.isMcp},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:l.loggerCallback,piiLoggingEnabled:l.piiLoggingEnabled,logLevel:l.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:hr.MSAL_SKU,version:jo,cpu:"",os:""},telemetry:this.config.telemetry}}}async function Lu(t,e,n,r,i,s,o,a){const l=bp(t.redirectUri,n.auth.redirectUri,s,a);new URL(l).origin!==new URL(window.location.href).origin&&(s.warning("08qbvw",a),o.addFields({isRedirectUriCrossOrigin:!0},a));const c={interactionType:e},u=Tk(r,t&&t.state||"",c),d={...await Z(Yk,$k,s,o,a)({...t,correlationId:a},n,o,s,a),redirectUri:l,state:u,nonce:t.nonce||Xs(),responseMode:n.auth.OIDCOptions.responseMode},f={...d,httpMethod:FN(d,n.system.protocolMode)};if(t.loginHint||t.sid)return f;const p=t.account||i.getActiveAccount(a);return p&&(s.verbose("1eqlb3",a),s.verbosePii("0tf99t",a),f.account=p),f}/*! @azure/msal-browser v5.10.0 2026-05-07 */function bW(t,e){if(!e)return null;try{return kh(t.base64Decode,e).libraryState.meta}catch{throw Y(Ru)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function Jc(t,e,n,r){const i=cp(t);if(!i)throw eN(t)?(n.error("13pl0s",r),n.errorPii("1097vx",r),se(q4)):(n.error("18h0l1",r),se(Y4));return i}function wW(t,e,n){if(!t.state)throw se(Dk);const r=bW(e,t.state);if(!r)throw se(_N);if(r.interactionType!==n)throw se(G4)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class XN{constructor(e,n,r,i,s){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=i,this.performanceClient=s}async handleCodeResponse(e,n,r){let i;try{i=n4(e,n.state)}catch(s){throw s instanceof Go&&s.subError===Ib?se(Ib):s}return Z(this.handleCodeResponseFromServer.bind(this),lN,this.logger,this.performanceClient,n.correlationId)(i,n,r)}async handleCodeResponseFromServer(e,n,r,i=!0){if(this.logger.trace("0mf2hb",n.correlationId),this.authCodeRequest.code=e.code,i&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const o=this.createCcsCredentials(n);o&&(this.authCodeRequest.ccsCredential=o)}return await Z(this.authModule.acquireToken.bind(this.authModule),_4,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,r,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Lr.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Lr.UPN}:null}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const SW="ContentError",kW="PageException",vW="user_switch";/*! @azure/msal-browser v5.10.0 2026-05-07 */const xW="USER_INTERACTION_REQUIRED",CW="USER_CANCEL",EW="NO_NETWORK",_W="DISABLED",TW="ACCOUNT_UNAVAILABLE",AW="UX_NOT_ALLOWED";/*! @azure/msal-browser v5.10.0 2026-05-07 */const PW=-2147186943;class li extends He{constructor(e,n,r){super(e,n||Fg(e)),Object.setPrototypeOf(this,li.prototype),this.name="NativeAuthError",this.ext=r}}function ua(t){if(t.ext&&t.ext.status&&t.ext.status===_W||t.ext&&t.ext.error&&t.ext.error===PW)return!0;switch(t.errorCode){case SW:case kW:return!0;default:return!1}}function wp(t,e,n){if(n&&n.status)switch(n.status){case TW:return mp(D3,Fg(t));case xW:return new vr(t,e);case CW:return se(Ib);case EW:return se(Rb);case AW:return mp(uN)}return new li(t,e,n)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class WN extends Fl{async acquireToken(e){const n=Sn($e.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),r=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),i=new J3(r,this.performanceClient);this.logger.verbose("0wa871",this.correlationId);try{const o=(await Z(i.acquireCachedToken.bind(i),x4,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(s){throw s instanceof vh&&s.errorCode===AN&&this.logger.verbose("06wena",this.correlationId),s}}logout(e){this.logger.verbose("1rkurh",this.correlationId);const n=this.initializeLogoutRequest(e);return Hk(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,n.account)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Of extends ZN{constructor(e,n,r,i,s,o,a,l,c,u,h,d){super(e,n,r,i,s,o,l,d,c),this.apiId=a,this.accountId=u,this.platformAuthProvider=c,this.nativeStorageManager=h,this.silentCacheClient=new WN(e,this.nativeStorageManager,r,i,s,o,l,d,c);const f=this.platformAuthProvider.getExtensionName();this.skus=$u.makeExtraSkuString({libraryName:hr.MSAL_SKU,libraryVersion:jo,extensionName:f,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[ZF]:this.skus}}async acquireToken(e,n){this.logger.trace("03qeos",this.correlationId);const r=this.performanceClient.startMeasurement(Nk,this.correlationId),i=Wr(),s=Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const o=await this.initializePlatformRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch(l){if(n===dn.AccessToken)throw this.logger.info("0eitbc",this.correlationId),r.end({success:!1,brokerErrorCode:"cache_request_failed"}),l;this.logger.info("0957j1",this.correlationId)}const a=await this.platformAuthProvider.sendMessage(o);return await this.handleNativeResponse(a,o,i).then(l=>(r.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),s.clearNativeBrokerErrorCode(),l)).catch(l=>{throw r.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError}),l})}catch(o){throw o instanceof li&&s.setNativeBrokerErrorCode(o.errorCode),r.end({success:!1}),o}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:rn.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("1ndf3e",this.correlationId),Y(S1);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},this.correlationId);if(!r)throw Y(S1);try{const i=this.createSilentCacheRequest(n,r),s=await this.silentCacheClient.acquireToken(i),o=this.browserStorage.getIdToken(r,this.correlationId,this.browserStorage.getTokenKeys(),r.tenantId),a=di((o==null?void 0:o.secret)||"",gn),l=hp(r,void 0,a,o==null?void 0:o.secret);return{...s,idToken:(o==null?void 0:o.secret)||"",idTokenClaims:a,account:l}}catch(i){throw i}}async acquireTokenRedirect(e,n,r){this.logger.trace("0luikq",this.correlationId);const i=await this.initializePlatformRequest(e),s=(r==null?void 0:r.navigateToLoginRequestUrl)??!0;try{await this.platformAuthProvider.sendMessage(i)}catch(l){if(l instanceof li&&(Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).setNativeBrokerErrorCode(l.errorCode),ua(l)))throw l}this.browserStorage.setTemporaryCache(_t.NATIVE_REQUEST,JSON.stringify(i),!0);const o={apiId:$e.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=s?window.location.href:bp(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId);n.end({success:!0}),await this.navigationClient.navigateExternal(a,o)}async handleRedirectPromise(){var s,o;if(this.logger.trace("1c5lhw",this.correlationId),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",this.correlationId),null;const e=this.browserStorage.getCachedNativeRequest();if(!e)return this.logger.verbose("0a6zjb",this.correlationId),(s=this.performanceClient)==null||s.addFields({errorCode:"no_cached_request"},this.correlationId),null;const{prompt:n,...r}=e;n&&this.logger.verbose("0ac34v",this.correlationId),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(_t.NATIVE_REQUEST));const i=Wr();try{this.logger.verbose("003x5a",this.correlationId);const a=await this.platformAuthProvider.sendMessage(r),l=await this.handleNativeResponse(a,r,i);return Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).clearNativeBrokerErrorCode(),(o=this.performanceClient)==null||o.addFields({isNativeBroker:!0},this.correlationId),l}catch(a){throw a}}logout(){return this.logger.trace("0u2sjm",this.correlationId),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var u,h;this.logger.trace("1bojln",this.correlationId);const i=di(e.id_token,gn),s=this.createHomeAccountIdentifier(e,i),o=(u=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:u.homeAccountId;if((h=n.extraParameters)!=null&&h.child_client_id&&e.account.id!==n.accountId)this.logger.info("1ub1in",this.correlationId);else if(s!==o&&e.account.id!==n.accountId)throw wp(vW);const a=await Bi(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,n.authority),l=dN(this.browserStorage,a,s,gn,this.correlationId,i,e.client_info,a.getPreferredCache(),i.tid,void 0,e.account.id,this.logger,this.performanceClient);e.expires_in=Number(e.expires_in);const c=await this.generateAuthenticationResult(e,n,i,l,a.canonicalAuthority,r);return await this.cacheAccount(l,Di(i)),await this.cacheNativeTokens(e,n,s,i,c.tenantId,r,a.getPreferredCache()),c}createHomeAccountIdentifier(e,n){return iN(e.client_info||"",$r.Default,this.logger,this.browserCrypto,this.correlationId,n)}generateScopes(e,n){return n?rn.fromString(n):rn.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===Be.POP&&n.signPopToken){if(e.shr)return this.logger.trace("0coqhu",this.correlationId),e.shr;const r=new gl(this.browserCrypto,this.performanceClient),i={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce,correlationId:this.correlationId};if(!n.keyId)throw Y(UR);return r.signPopToken(e.access_token,n.keyId,i)}else return e.access_token}async generateAuthenticationResult(e,n,r,i,s,o){const a=this.addTelemetryFromNativeResponse(e.properties.MATS),l=this.generateScopes(n.scope,e.scope),c=e.account.properties||{},u=c.UID||r.oid||r.sub||"",h=c.TenantId||r.tid||"",d=hp(Do(i),void 0,r,e.id_token);d.nativeAccountId!==e.account.id&&(d.nativeAccountId=e.account.id);const f=await this.generatePopAccessToken(e,n),p=n.tokenType===Be.POP?Be.POP:Be.BEARER;return{authority:s,uniqueId:u,tenantId:h,scopes:l.asArray(),account:d,idToken:e.id_token,idTokenClaims:r,accessToken:f,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:ff(o+e.expires_in),tokenType:p,correlationId:this.correlationId,state:e.state,fromPlatformBroker:!0,...n.resource&&{resource:n.resource}}}async cacheAccount(e,n){await this.browserStorage.setAccount(e,this.correlationId,n,this.apiId),this.browserStorage.removeAccountContext(Do(e),this.correlationId)}async cacheNativeTokens(e,n,r,i,s,o,a){var p;const l=Lg(r,a,e.id_token||"",n.clientId,i.tid||""),c=n.tokenType===Be.POP?h1:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=o+c,h=this.generateScopes(e.scope,n.scope),d=Dg(r,a,e.access_token,n.clientId,i.tid||s,h.printScopes(),u,0,gn,void 0,n.tokenType,void 0,n.keyId);l&&((p=n.storeInCache)==null?void 0:p.idToken)!==!1&&await this.browserStorage.setIdTokenCredential(l,this.correlationId,Di(i));const f={accessToken:d};return this.nativeStorageManager.saveCacheRecord(f,this.correlationId,Di(i),this.apiId,n.storeInCache)}getExpiresInValue(e,n){return e===Be.POP?h1:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("0b3l57",this.correlationId)}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("1okqev",this.correlationId),!1):!!e.is_cached}async initializePlatformRequest(e){this.logger.trace("1xdm2a",this.correlationId);const n=await this.getCanonicalAuthority(e),r=e.skipBrokerClaims&&e.embeddedClientId?void 0:this.config.auth.clientCapabilities,{scopes:i,claims:s,...o}=e,a=new rn(i||[]);a.appendScopes(jl);const l=r&&r.length?YR(s,r):s,c={...o,claims:l,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:a.printScopes(),redirectUri:bp(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw se(bX);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=dr.MATS_TELEMETRY,e.authenticationScheme===Be.POP){const u={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce,correlationId:this.correlationId},h=new gl(this.browserCrypto,this.performanceClient);let d;if(c.keyId)d=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const f=await Z(h.generateCnf.bind(h),Sh,this.logger,this.performanceClient,this.correlationId)(u,this.logger);d=f.reqCnfString,c.keyId=f.kid,c.signPopToken=!0}c.reqCnf=d}return this.addRequestSKUs(c),c}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority,{azureCloudOptions:r,account:i}=e;i&&await Bi(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,n,r,void 0,i);const s=new Le(n);return s.validateAsUri(),s}getPrompt(e){switch(this.apiId){case $e.ssoSilent:case $e.acquireTokenSilent_silentFlow:return this.logger.trace("12n1y2",this.correlationId),yn.NONE}if(!e){this.logger.trace("0uid1p",this.correlationId);return}switch(e){case yn.NONE:case yn.CONSENT:case yn.LOGIN:return this.logger.trace("0i0hco",this.correlationId),e;default:throw this.logger.trace("0w3tpw",this.correlationId),se(OX)}}handleExtraBrokerParams(e){var s;const n=e.extraParameters&&e.extraParameters.hasOwnProperty(Iu)&&e.extraParameters.hasOwnProperty(ap)&&e.extraParameters.hasOwnProperty(Lo);if(!e.embeddedClientId&&!n)return;let r="";const i=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[ap],r=e.extraParameters[Lo]),e.extraParameters={child_client_id:r,child_redirect_uri:i},(s=this.performanceClient)==null||s.addFields({embeddedClientId:r,embeddedRedirectUri:i},this.correlationId)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const IW=new Map([["e","AAD"],["m","MSA"]]);function RW(t){var e,n,r,i,s;if(!t)return null;try{const l=(/%(?:[0-9A-Fa-f]{2})/.test(t)?decodeURIComponent(t):t).split("|");return l.length<5?null:{accountType:IW.get(((e=l[0])==null?void 0:e.trim())||"")||"",error:((n=l[1])==null?void 0:n.trim())||"",subError:((r=l[2])==null?void 0:r.trim())||"",cloudInstance:((i=l[3])==null?void 0:i.trim())||"",callerDataBoundary:((s=l[4])==null?void 0:s.trim())||""}}catch{return null}}function VN(t,e,n){const r=RW(t.clientdata);r!=null&&r.accountType&&n.addFields({accountType:r.accountType},e),r!=null&&r.error&&n.addFields({serverErrorNo:r.error},e),r!=null&&r.subError&&n.addFields({serverSubErrorNo:r.subError},e)}async function qk(t,e,n,r,i){const s=t4({...t.auth,authority:e},n,r,i);if(mk(s,{sku:hr.MSAL_SKU,version:jo,os:"",cpu:""}),t.system.protocolMode!==Dn.OIDC&&Ok(s,t.telemetry.application),n.platformBroker&&(_5(s),i.addFields({isPlatformAuthorizeRequest:!0},n.correlationId),n.authenticationScheme===Be.POP)){const o=new Hi(r,i),a=new gl(o,i);let l;n.popKid?l=o.encodeKid(n.popKid):l=(await Z(a.generateCnf.bind(a),Sh,r,i,n.correlationId)(n,r)).reqCnfString,wk(s,l)}return $g(s,n.correlationId,i),s}async function Gk(t,e,n,r,i){if(!n.codeChallenge)throw et($R);const s=await Z(qk,C4,r,i,n.correlationId)(t,e,n,r,i);return hk(s,ik.CODE),yk(s,n.codeChallenge,rk),bi(s,{...n.extraQueryParameters,...n.extraParameters}),Ak(e,s)}async function Kk(t,e,n,r,i,s){if(!r.earJwk)throw se(EN);const o=await qk(e,n,r,i,s);hk(o,ik.IDTOKEN_TOKEN_REFRESHTOKEN),D5(o,r.earJwk),yk(o,r.codeChallenge,rk),bi(o,{...r.extraParameters});const a=new Map;bi(a,r.extraQueryParameters||{}),bh(a,r.correlationId);const l=Ak(n,a);return HN(t,l,o)}async function Jk(t,e,n,r,i,s){const o=await qk(e,n,r,i,s);hk(o,ik.CODE),yk(o,r.codeChallenge,r.codeChallengeMethod||rk),bi(o,{...r.extraParameters});const a=new Map;bi(a,r.extraQueryParameters||{}),bh(a,r.correlationId);const l=Ak(n,a);return HN(t,l,o)}function HN(t,e,n){const r=t.createElement("form");return r.method="post",r.action=e,n.forEach((i,s)=>{const o=t.createElement("input");o.hidden=!0,o.name=s,o.value=i,r.appendChild(o)}),t.body.appendChild(r),r}async function YN(t,e,n,r,i,s,o,a,l,c){if(a.verbose("11qcow",t.correlationId),!c)throw se(IN);const u=new Hi(a,l),h=new Of(r,i,u,a,o,r.system.navigationClient,n,l,c,e,s,t.correlationId),{userRequestState:d}=kh(u.base64Decode,t.state);return Z(h.acquireToken.bind(h),Nk,a,l,t.correlationId)({...t,state:d,prompt:void 0})}async function Ya(t,e,n,r,i,s,o,a,l,c,u,h){if(ai.removeThrottle(o,i.auth.clientId,t),VN(e,t.correlationId,u),e.accountId)return Z(YN,kN,c,u,t.correlationId)(t,e.accountId,r,i,o,a,l,c,u,h);const d={...t,code:e.code||"",codeVerifier:n},f=new XN(s,o,d,c,u);return await Z(f.handleCodeResponse.bind(f),E4,c,u,t.correlationId)(e,t,r)}async function ev(t,e,n,r,i,s,o,a,l,c,u){if(ai.removeThrottle(s,r.auth.clientId,t),VN(e,t.correlationId,c),Pk(e,t.state),!e.ear_jwe)throw se(H4);if(!t.earJwk)throw se(EN);const h=JSON.parse(await Z($X,U4,l,c,t.correlationId)(t.earJwk,e.ear_jwe));if(h.accountId)return Z(YN,kN,l,c,t.correlationId)(t,h.accountId,n,r,s,o,a,l,c,u);const d=new zo(r.auth.clientId,s,new Hi(l,c),l,c,null,null);d.validateTokenResponse(h,t.correlationId);const f={code:"",state:t.state,nonce:t.nonce,client_info:h.client_info,cloud_graph_host_name:h.cloud_graph_host_name,cloud_instance_host_name:h.cloud_instance_host_name,cloud_instance_name:h.cloud_instance_name,msgraph_host:h.msgraph_host};return await Z(d.handleServerTokenResponse.bind(d),Ek,l,c,t.correlationId)(h,i,Wr(),t,n,f,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v5.10.0 2026-05-07 */const NW=32;async function Uo(t,e,n){const r=Jn($W,$4,e,t,n)(t,e,n),i=await Z(MW,M4,e,t,n)(r,t,e,n);return{verifier:r,challenge:i}}function $W(t,e,n){try{const r=new Uint8Array(NW);return Jn(AX,L4,e,t,n)(r),Fs(r)}catch{throw se(CN)}}async function MW(t,e,n,r){try{const i=await Z($N,Q4,n,e,r)(t);return Fs(new Uint8Array(i))}catch{throw se(CN)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class Sp{navigateInternal(e,n){return Sp.defaultNavigateWindow(e,n)}navigateExternal(e,n){return Sp.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((r,i)=>{setTimeout(()=>{i(se(yp,"failed_to_redirect"))},n.timeout)})}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class QW{async sendGetRequestAsync(e,n){let r,i={},s=0;const o=lC(n);try{r=await fetch(e,{method:F1.GET,headers:o})}catch(a){throw Qc(se(window.navigator.onLine?uX:Rb),void 0,void 0,a)}i=cC(r.headers);try{return s=r.status,{headers:i,body:await r.json(),status:s}}catch(a){throw Qc(se(H1),s,i,a)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",i=lC(n);let s,o=0,a={};try{s=await fetch(e,{method:F1.POST,headers:i,body:r})}catch(l){throw Qc(se(window.navigator.onLine?cX:Rb),void 0,void 0,l)}a=cC(s.headers);try{return o=s.status,{headers:a,body:await s.json(),status:o}}catch(l){throw Qc(se(H1),o,a,l)}}}function lC(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,i])=>{e.append(r,i)}),e}catch(e){throw Qc(se(wX),void 0,void 0,e)}}function cC(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw se(SX)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */const LW=6e4,DW=1e4,zW=3e4,qN=2e3;function BW({auth:t,cache:e,system:n,experimental:r,telemetry:i},s){const o={clientId:"",authority:`${wR}`,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:"",postLogoutRedirectUri:"",clientCapabilities:[],OIDCOptions:{responseMode:sk.FRAGMENT,defaultScopes:[kR,vR,nk]},azureCloudOptions:{azureCloudInstance:Sk.None,tenant:""},instanceAware:!1,isMcp:!1,verifySSO:!1},a={cacheLocation:Ur.SessionStorage,cacheRetentionDays:5},l={loggerCallback:()=>{},logLevel:at.Info,piiLoggingEnabled:!1},u={...{...oN,loggerOptions:l,networkClient:s?new QW:e4,navigationClient:new Sp,popupBridgeTimeout:(n==null?void 0:n.popupBridgeTimeout)||LW,iframeBridgeTimeout:(n==null?void 0:n.iframeBridgeTimeout)||DW,redirectNavigationTimeout:zW,allowRedirectInIframe:!1,navigatePopups:!0,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||qN,protocolMode:Dn.AAD},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||l},h={application:{appName:"",appVersion:""},client:new sN},d={iframeTimeoutTelemetry:!1};if((n==null?void 0:n.protocolMode)!==Dn.OIDC&&(t!=null&&t.OIDCOptions)&&new ki(u.loggerOptions).warning(JSON.stringify(et(r5)),""),n!=null&&n.protocolMode&&n.protocolMode===Dn.OIDC&&(u!=null&&u.allowPlatformBroker))throw et(i5);return{auth:{...o,...t,OIDCOptions:{...o.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...a,...e},system:u,experimental:{...d,...r},telemetry:{...h,...i}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class kp{constructor(e,n,r,i){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=this.performanceClient.startMeasurement(R4),this.platformAuthType=dr.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace("0on4p2",e.correlationId);const n={method:yc.GetToken,request:e},r={channel:dr.CHANNEL_ID,extensionId:this.extensionId,responseId:Xs(),body:n};this.logger.trace("1qadfi",e.correlationId),this.logger.tracePii("1xm533",e.correlationId),this.messageChannel.port1.postMessage(r);const i=await new Promise((o,a)=>{this.resolvers.set(r.responseId,{resolve:o,reject:a})});return this.validatePlatformBrokerResponse(i)}static async createProvider(e,n,r,i){e.trace("15zfnw",i);try{const s=new kp(e,n,r,dr.PREFERRED_EXTENSION_ID);return await s.sendHandshakeRequest(i),s}catch{const o=new kp(e,n,r);return await o.sendHandshakeRequest(i),o}}async sendHandshakeRequest(e){this.logger.trace("1dpg9o",e),window.addEventListener("message",this.windowListener,!1);const n={channel:dr.CHANNEL_ID,extensionId:this.extensionId,responseId:Xs(),body:{method:yc.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=r=>{this.onChannelMessage(r)},window.postMessage(n,window.origin,[this.messageChannel.port2]),new Promise((r,i)=>{this.handshakeResolvers.set(n.responseId,{resolve:r,reject:i}),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}),i(se(gX)),this.handshakeResolvers.delete(n.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){const n=Nb();if(this.logger.trace("0jpn5u",n),e.source!==window)return;const r=e.data;if(!(!r.channel||r.channel!==dr.CHANNEL_ID)&&!(r.extensionId&&r.extensionId!==this.extensionId)&&r.body.method===yc.HandshakeRequest){const i=this.handshakeResolvers.get(r.responseId);if(!i){this.logger.trace("07buhm",n);return}this.logger.verbose(r.extensionId?"0xrkug":"No extension installed",n),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),i.reject(se(mX))}}onChannelMessage(e){const n=Nb();this.logger.trace("1py8yf",n);const r=e.data,i=this.resolvers.get(r.responseId),s=this.handshakeResolvers.get(r.responseId);try{const o=r.body.method;if(o===yc.Response){if(!i)return;const a=r.body.response;if(this.logger.trace("19hpgm",n),this.logger.tracePii("179a24",n),a.status!=="Success")i.reject(wp(a.code,a.description,a.ext));else if(a.result)a.result.code&&a.result.description?i.reject(wp(a.result.code,a.result.description,a.result.ext)):i.resolve(a.result);else throw xb(Ab,"Event does not contain result.");this.resolvers.delete(r.responseId)}else if(o===yc.HandshakeResponse){if(!s){this.logger.trace("082qnt",n);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=r.extensionId,this.extensionVersion=r.body.version,this.logger.verbose("0yf5ib",n),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),s.resolve(),this.handshakeResolvers.delete(r.responseId)}}catch(o){this.logger.error("0xf978",n),this.logger.errorPii("04i99o",n),this.logger.errorPii("0xdvsy",n),i?i.reject(o):s&&s.reject(o)}}validatePlatformBrokerResponse(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 xb(Ab,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){var e;return this.getExtensionId()===dr.PREFERRED_EXTENSION_ID?"chrome":(e=this.getExtensionId())!=null&&e.length?"unknown":void 0}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class tv{constructor(e,n,r){this.logger=e,this.performanceClient=n,this.correlationId=r,this.platformAuthType=dr.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,r){var i;if(e.trace("12mj4a",r),(i=window.navigator)!=null&&i.platformAuthentication){const s=await window.navigator.platformAuthentication.getSupportedContracts(dr.MICROSOFT_ENTRA_BROKERID);if(s!=null&&s.includes(dr.PLATFORM_DOM_APIS))return e.trace("1h5q1r",r),new tv(e,n,r)}}getExtensionId(){return dr.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return dr.DOM_API_NAME}async sendMessage(e){this.logger.trace("02bcil",e.correlationId);try{const n=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(r,e.correlationId)}catch(n){throw this.logger.error("11im7g",e.correlationId),n}}initializePlatformDOMRequest(e){this.logger.trace("15d6yv",e.correlationId);const{accountId:n,clientId:r,authority:i,scope:s,redirectUri:o,correlationId:a,state:l,storeInCache:c,embeddedClientId:u,extraParameters:h,...d}=e,f=this.getDOMExtraParams(d,a);return{accountId:n,brokerId:this.getExtensionId(),authority:i,clientId:r,correlationId:a||this.correlationId,extraParameters:{...h,...f},isSecurityTokenService:!1,redirectUri:o,scope:s,state:l,storeInCache:c,embeddedClientId:u}}validatePlatformBrokerResponse(e,n){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace("0h4vei",n),this.convertToPlatformBrokerResponse(e,n);if(e.hasOwnProperty("error")){const r=e;if(r.isSuccess===!1&&r.error&&r.error.code)throw this.logger.trace("0g92vm",n),wp(r.error.code,r.error.description,{error:parseInt(r.error.errorCode),protocol_error:r.error.protocolError,status:r.error.status,properties:r.error.properties})}}throw xb(Ab,"Response missing expected properties.")}convertToPlatformBrokerResponse(e,n){return this.logger.trace("14913t",n),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e,n){try{const r={};for(const[i,s]of Object.entries(e))s&&(typeof s=="object"?r[i]=JSON.stringify(s):r[i]=String(s));return r}catch{return this.logger.error("0eu9o3",n),this.logger.errorPii("17rpl5",n),{}}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */async function jW(t,e,n,r){t.trace("134j0v",n);const i=UW();t.trace("04c81g",n);let s;try{i&&(s=await tv.createProvider(t,e,n)),s||(t.trace("0l3na8",n),s=await kp.createProvider(t,r||qN,e,n))}catch(o){t.trace("0icbd7",o)}return s}function UW(){let t;try{return t=window[Ur.SessionStorage],(t==null?void 0:t.getItem(iW))==="true"}catch{return!1}}function Du(t,e,n,r,i){if(e.trace("0uko3r",n),!t.system.allowPlatformBroker)return e.trace("04hozs",n),!1;if(!r)return e.trace("0kvv1r",n),!1;if(i)switch(i){case Be.BEARER:case Be.POP:return e.trace("18tev1",n),!0;default:return e.trace("1dd2nh",n),!1}return!0}/*! @azure/msal-browser v5.10.0 2026-05-07 */class ZW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.nativeStorage=l,this.eventHandler=s}acquireToken(e,n){let r;try{if(r={popupName:this.generatePopupName(e.scopes||jl,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:!this.config.system.navigatePopups},this.correlationId),this.config.system.navigatePopups){const s={...e,httpMethod:FN(e,this.config.system.protocolMode)};return this.logger.verbose("1f9ok3",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(s,r,n)}else return this.logger.verbose("162h4u",this.correlationId),this.acquireTokenPopupAsync(e,r,n)}catch(i){return Promise.reject(i)}}logout(e){try{this.logger.verbose("068rup",this.correlationId);const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},i=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.navigatePopups?(this.logger.verbose("1a28da",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,i,s)):(this.logger.verbose("1phd8u",this.correlationId),this.logoutPopupAsync(n,r,i,s))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,r){this.logger.verbose("1g77pg",this.correlationId);const i=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(e,ge.Popup,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);n.popup&&jN(i.authority);const s=Du(this.config,this.logger,this.correlationId,this.platformAuthProvider,e.authenticationScheme);return i.platformBroker=s,this.config.system.protocolMode===Dn.EAR?this.executeEarFlow(i,n,r):this.executeCodeFlow(i,n,r)}async executeCodeFlow(e,n,r){var l;const i=e.correlationId,s=Sn($e.acquireTokenPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=r||await Z(Uo,Bo,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),a={...e,codeChallenge:o.challenge};try{const c=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,i)({serverTelemetryManager:s,requestAuthority:a.authority,requestAzureCloudOptions:a.azureCloudOptions,requestExtraQueryParameters:a.extraQueryParameters,account:a.account});if(a.httpMethod===Za.POST)return await this.executeCodeFlowWithPost(a,n,c,o.verifier);{const u=await Z(Gk,Ck,this.logger,this.performanceClient,i)(this.config,c.authority,a,this.logger,this.performanceClient),h=this.initiateAuthRequest(u,n);this.eventHandler.emitEvent(be.POPUP_OPENED,i,ge.Popup,{popupWindow:h},null);const d=await Ia(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient),f=Jn(Jc,Kc,this.logger,this.performanceClient,this.correlationId)(d,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return await Z(Ya,Wa,this.logger,this.performanceClient,i)(e,f,o.verifier,$e.acquireTokenPopup,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(c){throw(l=n.popup)==null||l.close(),c instanceof He&&(c.setCorrelationId(this.correlationId),s.cacheFailedRequest(c)),c}}async executeEarFlow(e,n,r){const{correlationId:i,authority:s,azureCloudOptions:o,extraQueryParameters:a,account:l}=e,c=await Z(Bi,To,this.logger,this.performanceClient,i)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,s,o,a,l),u=await Z(Fk,Qk,this.logger,this.performanceClient,i)(),h=r||await Z(Uo,Bo,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),d={...e,earJwk:u,codeChallenge:h.challenge},f=n.popup||this.openPopup("about:blank",n);(await Kk(f.document,this.config,c,d,this.logger,this.performanceClient)).submit();const g=await Z(Ia,Op,this.logger,this.performanceClient,i)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,d,this.performanceClient),y=Jn(Jc,Kc,this.logger,this.performanceClient,this.correlationId)(g,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);if(!y.ear_jwe&&y.code){const m=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,i)({serverTelemetryManager:Sn($e.acquireTokenPopup,this.config.auth.clientId,i,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:c});return Z(Ya,Wa,this.logger,this.performanceClient,i)(d,y,h.verifier,$e.acquireTokenPopup,this.config,m,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return Z(ev,Mk,this.logger,this.performanceClient,i)(d,y,$e.acquireTokenPopup,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,r,i){const s=e.correlationId,o=await Z(Bi,To,this.logger,this.performanceClient,s)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger),a=n.popup||this.openPopup("about:blank",n);(await Jk(a.document,this.config,o,e,this.logger,this.performanceClient)).submit();const c=await Z(Ia,Op,this.logger,this.performanceClient,s)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient),u=Jn(Jc,Kc,this.logger,this.performanceClient,this.correlationId)(c,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return Z(Ya,Wa,this.logger,this.performanceClient,s)(e,u,i,$e.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,r,i){var o,a,l;this.logger.verbose("0b7yrk",this.correlationId),this.eventHandler.emitEvent(be.LOGOUT_START,this.correlationId,ge.Popup,e);const s=Sn($e.logoutPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{await Hk(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,e.account);const c=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:r,account:e.account||void 0});try{c.authority.endSessionEndpoint}catch{if((o=e.account)!=null&&o.homeAccountId&&e.postLogoutRedirectUri&&c.authority.protocolMode===Dn.OIDC){if(this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,e.correlationId,ge.Popup,e),i){const d={apiId:$e.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=Le.getAbsoluteUrl(i,_s());await this.navigationClient.navigateInternal(f,d)}(a=n.popup)==null||a.close();return}}e.state=Tk(this.browserCrypto,e.state||"",{interactionType:ge.Popup});const u=c.getLogoutUri(e);this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,e.correlationId,ge.Popup,e);const h=this.openPopup(u,n);if(this.eventHandler.emitEvent(be.POPUP_OPENED,e.correlationId,ge.Popup,{popupWindow:h},null),await Ia(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient).catch(()=>{}),i){const d={apiId:$e.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=Le.getAbsoluteUrl(i,_s());this.logger.verbose("0qcur2",this.correlationId),this.logger.verbosePii("0oj7lk",this.correlationId),await this.navigationClient.navigateInternal(f,d)}else this.logger.verbose("03zgcf",this.correlationId)}catch(c){throw(l=n.popup)==null||l.close(),c instanceof He&&(c.setCorrelationId(this.correlationId),s.cacheFailedRequest(c)),this.eventHandler.emitEvent(be.LOGOUT_FAILURE,this.correlationId,ge.Popup,null,c),this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Popup),c}this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii("1kcr9k",this.correlationId),this.openPopup(e,n);throw this.logger.error("1l7hyp",this.correlationId),se(Lk)}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii("0cgeo7",this.correlationId),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii("0c2awd",this.correlationId),r=this.openSizedPopup(e,n)),!r)throw se(tX);return r.focus&&r.focus(),this.currentWindow=r,r}catch{throw this.logger.error("0dxfb9",this.correlationId),se(eX)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:i}){var f,p,g,y;const s=i.screenLeft?i.screenLeft:i.screenX,o=i.screenTop?i.screenTop:i.screenY,a=i.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=i.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let c=(f=r.popupSize)==null?void 0:f.width,u=(p=r.popupSize)==null?void 0:p.height,h=(g=r.popupPosition)==null?void 0:g.top,d=(y=r.popupPosition)==null?void 0:y.left;return(!c||c<0||c>a)&&(this.logger.verbose("08vfmo",this.correlationId),c=hr.POPUP_WIDTH),(!u||u<0||u>l)&&(this.logger.verbose("09cxa0",this.correlationId),u=hr.POPUP_HEIGHT),(!h||h<0||h>l)&&(this.logger.verbose("1qh4wo",this.correlationId),h=Math.max(0,l/2-hr.POPUP_HEIGHT/2+o)),(!d||d<0||d>a)&&(this.logger.verbose("1sz3en",this.correlationId),d=Math.max(0,a/2-hr.POPUP_WIDTH/2+s)),i.open(e,n,`width=${c}, height=${u}, top=${h}, left=${d}, scrollbars=yes`)}generatePopupName(e,n){return`${hr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${hr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function FW(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class XW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.nativeStorage=l}async acquireToken(e){const n=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(e,ge.Redirect,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);n.platformBroker=Du(this.config,this.logger,this.correlationId,this.platformAuthProvider,e.authenticationScheme);const r=s=>{s.persisted&&(this.logger.verbose("0udvtt",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),this.eventHandler.emitEvent(be.RESTORE_FROM_BFCACHE,this.correlationId,ge.Redirect))},i=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii("0zao0a",this.correlationId),this.browserStorage.setTemporaryCache(_t.ORIGIN_URI,i,!0),window.addEventListener("pageshow",r);try{this.config.system.protocolMode===Dn.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n)}catch(s){throw s instanceof He&&s.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),s}}async executeCodeFlow(e){const n=e.correlationId,r=Sn($e.acquireTokenRedirect,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),i=await Z(Uo,Bo,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),s={...e,codeChallenge:i.challenge};this.browserStorage.cacheAuthorizeRequest(s,this.correlationId,i.verifier);try{if(s.httpMethod===Za.POST)return await this.executeCodeFlowWithPost(s);{const o=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:s.authority,requestAzureCloudOptions:s.azureCloudOptions,requestExtraQueryParameters:s.extraQueryParameters,account:s.account}),a=await Z(Gk,Ck,this.logger,this.performanceClient,e.correlationId)(this.config,o.authority,s,this.logger,this.performanceClient);return await this.initiateAuthRequest(a)}}catch(o){throw o instanceof He&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}async executeEarFlow(e){const{correlationId:n,authority:r,azureCloudOptions:i,extraQueryParameters:s,account:o}=e,a=await Z(Bi,To,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,i,s,o),l=await Z(Fk,Qk,this.logger,this.performanceClient,n)(),c=await Z(Uo,Bo,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),u={...e,earJwk:l,codeChallenge:c.challenge};return this.browserStorage.cacheAuthorizeRequest(u,this.correlationId,c.verifier),(await Kk(document,this.config,a,u,this.logger,this.performanceClient)).submit(),new Promise((d,f)=>{setTimeout(()=>{f(se(yp,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,r=await Z(Bi,To,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger);return this.browserStorage.cacheAuthorizeRequest(e,this.correlationId),(await Jk(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise((s,o)=>{setTimeout(()=>{o(se(yp,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e,n,r,i){const s=Sn($e.handleRedirectPromise,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=(i==null?void 0:i.navigateToLoginRequestUrl)??!0;try{const[a,l]=this.getRedirectResponse((i==null?void 0:i.hash)||"");if(!a)return this.logger.info("1qmv0q",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),FW()!=="back_forward"?r.event.errorCode="no_server_response":this.logger.verbose("1eqegq",this.correlationId),null;const c=this.browserStorage.getTemporaryCache(_t.ORIGIN_URI,this.correlationId,!0)||"",u=x1(c),h=x1(window.location.href);if(u===h&&o)return this.logger.verbose("11yred",this.correlationId),c.indexOf("#")>-1&&zX(c),await this.handleResponse(a,e,n,s);if(o){if(!Xg()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(_t.URL_HASH,l,!0);const d={apiId:$e.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let f=!0;if(!c||c==="null"){const p=UX();this.browserStorage.setTemporaryCache(_t.ORIGIN_URI,p,!0),this.logger.warning("1dutq1",this.correlationId),f=await this.navigationClient.navigateInternal(p,d)}else this.logger.verbose("08jpy1",this.correlationId),f=await this.navigationClient.navigateInternal(c,d);if(!f)return await this.handleResponse(a,e,n,s)}}else return this.logger.verbose("0v4sdv",this.correlationId),await this.handleResponse(a,e,n,s);return null}catch(a){throw a instanceof He&&(a.setCorrelationId(this.correlationId),s.cacheFailedRequest(a)),a}}getRedirectResponse(e){this.logger.verbose("1c5i8m",this.correlationId);let n=e;n||(this.config.auth.OIDCOptions.responseMode===sk.QUERY?n=window.location.search:n=window.location.hash);let r=cp(n);if(r){try{wW(r,this.browserCrypto,ge.Redirect)}catch(s){return s instanceof He&&this.logger.error("0bkq6p",this.correlationId),[null,""]}return DN(window),this.logger.verbose("00uvho",this.correlationId),[r,n]}const i=this.browserStorage.getTemporaryCache(_t.URL_HASH,this.correlationId,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(_t.URL_HASH)),i&&(r=cp(i),r)?(this.logger.verbose("001671",this.correlationId),[r,i]):[null,""]}async handleResponse(e,n,r,i){if(!e.state)throw se(Dk);const{authority:o,azureCloudOptions:a,extraQueryParameters:l,account:c}=n;if(e.ear_jwe){const h=await Z(Bi,To,this.logger,this.performanceClient,n.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,a,l,c);return Z(ev,Mk,this.logger,this.performanceClient,n.correlationId)(n,e,$e.acquireTokenRedirect,this.config,h,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const u=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:n.authority});return Z(Ya,Wa,this.logger,this.performanceClient,n.correlationId)(n,e,r,$e.acquireTokenRedirect,this.config,u,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e){if(this.logger.verbose("0yaw2e",this.correlationId),e){this.logger.infoPii("1luf83",this.correlationId);const n={apiId:$e.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},r=this.config.auth.onRedirectNavigate;if(typeof r=="function")if(this.logger.verbose("1nehvl",this.correlationId),r(e)!==!1){this.logger.verbose("1a0jxh",this.correlationId),await this.navigationClient.navigateExternal(e,n);return}else{this.logger.verbose("09k5h5",this.correlationId);return}else{this.logger.verbose("0klwf7",this.correlationId),await this.navigationClient.navigateExternal(e,n);return}}else throw this.logger.info("0rlh4e",this.correlationId),se(Lk)}async logout(e){var i,s;this.logger.verbose("1rkurh",this.correlationId);const n=this.initializeLogoutRequest(e),r=Sn($e.logout,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{this.eventHandler.emitEvent(be.LOGOUT_START,this.correlationId,ge.Redirect,e),await Hk(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,n.account);const o={apiId:$e.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await Z(this.createAuthCodeClient.bind(this),zi,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(a.authority.protocolMode===Dn.OIDC)try{a.authority.endSessionEndpoint}catch{if((i=n.account)!=null&&i.homeAccountId){this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,this.correlationId,ge.Redirect,n);return}}n.state=Tk(this.browserCrypto,n.state||"",{interactionType:ge.Redirect});const l=a.getLogoutUri(n);(s=n.account)!=null&&s.homeAccountId&&this.eventHandler.emitEvent(be.LOGOUT_SUCCESS,this.correlationId,ge.Redirect,n);const c=this.config.auth.onRedirectNavigate;if(typeof c=="function")if(c(l)!==!1){this.logger.verbose("06v57e",this.correlationId),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),await this.navigationClient.navigateExternal(l,o);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("0xqes1",this.correlationId);else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),await this.navigationClient.navigateExternal(l,o);return}}catch(o){throw o instanceof He&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.eventHandler.emitEvent(be.LOGOUT_FAILURE,this.correlationId,ge.Redirect,null,o),this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Redirect),o}this.eventHandler.emitEvent(be.LOGOUT_END,this.correlationId,ge.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return Le.getAbsoluteUrl(n,_s())}}/*! @azure/msal-browser v5.10.0 2026-05-07 */async function WW(t,e,n,r){if(!t)throw n.info("1l7hyp",r),se(Lk);return Jn(YW,v4,n,e,r)(t)}async function VW(t,e,n,r,i){const s=nv();if(!s.contentDocument)throw"No document associated with iframe!";return(await Jk(s.contentDocument,t,e,n,r,i)).submit(),s}async function HW(t,e,n,r,i){const s=nv();if(!s.contentDocument)throw"No document associated with iframe!";return(await Kk(s.contentDocument,t,e,n,r,i)).submit(),s}function YW(t){const e=nv();return e.src=t,e}function nv(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),t.setAttribute("allow","local-network-access *"),document.body.appendChild(t),t}function uC(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v5.10.0 2026-05-07 */class qW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u,h){super(e,n,r,i,s,o,l,u,h),this.apiId=a,this.nativeStorage=c}async acquireToken(e){!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("1kl318",this.correlationId);const n={...e};n.prompt?n.prompt!==yn.NONE&&n.prompt!==yn.NO_SESSION&&(this.logger.warning("0bmctg",this.correlationId),n.prompt=yn.NONE):n.prompt=yn.NONE;const r=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(n,ge.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);return r.platformBroker=Du(this.config,this.logger,this.correlationId,this.platformAuthProvider,r.authenticationScheme),jN(r.authority),this.config.system.protocolMode===Dn.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let n;const r=Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{return n=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await Z(this.silentTokenHelper.bind(this),B1,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(i){if(i instanceof He&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),!n||!(i instanceof He)||i.errorCode!==hr.INVALID_GRANT_ERROR)throw i;return this.performanceClient.addFields({retryError:i.errorCode},this.correlationId),await Z(this.silentTokenHelper.bind(this),B1,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const{correlationId:n,authority:r,azureCloudOptions:i,extraQueryParameters:s,account:o}=e,a=await Z(Bi,To,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,i,s,o),l=await Z(Fk,Qk,this.logger,this.performanceClient,n)(),c=await Z(Uo,Bo,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),u={...e,earJwk:l,codeChallenge:c.challenge},h=await Z(HW,eO,this.logger,this.performanceClient,n)(this.config,a,u,this.logger,this.performanceClient),d=this.config.auth.OIDCOptions.responseMode;let f;try{f=await Z(Ia,Op,this.logger,this.performanceClient,n)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,e,this.performanceClient,this.config.experimental)}finally{Jn(uC,j1,this.logger,this.performanceClient,n)(h)}const p=Jn(Jc,Kc,this.logger,this.performanceClient,n)(f,d,this.logger,this.correlationId);if(!p.ear_jwe&&p.code){const g=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,n)({serverTelemetryManager:Sn(this.apiId,this.config.auth.clientId,n,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:a});return Z(Ya,Wa,this.logger,this.performanceClient,n)(u,p,c.verifier,this.apiId,this.config,g,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return Z(ev,Mk,this.logger,this.performanceClient,n)(u,p,this.apiId,this.config,a,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async verifySso(e){const n={...e};n.prompt||(n.prompt=yn.NONE);const r=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(n,ge.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId),i=await Z(this.createAuthCodeClient.bind(this),zi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),{serverParams:s}=await this.silentAuthorizeHelper(i,r),o=r.correlationId;return Pk(s,r.state),s.code?(this.logger.verbose("0kkkcj",o),!0):(this.logger.warning("0y34ti",o),!1)}logout(){return Promise.reject(se(zk))}async silentTokenHelper(e,n){const{serverParams:r,pkceCodes:i}=await this.silentAuthorizeHelper(e,n);return Z(Ya,Wa,this.logger,this.performanceClient,n.correlationId)(n,r,i.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async silentAuthorizeHelper(e,n){const r=n.correlationId,i=await Z(Uo,Bo,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...n,codeChallenge:i.challenge};let o;if(n.httpMethod===Za.POST)o=await Z(VW,eO,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);else{const u=await Z(Gk,Ck,this.logger,this.performanceClient,r)(this.config,e.authority,s,this.logger,this.performanceClient);o=await Z(WW,eO,this.logger,this.performanceClient,r)(u,this.performanceClient,this.logger,r)}const a=this.config.auth.OIDCOptions.responseMode;let l;try{l=await Z(Ia,Op,this.logger,this.performanceClient,r)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,n,this.performanceClient,this.config.experimental)}finally{Jn(uC,j1,this.logger,this.performanceClient,r)(o)}return{serverParams:Jn(Jc,Kc,this.logger,this.performanceClient,r)(l,a,this.logger,this.correlationId),pkceCodes:i,silentRequest:s}}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class GW extends Fl{async acquireToken(e){const n=await Z(Yk,$k,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger,this.correlationId),r={...e,...n};e.redirectUri&&(r.redirectUri=bp(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId));const i=Sn($e.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),s=await this.createRefreshTokenClient({serverTelemetryManager:i,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return Z(s.acquireTokenByRefreshToken.bind(s),w4,this.logger,this.performanceClient,e.correlationId)(r,$e.acquireTokenSilent_silentFlow).catch(o=>{throw o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o),o})}logout(){return Promise.reject(se(zk))}async createRefreshTokenClient(e){const n=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new K3(n,this.performanceClient)}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class KW extends bN{constructor(e,n){super(e,n),this.includeRedirectUri=!1}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class JW extends Fl{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,l,c,u),this.apiId=a}async acquireToken(e){if(!e.code)throw se(hX);const n=await Z(Lu,Mu,this.logger,this.performanceClient,this.correlationId)(e,ge.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId),r=Sn(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const i={...n,code:e.code},s=await Z(this.getClientConfiguration.bind(this),Zg,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),o=new KW(s,this.performanceClient);this.logger.verbose("1uic5e",this.correlationId);const a=new XN(o,this.browserStorage,i,this.logger,this.performanceClient);return await Z(a.handleCodeResponseFromServer.bind(a),lN,this.logger,this.performanceClient,this.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,this.apiId,!1)}catch(i){throw i instanceof He&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),i}}logout(){return Promise.reject(se(zk))}}/*! @azure/msal-browser v5.10.0 2026-05-07 */function eV(t,e,n,r){var a;const i=((a=window.msal)==null?void 0:a.clientIds)||[],s=i.length,o=i.filter(l=>l===t).length;o>1&&n.warning("1e88vg",r),e.add({msalInstanceCount:s,sameClientIdInstanceCount:o})}/*! @azure/msal-browser v5.10.0 2026-05-07 */function dd(t,e,n,r){try{Vk(t),wN(n.auth.isMcp,r)}catch(i){throw e.end({success:!1},i,r.account),i}}class rv{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 Hi(this.logger,this.performanceClient):up,this.eventHandler=new OW(this.logger),this.browserStorage=this.isBrowserEnvironment?new Mb(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,q3(this.config.auth)):hW(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:Ur.MemoryStorage,cacheRetentionDays:5};this.nativeInternalStorage=new Mb(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.activeSilentTokenRequests=new Map,this.trackStateChange=this.trackStateChange.bind(this),this.trackStateChangeWithMeasurement=this.trackStateChangeWithMeasurement.bind(this)}static async createController(e,n){const r=new rv(e);return await r.initialize(n),r}trackStateChange(e,n){e&&(n.type==="visibilitychange"?(this.logger.info("16v6hv",e),this.performanceClient.incrementFields({visibilityChangeCount:1},e)):n.type==="online"?(this.logger.info("0zirfd",e),this.performanceClient.incrementFields({onlineStatusChangeCount:1},e)):n.type==="offline"&&(this.logger.info("1xk9ef",e),this.performanceClient.incrementFields({onlineStatusChangeCount:1},e)))}async initialize(e){const n=this.getRequestCorrelationId(e);if(this.logger.trace("1f7joy",n),this.initialized){this.logger.info("061m5x",n);return}if(!this.isBrowserEnvironment){this.logger.info("19fvpi",n),this.initialized=!0,this.eventHandler.emitEvent(be.INITIALIZE_END,n);return}const r=this.config.system.allowPlatformBroker,i=this.performanceClient.startMeasurement(JX,n);if(this.eventHandler.emitEvent(be.INITIALIZE_START,n),this.logMultipleInstances(i,n),i.add({isMcp:this.config.auth.isMcp}),await Z(this.browserStorage.initialize.bind(this.browserStorage),k4,this.logger,this.performanceClient,n)(n),r)try{this.platformAuthProvider=await jW(this.logger,this.performanceClient,n,this.config.system.nativeBrokerHandshakeTimeout)}catch(s){this.logger.verbose(s,n)}this.config.cache.cacheLocation===Ur.LocalStorage&&this.eventHandler.subscribeCrossTab(),!this.config.system.navigatePopups&&await this.preGeneratePkceCodes(n),this.initialized=!0,this.eventHandler.emitEvent(be.INITIALIZE_END,n),i.end({allowPlatformBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("02l8bm",""),BN(this.initialized),this.isBrowserEnvironment){const n=(e==null?void 0:e.hash)||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("1wn9kp","")):this.logger.verbose("0w0gm3",""),r}return this.logger.verbose("12xi63",""),null}async handleRedirectPromiseInternal(e){var c;if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",""),null;if(((c=this.browserStorage.getInteractionInProgress())==null?void 0:c.type)===ws.SIGNOUT)return this.logger.verbose("1ywcv2",""),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const r=this.getAllAccounts(),i=this.browserStorage.getCachedNativeRequest(),s=i&&!(e!=null&&e.hash);let o,a,l;try{if(s&&this.platformAuthProvider){const u=(i==null?void 0:i.correlationId)||"";this.eventHandler.emitEvent(be.HANDLE_REDIRECT_START,u,ge.Redirect),o=this.performanceClient.startMeasurement(iO,u),this.logger.trace("12v7is",u),o.add({isPlatformBrokerRequest:!0});const h=new Of(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,i.accountId,this.nativeInternalStorage,i.correlationId);a=Z(h.handleRedirectPromise.bind(h),I4,this.logger,this.performanceClient,o.event.correlationId)()}else{const[u,h]=this.browserStorage.getCachedRequest("");l=u;const d=u.correlationId;this.eventHandler.emitEvent(be.HANDLE_REDIRECT_START,d,ge.Redirect),o=this.performanceClient.startMeasurement(iO,d),this.logger.trace("0znzs5",d);const f=this.createRedirectClient(d);a=Z(f.handleRedirectPromise.bind(f),P4,this.logger,this.performanceClient,o.event.correlationId)(u,h,o,e)}}catch(u){throw this.browserStorage.resetRequestCache(""),u}return a.then(u=>(u?(this.browserStorage.resetRequestCache(u.correlationId),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,u.correlationId,ge.Redirect,u),this.logger.verbose("0ui8f5",u.correlationId),r.length<this.getAllAccounts().length&&(this.eventHandler.emitEvent(be.LOGIN_SUCCESS,u.correlationId,ge.Redirect,u.account),this.logger.verbose("16im3l",u.correlationId)),o.end({success:!0},void 0,u.account),this.verifySsoCapability(l,ge.Redirect)):o.event.errorCode?o.end({success:!1},void 0):o.discard(),this.eventHandler.emitEvent(be.HANDLE_REDIRECT_END,o.event.correlationId,ge.Redirect),u)).catch(u=>{this.browserStorage.resetRequestCache(o.event.correlationId);const h=u;throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,o.event.correlationId,ge.Redirect,null,h),this.eventHandler.emitEvent(be.HANDLE_REDIRECT_END,o.event.correlationId,ge.Redirect),o.end({success:!1},h),u})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("0os66p",n);const r=this.performanceClient.startMeasurement(GX,n);r.add({scenarioId:e.scenarioId});const i=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=s=>{const o=typeof i=="function"?i(s):void 0;return r.add({navigateCallbackResult:o!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,o};try{J1(this.initialized,this.config),wN(this.config.auth.isMcp,e),this.browserStorage.setInteractionInProgress(!0,ws.SIGNIN),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Redirect,e);let s;if(this.platformAuthProvider&&this.canUsePlatformBroker(e)){const o=new Of(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n);s=Z(o.acquireTokenRedirect.bind(o),b4,this.logger,this.performanceClient,n)(e,r).catch(a=>{if(r.add({brokerErrorName:a.name,brokerErrorCode:a.errorCode}),a instanceof li&&ua(a))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(a instanceof vr)return this.logger.verbose("1ipyz4",n),this.createRedirectClient(n).acquireToken(e);throw a})}else s=this.createRedirectClient(n).acquireToken(e);return await s}catch(s){throw this.browserStorage.resetRequestCache(n),r.event.status===2?this.performanceClient.startMeasurement(iO,n).end({success:!1},s,e.account):r.end({success:!1},s,e.account),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Redirect,null,s),s}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(qX,n);r.add({scenarioId:e.scenarioId});try{this.logger.verbose("0ch87b",n),dd(this.initialized,r,this.config,e),this.browserStorage.setInteractionInProgress(!0,ws.SIGNIN,e.overrideInteractionInProgress,n)}catch(a){return Promise.reject(a)}const i=this.getAllAccounts();this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Popup,e);let s;const o=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?(r.add({isPlatformBrokerRequest:!0}),s=this.acquireTokenNative({...e,correlationId:n},$e.acquireTokenPopup).then(a=>(r.end({success:!0,isNativeBroker:!0},void 0,a.account),a)).catch(a=>{if(r.add({brokerErrorName:a.name,brokerErrorCode:a.errorCode}),a instanceof li&&ua(a))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,o);if(a instanceof vr)return this.logger.verbose("0yy5fw",n),this.createPopupClient(n).acquireToken(e,o);throw a})):s=this.createPopupClient(n).acquireToken(e,o),s.then(a=>{const l=i.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,n,ge.Popup,a),l&&this.eventHandler.emitEvent(be.LOGIN_SUCCESS,n,ge.Popup,a.account),r.end({success:!0,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length},void 0,a.account),this.verifySsoCapability(e,ge.Popup),a}).catch(a=>(this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Popup,null,a),r.end({success:!1},a,e.account),Promise.reject(a))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.navigatePopups||await this.preGeneratePkceCodes(n)})}trackStateChangeWithMeasurement(e){const n=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;n&&(e.type==="visibilitychange"?(this.logger.info("0yzimq",n.event.correlationId),n.increment({visibilityChangeCount:1})):e.type==="online"?(this.logger.info("1caf53",n.event.correlationId),n.increment({onlineStatusChangeCount:1})):e.type==="offline"&&(this.logger.info("0fdyk7",n.event.correlationId),n.increment({onlineStatusChangeCount:1})))}addStateChangeListeners(e){document.addEventListener("visibilitychange",e),window.addEventListener("online",e),window.addEventListener("offline",e)}removeStateChangeListeners(e){document.removeEventListener("visibilitychange",e),window.removeEventListener("online",e),window.removeEventListener("offline",e)}getCachedSsoCapable(){try{const e=window.localStorage.getItem(sC);if(e){const n=JSON.parse(e);if(n&&typeof n.ssoCapable=="boolean"&&n.expiresOn&&Date.now()<n.expiresOn)return n.ssoCapable}}catch{}}verifySsoCapability(e,n){if(!this.config.auth.verifySSO)return;const r=sC,i=24*60*60*1e3;if(this.getCachedSsoCapable()!==void 0){this.logger.verbose("13poou","");return}const o=Xs(),a=this.performanceClient.startMeasurement(tW,o);a.add({"ext.interactionType":n}),this.logger.verbose("0pbr0i",o),setTimeout(()=>{const l={...e,correlationId:o};this.createSilentIframeClient(o).verifySso(l).then(u=>{this.logger.verbose("1gd1iv",o);try{const h=JSON.stringify({ssoCapable:u,expiresOn:Date.now()+i});window.localStorage.setItem(r,h)}catch{this.logger.warning("18lmoj",o)}a.end({fromCache:!1,success:u},void 0)}).catch(u=>{this.logger.warning("05g83w",o);try{window.localStorage.removeItem(r)}catch{this.logger.warning("0nlf9q",o)}a.end({fromCache:!1,success:!1},u)})},0)}async ssoSilent(e){var o,a,l;const n=this.getRequestCorrelationId(e),r={...e,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(KX,n),(o=this.ssoSilentMeasurement)==null||o.add({scenarioId:e.scenarioId,ssoCapable:this.getCachedSsoCapable()}),dd(this.initialized,this.ssoSilentMeasurement,this.config,r),(a=this.ssoSilentMeasurement)==null||a.increment({visibilityChangeCount:0,onlineStatusChangeCount:0}),this.addStateChangeListeners(this.trackStateChangeWithMeasurement);const i=this.getAllAccounts();this.logger.verbose("0w1b45",n),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Silent,r);let s;return this.canUsePlatformBroker(r)?((l=this.ssoSilentMeasurement)==null||l.add({isPlatformBrokerRequest:!0}),s=this.acquireTokenNative(r,$e.ssoSilent).catch(c=>{var u;if((u=this.ssoSilentMeasurement)==null||u.add({brokerErrorName:c.name,brokerErrorCode:c.errorCode}),c instanceof li&&ua(c))return this.platformAuthProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw c})):s=this.createSilentIframeClient(r.correlationId).acquireToken(r),s.then(c=>{var h;const u=i.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,n,ge.Silent,c),u&&this.eventHandler.emitEvent(be.LOGIN_SUCCESS,n,ge.Silent,c.account),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:c.fromPlatformBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length},void 0,c.account),c}).catch(c=>{var u;throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Silent,null,c),(u=this.ssoSilentMeasurement)==null||u.end({success:!1},c,e.account),c}).finally(()=>{this.removeStateChangeListeners(this.trackStateChangeWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("0ch6ga",n);const r=this.performanceClient.startMeasurement(YX,n);dd(this.initialized,r,this.config,e),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,n,ge.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw se(fX);if(e.code){const i=e.code;let s=this.hybridAuthCodeResponses.get(i);return s?(this.logger.verbose("0qgp28",n),r.discard()):(this.logger.verbose("06eh73",n),s=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(o=>(this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,n,ge.Silent,o),this.hybridAuthCodeResponses.delete(i),r.end({success:!0,accessTokenSize:o.accessToken.length,idTokenSize:o.idToken.length},void 0,o.account),o)).catch(o=>{throw this.hybridAuthCodeResponses.delete(i),this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Silent,null,o),r.end({success:!1},o),o}),this.hybridAuthCodeResponses.set(i,s)),await s}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){r.add({isPlatformBrokerRequest:!0});const i=await this.acquireTokenNative({...e,correlationId:n},$e.acquireTokenByCode,e.nativeAccountId).catch(s=>{throw r.add({brokerErrorName:s.name,brokerErrorCode:s.errorCode}),s instanceof li&&ua(s)&&(this.platformAuthProvider=void 0),s});return r.end({success:!0},void 0,i.account),i}else throw se(pX);else throw se(dX)}catch(i){throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,n,ge.Silent,null,i),r.end({success:!1},i),i}}async acquireTokenByCodeAsync(e){var s;const n=this.getRequestCorrelationId(e);return this.logger.trace("10d9hy",n),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(A4,n),(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.increment({visibilityChangeCount:0,onlineStatusChangeCount:0}),this.addStateChangeListeners(this.trackStateChangeWithMeasurement),await this.createSilentAuthCodeClient(n).acquireToken(e).then(o=>{var a;return(a=this.acquireTokenByCodeAsyncMeasurement)==null||a.end({success:!0,fromCache:o.fromCache}),o}).catch(o=>{var a;throw(a=this.acquireTokenByCodeAsyncMeasurement)==null||a.end({success:!1},o),o}).finally(()=>{this.removeStateChangeListeners(this.trackStateChangeWithMeasurement)})}async acquireTokenFromCache(e,n){switch(n){case dn.Default:case dn.AccessToken:case dn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return Z(r.acquireToken.bind(r),g4,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(Es)}}async acquireTokenByRefreshToken(e,n){switch(n){case dn.Default:case dn.AccessTokenAndRefreshToken:case dn.RefreshToken:case dn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return Z(r.acquireToken.bind(r),y4,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(Es)}}async acquireTokenBySilentIframe(e){const n=this.createSilentIframeClient(e.correlationId);return Z(n.acquireToken.bind(n),m4,this.logger,this.performanceClient,e.correlationId)(e)}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return J1(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return Vk(this.initialized),this.browserStorage.setInteractionInProgress(!0,ws.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment)return;const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){return dW(this.logger,this.browserStorage,this.isBrowserEnvironment,this.getRequestCorrelationId(),e)}getAccount(e){return fW(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}setActiveAccount(e){pW(e,this.browserStorage,this.getRequestCorrelationId())}getActiveAccount(){return gW(this.browserStorage,this.getRequestCorrelationId())}async hydrateCache(e,n){this.logger.verbose("16jycr",e.correlationId);const r=K5(e.account,e.cloudGraphHostName,e.msGraphHost);if(await this.browserStorage.setAccount(r,e.correlationId,Di(e.idTokenClaims),$e.hydrateCache),e.fromPlatformBroker){this.logger.verbose("1i5atf",e.correlationId);const i=Lg(e.account.homeAccountId,e.account.environment,e.idToken,this.config.auth.clientId,e.tenantId),s=Dg(e.account.homeAccountId,e.account.environment,e.accessToken,this.config.auth.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?pp(e.expiresOn):0,e.extExpiresOn?pp(e.extExpiresOn):0,gn,void 0,e.tokenType,void 0,n.sshKid);n.resource&&(s.resource=n.resource);const o=Di(e.idTokenClaims);await this.browserStorage.setIdTokenCredential(i,e.correlationId,o),await this.nativeInternalStorage.setAccessTokenCredential(s,e.correlationId,o)}else return this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r,i){const s=this.getRequestCorrelationId(e);if(this.logger.trace("0b9y3p",s),!this.platformAuthProvider)throw se(IN);const o=new Of(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,s);return Z(o.acquireToken.bind(o),Nk,this.logger,this.performanceClient,s)(e,i)}canUsePlatformBroker(e,n){const r=this.getRequestCorrelationId(e);if(this.logger.trace("1n9lbl",r),!this.platformAuthProvider)return this.logger.trace("0vnu11",r),!1;if(!Du(this.config,this.logger,r,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("0yoy1g",r),!1;if(e.prompt)switch(e.prompt){case yn.NONE:case yn.CONSENT:case yn.LOGIN:this.logger.trace("0vdv8e",r);break;default:return this.logger.trace("0pdzw6",r),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("16lbtk",r),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||(!e.loginHint&&!e.sid?this.getActiveAccount():null);return n&&n.nativeAccountId||""}createPopupClient(e){return new ZW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createRedirectClient(e){return new XW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentIframeClient(e){return new qW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.ssoSilent,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentCacheClient(e){return new WN(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentRefreshClient(e){return new GW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentAuthCodeClient(e){return new JW(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,$e.acquireTokenByCode,this.performanceClient,e,this.platformAuthProvider)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return zN(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}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?Xs():""}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("0lz9hf",n),this.acquireTokenRedirect({correlationId:n,...e||W1})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("0qw7v5",n),this.acquireTokenPopup({correlationId:n,...e||W1})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(HX,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId,ssoCapable:this.getCachedSsoCapable()}),dd(this.initialized,r,this.config,e),this.logger.verbose("0x1c4s",n);const i=e.account||this.getActiveAccount();if(!i)throw se(oX);return this.acquireTokenSilentDeduped(e,i,n).then(s=>(r.end({success:!0,fromCache:s.fromCache,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length},void 0,s.account),{...s,state:e.state,correlationId:n})).catch(s=>{throw s instanceof He&&s.setCorrelationId(n),r.end({success:!1},s,i),s})}async acquireTokenSilentDeduped(e,n,r){const i=Bg(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},n.homeAccountId),s=JSON.stringify(i),o=this.activeSilentTokenRequests.get(s);if(typeof o>"u"){this.logger.verbose("0fcjbk",r),this.performanceClient.addFields({deduped:!1},r);const a=Z(this.acquireTokenSilentAsync.bind(this),d4,this.logger,this.performanceClient,r)({...e,correlationId:r},n);return this.activeSilentTokenRequests.set(s,a),a.finally(()=>{this.activeSilentTokenRequests.delete(s)})}else return this.logger.verbose("1yq7nb",r),this.performanceClient.addFields({deduped:!0},r),o}async acquireTokenSilentAsync(e,n){const r=a=>this.trackStateChange(e.correlationId,a);this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_START,e.correlationId,ge.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0,onlineStatusChangeCount:0},e.correlationId),this.addStateChangeListeners(r);const i=await Z(yW,S4,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||dn.Default;return this.acquireTokenSilentNoIframe(i,s).catch(async a=>{if(tV(a,s)){const c=`${a.errorCode}${a.subError?`|${a.subError}`:""}`;if(this.performanceClient.addFields({silentRefreshReason:c},e.correlationId),this.activeIframeRequest)if(s!==dn.Skip){const[u,h]=this.activeIframeRequest;this.logger.verbose("1w8fso",i.correlationId);const d=this.performanceClient.startMeasurement(O4,i.correlationId);d.add({awaitIframeCorrelationId:h});const f=await u;if(d.end({success:f}),f)return this.logger.verbose("0ywzzi",i.correlationId),this.acquireTokenSilentNoIframe(i,s);throw this.logger.info("17y14q",i.correlationId),a}else return this.logger.warning("1bd4p8",i.correlationId),Z(this.acquireTokenBySilentIframe.bind(this),z1,this.logger,this.performanceClient,i.correlationId)(i);else{let u;return this.activeIframeRequest=[new Promise(h=>{u=h}),i.correlationId],this.logger.verbose("0rh08z",i.correlationId),Z(this.acquireTokenBySilentIframe.bind(this),z1,this.logger,this.performanceClient,i.correlationId)(i).then(h=>(u(!0),h)).catch(h=>{throw u(!1),h}).finally(()=>{this.activeIframeRequest=void 0})}}else throw a}).then(a=>(this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_SUCCESS,e.correlationId,ge.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromPlatformBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_FAILURE,e.correlationId,ge.Silent,null,a),a}).finally(()=>{this.removeStateChangeListeners(r)})}async acquireTokenSilentNoIframe(e,n){return Du(this.config,this.logger,e.correlationId,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("0sczo4",e.correlationId),this.performanceClient.addFields({isPlatformBrokerRequest:!0},e.correlationId),this.acquireTokenNative(e,$e.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async r=>{throw this.performanceClient.addFields({brokerErrorName:r.name,brokerErrorCode:r.errorCode},e.correlationId),r instanceof li&&ua(r)?(this.logger.verbose("07rkmb",e.correlationId),this.platformAuthProvider=void 0,Y(Es)):r})):(this.logger.verbose("0ox81t",e.correlationId),n===dn.AccessToken&&this.logger.verbose("0fvwxe",e.correlationId),Z(this.acquireTokenFromCache.bind(this),u4,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===dn.AccessToken)throw r;return this.eventHandler.emitEvent(be.ACQUIRE_TOKEN_NETWORK_START,e.correlationId,ge.Silent,e),Z(this.acquireTokenByRefreshToken.bind(this),h4,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("1x6uj6",e),this.pkceCode=await Z(Uo,Bo,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,n?this.logger.verbose("12js1o",e):this.logger.verbose("1oe9ci",e),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e,n){const r=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("1qtz3l",n),window.msal.clientIds.push(r),eV(r,e,this.logger,n)}}function tV(t,e){const n=!(t instanceof vr&&t.subError!==_k),r=t.errorCode===hr.INVALID_GRANT_ERROR||t.errorCode===Es,i=n&&r||t.errorCode===Tb||t.errorCode===cN,s=V4.includes(e);return i&&s}/*! @azure/msal-browser v5.10.0 2026-05-07 */class iv{static loggerCallback(e,n){switch(e){case at.Error:console.error(n);return;case at.Info:console.info(n);return;case at.Verbose:console.debug(n);return;case at.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var l;this.browserEnvironment=typeof window<"u",this.config=BW(e,this.browserEnvironment);let n;try{n=window[Ur.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(nW),i=(l=n==null?void 0:n.getItem(rW))==null?void 0:l.toLowerCase(),s=i==="true"?!0:i==="false"?!1:void 0,o={...this.config.system.loggerOptions},a=r&&Object.keys(at).includes(r)?at[r]:void 0;a&&(o.loggerCallback=iv.loggerCallback,o.logLevel=a),s!==void 0&&(o.piiLoggingEnabled=s),this.logger=new ki(o,uW,jo),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v5.10.0 2026-05-07 */class ml extends iv{getModuleName(){return ml.MODULE_NAME}getId(){return ml.ID}async initialize(e){return this.available=typeof window<"u",this.available}}ml.MODULE_NAME="";ml.ID="StandardOperatingContext";/*! @azure/msal-browser v5.10.0 2026-05-07 */class nV{constructor(e,n){this.controller=n||new rv(new ml(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,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}getAccount(e){return this.controller.getAccount(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)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}const rV=["openid","profile","email"];let sO=null,ji=null,wc=null,qa=null;function iV(t){return`https://login.microsoftonline.com/${t}`}function Qb(t){return{scopes:rV,...t?{account:t}:{},redirectStartPage:window.location.href}}function sv(){if(!ji)throw new Error("MSAL has not been initialized");return ji}function Xl(t){return t.getActiveAccount()??t.getAllAccounts()[0]??null}function sV(t){const e=t.idToken||t.accessToken;if(!e)throw new Error("Microsoft login succeeded but did not return a usable token");return e}function hC(t,...e){for(const n of e){const r=t[n];if(typeof r=="string"&&r.trim().length>0)return r}return null}async function oV(t){const e=`${t.entraTenantId}:${t.entraClientId}`;if(wc&&sO===e){await wc;return}sO=e;const n=new nV({auth:{clientId:t.entraClientId,authority:iV(t.entraTenantId),redirectUri:window.location.origin,postLogoutRedirectUri:window.location.origin},cache:{cacheLocation:"sessionStorage"}});ji=n,wc=(async()=>{await n.initialize();const r=await n.handleRedirectPromise();qa=r;const i=(r==null?void 0:r.account)??Xl(n);i&&n.setActiveAccount(i)})().catch(r=>{throw ji===n&&(ji=null),sO=null,wc=null,r}),await wc}async function GN(){const t=sv(),e=Xl(t);await t.loginRedirect({...Qb(e??void 0),...e?{}:{prompt:"select_account"}})}async function aV(){const t=sv(),e=Xl(t);if(!e)throw await GN(),new Error("Authentication redirect started");try{const n=await t.acquireTokenSilent({...Qb(e),account:e});return qa=n,n.account&&t.setActiveAccount(n.account),sV(n)}catch(n){throw n instanceof vr?(await t.acquireTokenRedirect({...Qb(e),account:e}),new Error("Authentication redirect started")):n}}function dC(){return ji?Xl(ji)!==null:!1}function fC(){if(!ji)return null;const t=Xl(ji);if(!t)return null;const e=t.idTokenClaims??(qa==null?void 0:qa.idTokenClaims)??{},n=hC(e,"preferred_username","email","upn")??t.username;return{name:hC(e,"name")??t.name??n,email:n}}async function lV(){const t=sv(),e=Xl(t);qa=null,await t.logoutRedirect({account:e??void 0,postLogoutRedirectUri:window.location.origin})}var pC;function F(t,e,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,l);const c=o.prototype,u=Object.keys(c);for(let h=0;h<u.length;h++){const d=u[h];d in a||(a[d]=c[d].bind(a))}}const i=(n==null?void 0:n.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:t});function o(a){var l;const c=n!=null&&n.Parent?new s:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>{var l,c;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(c=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:c.has(t)}}),Object.defineProperty(o,"name",{value:t}),o}class Ga extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class KN extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(pC=globalThis).__zod_globalConfig??(pC.__zod_globalConfig={});const ov=globalThis.__zod_globalConfig;function Yi(t){return ov}function JN(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,i])=>e.indexOf(+r)===-1).map(([r,i])=>i)}function Lb(t,e){return typeof e=="bigint"?e.toString():e}function Hg(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function av(t){return t==null}function lv(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function cV(t,e){const n=t/e,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const gC=Symbol("evaluating");function je(t,e,n){let r;Object.defineProperty(t,e,{get(){if(r!==gC)return r===void 0&&(r=gC,r=n()),r},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function Ko(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ro(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function mC(t){return JSON.stringify(t)}function uV(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const e$="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function zu(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const hV=Hg(()=>{var t;if(ov.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ol(t){if(zu(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(zu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function t$(t){return Ol(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const dV=new Set(["string","number","symbol"]);function yl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function io(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n!=null&&n.parent)&&(r._zod.parent=t),r}function fe(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function fV(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const pV={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function gV(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=ro(t._zod.def,{get shape(){const o={};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=n.shape[a])}return Ko(this,"shape",o),o},checks:[]});return io(t,s)}function mV(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=ro(t._zod.def,{get shape(){const o={...t._zod.def.shape};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a]}return Ko(this,"shape",o),o},checks:[]});return io(t,s)}function OV(t,e){if(!Ol(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const s=t._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=ro(t._zod.def,{get shape(){const s={...t._zod.def.shape,...e};return Ko(this,"shape",s),s}});return io(t,i)}function yV(t,e){if(!Ol(e))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ro(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Ko(this,"shape",r),r}});return io(t,n)}function bV(t,e){var r;if((r=t._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=ro(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return Ko(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return io(t,n)}function wV(t,e,n){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=ro(e._zod.def,{get shape(){const a=e._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=t?new t({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=t?new t({type:"optional",innerType:a[c]}):a[c];return Ko(this,"shape",l),l},checks:[]});return io(e,o)}function SV(t,e,n){const r=ro(e._zod.def,{get shape(){const i=e._zod.def.shape,s={...i};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new t({type:"nonoptional",innerType:i[o]});return Ko(this,"shape",s),s}});return io(e,r)}function Ra(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function kV(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Na(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function fd(t){return typeof t=="string"?t:t==null?void 0:t.message}function qi(t,e,n){var l,c,u,h,d,f;const r=t.message?t.message:fd((u=(c=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:c.error)==null?void 0:u.call(c,t))??fd((h=e==null?void 0:e.error)==null?void 0:h.call(e,t))??fd((d=n.customError)==null?void 0:d.call(n,t))??fd((f=n.localeError)==null?void 0:f.call(n,t))??"Invalid input",{inst:i,continue:s,input:o,...a}=t;return a.path??(a.path=[]),a.message=r,e!=null&&e.reportInput&&(a.input=o),a}function cv(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Bu(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}const n$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Lb,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},r$=F("$ZodError",n$),i$=F("$ZodError",n$,{Parent:Error});function vV(t,e=n=>n.message){const n={},r=[];for(const i of t.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}function xV(t,e=n=>n.message){const n={_errors:[]},r=(i,s=[])=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a},[...s,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...s,...o.path]);else{const a=[...s,...o.path];if(a.length===0)n._errors.push(e(o));else{let l=n,c=0;for(;c<a.length;){const u=a[c];c===a.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(e(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}}};return r(t),n}const uv=t=>(e,n,r,i)=>{const s=r?{...r,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Ga;if(o.issues.length){const a=new((i==null?void 0:i.Err)??t)(o.issues.map(l=>qi(l,s,Yi())));throw e$(a,i==null?void 0:i.callee),a}return o.value},hv=t=>async(e,n,r,i)=>{const s=r?{...r,async:!0}:{async:!0};let o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new((i==null?void 0:i.Err)??t)(o.issues.map(l=>qi(l,s,Yi())));throw e$(a,i==null?void 0:i.callee),a}return o.value},Yg=t=>(e,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Ga;return s.issues.length?{success:!1,error:new(t??r$)(s.issues.map(o=>qi(o,i,Yi())))}:{success:!0,data:s.value}},CV=Yg(i$),qg=t=>async(e,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=e._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(o=>qi(o,i,Yi())))}:{success:!0,data:s.value}},EV=qg(i$),_V=t=>(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return uv(t)(e,n,i)},TV=t=>(e,n,r)=>uv(t)(e,n,r),AV=t=>async(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return hv(t)(e,n,i)},PV=t=>async(e,n,r)=>hv(t)(e,n,r),IV=t=>(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Yg(t)(e,n,i)},RV=t=>(e,n,r)=>Yg(t)(e,n,r),NV=t=>async(e,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return qg(t)(e,n,i)},$V=t=>async(e,n,r)=>qg(t)(e,n,r),MV=/^[cC][0-9a-z]{6,}$/,QV=/^[0-9a-z]+$/,LV=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,DV=/^[0-9a-vA-V]{20}$/,zV=/^[A-Za-z0-9]{27}$/,BV=/^[a-zA-Z0-9_-]{21}$/,jV=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UV=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,OC=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ZV=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,FV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function XV(){return new RegExp(FV,"u")}const WV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VV=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,HV=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YV=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qV=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s$=/^[A-Za-z0-9_-]*$/,GV=/^https?$/,KV=/^\+[1-9]\d{6,14}$/,o$="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",JV=new RegExp(`^${o$}$`);function a$(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eH(t){return new RegExp(`^${a$(t)}$`)}function tH(t){const e=a$({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${o$}T(?:${r})$`)}const nH=t=>{const e=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},rH=/^-?\d+$/,l$=/^-?\d+(?:\.\d+)?$/,iH=/^(?:true|false)$/i,sH=/^null$/i,oH=/^[^A-Z]*$/,aH=/^[^a-z]*$/,jn=F("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),c$={number:"number",bigint:"bigint",object:"date"},u$=F("$ZodCheckLessThan",(t,e)=>{jn.init(t,e);const n=c$[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),h$=F("$ZodCheckGreaterThan",(t,e)=>{jn.init(t,e);const n=c$[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),lH=F("$ZodCheckMultipleOf",(t,e)=>{jn.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):cV(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),cH=F("$ZodCheckNumberFormat",(t,e)=>{var o;jn.init(t,e),e.format=e.format||"float64";const n=(o=e.format)==null?void 0:o.includes("int"),r=n?"int":"number",[i,s]=pV[e.format];t._zod.onattach.push(a=>{const l=a._zod.bag;l.format=e.format,l.minimum=i,l.maximum=s,n&&(l.pattern=rH)}),t._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}l<i&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),l>s&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),uH=F("$ZodCheckMaxLength",(t,e)=>{var n;jn.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!av(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const o=cv(i);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),hH=F("$ZodCheckMinLength",(t,e)=>{var n;jn.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!av(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const o=cv(i);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),dH=F("$ZodCheckLengthEquals",(t,e)=>{var n;jn.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!av(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{const i=r.value,s=i.length;if(s===e.length)return;const o=cv(i),a=s>e.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Gg=F("$ZodCheckStringFormat",(t,e)=>{var n,r;jn.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),fH=F("$ZodCheckRegex",(t,e)=>{Gg.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),pH=F("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=oH),Gg.init(t,e)}),gH=F("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=aH),Gg.init(t,e)}),mH=F("$ZodCheckIncludes",(t,e)=>{jn.init(t,e);const n=yl(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),OH=F("$ZodCheckStartsWith",(t,e)=>{jn.init(t,e);const n=new RegExp(`^${yl(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),yH=F("$ZodCheckEndsWith",(t,e)=>{jn.init(t,e);const n=new RegExp(`.*${yl(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),bH=F("$ZodCheckOverwrite",(t,e)=>{jn.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class wH{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
72
72
|
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const e=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new e(...n,i.join(`
|
|
73
73
|
`))}}const SH={major:4,minor:4,patch:3},ut=F("$ZodType",(t,e)=>{var i;var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=SH;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const s of r)for(const o of s._zod.onattach)o(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const s=(a,l,c)=>{let u=Ra(a),h;for(const d of l){if(d._zod.def.when){if(kV(a)||!d._zod.def.when(a))continue}else if(u)continue;const f=a.issues.length,p=d._zod.check(a);if(p instanceof Promise&&(c==null?void 0:c.async)===!1)throw new Ga;if(h||p instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await p,a.issues.length!==f&&(u||(u=Ra(a,f)))});else{if(a.issues.length===f)continue;u||(u=Ra(a,f))}}return h?h.then(()=>a):a},o=(a,l,c)=>{if(Ra(a))return a.aborted=!0,a;const u=s(l,r,c);if(u instanceof Promise){if(c.async===!1)throw new Ga;return u.then(h=>t._zod.parse(h,c))}return t._zod.parse(u,c)};t._zod.run=(a,l)=>{if(l.skipChecks)return t._zod.parse(a,l);if(l.direction==="backward"){const u=t._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(h=>o(h,a,l)):o(u,a,l)}const c=t._zod.parse(a,l);if(c instanceof Promise){if(l.async===!1)throw new Ga;return c.then(u=>s(u,r,l))}return s(c,r,l)}}je(t,"~standard",()=>({validate:s=>{var o;try{const a=CV(t,s);return a.success?{value:a.data}:{issues:(o=a.error)==null?void 0:o.issues}}catch{return EV(t,s).then(l=>{var c;return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),dv=F("$ZodString",(t,e)=>{var n;ut.init(t,e),t._zod.pattern=[...((n=t==null?void 0:t._zod.bag)==null?void 0:n.patterns)??[]].pop()??nH(t._zod.bag),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ht=F("$ZodStringFormat",(t,e)=>{Gg.init(t,e),dv.init(t,e)}),kH=F("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=UV),ht.init(t,e)}),vH=F("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=OC(r))}else e.pattern??(e.pattern=OC());ht.init(t,e)}),xH=F("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=ZV),ht.init(t,e)}),CH=F("$ZodURL",(t,e)=>{ht.init(t,e),t._zod.check=n=>{var r;try{const i=n.value.trim();if(!e.normalize&&((r=e.protocol)==null?void 0:r.source)===GV.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}const s=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=s.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),EH=F("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=XV()),ht.init(t,e)}),_H=F("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=BV),ht.init(t,e)}),TH=F("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=MV),ht.init(t,e)}),AH=F("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=QV),ht.init(t,e)}),PH=F("$ZodULID",(t,e)=>{e.pattern??(e.pattern=LV),ht.init(t,e)}),IH=F("$ZodXID",(t,e)=>{e.pattern??(e.pattern=DV),ht.init(t,e)}),RH=F("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=zV),ht.init(t,e)}),NH=F("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=tH(e)),ht.init(t,e)}),$H=F("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=JV),ht.init(t,e)}),MH=F("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=eH(e)),ht.init(t,e)}),QH=F("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=jV),ht.init(t,e)}),LH=F("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=WV),ht.init(t,e),t._zod.bag.format="ipv4"}),DH=F("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=VV),ht.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),zH=F("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=HV),ht.init(t,e)}),BH=F("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=YV),ht.init(t,e),t._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function d$(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const jH=F("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=qV),ht.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{d$(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function UH(t){if(!s$.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return d$(n)}const ZH=F("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=s$),ht.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{UH(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),FH=F("$ZodE164",(t,e)=>{e.pattern??(e.pattern=KV),ht.init(t,e)});function XH(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const WH=F("$ZodJWT",(t,e)=>{ht.init(t,e),t._zod.check=n=>{XH(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),f$=F("$ZodNumber",(t,e)=>{ut.init(t,e),t._zod.pattern=t._zod.bag.pattern??l$,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),n}}),VH=F("$ZodNumberFormat",(t,e)=>{cH.init(t,e),f$.init(t,e)}),HH=F("$ZodBoolean",(t,e)=>{ut.init(t,e),t._zod.pattern=iH,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),n}}),YH=F("$ZodNull",(t,e)=>{ut.init(t,e),t._zod.pattern=sH,t._zod.values=new Set([null]),t._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),n}}),qH=F("$ZodUnknown",(t,e)=>{ut.init(t,e),t._zod.parse=n=>n}),GH=F("$ZodNever",(t,e)=>{ut.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function yC(t,e,n){t.issues.length&&e.issues.push(...Na(n,t.issues)),e.value[n]=t.value}const KH=F("$ZodArray",(t,e)=>{ut.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),n;n.value=Array(i.length);const s=[];for(let o=0;o<i.length;o++){const a=i[o],l=e.element._zod.run({value:a,issues:[]},r);l instanceof Promise?s.push(l.then(c=>yC(c,n,o))):yC(l,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function vp(t,e,n,r,i,s){const o=n in r;if(t.issues.length){if(i&&s&&!o)return;e.issues.push(...Na(n,t.issues))}if(!o&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?o&&(e.value[n]=void 0):e.value[n]=t.value}function p$(t){var r,i,s,o;const e=Object.keys(t.shape);for(const a of e)if(!((o=(s=(i=(r=t.shape)==null?void 0:r[a])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=fV(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function g$(t,e,n,r,i,s){const o=[],a=i.keySet,l=i.catchall._zod,c=l.def.type,u=l.optin==="optional",h=l.optout==="optional";for(const d in e){if(d==="__proto__"||a.has(d))continue;if(c==="never"){o.push(d);continue}const f=l.run({value:e[d],issues:[]},r);f instanceof Promise?t.push(f.then(p=>vp(p,n,d,e,u,h))):vp(f,n,d,e,u,h)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),t.length?Promise.all(t).then(()=>n):n}const JH=F("$ZodObject",(t,e)=>{ut.init(t,e);const n=Object.getOwnPropertyDescriptor(e,"shape");if(!(n!=null&&n.get)){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}const r=Hg(()=>p$(e));je(t._zod,"propValues",()=>{const a=e.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const h of u.values)l[c].add(h)}}return l});const i=zu,s=e.catchall;let o;t._zod.parse=(a,l)=>{o??(o=r.value);const c=a.value;if(!i(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:t}),a;a.value={};const u=[],h=o.shape;for(const d of o.keys){const f=h[d],p=f._zod.optin==="optional",g=f._zod.optout==="optional",y=f._zod.run({value:c[d],issues:[]},l);y instanceof Promise?u.push(y.then(m=>vp(m,a,d,c,p,g))):vp(y,a,d,c,p,g)}return s?g$(u,c,a,l,r.value,t):u.length?Promise.all(u).then(()=>a):a}}),e9=F("$ZodObjectJIT",(t,e)=>{JH.init(t,e);const n=t._zod.parse,r=Hg(()=>p$(e)),i=d=>{var b,S;const f=new wH(["shape","payload","ctx"]),p=r.value,g=x=>{const k=mC(x);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};f.write("const input = payload.value;");const y=Object.create(null);let m=0;for(const x of p.keys)y[x]=`key_${m++}`;f.write("const newResult = {};");for(const x of p.keys){const k=y[x],E=mC(x),I=d[x],Q=((b=I==null?void 0:I._zod)==null?void 0:b.optin)==="optional",T=((S=I==null?void 0:I._zod)==null?void 0:S.optout)==="optional";f.write(`const ${k} = ${g(x)};`),Q&&T?f.write(`
|
|
74
74
|
if (${k}.issues.length) {
|
|
@@ -131,7 +131,7 @@ _(cancelled)_`}:o.type==="thinking"?{...o,active:!1}:o)}:s)}}}),clearMessages:n=
|
|
|
131
131
|
|
|
132
132
|
`)}f.write("payload.value = newResult;"),f.write("return payload;");const O=f.compile();return(x,k)=>O(d,x,k)};let s;const o=zu,a=!ov.jitless,c=a&&hV.value,u=e.catchall;let h;t._zod.parse=(d,f)=>{h??(h=r.value);const p=d.value;return o(p)?a&&c&&(f==null?void 0:f.async)===!1&&f.jitless!==!0?(s||(s=i(e.shape)),d=s(d,f),u?g$([],p,d,f,h,t):d):n(d,f):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),d)}});function bC(t,e,n,r){for(const s of t)if(s.issues.length===0)return e.value=s.value,e;const i=t.filter(s=>!Ra(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(s=>s.issues.map(o=>qi(o,r,Yi())))}),e)}const m$=F("$ZodUnion",(t,e)=>{ut.init(t,e),je(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),je(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),je(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),je(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){const r=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>lv(i.source)).join("|")})$`)}});const n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1;const o=[];for(const a of e.options){const l=a._zod.run({value:r.value,issues:[]},i);if(l instanceof Promise)o.push(l),s=!0;else{if(l.issues.length===0)return l;o.push(l)}}return s?Promise.all(o).then(a=>bC(a,r,t,i)):bC(o,r,t,i)}}),t9=F("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,m$.init(t,e);const n=t._zod.parse;je(t._zod,"propValues",()=>{const i={};for(const s of e.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[a,l]of Object.entries(o)){i[a]||(i[a]=new Set);for(const c of l)i[a].add(c)}}return i});const r=Hg(()=>{var o;const i=e.options,s=new Map;for(const a of i){const l=(o=a._zod.propValues)==null?void 0:o[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const c of l){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});t._zod.parse=(i,s)=>{const o=i.value;if(!zu(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),i;const a=r.value.get(o==null?void 0:o[e.discriminator]);return a?a._zod.run(i,s):e.unionFallback||s.direction==="backward"?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(r.value.keys()),input:o,path:[e.discriminator],inst:t}),i)}}),n9=F("$ZodIntersection",(t,e)=>{ut.init(t,e),t._zod.parse=(n,r)=>{const i=n.value,s=e.left._zod.run({value:i,issues:[]},r),o=e.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([l,c])=>wC(n,l,c)):wC(n,s,o)}});function Db(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Ol(t)&&Ol(e)){const n=Object.keys(e),r=Object.keys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(const s of r){const o=Db(t[s],e[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const i=t[r],s=e[r],o=Db(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wC(t,e,n){const r=new Map;let i;for(const a of e.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else t.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else t.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&i&&t.issues.push({...i,keys:s}),Ra(t))return t;const o=Db(e.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}const r9=F("$ZodRecord",(t,e)=>{ut.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Ol(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),n;const s=[],o=e.keyType._zod.values;if(o){n.value={};const a=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=e.keyType._zod.run({value:c,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>qi(f,r,Yi())),input:c,path:[c],inst:t});continue}const h=u.value,d=e.valueType._zod.run({value:i[c],issues:[]},r);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&n.issues.push(...Na(c,f.issues)),n.value[h]=f.value})):(d.issues.length&&n.issues.push(...Na(c,d.issues)),n.value[h]=d.value)}let l;for(const c in i)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let l=e.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&l$.test(a)&&l.issues.length){const h=e.keyType._zod.run({value:Number(a),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){e.mode==="loose"?n.value[a]=i[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>qi(h,r,Yi())),input:a,path:[a],inst:t});continue}const u=e.valueType._zod.run({value:i[a],issues:[]},r);u instanceof Promise?s.push(u.then(h=>{h.issues.length&&n.issues.push(...Na(a,h.issues)),n.value[l.value]=h.value})):(u.issues.length&&n.issues.push(...Na(a,u.issues)),n.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>n):n}}),i9=F("$ZodEnum",(t,e)=>{ut.init(t,e);const n=JN(e.entries),r=new Set(n);t._zod.values=r,t._zod.pattern=new RegExp(`^(${n.filter(i=>dV.has(typeof i)).map(i=>typeof i=="string"?yl(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:t}),i}}),s9=F("$ZodLiteral",(t,e)=>{if(ut.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?yl(r):r?yl(r.toString()):String(r)).join("|")})$`),t._zod.parse=(r,i)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),r}}),o9=F("$ZodTransform",(t,e)=>{ut.init(t,e),t._zod.optin="optional",t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new KN(t.constructor.name);const i=e.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n.fallback=!0,n));if(i instanceof Promise)throw new Ga;return n.value=i,n.fallback=!0,n}});function SC(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const O$=F("$ZodOptional",(t,e)=>{ut.init(t,e),t._zod.optin="optional",t._zod.optout="optional",je(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),je(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${lv(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(e.innerType._zod.optin==="optional"){const i=n.value,s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>SC(o,i)):SC(s,i)}return n.value===void 0?n:e.innerType._zod.run(n,r)}}),a9=F("$ZodExactOptional",(t,e)=>{O$.init(t,e),je(t._zod,"values",()=>e.innerType._zod.values),je(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),l9=F("$ZodNullable",(t,e)=>{ut.init(t,e),je(t._zod,"optin",()=>e.innerType._zod.optin),je(t._zod,"optout",()=>e.innerType._zod.optout),je(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${lv(n.source)}|null)$`):void 0}),je(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),c9=F("$ZodDefault",(t,e)=>{ut.init(t,e),t._zod.optin="optional",je(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>kC(s,e)):kC(i,e)}});function kC(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const u9=F("$ZodPrefault",(t,e)=>{ut.init(t,e),t._zod.optin="optional",je(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),h9=F("$ZodNonOptional",(t,e)=>{ut.init(t,e),je(t._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>vC(s,t)):vC(i,t)}});function vC(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const d9=F("$ZodCatch",(t,e)=>{ut.init(t,e),t._zod.optin="optional",je(t._zod,"optout",()=>e.innerType._zod.optout),je(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(o=>qi(o,r,Yi()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(s=>qi(s,r,Yi()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),f9=F("$ZodPipe",(t,e)=>{ut.init(t,e),je(t._zod,"values",()=>e.in._zod.values),je(t._zod,"optin",()=>e.in._zod.optin),je(t._zod,"optout",()=>e.out._zod.optout),je(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=e.out._zod.run(n,r);return s instanceof Promise?s.then(o=>pd(o,e.in,r)):pd(s,e.in,r)}const i=e.in._zod.run(n,r);return i instanceof Promise?i.then(s=>pd(s,e.out,r)):pd(i,e.out,r)}});function pd(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}const p9=F("$ZodReadonly",(t,e)=>{ut.init(t,e),je(t._zod,"propValues",()=>e.innerType._zod.propValues),je(t._zod,"values",()=>e.innerType._zod.values),je(t._zod,"optin",()=>{var n,r;return(r=(n=e.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),je(t._zod,"optout",()=>{var n,r;return(r=(n=e.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(xC):xC(i)}});function xC(t){return t.value=Object.freeze(t.value),t}const g9=F("$ZodCustom",(t,e)=>{jn.init(t,e),ut.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,i=e.fn(r);if(i instanceof Promise)return i.then(s=>CC(s,n,r,t));CC(i,n,r,t)}});function CC(t,e,n,r){if(!t){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(Bu(i))}}var EC;class m9{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function O9(){return new m9}(EC=globalThis).__zod_globalRegistry??(EC.__zod_globalRegistry=O9());const Lc=globalThis.__zod_globalRegistry;function y9(t,e){return new t({type:"string",...fe(e)})}function b9(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...fe(e)})}function _C(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...fe(e)})}function w9(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...fe(e)})}function S9(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...fe(e)})}function k9(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...fe(e)})}function v9(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...fe(e)})}function x9(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...fe(e)})}function C9(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...fe(e)})}function E9(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...fe(e)})}function _9(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...fe(e)})}function T9(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...fe(e)})}function A9(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...fe(e)})}function P9(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...fe(e)})}function I9(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...fe(e)})}function R9(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...fe(e)})}function N9(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...fe(e)})}function $9(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...fe(e)})}function M9(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...fe(e)})}function Q9(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...fe(e)})}function L9(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...fe(e)})}function D9(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...fe(e)})}function z9(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...fe(e)})}function B9(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...fe(e)})}function j9(t,e){return new t({type:"string",format:"date",check:"string_format",...fe(e)})}function U9(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...fe(e)})}function Z9(t,e){return new t({type:"string",format:"duration",check:"string_format",...fe(e)})}function F9(t,e){return new t({type:"number",checks:[],...fe(e)})}function X9(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...fe(e)})}function W9(t,e){return new t({type:"boolean",...fe(e)})}function V9(t,e){return new t({type:"null",...fe(e)})}function H9(t){return new t({type:"unknown"})}function Y9(t,e){return new t({type:"never",...fe(e)})}function TC(t,e){return new u$({check:"less_than",...fe(e),value:t,inclusive:!1})}function oO(t,e){return new u$({check:"less_than",...fe(e),value:t,inclusive:!0})}function AC(t,e){return new h$({check:"greater_than",...fe(e),value:t,inclusive:!1})}function aO(t,e){return new h$({check:"greater_than",...fe(e),value:t,inclusive:!0})}function PC(t,e){return new lH({check:"multiple_of",...fe(e),value:t})}function y$(t,e){return new uH({check:"max_length",...fe(e),maximum:t})}function xp(t,e){return new hH({check:"min_length",...fe(e),minimum:t})}function b$(t,e){return new dH({check:"length_equals",...fe(e),length:t})}function q9(t,e){return new fH({check:"string_format",format:"regex",...fe(e),pattern:t})}function G9(t){return new pH({check:"string_format",format:"lowercase",...fe(t)})}function K9(t){return new gH({check:"string_format",format:"uppercase",...fe(t)})}function J9(t,e){return new mH({check:"string_format",format:"includes",...fe(e),includes:t})}function e6(t,e){return new OH({check:"string_format",format:"starts_with",...fe(e),prefix:t})}function t6(t,e){return new yH({check:"string_format",format:"ends_with",...fe(e),suffix:t})}function Wl(t){return new bH({check:"overwrite",tx:t})}function n6(t){return Wl(e=>e.normalize(t))}function r6(){return Wl(t=>t.trim())}function i6(){return Wl(t=>t.toLowerCase())}function s6(){return Wl(t=>t.toUpperCase())}function o6(){return Wl(t=>uV(t))}function a6(t,e,n){return new t({type:"array",element:e,...fe(n)})}function l6(t,e,n){return new t({type:"custom",check:"custom",fn:e,...fe(n)})}function c6(t,e){const n=u6(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Bu(i,r.value,n._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Bu(s))}},t(r.value,r)),e);return n}function u6(t,e){const n=new jn({check:"custom",...fe(e)});return n._zod.check=t,n}function w$(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??Lc,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function Pt(t,e,n={path:[],schemaPath:[]}){var u,h;var r;const i=t._zod.def,s=e.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o);const a=(h=(u=t._zod).toJSONSchema)==null?void 0:h.call(u);if(a)o.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,d);else{const p=o.schema,g=e.processors[i.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);g(t,e,p,d)}const f=t._zod.parent;f&&(o.ref||(o.ref=f),Pt(f,e,d),e.seen.get(f).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&Object.assign(o.schema,l),e.io==="input"&&hn(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function S$(t,e){var o,a,l,c;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const u of t.seen.entries()){const h=(o=t.metadataRegistry.get(u[0]))==null?void 0:o.id;if(h){const d=r.get(h);if(d&&d!==u[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,u[0])}}const i=u=>{var g;const h=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const y=(g=t.external.registry.get(u[0]))==null?void 0:g.id,m=t.external.uri??(b=>b);if(y)return{ref:m(y)};const O=u[1].defId??u[1].schema.id??`schema${t.counter++}`;return u[1].defId=O,{defId:O,ref:`${m("__shared")}#/${h}/${O}`}}if(u[1]===n)return{ref:"#"};const f=`#/${h}/`,p=u[1].schema.id??`__schema${t.counter++}`;return{defId:p,ref:f+p}},s=u=>{if(u[1].schema.$ref)return;const h=u[1],{ref:d,defId:f}=i(u);h.def={...h.schema},f&&(h.defId=f);const p=h.schema;for(const g in p)delete p[g];p.$ref=d};if(t.cycles==="throw")for(const u of t.seen.entries()){const h=u[1];if(h.cycle)throw new Error(`Cycle detected: #/${(a=h.cycle)==null?void 0:a.join("/")}/<root>
|
|
133
133
|
|
|
134
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of t.seen.entries()){const h=u[1];if(e===u[0]){s(u);continue}if(t.external){const f=(l=t.external.registry.get(u[0]))==null?void 0:l.id;if(e!==u[0]&&f){s(u);continue}}if((c=t.metadataRegistry.get(u[0]))==null?void 0:c.id){s(u);continue}if(h.cycle){s(u);continue}if(h.count>1&&t.reused==="ref"){s(u);continue}}}function k$(t,e){var a,l,c,u;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=h=>{const d=t.seen.get(h);if(d.ref===null)return;const f=d.def??d.schema,p={...f},g=d.ref;if(d.ref=null,g){r(g);const m=t.seen.get(g),O=m.schema;if(O.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(O)):Object.assign(f,O),Object.assign(f,p),h._zod.parent===g)for(const S in f)S==="$ref"||S==="allOf"||S in p||delete f[S];if(O.$ref&&m.def)for(const S in f)S==="$ref"||S==="allOf"||S in m.def&&JSON.stringify(f[S])===JSON.stringify(m.def[S])&&delete f[S]}const y=h._zod.parent;if(y&&y!==g){r(y);const m=t.seen.get(y);if(m!=null&&m.schema.$ref&&(f.$ref=m.schema.$ref,m.def))for(const O in f)O==="$ref"||O==="allOf"||O in m.def&&JSON.stringify(f[O])===JSON.stringify(m.def[O])&&delete f[O]}t.override({zodSchema:h,jsonSchema:f,path:d.path??[]})};for(const h of[...t.seen.entries()].reverse())r(h[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(a=t.external)!=null&&a.uri){const h=(l=t.external.registry.get(e))==null?void 0:l.id;if(!h)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(h)}Object.assign(i,n.def??n.schema);const s=(c=t.metadataRegistry.get(e))==null?void 0:c.id;s!==void 0&&i.id===s&&delete i.id;const o=((u=t.external)==null?void 0:u.defs)??{};for(const h of t.seen.entries()){const d=h[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,o[d.defId]=d.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const h=JSON.parse(JSON.stringify(i));return Object.defineProperty(h,"~standard",{value:{...e["~standard"],jsonSchema:{input:Cp(e,"input",t.processors),output:Cp(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function hn(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return hn(r.element,n);if(r.type==="set")return hn(r.valueType,n);if(r.type==="lazy")return hn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return hn(r.innerType,n);if(r.type==="intersection")return hn(r.left,n)||hn(r.right,n);if(r.type==="record"||r.type==="map")return hn(r.keyType,n)||hn(r.valueType,n);if(r.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:hn(r.in,n)||hn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(hn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(hn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(hn(i,n))return!0;return!!(r.rest&&hn(r.rest,n))}return!1}const h6=(t,e={})=>n=>{const r=w$({...n,processors:e});return Pt(t,r),S$(r,t),k$(r,t)},Cp=(t,e,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=w$({...i??{},target:s,io:e,processors:n});return Pt(t,o),S$(o,t),k$(o,t)},d6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},f6=(t,e,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:a,patterns:l,contentEncoding:c}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),a&&(i.format=d6[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(h=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},p6=(t,e,n,r)=>{const i=n,{minimum:s,maximum:o,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";const h=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),d=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";h?f?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),d?f?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o=="number"&&(i.maximum=o),typeof l=="number"&&(i.multipleOf=l)},g6=(t,e,n,r)=>{n.type="boolean"},m6=(t,e,n,r)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},O6=(t,e,n,r)=>{n.not={}},y6=(t,e,n,r)=>{},b6=(t,e,n,r)=>{const i=t._zod.def,s=JN(i.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},w6=(t,e,n,r)=>{const i=t._zod.def,s=[];for(const o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),s.every(o=>typeof o=="boolean")&&(n.type="boolean"),s.every(o=>o===null)&&(n.type="null"),n.enum=s},S6=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},k6=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},v6=(t,e,n,r)=>{const i=n,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Pt(s.element,e,{...r,path:[...r.path,"items"]})},x6=(t,e,n,r)=>{var c;const i=n,s=t._zod.def;i.type="object",i.properties={};const o=s.shape;for(const u in o)i.properties[u]=Pt(o[u],e,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(u=>{const h=s.shape[u]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((c=s.catchall)==null?void 0:c._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Pt(s.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},C6=(t,e,n,r)=>{const i=t._zod.def,s=i.inclusive===!1,o=i.options.map((a,l)=>Pt(a,e,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?n.oneOf=o:n.anyOf=o},E6=(t,e,n,r)=>{const i=t._zod.def,s=Pt(i.left,e,{...r,path:[...r.path,"allOf",0]}),o=Pt(i.right,e,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];n.allOf=l},_6=(t,e,n,r)=>{const i=n,s=t._zod.def;i.type="object";const o=s.keyType,a=o._zod.bag,l=a==null?void 0:a.patterns;if(s.mode==="loose"&&l&&l.size>0){const u=Pt(s.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const h of l)i.patternProperties[h.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Pt(s.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Pt(s.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const c=o._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(i.required=u)}},T6=(t,e,n,r)=>{const i=t._zod.def,s=Pt(i.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},A6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType},P6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},I6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},R6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},N6=(t,e,n,r)=>{const i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?i.out:i.in:i.out;Pt(o,e,r);const a=e.seen.get(t);a.ref=o},$6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType,n.readOnly=!0},v$=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType},M6=F("ZodISODateTime",(t,e)=>{NH.init(t,e),yt.init(t,e)});function Q6(t){return B9(M6,t)}const L6=F("ZodISODate",(t,e)=>{$H.init(t,e),yt.init(t,e)});function D6(t){return j9(L6,t)}const z6=F("ZodISOTime",(t,e)=>{MH.init(t,e),yt.init(t,e)});function B6(t){return U9(z6,t)}const j6=F("ZodISODuration",(t,e)=>{QH.init(t,e),yt.init(t,e)});function U6(t){return Z9(j6,t)}const Z6=(t,e)=>{r$.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>xV(t,n)},flatten:{value:n=>vV(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Lb,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Lb,2)}},isEmpty:{get(){return t.issues.length===0}}})},xr=F("ZodError",Z6,{Parent:Error}),F6=uv(xr),X6=hv(xr),W6=Yg(xr),V6=qg(xr),H6=_V(xr),Y6=TV(xr),q6=AV(xr),G6=PV(xr),K6=IV(xr),J6=RV(xr),eY=NV(xr),tY=$V(xr),IC=new WeakMap;function xh(t,e,n){const r=Object.getPrototypeOf(t);let i=IC.get(r);if(i||(i=new Set,IC.set(r,i)),!i.has(e)){i.add(e);for(const s in n){const o=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const dt=F("ZodType",(t,e)=>(ut.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Cp(t,"input"),output:Cp(t,"output")}}),t.toJSONSchema=h6(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,r)=>F6(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>W6(t,n,r),t.parseAsync=async(n,r)=>X6(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>V6(t,n,r),t.spa=t.safeParseAsync,t.encode=(n,r)=>H6(t,n,r),t.decode=(n,r)=>Y6(t,n,r),t.encodeAsync=async(n,r)=>q6(t,n,r),t.decodeAsync=async(n,r)=>G6(t,n,r),t.safeEncode=(n,r)=>K6(t,n,r),t.safeDecode=(n,r)=>J6(t,n,r),t.safeEncodeAsync=async(n,r)=>eY(t,n,r),t.safeDecodeAsync=async(n,r)=>tY(t,n,r),xh(t,"ZodType",{check(...n){const r=this.def;return this.clone(ro(r,{checks:[...r.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return io(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(YY(n,r))},superRefine(n,r){return this.check(qY(n,r))},overwrite(n){return this.check(Wl(n))},optional(){return MC(this)},exactOptional(){return QY(this)},nullable(){return QC(this)},nullish(){return MC(QC(this))},nonoptional(n){return UY(this,n)},array(){return Vt(this)},or(n){return Ch([this,n])},and(n){return IY(this,n)},transform(n){return LC(this,$Y(n))},default(n){return zY(this,n)},prefault(n){return jY(this,n)},catch(n){return FY(this,n)},pipe(n){return LC(this,n)},readonly(){return VY(this)},describe(n){const r=this.clone();return Lc.add(r,{description:n}),r},meta(...n){if(n.length===0)return Lc.get(this);const r=this.clone();return Lc.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){var n;return(n=Lc.get(t))==null?void 0:n.description},configurable:!0}),t)),x$=F("_ZodString",(t,e)=>{dv.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(r,i,s)=>f6(t,r,i);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,xh(t,"_ZodString",{regex(...r){return this.check(q9(...r))},includes(...r){return this.check(J9(...r))},startsWith(...r){return this.check(e6(...r))},endsWith(...r){return this.check(t6(...r))},min(...r){return this.check(xp(...r))},max(...r){return this.check(y$(...r))},length(...r){return this.check(b$(...r))},nonempty(...r){return this.check(xp(1,...r))},lowercase(r){return this.check(G9(r))},uppercase(r){return this.check(K9(r))},trim(){return this.check(r6())},normalize(...r){return this.check(n6(...r))},toLowerCase(){return this.check(i6())},toUpperCase(){return this.check(s6())},slugify(){return this.check(o6())}})}),nY=F("ZodString",(t,e)=>{dv.init(t,e),x$.init(t,e),t.email=n=>t.check(b9(rY,n)),t.url=n=>t.check(x9(iY,n)),t.jwt=n=>t.check(z9(bY,n)),t.emoji=n=>t.check(C9(sY,n)),t.guid=n=>t.check(_C(RC,n)),t.uuid=n=>t.check(w9(gd,n)),t.uuidv4=n=>t.check(S9(gd,n)),t.uuidv6=n=>t.check(k9(gd,n)),t.uuidv7=n=>t.check(v9(gd,n)),t.nanoid=n=>t.check(E9(oY,n)),t.guid=n=>t.check(_C(RC,n)),t.cuid=n=>t.check(_9(aY,n)),t.cuid2=n=>t.check(T9(lY,n)),t.ulid=n=>t.check(A9(cY,n)),t.base64=n=>t.check(Q9(mY,n)),t.base64url=n=>t.check(L9(OY,n)),t.xid=n=>t.check(P9(uY,n)),t.ksuid=n=>t.check(I9(hY,n)),t.ipv4=n=>t.check(R9(dY,n)),t.ipv6=n=>t.check(N9(fY,n)),t.cidrv4=n=>t.check($9(pY,n)),t.cidrv6=n=>t.check(M9(gY,n)),t.e164=n=>t.check(D9(yY,n)),t.datetime=n=>t.check(Q6(n)),t.date=n=>t.check(D6(n)),t.time=n=>t.check(B6(n)),t.duration=n=>t.check(U6(n))});function P(t){return y9(nY,t)}const yt=F("ZodStringFormat",(t,e)=>{ht.init(t,e),x$.init(t,e)}),rY=F("ZodEmail",(t,e)=>{xH.init(t,e),yt.init(t,e)}),RC=F("ZodGUID",(t,e)=>{kH.init(t,e),yt.init(t,e)}),gd=F("ZodUUID",(t,e)=>{vH.init(t,e),yt.init(t,e)}),iY=F("ZodURL",(t,e)=>{CH.init(t,e),yt.init(t,e)}),sY=F("ZodEmoji",(t,e)=>{EH.init(t,e),yt.init(t,e)}),oY=F("ZodNanoID",(t,e)=>{_H.init(t,e),yt.init(t,e)}),aY=F("ZodCUID",(t,e)=>{TH.init(t,e),yt.init(t,e)}),lY=F("ZodCUID2",(t,e)=>{AH.init(t,e),yt.init(t,e)}),cY=F("ZodULID",(t,e)=>{PH.init(t,e),yt.init(t,e)}),uY=F("ZodXID",(t,e)=>{IH.init(t,e),yt.init(t,e)}),hY=F("ZodKSUID",(t,e)=>{RH.init(t,e),yt.init(t,e)}),dY=F("ZodIPv4",(t,e)=>{LH.init(t,e),yt.init(t,e)}),fY=F("ZodIPv6",(t,e)=>{DH.init(t,e),yt.init(t,e)}),pY=F("ZodCIDRv4",(t,e)=>{zH.init(t,e),yt.init(t,e)}),gY=F("ZodCIDRv6",(t,e)=>{BH.init(t,e),yt.init(t,e)}),mY=F("ZodBase64",(t,e)=>{jH.init(t,e),yt.init(t,e)}),OY=F("ZodBase64URL",(t,e)=>{ZH.init(t,e),yt.init(t,e)}),yY=F("ZodE164",(t,e)=>{FH.init(t,e),yt.init(t,e)}),bY=F("ZodJWT",(t,e)=>{WH.init(t,e),yt.init(t,e)}),C$=F("ZodNumber",(t,e)=>{f$.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(r,i,s)=>p6(t,r,i),xh(t,"ZodNumber",{gt(r,i){return this.check(AC(r,i))},gte(r,i){return this.check(aO(r,i))},min(r,i){return this.check(aO(r,i))},lt(r,i){return this.check(TC(r,i))},lte(r,i){return this.check(oO(r,i))},max(r,i){return this.check(oO(r,i))},int(r){return this.check(NC(r))},safe(r){return this.check(NC(r))},positive(r){return this.check(AC(0,r))},nonnegative(r){return this.check(aO(0,r))},negative(r){return this.check(TC(0,r))},nonpositive(r){return this.check(oO(0,r))},multipleOf(r,i){return this.check(PC(r,i))},step(r,i){return this.check(PC(r,i))},finite(){return this}});const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function Wt(t){return F9(C$,t)}const wY=F("ZodNumberFormat",(t,e)=>{VH.init(t,e),C$.init(t,e)});function NC(t){return X9(wY,t)}const SY=F("ZodBoolean",(t,e)=>{HH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>g6(t,n,r)});function pt(t){return W9(SY,t)}const kY=F("ZodNull",(t,e)=>{YH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>m6(t,n,r)});function vY(t){return V9(kY,t)}const xY=F("ZodUnknown",(t,e)=>{qH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>y6()});function bl(){return H9(xY)}const CY=F("ZodNever",(t,e)=>{GH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>O6(t,n,r)});function EY(t){return Y9(CY,t)}const _Y=F("ZodArray",(t,e)=>{KH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>v6(t,n,r,i),t.element=e.element,xh(t,"ZodArray",{min(n,r){return this.check(xp(n,r))},nonempty(n){return this.check(xp(1,n))},max(n,r){return this.check(y$(n,r))},length(n,r){return this.check(b$(n,r))},unwrap(){return this.element}})});function Vt(t,e){return a6(_Y,t,e)}const TY=F("ZodObject",(t,e)=>{e9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>x6(t,n,r,i),je(t,"shape",()=>e.shape),xh(t,"ZodObject",{keyof(){return ns(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:bl()})},loose(){return this.clone({...this._zod.def,catchall:bl()})},strict(){return this.clone({...this._zod.def,catchall:EY()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return OV(this,n)},safeExtend(n){return yV(this,n)},merge(n){return bV(this,n)},pick(n){return gV(this,n)},omit(n){return mV(this,n)},partial(...n){return wV(_$,this,n[0])},required(...n){return SV(T$,this,n[0])}})});function ce(t,e){const n={type:"object",shape:t??{},...fe(e)};return new TY(n)}const E$=F("ZodUnion",(t,e)=>{m$.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>C6(t,n,r,i),t.options=e.options});function Ch(t,e){return new E$({type:"union",options:t,...fe(e)})}const AY=F("ZodDiscriminatedUnion",(t,e)=>{E$.init(t,e),t9.init(t,e)});function Kg(t,e,n){return new AY({type:"union",options:e,discriminator:t,...fe(n)})}const PY=F("ZodIntersection",(t,e)=>{n9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>E6(t,n,r,i)});function IY(t,e){return new PY({type:"intersection",left:t,right:e})}const $C=F("ZodRecord",(t,e)=>{r9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>_6(t,n,r,i),t.keyType=e.keyType,t.valueType=e.valueType});function Eh(t,e,n){return!e||!e._zod?new $C({type:"record",keyType:P(),valueType:t,...fe(e)}):new $C({type:"record",keyType:t,valueType:e,...fe(n)})}const zb=F("ZodEnum",(t,e)=>{i9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(r,i,s)=>b6(t,r,i),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new zb({...e,checks:[],...fe(i),entries:s})},t.exclude=(r,i)=>{const s={...e.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new zb({...e,checks:[],...fe(i),entries:s})}});function ns(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new zb({type:"enum",entries:n,...fe(e)})}const RY=F("ZodLiteral",(t,e)=>{s9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>w6(t,n,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function me(t,e){return new RY({type:"literal",values:Array.isArray(t)?t:[t],...fe(e)})}const NY=F("ZodTransform",(t,e)=>{o9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>k6(t,n),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new KN(t.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Bu(s,n.value,e));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),n.issues.push(Bu(o))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function $Y(t){return new NY({type:"transform",transform:t})}const _$=F("ZodOptional",(t,e)=>{O$.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>v$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function MC(t){return new _$({type:"optional",innerType:t})}const MY=F("ZodExactOptional",(t,e)=>{a9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>v$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function QY(t){return new MY({type:"optional",innerType:t})}const LY=F("ZodNullable",(t,e)=>{l9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>T6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function QC(t){return new LY({type:"nullable",innerType:t})}const DY=F("ZodDefault",(t,e)=>{c9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>P6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function zY(t,e){return new DY({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():t$(e)}})}const BY=F("ZodPrefault",(t,e)=>{u9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>I6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function jY(t,e){return new BY({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():t$(e)}})}const T$=F("ZodNonOptional",(t,e)=>{h9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>A6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function UY(t,e){return new T$({type:"nonoptional",innerType:t,...fe(e)})}const ZY=F("ZodCatch",(t,e)=>{d9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>R6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function FY(t,e){return new ZY({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const XY=F("ZodPipe",(t,e)=>{f9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>N6(t,n,r,i),t.in=e.in,t.out=e.out});function LC(t,e){return new XY({type:"pipe",in:t,out:e})}const WY=F("ZodReadonly",(t,e)=>{p9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>$6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function VY(t){return new WY({type:"readonly",innerType:t})}const HY=F("ZodCustom",(t,e)=>{g9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>S6(t,n)});function YY(t,e={}){return l6(HY,t,e)}function qY(t,e){return c6(t,e)}const GY=ce({appName:me("Chapterhouse"),entraAuthEnabled:me(!1),standalone:me(!0),chatSseEnabled:pt().optional()}),KY=ce({appName:me("Chapterhouse"),entraAuthEnabled:me(!1),standalone:me(!1),chatSseEnabled:pt().optional()}),JY=ce({appName:me("Chapterhouse"),entraAuthEnabled:me(!0),entraClientId:P(),entraTenantId:P(),chatSseEnabled:pt().optional()}),eq=Ch([GY,KY,JY]),tq=Ch([ce({authMode:me("legacy"),token:P().nullable()}),ce({authMode:me("entra")}),ce({authMode:me("standalone")})]),lO=ce({status:P()}),nq=ce({status:P(),cancelled:pt()}),rq=ce({slug:P(),cwd:P(),hardRuleCount:Wt().int().nullable(),softRuleCount:Wt().int().nullable()}),iq=Vt(rq),A$=ce({auto_pr:pt(),require_worktree:pt(),pr_draft_default:pt(),default_branch:P(),commit_co_author:P(),test_command:P(),build_command:P(),lint_command:P(),require_clean_worktree:pt()}),sq=ce({hardRules:A$}),oq=ce({softRules:Vt(P())}),md=Kg("rulesFound",[ce({slug:P(),cwd:P(),rulesFound:me(!0),hardRules:A$,softRules:Vt(P())}),ce({slug:P(),cwd:P(),rulesFound:me(!1),hardRules:vY(),softRules:Vt(P())})]),aq=ce({ok:me(!0),slug:P()}),lq=ce({slug:P(),name:P(),model:P(),taskId:P(),description:P(),status:P(),startedAt:P(),completedAt:P().nullable()}),cq=Vt(lq),uq=ce({taskId:P(),agentSlug:P(),name:P(),description:P(),prompt:P().nullable(),status:P(),result:P().nullable(),startedAt:P(),completedAt:P().nullable()}),hq=ce({id:Wt(),taskId:P(),seq:Wt(),ts:Wt(),kind:ns(["tool_start","tool_complete"]),toolName:P().nullable(),summary:P().nullable()});ce({taskId:P(),events:Vt(hq)});const dq=ce({model:P()}),fq=ce({previous:P(),current:P()}),pq=ce({models:Vt(P()),current:P()}),DC=ce({enabled:pt(),tierModels:Eh(P(),P()),cooldownMessages:Wt(),currentModel:P(),lastRoute:bl()}),gq=ce({path:P(),title:P(),summary:P(),section:P(),tags:Vt(P()),updated:P(),scope:ns(["personal","team"])}),mq=Vt(gq),Oq=Ch([P(),Vt(P()),pt()]),yq=ce({title:P().optional(),summary:P().optional(),updated:P().optional(),tags:Vt(P()).optional(),autostub:pt().optional(),confidence:ns(["high","medium","low"]).optional(),contested:pt().optional(),contradictions:Vt(P()).optional(),related:Vt(P()).optional(),auto_pr:pt().optional(),require_worktree:pt().optional(),pr_draft_default:pt().optional(),default_branch:P().optional(),commit_co_author:P().optional(),test_command:P().optional(),build_command:P().optional(),lint_command:P().optional(),require_clean_worktree:pt().optional(),metadata:Eh(P(),Oq)}),bq=ce({path:P(),content:P(),renderedContent:P(),frontmatter:yq}),wq=ce({ok:pt(),created:pt(),path:P()}),Sq=ce({ok:pt(),path:P()}),kq=ce({slug:P(),name:P(),description:P(),directory:P(),source:ns(["bundled","local","global"])}),vq=Vt(kq),xq=ce({ok:pt(),message:P()}),Cq=ce({id:Wt().int(),role:ns(["user","assistant"]),content:P(),ts:P(),turn_id:P().nullable()}),Eq=ce({sessionKey:P(),messages:Vt(Cq)}),_q=ce({type:me("text"),text:P()}),Tq=ce({type:me("thinking"),reasoningId:P(),text:P(),active:pt()}),Aq=ce({type:me("tool-call"),toolCallId:P(),toolName:P(),mcpServerName:P().optional(),arguments:Eh(P(),bl()).optional(),status:ns(["running","done","failed"]),resultPreview:P().optional(),detailedContent:P().optional(),agentSlug:P().optional()}),Pq=ce({type:me("subagent"),toolCallId:P(),agentName:P(),agentDisplayName:P(),agentDescription:P().optional(),status:ns(["running","done","failed"]),durationMs:Wt().optional(),error:P().optional(),agentSlug:P().optional()}),Iq=ce({type:me("activity-heartbeat"),agentSlug:P(),agentName:P(),currentAction:P(),startedAt:Wt(),lastUpdate:Wt()}),Rq=Kg("type",[_q,Tq,Aq,Pq,Iq]),Nq=ce({model:P(),routerMode:P().optional(),tier:P().nullable().optional(),overrideName:P().optional()}),$q=ce({kind:me("thinking_delta"),reasoningId:P(),deltaContent:P(),agentSlug:P().optional()}),Mq=ce({kind:me("tool_start"),toolCallId:P(),toolName:P(),mcpServerName:P().optional(),arguments:Eh(P(),bl()).optional(),agentSlug:P().optional()}),Qq=ce({kind:me("tool_complete"),toolCallId:P(),success:pt(),resultPreview:P().optional(),detailedContent:P().optional(),agentSlug:P().optional()}),Lq=ce({kind:me("subagent_started"),toolCallId:P(),agentName:P(),agentDisplayName:P(),agentDescription:P(),agentSlug:P().optional()}),Dq=ce({kind:me("subagent_completed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),durationMs:Wt().optional(),agentSlug:P().optional()}),zq=ce({kind:me("subagent_failed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),error:P().optional(),agentSlug:P().optional()});Kg("kind",[$q,Mq,Qq,Lq,Dq,zq]);const Bq=Ch([ce({type:me("connected"),connectionId:P()}),ce({type:me("delta"),content:P(),sessionKey:P().optional(),turnId:P().optional()}),ce({type:me("message"),content:P(),sessionKey:P().optional(),turnId:P().optional(),route:Nq.optional()}),ce({type:me("cancelled"),sessionKey:P().optional()}),ce({type:me("status"),status:ns(["idle","dreaming"]),message:P()}),ce({type:me("queued"),position:Wt(),sessionKey:P().optional(),turnId:P().optional(),msgId:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("thinking_delta"),reasoningId:P(),deltaContent:P(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("tool_start"),toolCallId:P(),toolName:P(),mcpServerName:P().optional(),arguments:Eh(P(),bl()).optional(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("tool_complete"),toolCallId:P(),success:pt(),resultPreview:P().optional(),detailedContent:P().optional(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("subagent_started"),toolCallId:P(),agentName:P(),agentDisplayName:P(),agentDescription:P(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("subagent_completed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),durationMs:Wt().optional(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("subagent_failed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),error:P().optional(),agentSlug:P().optional()}),ce({type:me("queue-advance"),length:Wt(),sessionKey:P().optional()}),ce({type:me("turn-interrupted"),abortedTurnId:P(),sessionKey:P().optional()})]),jq=ce({turnId:P()}),Vl={_seq:Wt().optional(),_ts:Wt().optional()},Uq=ce({...Vl,type:me("turn:started"),turnId:P(),sessionKey:P(),prompt:P(),attachments:Vt(ce({type:me("file"),path:P(),displayName:P().optional()})).optional()}),Zq=ce({...Vl,type:me("turn:delta"),turnId:P(),sessionKey:P(),part:Rq}),Fq=ce({...Vl,type:me("turn:queued"),turnId:P(),sessionKey:P(),position:Wt()}),Xq=ce({...Vl,type:me("turn:interrupted"),turnId:P(),sessionKey:P()}),Wq=ce({...Vl,type:me("turn:complete"),turnId:P(),sessionKey:P(),finalMessage:P()}),Vq=ce({...Vl,type:me("turn:error"),turnId:P(),sessionKey:P(),error:P()}),Hq=Kg("type",[Uq,Zq,Fq,Xq,Wq,Vq]),Yq=new Set([408,425,429,500,502,503,504]),Ep=[400,800,1600];let Bb=null,Od=null,yd=null,Jg=!1;function qq(t){return Bb=t,t}function Gq(){const t=new URL(window.location.href),e=new URLSearchParams(t.hash.startsWith("#")?t.hash.slice(1):t.hash);(t.searchParams.has("access_token")||t.searchParams.has("token")||e.has("access_token")||e.has("token"))&&(t.searchParams.delete("access_token"),t.searchParams.delete("token"),e.delete("access_token"),e.delete("token"),t.hash=e.toString()?`#${e.toString()}`:"",window.history.replaceState({},document.title,t.toString()))}function Kq(t){const e=(t??"GET").toUpperCase();return e==="GET"||e==="HEAD"||e==="OPTIONS"}function Jq(t){return t instanceof DOMException&&t.name==="AbortError"}function eG(t){if(!t)return null;const e=Number(t);if(Number.isFinite(e))return Math.max(0,e*1e3);const n=Date.parse(t);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}function zC(t,e){return eG((t==null?void 0:t.headers.get("Retry-After"))??null)??Ep[Math.min(e,Ep.length-1)]}function BC(t){return new Promise(e=>window.setTimeout(e,t))}async function fv(t,e={},n={}){const r=n.retry??Kq(e.method);for(let i=0;;i+=1)try{const s=await fetch(t,e);if(!r||!Yq.has(s.status)||i>=Ep.length)return s;await BC(zC(s,i))}catch(s){if(!r||i>=Ep.length||Jq(s))throw s;await BC(zC(null,i))}}async function tG(){const t=await fv("/api/config/public",{},{retry:!0});if(!t.ok)throw new Error(`Failed to load auth config: ${t.status} ${t.statusText}`);const e=await t.json(),n=eq.safeParse(e);if(!n.success)throw console.error("[api] /api/config/public schema validation failed:",n.error.format()),new Error("The server returned an unexpected auth config shape. Please reload.");return n.data}async function nG(){if(Bb)return Bb;Gq();const t=await fv("/api/bootstrap",{},{retry:!0});if(!t.ok)throw new Error(`Bootstrap failed: ${t.status} ${t.statusText}`);const e=await t.json(),n=tq.safeParse(e);if(!n.success)throw console.error("[api] /api/bootstrap schema validation failed:",n.error.format()),new Error("The server returned an unexpected bootstrap shape. Please reload.");const r=n.data;if(r.authMode==="standalone")return Jg=!0,"";if(r.authMode!=="legacy")throw new Error("Entra auth is enabled but the browser auth flow has not been initialized");if(!r.token)throw new Error("Bootstrap did not return an API token");return qq(r.token)}async function pv(){return Od||(Od=tG().catch(t=>{throw Od=null,t})),await Od}async function em(){yd||(yd=(async()=>{const e=await pv();return Jg=!e.entraAuthEnabled&&e.standalone,e.entraAuthEnabled?(await oV(e),{config:e,authEnabled:!0,isAuthenticated:dC(),user:fC()}):{config:e,authEnabled:!1,isAuthenticated:!0,user:null}})().catch(e=>{throw yd=null,e}));const t=await yd;return t.authEnabled?{...t,isAuthenticated:dC(),user:fC()}:t}async function rG(){return(await em()).authEnabled?await aV():Jg?"":await nG()}async function _h(t){const e=new Headers(t),n=await rG();return!Jg&&n&&e.set("Authorization",`Bearer ${n}`),e}async function iG(){if(!(await em()).authEnabled)throw new Error("Microsoft sign-in is not enabled for this Chapterhouse server");await GN()}async function sG(){(await em()).authEnabled&&await lV()}async function nt(t,e={},n={}){const r=await _h(e.headers);return e.body&&!r.has("Content-Type")&&r.set("Content-Type","application/json"),fv(t,{...e,headers:r},n)}async function rt(t,e){if(!t.ok){let i;try{const s=await t.json();i=(s==null?void 0:s.error)||JSON.stringify(s)}catch{i=await t.text().catch(()=>{})}throw new Error(`HTTP ${t.status}${i?": "+i:""}`)}const n=await t.json(),r=e.safeParse(n);if(!r.success){const i=t.url?` (${new URL(t.url,"http://localhost").pathname})`:"";throw console.error(`[api] Schema validation failed${i}:`,r.error.format()),new Error(`The server returned an unexpected response${i}. Please try again or contact support.`)}return r.data}const Ve={sendMessage:(t,e,n,r)=>nt("/api/message",{method:"POST",body:JSON.stringify({prompt:t,connectionId:e,...n?{sessionKey:n}:{},...r?{msgId:r}:{}})}).then(i=>rt(i,lO)),cancel:()=>nt("/api/cancel",{method:"POST"}).then(t=>rt(t,nq)),listProjects:()=>nt("/api/projects").then(t=>rt(t,iq)),createProject:t=>nt("/api/projects",{method:"POST",body:JSON.stringify(t)}).then(e=>rt(e,md)),getProjectDetail:t=>nt(`/api/projects/${encodeURIComponent(t)}`).then(e=>rt(e,md)),deleteProject:t=>nt(`/api/projects/${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>rt(e,aq)),updateProjectHardRules:(t,e)=>nt(`/api/projects/${encodeURIComponent(t)}/rules/hard`,{method:"PUT",body:JSON.stringify(sq.parse(e))}).then(n=>rt(n,md)),updateProjectSoftRules:(t,e)=>nt(`/api/projects/${encodeURIComponent(t)}/rules/soft`,{method:"PUT",body:JSON.stringify(oq.parse(e))}).then(n=>rt(n,md)),interruptMessage:(t,e,n,r)=>nt(`/api/sessions/${encodeURIComponent(t)}/interrupt`,{method:"POST",body:JSON.stringify({prompt:n,connectionId:e,...r&&r.length>0?{attachments:r}:{}})}).then(i=>rt(i,lO)),listWorkers:()=>nt("/api/workers").then(t=>rt(t,cq)),getWorker:t=>nt(`/api/workers/${encodeURIComponent(t)}`).then(e=>rt(e,uq)),getModel:()=>nt("/api/model").then(t=>rt(t,dq)),setModel:t=>nt("/api/model",{method:"POST",body:JSON.stringify({model:t})}).then(e=>rt(e,fq)),listModels:()=>nt("/api/models").then(t=>rt(t,pq)),getAuto:()=>nt("/api/auto").then(t=>rt(t,DC)),setAuto:t=>nt("/api/auto",{method:"POST",body:JSON.stringify(t)}).then(e=>rt(e,DC)),listPages:()=>nt("/api/wiki/pages").then(t=>rt(t,mq)),readPage:t=>nt(`/api/wiki/page?path=${encodeURIComponent(t)}`).then(e=>rt(e,bq)),writePage:(t,e)=>nt(`/api/wiki/page?path=${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({content:e})}).then(n=>rt(n,wq)),deletePage:t=>nt(`/api/wiki/page?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>rt(e,Sq)),listSkills:()=>nt("/api/skills").then(t=>rt(t,vq)),removeSkill:t=>nt(`/api/skills/${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>rt(e,xq)),restart:()=>nt("/api/restart",{method:"POST"}).then(t=>rt(t,lO)),getSessionMessages:(t,e)=>{const n=`/api/session/${encodeURIComponent(t)}/messages${e!==void 0?`?limit=${e}`:""}`;return nt(n).then(r=>rt(r,Eq))},submitTurn:(t,e)=>nt(`/api/sessions/${encodeURIComponent(t)}/turn`,{method:"POST",body:JSON.stringify(e)}).then(n=>rt(n,jq))},oG=1e3,aG=3e4,lG=10;function cG(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}function uG(t,e){return new Promise(n=>{if(e!=null&&e.aborted){n();return}const r=window.setTimeout(n,t);e==null||e.addEventListener("abort",()=>{window.clearTimeout(r),n()})})}function hG(t){let e="message";const n=[];for(const r of t.split(`
|
|
134
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of t.seen.entries()){const h=u[1];if(e===u[0]){s(u);continue}if(t.external){const f=(l=t.external.registry.get(u[0]))==null?void 0:l.id;if(e!==u[0]&&f){s(u);continue}}if((c=t.metadataRegistry.get(u[0]))==null?void 0:c.id){s(u);continue}if(h.cycle){s(u);continue}if(h.count>1&&t.reused==="ref"){s(u);continue}}}function k$(t,e){var a,l,c,u;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=h=>{const d=t.seen.get(h);if(d.ref===null)return;const f=d.def??d.schema,p={...f},g=d.ref;if(d.ref=null,g){r(g);const m=t.seen.get(g),O=m.schema;if(O.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(O)):Object.assign(f,O),Object.assign(f,p),h._zod.parent===g)for(const S in f)S==="$ref"||S==="allOf"||S in p||delete f[S];if(O.$ref&&m.def)for(const S in f)S==="$ref"||S==="allOf"||S in m.def&&JSON.stringify(f[S])===JSON.stringify(m.def[S])&&delete f[S]}const y=h._zod.parent;if(y&&y!==g){r(y);const m=t.seen.get(y);if(m!=null&&m.schema.$ref&&(f.$ref=m.schema.$ref,m.def))for(const O in f)O==="$ref"||O==="allOf"||O in m.def&&JSON.stringify(f[O])===JSON.stringify(m.def[O])&&delete f[O]}t.override({zodSchema:h,jsonSchema:f,path:d.path??[]})};for(const h of[...t.seen.entries()].reverse())r(h[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(a=t.external)!=null&&a.uri){const h=(l=t.external.registry.get(e))==null?void 0:l.id;if(!h)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(h)}Object.assign(i,n.def??n.schema);const s=(c=t.metadataRegistry.get(e))==null?void 0:c.id;s!==void 0&&i.id===s&&delete i.id;const o=((u=t.external)==null?void 0:u.defs)??{};for(const h of t.seen.entries()){const d=h[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,o[d.defId]=d.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const h=JSON.parse(JSON.stringify(i));return Object.defineProperty(h,"~standard",{value:{...e["~standard"],jsonSchema:{input:Cp(e,"input",t.processors),output:Cp(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function hn(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return hn(r.element,n);if(r.type==="set")return hn(r.valueType,n);if(r.type==="lazy")return hn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return hn(r.innerType,n);if(r.type==="intersection")return hn(r.left,n)||hn(r.right,n);if(r.type==="record"||r.type==="map")return hn(r.keyType,n)||hn(r.valueType,n);if(r.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:hn(r.in,n)||hn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(hn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(hn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(hn(i,n))return!0;return!!(r.rest&&hn(r.rest,n))}return!1}const h6=(t,e={})=>n=>{const r=w$({...n,processors:e});return Pt(t,r),S$(r,t),k$(r,t)},Cp=(t,e,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=w$({...i??{},target:s,io:e,processors:n});return Pt(t,o),S$(o,t),k$(o,t)},d6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},f6=(t,e,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:a,patterns:l,contentEncoding:c}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),a&&(i.format=d6[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(h=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},p6=(t,e,n,r)=>{const i=n,{minimum:s,maximum:o,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";const h=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),d=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";h?f?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),d?f?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o=="number"&&(i.maximum=o),typeof l=="number"&&(i.multipleOf=l)},g6=(t,e,n,r)=>{n.type="boolean"},m6=(t,e,n,r)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},O6=(t,e,n,r)=>{n.not={}},y6=(t,e,n,r)=>{},b6=(t,e,n,r)=>{const i=t._zod.def,s=JN(i.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},w6=(t,e,n,r)=>{const i=t._zod.def,s=[];for(const o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),s.every(o=>typeof o=="boolean")&&(n.type="boolean"),s.every(o=>o===null)&&(n.type="null"),n.enum=s},S6=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},k6=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},v6=(t,e,n,r)=>{const i=n,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Pt(s.element,e,{...r,path:[...r.path,"items"]})},x6=(t,e,n,r)=>{var c;const i=n,s=t._zod.def;i.type="object",i.properties={};const o=s.shape;for(const u in o)i.properties[u]=Pt(o[u],e,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(u=>{const h=s.shape[u]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((c=s.catchall)==null?void 0:c._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Pt(s.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},C6=(t,e,n,r)=>{const i=t._zod.def,s=i.inclusive===!1,o=i.options.map((a,l)=>Pt(a,e,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?n.oneOf=o:n.anyOf=o},E6=(t,e,n,r)=>{const i=t._zod.def,s=Pt(i.left,e,{...r,path:[...r.path,"allOf",0]}),o=Pt(i.right,e,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];n.allOf=l},_6=(t,e,n,r)=>{const i=n,s=t._zod.def;i.type="object";const o=s.keyType,a=o._zod.bag,l=a==null?void 0:a.patterns;if(s.mode==="loose"&&l&&l.size>0){const u=Pt(s.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const h of l)i.patternProperties[h.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Pt(s.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Pt(s.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const c=o._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(i.required=u)}},T6=(t,e,n,r)=>{const i=t._zod.def,s=Pt(i.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},A6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType},P6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},I6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},R6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},N6=(t,e,n,r)=>{const i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?i.out:i.in:i.out;Pt(o,e,r);const a=e.seen.get(t);a.ref=o},$6=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType,n.readOnly=!0},v$=(t,e,n,r)=>{const i=t._zod.def;Pt(i.innerType,e,r);const s=e.seen.get(t);s.ref=i.innerType},M6=F("ZodISODateTime",(t,e)=>{NH.init(t,e),yt.init(t,e)});function Q6(t){return B9(M6,t)}const L6=F("ZodISODate",(t,e)=>{$H.init(t,e),yt.init(t,e)});function D6(t){return j9(L6,t)}const z6=F("ZodISOTime",(t,e)=>{MH.init(t,e),yt.init(t,e)});function B6(t){return U9(z6,t)}const j6=F("ZodISODuration",(t,e)=>{QH.init(t,e),yt.init(t,e)});function U6(t){return Z9(j6,t)}const Z6=(t,e)=>{r$.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>xV(t,n)},flatten:{value:n=>vV(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Lb,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Lb,2)}},isEmpty:{get(){return t.issues.length===0}}})},xr=F("ZodError",Z6,{Parent:Error}),F6=uv(xr),X6=hv(xr),W6=Yg(xr),V6=qg(xr),H6=_V(xr),Y6=TV(xr),q6=AV(xr),G6=PV(xr),K6=IV(xr),J6=RV(xr),eY=NV(xr),tY=$V(xr),IC=new WeakMap;function xh(t,e,n){const r=Object.getPrototypeOf(t);let i=IC.get(r);if(i||(i=new Set,IC.set(r,i)),!i.has(e)){i.add(e);for(const s in n){const o=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const dt=F("ZodType",(t,e)=>(ut.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Cp(t,"input"),output:Cp(t,"output")}}),t.toJSONSchema=h6(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,r)=>F6(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>W6(t,n,r),t.parseAsync=async(n,r)=>X6(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>V6(t,n,r),t.spa=t.safeParseAsync,t.encode=(n,r)=>H6(t,n,r),t.decode=(n,r)=>Y6(t,n,r),t.encodeAsync=async(n,r)=>q6(t,n,r),t.decodeAsync=async(n,r)=>G6(t,n,r),t.safeEncode=(n,r)=>K6(t,n,r),t.safeDecode=(n,r)=>J6(t,n,r),t.safeEncodeAsync=async(n,r)=>eY(t,n,r),t.safeDecodeAsync=async(n,r)=>tY(t,n,r),xh(t,"ZodType",{check(...n){const r=this.def;return this.clone(ro(r,{checks:[...r.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return io(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(YY(n,r))},superRefine(n,r){return this.check(qY(n,r))},overwrite(n){return this.check(Wl(n))},optional(){return MC(this)},exactOptional(){return QY(this)},nullable(){return QC(this)},nullish(){return MC(QC(this))},nonoptional(n){return UY(this,n)},array(){return Vt(this)},or(n){return Ch([this,n])},and(n){return IY(this,n)},transform(n){return LC(this,$Y(n))},default(n){return zY(this,n)},prefault(n){return jY(this,n)},catch(n){return FY(this,n)},pipe(n){return LC(this,n)},readonly(){return VY(this)},describe(n){const r=this.clone();return Lc.add(r,{description:n}),r},meta(...n){if(n.length===0)return Lc.get(this);const r=this.clone();return Lc.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){var n;return(n=Lc.get(t))==null?void 0:n.description},configurable:!0}),t)),x$=F("_ZodString",(t,e)=>{dv.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(r,i,s)=>f6(t,r,i);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,xh(t,"_ZodString",{regex(...r){return this.check(q9(...r))},includes(...r){return this.check(J9(...r))},startsWith(...r){return this.check(e6(...r))},endsWith(...r){return this.check(t6(...r))},min(...r){return this.check(xp(...r))},max(...r){return this.check(y$(...r))},length(...r){return this.check(b$(...r))},nonempty(...r){return this.check(xp(1,...r))},lowercase(r){return this.check(G9(r))},uppercase(r){return this.check(K9(r))},trim(){return this.check(r6())},normalize(...r){return this.check(n6(...r))},toLowerCase(){return this.check(i6())},toUpperCase(){return this.check(s6())},slugify(){return this.check(o6())}})}),nY=F("ZodString",(t,e)=>{dv.init(t,e),x$.init(t,e),t.email=n=>t.check(b9(rY,n)),t.url=n=>t.check(x9(iY,n)),t.jwt=n=>t.check(z9(bY,n)),t.emoji=n=>t.check(C9(sY,n)),t.guid=n=>t.check(_C(RC,n)),t.uuid=n=>t.check(w9(gd,n)),t.uuidv4=n=>t.check(S9(gd,n)),t.uuidv6=n=>t.check(k9(gd,n)),t.uuidv7=n=>t.check(v9(gd,n)),t.nanoid=n=>t.check(E9(oY,n)),t.guid=n=>t.check(_C(RC,n)),t.cuid=n=>t.check(_9(aY,n)),t.cuid2=n=>t.check(T9(lY,n)),t.ulid=n=>t.check(A9(cY,n)),t.base64=n=>t.check(Q9(mY,n)),t.base64url=n=>t.check(L9(OY,n)),t.xid=n=>t.check(P9(uY,n)),t.ksuid=n=>t.check(I9(hY,n)),t.ipv4=n=>t.check(R9(dY,n)),t.ipv6=n=>t.check(N9(fY,n)),t.cidrv4=n=>t.check($9(pY,n)),t.cidrv6=n=>t.check(M9(gY,n)),t.e164=n=>t.check(D9(yY,n)),t.datetime=n=>t.check(Q6(n)),t.date=n=>t.check(D6(n)),t.time=n=>t.check(B6(n)),t.duration=n=>t.check(U6(n))});function P(t){return y9(nY,t)}const yt=F("ZodStringFormat",(t,e)=>{ht.init(t,e),x$.init(t,e)}),rY=F("ZodEmail",(t,e)=>{xH.init(t,e),yt.init(t,e)}),RC=F("ZodGUID",(t,e)=>{kH.init(t,e),yt.init(t,e)}),gd=F("ZodUUID",(t,e)=>{vH.init(t,e),yt.init(t,e)}),iY=F("ZodURL",(t,e)=>{CH.init(t,e),yt.init(t,e)}),sY=F("ZodEmoji",(t,e)=>{EH.init(t,e),yt.init(t,e)}),oY=F("ZodNanoID",(t,e)=>{_H.init(t,e),yt.init(t,e)}),aY=F("ZodCUID",(t,e)=>{TH.init(t,e),yt.init(t,e)}),lY=F("ZodCUID2",(t,e)=>{AH.init(t,e),yt.init(t,e)}),cY=F("ZodULID",(t,e)=>{PH.init(t,e),yt.init(t,e)}),uY=F("ZodXID",(t,e)=>{IH.init(t,e),yt.init(t,e)}),hY=F("ZodKSUID",(t,e)=>{RH.init(t,e),yt.init(t,e)}),dY=F("ZodIPv4",(t,e)=>{LH.init(t,e),yt.init(t,e)}),fY=F("ZodIPv6",(t,e)=>{DH.init(t,e),yt.init(t,e)}),pY=F("ZodCIDRv4",(t,e)=>{zH.init(t,e),yt.init(t,e)}),gY=F("ZodCIDRv6",(t,e)=>{BH.init(t,e),yt.init(t,e)}),mY=F("ZodBase64",(t,e)=>{jH.init(t,e),yt.init(t,e)}),OY=F("ZodBase64URL",(t,e)=>{ZH.init(t,e),yt.init(t,e)}),yY=F("ZodE164",(t,e)=>{FH.init(t,e),yt.init(t,e)}),bY=F("ZodJWT",(t,e)=>{WH.init(t,e),yt.init(t,e)}),C$=F("ZodNumber",(t,e)=>{f$.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(r,i,s)=>p6(t,r,i),xh(t,"ZodNumber",{gt(r,i){return this.check(AC(r,i))},gte(r,i){return this.check(aO(r,i))},min(r,i){return this.check(aO(r,i))},lt(r,i){return this.check(TC(r,i))},lte(r,i){return this.check(oO(r,i))},max(r,i){return this.check(oO(r,i))},int(r){return this.check(NC(r))},safe(r){return this.check(NC(r))},positive(r){return this.check(AC(0,r))},nonnegative(r){return this.check(aO(0,r))},negative(r){return this.check(TC(0,r))},nonpositive(r){return this.check(oO(0,r))},multipleOf(r,i){return this.check(PC(r,i))},step(r,i){return this.check(PC(r,i))},finite(){return this}});const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function Wt(t){return F9(C$,t)}const wY=F("ZodNumberFormat",(t,e)=>{VH.init(t,e),C$.init(t,e)});function NC(t){return X9(wY,t)}const SY=F("ZodBoolean",(t,e)=>{HH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>g6(t,n,r)});function pt(t){return W9(SY,t)}const kY=F("ZodNull",(t,e)=>{YH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>m6(t,n,r)});function vY(t){return V9(kY,t)}const xY=F("ZodUnknown",(t,e)=>{qH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>y6()});function bl(){return H9(xY)}const CY=F("ZodNever",(t,e)=>{GH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>O6(t,n,r)});function EY(t){return Y9(CY,t)}const _Y=F("ZodArray",(t,e)=>{KH.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>v6(t,n,r,i),t.element=e.element,xh(t,"ZodArray",{min(n,r){return this.check(xp(n,r))},nonempty(n){return this.check(xp(1,n))},max(n,r){return this.check(y$(n,r))},length(n,r){return this.check(b$(n,r))},unwrap(){return this.element}})});function Vt(t,e){return a6(_Y,t,e)}const TY=F("ZodObject",(t,e)=>{e9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>x6(t,n,r,i),je(t,"shape",()=>e.shape),xh(t,"ZodObject",{keyof(){return ns(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:bl()})},loose(){return this.clone({...this._zod.def,catchall:bl()})},strict(){return this.clone({...this._zod.def,catchall:EY()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return OV(this,n)},safeExtend(n){return yV(this,n)},merge(n){return bV(this,n)},pick(n){return gV(this,n)},omit(n){return mV(this,n)},partial(...n){return wV(_$,this,n[0])},required(...n){return SV(T$,this,n[0])}})});function ce(t,e){const n={type:"object",shape:t??{},...fe(e)};return new TY(n)}const E$=F("ZodUnion",(t,e)=>{m$.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>C6(t,n,r,i),t.options=e.options});function Ch(t,e){return new E$({type:"union",options:t,...fe(e)})}const AY=F("ZodDiscriminatedUnion",(t,e)=>{E$.init(t,e),t9.init(t,e)});function Kg(t,e,n){return new AY({type:"union",options:e,discriminator:t,...fe(n)})}const PY=F("ZodIntersection",(t,e)=>{n9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>E6(t,n,r,i)});function IY(t,e){return new PY({type:"intersection",left:t,right:e})}const $C=F("ZodRecord",(t,e)=>{r9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>_6(t,n,r,i),t.keyType=e.keyType,t.valueType=e.valueType});function Eh(t,e,n){return!e||!e._zod?new $C({type:"record",keyType:P(),valueType:t,...fe(e)}):new $C({type:"record",keyType:t,valueType:e,...fe(n)})}const zb=F("ZodEnum",(t,e)=>{i9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(r,i,s)=>b6(t,r,i),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new zb({...e,checks:[],...fe(i),entries:s})},t.exclude=(r,i)=>{const s={...e.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new zb({...e,checks:[],...fe(i),entries:s})}});function ns(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new zb({type:"enum",entries:n,...fe(e)})}const RY=F("ZodLiteral",(t,e)=>{s9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>w6(t,n,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function me(t,e){return new RY({type:"literal",values:Array.isArray(t)?t:[t],...fe(e)})}const NY=F("ZodTransform",(t,e)=>{o9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>k6(t,n),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new KN(t.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Bu(s,n.value,e));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),n.issues.push(Bu(o))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function $Y(t){return new NY({type:"transform",transform:t})}const _$=F("ZodOptional",(t,e)=>{O$.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>v$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function MC(t){return new _$({type:"optional",innerType:t})}const MY=F("ZodExactOptional",(t,e)=>{a9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>v$(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function QY(t){return new MY({type:"optional",innerType:t})}const LY=F("ZodNullable",(t,e)=>{l9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>T6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function QC(t){return new LY({type:"nullable",innerType:t})}const DY=F("ZodDefault",(t,e)=>{c9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>P6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function zY(t,e){return new DY({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():t$(e)}})}const BY=F("ZodPrefault",(t,e)=>{u9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>I6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function jY(t,e){return new BY({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():t$(e)}})}const T$=F("ZodNonOptional",(t,e)=>{h9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>A6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function UY(t,e){return new T$({type:"nonoptional",innerType:t,...fe(e)})}const ZY=F("ZodCatch",(t,e)=>{d9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>R6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function FY(t,e){return new ZY({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const XY=F("ZodPipe",(t,e)=>{f9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>N6(t,n,r,i),t.in=e.in,t.out=e.out});function LC(t,e){return new XY({type:"pipe",in:t,out:e})}const WY=F("ZodReadonly",(t,e)=>{p9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>$6(t,n,r,i),t.unwrap=()=>t._zod.def.innerType});function VY(t){return new WY({type:"readonly",innerType:t})}const HY=F("ZodCustom",(t,e)=>{g9.init(t,e),dt.init(t,e),t._zod.processJSONSchema=(n,r,i)=>S6(t,n)});function YY(t,e={}){return l6(HY,t,e)}function qY(t,e){return c6(t,e)}const GY=ce({appName:me("Chapterhouse"),entraAuthEnabled:me(!1),standalone:me(!0),chatSseEnabled:pt().optional()}),KY=ce({appName:me("Chapterhouse"),entraAuthEnabled:me(!1),standalone:me(!1),chatSseEnabled:pt().optional()}),JY=ce({appName:me("Chapterhouse"),entraAuthEnabled:me(!0),entraClientId:P(),entraTenantId:P(),chatSseEnabled:pt().optional()}),eq=Ch([GY,KY,JY]),tq=Ch([ce({authMode:me("legacy"),token:P().nullable()}),ce({authMode:me("entra")}),ce({authMode:me("standalone")})]),lO=ce({status:P()}),nq=ce({status:P(),cancelled:pt()}),rq=ce({slug:P(),cwd:P(),hardRuleCount:Wt().int().nullable(),softRuleCount:Wt().int().nullable()}),iq=Vt(rq),A$=ce({auto_pr:pt(),require_worktree:pt(),pr_draft_default:pt(),default_branch:P(),commit_co_author:P(),test_command:P(),build_command:P(),lint_command:P(),require_clean_worktree:pt()}),sq=ce({hardRules:A$}),oq=ce({softRules:Vt(P())}),md=Kg("rulesFound",[ce({slug:P(),cwd:P(),rulesFound:me(!0),hardRules:A$,softRules:Vt(P())}),ce({slug:P(),cwd:P(),rulesFound:me(!1),hardRules:vY(),softRules:Vt(P())})]),aq=ce({ok:me(!0),slug:P()}),lq=ce({slug:P(),name:P(),model:P(),taskId:P(),description:P(),status:P(),startedAt:P(),completedAt:P().nullable()}),cq=Vt(lq),uq=ce({taskId:P(),agentSlug:P(),name:P(),description:P(),prompt:P().nullable(),status:P(),result:P().nullable(),startedAt:P(),completedAt:P().nullable()}),hq=ce({id:Wt(),taskId:P(),seq:Wt(),ts:Wt(),kind:ns(["tool_start","tool_complete"]),toolName:P().nullable(),summary:P().nullable()});ce({taskId:P(),events:Vt(hq)});const dq=ce({model:P()}),fq=ce({previous:P(),current:P()}),pq=ce({models:Vt(P()),current:P()}),DC=ce({enabled:pt(),tierModels:Eh(P(),P()),cooldownMessages:Wt(),currentModel:P(),lastRoute:bl()}),gq=ce({path:P(),title:P(),summary:P(),section:P(),tags:Vt(P()),updated:P(),scope:ns(["personal","team"])}),mq=Vt(gq),Oq=Ch([P(),Vt(P()),pt()]),yq=ce({title:P().optional(),summary:P().optional(),updated:P().optional(),tags:Vt(P()).optional(),autostub:pt().optional(),confidence:ns(["high","medium","low"]).optional(),contested:pt().optional(),contradictions:Vt(P()).optional(),related:Vt(P()).optional(),auto_pr:pt().optional(),require_worktree:pt().optional(),pr_draft_default:pt().optional(),default_branch:P().optional(),commit_co_author:P().optional(),test_command:P().optional(),build_command:P().optional(),lint_command:P().optional(),require_clean_worktree:pt().optional(),metadata:Eh(P(),Oq)}),bq=ce({path:P(),content:P(),renderedContent:P(),frontmatter:yq}),wq=ce({ok:pt(),created:pt(),path:P()}),Sq=ce({ok:pt(),path:P()}),kq=ce({slug:P(),name:P(),description:P(),directory:P(),source:ns(["bundled","local","global"])}),vq=Vt(kq),xq=ce({ok:pt(),message:P()}),Cq=ce({id:Wt().int(),role:ns(["user","assistant"]),content:P(),ts:P(),turn_id:P().nullable(),turnId:P().optional(),agentSlug:P().optional(),agentDisplayName:P().optional()}),Eq=ce({sessionKey:P(),messages:Vt(Cq)}),_q=ce({type:me("text"),text:P()}),Tq=ce({type:me("thinking"),reasoningId:P(),text:P(),active:pt()}),Aq=ce({type:me("tool-call"),toolCallId:P(),toolName:P(),mcpServerName:P().optional(),arguments:Eh(P(),bl()).optional(),status:ns(["running","done","failed"]),resultPreview:P().optional(),detailedContent:P().optional(),agentSlug:P().optional()}),Pq=ce({type:me("subagent"),toolCallId:P(),agentName:P(),agentDisplayName:P(),agentDescription:P().optional(),status:ns(["running","done","failed"]),durationMs:Wt().optional(),error:P().optional(),agentSlug:P().optional()}),Iq=ce({type:me("activity-heartbeat"),agentSlug:P(),agentName:P(),currentAction:P(),startedAt:Wt(),lastUpdate:Wt()}),Rq=Kg("type",[_q,Tq,Aq,Pq,Iq]),Nq=ce({model:P(),routerMode:P().optional(),tier:P().nullable().optional(),overrideName:P().optional()}),$q=ce({kind:me("thinking_delta"),reasoningId:P(),deltaContent:P(),agentSlug:P().optional()}),Mq=ce({kind:me("tool_start"),toolCallId:P(),toolName:P(),mcpServerName:P().optional(),arguments:Eh(P(),bl()).optional(),agentSlug:P().optional()}),Qq=ce({kind:me("tool_complete"),toolCallId:P(),success:pt(),resultPreview:P().optional(),detailedContent:P().optional(),agentSlug:P().optional()}),Lq=ce({kind:me("subagent_started"),toolCallId:P(),agentName:P(),agentDisplayName:P(),agentDescription:P(),agentSlug:P().optional()}),Dq=ce({kind:me("subagent_completed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),durationMs:Wt().optional(),agentSlug:P().optional()}),zq=ce({kind:me("subagent_failed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),error:P().optional(),agentSlug:P().optional()});Kg("kind",[$q,Mq,Qq,Lq,Dq,zq]);const Bq=Ch([ce({type:me("connected"),connectionId:P()}),ce({type:me("delta"),content:P(),sessionKey:P().optional(),turnId:P().optional()}),ce({type:me("message"),content:P(),sessionKey:P().optional(),turnId:P().optional(),route:Nq.optional()}),ce({type:me("cancelled"),sessionKey:P().optional()}),ce({type:me("status"),status:ns(["idle","dreaming"]),message:P()}),ce({type:me("queued"),position:Wt(),sessionKey:P().optional(),turnId:P().optional(),msgId:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("thinking_delta"),reasoningId:P(),deltaContent:P(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("tool_start"),toolCallId:P(),toolName:P(),mcpServerName:P().optional(),arguments:Eh(P(),bl()).optional(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("tool_complete"),toolCallId:P(),success:pt(),resultPreview:P().optional(),detailedContent:P().optional(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("subagent_started"),toolCallId:P(),agentName:P(),agentDisplayName:P(),agentDescription:P(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("subagent_completed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),durationMs:Wt().optional(),agentSlug:P().optional()}),ce({type:me("activity"),sessionKey:P().optional(),turnId:P().optional(),kind:me("subagent_failed"),toolCallId:P(),agentName:P(),agentDisplayName:P(),error:P().optional(),agentSlug:P().optional()}),ce({type:me("queue-advance"),length:Wt(),sessionKey:P().optional()}),ce({type:me("turn-interrupted"),abortedTurnId:P(),sessionKey:P().optional()})]),jq=ce({turnId:P()}),Vl={_seq:Wt().optional(),_ts:Wt().optional()},Uq=ce({...Vl,type:me("turn:started"),turnId:P(),sessionKey:P(),prompt:P(),agentSlug:P().optional(),agentDisplayName:P().optional(),attachments:Vt(ce({type:me("file"),path:P(),displayName:P().optional()})).optional()}),Zq=ce({...Vl,type:me("turn:delta"),turnId:P(),sessionKey:P(),part:Rq}),Fq=ce({...Vl,type:me("turn:queued"),turnId:P(),sessionKey:P(),position:Wt()}),Xq=ce({...Vl,type:me("turn:interrupted"),turnId:P(),sessionKey:P()}),Wq=ce({...Vl,type:me("turn:complete"),turnId:P(),sessionKey:P(),finalMessage:P()}),Vq=ce({...Vl,type:me("turn:error"),turnId:P(),sessionKey:P(),error:P()}),Hq=Kg("type",[Uq,Zq,Fq,Xq,Wq,Vq]),Yq=new Set([408,425,429,500,502,503,504]),Ep=[400,800,1600];let Bb=null,Od=null,yd=null,Jg=!1;function qq(t){return Bb=t,t}function Gq(){const t=new URL(window.location.href),e=new URLSearchParams(t.hash.startsWith("#")?t.hash.slice(1):t.hash);(t.searchParams.has("access_token")||t.searchParams.has("token")||e.has("access_token")||e.has("token"))&&(t.searchParams.delete("access_token"),t.searchParams.delete("token"),e.delete("access_token"),e.delete("token"),t.hash=e.toString()?`#${e.toString()}`:"",window.history.replaceState({},document.title,t.toString()))}function Kq(t){const e=(t??"GET").toUpperCase();return e==="GET"||e==="HEAD"||e==="OPTIONS"}function Jq(t){return t instanceof DOMException&&t.name==="AbortError"}function eG(t){if(!t)return null;const e=Number(t);if(Number.isFinite(e))return Math.max(0,e*1e3);const n=Date.parse(t);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}function zC(t,e){return eG((t==null?void 0:t.headers.get("Retry-After"))??null)??Ep[Math.min(e,Ep.length-1)]}function BC(t){return new Promise(e=>window.setTimeout(e,t))}async function fv(t,e={},n={}){const r=n.retry??Kq(e.method);for(let i=0;;i+=1)try{const s=await fetch(t,e);if(!r||!Yq.has(s.status)||i>=Ep.length)return s;await BC(zC(s,i))}catch(s){if(!r||i>=Ep.length||Jq(s))throw s;await BC(zC(null,i))}}async function tG(){const t=await fv("/api/config/public",{},{retry:!0});if(!t.ok)throw new Error(`Failed to load auth config: ${t.status} ${t.statusText}`);const e=await t.json(),n=eq.safeParse(e);if(!n.success)throw console.error("[api] /api/config/public schema validation failed:",n.error.format()),new Error("The server returned an unexpected auth config shape. Please reload.");return n.data}async function nG(){if(Bb)return Bb;Gq();const t=await fv("/api/bootstrap",{},{retry:!0});if(!t.ok)throw new Error(`Bootstrap failed: ${t.status} ${t.statusText}`);const e=await t.json(),n=tq.safeParse(e);if(!n.success)throw console.error("[api] /api/bootstrap schema validation failed:",n.error.format()),new Error("The server returned an unexpected bootstrap shape. Please reload.");const r=n.data;if(r.authMode==="standalone")return Jg=!0,"";if(r.authMode!=="legacy")throw new Error("Entra auth is enabled but the browser auth flow has not been initialized");if(!r.token)throw new Error("Bootstrap did not return an API token");return qq(r.token)}async function pv(){return Od||(Od=tG().catch(t=>{throw Od=null,t})),await Od}async function em(){yd||(yd=(async()=>{const e=await pv();return Jg=!e.entraAuthEnabled&&e.standalone,e.entraAuthEnabled?(await oV(e),{config:e,authEnabled:!0,isAuthenticated:dC(),user:fC()}):{config:e,authEnabled:!1,isAuthenticated:!0,user:null}})().catch(e=>{throw yd=null,e}));const t=await yd;return t.authEnabled?{...t,isAuthenticated:dC(),user:fC()}:t}async function rG(){return(await em()).authEnabled?await aV():Jg?"":await nG()}async function _h(t){const e=new Headers(t),n=await rG();return!Jg&&n&&e.set("Authorization",`Bearer ${n}`),e}async function iG(){if(!(await em()).authEnabled)throw new Error("Microsoft sign-in is not enabled for this Chapterhouse server");await GN()}async function sG(){(await em()).authEnabled&&await lV()}async function nt(t,e={},n={}){const r=await _h(e.headers);return e.body&&!r.has("Content-Type")&&r.set("Content-Type","application/json"),fv(t,{...e,headers:r},n)}async function rt(t,e){if(!t.ok){let i;try{const s=await t.json();i=(s==null?void 0:s.error)||JSON.stringify(s)}catch{i=await t.text().catch(()=>{})}throw new Error(`HTTP ${t.status}${i?": "+i:""}`)}const n=await t.json(),r=e.safeParse(n);if(!r.success){const i=t.url?` (${new URL(t.url,"http://localhost").pathname})`:"";throw console.error(`[api] Schema validation failed${i}:`,r.error.format()),new Error(`The server returned an unexpected response${i}. Please try again or contact support.`)}return r.data}const Ve={sendMessage:(t,e,n,r)=>nt("/api/message",{method:"POST",body:JSON.stringify({prompt:t,connectionId:e,...n?{sessionKey:n}:{},...r?{msgId:r}:{}})}).then(i=>rt(i,lO)),cancel:()=>nt("/api/cancel",{method:"POST"}).then(t=>rt(t,nq)),listProjects:()=>nt("/api/projects").then(t=>rt(t,iq)),createProject:t=>nt("/api/projects",{method:"POST",body:JSON.stringify(t)}).then(e=>rt(e,md)),getProjectDetail:t=>nt(`/api/projects/${encodeURIComponent(t)}`).then(e=>rt(e,md)),deleteProject:t=>nt(`/api/projects/${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>rt(e,aq)),updateProjectHardRules:(t,e)=>nt(`/api/projects/${encodeURIComponent(t)}/rules/hard`,{method:"PUT",body:JSON.stringify(sq.parse(e))}).then(n=>rt(n,md)),updateProjectSoftRules:(t,e)=>nt(`/api/projects/${encodeURIComponent(t)}/rules/soft`,{method:"PUT",body:JSON.stringify(oq.parse(e))}).then(n=>rt(n,md)),interruptMessage:(t,e,n,r)=>nt(`/api/sessions/${encodeURIComponent(t)}/interrupt`,{method:"POST",body:JSON.stringify({prompt:n,connectionId:e,...r&&r.length>0?{attachments:r}:{}})}).then(i=>rt(i,lO)),listWorkers:()=>nt("/api/workers").then(t=>rt(t,cq)),getWorker:t=>nt(`/api/workers/${encodeURIComponent(t)}`).then(e=>rt(e,uq)),getModel:()=>nt("/api/model").then(t=>rt(t,dq)),setModel:t=>nt("/api/model",{method:"POST",body:JSON.stringify({model:t})}).then(e=>rt(e,fq)),listModels:()=>nt("/api/models").then(t=>rt(t,pq)),getAuto:()=>nt("/api/auto").then(t=>rt(t,DC)),setAuto:t=>nt("/api/auto",{method:"POST",body:JSON.stringify(t)}).then(e=>rt(e,DC)),listPages:()=>nt("/api/wiki/pages").then(t=>rt(t,mq)),readPage:t=>nt(`/api/wiki/page?path=${encodeURIComponent(t)}`).then(e=>rt(e,bq)),writePage:(t,e)=>nt(`/api/wiki/page?path=${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({content:e})}).then(n=>rt(n,wq)),deletePage:t=>nt(`/api/wiki/page?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>rt(e,Sq)),listSkills:()=>nt("/api/skills").then(t=>rt(t,vq)),removeSkill:t=>nt(`/api/skills/${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>rt(e,xq)),restart:()=>nt("/api/restart",{method:"POST"}).then(t=>rt(t,lO)),getSessionMessages:(t,e)=>{const n=`/api/session/${encodeURIComponent(t)}/messages${e!==void 0?`?limit=${e}`:""}`;return nt(n).then(r=>rt(r,Eq))},submitTurn:(t,e)=>nt(`/api/sessions/${encodeURIComponent(t)}/turn`,{method:"POST",body:JSON.stringify(e)}).then(n=>rt(n,jq))},oG=1e3,aG=3e4,lG=10;function cG(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}function uG(t,e){return new Promise(n=>{if(e!=null&&e.aborted){n();return}const r=window.setTimeout(n,t);e==null||e.addEventListener("abort",()=>{window.clearTimeout(r),n()})})}function hG(t){let e="message";const n=[];for(const r of t.split(`
|
|
135
135
|
`))if(!(!r||r.startsWith(":"))){if(r.startsWith("event:")){e=r.slice(6).trim();continue}r.startsWith("data:")&&n.push(r.slice(5).trimStart())}return n.length===0?null:{event:e,data:n.join(`
|
|
136
136
|
`)}}function jC(t){const e=[];let n=t;for(;;){const r=n.indexOf(`
|
|
137
137
|
|
|
@@ -171,7 +171,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
171
171
|
`},c]}}const sre=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ore=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],are=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],lre=[...ore,...are],cre=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),XM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),WM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ure=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),hre=XM.concat(WM).sort().reverse();function dre(t){const e=sre(t),n=hre,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],a=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},c=function(b,S,x){return{className:b,begin:S,relevance:x}},u={$pattern:/[a-z-]+/,keyword:r,attribute:cre.join(" ")},h={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const d=a.concat({begin:/\{/,end:/\}/,contains:o}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},p={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ure.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},y={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},m={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,f,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+lre.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+XM.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+WM.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},e.FUNCTION_DISPATCH]},O={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[m]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,y,O,p,m,f,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function fre(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function pre(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,s,o]}}function gre(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=t.inherit(c,{contains:[]}),d=t.inherit(u,{contains:[]});c.contains.push(d),u.contains.push(h);let f=[n,l];return[c,u,h,d].forEach(m=>{m.contains=m.contains.concat(f)}),f=f.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,s,c,u,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,r,l,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function mre(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function Ore(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[t.BACKSLASH_ESCAPE,s,l],h=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(g,y,m="\\1")=>{const O=m==="\\1"?m:e.concat(m,y);return e.concat(e.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,O,/(?:\\.|[^\\\/])*?/,m,r)},f=(g,y,m)=>e.concat(e.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,m,r),p=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",e.either(...h,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",e.either(...h,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:p}}function yre(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=t.inherit(t.APOS_STRING_MODE,{illegal:null}),u=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),h={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(H,M)=>{M.data._beginMatch=H[1]||H[2]},"on:end":(H,M)=>{M.data._beginMatch!==H[1]&&M.ignoreMatch()}},d=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[
|
|
172
172
|
]`,p={scope:"string",variants:[u,c,h,d]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],m=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],O=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:m,literal:(H=>{const M=[];return H.forEach(N=>{M.push(N),N.toLowerCase()===N?M.push(N.toUpperCase()):M.push(N.toLowerCase())}),M})(y),built_in:O},x=H=>H.map(M=>M.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,e.concat(f,"+"),e.concat("(?!",x(O).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},E=e.concat(r,"\\b(?!\\()"),I={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Q={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[Q,o,I,t.C_BLOCK_COMMENT_MODE,p,g,k]},D={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",x(m).join("\\b|"),"|",x(O).join("\\b|"),"\\b)"),r,e.concat(f,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(D);const L=[Q,I,t.C_BLOCK_COMMENT_MODE,p,g,k],V={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:S,contains:[V,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},o,D,I,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",V,o,I,t.C_BLOCK_COMMENT_MODE,p,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},p,g]}}function bre(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function wre(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Sre(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,u,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",f=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,p=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${f}))[eE][+-]?(${d})[jJ]?(?=${p})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${d})[jJ](?=${p})`}]},y={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,h,t.HASH_COMMENT_MODE]}]};return c.contains=[h,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,y,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,h]}]}}function kre(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function vre(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function xre(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:o},h={className:"string",contains:[t.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,u]})]}]},d="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},k=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=k,g.contains=k;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:k}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(T).concat(c).concat(k)}}function Cre(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:u,keyword:a,literal:l,built_in:c},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},s]}}const Ere=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),_re=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Tre=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Are=[..._re,...Tre],Pre=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ire=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Rre=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Nre=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function $re(t){const e=Ere(t),n=Rre,r=Ire,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Are.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Nre.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Pre.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function Mre(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Qre(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=u,p=[...c,...l].filter(x=>!u.includes(x)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},m={match:e.concat(/\b/,e.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function O(x){return e.concat(/\b/,e.either(...x.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:O(d),relevance:0};function S(x,{exceptions:k,when:E}={}){const I=E;return k=k||[],x.map(Q=>Q.match(/\|\d+$/)||k.includes(Q)?Q:I(Q)?`${Q}|0`:Q)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(p,{when:x=>x.length<3}),literal:s,type:a,built_in:h},contains:[{scope:"type",match:O(o)},b,m,g,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,y]}}function VM(t){return t?typeof t=="string"?t:t.source:null}function vc(t){return Fe("(?=",t,")")}function Fe(...t){return t.map(n=>VM(n)).join("")}function Lre(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function fn(...t){return"("+(Lre(t).capture?"":"?:")+t.map(r=>VM(r)).join("|")+")"}const $v=t=>Fe(/\b/,t,/\w$/.test(t)?/\b/:/\B/),Dre=["Protocol","Type"].map($v),FE=["init","self"].map($v),zre=["Any","Self"],xO=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],XE=["false","nil","true"],Bre=["assignment","associativity","higherThan","left","lowerThan","none","right"],jre=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],WE=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],HM=fn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),YM=fn(HM,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),CO=Fe(HM,YM,"*"),qM=fn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ip=fn(qM,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ni=Fe(qM,Ip,"*"),_d=Fe(/[A-Z]/,Ip,"*"),Ure=["attached","autoclosure",Fe(/convention\(/,fn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Fe(/objc\(/,ni,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Zre=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Fre(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,fn(...Dre,...FE)],className:{2:"keyword"}},s={match:Fe(/\./,fn(...xO)),relevance:0},o=xO.filter(Qe=>typeof Qe=="string").concat(["_|0"]),a=xO.filter(Qe=>typeof Qe!="string").concat(zre).map($v),l={variants:[{className:"keyword",match:fn(...a,...FE)}]},c={$pattern:fn(/\b\w+/,/#\w+/),keyword:o.concat(jre),literal:XE},u=[i,s,l],h={match:Fe(/\./,fn(...WE)),relevance:0},d={className:"built_in",match:Fe(/\b/,fn(...WE),/(?=\()/)},f=[h,d],p={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:CO},{match:`\\.(\\.|${YM})+`}]},y=[p,g],m="([0-9]_*)+",O="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${m})(\\.(${m}))?([eE][+-]?(${m}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${m}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(Qe="")=>({className:"subst",variants:[{match:Fe(/\\/,Qe,/[0\\tnr"']/)},{match:Fe(/\\/,Qe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),x=(Qe="")=>({className:"subst",match:Fe(/\\/,Qe,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(Qe="")=>({className:"subst",label:"interpol",begin:Fe(/\\/,Qe,/\(/),end:/\)/}),E=(Qe="")=>({begin:Fe(Qe,/"""/),end:Fe(/"""/,Qe),contains:[S(Qe),x(Qe),k(Qe)]}),I=(Qe="")=>({begin:Fe(Qe,/"/),end:Fe(/"/,Qe),contains:[S(Qe),k(Qe)]}),Q={className:"string",variants:[E(),E("#"),E("##"),E("###"),I(),I("#"),I("##"),I("###")]},T=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},L=Qe=>{const _r=Fe(Qe,/\//),ye=Fe(/\//,Qe);return{begin:_r,end:ye,contains:[...T,{scope:"comment",begin:`#(?!.*${ye})`,end:/$/}]}},V={scope:"regexp",variants:[L("###"),L("##"),L("#"),D]},H={match:Fe(/`/,ni,/`/)},M={className:"variable",match:/\$\d+/},N={className:"variable",match:`\\$${Ip}+`},j=[H,M,N],$={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Zre,contains:[...y,b,Q]}]}},B={scope:"keyword",match:Fe(/@/,fn(...Ure),vc(fn(/\(/,/\s+/)))},C={scope:"meta",match:Fe(/@/,ni)},ee=[$,B,C],ie={match:vc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Fe(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ip,"+")},{className:"type",match:_d,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Fe(/\s+&\s+/,vc(_d)),relevance:0}]},v={begin:/</,end:/>/,keywords:c,contains:[...r,...u,...ee,p,ie]};ie.contains.push(v);const W={match:Fe(ni,/\s*:/),keywords:"_|0",relevance:0},X={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",W,...r,V,...u,...f,...y,b,Q,...j,...ee,ie]},q={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,ie]},he={begin:fn(vc(Fe(ni,/\s*:/)),vc(Fe(ni,/\s+/,ni,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ni}]},Pe={begin:/\(/,end:/\)/,keywords:c,contains:[he,...r,...u,...y,b,Q,...ee,ie,X],endsParent:!0,illegal:/["']/},Gt={match:[/(func|macro)/,/\s+/,fn(H.match,ni,CO)],className:{1:"keyword",3:"title.function"},contains:[q,Pe,e],illegal:[/\[/,/%/]},ar={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[q,Pe,e],illegal:/\[|%/},ss={match:[/operator/,/\s+/,CO],className:{1:"keyword",3:"title"}},ic={begin:[/precedencegroup/,/\s+/,_d],className:{1:"keyword",3:"title"},contains:[ie],keywords:[...Bre,...XE],end:/}/},os={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},na={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},un={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ni,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[q,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:_d},...u],relevance:0}]};for(const Qe of Q.variants){const _r=Qe.contains.find(ao=>ao.label==="interpol");_r.keywords=c;const ye=[...u,...f,...y,b,Q,...j];_r.contains=[...ye,{begin:/\(/,end:/\)/,contains:["self",...ye]}]}return{name:"Swift",keywords:c,contains:[...r,Gt,ar,os,na,un,ss,ic,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},V,...u,...f,...y,b,Q,...j,...ee,ie,X]}}const Rp="[A-Za-z$_][0-9A-Za-z$_]*",GM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],KM=["true","false","null","undefined","NaN","Infinity"],JM=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],eQ=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tQ=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nQ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rQ=[].concat(tQ,JM,eQ);function Xre(t){const e=t.regex,n=($,{after:B})=>{const C="</"+$[0].slice(1);return $.input.indexOf(C,B)!==-1},r=Rp,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,B)=>{const C=$[0].length+$.index,ee=$.input[C];if(ee==="<"||ee===","){B.ignoreMatch();return}ee===">"&&(n($,{after:C})||B.ignoreMatch());let ie;const v=$.input.substring(C);if(ie=v.match(/^\s*=/)){B.ignoreMatch();return}if((ie=v.match(/^\s+extends\s+/))&&ie.index===0){B.ignoreMatch();return}}},a={$pattern:Rp,keyword:GM,literal:KM,built_in:rQ,"variable.language":nQ},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,d]},O={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},b=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,p,g,y,{match:/\$\d+/},h];d.contains=b.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(b)});const S=[].concat(O,d.contains),x=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(S)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...JM,...eQ]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L($){return e.concat("(?!",$.join("|"),")")}const V={match:e.concat(/\b/,L([...tQ,"super","import"].map($=>`${$}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},H={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},M={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,p,g,y,O,{match:/\$\d+/},h,I,{scope:"attr",match:r+e.lookahead(":"),relevance:0},j,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},H,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},V,D,E,M,{match:/\$[(.]/}]}}function Wre(t){const e=t.regex,n=Xre(t),r=Rp,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Rp,keyword:GM.concat(l),literal:KM,built_in:rQ.concat(i),"variable.language":nQ},u={className:"meta",begin:"@"+r},h=(g,y,m)=>{const O=g.contains.findIndex(b=>b.label===y);if(O===-1)throw new Error("can not find mode to replace");g.contains.splice(O,1,m)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const d=n.contains.find(g=>g.scope==="attr"),f=Object.assign({},d,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([u,s,o,f]),h(n,"shebang",t.SHEBANG()),h(n,"use_strict",a);const p=n.contains.find(g=>g.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Vre(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,i),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,e.either(s,i),/ +/,e.either(o,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},h=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,h,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}function Hre(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,t.QUOTE_STRING_MODE,l,c,a]}}function Yre(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(s,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,l,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function qre(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},a=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),d={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},p,g,s,o],m=[...y];return m.pop(),m.push(a),f.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const Gre={arduino:Rne,bash:Nne,c:$ne,cpp:Mne,csharp:Qne,css:Xne,diff:Wne,go:Vne,graphql:Hne,ini:Yne,java:qne,javascript:tre,json:nre,kotlin:ire,less:dre,lua:fre,makefile:pre,markdown:gre,objectivec:mre,perl:Ore,php:yre,"php-template":bre,plaintext:wre,python:Sre,"python-repl":kre,r:vre,ruby:xre,rust:Cre,scss:$re,shell:Mre,sql:Qre,swift:Fre,typescript:Wre,vbnet:Vre,wasm:Hre,xml:Yre,yaml:qre};function iQ(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&iQ(n)}),t}class VE{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function sQ(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ts(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const Kre="</span>",HE=t=>!!t.scope,Jre=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};class eie{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=sQ(e)}openNode(e){if(!HE(e))return;const n=Jre(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){HE(e)&&(this.buffer+=Kre)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const YE=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class Mv{constructor(){this.rootNode=YE(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=YE({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{Mv._collapse(n)}))}}class tie extends Mv{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new eie(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Zu(t){return t?typeof t=="string"?t:t.source:null}function oQ(t){return ta("(?=",t,")")}function nie(t){return ta("(?:",t,")*")}function rie(t){return ta("(?:",t,")?")}function ta(...t){return t.map(n=>Zu(n)).join("")}function iie(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Qv(...t){return"("+(iie(t).capture?"":"?:")+t.map(r=>Zu(r)).join("|")+")"}function aQ(t){return new RegExp(t.toString()+"|").exec("").length-1}function sie(t,e){const n=t&&t.exec(e);return n&&n.index===0}const oie=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Lv(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const i=n;let s=Zu(r),o="";for(;s.length>0;){const a=oie.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(e)}const aie=/\b\B/,lQ="[a-zA-Z]\\w*",Dv="[a-zA-Z_]\\w*",cQ="\\b\\d+(\\.\\d+)?",uQ="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",hQ="\\b(0b[01]+)",lie="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cie=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=ta(e,/.*\b/,t.binary,/\b.*/)),Ts({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Fu={begin:"\\\\[\\s\\S]",relevance:0},uie={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fu]},hie={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fu]},die={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},am=function(t,e,n={}){const r=Ts({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Qv("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ta(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},fie=am("//","$"),pie=am("/\\*","\\*/"),gie=am("#","$"),mie={scope:"number",begin:cQ,relevance:0},Oie={scope:"number",begin:uQ,relevance:0},yie={scope:"number",begin:hQ,relevance:0},bie={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Fu,{begin:/\[/,end:/\]/,relevance:0,contains:[Fu]}]},wie={scope:"title",begin:lQ,relevance:0},Sie={scope:"title",begin:Dv,relevance:0},kie={begin:"\\.\\s*"+Dv,relevance:0},vie=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})};var Td=Object.freeze({__proto__:null,APOS_STRING_MODE:uie,BACKSLASH_ESCAPE:Fu,BINARY_NUMBER_MODE:yie,BINARY_NUMBER_RE:hQ,COMMENT:am,C_BLOCK_COMMENT_MODE:pie,C_LINE_COMMENT_MODE:fie,C_NUMBER_MODE:Oie,C_NUMBER_RE:uQ,END_SAME_AS_BEGIN:vie,HASH_COMMENT_MODE:gie,IDENT_RE:lQ,MATCH_NOTHING_RE:aie,METHOD_GUARD:kie,NUMBER_MODE:mie,NUMBER_RE:cQ,PHRASAL_WORDS_MODE:die,QUOTE_STRING_MODE:hie,REGEXP_MODE:bie,RE_STARTERS_RE:lie,SHEBANG:cie,TITLE_MODE:wie,UNDERSCORE_IDENT_RE:Dv,UNDERSCORE_TITLE_MODE:Sie});function xie(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Cie(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Eie(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=xie,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function _ie(t,e){Array.isArray(t.illegal)&&(t.illegal=Qv(...t.illegal))}function Tie(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Aie(t,e){t.relevance===void 0&&(t.relevance=1)}const Pie=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=ta(n.beforeMatch,oQ(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Iie=["of","and","for","in","not","or","if","then","parent","list","value"],Rie="keyword";function dQ(t,e,n=Rie){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,dQ(t[s],e,s))}),r;function i(s,o){e&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");r[l[0]]=[s,Nie(l[0],l[1])]})}}function Nie(t,e){return e?Number(e):$ie(t)?0:1}function $ie(t){return Iie.includes(t.toLowerCase())}const qE={},Ao=t=>{console.error(t)},GE=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ca=(t,e)=>{qE[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),qE[`${t}/${e}`]=!0)},Np=new Error;function fQ(t,e,{key:n}){let r=0;const i=t[n],s={},o={};for(let a=1;a<=e.length;a++)o[a+r]=i[a],s[a+r]=!0,r+=aQ(e[a-1]);t[n]=o,t[n]._emit=s,t[n]._multi=!0}function Mie(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Ao("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Np;if(typeof t.beginScope!="object"||t.beginScope===null)throw Ao("beginScope must be object"),Np;fQ(t,t.begin,{key:"beginScope"}),t.begin=Lv(t.begin,{joinWith:""})}}function Qie(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Ao("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Np;if(typeof t.endScope!="object"||t.endScope===null)throw Ao("endScope must be object"),Np;fQ(t,t.end,{key:"endScope"}),t.end=Lv(t.end,{joinWith:""})}}function Lie(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Die(t){Lie(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Mie(t),Qie(t)}function zie(t){function e(o,a){return new RegExp(Zu(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=aQ(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=e(Lv(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const c=l.findIndex((h,d)=>d>0&&h!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new n;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(o){const a=new r;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){const l=o;if(o.isCompiled)return l;[Cie,Tie,Die,Pie].forEach(u=>u(o,a)),t.compilerExtensions.forEach(u=>u(o,a)),o.__beforeBegin=null,[Eie,_ie,Aie].forEach(u=>u(o,a)),o.isCompiled=!0;let c=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),c=o.keywords.$pattern,delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=dQ(o.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=Zu(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(u){return Bie(u==="self"?o:u)})),o.contains.forEach(function(u){s(u,l)}),o.starts&&s(o.starts,a),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ts(t.classNameAliases||{}),s(t)}function pQ(t){return t?t.endsWithParent||pQ(t.starts):!1}function Bie(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ts(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:pQ(t)?Ts(t,{starts:t.starts?Ts(t.starts):null}):Object.isFrozen(t)?Ts(t):t}var jie="11.11.1";class Uie extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const EO=sQ,KE=Ts,JE=Symbol("nomatch"),Zie=7,gQ=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:tie};function l(N){return a.noHighlightRe.test(N)}function c(N){let j=N.className+" ";j+=N.parentNode?N.parentNode.className:"";const $=a.languageDetectRe.exec(j);if($){const B=I($[1]);return B||(GE(s.replace("{}",$[1])),GE("Falling back to no-highlight mode for this block.",N)),B?$[1]:"no-highlight"}return j.split(/\s+/).find(B=>l(B)||I(B))}function u(N,j,$){let B="",C="";typeof j=="object"?(B=N,$=j.ignoreIllegals,C=j.language):(ca("10.7.0","highlight(lang, code, ...args) has been deprecated."),ca("10.7.0",`Please use highlight(code, options) instead.
|
|
173
173
|
https://github.com/highlightjs/highlight.js/issues/2277`),C=N,B=j),$===void 0&&($=!0);const ee={code:B,language:C};H("before:highlight",ee);const ie=ee.result?ee.result:h(ee.language,ee.code,$);return ie.code=ee.code,H("after:highlight",ie),ie}function h(N,j,$,B){const C=Object.create(null);function ee(R,z){return R.keywords[z]}function ie(){if(!ye.keywords){Ct.addText(Ze);return}let R=0;ye.keywordPatternRe.lastIndex=0;let z=ye.keywordPatternRe.exec(Ze),te="";for(;z;){te+=Ze.substring(R,z.index);const ue=un.case_insensitive?z[0].toLowerCase():z[0],ve=ee(ye,ue);if(ve){const[kt,Ti]=ve;if(Ct.addText(te),te="",C[ue]=(C[ue]||0)+1,C[ue]<=Zie&&(ra+=Ti),kt.startsWith("_"))te+=z[0];else{const Tr=un.classNameAliases[kt]||kt;X(z[0],Tr)}}else te+=z[0];R=ye.keywordPatternRe.lastIndex,z=ye.keywordPatternRe.exec(Ze)}te+=Ze.substring(R),Ct.addText(te)}function v(){if(Ze==="")return;let R=null;if(typeof ye.subLanguage=="string"){if(!e[ye.subLanguage]){Ct.addText(Ze);return}R=h(ye.subLanguage,Ze,!0,ao[ye.subLanguage]),ao[ye.subLanguage]=R._top}else R=f(Ze,ye.subLanguage.length?ye.subLanguage:null);ye.relevance>0&&(ra+=R.relevance),Ct.__addSublanguage(R._emitter,R.language)}function W(){ye.subLanguage!=null?v():ie(),Ze=""}function X(R,z){R!==""&&(Ct.startScope(z),Ct.addText(R),Ct.endScope())}function q(R,z){let te=1;const ue=z.length-1;for(;te<=ue;){if(!R._emit[te]){te++;continue}const ve=un.classNameAliases[R[te]]||R[te],kt=z[te];ve?X(kt,ve):(Ze=kt,ie(),Ze=""),te++}}function he(R,z){return R.scope&&typeof R.scope=="string"&&Ct.openNode(un.classNameAliases[R.scope]||R.scope),R.beginScope&&(R.beginScope._wrap?(X(Ze,un.classNameAliases[R.beginScope._wrap]||R.beginScope._wrap),Ze=""):R.beginScope._multi&&(q(R.beginScope,z),Ze="")),ye=Object.create(R,{parent:{value:ye}}),ye}function Pe(R,z,te){let ue=sie(R.endRe,te);if(ue){if(R["on:end"]){const ve=new VE(R);R["on:end"](z,ve),ve.isMatchIgnored&&(ue=!1)}if(ue){for(;R.endsParent&&R.parent;)R=R.parent;return R}}if(R.endsWithParent)return Pe(R.parent,z,te)}function Gt(R){return ye.matcher.regexIndex===0?(Ze+=R[0],1):(oc=!0,0)}function ar(R){const z=R[0],te=R.rule,ue=new VE(te),ve=[te.__beforeBegin,te["on:begin"]];for(const kt of ve)if(kt&&(kt(R,ue),ue.isMatchIgnored))return Gt(z);return te.skip?Ze+=z:(te.excludeBegin&&(Ze+=z),W(),!te.returnBegin&&!te.excludeBegin&&(Ze=z)),he(te,R),te.returnBegin?0:z.length}function ss(R){const z=R[0],te=j.substring(R.index),ue=Pe(ye,R,te);if(!ue)return JE;const ve=ye;ye.endScope&&ye.endScope._wrap?(W(),X(z,ye.endScope._wrap)):ye.endScope&&ye.endScope._multi?(W(),q(ye.endScope,R)):ve.skip?Ze+=z:(ve.returnEnd||ve.excludeEnd||(Ze+=z),W(),ve.excludeEnd&&(Ze=z));do ye.scope&&Ct.closeNode(),!ye.skip&&!ye.subLanguage&&(ra+=ye.relevance),ye=ye.parent;while(ye!==ue.parent);return ue.starts&&he(ue.starts,R),ve.returnEnd?0:z.length}function ic(){const R=[];for(let z=ye;z!==un;z=z.parent)z.scope&&R.unshift(z.scope);R.forEach(z=>Ct.openNode(z))}let os={};function na(R,z){const te=z&&z[0];if(Ze+=R,te==null)return W(),0;if(os.type==="begin"&&z.type==="end"&&os.index===z.index&&te===""){if(Ze+=j.slice(z.index,z.index+1),!i){const ue=new Error(`0 width match regex (${N})`);throw ue.languageName=N,ue.badRule=os.rule,ue}return 1}if(os=z,z.type==="begin")return ar(z);if(z.type==="illegal"&&!$){const ue=new Error('Illegal lexeme "'+te+'" for mode "'+(ye.scope||"<unnamed>")+'"');throw ue.mode=ye,ue}else if(z.type==="end"){const ue=ss(z);if(ue!==JE)return ue}if(z.type==="illegal"&&te==="")return Ze+=`
|
|
174
|
-
`,1;if(sc>1e5&&sc>z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ze+=te,te.length}const un=I(N);if(!un)throw Ao(s.replace("{}",N)),new Error('Unknown language: "'+N+'"');const Qe=zie(un);let _r="",ye=B||Qe;const ao={},Ct=new a.__emitter(a);ic();let Ze="",ra=0,_i=0,sc=0,oc=!1;try{if(un.__emitTokens)un.__emitTokens(j,Ct);else{for(ye.matcher.considerAll();;){sc++,oc?oc=!1:ye.matcher.considerAll(),ye.matcher.lastIndex=_i;const R=ye.matcher.exec(j);if(!R)break;const z=j.substring(_i,R.index),te=na(z,R);_i=R.index+te}na(j.substring(_i))}return Ct.finalize(),_r=Ct.toHTML(),{language:N,value:_r,relevance:ra,illegal:!1,_emitter:Ct,_top:ye}}catch(R){if(R.message&&R.message.includes("Illegal"))return{language:N,value:EO(j),illegal:!0,relevance:0,_illegalBy:{message:R.message,index:_i,context:j.slice(_i-100,_i+100),mode:R.mode,resultSoFar:_r},_emitter:Ct};if(i)return{language:N,value:EO(j),illegal:!1,relevance:0,errorRaised:R,_emitter:Ct,_top:ye};throw R}}function d(N){const j={value:EO(N),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return j._emitter.addText(N),j}function f(N,j){j=j||a.languages||Object.keys(e);const $=d(N),B=j.filter(I).filter(T).map(W=>h(W,N,!1));B.unshift($);const C=B.sort((W,X)=>{if(W.relevance!==X.relevance)return X.relevance-W.relevance;if(W.language&&X.language){if(I(W.language).supersetOf===X.language)return 1;if(I(X.language).supersetOf===W.language)return-1}return 0}),[ee,ie]=C,v=ee;return v.secondBest=ie,v}function p(N,j,$){const B=j&&n[j]||$;N.classList.add("hljs"),N.classList.add(`language-${B}`)}function g(N){let j=null;const $=c(N);if(l($))return;if(H("before:highlightElement",{el:N,language:$}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new Uie("One of your code blocks includes unescaped HTML.",N.innerHTML);j=N;const B=j.textContent,C=$?u(B,{language:$,ignoreIllegals:!0}):f(B);N.innerHTML=C.value,N.dataset.highlighted="yes",p(N,$,C.language),N.result={language:C.language,re:C.relevance,relevance:C.relevance},C.secondBest&&(N.secondBest={language:C.secondBest.language,relevance:C.secondBest.relevance}),H("after:highlightElement",{el:N,result:C,text:B})}function y(N){a=KE(a,N)}const m=()=>{S(),ca("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){S(),ca("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function S(){function N(){S()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",N,!1),b=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function x(N,j){let $=null;try{$=j(t)}catch(B){if(Ao("Language definition for '{}' could not be registered.".replace("{}",N)),i)Ao(B);else throw B;$=o}$.name||($.name=N),e[N]=$,$.rawDefinition=j.bind(null,t),$.aliases&&Q($.aliases,{languageName:N})}function k(N){delete e[N];for(const j of Object.keys(n))n[j]===N&&delete n[j]}function E(){return Object.keys(e)}function I(N){return N=(N||"").toLowerCase(),e[N]||e[n[N]]}function Q(N,{languageName:j}){typeof N=="string"&&(N=[N]),N.forEach($=>{n[$.toLowerCase()]=j})}function T(N){const j=I(N);return j&&!j.disableAutodetect}function D(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=j=>{N["before:highlightBlock"](Object.assign({block:j.el},j))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=j=>{N["after:highlightBlock"](Object.assign({block:j.el},j))})}function L(N){D(N),r.push(N)}function V(N){const j=r.indexOf(N);j!==-1&&r.splice(j,1)}function H(N,j){const $=N;r.forEach(function(B){B[$]&&B[$](j)})}function M(N){return ca("10.7.0","highlightBlock will be removed entirely in v12.0"),ca("10.7.0","Please use highlightElement now."),g(N)}Object.assign(t,{highlight:u,highlightAuto:f,highlightAll:S,highlightElement:g,highlightBlock:M,configure:y,initHighlighting:m,initHighlightingOnLoad:O,registerLanguage:x,unregisterLanguage:k,listLanguages:E,getLanguage:I,registerAliases:Q,autoDetection:T,inherit:KE,addPlugin:L,removePlugin:V}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=jie,t.regex={concat:ta,lookahead:oQ,either:Qv,optional:rie,anyNumberOfTimes:nie};for(const N in Td)typeof Td[N]=="object"&&iQ(Td[N]);return Object.assign(t,Td),t},kl=gQ({});kl.newInstance=()=>gQ({});var Fie=kl;kl.HighlightJS=kl;kl.default=kl;const Xie=pg(Fie),e_={},Wie="hljs-";function Vie(t){const e=Xie.newInstance();return t&&s(t),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:a};function n(l,c,u){const h=u||e_,d=typeof h.prefix=="string"?h.prefix:Wie;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:Hie,classPrefix:d});const f=e.highlight(c,{ignoreIllegals:!0,language:l});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const p=f._emitter.root,g=p.data;return g.language=f.language,g.relevance=f.relevance,p}function r(l,c){const h=(c||e_).subset||i();let d=-1,f=0,p;for(;++d<h.length;){const g=h[d];if(!e.getLanguage(g))continue;const y=n(g,l,c);y.data&&y.data.relevance!==void 0&&y.data.relevance>f&&(f=y.data.relevance,p=y)}return p||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return e.listLanguages()}function s(l,c){if(typeof l=="string")e.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&e.registerLanguage(u,l[u])}}function o(l,c){if(typeof l=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const h=l[u];e.registerAliases(typeof h=="string"?h:[...h],{languageName:u})}}}function a(l){return!!e.getLanguage(l)}}class Hie{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(o,a){return a?o+"_".repeat(a):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Yie={};function qie(t){const e=t||Yie,n=e.aliases,r=e.detect||!1,i=e.languages||Gre,s=e.plainText,o=e.prefix,a=e.subset;let l="hljs";const c=Vie(i);if(n&&c.registerAlias(n),o){const u=o.indexOf("-");l=u===-1?o:o.slice(0,u)}return function(u,h){om(u,"element",function(d,f,p){if(d.tagName!=="code"||!p||p.type!=="element"||p.tagName!=="pre")return;const g=Gie(d);if(g===!1||!g&&!r||g&&s&&s.includes(g))return;Array.isArray(d.properties.className)||(d.properties.className=[]),d.properties.className.includes(l)||d.properties.className.unshift(l);const y=xne(d,{whitespace:"pre"});let m;try{m=g?c.highlight(g,y,{prefix:o}):c.highlightAuto(y,{prefix:o,subset:a})}catch(O){const b=O;if(g&&/Unknown language/.test(b.message)){h.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[p,d],cause:b,place:d.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!g&&m.data&&m.data.language&&d.properties.className.push("language-"+m.data.language),m.children.length>0&&(d.children=m.children)})}}function Gie(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let r;for(;++n<e.length;){const i=String(e[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function ew(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map(ew).join(""):t&&typeof t=="object"&&"props"in t?ew(t.props.children):""}function Kie({children:t,...e}){const n=ew(t).replace(/\n$/,"");return w.jsxs("pre",{...e,className:`copy-btn-wrap ${e.className??""}`.trim(),children:[w.jsx(I$,{text:n,label:"Copy code",className:"copy-btn--code"}),t]})}const Jie={pre:Kie};function zv({content:t}){return w.jsx("div",{className:"md",children:w.jsx(iee,{remarkPlugins:[One],rehypePlugins:[qie],components:Jie,children:t})})}function ese(t){return t<=60?"just now":t<3600?`${Math.floor(t/60)} min later`:`${Math.floor(t/3600)} hr later`}function tse({gapSeconds:t}){const e=ese(t);return w.jsxs("div",{className:"time-separator",role:"separator","aria-label":e,children:[w.jsx("span",{className:"time-separator-line","aria-hidden":"true"}),w.jsx("span",{className:"time-separator-label",children:e}),w.jsx("span",{className:"time-separator-line","aria-hidden":"true"})]})}function nse(t){return new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function rse(t){return new Date(t).toISOString()}function ise({message:t,assistantLabel:e}){const n=t.role==="user",r=n?"👤":"🤖",i=n?"You":e,s=rse(t.ts);return w.jsxs("div",{className:`turn-header turn-header--${t.role}`,children:[w.jsxs("span",{className:"turn-actor-badge",children:[w.jsx("span",{className:"turn-actor-icon","aria-hidden":"true",children:r}),w.jsx("span",{className:"turn-actor-name",children:i})]}),w.jsx("time",{className:"turn-ts dim",dateTime:s,title:s,children:nse(t.ts)})]})}const sse=60,ose=120;function ase(t){return t.activities.length>0&&t.content.trim().length<ose}function lse({messages:t,lastCompletedAssistantId:e,latestAssistantRef:n,rehydrating:r,systemStatus:i,assistantLabel:s,emptyState:o}){return w.jsxs(w.Fragment,{children:[r?w.jsx(zn,{inline:!0,label:"Loading conversation history"}):t.length===0?o:null,t.map((a,l)=>{const c=a.role==="assistant"&&a.id===e,u=l>0?t[l-1]:null,h=u?(a.ts-u.ts)/1e3:0,d=u!==null&&h>sse,f=a.role==="assistant"&&ase(a);return w.jsxs("div",{className:`turn-wrapper${d?" has-separator":""}`,children:[d&&w.jsx(tse,{gapSeconds:h}),w.jsxs("article",{className:`bubble ${a.role}${f?" bubble--agent-activity":""}`,"aria-label":a.role==="user"?"You":s,tabIndex:c?-1:void 0,ref:c?p=>{n.current=p}:void 0,children:[w.jsx(ise,{message:a,assistantLabel:s}),a.role==="user"?w.jsxs("p",{className:"bubble-text user-text",children:[a.content,a.deliveryStatus==="posting"?w.jsxs("span",{className:"msg-queued-indicator","aria-label":"sending",title:"Sending…",children:[" ","⏳"]}):a.deliveryStatus==="queued-backend"?w.jsxs("span",{className:"msg-queued-backend-indicator","aria-label":`queued — ${a.queuePosition??1} ahead`,title:`Waiting in queue (${a.queuePosition??1} ahead)`,children:[" ","📥 Waiting in queue (",a.queuePosition??1," ahead)"]}):null]}):w.jsxs("div",{className:"copy-btn-wrap assistant-bubble-wrap",children:[!a.pending&&a.content&&w.jsx(I$,{text:a.content,label:"Copy message"}),a.parts.filter(p=>p.type==="activity-heartbeat").map(p=>w.jsx(bG,{part:p},p.agentSlug)),w.jsx(SG,{parts:a.parts}),a.content||!a.pending?w.jsx(zv,{content:a.content||""}):w.jsx(zn,{inline:!0,label:`${s} is responding`,detail:i.status==="dreaming"?i.message||"Thinking through the request.":"Streaming the reply as it arrives."}),a.route&&!a.pending&&w.jsxs("div",{className:"route-tag","aria-label":`Response routed to ${a.route.model}`,children:[a.route.tier?`${a.route.tier} → `:"",a.route.model,a.route.overrideName?` · ${a.route.overrideName}`:""]})]})]})]},a.id)})]})}const cse=1e3,use=3e4,hse=10,dse=!1,fse=new Set(["turn:started","turn:delta","turn:queued","turn:interrupted","turn:complete","turn:error"]);function pse(t){let e;const n=[];for(const r of t.split(`
|
|
174
|
+
`,1;if(sc>1e5&&sc>z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ze+=te,te.length}const un=I(N);if(!un)throw Ao(s.replace("{}",N)),new Error('Unknown language: "'+N+'"');const Qe=zie(un);let _r="",ye=B||Qe;const ao={},Ct=new a.__emitter(a);ic();let Ze="",ra=0,_i=0,sc=0,oc=!1;try{if(un.__emitTokens)un.__emitTokens(j,Ct);else{for(ye.matcher.considerAll();;){sc++,oc?oc=!1:ye.matcher.considerAll(),ye.matcher.lastIndex=_i;const R=ye.matcher.exec(j);if(!R)break;const z=j.substring(_i,R.index),te=na(z,R);_i=R.index+te}na(j.substring(_i))}return Ct.finalize(),_r=Ct.toHTML(),{language:N,value:_r,relevance:ra,illegal:!1,_emitter:Ct,_top:ye}}catch(R){if(R.message&&R.message.includes("Illegal"))return{language:N,value:EO(j),illegal:!0,relevance:0,_illegalBy:{message:R.message,index:_i,context:j.slice(_i-100,_i+100),mode:R.mode,resultSoFar:_r},_emitter:Ct};if(i)return{language:N,value:EO(j),illegal:!1,relevance:0,errorRaised:R,_emitter:Ct,_top:ye};throw R}}function d(N){const j={value:EO(N),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return j._emitter.addText(N),j}function f(N,j){j=j||a.languages||Object.keys(e);const $=d(N),B=j.filter(I).filter(T).map(W=>h(W,N,!1));B.unshift($);const C=B.sort((W,X)=>{if(W.relevance!==X.relevance)return X.relevance-W.relevance;if(W.language&&X.language){if(I(W.language).supersetOf===X.language)return 1;if(I(X.language).supersetOf===W.language)return-1}return 0}),[ee,ie]=C,v=ee;return v.secondBest=ie,v}function p(N,j,$){const B=j&&n[j]||$;N.classList.add("hljs"),N.classList.add(`language-${B}`)}function g(N){let j=null;const $=c(N);if(l($))return;if(H("before:highlightElement",{el:N,language:$}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new Uie("One of your code blocks includes unescaped HTML.",N.innerHTML);j=N;const B=j.textContent,C=$?u(B,{language:$,ignoreIllegals:!0}):f(B);N.innerHTML=C.value,N.dataset.highlighted="yes",p(N,$,C.language),N.result={language:C.language,re:C.relevance,relevance:C.relevance},C.secondBest&&(N.secondBest={language:C.secondBest.language,relevance:C.secondBest.relevance}),H("after:highlightElement",{el:N,result:C,text:B})}function y(N){a=KE(a,N)}const m=()=>{S(),ca("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){S(),ca("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function S(){function N(){S()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",N,!1),b=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function x(N,j){let $=null;try{$=j(t)}catch(B){if(Ao("Language definition for '{}' could not be registered.".replace("{}",N)),i)Ao(B);else throw B;$=o}$.name||($.name=N),e[N]=$,$.rawDefinition=j.bind(null,t),$.aliases&&Q($.aliases,{languageName:N})}function k(N){delete e[N];for(const j of Object.keys(n))n[j]===N&&delete n[j]}function E(){return Object.keys(e)}function I(N){return N=(N||"").toLowerCase(),e[N]||e[n[N]]}function Q(N,{languageName:j}){typeof N=="string"&&(N=[N]),N.forEach($=>{n[$.toLowerCase()]=j})}function T(N){const j=I(N);return j&&!j.disableAutodetect}function D(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=j=>{N["before:highlightBlock"](Object.assign({block:j.el},j))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=j=>{N["after:highlightBlock"](Object.assign({block:j.el},j))})}function L(N){D(N),r.push(N)}function V(N){const j=r.indexOf(N);j!==-1&&r.splice(j,1)}function H(N,j){const $=N;r.forEach(function(B){B[$]&&B[$](j)})}function M(N){return ca("10.7.0","highlightBlock will be removed entirely in v12.0"),ca("10.7.0","Please use highlightElement now."),g(N)}Object.assign(t,{highlight:u,highlightAuto:f,highlightAll:S,highlightElement:g,highlightBlock:M,configure:y,initHighlighting:m,initHighlightingOnLoad:O,registerLanguage:x,unregisterLanguage:k,listLanguages:E,getLanguage:I,registerAliases:Q,autoDetection:T,inherit:KE,addPlugin:L,removePlugin:V}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=jie,t.regex={concat:ta,lookahead:oQ,either:Qv,optional:rie,anyNumberOfTimes:nie};for(const N in Td)typeof Td[N]=="object"&&iQ(Td[N]);return Object.assign(t,Td),t},kl=gQ({});kl.newInstance=()=>gQ({});var Fie=kl;kl.HighlightJS=kl;kl.default=kl;const Xie=pg(Fie),e_={},Wie="hljs-";function Vie(t){const e=Xie.newInstance();return t&&s(t),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:a};function n(l,c,u){const h=u||e_,d=typeof h.prefix=="string"?h.prefix:Wie;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:Hie,classPrefix:d});const f=e.highlight(c,{ignoreIllegals:!0,language:l});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const p=f._emitter.root,g=p.data;return g.language=f.language,g.relevance=f.relevance,p}function r(l,c){const h=(c||e_).subset||i();let d=-1,f=0,p;for(;++d<h.length;){const g=h[d];if(!e.getLanguage(g))continue;const y=n(g,l,c);y.data&&y.data.relevance!==void 0&&y.data.relevance>f&&(f=y.data.relevance,p=y)}return p||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return e.listLanguages()}function s(l,c){if(typeof l=="string")e.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&e.registerLanguage(u,l[u])}}function o(l,c){if(typeof l=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const h=l[u];e.registerAliases(typeof h=="string"?h:[...h],{languageName:u})}}}function a(l){return!!e.getLanguage(l)}}class Hie{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(o,a){return a?o+"_".repeat(a):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Yie={};function qie(t){const e=t||Yie,n=e.aliases,r=e.detect||!1,i=e.languages||Gre,s=e.plainText,o=e.prefix,a=e.subset;let l="hljs";const c=Vie(i);if(n&&c.registerAlias(n),o){const u=o.indexOf("-");l=u===-1?o:o.slice(0,u)}return function(u,h){om(u,"element",function(d,f,p){if(d.tagName!=="code"||!p||p.type!=="element"||p.tagName!=="pre")return;const g=Gie(d);if(g===!1||!g&&!r||g&&s&&s.includes(g))return;Array.isArray(d.properties.className)||(d.properties.className=[]),d.properties.className.includes(l)||d.properties.className.unshift(l);const y=xne(d,{whitespace:"pre"});let m;try{m=g?c.highlight(g,y,{prefix:o}):c.highlightAuto(y,{prefix:o,subset:a})}catch(O){const b=O;if(g&&/Unknown language/.test(b.message)){h.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[p,d],cause:b,place:d.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!g&&m.data&&m.data.language&&d.properties.className.push("language-"+m.data.language),m.children.length>0&&(d.children=m.children)})}}function Gie(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let r;for(;++n<e.length;){const i=String(e[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function ew(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map(ew).join(""):t&&typeof t=="object"&&"props"in t?ew(t.props.children):""}function Kie({children:t,...e}){const n=ew(t).replace(/\n$/,"");return w.jsxs("pre",{...e,className:`copy-btn-wrap ${e.className??""}`.trim(),children:[w.jsx(I$,{text:n,label:"Copy code",className:"copy-btn--code"}),t]})}const Jie={pre:Kie};function zv({content:t}){return w.jsx("div",{className:"md",children:w.jsx(iee,{remarkPlugins:[One],rehypePlugins:[qie],components:Jie,children:t})})}function ese(t){return t<=60?"just now":t<3600?`${Math.floor(t/60)} min later`:`${Math.floor(t/3600)} hr later`}function tse({gapSeconds:t}){const e=ese(t);return w.jsxs("div",{className:"time-separator",role:"separator","aria-label":e,children:[w.jsx("span",{className:"time-separator-line","aria-hidden":"true"}),w.jsx("span",{className:"time-separator-label",children:e}),w.jsx("span",{className:"time-separator-line","aria-hidden":"true"})]})}function nse(t){return new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function rse(t){return new Date(t).toISOString()}function ise({message:t,assistantLabel:e}){const n=t.role==="user",r=t.role==="assistant"&&!!t.agentSlug,i=n?"👤":r?"🧩":"🤖",s=n?"You":r&&(t.agentDisplayName||t.agentSlug)||e,o=rse(t.ts);return w.jsxs("div",{className:`turn-header turn-header--${t.role}${r?" turn-header--agent":""}`,children:[w.jsxs("span",{className:"turn-actor-badge",children:[w.jsx("span",{className:"turn-actor-icon","aria-hidden":"true",children:i}),w.jsx("span",{className:"turn-actor-name",children:s}),r&&w.jsxs("span",{className:"turn-agent-slug",children:["@",t.agentSlug]})]}),w.jsx("time",{className:"turn-ts dim",dateTime:o,title:o,children:nse(t.ts)})]})}const sse=60,ose=120;function ase(t){return t.activities.length>0&&t.content.trim().length<ose}function lse({messages:t,lastCompletedAssistantId:e,latestAssistantRef:n,rehydrating:r,systemStatus:i,assistantLabel:s,emptyState:o}){return w.jsxs(w.Fragment,{children:[r?w.jsx(zn,{inline:!0,label:"Loading conversation history"}):t.length===0?o:null,t.map((a,l)=>{const c=a.role==="assistant"&&a.id===e,u=l>0?t[l-1]:null,h=u?(a.ts-u.ts)/1e3:0,d=u!==null&&h>sse,f=a.role==="assistant"&&ase(a);return w.jsxs("div",{className:`turn-wrapper${d?" has-separator":""}`,children:[d&&w.jsx(tse,{gapSeconds:h}),w.jsxs("article",{className:`bubble ${a.role}${f?" bubble--agent-activity":""}`,"aria-label":a.role==="user"?"You":s,tabIndex:c?-1:void 0,ref:c?p=>{n.current=p}:void 0,children:[w.jsx(ise,{message:a,assistantLabel:s}),a.role==="user"?w.jsxs("p",{className:"bubble-text user-text",children:[a.content,a.deliveryStatus==="posting"?w.jsxs("span",{className:"msg-queued-indicator","aria-label":"sending",title:"Sending…",children:[" ","⏳"]}):a.deliveryStatus==="queued-backend"?w.jsxs("span",{className:"msg-queued-backend-indicator","aria-label":`queued — ${a.queuePosition??1} ahead`,title:`Waiting in queue (${a.queuePosition??1} ahead)`,children:[" ","📥 Waiting in queue (",a.queuePosition??1," ahead)"]}):null]}):w.jsxs("div",{className:"copy-btn-wrap assistant-bubble-wrap",children:[!a.pending&&a.content&&w.jsx(I$,{text:a.content,label:"Copy message"}),a.parts.filter(p=>p.type==="activity-heartbeat").map(p=>w.jsx(bG,{part:p},p.agentSlug)),w.jsx(SG,{parts:a.parts}),a.content||!a.pending?w.jsx(zv,{content:a.content||""}):w.jsx(zn,{inline:!0,label:`${s} is responding`,detail:i.status==="dreaming"?i.message||"Thinking through the request.":"Streaming the reply as it arrives."}),a.route&&!a.pending&&w.jsxs("div",{className:"route-tag","aria-label":`Response routed to ${a.route.model}`,children:[a.route.tier?`${a.route.tier} → `:"",a.route.model,a.route.overrideName?` · ${a.route.overrideName}`:""]})]})]})]},a.id)})]})}const cse=1e3,use=3e4,hse=10,dse=!1,fse=new Set(["turn:started","turn:delta","turn:queued","turn:interrupted","turn:complete","turn:error"]);function pse(t){let e;const n=[];for(const r of t.split(`
|
|
175
175
|
`))if(!(!r||r.startsWith(":"))){if(r.startsWith("id:")){const i=r.slice(3).trim(),s=parseInt(i,10);isNaN(s)||(e=s);continue}r.startsWith("data:")&&n.push(r.slice(5).trimStart())}return n.length===0?null:{id:e,data:n.join(`
|
|
176
176
|
`)}}function t_(t){const e=[];let n=t;for(;;){const r=n.indexOf(`
|
|
177
177
|
|
|
@@ -220,4 +220,4 @@ Try sending your message again.`,"default")}finally{g(!1)}}function ie(v){v.key=
|
|
|
220
220
|
\${}
|
|
221
221
|
}
|
|
222
222
|
}`,{label:"class",detail:"definition",type:"keyword"}),En('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),En('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],sme=hz.concat([En("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),En("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),En("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),BA=new JL,dz=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Pc(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const ome=["FunctionDeclaration"],ame={FunctionDeclaration:Pc("function"),ClassDeclaration:Pc("class"),ClassExpression:()=>!0,EnumDeclaration:Pc("constant"),TypeAliasDeclaration:Pc("type"),NamespaceDeclaration:Pc("namespace"),VariableDefinition(t,e){t.matchContext(ome)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function fz(t,e){let n=BA.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(ze.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=ame[o.name];if(a&&a(o,s)||dz.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of fz(t,o.node))r.push(a);return!1}}),BA.set(e,r),r}const jA=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,pz=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function lme(t){let e=Ge(t.state).resolveInner(t.pos,-1);if(pz.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&jA.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)dz.has(i.name)&&(r=r.concat(fz(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:jA}}const Si=Al.define({name:"javascript",parser:ime.configure({props:[Qh.add({IfStatement:_f({except:/^\s*({|else\b)/}),TryStatement:_f({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Nce,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:Rce({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":_f({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),ec.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":aD,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),gz={test:t=>/^JSX/.test(t.name),facet:u0({commentTokens:{block:{open:"{/*",close:"*/}"}}})},mz=Si.configure({dialect:"ts"},"typescript"),Oz=Si.configure({dialect:"jsx",props:[h0.add(t=>t.isTop?[gz]:void 0)]}),yz=Si.configure({dialect:"jsx ts",props:[h0.add(t=>t.isTop?[gz]:void 0)]},"typescript");let bz=t=>({label:t,type:"keyword"});const wz="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(bz),cme=wz.concat(["declare","implements","private","protected","public"].map(bz));function ume(t={}){let e=t.jsx?t.typescript?yz:Oz:t.typescript?mz:Si,n=t.typescript?sme.concat(cme):hz.concat(wz);return new nh(e,[Si.data.of({autocomplete:Jhe(pz,c2(n))}),Si.data.of({autocomplete:lme}),t.jsx?fme:[]])}function hme(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function UA(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const dme=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),fme=ne.inputHandler.of((t,e,n,r,i)=>{if((dme?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Si.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:u}=l,h=Ge(o).resolveInner(u-1,-1),d;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=r||h.name=="JSXAttributeValue"&&h.to>u)){if(r==">"&&h.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(r=="/"&&h.name=="JSXStartCloseTag"){let f=h.parent,p=f.parent;if(p&&f.from==u-2&&((d=UA(o.doc,p.firstChild,u))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${d}>`;return{range:U.cursor(u+g.length,-1),changes:{from:u,insert:g}}}}else if(r==">"){let f=hme(h);if(f&&f.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(d=UA(o.doc,f,u)))return{range:l,changes:{from:u,insert:`</${d}>`}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ic=["_blank","_self","_top","_parent"],gy=["ascii","utf-8","utf-16","latin1","latin1"],my=["get","post","put","delete"],Oy=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Wn=["true","false"],de={},pme={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ic,hreflang:null}},abbr:de,address:de,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:de,aside:de,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:de,base:{attrs:{href:null,target:Ic}},bdi:de,bdo:de,blockquote:{attrs:{cite:null}},body:de,br:de,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Oy,formmethod:my,formnovalidate:["novalidate"],formtarget:Ic,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:de,center:de,cite:de,code:de,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:de,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:de,div:de,dl:de,dt:de,em:de,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:de,figure:de,footer:de,form:{attrs:{action:null,name:null,"accept-charset":gy,autocomplete:["on","off"],enctype:Oy,method:my,novalidate:["novalidate"],target:Ic}},h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:de,hgroup:de,hr:de,html:{attrs:{manifest:null}},i:de,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Oy,formmethod:my,formnovalidate:["novalidate"],formtarget:Ic,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:de,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:de,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:de,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gy,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:de,noscript:de,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:de,param:{attrs:{name:null,value:null}},pre:de,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:de,rt:de,ruby:de,samp:de,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gy}},section:de,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:de,source:{attrs:{src:null,type:null,media:null}},span:de,strong:de,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:de,summary:de,sup:de,table:de,tbody:de,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:de,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:de,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:de,time:{attrs:{datetime:null}},title:de,tr:de,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:de,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:de},Sz={accesskey:null,class:null,contenteditable:Wn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Wn,autocorrect:Wn,autocapitalize:Wn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Wn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Wn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Wn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Wn,"aria-hidden":Wn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Wn,"aria-multiselectable":Wn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Wn,"aria-relevant":null,"aria-required":Wn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},kz="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of kz)Sz[t]=null;class fh{constructor(e,n){this.tags={...pme,...e},this.globalAttrs={...Sz,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}fh.default=new fh;function $l(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Ml(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function vz(t,e,n){let r=n.tags[$l(t,Ml(e))];return(r==null?void 0:r.children)||n.allTags}function z0(t,e){let n=[];for(let r=Ml(e);r&&!r.type.isTop;r=Ml(r.parent)){let i=$l(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const xz=/^[:\-\.\w\u00b7-\uffff]*$/;function ZA(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=Ml(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:vz(t.doc,o,e).map(a=>({label:a,type:"type"})).concat(z0(t.doc,n).map((a,l)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function FA(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:z0(t.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:xz}}function gme(t,e,n,r){let i=[],s=0;for(let o of vz(t.doc,n,e))i.push({label:"<"+o,type:"type"});for(let o of z0(t.doc,n))i.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function mme(t,e,n,r,i){let s=Ml(n),o=s?e.tags[$l(t.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:xz}}function Ome(t,e,n,r,i){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],l;if(o){let c=t.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=Ml(n),d=h?e.tags[$l(t.doc,h)]:null;u=(d==null?void 0:d.attrs)&&d.attrs[c]}if(u){let h=t.sliceDoc(r,i).toLowerCase(),d='"',f='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",f=t.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),r++):l=/^[^\s<>='"]*$/;for(let p of u)a.push({label:p,apply:d+p+f,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function Cz(t,e){let{state:n,pos:r}=e,i=Ge(n).resolveInner(r,-1),s=i.resolve(r);for(let o=r,a;s==i&&(a=i.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;s=i=a,o=l.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?FA(n,i,i.from,r):ZA(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?ZA(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?FA(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?mme(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?Ome(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?gme(n,t,i,r):null}function yme(t){return Cz(fh.default,t)}function bme(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new fh(e,n):fh.default;return i=>Cz(r,i)}const wme=Si.parser.configure({top:"SingleExpression"}),Ez=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:mz.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:Oz.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:yz.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:wme},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:Si.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:dg.parser}],_z=[{name:"style",parser:dg.parser.configure({top:"Styles"})}].concat(kz.map(t=>({name:t,parser:Si.parser}))),Tz=Al.define({name:"html",parser:Xpe.configure({props:[Qh.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),ec.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),wD.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),If=Tz.configure({wrap:iz(Ez,_z)});function Sme(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=iz((t.nestedLanguages||[]).concat(Ez),(t.nestedAttributes||[]).concat(_z)));let r=n?Tz.configure({wrap:n,dialect:e}):e?If.configure({dialect:e}):If;return new nh(r,[If.data.of({autocomplete:bme(t)}),t.autoCloseTags!==!1?kme:[],ume().support,_ge().support])}const XA=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),kme=ne.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!If.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c,u,h;let d=o.doc.sliceString(l.from-1,l.to)==r,{head:f}=l,p=Ge(o).resolveInner(f,-1),g;if(d&&r==">"&&p.name=="EndTag"){let y=p.parent;if(((u=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(g=$l(o.doc,y.parent,f))&&!XA.has(g)){let m=f+(o.doc.sliceString(f,f+1)===">"?1:0),O=`</${g}>`;return{range:l,changes:{from:f,to:m,insert:O}}}}else if(d&&r=="/"&&p.name=="IncompleteCloseTag"){let y=p.parent;if(p.from==f-2&&((h=y.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(g=$l(o.doc,y,f))&&!XA.has(g)){let m=f+(o.doc.sliceString(f,f+1)===">"?1:0),O=`${g}>`;return{range:U.cursor(f+O.length,-1),changes:{from:f,to:m,insert:O}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Az=u0({commentTokens:{block:{open:"<!--",close:"-->"}}}),Pz=new Se,Iz=zfe.configure({props:[ec.add(t=>!t.is("Block")||t.is("Document")||iS(t)!=null||vme(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),Pz.add(iS),Qh.add({Document:()=>null}),xo.add({Document:Az})]});function iS(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function vme(t){return t.name=="OrderedList"||t.name=="BulletList"}function xme(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=iS(r.type))!=null&&i<=e)break;n=r}return n.to}const Cme=oD.of((t,e,n)=>{for(let r=Ge(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(Pz);if(i==null)continue;let s=xme(r,i);if(s>n)return{from:n,to:s}}return null});function B0(t){return new Or(Az,t,[],"markdown")}const Eme=B0(Iz),_me=Iz.configure([qfe,Kfe,Gfe,Jfe,{props:[ec.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),fg=B0(_me);function Tme(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=Hp.matchLanguageName(t,n,!0),r instanceof Hp)return r.support?r.support.language.parser:th.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}class yy{constructor(e,n,r,i,s,o,a){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=o,this.item=a}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+Nz(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Rz(t,e){let n=[],r=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&n.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i],o,a=e.lineAt(s.from),l=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))r.push(new yy(s,l,l+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new yy(s.parent,l,l+u,o[1],c,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),r.push(new yy(s.parent,l,l+u,o[1],c,h,s))}}return r}function Nz(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function by(t,e,n,r=0){for(let i=-1,s=t;;){if(s.name=="ListItem"){let a=Nz(s,e),l=+a[2];if(i>=0){if(l!=i+1)return;n.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(i+2+r)})}i=l}let o=s.nextSibling;if(!o)break;s=o}}function j0(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(Jl)!=" ")return t;let r=Vr(t,4,n),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+t.slice(n)}const Ame=(t={})=>({state:e,dispatch:n})=>{let r=Ge(e),{doc:i}=e,s=null,o=e.changeByRange(a=>{if(!a.empty||!fg.isActiveAt(e,a.from,-1)&&!fg.isActiveAt(e,a.from,1))return s={range:a};let l=a.from,c=i.lineAt(l),u=Rz(r.resolveInner(l,-1),i);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return s={range:a};let h=u[u.length-1];if(h.to-h.spaceAfter.length>l-c.from)return s={range:a};let d=l>=h.to-h.spaceAfter.length&&!/\S/.test(c.text.slice(h.to));if(h.item&&d){let m=h.node.firstChild,O=h.node.getChild("ListItem","ListItem");if(m.to>=l||O&&O.to<l||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||t.nonTightLists===!1){let b=u.length>1?u[u.length-2]:null,S,x="";b&&b.item?(S=c.from+b.from,x=b.marker(i,1)):S=c.from+(b?b.to:0);let k=[{from:S,to:l,insert:x}];return h.node.name=="OrderedList"&&by(h.item,i,k,-2),b&&b.node.name=="OrderedList"&&by(b.item,i,k),{range:U.cursor(S+x.length),changes:k}}else{let b=VA(u,e,c);return{range:U.cursor(l+b.length+1),changes:{from:c.from,insert:b+e.lineBreak}}}}if(h.node.name=="Blockquote"&&d&&c.from){let m=i.lineAt(c.from-1),O=/>\s*$/.exec(m.text);if(O&&O.index==h.from){let b=e.changes([{from:m.from+O.index,to:m.to},{from:c.from+h.from,to:c.to}]);return{range:a.map(b),changes:b}}}let f=[];h.node.name=="OrderedList"&&by(h.item,i,f);let p=h.item&&h.item.from<c.from,g="";if(!p||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=h.to)for(let m=0,O=u.length-1;m<=O;m++)g+=m==O&&!p?u[m].marker(i,1):u[m].blank(m<O?Vr(c.text,4,u[m+1].from)-g.length:null);let y=l;for(;y>c.from&&/\s/.test(c.text.charAt(y-c.from-1));)y--;return g=j0(g,e),Ime(h.node,e.doc)&&(g=VA(u,e,c)+e.lineBreak+g),f.push({from:y,to:l,insert:e.lineBreak+g}),{range:U.cursor(y+g.length+1),changes:f}});return s?!1:(n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},Pme=Ame();function WA(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Ime(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),s=e.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<s.number}function VA(t,e,n){let r="";for(let i=0,s=t.length-2;i<=s;i++)r+=t[i].blank(i<s?Vr(n.text,4,t[i+1].from)-r.length:null,i<s);return j0(r,e)}function Rme(t,e){let n=t.resolveInner(e,-1),r=e;WA(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(WA(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const Nme=({state:t,dispatch:e})=>{let n=Ge(t),r=null,i=t.changeByRange(s=>{let o=s.from,{doc:a}=t;if(s.empty&&fg.isActiveAt(t,s.from)){let l=a.lineAt(o),c=Rz(Rme(n,o),a);if(c.length){let u=c[c.length-1],h=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>h&&!/\S/.test(l.text.slice(h,o-l.from)))return{range:U.cursor(l.from+h),changes:{from:l.from+h,to:o}};if(o-l.from==h&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let d=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let f=u.blank(Vr(l.text,4,u.to)-Vr(l.text,4,u.from));return d==l.from&&(f=j0(f,t)),{range:U.cursor(d+f.length),changes:{from:d,to:l.from+u.to,insert:f}}}if(d<o)return{range:U.cursor(d),changes:{from:d,to:o}}}}}return r={range:s}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},$me=[{key:"Enter",run:Pme},{key:"Backspace",run:Nme}],$z=Sme({matchClosingTags:!1});function Mme(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=Eme,completeHTMLTags:s=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=$z}=t;if(!(i instanceof vm))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],c=[a.support,Cme],u;o&&c.push(zme),n instanceof nh?(c.push(n.support),u=n.language):n&&(u=n);let h=e||u?Tme(e,u):void 0;l.push(jfe({codeParser:h,htmlParser:a.language.parser})),r&&c.push(is.high(Gl.of($me)));let d=B0(i.configure(l));return s&&c.push(d.data.of({autocomplete:Qme})),new nh(d,c)}function Qme(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=Ge(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:Lme(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let wy=null;function Lme(){if(wy)return wy;let t=yme(new S0(Ae.create({extensions:$z}),0,!0));return wy=t?t.options:[]}const Dme=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,zme=ne.domEventHandlers({paste:(t,e)=>{var n;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!fg.isActiveAt(e.state,r.from,1)))return!1;let s=Ge(e.state),o=!1;return s.iterate({from:r.from,to:r.to,enter:a=>{(a.from>r.from||Dme.test(a.name))&&(o=!0)},leave:a=>{a.to<r.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});function Bme(){const[t]=yR(),e=t.get("path"),n=t.get("new")==="1",[r,i]=A.useState(e||"pages/"),[s,o]=A.useState(""),[a,l]=A.useState(n),[c,u]=A.useState(!1),[h,d]=A.useState(null),f=no();A.useEffect(()=>{if(!e||n){l(!0);return}l(!1),Ve.readPage(e).then(g=>{o(g.content),l(!0),d(null)}).catch(g=>d(g instanceof Error?g.message:String(g)))},[e,n]);async function p(){if(!r.startsWith("pages/")||!r.endsWith(".md")){d("Path must start with pages/ and end in .md");return}u(!0),d(null);try{await Ve.writePage(r,s),f(`/wiki?selected=${encodeURIComponent(r)}`)}catch(g){d(g instanceof Error?g.message:String(g))}finally{u(!1)}}return a?w.jsxs("div",{className:"page wiki-edit",children:[w.jsx("header",{className:"page-header",children:w.jsx("h1",{children:n?"New page":"Edit page"})}),h?w.jsx(Xr,{inline:!0,message:h,onRetry:()=>void p()}):null,w.jsx("div",{className:"row",children:w.jsxs("label",{htmlFor:"wiki-path",children:["Path",w.jsx("input",{id:"wiki-path",type:"text",value:r,onChange:g=>i(g.target.value),disabled:!n,"aria-invalid":!!(h&&(!r.startsWith("pages/")||!r.endsWith(".md")))})]})}),w.jsx("div",{className:"wiki-editor","aria-label":"Markdown editor",children:w.jsx(x2,{value:s,height:"60vh",extensions:[Mme()],onChange:g=>o(g),theme:"dark"})}),w.jsxs("div",{className:"composer-actions",children:[w.jsx("button",{type:"button",className:"btn primary",onClick:()=>void p(),disabled:c,children:c?"Saving…":"Save"}),w.jsx("button",{type:"button",className:"btn",onClick:()=>f(e?`/wiki?selected=${encodeURIComponent(e)}`:"/wiki"),children:"Cancel"})]})]}):w.jsx(zn,{centered:!0,label:"Loading editor",detail:"Fetching the wiki page content."})}function jme(){const[t,e]=A.useState(null),[n,r]=A.useState(null),[i,s]=A.useState(!0);async function o(){s(!0);try{const l=await Ve.listSkills();e(l),r(null)}catch(l){r(l instanceof Error?l.message:String(l))}finally{s(!1)}}A.useEffect(()=>{o()},[]);async function a(l){if(confirm(`Uninstall ${l}?`))try{const c=await Ve.removeSkill(l);if(!c.ok){r(c.message);return}await o()}catch(c){r(c instanceof Error?c.message:String(c))}}return w.jsxs("div",{className:"page skills",children:[w.jsxs("header",{className:"page-header",children:[w.jsx("h1",{children:"Skills"}),w.jsx("p",{className:"dim",children:"Bundled skills ship with Chapterhouse. Local skills live in ~/.chapterhouse/skills/ and can be uninstalled here."})]}),n?w.jsx(Xr,{inline:!0,message:n,onRetry:()=>void o()}):null,i&&t===null?w.jsx(zn,{inline:!0,label:"Loading skills"}):null,w.jsx("div",{className:"skill-grid",children:t==null?void 0:t.map(l=>w.jsxs("div",{className:"skill-card",children:[w.jsxs("div",{className:"skill-head",children:[w.jsx("strong",{children:l.name}),w.jsx("span",{className:`tag tag-${l.source}`,children:l.source})]}),w.jsx("div",{className:"dim small",children:l.slug}),w.jsx("p",{children:l.description}),l.source==="local"?w.jsx("button",{type:"button",className:"btn danger",onClick:()=>void a(l.slug),children:"Uninstall"}):null]},l.directory))})]})}function Ume(){const[t,e]=A.useState(null),[n,r]=A.useState(null),[i,s]=A.useState(null),[o,a]=A.useState(null),[l,c]=A.useState(!0),[u,h]=A.useState(!1),d=st(m=>m.setCurrentModel);async function f(){a(null),c(!0);try{const[m,O]=await Promise.all([Ve.listModels(),Ve.getAuto()]);e(m.models),r(m.current),d(m.current),s(O)}catch(m){a(m instanceof Error?m.message:String(m))}finally{c(!1)}}A.useEffect(()=>{f()},[]);async function p(m){if(!(!m||m===n)){h(!0),a(null);try{await Ve.setModel(m),r(m),d(m)}catch(O){a(O instanceof Error?O.message:String(O))}finally{h(!1)}}}async function g(){if(i){h(!0),a(null);try{await Ve.setAuto({enabled:!i.enabled}),await f()}catch(m){a(m instanceof Error?m.message:String(m))}finally{h(!1)}}}async function y(){if(confirm("Restart the daemon? In-flight workers will be stopped.")){a(null),h(!0);try{await Ve.restart()}catch(m){a(m instanceof Error?m.message:String(m))}finally{h(!1)}}}return w.jsxs("div",{className:"page settings",children:[w.jsx("header",{className:"page-header",children:w.jsx("h1",{children:"Settings"})}),o?w.jsx(Xr,{inline:!0,message:o,onRetry:()=>void f()}):null,w.jsxs("section",{"aria-busy":l||u,children:[w.jsx("h2",{children:"Model"}),l&&t===null?w.jsx(zn,{inline:!0,label:"Loading available models"}):w.jsxs("div",{className:"row settings-row",children:[w.jsxs("label",{className:"settings-field",htmlFor:"model-select",children:[w.jsx("span",{className:"settings-field-label",children:"Available models"}),w.jsx("select",{id:"model-select",value:n??"",onChange:m=>void p(m.target.value),disabled:u,children:t==null?void 0:t.map(m=>w.jsx("option",{value:m,children:m},m))})]}),w.jsxs("span",{className:"dim small",children:["Current: ",n??"(unknown)"]})]})]}),w.jsxs("section",{"aria-busy":l||u,children:[w.jsx("h2",{children:"Auto-routing"}),l&&i===null?w.jsx(zn,{inline:!0,label:"Loading routing preferences"}):i?w.jsxs(w.Fragment,{children:[w.jsxs("p",{children:["Auto-routing is currently ",w.jsx("strong",{children:i.enabled?"enabled":"disabled"}),". When on, Chapterhouse picks the model tier per message."]}),w.jsx("button",{type:"button",className:"btn",onClick:()=>void g(),disabled:u,children:i.enabled?"Disable":"Enable"})]}):null]}),w.jsxs("section",{children:[w.jsx("h2",{children:"Daemon"}),w.jsx("button",{type:"button",className:"btn danger",onClick:()=>void y(),disabled:u,children:"Restart daemon"})]})]})}Sy.createRoot(document.getElementById("root")).render(w.jsx(ya.StrictMode,{children:w.jsx(gG,{children:w.jsx(fZ,{children:w.jsx(iZ,{children:w.jsxs(lr,{path:"/",element:w.jsx(pG,{}),children:[w.jsx(lr,{index:!0,element:w.jsx(tZ,{to:"/chat",replace:!0})}),w.jsx(lr,{path:"chat",element:w.jsx(yse,{})}),w.jsx(lr,{path:"projects",element:w.jsx(vse,{})}),w.jsx(lr,{path:"projects/:slug",element:w.jsx(kse,{})}),w.jsx(lr,{path:"workers",element:w.jsx(o_,{})}),w.jsx(lr,{path:"workers/:taskId",element:w.jsx(o_,{})}),w.jsx(lr,{path:"wiki",element:w.jsx(Zse,{})}),w.jsx(lr,{path:"wiki/edit",element:w.jsx(Bme,{})}),w.jsx(lr,{path:"skills",element:w.jsx(jme,{})}),w.jsx(lr,{path:"settings",element:w.jsx(Ume,{})})]})})})})}));
|
|
223
|
-
//# sourceMappingURL=index-
|
|
223
|
+
//# sourceMappingURL=index-D4-uRAi6.js.map
|