paskia 0.10.0__py3-none-any.whl → 0.10.2__py3-none-any.whl

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.
Files changed (61) hide show
  1. paskia/_version.py +2 -2
  2. paskia/bootstrap.py +8 -7
  3. paskia/db/__init__.py +2 -0
  4. paskia/db/background.py +5 -8
  5. paskia/db/operations.py +17 -0
  6. paskia/db/structs.py +3 -2
  7. paskia/fastapi/__main__.py +21 -13
  8. paskia/fastapi/authz.py +8 -1
  9. paskia/fastapi/mainapp.py +6 -4
  10. paskia/fastapi/user.py +22 -0
  11. paskia/frontend-build/auth/admin/index.html +7 -6
  12. paskia/frontend-build/auth/assets/AccessDenied-CVQZxSIL.css +1 -0
  13. paskia/frontend-build/auth/assets/AccessDenied-Licr0tqA.js +8 -0
  14. paskia/frontend-build/auth/assets/{RestrictedAuth-BOdNrlQB.css → RestrictedAuth-0MFeNWS2.css} +1 -1
  15. paskia/frontend-build/auth/assets/{RestrictedAuth-BSusdAfp.js → RestrictedAuth-DWKMTEV3.js} +1 -1
  16. paskia/frontend-build/auth/assets/_plugin-vue_export-helper-DJsHCwvl.js +33 -0
  17. paskia/frontend-build/auth/assets/_plugin-vue_export-helper-DUBf8-iM.css +1 -0
  18. paskia/frontend-build/auth/assets/{admin-CmNtuH3s.css → admin-B1H4YqM_.css} +1 -1
  19. paskia/frontend-build/auth/assets/admin-CZKsX1OI.js +1 -0
  20. paskia/frontend-build/auth/assets/{auth-BKq4T2K2.css → auth-B4EpDxom.css} +1 -1
  21. paskia/frontend-build/auth/assets/auth-Pe-PKe8b.js +1 -0
  22. paskia/frontend-build/auth/assets/forward-BC0p23CH.js +1 -0
  23. paskia/frontend-build/auth/assets/{pow-2N9bxgAo.js → pow-DUr-T9XX.js} +1 -1
  24. paskia/frontend-build/auth/assets/reset-CkY9h28U.js +1 -0
  25. paskia/frontend-build/auth/assets/restricted-C9cJlHkd.js +1 -0
  26. paskia/frontend-build/auth/assets/theme-C2WysaSw.js +1 -0
  27. paskia/frontend-build/auth/index.html +8 -7
  28. paskia/frontend-build/auth/restricted/index.html +7 -6
  29. paskia/frontend-build/int/forward/index.html +6 -6
  30. paskia/frontend-build/int/reset/index.html +3 -3
  31. paskia/frontend-build/paskia.webp +0 -0
  32. paskia/util/__init__.py +0 -0
  33. paskia/util/apistructs.py +110 -0
  34. paskia/util/frontend.py +75 -0
  35. paskia/util/hostutil.py +75 -0
  36. paskia/util/htmlutil.py +47 -0
  37. paskia/util/passphrase.py +20 -0
  38. paskia/util/permutil.py +43 -0
  39. paskia/util/pow.py +45 -0
  40. paskia/util/querysafe.py +11 -0
  41. paskia/util/sessionutil.py +38 -0
  42. paskia/util/startupbox.py +103 -0
  43. paskia/util/timeutil.py +47 -0
  44. paskia/util/useragent.py +10 -0
  45. paskia/util/userinfo.py +63 -0
  46. paskia/util/vitedev.py +71 -0
  47. paskia/util/wordlist.py +54 -0
  48. {paskia-0.10.0.dist-info → paskia-0.10.2.dist-info}/METADATA +14 -11
  49. paskia-0.10.2.dist-info/RECORD +78 -0
  50. paskia/frontend-build/auth/assets/AccessDenied-C29NZI95.css +0 -1
  51. paskia/frontend-build/auth/assets/AccessDenied-DAdzg_MJ.js +0 -12
  52. paskia/frontend-build/auth/assets/_plugin-vue_export-helper-D2l53SUz.js +0 -49
  53. paskia/frontend-build/auth/assets/_plugin-vue_export-helper-DYJ24FZK.css +0 -1
  54. paskia/frontend-build/auth/assets/admin-BeFvGyD6.js +0 -1
  55. paskia/frontend-build/auth/assets/auth-DvHf8hgy.js +0 -1
  56. paskia/frontend-build/auth/assets/forward-C86Jm_Uq.js +0 -1
  57. paskia/frontend-build/auth/assets/reset-D71FG0VL.js +0 -1
  58. paskia/frontend-build/auth/assets/restricted-CW0drE_k.js +0 -1
  59. paskia-0.10.0.dist-info/RECORD +0 -60
  60. {paskia-0.10.0.dist-info → paskia-0.10.2.dist-info}/WHEEL +0 -0
  61. {paskia-0.10.0.dist-info → paskia-0.10.2.dist-info}/entry_points.txt +0 -0
@@ -1,12 +0,0 @@
1
- import{M as At,r as q,P as Rt,Q as Yt,R as ue,S as Tt,T as Qt,U as Gt,V as Wt,n as xe,W as Zt,c as x,w as He,X as Xt,Y as en,H as Q,m as tn,Z as nn,$ as on,b as T,f as L,z as F,d as M,e as v,t as D,g as se,_ as Y,F as oe,i as ce,B as j,D as Mt,l as de,a0 as Nt,a1 as Pt,a2 as Dt,a3 as Lt,o as $t,a4 as rn,a as qt,C as sn,k as ze,h as an,a5 as ln,L as un,x as cn}from"./_plugin-vue_export-helper-D2l53SUz.js";import{f as G,h as ae,g as We}from"./helpers-DzjFIx78.js";/*!
2
- * pinia v3.0.3
3
- * (c) 2025 Eduardo San Martin Morote
4
- * @license MIT
5
- */let Ft;const fe=e=>Ft=e,Ut=Symbol();function Oe(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var re;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(re||(re={}));function vr(){const e=At(!0),s=e.run(()=>q({}));let r=[],t=[];const n=Rt({install(o){fe(n),n._a=o,o.provide(Ut,n),o.config.globalProperties.$pinia=n,t.forEach(i=>r.push(i)),t=[]},use(o){return this._a?r.push(o):t.push(o),this},_p:r,_a:null,_e:e,_s:new Map,state:s});return n}const Kt=()=>{};function Ze(e,s,r,t=Kt){e.push(s);const n=()=>{const o=e.indexOf(s);o>-1&&(e.splice(o,1),t())};return!r&&Gt()&&Wt(n),n}function ee(e,...s){e.slice().forEach(r=>{r(...s)})}const dn=e=>e(),Xe=Symbol(),we=Symbol();function je(e,s){e instanceof Map&&s instanceof Map?s.forEach((r,t)=>e.set(t,r)):e instanceof Set&&s instanceof Set&&s.forEach(e.add,e);for(const r in s){if(!s.hasOwnProperty(r))continue;const t=s[r],n=e[r];Oe(n)&&Oe(t)&&e.hasOwnProperty(r)&&!ue(t)&&!Tt(t)?e[r]=je(n,t):e[r]=t}return e}const fn=Symbol();function hn(e){return!Oe(e)||!Object.prototype.hasOwnProperty.call(e,fn)}const{assign:J}=Object;function gn(e){return!!(ue(e)&&e.effect)}function mn(e,s,r,t){const{state:n,actions:o,getters:i}=s,l=r.state.value[e];let a;function u(){l||(r.state.value[e]=n?n():{});const d=Zt(r.state.value[e]);return J(d,o,Object.keys(i||{}).reduce((p,b)=>(p[b]=Rt(x(()=>{fe(r);const f=r._s.get(e);return i[b].call(f,f)})),p),{}))}return a=Vt(e,u,s,r,t,!0),a}function Vt(e,s,r={},t,n,o){let i;const l=J({actions:{}},r),a={deep:!0};let u,d,p=[],b=[],f;const w=t.state.value[e];!o&&!w&&(t.state.value[e]={}),q({});let h;function _(m){let g;u=d=!1,typeof m=="function"?(m(t.state.value[e]),g={type:re.patchFunction,storeId:e,events:f}):(je(t.state.value[e],m),g={type:re.patchObject,payload:m,storeId:e,events:f});const E=h=Symbol();xe().then(()=>{h===E&&(u=!0)}),d=!0,ee(p,g,t.state.value[e])}const A=o?function(){const{state:g}=r,E=g?g():{};this.$patch(k=>{J(k,E)})}:Kt;function P(){i.stop(),p=[],b=[],t._s.delete(e)}const c=(m,g="")=>{if(Xe in m)return m[we]=g,m;const E=function(){fe(t);const k=Array.from(arguments),B=[],I=[];function N($){B.push($)}function K($){I.push($)}ee(b,{args:k,name:E[we],store:R,after:N,onError:K});let U;try{U=m.apply(this&&this.$id===e?this:R,k)}catch($){throw ee(I,$),$}return U instanceof Promise?U.then($=>(ee(B,$),$)).catch($=>(ee(I,$),Promise.reject($))):(ee(B,U),U)};return E[Xe]=!0,E[we]=g,E},S={_p:t,$id:e,$onAction:Ze.bind(null,b),$patch:_,$reset:A,$subscribe(m,g={}){const E=Ze(p,m,g.detached,()=>k()),k=i.run(()=>He(()=>t.state.value[e],B=>{(g.flush==="sync"?d:u)&&m({storeId:e,type:re.direct,events:f},B)},J({},a,g)));return E},$dispose:P},R=Yt(S);t._s.set(e,R);const y=(t._a&&t._a.runWithContext||dn)(()=>t._e.run(()=>(i=At()).run(()=>s({action:c}))));for(const m in y){const g=y[m];if(ue(g)&&!gn(g)||Tt(g))o||(w&&hn(g)&&(ue(g)?g.value=w[m]:je(g,w[m])),t.state.value[e][m]=g);else if(typeof g=="function"){const E=c(g,m);y[m]=E,l.actions[m]=g}}return J(R,y),J(Qt(R),y),Object.defineProperty(R,"$state",{get:()=>t.state.value[e],set:m=>{_(g=>{J(g,m)})}}),t._p.forEach(m=>{J(R,i.run(()=>m({store:R,app:t._a,pinia:t,options:l})))}),w&&o&&r.hydrate&&r.hydrate(R.$state,w),u=!0,d=!0,R}/*! #__NO_SIDE_EFFECTS__ */function yn(e,s,r){let t;const n=typeof s=="function";t=n?r:s;function o(i,l){const a=en();return i=i||(a?Xt(Ut,null):null),i&&fe(i),i=Ft,i._s.has(e)||(n?Vt(e,s,t,i):mn(e,t,i)),i._s.get(e)}return o.$id=e,o}const he=yn("auth",{state:()=>({userInfo:null,isLoading:!1,settings:null,currentView:"login",status:{message:"",type:"info",show:!1}}),getters:{},actions:{setLoading(e){this.isLoading=!!e},showMessage(e,s="info",r=null){const t=r??(s==="error"?5e3:3e3);this.status={message:e,type:s,show:!0},t>0&&setTimeout(()=>{this.status.show=!1},t)},async setSessionCookie(e){if(!e?.session_token)throw console.error("setSessionCookie called with missing session_token:",e),new Error("Authentication response missing session_token");return await Q("/auth/api/set-session",{method:"POST",headers:{Authorization:`Bearer ${e.session_token}`}})},async register(){this.isLoading=!0;try{const e=await on();return await this.setSessionCookie(e),await this.loadUserInfo(),this.selectView(),e}finally{this.isLoading=!1}},async authenticate(){this.isLoading=!0;try{const e=await nn();return await this.setSessionCookie(e),await this.loadUserInfo(),this.selectView(),e}finally{this.isLoading=!1}},selectView(){this.userInfo?this.currentView="profile":this.currentView="login"},async loadSettings(){this.settings=await tn()},async loadUserInfo(){try{this.userInfo=await Q("/auth/api/user-info",{method:"POST"}),console.log("User info loaded:",this.userInfo)}catch(e){throw e.status===401||e.status===403?console.log("Authentication required:",e.message):this.showMessage(e.message||"Failed to load user info","error",5e3),e}},async deleteCredential(e){await Q(`/auth/api/user/credential/${e}`,{method:"DELETE"}),await this.loadUserInfo()},async terminateSession(e){try{if((await Q(`/auth/api/user/session/${e}`,{method:"DELETE"}))?.current_session_terminated){sessionStorage.clear(),location.reload();return}await this.loadUserInfo(),this.showMessage("Session terminated","success",2500)}catch(s){throw console.error("Terminate session error:",s),s}},async logout(){try{await Q("/auth/api/logout",{method:"POST"}),sessionStorage.clear(),location.reload()}catch(e){console.error("Logout error:",e),e.status!==401&&e.status!==403&&this.showMessage(e.message,"error")}},async logoutEverywhere(){try{await Q("/auth/api/user/logout-all",{method:"POST"}),sessionStorage.clear(),location.reload()}catch(e){console.error("Logout-all error:",e),e.status!==401&&e.status!==403&&this.showMessage(e.message,"error")}}}}),pn={key:0,class:"global-status",style:{display:"block"}},Cr={__name:"StatusMessage",setup(e){const s=he();return(r,t)=>F(s).status.show?(M(),T("div",pn,[v("div",{class:se(["status",F(s).status.type])},D(F(s).status.message),3)])):L("",!0)}},wn=["href"],bn={key:0,class:"sep"},vn={__name:"Breadcrumbs",props:{entries:{type:Array,default:()=>[]},showHome:{type:Boolean,default:!0},homeHref:{type:String,default:"/"}},setup(e,{expose:s}){const r=e,t=q(null),n=x(()=>r.showHome&&r.entries.length>0&&r.entries[0].href===r.homeHref?[{label:"🏠 "+r.entries[0].label,href:r.homeHref},...r.entries.slice(1)]:[...r.showHome?[{label:"🏠",href:r.homeHref}]:[],...r.entries]),o=x(()=>{const u=window.location.hash||window.location.pathname;for(let d=n.value.length-1;d>=0;d--){const p=n.value[d].href;if(p===u||p&&u.startsWith(p))return d}return n.value.length-1});function i(u){if(u.target===t.value){const d=t.value.querySelectorAll("a"),p=Math.min(o.value,d.length-1);d[p]&&d[p].focus()}}function l(u){const d=j(u);d&&(d==="left"||d==="right")&&(u.preventDefault(),Mt(t.value,u.target,d,{itemSelector:"a"}))}function a(){const u=t.value?.querySelectorAll("a");if(u?.length){const d=Math.min(o.value,u.length-1);u[d]?.focus()}}return s({focusCurrent:a}),(u,d)=>n.value.length>1?(M(),T("nav",{key:0,ref_key:"navRef",ref:t,class:"breadcrumbs","aria-label":"Breadcrumb",tabindex:"0",onFocusin:i,onKeydown:l},[v("ol",null,[(M(!0),T(oe,null,ce(n.value,(p,b)=>(M(),T("li",{key:b},[v("a",{href:p.href,tabindex:"-1"},D(p.label),9,wn),b<n.value.length-1?(M(),T("span",bn," — ")):L("",!0)]))),128))])],544)):L("",!0)}},Sr=Y(vn,[["__scopeId","data-v-6344dbb8"]]),Cn={key:0},Sn={key:1},En=["onFocusin","onKeydown"],_n={class:"item-top"},kn={class:"item-icon"},Bn=["src","alt"],In={key:1,class:"auth-emoji"},An={class:"item-title"},Rn={class:"item-actions"},Tn={key:0,class:"badge badge-current"},Mn={key:1,class:"badge badge-current"},Nn={key:2,class:"badge badge-current"},Pn=["onClick","disabled","title"],Dn={class:"item-details"},Ln={class:"credential-dates"},$n={class:"date-value"},qn={class:"date-value"},Fn={class:"date-value"},Er={__name:"CredentialList",props:{credentials:{type:Array,default:()=>[]},aaguidInfo:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},allowDelete:{type:Boolean,default:!1},hoveredCredentialUuid:{type:String,default:null},hoveredSessionCredentialUuid:{type:String,default:null},navigationDisabled:{type:Boolean,default:!1}},emits:["delete","credentialHover","navigate-out"],setup(e,{emit:s}){const r=e,t=s,n=f=>{t("credentialHover",f)},o=f=>{f.currentTarget.contains(f.relatedTarget)||t("credentialHover",null)},i=f=>{f.currentTarget.matches(":focus")||(f.currentTarget.focus(),f.stopPropagation())},l=(f,w)=>{Pt(f,()=>{r.allowDelete&&!w.is_current_session&&t("delete",w)})},a=f=>{if(r.navigationDisabled)return;const w=f.currentTarget;if(f.target===w){const h=w.querySelector(".credential-item");h&&h.focus()}},u=f=>{r.navigationDisabled||Dt(f,w=>t("navigate-out",w))},d=(f,w)=>{if(l(f,w),f.defaultPrevented||r.navigationDisabled)return;const h=j(f);if(h){f.preventDefault();const _=f.currentTarget.closest(".credential-list");Nt(_,f.currentTarget,h,{itemSelector:".credential-item"})==="boundary"&&t("navigate-out",h)}},p=f=>{const w=r.aaguidInfo?.[f.aaguid];return w?w.name:"Unknown Authenticator"},b=f=>{const w=r.aaguidInfo?.[f.aaguid];if(!w)return null;const _=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"icon_dark":"icon_light";return w[_]||null};return(f,w)=>(M(),T("div",{class:"credential-list",tabindex:"0",onFocusin:a,onKeydown:u},[e.loading?(M(),T("div",Cn,[...w[2]||(w[2]=[v("p",null,"Loading credentials...",-1)])])):e.credentials?.length?(M(!0),T(oe,{key:2},ce(e.credentials,h=>(M(),T("div",{key:h.credential,class:se(["credential-item",{"current-session":h.is_current_session&&!e.hoveredCredentialUuid&&!e.hoveredSessionCredentialUuid,"is-hovered":e.hoveredCredentialUuid===h.credential,"is-linked-session":e.hoveredSessionCredentialUuid===h.credential}]),tabindex:"-1",onMousedown:w[0]||(w[0]=de(()=>{},["prevent"])),onClickCapture:i,onFocusin:_=>n(h.credential),onFocusout:w[1]||(w[1]=_=>o(_)),onKeydown:_=>d(_,h)},[v("div",_n,[v("div",kn,[b(h)?(M(),T("img",{key:0,src:b(h),alt:p(h),class:"auth-icon",width:"32",height:"32"},null,8,Bn)):(M(),T("span",In,"🔑"))]),v("h4",An,D(p(h)),1),v("div",Rn,[h.is_current_session&&!e.hoveredCredentialUuid&&!e.hoveredSessionCredentialUuid?(M(),T("span",Tn,"Current")):e.hoveredCredentialUuid===h.credential?(M(),T("span",Mn,"Selected")):e.hoveredSessionCredentialUuid===h.credential?(M(),T("span",Nn,"Linked")):L("",!0),e.allowDelete?(M(),T("button",{key:3,onClick:_=>f.$emit("delete",h),class:"btn-card-delete",disabled:h.is_current_session,title:h.is_current_session?"Cannot delete current session credential":"Delete passkey and terminate any linked sessions.",tabindex:"-1"},"❌",8,Pn)):L("",!0)])]),v("div",Dn,[v("div",Ln,[w[4]||(w[4]=v("span",{class:"date-label"},"Created:",-1)),v("span",$n,D(F(G)(h.created_at)),1),w[5]||(w[5]=v("span",{class:"date-label"},"Last used:",-1)),v("span",qn,D(F(G)(h.last_used)),1),w[6]||(w[6]=v("span",{class:"date-label"},"Last verified:",-1)),v("span",Fn,D(F(G)(h.last_verified)),1)])])],42,En))),128)):(M(),T("div",Sn,[...w[3]||(w[3]=[v("p",null,"No passkeys found.",-1)])]))],32))}},Un={class:"user-name-heading"},Kn={class:"user-name-row"},Vn=["title"],Hn={key:0,class:"org-role-sub"},On={key:0,class:"org-line"},jn={key:1,class:"role-line"},xn={class:"user-details"},zn={class:"date-value"},Jn={class:"date-value"},Yn={class:"date-value"},Qn={key:1,class:"user-info-extra"},Gn={__name:"UserBasicInfo",props:{name:{type:String,required:!0},visits:{type:[Number,String],default:0},createdAt:{type:[String,Number,Date],default:null},lastSeen:{type:[String,Number,Date],default:null},updateEndpoint:{type:String,default:null},canEdit:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},orgDisplayName:{type:String,default:""},roleName:{type:String,default:""}},emits:["saved","editName"],setup(e,{emit:s}){const r=e,t=s;he();const n=x(()=>!!r.name);return(o,i)=>n.value?(M(),T("div",{key:0,class:se(["user-info",{"has-extra":o.$slots.default}])},[v("h3",Un,[i[1]||(i[1]=v("span",{class:"icon"},"👤",-1)),v("span",Kn,[v("span",{class:"display-name",title:e.name},D(e.name),9,Vn),e.canEdit&&e.updateEndpoint?(M(),T("button",{key:0,class:"mini-btn",onClick:i[0]||(i[0]=l=>t("editName")),title:"Edit name"},"✏️")):L("",!0)])]),e.orgDisplayName||e.roleName?(M(),T("div",Hn,[e.orgDisplayName?(M(),T("div",On,D(e.orgDisplayName),1)):L("",!0),e.roleName?(M(),T("div",jn,D(e.roleName),1)):L("",!0)])):L("",!0),v("div",xn,[i[2]||(i[2]=v("span",{class:"date-label"},[v("strong",null,"Visits:")],-1)),v("span",zn,D(e.visits||0),1),i[3]||(i[3]=v("span",{class:"date-label"},[v("strong",null,"Registered:")],-1)),v("span",Jn,D(F(G)(e.createdAt)),1),i[4]||(i[4]=v("span",{class:"date-label"},[v("strong",null,"Last seen:")],-1)),v("span",Yn,D(F(G)(e.lastSeen)),1)]),o.$slots.default?(M(),T("div",Qn,[Lt(o.$slots,"default",{},void 0)])):L("",!0)],2)):L("",!0)}},_r=Y(Gn,[["__scopeId","data-v-ce373d6c"]]),Wn={__name:"Modal",props:{focusFallback:{type:[HTMLElement,Object],default:null},focusIndex:{type:Number,default:-1},focusSiblingSelector:{type:String,default:""}},emits:["close"],setup(e){const s=e,r=q(null),t=q(null),n=()=>{const i=t.value;if(!i)return;if(document.body.contains(i)&&!i.disabled){i.focus();return}if(s.focusSiblingSelector&&s.focusIndex>=0){const a=[s.focusFallback?.$el||s.focusFallback,i.closest("[data-nav-group]"),i.parentElement?.closest("section"),document.querySelector(".view-root")].filter(Boolean);for(const u of a){if(!u)continue;const d=u.querySelectorAll(s.focusSiblingSelector);if(d.length>0){const p=Math.min(s.focusIndex,d.length-1),b=d[p];if(b&&!b.disabled){b.focus();return}}}}const l=s.focusFallback?.$el||s.focusFallback;if(l&&document.body.contains(l)){const a=l.querySelector?.('button:not([disabled]), a, [tabindex="0"]')||l;if(a?.focus){a.focus();return}}},o=i=>{const l=j(i);if(!l)return;const a=i.target,u=a.closest(".modal-actions");if(u&&(l==="left"||l==="right"))i.preventDefault(),Mt(u,a,l,{itemSelector:"button"});else if(l==="up"&&u){i.preventDefault();const p=(u.closest("form")||u.closest(".modal-form"))?.querySelectorAll("input, textarea, select, button:not(.modal-actions button)");p&&p.length>0&&p[p.length-1].focus()}else if(l==="down"&&!u){const d=a.closest("form")||a.closest(".modal-form");if(d){i.preventDefault();const p=d.querySelector(".modal-actions");p&&sn(p,{primarySelector:".btn-primary",itemSelector:"button"})}}};return $t(()=>{t.value=document.activeElement,xe(()=>{if(r.value){r.value.showModal();const i=r.value.querySelector(".modal-actions .btn-primary");i&&i.setAttribute("data-nav-primary",""),rn(r.value)}})}),qt(()=>{n()}),(i,l)=>(M(),T("dialog",{ref_key:"dialog",ref:r,onClose:l[0]||(l[0]=a=>i.$emit("close")),onKeydown:o},[Lt(i.$slots,"default",{},void 0)],544))}},kr=Y(Wn,[["__scopeId","data-v-2ebcbb0a"]]),Zn={class:"name-edit-form"},Xn=["for"],eo=["id","type","placeholder","disabled"],to={key:0,class:"error small"},no=["disabled"],oo=["disabled"],ro={__name:"NameEditForm",props:{modelValue:{type:String,default:""},label:{type:String,default:"Name"},placeholder:{type:String,default:""},submitText:{type:String,default:"Save"},cancelText:{type:String,default:"Cancel"},busy:{type:Boolean,default:!1},error:{type:String,default:""},autoFocus:{type:Boolean,default:!0},autoSelect:{type:Boolean,default:!0},inputId:{type:String,default:null},inputType:{type:String,default:"text"}},emits:["update:modelValue","cancel"],setup(e,{emit:s}){const r=e,t=s,n=q(null),o=`name-edit-${Math.random().toString(36).slice(2,10)}`,i=x({get:()=>r.modelValue,set:d=>t("update:modelValue",d)}),l=x(()=>r.inputId||o),a=d=>{if(j(d)==="up"){d.preventDefault(),n.value?.focus();return}};function u(){t("cancel")}return(d,p)=>(M(),T("div",Zn,[v("label",{for:l.value},[ze(D(e.label)+" ",1),an(v("input",{id:l.value,ref_key:"inputRef",ref:n,type:e.inputType,placeholder:e.placeholder,"onUpdate:modelValue":p[0]||(p[0]=b=>i.value=b),disabled:e.busy,required:""},null,8,eo),[[ln,i.value]])],8,Xn),e.error?(M(),T("div",to,D(e.error),1)):L("",!0),v("div",{class:"modal-actions",onKeydown:a},[v("button",{type:"button",class:"btn-secondary",onClick:u,disabled:e.busy},D(e.cancelText),9,no),v("button",{type:"submit",class:"btn-primary",disabled:e.busy,"data-nav-primary":""},D(e.submitText),9,oo)],32)]))}},Br=Y(ro,[["__scopeId","data-v-b73321cf"]]),so={class:"section-block","data-component":"session-list-section"},io={class:"section-header"},ao={class:"section-description"},lo={class:"section-body"},uo=["onKeydown"],co=["href"],fo={class:"session-list"},ho=["onFocusin","onKeydown"],go={class:"item-top"},mo={class:"item-title"},yo={class:"item-actions"},po={key:0,class:"badge badge-current"},wo={key:1,class:"badge badge-current"},bo={key:2,class:"badge badge-current"},vo={key:3,class:"badge"},Co=["onClick","disabled","title"],So={class:"item-details"},Eo={class:"session-dates"},_o={class:"date-label"},ko=["onClick"],Bo={key:1,class:"empty-state"},Ir={__name:"SessionList",props:{sessions:{type:Array,default:()=>[]},emptyMessage:{type:String,default:"You currently have no other active sessions."},sectionDescription:{type:String,default:"Review where you're signed in and end any sessions you no longer recognize."},terminatingSessions:{type:Object,default:()=>({})},hoveredCredentialUuid:{type:String,default:null},navigationDisabled:{type:Boolean,default:!1}},emits:["terminate","sessionHover","navigate-out"],setup(e,{emit:s}){const r=e,t=s,n=he(),o=q(null),i=q(null),l=c=>{i.value=c,o.value=c.ip||null,t("sessionHover",c)},a=c=>{c.currentTarget.contains(c.relatedTarget)||(i.value=null,o.value=null,t("sessionHover",null))},u=c=>{c.currentTarget.matches(":focus")||(c.currentTarget.focus(),c.stopPropagation())},d=c=>!!r.terminatingSessions[c],p=(c,S)=>{const R=c.currentTarget,y=R.querySelector(".session-list")?.querySelectorAll(".session-item"),m=Array.from(document.querySelectorAll(".session-group")),g=m.indexOf(R);if(c.key==="Enter"&&c.target===R){S&&R.querySelector("a")?.click();return}if(r.navigationDisabled)return;const E=j(c);if(["down","right"].includes(E)&&c.target===R){c.preventDefault(),y?.[0]?.focus();return}if(["up","left"].includes(E)&&c.target===R){c.preventDefault(),g>0?m[g-1].focus():t("navigate-out","up");return}Dt(c,k=>t("navigate-out",k))},b=(c,S)=>{if(Pt(c,()=>{d(S.id)||t("terminate",S)}),c.defaultPrevented||r.navigationDisabled)return;const R=j(c);if(R){c.preventDefault();const C=c.currentTarget.closest(".session-group"),y=C.querySelector(".session-list");if(Nt(y,c.currentTarget,R,{itemSelector:".session-item"})==="boundary"){if(R==="left"||R==="up")C?.focus();else if(R==="down"||R==="right"){const g=Array.from(document.querySelectorAll(".session-group")),E=g.indexOf(C);E<g.length-1?g[E+1].focus():t("navigate-out","down")}}}c.key==="Escape"&&(c.preventDefault(),c.currentTarget.closest(".session-group")?.focus())},f=c=>`${c.includes(":")?"http":"https"}://${c}`,w=async c=>{if(c)try{await navigator.clipboard.writeText(c),n.showMessage("Full IP copied to clipboard!","success",2e3)}catch(S){console.error("Failed to copy IP:",S),n.showMessage("Failed to copy IP","error",3e3)}},h=c=>ae(c)??c,_=x(()=>{if(o.value)return ae(o.value);const c=r.sessions.find(S=>S.is_current);return c?ae(c.ip):null}),A=c=>_.value&&ae(c)===_.value,P=x(()=>{const c={};for(const y of r.sessions){const m=y.host||"";c[m]||(c[m]={sessions:[],isCurrentSite:!1}),c[m].sessions.push(y),y.is_current_host&&(c[m].isCurrentSite=!0)}for(const y in c)c[y].sessions.sort((m,g)=>new Date(g.last_renewed)-new Date(m.last_renewed));const S=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),R=Object.keys(c).sort(S.compare),C={};for(const y of R)C[y]=c[y];return C});return(c,S)=>(M(),T("section",so,[v("div",io,[S[2]||(S[2]=v("h2",null,"Active Sessions",-1)),v("p",ao,D(e.sectionDescription),1)]),v("div",lo,[v("div",null,[Array.isArray(e.sessions)&&e.sessions.length?(M(!0),T(oe,{key:0},ce(P.value,(R,C)=>(M(),T("div",{key:C,class:"session-group",tabindex:"0",onKeydown:y=>p(y,C)},[v("span",{class:se(["session-group-host",{"is-current-site":R.isCurrentSite}])},[S[3]||(S[3]=v("span",{class:"session-group-icon"},"🌐",-1)),C?(M(),T("a",{key:0,href:f(C),tabindex:"-1",target:"_blank",rel:"noopener noreferrer"},D(C),9,co)):(M(),T(oe,{key:1},[ze("Unbound host")],64))],2),v("div",fo,[(M(!0),T(oe,null,ce(R.sessions,y=>(M(),T("div",{key:y.id,class:se(["session-item",{"is-current":y.is_current&&!o.value&&!e.hoveredCredentialUuid,"is-hovered":i.value?.id===y.id,"is-linked-credential":e.hoveredCredentialUuid===y.credential}]),tabindex:"-1",onMousedown:S[0]||(S[0]=de(()=>{},["prevent"])),onClickCapture:u,onFocusin:m=>l(y),onFocusout:S[1]||(S[1]=m=>a(m)),onKeydown:m=>b(m,y)},[v("div",go,[v("h4",mo,D(y.user_agent),1),v("div",yo,[y.is_current&&!o.value&&!e.hoveredCredentialUuid?(M(),T("span",po,"Current")):i.value?.id===y.id?(M(),T("span",wo,"Selected")):e.hoveredCredentialUuid===y.credential?(M(),T("span",bo,"Linked")):!e.hoveredCredentialUuid&&A(y.ip)?(M(),T("span",vo,"Same IP")):L("",!0),v("button",{onClick:m=>c.$emit("terminate",y),class:"btn-card-delete",disabled:d(y.id),title:d(y.id)?"Terminating...":"Terminate session",tabindex:"-1"},"❌",8,Co)])]),v("div",So,[v("div",Eo,[v("span",_o,D(F(G)(y.last_renewed)),1),v("span",{class:"date-value",onClick:m=>w(y.ip),title:"Click to copy full IP"},D(h(y.ip)),9,ko)])])],42,ho))),128))])],40,uo))),128)):(M(),T("div",Bo,[v("p",null,D(e.emptyMessage),1)]))])])]))}};function Io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={},be,et;function Ao(){return et||(et=1,be=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),be}var ve={},z={},tt;function W(){if(tt)return z;tt=1;let e;const s=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return z.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17},z.getSymbolTotalCodewords=function(t){return s[t]},z.getBCHDigit=function(r){let t=0;for(;r!==0;)t++,r>>>=1;return t},z.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');e=t},z.isKanjiModeEnabled=function(){return typeof e<"u"},z.toSJIS=function(t){return e(t)},z}var Ce={},nt;function Je(){return nt||(nt=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function s(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return s(t)}catch{return n}}})(Ce)),Ce}var Se,ot;function Ro(){if(ot)return Se;ot=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(s){const r=Math.floor(s/8);return(this.buffer[r]>>>7-s%8&1)===1},put:function(s,r){for(let t=0;t<r;t++)this.putBit((s>>>r-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(s){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),s&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Se=e,Se}var Ee,rt;function To(){if(rt)return Ee;rt=1;function e(s){if(!s||s<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=s,this.data=new Uint8Array(s*s),this.reservedBit=new Uint8Array(s*s)}return e.prototype.set=function(s,r,t,n){const o=s*this.size+r;this.data[o]=t,n&&(this.reservedBit[o]=!0)},e.prototype.get=function(s,r){return this.data[s*this.size+r]},e.prototype.xor=function(s,r,t){this.data[s*this.size+r]^=t},e.prototype.isReserved=function(s,r){return this.reservedBit[s*this.size+r]},Ee=e,Ee}var _e={},st;function Mo(){return st||(st=1,(function(e){const s=W().getSymbolSize;e.getRowColCoords=function(t){if(t===1)return[];const n=Math.floor(t/7)+2,o=s(t),i=o===145?26:Math.ceil((o-13)/(2*n-2))*2,l=[o-7];for(let a=1;a<n-1;a++)l[a]=l[a-1]-i;return l.push(6),l.reverse()},e.getPositions=function(t){const n=[],o=e.getRowColCoords(t),i=o.length;for(let l=0;l<i;l++)for(let a=0;a<i;a++)l===0&&a===0||l===0&&a===i-1||l===i-1&&a===0||n.push([o[l],o[a]]);return n}})(_e)),_e}var ke={},it;function No(){if(it)return ke;it=1;const e=W().getSymbolSize,s=7;return ke.getPositions=function(t){const n=e(t);return[[0,0],[n-s,0],[0,n-s]]},ke}var Be={},at;function Po(){return at||(at=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const s={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const o=n.size;let i=0,l=0,a=0,u=null,d=null;for(let p=0;p<o;p++){l=a=0,u=d=null;for(let b=0;b<o;b++){let f=n.get(p,b);f===u?l++:(l>=5&&(i+=s.N1+(l-5)),u=f,l=1),f=n.get(b,p),f===d?a++:(a>=5&&(i+=s.N1+(a-5)),d=f,a=1)}l>=5&&(i+=s.N1+(l-5)),a>=5&&(i+=s.N1+(a-5))}return i},e.getPenaltyN2=function(n){const o=n.size;let i=0;for(let l=0;l<o-1;l++)for(let a=0;a<o-1;a++){const u=n.get(l,a)+n.get(l,a+1)+n.get(l+1,a)+n.get(l+1,a+1);(u===4||u===0)&&i++}return i*s.N2},e.getPenaltyN3=function(n){const o=n.size;let i=0,l=0,a=0;for(let u=0;u<o;u++){l=a=0;for(let d=0;d<o;d++)l=l<<1&2047|n.get(u,d),d>=10&&(l===1488||l===93)&&i++,a=a<<1&2047|n.get(d,u),d>=10&&(a===1488||a===93)&&i++}return i*s.N3},e.getPenaltyN4=function(n){let o=0;const i=n.data.length;for(let a=0;a<i;a++)o+=n.data[a];return Math.abs(Math.ceil(o*100/i/5)-10)*s.N4};function r(t,n,o){switch(t){case e.Patterns.PATTERN000:return(n+o)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return o%3===0;case e.Patterns.PATTERN011:return(n+o)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2===0;case e.Patterns.PATTERN101:return n*o%2+n*o%3===0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2===0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}e.applyMask=function(n,o){const i=o.size;for(let l=0;l<i;l++)for(let a=0;a<i;a++)o.isReserved(a,l)||o.xor(a,l,r(n,a,l))},e.getBestMask=function(n,o){const i=Object.keys(e.Patterns).length;let l=0,a=1/0;for(let u=0;u<i;u++){o(u),e.applyMask(u,n);const d=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(u,n),d<a&&(a=d,l=u)}return l}})(Be)),Be}var le={},lt;function Ht(){if(lt)return le;lt=1;const e=Je(),s=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return le.getBlocksCount=function(n,o){switch(o){case e.L:return s[(n-1)*4+0];case e.M:return s[(n-1)*4+1];case e.Q:return s[(n-1)*4+2];case e.H:return s[(n-1)*4+3];default:return}},le.getTotalCodewordsCount=function(n,o){switch(o){case e.L:return r[(n-1)*4+0];case e.M:return r[(n-1)*4+1];case e.Q:return r[(n-1)*4+2];case e.H:return r[(n-1)*4+3];default:return}},le}var Ie={},ne={},ut;function Do(){if(ut)return ne;ut=1;const e=new Uint8Array(512),s=new Uint8Array(256);return(function(){let t=1;for(let n=0;n<255;n++)e[n]=t,s[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),ne.log=function(t){if(t<1)throw new Error("log("+t+")");return s[t]},ne.exp=function(t){return e[t]},ne.mul=function(t,n){return t===0||n===0?0:e[s[t]+s[n]]},ne}var ct;function Lo(){return ct||(ct=1,(function(e){const s=Do();e.mul=function(t,n){const o=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let l=0;l<n.length;l++)o[i+l]^=s.mul(t[i],n[l]);return o},e.mod=function(t,n){let o=new Uint8Array(t);for(;o.length-n.length>=0;){const i=o[0];for(let a=0;a<n.length;a++)o[a]^=s.mul(n[a],i);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},e.generateECPolynomial=function(t){let n=new Uint8Array([1]);for(let o=0;o<t;o++)n=e.mul(n,new Uint8Array([1,s.exp(o)]));return n}})(Ie)),Ie}var Ae,dt;function $o(){if(dt)return Ae;dt=1;const e=Lo();function s(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return s.prototype.initialize=function(t){this.degree=t,this.genPoly=e.generateECPolynomial(this.degree)},s.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(t.length+this.degree);n.set(t);const o=e.mod(n,this.genPoly),i=this.degree-o.length;if(i>0){const l=new Uint8Array(this.degree);return l.set(o,i),l}return o},Ae=s,Ae}var Re={},Te={},Me={},ft;function Ot(){return ft||(ft=1,Me.isValid=function(s){return!isNaN(s)&&s>=1&&s<=40}),Me}var V={},ht;function jt(){if(ht)return V;ht=1;const e="[0-9]+",s="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const t="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
6
- ]))+`;V.KANJI=new RegExp(r,"g"),V.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),V.BYTE=new RegExp(t,"g"),V.NUMERIC=new RegExp(e,"g"),V.ALPHANUMERIC=new RegExp(s,"g");const n=new RegExp("^"+r+"$"),o=new RegExp("^"+e+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return V.testKanji=function(a){return n.test(a)},V.testNumeric=function(a){return o.test(a)},V.testAlphanumeric=function(a){return i.test(a)},V}var gt;function Z(){return gt||(gt=1,(function(e){const s=Ot(),r=jt();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(o,i){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!s.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?o.ccBits[0]:i<27?o.ccBits[1]:o.ccBits[2]},e.getBestModeForData=function(o){return r.testNumeric(o)?e.NUMERIC:r.testAlphanumeric(o)?e.ALPHANUMERIC:r.testKanji(o)?e.KANJI:e.BYTE},e.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},e.isValid=function(o){return o&&o.bit&&o.ccBits};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(o,i){if(e.isValid(o))return o;try{return t(o)}catch{return i}}})(Te)),Te}var mt;function qo(){return mt||(mt=1,(function(e){const s=W(),r=Ht(),t=Je(),n=Z(),o=Ot(),i=7973,l=s.getBCHDigit(i);function a(b,f,w){for(let h=1;h<=40;h++)if(f<=e.getCapacity(h,w,b))return h}function u(b,f){return n.getCharCountIndicator(b,f)+4}function d(b,f){let w=0;return b.forEach(function(h){const _=u(h.mode,f);w+=_+h.getBitsLength()}),w}function p(b,f){for(let w=1;w<=40;w++)if(d(b,w)<=e.getCapacity(w,f,n.MIXED))return w}e.from=function(f,w){return o.isValid(f)?parseInt(f,10):w},e.getCapacity=function(f,w,h){if(!o.isValid(f))throw new Error("Invalid QR Code version");typeof h>"u"&&(h=n.BYTE);const _=s.getSymbolTotalCodewords(f),A=r.getTotalCodewordsCount(f,w),P=(_-A)*8;if(h===n.MIXED)return P;const c=P-u(h,f);switch(h){case n.NUMERIC:return Math.floor(c/10*3);case n.ALPHANUMERIC:return Math.floor(c/11*2);case n.KANJI:return Math.floor(c/13);case n.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(f,w){let h;const _=t.from(w,t.M);if(Array.isArray(f)){if(f.length>1)return p(f,_);if(f.length===0)return 1;h=f[0]}else h=f;return a(h.mode,h.getLength(),_)},e.getEncodedBits=function(f){if(!o.isValid(f)||f<7)throw new Error("Invalid QR Code version");let w=f<<12;for(;s.getBCHDigit(w)-l>=0;)w^=i<<s.getBCHDigit(w)-l;return f<<12|w}})(Re)),Re}var Ne={},yt;function Fo(){if(yt)return Ne;yt=1;const e=W(),s=1335,r=21522,t=e.getBCHDigit(s);return Ne.getEncodedBits=function(o,i){const l=o.bit<<3|i;let a=l<<10;for(;e.getBCHDigit(a)-t>=0;)a^=s<<e.getBCHDigit(a)-t;return(l<<10|a)^r},Ne}var Pe={},De,pt;function Uo(){if(pt)return De;pt=1;const e=Z();function s(r){this.mode=e.NUMERIC,this.data=r.toString()}return s.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(t){let n,o,i;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),i=parseInt(o,10),t.put(i,10);const l=this.data.length-n;l>0&&(o=this.data.substr(n),i=parseInt(o,10),t.put(i,l*3+1))},De=s,De}var Le,wt;function Ko(){if(wt)return Le;wt=1;const e=Z(),s=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(t){this.mode=e.ALPHANUMERIC,this.data=t}return r.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let o;for(o=0;o+2<=this.data.length;o+=2){let i=s.indexOf(this.data[o])*45;i+=s.indexOf(this.data[o+1]),n.put(i,11)}this.data.length%2&&n.put(s.indexOf(this.data[o]),6)},Le=r,Le}var $e,bt;function Vo(){if(bt)return $e;bt=1;const e=Z();function s(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return s.getBitsLength=function(t){return t*8},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(r){for(let t=0,n=this.data.length;t<n;t++)r.put(this.data[t],8)},$e=s,$e}var qe,vt;function Ho(){if(vt)return qe;vt=1;const e=Z(),s=W();function r(t){this.mode=e.KANJI,this.data=t}return r.getBitsLength=function(n){return n*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let n;for(n=0;n<this.data.length;n++){let o=s.toSJIS(this.data[n]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
7
- Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),t.put(o,13)}},qe=r,qe}var Fe={exports:{}},Ct;function Oo(){return Ct||(Ct=1,(function(e){var s={single_source_shortest_paths:function(r,t,n){var o={},i={};i[t]=0;var l=s.PriorityQueue.make();l.push(t,0);for(var a,u,d,p,b,f,w,h,_;!l.empty();){a=l.pop(),u=a.value,p=a.cost,b=r[u]||{};for(d in b)b.hasOwnProperty(d)&&(f=b[d],w=p+f,h=i[d],_=typeof i[d]>"u",(_||h>w)&&(i[d]=w,l.push(d,w),o[d]=u))}if(typeof n<"u"&&typeof i[n]>"u"){var A=["Could not find a path from ",t," to ",n,"."].join("");throw new Error(A)}return o},extract_shortest_path_from_predecessor_list:function(r,t){for(var n=[],o=t;o;)n.push(o),r[o],o=r[o];return n.reverse(),n},find_path:function(r,t,n){var o=s.single_source_shortest_paths(r,t,n);return s.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(r){var t=s.PriorityQueue,n={},o;r=r||{};for(o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);return n.queue=[],n.sorter=r.sorter||t.default_sorter,n},default_sorter:function(r,t){return r.cost-t.cost},push:function(r,t){var n={value:r,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=s})(Fe)),Fe.exports}var St;function jo(){return St||(St=1,(function(e){const s=Z(),r=Uo(),t=Ko(),n=Vo(),o=Ho(),i=jt(),l=W(),a=Oo();function u(A){return unescape(encodeURIComponent(A)).length}function d(A,P,c){const S=[];let R;for(;(R=A.exec(c))!==null;)S.push({data:R[0],index:R.index,mode:P,length:R[0].length});return S}function p(A){const P=d(i.NUMERIC,s.NUMERIC,A),c=d(i.ALPHANUMERIC,s.ALPHANUMERIC,A);let S,R;return l.isKanjiModeEnabled()?(S=d(i.BYTE,s.BYTE,A),R=d(i.KANJI,s.KANJI,A)):(S=d(i.BYTE_KANJI,s.BYTE,A),R=[]),P.concat(c,S,R).sort(function(y,m){return y.index-m.index}).map(function(y){return{data:y.data,mode:y.mode,length:y.length}})}function b(A,P){switch(P){case s.NUMERIC:return r.getBitsLength(A);case s.ALPHANUMERIC:return t.getBitsLength(A);case s.KANJI:return o.getBitsLength(A);case s.BYTE:return n.getBitsLength(A)}}function f(A){return A.reduce(function(P,c){const S=P.length-1>=0?P[P.length-1]:null;return S&&S.mode===c.mode?(P[P.length-1].data+=c.data,P):(P.push(c),P)},[])}function w(A){const P=[];for(let c=0;c<A.length;c++){const S=A[c];switch(S.mode){case s.NUMERIC:P.push([S,{data:S.data,mode:s.ALPHANUMERIC,length:S.length},{data:S.data,mode:s.BYTE,length:S.length}]);break;case s.ALPHANUMERIC:P.push([S,{data:S.data,mode:s.BYTE,length:S.length}]);break;case s.KANJI:P.push([S,{data:S.data,mode:s.BYTE,length:u(S.data)}]);break;case s.BYTE:P.push([{data:S.data,mode:s.BYTE,length:u(S.data)}])}}return P}function h(A,P){const c={},S={start:{}};let R=["start"];for(let C=0;C<A.length;C++){const y=A[C],m=[];for(let g=0;g<y.length;g++){const E=y[g],k=""+C+g;m.push(k),c[k]={node:E,lastCount:0},S[k]={};for(let B=0;B<R.length;B++){const I=R[B];c[I]&&c[I].node.mode===E.mode?(S[I][k]=b(c[I].lastCount+E.length,E.mode)-b(c[I].lastCount,E.mode),c[I].lastCount+=E.length):(c[I]&&(c[I].lastCount=E.length),S[I][k]=b(E.length,E.mode)+4+s.getCharCountIndicator(E.mode,P))}}R=m}for(let C=0;C<R.length;C++)S[R[C]].end=0;return{map:S,table:c}}function _(A,P){let c;const S=s.getBestModeForData(A);if(c=s.from(P,S),c!==s.BYTE&&c.bit<S.bit)throw new Error('"'+A+'" cannot be encoded with mode '+s.toString(c)+`.
8
- Suggested mode is: `+s.toString(S));switch(c===s.KANJI&&!l.isKanjiModeEnabled()&&(c=s.BYTE),c){case s.NUMERIC:return new r(A);case s.ALPHANUMERIC:return new t(A);case s.KANJI:return new o(A);case s.BYTE:return new n(A)}}e.fromArray=function(P){return P.reduce(function(c,S){return typeof S=="string"?c.push(_(S,null)):S.data&&c.push(_(S.data,S.mode)),c},[])},e.fromString=function(P,c){const S=p(P,l.isKanjiModeEnabled()),R=w(S),C=h(R,c),y=a.find_path(C.map,"start","end"),m=[];for(let g=1;g<y.length-1;g++)m.push(C.table[y[g]].node);return e.fromArray(f(m))},e.rawSplit=function(P){return e.fromArray(p(P,l.isKanjiModeEnabled()))}})(Pe)),Pe}var Et;function xo(){if(Et)return ve;Et=1;const e=W(),s=Je(),r=Ro(),t=To(),n=Mo(),o=No(),i=Po(),l=Ht(),a=$o(),u=qo(),d=Fo(),p=Z(),b=jo();function f(C,y){const m=C.size,g=o.getPositions(y);for(let E=0;E<g.length;E++){const k=g[E][0],B=g[E][1];for(let I=-1;I<=7;I++)if(!(k+I<=-1||m<=k+I))for(let N=-1;N<=7;N++)B+N<=-1||m<=B+N||(I>=0&&I<=6&&(N===0||N===6)||N>=0&&N<=6&&(I===0||I===6)||I>=2&&I<=4&&N>=2&&N<=4?C.set(k+I,B+N,!0,!0):C.set(k+I,B+N,!1,!0))}}function w(C){const y=C.size;for(let m=8;m<y-8;m++){const g=m%2===0;C.set(m,6,g,!0),C.set(6,m,g,!0)}}function h(C,y){const m=n.getPositions(y);for(let g=0;g<m.length;g++){const E=m[g][0],k=m[g][1];for(let B=-2;B<=2;B++)for(let I=-2;I<=2;I++)B===-2||B===2||I===-2||I===2||B===0&&I===0?C.set(E+B,k+I,!0,!0):C.set(E+B,k+I,!1,!0)}}function _(C,y){const m=C.size,g=u.getEncodedBits(y);let E,k,B;for(let I=0;I<18;I++)E=Math.floor(I/3),k=I%3+m-8-3,B=(g>>I&1)===1,C.set(E,k,B,!0),C.set(k,E,B,!0)}function A(C,y,m){const g=C.size,E=d.getEncodedBits(y,m);let k,B;for(k=0;k<15;k++)B=(E>>k&1)===1,k<6?C.set(k,8,B,!0):k<8?C.set(k+1,8,B,!0):C.set(g-15+k,8,B,!0),k<8?C.set(8,g-k-1,B,!0):k<9?C.set(8,15-k-1+1,B,!0):C.set(8,15-k-1,B,!0);C.set(g-8,8,1,!0)}function P(C,y){const m=C.size;let g=-1,E=m-1,k=7,B=0;for(let I=m-1;I>0;I-=2)for(I===6&&I--;;){for(let N=0;N<2;N++)if(!C.isReserved(E,I-N)){let K=!1;B<y.length&&(K=(y[B]>>>k&1)===1),C.set(E,I-N,K),k--,k===-1&&(B++,k=7)}if(E+=g,E<0||m<=E){E-=g,g=-g;break}}}function c(C,y,m){const g=new r;m.forEach(function(N){g.put(N.mode.bit,4),g.put(N.getLength(),p.getCharCountIndicator(N.mode,C)),N.write(g)});const E=e.getSymbolTotalCodewords(C),k=l.getTotalCodewordsCount(C,y),B=(E-k)*8;for(g.getLengthInBits()+4<=B&&g.put(0,4);g.getLengthInBits()%8!==0;)g.putBit(0);const I=(B-g.getLengthInBits())/8;for(let N=0;N<I;N++)g.put(N%2?17:236,8);return S(g,C,y)}function S(C,y,m){const g=e.getSymbolTotalCodewords(y),E=l.getTotalCodewordsCount(y,m),k=g-E,B=l.getBlocksCount(y,m),I=g%B,N=B-I,K=Math.floor(g/B),U=Math.floor(k/B),$=U+1,Ye=K-U,zt=new a(Ye);let ge=0;const ie=new Array(B),Qe=new Array(B);let me=0;const Jt=new Uint8Array(C.buffer);for(let X=0;X<B;X++){const pe=X<N?U:$;ie[X]=Jt.slice(ge,ge+pe),Qe[X]=zt.encode(ie[X]),ge+=pe,me=Math.max(me,pe)}const ye=new Uint8Array(g);let Ge=0,H,O;for(H=0;H<me;H++)for(O=0;O<B;O++)H<ie[O].length&&(ye[Ge++]=ie[O][H]);for(H=0;H<Ye;H++)for(O=0;O<B;O++)ye[Ge++]=Qe[O][H];return ye}function R(C,y,m,g){let E;if(Array.isArray(C))E=b.fromArray(C);else if(typeof C=="string"){let K=y;if(!K){const U=b.rawSplit(C);K=u.getBestVersionForData(U,m)}E=b.fromString(C,K||40)}else throw new Error("Invalid data");const k=u.getBestVersionForData(E,m);if(!k)throw new Error("The amount of data is too big to be stored in a QR Code");if(!y)y=k;else if(y<k)throw new Error(`
9
- The chosen QR Code version cannot contain this amount of data.
10
- Minimum version required to store current data is: `+k+`.
11
- `);const B=c(y,m,E),I=e.getSymbolSize(y),N=new t(I);return f(N,y),w(N),h(N,y),A(N,m,0),y>=7&&_(N,y),P(N,B),isNaN(g)&&(g=i.getBestMask(N,A.bind(null,N,m))),i.applyMask(g,N),A(N,m,g),{modules:N,version:y,errorCorrectionLevel:m,maskPattern:g,segments:E}}return ve.create=function(y,m){if(typeof y>"u"||y==="")throw new Error("No input text");let g=s.M,E,k;return typeof m<"u"&&(g=s.from(m.errorCorrectionLevel,s.M),E=u.from(m.version),k=i.from(m.maskPattern),m.toSJISFunc&&e.setToSJISFunction(m.toSJISFunc)),R(y,E,g,k)},ve}var Ue={},Ke={},_t;function xt(){return _t||(_t=1,(function(e){function s(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let t=r.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+r);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(o){return[o,o]}))),t.length===6&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});const n=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,o=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:o,scale:o?4:i,margin:n,color:{dark:s(t.color.dark||"#000000ff"),light:s(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,n){return n.width&&n.width>=t+n.margin*2?n.width/(t+n.margin*2):n.scale},e.getImageWidth=function(t,n){const o=e.getScale(t,n);return Math.floor((t+n.margin*2)*o)},e.qrToImageData=function(t,n,o){const i=n.modules.size,l=n.modules.data,a=e.getScale(i,o),u=Math.floor((i+o.margin*2)*a),d=o.margin*a,p=[o.color.light,o.color.dark];for(let b=0;b<u;b++)for(let f=0;f<u;f++){let w=(b*u+f)*4,h=o.color.light;if(b>=d&&f>=d&&b<u-d&&f<u-d){const _=Math.floor((b-d)/a),A=Math.floor((f-d)/a);h=p[l[_*i+A]?1:0]}t[w++]=h.r,t[w++]=h.g,t[w++]=h.b,t[w]=h.a}}})(Ke)),Ke}var kt;function zo(){return kt||(kt=1,(function(e){const s=xt();function r(n,o,i){n.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=i,o.width=i,o.style.height=i+"px",o.style.width=i+"px"}function t(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(o,i,l){let a=l,u=i;typeof a>"u"&&(!i||!i.getContext)&&(a=i,i=void 0),i||(u=t()),a=s.getOptions(a);const d=s.getImageWidth(o.modules.size,a),p=u.getContext("2d"),b=p.createImageData(d,d);return s.qrToImageData(b.data,o,a),r(p,u,d),p.putImageData(b,0,0),u},e.renderToDataURL=function(o,i,l){let a=l;typeof a>"u"&&(!i||!i.getContext)&&(a=i,i=void 0),a||(a={});const u=e.render(o,i,a),d=a.type||"image/png",p=a.rendererOpts||{};return u.toDataURL(d,p.quality)}})(Ue)),Ue}var Ve={},Bt;function Jo(){if(Bt)return Ve;Bt=1;const e=xt();function s(n,o){const i=n.a/255,l=o+'="'+n.hex+'"';return i<1?l+" "+o+'-opacity="'+i.toFixed(2).slice(1)+'"':l}function r(n,o,i){let l=n+o;return typeof i<"u"&&(l+=" "+i),l}function t(n,o,i){let l="",a=0,u=!1,d=0;for(let p=0;p<n.length;p++){const b=Math.floor(p%o),f=Math.floor(p/o);!b&&!u&&(u=!0),n[p]?(d++,p>0&&b>0&&n[p-1]||(l+=u?r("M",b+i,.5+f+i):r("m",a,0),a=0,u=!1),b+1<o&&n[p+1]||(l+=r("h",d),d=0)):a++}return l}return Ve.render=function(o,i,l){const a=e.getOptions(i),u=o.modules.size,d=o.modules.data,p=u+a.margin*2,b=a.color.light.a?"<path "+s(a.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",f="<path "+s(a.color.dark,"stroke")+' d="'+t(d,u,a.margin)+'"/>',w='viewBox="0 0 '+p+" "+p+'"',_='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+w+' shape-rendering="crispEdges">'+b+f+`</svg>
12
- `;return typeof l=="function"&&l(null,_),_},Ve}var It;function Yo(){if(It)return te;It=1;const e=Ao(),s=xo(),r=zo(),t=Jo();function n(o,i,l,a,u){const d=[].slice.call(arguments,1),p=d.length,b=typeof d[p-1]=="function";if(!b&&!e())throw new Error("Callback required as last argument");if(b){if(p<2)throw new Error("Too few arguments provided");p===2?(u=l,l=i,i=a=void 0):p===3&&(i.getContext&&typeof u>"u"?(u=a,a=void 0):(u=a,a=l,l=i,i=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(l=i,i=a=void 0):p===2&&!i.getContext&&(a=l,l=i,i=void 0),new Promise(function(f,w){try{const h=s.create(l,a);f(o(h,i,a))}catch(h){w(h)}})}try{const f=s.create(l,a);u(null,o(f,i,a))}catch(f){u(f)}}return te.create=s.create,te.toCanvas=n.bind(null,r.render),te.toDataURL=n.bind(null,r.renderToDataURL),te.toString=n.bind(null,function(o,i,l){return t.render(o,l)}),te}var Qo=Yo();const Go=Io(Qo),Wo={class:"qr-display"},Zo={class:"qr-section"},Xo=["href","onKeydown"],er={key:0,class:"link-text"},tr={__name:"QRCodeDisplay",props:{url:{type:String,required:!0},showLink:{type:Boolean,default:!1}},emits:["copied"],setup(e,{emit:s}){const r=e,t=s,n=q(null),o=x(()=>r.url?r.url.replace(/^https?:\/\//,""):"");function i(){if(!(!r.url||!n.value))try{n.value.getContext("2d").clearRect(0,0,n.value.width,n.value.height),Go.toCanvas(n.value,r.url,{scale:6,margin:0,color:{dark:"#000000",light:"#FFFFFF"}}),n.value.removeAttribute("style")}catch(a){console.error("QR code generation failed:",a)}}async function l(){if(r.url)try{await navigator.clipboard.writeText(r.url),t("copied")}catch(a){console.error("Failed to copy link:",a)}}return He(()=>r.url,()=>{i()},{immediate:!0}),He(n,()=>{n.value&&r.url&&i()},{immediate:!0}),(a,u)=>(M(),T("div",Wo,[v("div",Zo,[v("a",{href:e.url,onClick:de(l,["prevent"]),class:"qr-link",title:"Click to copy link",tabindex:"0",onKeydown:un(de(l,["prevent"]),["enter"])},[v("canvas",{ref_key:"qrCanvas",ref:n,class:"qr-code"},null,512),e.showLink&&e.url?(M(),T("div",er,D(o.value),1)):L("",!0)],40,Xo)])]))}},nr=Y(tr,[["__scopeId","data-v-727427c4"]]),or={class:"device-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"regTitle"},rr={class:"reg-header-row"},sr={id:"regTitle",class:"reg-title"},ir={key:0},ar={key:1},lr={class:"device-link-section"},ur={key:0,class:"expiry-note"},cr={__name:"RegistrationLinkModal",props:{endpoint:{type:String,required:!0},userName:{type:String,default:""}},emits:["close","copied"],setup(e,{emit:s}){const r=e,t=s,n=he(),o=q(null),i=q(null),l=q(null),a=q(null),u=q(null);async function d(){try{const h=await Q(r.endpoint,{method:"POST"});if(h.url){if(i.value=h.url,l.value=h.expires?new Date(h.expires):null,await xe(),o.value){o.value.showModal();const _=a.value;(_?.querySelector(".btn-primary")||_?.querySelector("button"))?.focus()}}else t("close")}catch(h){n.showMessage(h.message||"Failed to generate link","error"),t("close")}}function p(){t("copied")}const b=h=>{const _=j(h)},f=h=>{const _=j(h);_&&(h.preventDefault(),(_==="down"||_==="up")&&a.value?.querySelector("button")?.focus())},w=h=>{const _=j(h);_&&(h.preventDefault(),(_==="up"||_==="down")&&document.querySelector(".qr-link")?.focus())};return $t(()=>{u.value=document.activeElement,d()}),qt(()=>{const h=u.value;h&&document.body.contains(h)&&!h.disabled&&h.focus()}),(h,_)=>(M(),T("dialog",{ref_key:"dialog",ref:o,onClose:_[2]||(_[2]=A=>h.$emit("close")),onKeydown:b},[v("div",or,[v("div",rr,[v("h2",sr,[_[3]||(_[3]=ze(" 📱 ",-1)),e.userName?(M(),T("span",ir,"Registration for "+D(e.userName),1)):(M(),T("span",ar,"Add Another Device"))]),v("button",{class:"icon-btn",onClick:_[0]||(_[0]=A=>h.$emit("close")),"aria-label":"Close",tabindex:"-1"},"✕")]),v("div",lr,[_[4]||(_[4]=v("p",{class:"reg-help"}," Scan this QR code on the new device, or copy the link and open it there. ",-1)),cn(nr,{url:i.value,"show-link":!0,onCopied:p,onKeydown:f},null,8,["url"]),l.value?(M(),T("p",ur," This link expires "+D(F(G)(l.value).toLowerCase())+". ",1)):L("",!0)]),v("div",{class:"reg-actions",ref_key:"actionsRow",ref:a,onKeydown:w},[v("button",{class:"btn-secondary",onClick:_[1]||(_[1]=A=>h.$emit("close"))},"Close")],544)])],544))}},Ar=Y(cr,[["__scopeId","data-v-26360b56"]]),dr={class:"loading-container"},fr={__name:"LoadingView",props:{message:{type:String,default:"Loading..."}},setup(e){return(s,r)=>(M(),T("div",dr,[r[0]||(r[0]=v("div",{class:"loading-spinner"},null,-1)),v("p",null,D(e.message),1)]))}},Rr=Y(fr,[["__scopeId","data-v-130f5abf"]]),hr={class:"message-container"},gr={class:"message-content"},mr={key:0,class:"error-detail"},yr={class:"button-row"},pr={__name:"AccessDenied",props:{title:{type:String,default:"Access Denied"},icon:{type:String,default:"🔒"},message:{type:String,default:null}},setup(e){function s(){window.location.reload()}return(r,t)=>(M(),T("div",hr,[v("div",gr,[v("h2",null,D(e.icon)+" "+D(e.title),1),e.message?(M(),T("p",mr,D(e.message),1)):L("",!0),v("div",yr,[v("button",{class:"btn-secondary",onClick:t[0]||(t[0]=(...n)=>F(We)&&F(We)(...n))},"Back"),v("button",{class:"btn-primary",onClick:s},"Reload Page")])])]))}},Tr=Y(pr,[["__scopeId","data-v-a7b258e7"]]);export{Tr as A,Sr as B,Rr as L,kr as M,Br as N,Ar as R,_r as U,Er as _,Ir as a,Cr as b,vr as c,he as u};
@@ -1,49 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
2
- * @vue/shared v3.5.21
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/function Yn(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const j={},ct=[],Te=()=>{},ir=()=>!1,dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),zn=e=>e.startsWith("onUpdate:"),ie=Object.assign,Xn=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xi=Object.prototype.hasOwnProperty,U=(e,t)=>xi.call(e,t),R=Array.isArray,at=e=>Ut(e)==="[object Map]",mt=e=>Ut(e)==="[object Set]",Es=e=>Ut(e)==="[object Date]",P=e=>typeof e=="function",q=e=>typeof e=="string",ge=e=>typeof e=="symbol",V=e=>e!==null&&typeof e=="object",or=e=>(V(e)||P(e))&&P(e.then)&&P(e.catch),lr=Object.prototype.toString,Ut=e=>lr.call(e),Ti=e=>Ut(e).slice(8,-1),cr=e=>Ut(e)==="[object Object]",Zn=e=>q(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,xt=Yn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),hn=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Ai=/-\w/g,Ve=hn(e=>e.replace(Ai,t=>t.slice(1).toUpperCase())),Ri=/\B([A-Z])/g,qe=hn(e=>e.replace(Ri,"-$1").toLowerCase()),ar=hn(e=>e.charAt(0).toUpperCase()+e.slice(1)),xn=hn(e=>e?`on${ar(e)}`:""),ke=(e,t)=>!Object.is(e,t),Yt=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ur=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},tn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let xs;const pn=()=>xs||(xs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Qn(e){if(R(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=q(s)?Pi(s):Qn(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(q(e)||V(e))return e}const Ci=/;(?![^(]*\))/g,Oi=/:([^]+)/,Ii=/\/\*[^]*?\*\//g;function Pi(e){const t={};return e.replace(Ii,"").split(Ci).forEach(n=>{if(n){const s=n.split(Oi);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function es(e){let t="";if(q(e))t=e;else if(R(e))for(let n=0;n<e.length;n++){const s=es(e[n]);s&&(t+=s+" ")}else if(V(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Mi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ni=Yn(Mi);function fr(e){return!!e||e===""}function Di(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=st(e[s],t[s]);return n}function st(e,t){if(e===t)return!0;let n=Es(e),s=Es(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=ge(e),s=ge(t),n||s)return e===t;if(n=R(e),s=R(t),n||s)return n&&s?Di(e,t):!1;if(n=V(e),s=V(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,i=Object.keys(t).length;if(r!==i)return!1;for(const o in e){const l=e.hasOwnProperty(o),c=t.hasOwnProperty(o);if(l&&!c||!l&&c||!st(e[o],t[o]))return!1}}return String(e)===String(t)}function ts(e,t){return e.findIndex(n=>st(n,t))}const dr=e=>!!(e&&e.__v_isRef===!0),Fi=e=>q(e)?e:e==null?"":R(e)||V(e)&&(e.toString===lr||!P(e.toString))?dr(e)?Fi(e.value):JSON.stringify(e,hr,2):String(e),hr=(e,t)=>dr(t)?hr(e,t.value):at(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[Tn(s,i)+" =>"]=r,n),{})}:mt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Tn(n))}:ge(t)?Tn(t):V(t)&&!R(t)&&!cr(t)?String(t):t,Tn=(e,t="")=>{var n;return ge(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
- * @vue/reactivity v3.5.21
7
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
- * @license MIT
9
- **/let X;class pr{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=X,!t&&X&&(this.index=(X.scopes||(X.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=X;try{return X=this,t()}finally{X=n}}}on(){++this._on===1&&(this.prevScope=X,X=this)}off(){this._on>0&&--this._on===0&&(X=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Uc(e){return new pr(e)}function Ui(){return X}function Lc(e,t=!1){X&&X.cleanups.push(e)}let $;const An=new WeakSet;class gr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,X&&X.active&&X.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,An.has(this)&&(An.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||br(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ts(this),yr(this);const t=$,n=pe;$=this,pe=!0;try{return this.fn()}finally{_r(this),$=t,pe=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)rs(t);this.deps=this.depsTail=void 0,Ts(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?An.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ln(this)&&this.run()}get dirty(){return Ln(this)}}let mr=0,Tt,At;function br(e,t=!1){if(e.flags|=8,t){e.next=At,At=e;return}e.next=Tt,Tt=e}function ns(){mr++}function ss(){if(--mr>0)return;if(At){let t=At;for(At=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Tt;){let t=Tt;for(Tt=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function yr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _r(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),rs(s),Li(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Ln(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(wr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function wr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Pt)||(e.globalVersion=Pt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ln(e))))return;e.flags|=2;const t=e.dep,n=$,s=pe;$=e,pe=!0;try{yr(e);const r=e.fn(e._value);(t.version===0||ke(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{$=n,pe=s,_r(e),e.flags&=-3}}function rs(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)rs(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Li(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pe=!0;const vr=[];function Ne(){vr.push(pe),pe=!1}function De(){const e=vr.pop();pe=e===void 0?!0:e}function Ts(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=$;$=void 0;try{t()}finally{$=n}}}let Pt=0;class ji{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class is{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!$||!pe||$===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==$)n=this.activeLink=new ji($,this),$.deps?(n.prevDep=$.depsTail,$.depsTail.nextDep=n,$.depsTail=n):$.deps=$.depsTail=n,Sr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=$.depsTail,n.nextDep=void 0,$.depsTail.nextDep=n,$.depsTail=n,$.deps===n&&($.deps=s)}return n}trigger(t){this.version++,Pt++,this.notify(t)}notify(t){ns();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ss()}}}function Sr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Sr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const nn=new WeakMap,tt=Symbol(""),jn=Symbol(""),Mt=Symbol("");function Z(e,t,n){if(pe&&$){let s=nn.get(e);s||nn.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new is),r.map=s,r.key=n),r.track()}}function Ie(e,t,n,s,r,i){const o=nn.get(e);if(!o){Pt++;return}const l=c=>{c&&c.trigger()};if(ns(),t==="clear")o.forEach(l);else{const c=R(e),d=c&&Zn(n);if(c&&n==="length"){const f=Number(s);o.forEach((p,S)=>{(S==="length"||S===Mt||!ge(S)&&S>=f)&&l(p)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),d&&l(o.get(Mt)),t){case"add":c?d&&l(o.get("length")):(l(o.get(tt)),at(e)&&l(o.get(jn)));break;case"delete":c||(l(o.get(tt)),at(e)&&l(o.get(jn)));break;case"set":at(e)&&l(o.get(tt));break}}ss()}function Ki(e,t){const n=nn.get(e);return n&&n.get(t)}function rt(e){const t=F(e);return t===e?t:(Z(t,"iterate",Mt),de(e)?t:t.map(Y))}function gn(e){return Z(e=F(e),"iterate",Mt),e}const Hi={__proto__:null,[Symbol.iterator](){return Rn(this,Symbol.iterator,Y)},concat(...e){return rt(this).concat(...e.map(t=>R(t)?rt(t):t))},entries(){return Rn(this,"entries",e=>(e[1]=Y(e[1]),e))},every(e,t){return Ce(this,"every",e,t,void 0,arguments)},filter(e,t){return Ce(this,"filter",e,t,n=>n.map(Y),arguments)},find(e,t){return Ce(this,"find",e,t,Y,arguments)},findIndex(e,t){return Ce(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ce(this,"findLast",e,t,Y,arguments)},findLastIndex(e,t){return Ce(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ce(this,"forEach",e,t,void 0,arguments)},includes(...e){return Cn(this,"includes",e)},indexOf(...e){return Cn(this,"indexOf",e)},join(e){return rt(this).join(e)},lastIndexOf(...e){return Cn(this,"lastIndexOf",e)},map(e,t){return Ce(this,"map",e,t,void 0,arguments)},pop(){return vt(this,"pop")},push(...e){return vt(this,"push",e)},reduce(e,...t){return As(this,"reduce",e,t)},reduceRight(e,...t){return As(this,"reduceRight",e,t)},shift(){return vt(this,"shift")},some(e,t){return Ce(this,"some",e,t,void 0,arguments)},splice(...e){return vt(this,"splice",e)},toReversed(){return rt(this).toReversed()},toSorted(e){return rt(this).toSorted(e)},toSpliced(...e){return rt(this).toSpliced(...e)},unshift(...e){return vt(this,"unshift",e)},values(){return Rn(this,"values",Y)}};function Rn(e,t,n){const s=gn(e),r=s[t]();return s!==e&&!de(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.value&&(i.value=n(i.value)),i}),r}const $i=Array.prototype;function Ce(e,t,n,s,r,i){const o=gn(e),l=o!==e&&!de(e),c=o[t];if(c!==$i[t]){const p=c.apply(e,i);return l?Y(p):p}let d=n;o!==e&&(l?d=function(p,S){return n.call(this,Y(p),S,e)}:n.length>2&&(d=function(p,S){return n.call(this,p,S,e)}));const f=c.call(o,d,s);return l&&r?r(f):f}function As(e,t,n,s){const r=gn(e);let i=n;return r!==e&&(de(e)?n.length>3&&(i=function(o,l,c){return n.call(this,o,l,c,e)}):i=function(o,l,c){return n.call(this,o,Y(l),c,e)}),r[t](i,...s)}function Cn(e,t,n){const s=F(e);Z(s,"iterate",Mt);const r=s[t](...n);return(r===-1||r===!1)&&as(n[0])?(n[0]=F(n[0]),s[t](...n)):r}function vt(e,t,n=[]){Ne(),ns();const s=F(e)[t].apply(e,n);return ss(),De(),s}const ki=Yn("__proto__,__v_isRef,__isVue"),Er=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ge));function Vi(e){ge(e)||(e=String(e));const t=F(this);return Z(t,"has",e),t.hasOwnProperty(e)}class xr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Qi:Cr:i?Rr:Ar).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=R(t);if(!r){let c;if(o&&(c=Hi[n]))return c;if(n==="hasOwnProperty")return Vi}const l=Reflect.get(t,n,z(t)?t:s);return(ge(n)?Er.has(n):ki(n))||(r||Z(t,"get",n),i)?l:z(l)?o&&Zn(n)?l:l.value:V(l)?r?Or(l):ls(l):l}}class Tr extends xr{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const c=Be(i);if(!de(s)&&!Be(s)&&(i=F(i),s=F(s)),!R(t)&&z(i)&&!z(s))return c||(i.value=s),!0}const o=R(t)&&Zn(n)?Number(n)<t.length:U(t,n),l=Reflect.set(t,n,s,z(t)?t:r);return t===F(r)&&(o?ke(s,i)&&Ie(t,"set",n,s):Ie(t,"add",n,s)),l}deleteProperty(t,n){const s=U(t,n);t[n];const r=Reflect.deleteProperty(t,n);return r&&s&&Ie(t,"delete",n,void 0),r}has(t,n){const s=Reflect.has(t,n);return(!ge(n)||!Er.has(n))&&Z(t,"has",n),s}ownKeys(t){return Z(t,"iterate",R(t)?"length":tt),Reflect.ownKeys(t)}}class Bi extends xr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Wi=new Tr,qi=new Bi,Ji=new Tr(!0);const Kn=e=>e,Bt=e=>Reflect.getPrototypeOf(e);function Gi(e,t,n){return function(...s){const r=this.__v_raw,i=F(r),o=at(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,d=r[e](...s),f=n?Kn:t?sn:Y;return!t&&Z(i,"iterate",c?jn:tt),{next(){const{value:p,done:S}=d.next();return S?{value:p,done:S}:{value:l?[f(p[0]),f(p[1])]:f(p),done:S}},[Symbol.iterator](){return this}}}}function Wt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Yi(e,t){const n={get(r){const i=this.__v_raw,o=F(i),l=F(r);e||(ke(r,l)&&Z(o,"get",r),Z(o,"get",l));const{has:c}=Bt(o),d=t?Kn:e?sn:Y;if(c.call(o,r))return d(i.get(r));if(c.call(o,l))return d(i.get(l));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&Z(F(r),"iterate",tt),r.size},has(r){const i=this.__v_raw,o=F(i),l=F(r);return e||(ke(r,l)&&Z(o,"has",r),Z(o,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const o=this,l=o.__v_raw,c=F(l),d=t?Kn:e?sn:Y;return!e&&Z(c,"iterate",tt),l.forEach((f,p)=>r.call(i,d(f),d(p),o))}};return ie(n,e?{add:Wt("add"),set:Wt("set"),delete:Wt("delete"),clear:Wt("clear")}:{add(r){!t&&!de(r)&&!Be(r)&&(r=F(r));const i=F(this);return Bt(i).has.call(i,r)||(i.add(r),Ie(i,"add",r,r)),this},set(r,i){!t&&!de(i)&&!Be(i)&&(i=F(i));const o=F(this),{has:l,get:c}=Bt(o);let d=l.call(o,r);d||(r=F(r),d=l.call(o,r));const f=c.call(o,r);return o.set(r,i),d?ke(i,f)&&Ie(o,"set",r,i):Ie(o,"add",r,i),this},delete(r){const i=F(this),{has:o,get:l}=Bt(i);let c=o.call(i,r);c||(r=F(r),c=o.call(i,r)),l&&l.call(i,r);const d=i.delete(r);return c&&Ie(i,"delete",r,void 0),d},clear(){const r=F(this),i=r.size!==0,o=r.clear();return i&&Ie(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Gi(r,e,t)}),n}function os(e,t){const n=Yi(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(U(n,r)&&r in s?n:s,r,i)}const zi={get:os(!1,!1)},Xi={get:os(!1,!0)},Zi={get:os(!0,!1)};const Ar=new WeakMap,Rr=new WeakMap,Cr=new WeakMap,Qi=new WeakMap;function eo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function to(e){return e.__v_skip||!Object.isExtensible(e)?0:eo(Ti(e))}function ls(e){return Be(e)?e:cs(e,!1,Wi,zi,Ar)}function no(e){return cs(e,!1,Ji,Xi,Rr)}function Or(e){return cs(e,!0,qi,Zi,Cr)}function cs(e,t,n,s,r){if(!V(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=to(e);if(i===0)return e;const o=r.get(e);if(o)return o;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function ut(e){return Be(e)?ut(e.__v_raw):!!(e&&e.__v_isReactive)}function Be(e){return!!(e&&e.__v_isReadonly)}function de(e){return!!(e&&e.__v_isShallow)}function as(e){return e?!!e.__v_raw:!1}function F(e){const t=e&&e.__v_raw;return t?F(t):e}function so(e){return!U(e,"__v_skip")&&Object.isExtensible(e)&&ur(e,"__v_skip",!0),e}const Y=e=>V(e)?ls(e):e,sn=e=>V(e)?Or(e):e;function z(e){return e?e.__v_isRef===!0:!1}function jc(e){return ro(e,!1)}function ro(e,t){return z(e)?e:new io(e,t)}class io{constructor(t,n){this.dep=new is,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:F(t),this._value=n?t:Y(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||de(t)||Be(t);t=s?t:F(t),ke(t,n)&&(this._rawValue=t,this._value=s?t:Y(t),this.dep.trigger())}}function oo(e){return z(e)?e.value:e}const lo={get:(e,t,n)=>t==="__v_raw"?e:oo(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return z(r)&&!z(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Ir(e){return ut(e)?e:new Proxy(e,lo)}function Kc(e){const t=R(e)?new Array(e.length):{};for(const n in e)t[n]=ao(e,n);return t}class co{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Ki(F(this._object),this._key)}}function ao(e,t,n){const s=e[t];return z(s)?s:new co(e,t,n)}class uo{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new is(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Pt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&$!==this)return br(this,!0),!0}get value(){const t=this.dep.track();return wr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function fo(e,t,n=!1){let s,r;return P(e)?s=e:(s=e.get,r=e.set),new uo(s,r,n)}const qt={},rn=new WeakMap;let Ze;function ho(e,t=!1,n=Ze){if(n){let s=rn.get(n);s||rn.set(n,s=[]),s.push(e)}}function po(e,t,n=j){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:l,call:c}=n,d=O=>r?O:de(O)||r===!1||r===0?Pe(O,1):Pe(O);let f,p,S,x,C=!1,N=!1;if(z(e)?(p=()=>e.value,C=de(e)):ut(e)?(p=()=>d(e),C=!0):R(e)?(N=!0,C=e.some(O=>ut(O)||de(O)),p=()=>e.map(O=>{if(z(O))return O.value;if(ut(O))return d(O);if(P(O))return c?c(O,2):O()})):P(e)?t?p=c?()=>c(e,2):e:p=()=>{if(S){Ne();try{S()}finally{De()}}const O=Ze;Ze=f;try{return c?c(e,3,[x]):e(x)}finally{Ze=O}}:p=Te,t&&r){const O=p,J=r===!0?1/0:r;p=()=>Pe(O(),J)}const ee=Ui(),D=()=>{f.stop(),ee&&ee.active&&Xn(ee.effects,f)};if(i&&t){const O=t;t=(...J)=>{O(...J),D()}}let k=N?new Array(e.length).fill(qt):qt;const W=O=>{if(!(!(f.flags&1)||!f.dirty&&!O))if(t){const J=f.run();if(r||C||(N?J.some((Le,me)=>ke(Le,k[me])):ke(J,k))){S&&S();const Le=Ze;Ze=f;try{const me=[J,k===qt?void 0:N&&k[0]===qt?[]:k,x];k=J,c?c(t,3,me):t(...me)}finally{Ze=Le}}}else f.run()};return l&&l(W),f=new gr(p),f.scheduler=o?()=>o(W,!1):W,x=O=>ho(O,!1,f),S=f.onStop=()=>{const O=rn.get(f);if(O){if(c)c(O,4);else for(const J of O)J();rn.delete(f)}},t?s?W(!0):k=f.run():o?o(W.bind(null,!0),!0):f.run(),D.pause=f.pause.bind(f),D.resume=f.resume.bind(f),D.stop=D,D}function Pe(e,t=1/0,n){if(t<=0||!V(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,z(e))Pe(e.value,t,n);else if(R(e))for(let s=0;s<e.length;s++)Pe(e[s],t,n);else if(mt(e)||at(e))e.forEach(s=>{Pe(s,t,n)});else if(cr(e)){for(const s in e)Pe(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Pe(e[s],t,n)}return e}/**
10
- * @vue/runtime-core v3.5.21
11
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
- * @license MIT
13
- **/function Lt(e,t,n,s){try{return s?e(...s):e()}catch(r){mn(r,t,n)}}function Re(e,t,n,s){if(P(e)){const r=Lt(e,t,n,s);return r&&or(r)&&r.catch(i=>{mn(i,t,n)}),r}if(R(e)){const r=[];for(let i=0;i<e.length;i++)r.push(Re(e[i],t,n,s));return r}}function mn(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||j;if(t){let l=t.parent;const c=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const f=l.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,c,d)===!1)return}l=l.parent}if(i){Ne(),Lt(i,null,10,[e,c,d]),De();return}}go(e,n,r,s,o)}function go(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const se=[];let Se=-1;const ft=[];let Ke=null,it=0;const Pr=Promise.resolve();let on=null;function Mr(e){const t=on||Pr;return e?t.then(this?e.bind(this):e):t}function mo(e){let t=Se+1,n=se.length;for(;t<n;){const s=t+n>>>1,r=se[s],i=Nt(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function us(e){if(!(e.flags&1)){const t=Nt(e),n=se[se.length-1];!n||!(e.flags&2)&&t>=Nt(n)?se.push(e):se.splice(mo(t),0,e),e.flags|=1,Nr()}}function Nr(){on||(on=Pr.then(Fr))}function bo(e){R(e)?ft.push(...e):Ke&&e.id===-1?Ke.splice(it+1,0,e):e.flags&1||(ft.push(e),e.flags|=1),Nr()}function Rs(e,t,n=Se+1){for(;n<se.length;n++){const s=se[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;se.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Dr(e){if(ft.length){const t=[...new Set(ft)].sort((n,s)=>Nt(n)-Nt(s));if(ft.length=0,Ke){Ke.push(...t);return}for(Ke=t,it=0;it<Ke.length;it++){const n=Ke[it];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ke=null,it=0}}const Nt=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Fr(e){try{for(Se=0;Se<se.length;Se++){const t=se[Se];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Lt(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Se<se.length;Se++){const t=se[Se];t&&(t.flags&=-2)}Se=-1,se.length=0,Dr(),on=null,(se.length||ft.length)&&Fr()}}let Q=null,Ur=null;function ln(e){const t=Q;return Q=e,Ur=e&&e.type.__scopeId||null,t}function yo(e,t=Q,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Ls(-1);const i=ln(t);let o;try{o=e(...r)}finally{ln(i),s._d&&Ls(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Hc(e,t){if(Q===null)return e;const n=wn(Q),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[i,o,l,c=j]=t[r];i&&(P(i)&&(i={mounted:i,updated:i}),i.deep&&Pe(o),s.push({dir:i,instance:n,value:o,oldValue:void 0,arg:l,modifiers:c}))}return e}function ze(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o<r.length;o++){const l=r[o];i&&(l.oldValue=i[o].value);let c=l.dir[s];c&&(Ne(),Re(c,n,8,[e.el,l,e,t]),De())}}const _o=Symbol("_vte"),wo=e=>e.__isTeleport,vo=Symbol("_leaveCb");function fs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,fs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Lr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const cn=new WeakMap;function Rt(e,t,n,s,r=!1){if(R(e)){e.forEach((C,N)=>Rt(C,t&&(R(t)?t[N]:t),n,s,r));return}if(dt(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Rt(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?wn(s.component):s.el,o=r?null:i,{i:l,r:c}=e,d=t&&t.r,f=l.refs===j?l.refs={}:l.refs,p=l.setupState,S=F(p),x=p===j?ir:C=>U(S,C);if(d!=null&&d!==c){if(Cs(t),q(d))f[d]=null,x(d)&&(p[d]=null);else if(z(d)){d.value=null;const C=t;C.k&&(f[C.k]=null)}}if(P(c))Lt(c,l,12,[o,f]);else{const C=q(c),N=z(c);if(C||N){const ee=()=>{if(e.f){const D=C?x(c)?p[c]:f[c]:c.value;if(r)R(D)&&Xn(D,i);else if(R(D))D.includes(i)||D.push(i);else if(C)f[c]=[i],x(c)&&(p[c]=f[c]);else{const k=[i];c.value=k,e.k&&(f[e.k]=k)}}else C?(f[c]=o,x(c)&&(p[c]=o)):N&&(c.value=o,e.k&&(f[e.k]=o))};if(o){const D=()=>{ee(),cn.delete(e)};D.id=-1,cn.set(e,D),ae(D,n)}else Cs(e),ee()}}}function Cs(e){const t=cn.get(e);t&&(t.flags|=8,cn.delete(e))}pn().requestIdleCallback;pn().cancelIdleCallback;const dt=e=>!!e.type.__asyncLoader,jr=e=>e.type.__isKeepAlive;function So(e,t){Kr(e,"a",t)}function Eo(e,t){Kr(e,"da",t)}function Kr(e,t,n=re){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(bn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)jr(r.parent.vnode)&&xo(s,t,n,r),r=r.parent}}function xo(e,t,n,s){const r=bn(t,e,s,!0);Hr(()=>{Xn(s[t],r)},n)}function bn(e,t,n=re,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Ne();const l=jt(n),c=Re(t,n,e,o);return l(),De(),c});return s?r.unshift(i):r.push(i),i}}const Ue=e=>(t,n=re)=>{(!Ft||e==="sp")&&bn(e,(...s)=>t(...s),n)},To=Ue("bm"),Ao=Ue("m"),Ro=Ue("bu"),Co=Ue("u"),Oo=Ue("bum"),Hr=Ue("um"),Io=Ue("sp"),Po=Ue("rtg"),Mo=Ue("rtc");function No(e,t=re){bn("ec",e,t)}const Do=Symbol.for("v-ndc");function $c(e,t,n,s){let r;const i=n,o=R(e);if(o||q(e)){const l=o&&ut(e);let c=!1,d=!1;l&&(c=!de(e),d=Be(e),e=gn(e)),r=new Array(e.length);for(let f=0,p=e.length;f<p;f++)r[f]=t(c?d?sn(Y(e[f])):Y(e[f]):e[f],f,void 0,i)}else if(typeof e=="number"){r=new Array(e);for(let l=0;l<e;l++)r[l]=t(l+1,l,void 0,i)}else if(V(e))if(e[Symbol.iterator])r=Array.from(e,(l,c)=>t(l,c,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let c=0,d=l.length;c<d;c++){const f=l[c];r[c]=t(e[f],f,c,i)}}else r=[];return r}function kc(e,t,n={},s,r){if(Q.ce||Q.parent&&dt(Q.parent)&&Q.parent.ce)return t!=="default"&&(n.name=t),Bn(),Wn(fe,null,[Ae("slot",n,s&&s())],64);let i=e[t];i&&i._c&&(i._d=!1),Bn();const o=i&&$r(i(n)),l=n.key||o&&o.key,c=Wn(fe,{key:(l&&!ge(l)?l:`_${t}`)+(!o&&s?"_fb":"")},o||(s?s():[]),o&&e._===1?64:-2);return i&&i._c&&(i._d=!0),c}function $r(e){return e.some(t=>ps(t)?!(t.type===Fe||t.type===fe&&!$r(t.children)):!0)?e:null}const Hn=e=>e?ai(e)?wn(e):Hn(e.parent):null,Ct=ie(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Hn(e.parent),$root:e=>Hn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Vr(e),$forceUpdate:e=>e.f||(e.f=()=>{us(e.update)}),$nextTick:e=>e.n||(e.n=Mr.bind(e.proxy)),$watch:e=>nl.bind(e)}),On=(e,t)=>e!==j&&!e.__isScriptSetup&&U(e,t),Fo={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;let d;if(t[0]!=="$"){const x=o[t];if(x!==void 0)switch(x){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(On(s,t))return o[t]=1,s[t];if(r!==j&&U(r,t))return o[t]=2,r[t];if((d=e.propsOptions[0])&&U(d,t))return o[t]=3,i[t];if(n!==j&&U(n,t))return o[t]=4,n[t];$n&&(o[t]=0)}}const f=Ct[t];let p,S;if(f)return t==="$attrs"&&Z(e.attrs,"get",""),f(e);if((p=l.__cssModules)&&(p=p[t]))return p;if(n!==j&&U(n,t))return o[t]=4,n[t];if(S=c.config.globalProperties,U(S,t))return S[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return On(r,t)?(r[t]=n,!0):s!==j&&U(s,t)?(s[t]=n,!0):U(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i,type:o}},l){let c,d;return!!(n[l]||e!==j&&l[0]!=="$"&&U(e,l)||On(t,l)||(c=i[0])&&U(c,l)||U(s,l)||U(Ct,l)||U(r.config.globalProperties,l)||(d=o.__cssModules)&&d[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:U(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Os(e){return R(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let $n=!0;function Uo(e){const t=Vr(e),n=e.proxy,s=e.ctx;$n=!1,t.beforeCreate&&Is(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:d,created:f,beforeMount:p,mounted:S,beforeUpdate:x,updated:C,activated:N,deactivated:ee,beforeDestroy:D,beforeUnmount:k,destroyed:W,unmounted:O,render:J,renderTracked:Le,renderTriggered:me,errorCaptured:je,serverPrefetch:Kt,expose:Je,inheritAttrs:bt,components:Ht,directives:$t,filters:Sn}=t;if(d&&Lo(d,s,null),o)for(const B in o){const K=o[B];P(K)&&(s[B]=K.bind(n))}if(r){const B=r.call(n,n);V(B)&&(e.data=ls(B))}if($n=!0,i)for(const B in i){const K=i[B],Ge=P(K)?K.bind(n,n):P(K.get)?K.get.bind(n,n):Te,kt=!P(K)&&P(K.set)?K.set.bind(n):Te,Ye=xl({get:Ge,set:kt});Object.defineProperty(s,B,{enumerable:!0,configurable:!0,get:()=>Ye.value,set:be=>Ye.value=be})}if(l)for(const B in l)kr(l[B],s,n,B);if(c){const B=P(c)?c.call(n):c;Reflect.ownKeys(B).forEach(K=>{Vo(K,B[K])})}f&&Is(f,e,"c");function te(B,K){R(K)?K.forEach(Ge=>B(Ge.bind(n))):K&&B(K.bind(n))}if(te(To,p),te(Ao,S),te(Ro,x),te(Co,C),te(So,N),te(Eo,ee),te(No,je),te(Mo,Le),te(Po,me),te(Oo,k),te(Hr,O),te(Io,Kt),R(Je))if(Je.length){const B=e.exposed||(e.exposed={});Je.forEach(K=>{Object.defineProperty(B,K,{get:()=>n[K],set:Ge=>n[K]=Ge,enumerable:!0})})}else e.exposed||(e.exposed={});J&&e.render===Te&&(e.render=J),bt!=null&&(e.inheritAttrs=bt),Ht&&(e.components=Ht),$t&&(e.directives=$t),Kt&&Lr(e)}function Lo(e,t,n=Te){R(e)&&(e=kn(e));for(const s in e){const r=e[s];let i;V(r)?"default"in r?i=zt(r.from||s,r.default,!0):i=zt(r.from||s):i=zt(r),z(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function Is(e,t,n){Re(R(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function kr(e,t,n,s){let r=s.includes(".")?ni(n,s):()=>n[s];if(q(e)){const i=t[e];P(i)&&Pn(r,i)}else if(P(e))Pn(r,e.bind(n));else if(V(e))if(R(e))e.forEach(i=>kr(i,t,n,s));else{const i=P(e.handler)?e.handler.bind(n):t[e.handler];P(i)&&Pn(r,i,e)}}function Vr(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(d=>an(c,d,o,!0)),an(c,t,o)),V(t)&&i.set(t,c),c}function an(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&an(e,i,n,!0),r&&r.forEach(o=>an(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=jo[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const jo={data:Ps,props:Ms,emits:Ms,methods:Et,computed:Et,beforeCreate:ne,created:ne,beforeMount:ne,mounted:ne,beforeUpdate:ne,updated:ne,beforeDestroy:ne,beforeUnmount:ne,destroyed:ne,unmounted:ne,activated:ne,deactivated:ne,errorCaptured:ne,serverPrefetch:ne,components:Et,directives:Et,watch:Ho,provide:Ps,inject:Ko};function Ps(e,t){return t?e?function(){return ie(P(e)?e.call(this,this):e,P(t)?t.call(this,this):t)}:t:e}function Ko(e,t){return Et(kn(e),kn(t))}function kn(e){if(R(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ne(e,t){return e?[...new Set([].concat(e,t))]:t}function Et(e,t){return e?ie(Object.create(null),e,t):t}function Ms(e,t){return e?R(e)&&R(t)?[...new Set([...e,...t])]:ie(Object.create(null),Os(e),Os(t??{})):t}function Ho(e,t){if(!e)return t;if(!t)return e;const n=ie(Object.create(null),e);for(const s in t)n[s]=ne(e[s],t[s]);return n}function Br(){return{app:null,config:{isNativeTag:ir,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let $o=0;function ko(e,t){return function(s,r=null){P(s)||(s=ie({},s)),r!=null&&!V(r)&&(r=null);const i=Br(),o=new WeakSet,l=[];let c=!1;const d=i.app={_uid:$o++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:Tl,get config(){return i.config},set config(f){},use(f,...p){return o.has(f)||(f&&P(f.install)?(o.add(f),f.install(d,...p)):P(f)&&(o.add(f),f(d,...p))),d},mixin(f){return i.mixins.includes(f)||i.mixins.push(f),d},component(f,p){return p?(i.components[f]=p,d):i.components[f]},directive(f,p){return p?(i.directives[f]=p,d):i.directives[f]},mount(f,p,S){if(!c){const x=d._ceVNode||Ae(s,r);return x.appContext=i,S===!0?S="svg":S===!1&&(S=void 0),e(x,f,S),c=!0,d._container=f,f.__vue_app__=d,wn(x.component)}},onUnmount(f){l.push(f)},unmount(){c&&(Re(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(f,p){return i.provides[f]=p,d},runWithContext(f){const p=nt;nt=d;try{return f()}finally{nt=p}}};return d}}let nt=null;function Vo(e,t){if(re){let n=re.provides;const s=re.parent&&re.parent.provides;s===n&&(n=re.provides=Object.create(s)),n[e]=t}}function zt(e,t,n=!1){const s=ci();if(s||nt){let r=nt?nt._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&P(t)?t.call(s&&s.proxy):t}}function Vc(){return!!(ci()||nt)}const Wr={},qr=()=>Object.create(Wr),Jr=e=>Object.getPrototypeOf(e)===Wr;function Bo(e,t,n,s=!1){const r={},i=qr();e.propsDefaults=Object.create(null),Gr(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:no(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function Wo(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=F(r),[c]=e.propsOptions;let d=!1;if((s||o>0)&&!(o&16)){if(o&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let S=f[p];if(yn(e.emitsOptions,S))continue;const x=t[S];if(c)if(U(i,S))x!==i[S]&&(i[S]=x,d=!0);else{const C=Ve(S);r[C]=Vn(c,l,C,x,e,!1)}else x!==i[S]&&(i[S]=x,d=!0)}}}else{Gr(e,t,r,i)&&(d=!0);let f;for(const p in l)(!t||!U(t,p)&&((f=qe(p))===p||!U(t,f)))&&(c?n&&(n[p]!==void 0||n[f]!==void 0)&&(r[p]=Vn(c,l,p,void 0,e,!0)):delete r[p]);if(i!==l)for(const p in i)(!t||!U(t,p))&&(delete i[p],d=!0)}d&&Ie(e.attrs,"set","")}function Gr(e,t,n,s){const[r,i]=e.propsOptions;let o=!1,l;if(t)for(let c in t){if(xt(c))continue;const d=t[c];let f;r&&U(r,f=Ve(c))?!i||!i.includes(f)?n[f]=d:(l||(l={}))[f]=d:yn(e.emitsOptions,c)||(!(c in s)||d!==s[c])&&(s[c]=d,o=!0)}if(i){const c=F(n),d=l||j;for(let f=0;f<i.length;f++){const p=i[f];n[p]=Vn(r,c,p,d[p],e,!U(d,p))}}return o}function Vn(e,t,n,s,r,i){const o=e[n];if(o!=null){const l=U(o,"default");if(l&&s===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&P(c)){const{propsDefaults:d}=r;if(n in d)s=d[n];else{const f=jt(r);s=d[n]=c.call(null,t),f()}}else s=c;r.ce&&r.ce._setProp(n,s)}o[0]&&(i&&!l?s=!1:o[1]&&(s===""||s===qe(n))&&(s=!0))}return s}const qo=new WeakMap;function Yr(e,t,n=!1){const s=n?qo:t.propsCache,r=s.get(e);if(r)return r;const i=e.props,o={},l=[];let c=!1;if(!P(e)){const f=p=>{c=!0;const[S,x]=Yr(p,t,!0);ie(o,S),x&&l.push(...x)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!i&&!c)return V(e)&&s.set(e,ct),ct;if(R(i))for(let f=0;f<i.length;f++){const p=Ve(i[f]);Ns(p)&&(o[p]=j)}else if(i)for(const f in i){const p=Ve(f);if(Ns(p)){const S=i[f],x=o[p]=R(S)||P(S)?{type:S}:ie({},S),C=x.type;let N=!1,ee=!0;if(R(C))for(let D=0;D<C.length;++D){const k=C[D],W=P(k)&&k.name;if(W==="Boolean"){N=!0;break}else W==="String"&&(ee=!1)}else N=P(C)&&C.name==="Boolean";x[0]=N,x[1]=ee,(N||U(x,"default"))&&l.push(p)}}const d=[o,l];return V(e)&&s.set(e,d),d}function Ns(e){return e[0]!=="$"&&!xt(e)}const ds=e=>e==="_"||e==="_ctx"||e==="$stable",hs=e=>R(e)?e.map(Ee):[Ee(e)],Jo=(e,t,n)=>{if(t._n)return t;const s=yo((...r)=>hs(t(...r)),n);return s._c=!1,s},zr=(e,t,n)=>{const s=e._ctx;for(const r in e){if(ds(r))continue;const i=e[r];if(P(i))t[r]=Jo(r,i,s);else if(i!=null){const o=hs(i);t[r]=()=>o}}},Xr=(e,t)=>{const n=hs(t);e.slots.default=()=>n},Zr=(e,t,n)=>{for(const s in t)(n||!ds(s))&&(e[s]=t[s])},Go=(e,t,n)=>{const s=e.slots=qr();if(e.vnode.shapeFlag&32){const r=t._;r?(Zr(s,t,n),n&&ur(s,"_",r,!0)):zr(t,s)}else t&&Xr(e,t)},Yo=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=j;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:Zr(r,t,n):(i=!t.$stable,zr(t,r)),o=t}else t&&(Xr(e,t),o={default:1});if(i)for(const l in r)!ds(l)&&o[l]==null&&delete r[l]},ae=ul;function zo(e){return Xo(e)}function Xo(e,t){const n=pn();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:d,setElementText:f,parentNode:p,nextSibling:S,setScopeId:x=Te,insertStaticContent:C}=e,N=(a,u,h,b=null,g=null,m=null,v=void 0,w=null,_=!!u.dynamicChildren)=>{if(a===u)return;a&&!St(a,u)&&(b=Vt(a),be(a,g,m,!0),a=null),u.patchFlag===-2&&(_=!1,u.dynamicChildren=null);const{type:y,ref:A,shapeFlag:E}=u;switch(y){case _n:ee(a,u,h,b);break;case Fe:D(a,u,h,b);break;case Mn:a==null&&k(u,h,b,v);break;case fe:Ht(a,u,h,b,g,m,v,w,_);break;default:E&1?J(a,u,h,b,g,m,v,w,_):E&6?$t(a,u,h,b,g,m,v,w,_):(E&64||E&128)&&y.process(a,u,h,b,g,m,v,w,_,_t)}A!=null&&g?Rt(A,a&&a.ref,m,u||a,!u):A==null&&a&&a.ref!=null&&Rt(a.ref,null,m,a,!0)},ee=(a,u,h,b)=>{if(a==null)s(u.el=l(u.children),h,b);else{const g=u.el=a.el;u.children!==a.children&&d(g,u.children)}},D=(a,u,h,b)=>{a==null?s(u.el=c(u.children||""),h,b):u.el=a.el},k=(a,u,h,b)=>{[a.el,a.anchor]=C(a.children,u,h,b,a.el,a.anchor)},W=({el:a,anchor:u},h,b)=>{let g;for(;a&&a!==u;)g=S(a),s(a,h,b),a=g;s(u,h,b)},O=({el:a,anchor:u})=>{let h;for(;a&&a!==u;)h=S(a),r(a),a=h;r(u)},J=(a,u,h,b,g,m,v,w,_)=>{u.type==="svg"?v="svg":u.type==="math"&&(v="mathml"),a==null?Le(u,h,b,g,m,v,w,_):Kt(a,u,g,m,v,w,_)},Le=(a,u,h,b,g,m,v,w)=>{let _,y;const{props:A,shapeFlag:E,transition:T,dirs:I}=a;if(_=a.el=o(a.type,m,A&&A.is,A),E&8?f(_,a.children):E&16&&je(a.children,_,null,b,g,In(a,m),v,w),I&&ze(a,null,b,"created"),me(_,a,a.scopeId,v,b),A){for(const H in A)H!=="value"&&!xt(H)&&i(_,H,null,A[H],m,b);"value"in A&&i(_,"value",null,A.value,m),(y=A.onVnodeBeforeMount)&&ve(y,b,a)}I&&ze(a,null,b,"beforeMount");const M=Zo(g,T);M&&T.beforeEnter(_),s(_,u,h),((y=A&&A.onVnodeMounted)||M||I)&&ae(()=>{y&&ve(y,b,a),M&&T.enter(_),I&&ze(a,null,b,"mounted")},g)},me=(a,u,h,b,g)=>{if(h&&x(a,h),b)for(let m=0;m<b.length;m++)x(a,b[m]);if(g){let m=g.subTree;if(u===m||ri(m.type)&&(m.ssContent===u||m.ssFallback===u)){const v=g.vnode;me(a,v,v.scopeId,v.slotScopeIds,g.parent)}}},je=(a,u,h,b,g,m,v,w,_=0)=>{for(let y=_;y<a.length;y++){const A=a[y]=w?He(a[y]):Ee(a[y]);N(null,A,u,h,b,g,m,v,w)}},Kt=(a,u,h,b,g,m,v)=>{const w=u.el=a.el;let{patchFlag:_,dynamicChildren:y,dirs:A}=u;_|=a.patchFlag&16;const E=a.props||j,T=u.props||j;let I;if(h&&Xe(h,!1),(I=T.onVnodeBeforeUpdate)&&ve(I,h,u,a),A&&ze(u,a,h,"beforeUpdate"),h&&Xe(h,!0),(E.innerHTML&&T.innerHTML==null||E.textContent&&T.textContent==null)&&f(w,""),y?Je(a.dynamicChildren,y,w,h,b,In(u,g),m):v||K(a,u,w,null,h,b,In(u,g),m,!1),_>0){if(_&16)bt(w,E,T,h,g);else if(_&2&&E.class!==T.class&&i(w,"class",null,T.class,g),_&4&&i(w,"style",E.style,T.style,g),_&8){const M=u.dynamicProps;for(let H=0;H<M.length;H++){const L=M[H],oe=E[L],le=T[L];(le!==oe||L==="value")&&i(w,L,oe,le,g,h)}}_&1&&a.children!==u.children&&f(w,u.children)}else!v&&y==null&&bt(w,E,T,h,g);((I=T.onVnodeUpdated)||A)&&ae(()=>{I&&ve(I,h,u,a),A&&ze(u,a,h,"updated")},b)},Je=(a,u,h,b,g,m,v)=>{for(let w=0;w<u.length;w++){const _=a[w],y=u[w],A=_.el&&(_.type===fe||!St(_,y)||_.shapeFlag&198)?p(_.el):h;N(_,y,A,null,b,g,m,v,!0)}},bt=(a,u,h,b,g)=>{if(u!==h){if(u!==j)for(const m in u)!xt(m)&&!(m in h)&&i(a,m,u[m],null,g,b);for(const m in h){if(xt(m))continue;const v=h[m],w=u[m];v!==w&&m!=="value"&&i(a,m,w,v,g,b)}"value"in h&&i(a,"value",u.value,h.value,g)}},Ht=(a,u,h,b,g,m,v,w,_)=>{const y=u.el=a?a.el:l(""),A=u.anchor=a?a.anchor:l("");let{patchFlag:E,dynamicChildren:T,slotScopeIds:I}=u;I&&(w=w?w.concat(I):I),a==null?(s(y,h,b),s(A,h,b),je(u.children||[],h,A,g,m,v,w,_)):E>0&&E&64&&T&&a.dynamicChildren?(Je(a.dynamicChildren,T,h,g,m,v,w),(u.key!=null||g&&u===g.subTree)&&Qr(a,u,!0)):K(a,u,h,A,g,m,v,w,_)},$t=(a,u,h,b,g,m,v,w,_)=>{u.slotScopeIds=w,a==null?u.shapeFlag&512?g.ctx.activate(u,h,b,v,_):Sn(u,h,b,g,m,v,_):bs(a,u,_)},Sn=(a,u,h,b,g,m,v)=>{const w=a.component=yl(a,b,g);if(jr(a)&&(w.ctx.renderer=_t),_l(w,!1,v),w.asyncDep){if(g&&g.registerDep(w,te,v),!a.el){const _=w.subTree=Ae(Fe);D(null,_,u,h),a.placeholder=_.el}}else te(w,a,u,h,g,m,v)},bs=(a,u,h)=>{const b=u.component=a.component;if(cl(a,u,h))if(b.asyncDep&&!b.asyncResolved){B(b,u,h);return}else b.next=u,b.update();else u.el=a.el,b.vnode=u},te=(a,u,h,b,g,m,v)=>{const w=()=>{if(a.isMounted){let{next:E,bu:T,u:I,parent:M,vnode:H}=a;{const _e=ei(a);if(_e){E&&(E.el=H.el,B(a,E,v)),_e.asyncDep.then(()=>{a.isUnmounted||w()});return}}let L=E,oe;Xe(a,!1),E?(E.el=H.el,B(a,E,v)):E=H,T&&Yt(T),(oe=E.props&&E.props.onVnodeBeforeUpdate)&&ve(oe,M,E,H),Xe(a,!0);const le=Fs(a),ye=a.subTree;a.subTree=le,N(ye,le,p(ye.el),Vt(ye),a,g,m),E.el=le.el,L===null&&al(a,le.el),I&&ae(I,g),(oe=E.props&&E.props.onVnodeUpdated)&&ae(()=>ve(oe,M,E,H),g)}else{let E;const{el:T,props:I}=u,{bm:M,m:H,parent:L,root:oe,type:le}=a,ye=dt(u);Xe(a,!1),M&&Yt(M),!ye&&(E=I&&I.onVnodeBeforeMount)&&ve(E,L,u),Xe(a,!0);{oe.ce&&oe.ce._def.shadowRoot!==!1&&oe.ce._injectChildStyle(le);const _e=a.subTree=Fs(a);N(null,_e,h,b,a,g,m),u.el=_e.el}if(H&&ae(H,g),!ye&&(E=I&&I.onVnodeMounted)){const _e=u;ae(()=>ve(E,L,_e),g)}(u.shapeFlag&256||L&&dt(L.vnode)&&L.vnode.shapeFlag&256)&&a.a&&ae(a.a,g),a.isMounted=!0,u=h=b=null}};a.scope.on();const _=a.effect=new gr(w);a.scope.off();const y=a.update=_.run.bind(_),A=a.job=_.runIfDirty.bind(_);A.i=a,A.id=a.uid,_.scheduler=()=>us(A),Xe(a,!0),y()},B=(a,u,h)=>{u.component=a;const b=a.vnode.props;a.vnode=u,a.next=null,Wo(a,u.props,b,h),Yo(a,u.children,h),Ne(),Rs(a),De()},K=(a,u,h,b,g,m,v,w,_=!1)=>{const y=a&&a.children,A=a?a.shapeFlag:0,E=u.children,{patchFlag:T,shapeFlag:I}=u;if(T>0){if(T&128){kt(y,E,h,b,g,m,v,w,_);return}else if(T&256){Ge(y,E,h,b,g,m,v,w,_);return}}I&8?(A&16&&yt(y,g,m),E!==y&&f(h,E)):A&16?I&16?kt(y,E,h,b,g,m,v,w,_):yt(y,g,m,!0):(A&8&&f(h,""),I&16&&je(E,h,b,g,m,v,w,_))},Ge=(a,u,h,b,g,m,v,w,_)=>{a=a||ct,u=u||ct;const y=a.length,A=u.length,E=Math.min(y,A);let T;for(T=0;T<E;T++){const I=u[T]=_?He(u[T]):Ee(u[T]);N(a[T],I,h,null,g,m,v,w,_)}y>A?yt(a,g,m,!0,!1,E):je(u,h,b,g,m,v,w,_,E)},kt=(a,u,h,b,g,m,v,w,_)=>{let y=0;const A=u.length;let E=a.length-1,T=A-1;for(;y<=E&&y<=T;){const I=a[y],M=u[y]=_?He(u[y]):Ee(u[y]);if(St(I,M))N(I,M,h,null,g,m,v,w,_);else break;y++}for(;y<=E&&y<=T;){const I=a[E],M=u[T]=_?He(u[T]):Ee(u[T]);if(St(I,M))N(I,M,h,null,g,m,v,w,_);else break;E--,T--}if(y>E){if(y<=T){const I=T+1,M=I<A?u[I].el:b;for(;y<=T;)N(null,u[y]=_?He(u[y]):Ee(u[y]),h,M,g,m,v,w,_),y++}}else if(y>T)for(;y<=E;)be(a[y],g,m,!0),y++;else{const I=y,M=y,H=new Map;for(y=M;y<=T;y++){const ce=u[y]=_?He(u[y]):Ee(u[y]);ce.key!=null&&H.set(ce.key,y)}let L,oe=0;const le=T-M+1;let ye=!1,_e=0;const wt=new Array(le);for(y=0;y<le;y++)wt[y]=0;for(y=I;y<=E;y++){const ce=a[y];if(oe>=le){be(ce,g,m,!0);continue}let we;if(ce.key!=null)we=H.get(ce.key);else for(L=M;L<=T;L++)if(wt[L-M]===0&&St(ce,u[L])){we=L;break}we===void 0?be(ce,g,m,!0):(wt[we-M]=y+1,we>=_e?_e=we:ye=!0,N(ce,u[we],h,null,g,m,v,w,_),oe++)}const ws=ye?Qo(wt):ct;for(L=ws.length-1,y=le-1;y>=0;y--){const ce=M+y,we=u[ce],vs=u[ce+1],Ss=ce+1<A?vs.el||vs.placeholder:b;wt[y]===0?N(null,we,h,Ss,g,m,v,w,_):ye&&(L<0||y!==ws[L]?Ye(we,h,Ss,2):L--)}}},Ye=(a,u,h,b,g=null)=>{const{el:m,type:v,transition:w,children:_,shapeFlag:y}=a;if(y&6){Ye(a.component.subTree,u,h,b);return}if(y&128){a.suspense.move(u,h,b);return}if(y&64){v.move(a,u,h,_t);return}if(v===fe){s(m,u,h);for(let E=0;E<_.length;E++)Ye(_[E],u,h,b);s(a.anchor,u,h);return}if(v===Mn){W(a,u,h);return}if(b!==2&&y&1&&w)if(b===0)w.beforeEnter(m),s(m,u,h),ae(()=>w.enter(m),g);else{const{leave:E,delayLeave:T,afterLeave:I}=w,M=()=>{a.ctx.isUnmounted?r(m):s(m,u,h)},H=()=>{m._isLeaving&&m[vo](!0),E(m,()=>{M(),I&&I()})};T?T(m,M,H):H()}else s(m,u,h)},be=(a,u,h,b=!1,g=!1)=>{const{type:m,props:v,ref:w,children:_,dynamicChildren:y,shapeFlag:A,patchFlag:E,dirs:T,cacheIndex:I}=a;if(E===-2&&(g=!1),w!=null&&(Ne(),Rt(w,null,h,a,!0),De()),I!=null&&(u.renderCache[I]=void 0),A&256){u.ctx.deactivate(a);return}const M=A&1&&T,H=!dt(a);let L;if(H&&(L=v&&v.onVnodeBeforeUnmount)&&ve(L,u,a),A&6)Ei(a.component,h,b);else{if(A&128){a.suspense.unmount(h,b);return}M&&ze(a,null,u,"beforeUnmount"),A&64?a.type.remove(a,u,h,_t,b):y&&!y.hasOnce&&(m!==fe||E>0&&E&64)?yt(y,u,h,!1,!0):(m===fe&&E&384||!g&&A&16)&&yt(_,u,h),b&&ys(a)}(H&&(L=v&&v.onVnodeUnmounted)||M)&&ae(()=>{L&&ve(L,u,a),M&&ze(a,null,u,"unmounted")},h)},ys=a=>{const{type:u,el:h,anchor:b,transition:g}=a;if(u===fe){Si(h,b);return}if(u===Mn){O(a);return}const m=()=>{r(h),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(a.shapeFlag&1&&g&&!g.persisted){const{leave:v,delayLeave:w}=g,_=()=>v(h,m);w?w(a.el,m,_):_()}else m()},Si=(a,u)=>{let h;for(;a!==u;)h=S(a),r(a),a=h;r(u)},Ei=(a,u,h)=>{const{bum:b,scope:g,job:m,subTree:v,um:w,m:_,a:y}=a;Ds(_),Ds(y),b&&Yt(b),g.stop(),m&&(m.flags|=8,be(v,a,u,h)),w&&ae(w,u),ae(()=>{a.isUnmounted=!0},u)},yt=(a,u,h,b=!1,g=!1,m=0)=>{for(let v=m;v<a.length;v++)be(a[v],u,h,b,g)},Vt=a=>{if(a.shapeFlag&6)return Vt(a.component.subTree);if(a.shapeFlag&128)return a.suspense.next();const u=S(a.anchor||a.el),h=u&&u[_o];return h?S(h):u};let En=!1;const _s=(a,u,h)=>{a==null?u._vnode&&be(u._vnode,null,null,!0):N(u._vnode||null,a,u,null,null,null,h),u._vnode=a,En||(En=!0,Rs(),Dr(),En=!1)},_t={p:N,um:be,m:Ye,r:ys,mt:Sn,mc:je,pc:K,pbc:Je,n:Vt,o:e};return{render:_s,hydrate:void 0,createApp:ko(_s)}}function In({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Xe({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Zo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Qr(e,t,n=!1){const s=e.children,r=t.children;if(R(s)&&R(r))for(let i=0;i<s.length;i++){const o=s[i];let l=r[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=r[i]=He(r[i]),l.el=o.el),!n&&l.patchFlag!==-2&&Qr(o,l)),l.type===_n&&l.patchFlag!==-1&&(l.el=o.el),l.type===Fe&&!l.el&&(l.el=o.el)}}function Qo(e){const t=e.slice(),n=[0];let s,r,i,o,l;const c=e.length;for(s=0;s<c;s++){const d=e[s];if(d!==0){if(r=n[n.length-1],e[r]<d){t[s]=r,n.push(s);continue}for(i=0,o=n.length-1;i<o;)l=i+o>>1,e[n[l]]<d?i=l+1:o=l;d<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function ei(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ei(t)}function Ds(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const el=Symbol.for("v-scx"),tl=()=>zt(el);function Pn(e,t,n){return ti(e,t,n)}function ti(e,t,n=j){const{immediate:s,deep:r,flush:i,once:o}=n,l=ie({},n),c=t&&s||!t&&i!=="post";let d;if(Ft){if(i==="sync"){const x=tl();d=x.__watcherHandles||(x.__watcherHandles=[])}else if(!c){const x=()=>{};return x.stop=Te,x.resume=Te,x.pause=Te,x}}const f=re;l.call=(x,C,N)=>Re(x,f,C,N);let p=!1;i==="post"?l.scheduler=x=>{ae(x,f&&f.suspense)}:i!=="sync"&&(p=!0,l.scheduler=(x,C)=>{C?x():us(x)}),l.augmentJob=x=>{t&&(x.flags|=4),p&&(x.flags|=2,f&&(x.id=f.uid,x.i=f))};const S=po(e,t,l);return Ft&&(d?d.push(S):c&&S()),S}function nl(e,t,n){const s=this.proxy,r=q(e)?e.includes(".")?ni(s,e):()=>s[e]:e.bind(s,s);let i;P(t)?i=t:(i=t.handler,n=t);const o=jt(this),l=ti(r,i.bind(s),n);return o(),l}function ni(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const sl=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ve(t)}Modifiers`]||e[`${qe(t)}Modifiers`];function rl(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||j;let r=n;const i=t.startsWith("update:"),o=i&&sl(s,t.slice(7));o&&(o.trim&&(r=n.map(f=>q(f)?f.trim():f)),o.number&&(r=n.map(tn)));let l,c=s[l=xn(t)]||s[l=xn(Ve(t))];!c&&i&&(c=s[l=xn(qe(t))]),c&&Re(c,e,6,r);const d=s[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Re(d,e,6,r)}}const il=new WeakMap;function si(e,t,n=!1){const s=n?il:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!P(e)){const c=d=>{const f=si(d,t,!0);f&&(l=!0,ie(o,f))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(V(e)&&s.set(e,null),null):(R(i)?i.forEach(c=>o[c]=null):ie(o,i),V(e)&&s.set(e,o),o)}function yn(e,t){return!e||!dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),U(e,t[0].toLowerCase()+t.slice(1))||U(e,qe(t))||U(e,t))}function Fs(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:c,render:d,renderCache:f,props:p,data:S,setupState:x,ctx:C,inheritAttrs:N}=e,ee=ln(e);let D,k;try{if(n.shapeFlag&4){const O=r||s,J=O;D=Ee(d.call(J,O,f,p,x,S,C)),k=l}else{const O=t;D=Ee(O.length>1?O(p,{attrs:l,slots:o,emit:c}):O(p,null)),k=t.props?l:ol(l)}}catch(O){Ot.length=0,mn(O,e,1),D=Ae(Fe)}let W=D;if(k&&N!==!1){const O=Object.keys(k),{shapeFlag:J}=W;O.length&&J&7&&(i&&O.some(zn)&&(k=ll(k,i)),W=ht(W,k,!1,!0))}return n.dirs&&(W=ht(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(n.dirs):n.dirs),n.transition&&fs(W,n.transition),D=W,ln(ee),D}const ol=e=>{let t;for(const n in e)(n==="class"||n==="style"||dn(n))&&((t||(t={}))[n]=e[n]);return t},ll=(e,t)=>{const n={};for(const s in e)(!zn(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function cl(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,d=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?Us(s,o,d):!!o;if(c&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const S=f[p];if(o[S]!==s[S]&&!yn(d,S))return!0}}}else return(r||l)&&(!l||!l.$stable)?!0:s===o?!1:s?o?Us(s,o,d):!0:!!o;return!1}function Us(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const i=s[r];if(t[i]!==e[i]&&!yn(n,i))return!0}return!1}function al({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s===e)(e=t.vnode).el=n,t=t.parent;else break}}const ri=e=>e.__isSuspense;function ul(e,t){t&&t.pendingBranch?R(e)?t.effects.push(...e):t.effects.push(e):bo(e)}const fe=Symbol.for("v-fgt"),_n=Symbol.for("v-txt"),Fe=Symbol.for("v-cmt"),Mn=Symbol.for("v-stc"),Ot=[];let ue=null;function Bn(e=!1){Ot.push(ue=e?null:[])}function fl(){Ot.pop(),ue=Ot[Ot.length-1]||null}let Dt=1;function Ls(e,t=!1){Dt+=e,e<0&&ue&&t&&(ue.hasOnce=!0)}function ii(e){return e.dynamicChildren=Dt>0?ue||ct:null,fl(),Dt>0&&ue&&ue.push(e),e}function Bc(e,t,n,s,r,i){return ii(li(e,t,n,s,r,i,!0))}function Wn(e,t,n,s,r){return ii(Ae(e,t,n,s,r,!0))}function ps(e){return e?e.__v_isVNode===!0:!1}function St(e,t){return e.type===t.type&&e.key===t.key}const oi=({key:e})=>e??null,Xt=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?q(e)||z(e)||P(e)?{i:Q,r:e,k:t,f:!!n}:e:null);function li(e,t=null,n=null,s=0,r=null,i=e===fe?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&oi(t),ref:t&&Xt(t),scopeId:Ur,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Q};return l?(gs(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=q(n)?8:16),Dt>0&&!o&&ue&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&ue.push(c),c}const Ae=dl;function dl(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Do)&&(e=Fe),ps(e)){const l=ht(e,t,!0);return n&&gs(l,n),Dt>0&&!i&&ue&&(l.shapeFlag&6?ue[ue.indexOf(e)]=l:ue.push(l)),l.patchFlag=-2,l}if(El(e)&&(e=e.__vccOpts),t){t=hl(t);let{class:l,style:c}=t;l&&!q(l)&&(t.class=es(l)),V(c)&&(as(c)&&!R(c)&&(c=ie({},c)),t.style=Qn(c))}const o=q(e)?1:ri(e)?128:wo(e)?64:V(e)?4:P(e)?2:0;return li(e,t,n,s,r,o,i,!0)}function hl(e){return e?as(e)||Jr(e)?ie({},e):e:null}function ht(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:c}=e,d=t?gl(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&oi(d),ref:t&&t.ref?n&&i?R(i)?i.concat(Xt(t)):[i,Xt(t)]:Xt(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==fe?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ht(e.ssContent),ssFallback:e.ssFallback&&ht(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&fs(f,c.clone(f)),f}function pl(e=" ",t=0){return Ae(_n,null,e,t)}function Wc(e="",t=!1){return t?(Bn(),Wn(Fe,null,e)):Ae(Fe,null,e)}function Ee(e){return e==null||typeof e=="boolean"?Ae(Fe):R(e)?Ae(fe,null,e.slice()):ps(e)?He(e):Ae(_n,null,String(e))}function He(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ht(e)}function gs(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(R(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),gs(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Jr(t)?t._ctx=Q:r===3&&Q&&(Q.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else P(t)?(t={default:t,_ctx:Q},n=32):(t=String(t),s&64?(n=16,t=[pl(t)]):n=8);e.children=t,e.shapeFlag|=n}function gl(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=es([t.class,s.class]));else if(r==="style")t.style=Qn([t.style,s.style]);else if(dn(r)){const i=t[r],o=s[r];o&&i!==o&&!(R(i)&&i.includes(o))&&(t[r]=i?[].concat(i,o):o)}else r!==""&&(t[r]=s[r])}return t}function ve(e,t,n,s=null){Re(e,t,7,[n,s])}const ml=Br();let bl=0;function yl(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||ml,i={uid:bl++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new pr(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Yr(s,r),emitsOptions:si(s,r),emit:null,emitted:null,propsDefaults:j,inheritAttrs:s.inheritAttrs,ctx:j,data:j,props:j,attrs:j,slots:j,refs:j,setupState:j,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=rl.bind(null,i),e.ce&&e.ce(i),i}let re=null;const ci=()=>re||Q;let un,qn;{const e=pn(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};un=t("__VUE_INSTANCE_SETTERS__",n=>re=n),qn=t("__VUE_SSR_SETTERS__",n=>Ft=n)}const jt=e=>{const t=re;return un(e),e.scope.on(),()=>{e.scope.off(),un(t)}},js=()=>{re&&re.scope.off(),un(null)};function ai(e){return e.vnode.shapeFlag&4}let Ft=!1;function _l(e,t=!1,n=!1){t&&qn(t);const{props:s,children:r}=e.vnode,i=ai(e);Bo(e,s,i,t),Go(e,r,n||t);const o=i?wl(e,t):void 0;return t&&qn(!1),o}function wl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Fo);const{setup:s}=n;if(s){Ne();const r=e.setupContext=s.length>1?Sl(e):null,i=jt(e),o=Lt(s,e,0,[e.props,r]),l=or(o);if(De(),i(),(l||e.sp)&&!dt(e)&&Lr(e),l){if(o.then(js,js),t)return o.then(c=>{Ks(e,c)}).catch(c=>{mn(c,e,0)});e.asyncDep=o}else Ks(e,o)}else ui(e)}function Ks(e,t,n){P(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:V(t)&&(e.setupState=Ir(t)),ui(e)}function ui(e,t,n){const s=e.type;e.render||(e.render=s.render||Te);{const r=jt(e);Ne();try{Uo(e)}finally{De(),r()}}}const vl={get(e,t){return Z(e,"get",""),e[t]}};function Sl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,vl),slots:e.slots,emit:e.emit,expose:t}}function wn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ir(so(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ct)return Ct[n](e)},has(t,n){return n in t||n in Ct}})):e.proxy}function El(e){return P(e)&&"__vccOpts"in e}const xl=(e,t)=>fo(e,t,Ft),Tl="3.5.21";/**
14
- * @vue/runtime-dom v3.5.21
15
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
- * @license MIT
17
- **/let Jn;const Hs=typeof window<"u"&&window.trustedTypes;if(Hs)try{Jn=Hs.createPolicy("vue",{createHTML:e=>e})}catch{}const fi=Jn?e=>Jn.createHTML(e):e=>e,Al="http://www.w3.org/2000/svg",Rl="http://www.w3.org/1998/Math/MathML",Oe=typeof document<"u"?document:null,$s=Oe&&Oe.createElement("template"),Cl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Oe.createElementNS(Al,e):t==="mathml"?Oe.createElementNS(Rl,e):n?Oe.createElement(e,{is:n}):Oe.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Oe.createTextNode(e),createComment:e=>Oe.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Oe.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{$s.innerHTML=fi(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=$s.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ol=Symbol("_vtc");function Il(e,t,n){const s=e[Ol];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ks=Symbol("_vod"),Pl=Symbol("_vsh"),Ml=Symbol(""),Nl=/(?:^|;)\s*display\s*:/;function Dl(e,t,n){const s=e.style,r=q(n);let i=!1;if(n&&!r){if(t)if(q(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&Zt(s,l,"")}else for(const o in t)n[o]==null&&Zt(s,o,"");for(const o in n)o==="display"&&(i=!0),Zt(s,o,n[o])}else if(r){if(t!==n){const o=s[Ml];o&&(n+=";"+o),s.cssText=n,i=Nl.test(n)}}else t&&e.removeAttribute("style");ks in e&&(e[ks]=i?s.display:"",e[Pl]&&(s.display="none"))}const Vs=/\s*!important$/;function Zt(e,t,n){if(R(n))n.forEach(s=>Zt(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Fl(e,t);Vs.test(n)?e.setProperty(qe(s),n.replace(Vs,""),"important"):e[s]=n}}const Bs=["Webkit","Moz","ms"],Nn={};function Fl(e,t){const n=Nn[t];if(n)return n;let s=Ve(t);if(s!=="filter"&&s in e)return Nn[t]=s;s=ar(s);for(let r=0;r<Bs.length;r++){const i=Bs[r]+s;if(i in e)return Nn[t]=i}return t}const Ws="http://www.w3.org/1999/xlink";function qs(e,t,n,s,r,i=Ni(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ws,t.slice(6,t.length)):e.setAttributeNS(Ws,t,n):n==null||i&&!fr(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ge(n)?String(n):n)}function Js(e,t,n,s,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?fi(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=fr(n):n==null&&l==="string"?(n="",o=!0):l==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(r||t)}function Me(e,t,n,s){e.addEventListener(t,n,s)}function Ul(e,t,n,s){e.removeEventListener(t,n,s)}const Gs=Symbol("_vei");function Ll(e,t,n,s,r=null){const i=e[Gs]||(e[Gs]={}),o=i[t];if(s&&o)o.value=s;else{const[l,c]=jl(t);if(s){const d=i[t]=$l(s,r);Me(e,l,d,c)}else o&&(Ul(e,l,o,c),i[t]=void 0)}}const Ys=/(?:Once|Passive|Capture)$/;function jl(e){let t;if(Ys.test(e)){t={};let s;for(;s=e.match(Ys);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):qe(e.slice(2)),t]}let Dn=0;const Kl=Promise.resolve(),Hl=()=>Dn||(Kl.then(()=>Dn=0),Dn=Date.now());function $l(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Re(kl(s,n.value),t,5,[s])};return n.value=e,n.attached=Hl(),n}function kl(e,t){if(R(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const zs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Vl=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?Il(e,s,o):t==="style"?Dl(e,n,s):dn(t)?zn(t)||Ll(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Bl(e,t,s,o))?(Js(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&qs(e,t,s,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!q(s))?Js(e,Ve(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),qs(e,t,s,o))};function Bl(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&zs(t)&&P(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return zs(t)&&q(n)?!1:t in e}const We=e=>{const t=e.props["onUpdate:modelValue"]||!1;return R(t)?n=>Yt(t,n):t};function Wl(e){e.target.composing=!0}function Xs(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const he=Symbol("_assign"),Zs={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[he]=We(r);const i=s||r.props&&r.props.type==="number";Me(e,t?"change":"input",o=>{if(o.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=tn(l)),e[he](l)}),n&&Me(e,"change",()=>{e.value=e.value.trim()}),t||(Me(e,"compositionstart",Wl),Me(e,"compositionend",Xs),Me(e,"change",Xs))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[he]=We(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?tn(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===c)||(e.value=c))}},ql={deep:!0,created(e,t,n){e[he]=We(n),Me(e,"change",()=>{const s=e._modelValue,r=pt(e),i=e.checked,o=e[he];if(R(s)){const l=ts(s,r),c=l!==-1;if(i&&!c)o(s.concat(r));else if(!i&&c){const d=[...s];d.splice(l,1),o(d)}}else if(mt(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(di(e,i))})},mounted:Qs,beforeUpdate(e,t,n){e[he]=We(n),Qs(e,t,n)}};function Qs(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(R(t))r=ts(t,s.props.value)>-1;else if(mt(t))r=t.has(s.props.value);else{if(t===n)return;r=st(t,di(e,!0))}e.checked!==r&&(e.checked=r)}const Jl={created(e,{value:t},n){e.checked=st(t,n.props.value),e[he]=We(n),Me(e,"change",()=>{e[he](pt(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[he]=We(s),t!==n&&(e.checked=st(t,s.props.value))}},Gl={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=mt(t);Me(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?tn(pt(o)):pt(o));e[he](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,Mr(()=>{e._assigning=!1})}),e[he]=We(s)},mounted(e,{value:t}){er(e,t)},beforeUpdate(e,t,n){e[he]=We(n)},updated(e,{value:t}){e._assigning||er(e,t)}};function er(e,t){const n=e.multiple,s=R(t);if(!(n&&!s&&!mt(t))){for(let r=0,i=e.options.length;r<i;r++){const o=e.options[r],l=pt(o);if(n)if(s){const c=typeof l;c==="string"||c==="number"?o.selected=t.some(d=>String(d)===String(l)):o.selected=ts(t,l)>-1}else o.selected=t.has(l);else if(st(pt(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function pt(e){return"_value"in e?e._value:e.value}function di(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const qc={created(e,t,n){Jt(e,t,n,null,"created")},mounted(e,t,n){Jt(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Jt(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Jt(e,t,n,s,"updated")}};function Yl(e,t){switch(e){case"SELECT":return Gl;case"TEXTAREA":return Zs;default:switch(t){case"checkbox":return ql;case"radio":return Jl;default:return Zs}}}function Jt(e,t,n,s,r){const o=Yl(e.tagName,n.props&&n.props.type)[r];o&&o(e,t,n,s)}const zl=["ctrl","shift","alt","meta"],Xl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>zl.some(n=>e[`${n}Key`]&&!t.includes(n))},Jc=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...i)=>{for(let o=0;o<t.length;o++){const l=Xl[t[o]];if(l&&l(r,t))return}return e(r,...i)}))},Zl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Gc=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(r=>{if(!("key"in r))return;const i=qe(r.key);if(t.some(o=>o===i||Zl[o]===i))return e(r)}))},Ql=ie({patchProp:Vl},Cl);let tr;function ec(){return tr||(tr=zo(Ql))}const Yc=((...e)=>{const t=ec().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=nc(s);if(!r)return;const i=t._component;!P(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,tc(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function tc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function nc(e){return q(e)?document.querySelector(e):e}function xe(e){const t=new Uint8Array(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function fn(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,s=t.padEnd(t.length+n,"="),r=atob(s),i=new ArrayBuffer(r.length),o=new Uint8Array(i);for(let l=0;l<r.length;l++)o[l]=r.charCodeAt(l);return i}function ms(){return sc.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const sc={stubThis:e=>e};function hi(e){const{id:t}=e;return{...e,id:fn(t),transports:e.transports}}function pi(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}class G extends Error{constructor({message:t,code:n,cause:s,name:r}){super(t,{cause:s}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??s.name,this.code=n}}function rc({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new G({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===!0)return new G({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&n.authenticatorSelection?.userVerification==="required")return new G({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(n.authenticatorSelection?.userVerification==="required")return new G({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new G({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new G({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return n.pubKeyCredParams.filter(r=>r.type==="public-key").length===0?new G({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new G({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const s=globalThis.location.hostname;if(pi(s)){if(n.rp.id!==s)return new G({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new G({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new G({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new G({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}class ic{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const gi=new ic,oc=["cross-platform","platform"];function mi(e){if(e&&!(oc.indexOf(e)<0))return e}async function lc(e){!e.optionsJSON&&e.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});const{optionsJSON:t,useAutoRegister:n=!1}=e;if(!ms())throw new Error("WebAuthn is not supported in this browser");const s={...t,challenge:fn(t.challenge),user:{...t.user,id:fn(t.user.id)},excludeCredentials:t.excludeCredentials?.map(hi)},r={};n&&(r.mediation="conditional"),r.publicKey=s,r.signal=gi.createNewAbortSignal();let i;try{i=await navigator.credentials.create(r)}catch(C){throw rc({error:C,options:r})}if(!i)throw new Error("Registration was not completed");const{id:o,rawId:l,response:c,type:d}=i;let f;typeof c.getTransports=="function"&&(f=c.getTransports());let p;if(typeof c.getPublicKeyAlgorithm=="function")try{p=c.getPublicKeyAlgorithm()}catch(C){Fn("getPublicKeyAlgorithm()",C)}let S;if(typeof c.getPublicKey=="function")try{const C=c.getPublicKey();C!==null&&(S=xe(C))}catch(C){Fn("getPublicKey()",C)}let x;if(typeof c.getAuthenticatorData=="function")try{x=xe(c.getAuthenticatorData())}catch(C){Fn("getAuthenticatorData()",C)}return{id:o,rawId:xe(l),response:{attestationObject:xe(c.attestationObject),clientDataJSON:xe(c.clientDataJSON),transports:f,publicKeyAlgorithm:p,publicKey:S,authenticatorData:x},type:d,clientExtensionResults:i.getClientExtensionResults(),authenticatorAttachment:mi(i.authenticatorAttachment)}}function Fn(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
18
- `,t)}function cc(){if(!ms())return Un.stubThis(new Promise(t=>t(!1)));const e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Un.stubThis(new Promise(t=>t(!1))):Un.stubThis(e.isConditionalMediationAvailable())}const Un={stubThis:e=>e};function ac({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new G({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new G({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=globalThis.location.hostname;if(pi(s)){if(n.rpId!==s)return new G({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new G({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new G({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}async function uc(e){!e.optionsJSON&&e.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});const{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:s=!0}=e;if(!ms())throw new Error("WebAuthn is not supported in this browser");let r;t.allowCredentials?.length!==0&&(r=t.allowCredentials?.map(hi));const i={...t,challenge:fn(t.challenge),allowCredentials:r},o={};if(n){if(!await cc())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&s)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation="conditional",i.allowCredentials=[]}o.publicKey=i,o.signal=gi.createNewAbortSignal();let l;try{l=await navigator.credentials.get(o)}catch(x){throw ac({error:x,options:o})}if(!l)throw new Error("Authentication was not completed");const{id:c,rawId:d,response:f,type:p}=l;let S;return f.userHandle&&(S=xe(f.userHandle)),{id:c,rawId:xe(d),response:{authenticatorData:xe(f.authenticatorData),clientDataJSON:xe(f.clientDataJSON),signature:xe(f.signature),userHandle:S},type:p,clientExtensionResults:l.getClientExtensionResults(),authenticatorAttachment:mi(l.authenticatorAttachment)}}class fc extends WebSocket{#n=[];#e=[];#t=null;#s=!1;constructor(t,n,s,r,i){super(new URL(s,document.baseURI.replace(/^http/,"ws")),r),this.binaryType=i||"blob",this.onopen=()=>{this.#s=!0,t(this)},this.onmessage=o=>{this.#e.length?this.#e.shift().resolve(o.data):this.#n.push(o.data)},this.onclose=o=>{if(!this.#s){n(new Error(`Failed to connect to server (code ${o.code})`));return}let l;if(o.wasClean)switch(o.code){case 1e3:l="Connection closed normally";break;case 1001:l="Server is going away";break;case 1002:l="Protocol error";break;case 1003:l="Unsupported data received";break;case 1006:l="Connection lost unexpectedly";break;case 1007:l="Invalid data received";break;case 1008:l="Policy violation";break;case 1009:l="Message too large";break;case 1010:l="Extension negotiation failed";break;case 1011:l="Server encountered an error";break;case 1012:l="Server is restarting";break;case 1013:l="Server is overloaded, try again later";break;case 1014:l="Bad gateway";break;case 1015:l="TLS handshake failed";break;default:l=`Connection closed (code ${o.code})`}else l=o.code===1006?"Connection lost unexpectedly":`Connection closed with error (code ${o.code})`;this.#t=new Error(l),this.#e.splice(0).forEach(c=>c.reject(this.#t))}}receive(){return this.#n.length?Promise.resolve(this.#n.shift()):this.#t?Promise.reject(this.#t):new Promise((t,n)=>this.#e.push({resolve:t,reject:n}))}async receive_bytes(){const t=await this.receive();if(typeof t=="string")throw console.error("WebSocket received text data, expected a binary message",t),new Error("WebSocket received text data, expected a binary message");return t instanceof Blob?t.bytes():new Uint8Array(t)}async receive_json(){const t=await this.receive();if(typeof t!="string")throw console.error("WebSocket received binary data, expected JSON string",t),new Error("WebSocket received binary data, expected JSON string");try{return JSON.parse(t)}catch(n){throw console.error("Failed to parse JSON from WebSocket message",t,n),new Error("Failed to parse JSON from WebSocket message")}}send_json(t){let n;try{n=JSON.stringify(t)}catch(s){throw new Error(`Failed to stringify data for WebSocket: ${s.message}`)}this.send(n)}}function bi(e,t={}){const{protocols:n,binaryType:s}=t;return new Promise((r,i)=>{new fc(r,i,e,n,s)})}let Gt=null,Qe=null;async function dc(){return Qe||Gt||(Gt=fetch("/auth/api/settings").then(e=>e.ok?e.json():{}).then(e=>(Qe=e||{},Qe)).catch(()=>(Qe={},Qe)),Gt)}function It(){const e=Qe?.ui_base_path||"/auth/";return e==="/"?"/":e.endsWith("/")?e:e+"/"}function zc(){return It()==="/"?"/admin/":It()+"admin/"}function Xc(e=""){const t=e.startsWith("/")?e.slice(1):e;return t?It()==="/"?"/"+t:It()+t:It()}const gt="paskia-iframe",nr="paskia-dialog",hc=`body::before {
19
- content: '';
20
- position: fixed;
21
- inset: 0;
22
- z-index: 1099;
23
- background: transparent;
24
- backdrop-filter: blur(0) brightness(1);
25
- -webkit-backdrop-filter: blur(0) brightness(1);
26
- pointer-events: none;
27
- visibility: hidden;
28
- transition: all 0.2s ease-out;
29
- }
30
- body.paskia-backdrop::before {
31
- -webkit-backdrop-filter: blur(.2rem) brightness(0.5);
32
- backdrop-filter: blur(.2rem) brightness(0.5);
33
- visibility: visible;
34
- }
35
- body.paskia-backdrop {
36
- overflow: auto;
37
- }
38
- #${gt} {
39
- border: none;
40
- position: fixed;
41
- top: 0;
42
- left: 0;
43
- width: 100%;
44
- height: 100%;
45
- z-index: 9999;
46
- color-scheme: auto;
47
- background: transparent;
48
- }
49
- `;let $e=null,et=null,ot=null,lt=null,sr=!1,Qt=0;function yi(){if(document.getElementById(nr))return;const e=document.createElement("style");e.id=nr,e.textContent=hc,document.head.insertBefore(e,document.head.firstChild)}class pc extends Error{constructor(){super("Authentication cancelled"),this.name="AuthCancelledError"}}function gc(){Qt++,document.body.classList.add("paskia-backdrop")}function mc(){Qt=Math.max(0,Qt-1),Qt===0&&document.body.classList.remove("paskia-backdrop")}function Gn(){$e&&($e.remove(),$e=null,mc())}function bc(e){const t=e.data;if(t?.type)switch(t.type){case"auth-success":Gn(),ot&&(ot(),et=null,ot=null,lt=null);break;case"auth-back":Gn(),lt&&(lt(new pc),et=null,ot=null,lt=null);break}}function yc(){sr||typeof window<"u"&&(window.addEventListener("message",bc),sr=!0)}function _i(e,t="Authentication"){return yi(),yc(),et||(document.getElementById(gt)?(et=new Promise((n,s)=>{ot=n,lt=s}),et):(et=new Promise((n,s)=>{ot=n,lt=s}),Gn(),gc(),$e=document.createElement("iframe"),$e.id=gt,$e.title=t,$e.src=e,document.body.appendChild($e),et))}function Zc(e,t="Authentication"){yi();const n=document.getElementById(gt);n&&n.remove();const s=document.createElement("iframe");return s.id=gt,s.title=t,s.src=e,document.body.appendChild(s),s}function Qc(){const e=document.getElementById(gt);e&&e.remove()}const _c=1e3;class wi extends Error{constructor(t,n,s){super(s?.detail||`Request failed: ${n.status}`),this.name="ApiError",this.url=t,this.status=n.status,this.statusText=n.statusText,this.data=s}}class en extends Error{constructor(t,n=null){super(t),this.name="NetworkError",this.originalError=n}}async function wc(e,t={}){const{timeout:n=_c,...s}=t;for(s.credentials=s.credentials||"include";;){let r;try{r=await fetch(e,{...s,signal:n?AbortSignal.timeout(n):void 0})}catch(i){const o=i;throw o.name==="TimeoutError"?new en("Request timed out",o):o.name==="AbortError"?i:o.name==="TypeError"&&o.message==="Failed to fetch"?new en("Unable to connect to server",o):new en(o.message||"Network error",o)}if(r.status===401||r.status===403){let i=null;try{i=await r.clone().json()}catch{}if(i?.auth?.iframe&&window===window.top){await _i(i.auth.iframe);continue}}return r}}async function vc(e,t={}){return Sc(e,t,wc)}async function Sc(e,t={},n=fetch){const s={Accept:"application/json",...t.headers};let r;t.body&&typeof t.body=="object"&&!(t.body instanceof FormData)?(s["Content-Type"]="application/json",r=JSON.stringify(t.body)):r=t.body;const i={...t,headers:s,body:r},o=await n(e,i),l=await o.json();if(!o.ok)throw new wi(e,o,l);return l}function ea(e){return e instanceof en||e instanceof wi?e.message:e.name==="TimeoutError"?"Request timed out":e.name==="TypeError"&&e.message==="Failed to fetch"?"Unable to connect to server":e.message||"An error occurred"}const Ec=60*1e3,xc=300*1e3;class ta{constructor(t,n){this.pollTimer=null,this.idleTimer=null,this.active=!1,this.userUuidGetter=t,this.onSessionLost=n,this.resetIdleTimer=this.resetIdleTimer.bind(this)}resetIdleTimer(){this.idleTimer&&clearTimeout(this.idleTimer),this.active||this.startPolling(),this.idleTimer=setTimeout(()=>this.stopPolling(),xc)}async validate(){try{(await vc("/auth/api/validate",{method:"POST"})).ctx?.user?.uuid!==this.userUuidGetter()&&window.location.reload()}catch(t){t.name!=="NetworkError"&&(this.stopPolling(),this.onSessionLost(t))}}startPolling(){this.active||(this.active=!0,this.pollTimer=setInterval(()=>this.validate(),Ec))}stopPolling(){this.active=!1,this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}start(){window.addEventListener("pointermove",this.resetIdleTimer),window.addEventListener("pointerdown",this.resetIdleTimer),this.resetIdleTimer()}stop(){window.removeEventListener("pointermove",this.resetIdleTimer),window.removeEventListener("pointerdown",this.resetIdleTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.stopPolling()}}async function vi(e){const n=(await dc())?.auth_host;return n&&location.host!==n?`//${n}${e}`:e}async function Tc(e=null,t=null,n=null){let s=[];e&&s.push(`reset=${encodeURIComponent(e)}`),t&&s.push(`name=${encodeURIComponent(t)}`);const r=s.length?`?${s.join("&")}`:"";for(;;){const i=await bi(await vi(`/auth/ws/register${r}`));try{const o=await i.receive_json();if((o.status===401||o.status===403)&&o.auth?.iframe){i.close(),await _i(o.auth.iframe);continue}if(o.status)throw new Error(o.detail||`Registration failed: ${o.status}`);n&&n();const l=await lc(o);i.send_json(l);const c=await i.receive_json();if(c.status)throw new Error(c.detail||`Registration failed: ${c.status}`);return c}catch(o){throw i.close(),console.error("Registration error:",o),Error(o.name==="NotAllowedError"?"Passkey registration cancelled":o.message)}}}async function Ac(){const e=await bi(await vi("/auth/ws/authenticate"));try{let t=await e.receive_json();if(t.status>=400)throw new Error(t.detail||`Authentication failed: ${t.status}`);const n=await uc(t);if(e.send_json(n),t=await e.receive_json(),t.status>=400)throw new Error(t.detail||`Authentication failed: ${t.status}`);return t}catch(t){throw console.error("Authentication error:",t),Error(t.name==="NotAllowedError"?"Passkey authentication cancelled":t.message)}finally{e.close()}}const na={authenticate:Ac,register:Tc},Rc={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},Cc=new Set(["text","email","password","search","tel","url","number"]),Oc=e=>{const t=Rc[e.key];if(!t)return null;const n=e.target;return(n.tagName==="INPUT"&&Cc.has(n.type)||n.tagName==="TEXTAREA")&&(t==="left"||t==="right")&&n.value!==""?null:t},vn=(e,t=null)=>{if(!e)return[];const n=t||e.dataset?.navItems||'button:not([disabled]), a, [tabindex="0"], [tabindex="-1"]:not([disabled])';return Array.from(e.querySelectorAll(n))},Ic=(e,t)=>{const n=vn(e,t);if(n.length===0)return null;const s=n[0].getBoundingClientRect().top;let r=0;for(const i of n)if(Math.abs(i.getBoundingClientRect().top-s)<5)r++;else break;return{items:n,cols:Math.max(1,r)}},Pc=(e,t,n,s={})=>{const r=vn(e,s.itemSelector);if(r.length===0)return"none";const i=r.indexOf(t);return i===-1?"none":n==="left"?i>0?(r[i-1].focus(),"moved"):"boundary":n==="right"&&i<r.length-1?(r[i+1].focus(),"moved"):"boundary"},sa=(e,t,n,s={})=>{const r=Ic(e,s.itemSelector);if(!r)return"none";const{items:i,cols:o}=r,l=i.indexOf(t);if(l===-1)return"none";const c=Math.floor(l/o),d=l%o;let f=l;switch(n){case"left":if(d===0)return"boundary";f=l-1;break;case"right":if(l>=i.length-1)return"boundary";f=l+1;break;case"up":if(c===0)return"boundary";f=l-o;break;case"down":if(l+o>=i.length)return"boundary";f=l+o;break;default:return"none"}return f!==l?(i[f].focus(),"moved"):"none"},ra=(e,t={})=>{if(!e)return null;const n=e.querySelector("[data-nav-primary]")||t.primarySelector&&e.querySelector(t.primarySelector);if(n)return n.focus(),n;const s=vn(e,t.itemSelector);return s.length>0?(s[0].focus(),s[0]):null},ia=(e,t,n={})=>{if(!e)return null;const s=vn(e,n.itemSelector);if(s.length===0)return null;const r=t<0?s.length+t:t;return r>=0&&r<s.length?(s[r].focus(),s[r]):null},oa=(e,t,n)=>e.key!=="Escape"?!1:(e.preventDefault(),t?.("up"),!0),la=(e,t)=>{const n=navigator.userAgent.includes("Mac OS");return e.key==="Delete"||n&&e.key==="Backspace"?(e.preventDefault(),t?.(),!0):!1},Mc=e=>{if(!e)return null;const t=[".btn-primary:not([disabled])",".btn-secondary:not([disabled])","button:not([disabled])"];for(const n of t){const s=e.querySelector(n);if(s)return s.focus(),s}return null},ca=e=>{if(!e)return null;const t=e.querySelector('input:not([disabled]):not([type="hidden"]), textarea:not([disabled])');return t?(t.focus(),typeof t.select=="function"&&t.select(),t):Mc(e)},Nc=".button-row, .modal-actions, .actions, .role-actions, .ancillary-actions",Dc=e=>{const t=Oc(e);if(!t)return;const n=e.target;if(n.tagName!=="BUTTON"&&n.tagName!=="A")return;const s=n.closest(Nc);s&&(t==="left"||t==="right")&&(e.preventDefault(),Pc(s,n,t,{itemSelector:"button:not([disabled]), a"}))};let rr=!1;const aa=()=>{rr||typeof document>"u"||(document.addEventListener("keydown",Dc),rr=!0)},ua=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};export{Tc as $,yo as A,Oc as B,ra as C,Pc as D,ia as E,fe as F,na as G,vc as H,Zc as I,Yc as J,aa as K,Gc as L,Uc as M,ta as N,Qc as O,so as P,ls as Q,z as R,ut as S,F as T,Ui as U,Lc as V,Kc as W,zt as X,Vc as Y,Ac as Z,ua as _,Hr as a,sa as a0,la as a1,oa as a2,kc as a3,ca as a4,qc as a5,It as a6,wi as a7,ea as a8,Sc as a9,Mc as aa,Bc as b,xl as c,Bn as d,li as e,Wc as f,es as g,Hc as h,$c as i,Qn as j,pl as k,Jc as l,dc as m,Mr as n,Ao as o,bi as p,Xc as q,jc as r,uc as s,Fi as t,zc as u,Zs as v,Pn as w,Ae as x,Wn as y,oo as z};
@@ -1 +0,0 @@
1
- :root{--font-sans: "Inter", "Inter var", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;--font-mono: "DM Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;--color-canvas: #ffffff;--color-surface: #eff6ff;--color-surface-subtle: #dbeafe;--color-border: #2563eb;--color-border-strong: #1e40af;--color-heading: #1e3a8a;--color-text: #1e293b;--color-text-muted: #475569;--color-link: #1d4ed8;--color-link-hover: #1e40af;--color-accent: #2563eb;--color-accent-strong: #1e40af;--color-accent-contrast: #ffffff;--color-success-text: #166534;--color-success-bg: #dcfce7;--color-error-text: #b91c1c;--color-error-bg: #fee2e2;--color-info-text: #1e40af;--color-info-bg: #dbeafe;--color-danger: #dc2626;--shadow-soft: 0 10px 30px rgba(30, 64, 175, .15);--radius-none: 0;--radius-sm: 4px;--radius-md: 6px;--radius-lg: 10px;--space-xxs: .25rem;--space-xs: .5rem;--space-sm: .75rem;--space-md: 1rem;--space-lg: 1.5rem;--space-xl: 2.25rem;--space-xxl: 3.5rem;--layout-padding: clamp(1.5rem, 3vw + 1rem, 3.25rem);--transition-base: .16s ease;--focus-ring: 0 0 0 2px var(--color-accent)}@media (prefers-color-scheme: dark){:root{--color-canvas: #0f172a;--color-surface: #141b2f;--color-surface-subtle: #1b243b;--color-border: #25304a;--color-border-strong: #3d4d6b;--color-heading: #fff;--color-text: #e2e8f0;--color-text-muted: #94a3b8;--color-link: #60a5fa;--color-link-hover: #93c5fd;--color-accent: #60a5fa;--color-accent-strong: #3b82f6;--color-accent-contrast: #0b1120;--color-success-text: #34d399;--color-success-bg: #1a4d2e;--color-error-text: #fca5a5;--color-error-bg: #4a1f1f;--color-info-text: #bae6fd;--color-info-bg: #1e3a5f;--color-danger: #f87171;--shadow-soft: 0 0 0 #000000}}*,*:before,*:after{box-sizing:border-box}html{overflow:clip;height:100%;background:var(--color-canvas)}body{color-scheme:light dark;overflow:auto;scrollbar-gutter:stable;height:100%;margin:0;font-family:var(--font-sans);background:none;color:var(--color-text);line-height:1.55;-webkit-font-smoothing:antialiased;text-align:justify;hyphens:auto;-webkit-hyphens:auto;-moz-hyphens:auto}body,#app,#admin-app{display:flex;flex-direction:column;min-height:100vh}#app,#admin-app{flex:1}a,a:visited{color:var(--color-link);text-decoration:none}a:hover,a:focus-visible{color:var(--color-link-hover)}.app-shell{flex:1;display:flex;flex-direction:column;min-height:100vh}.app-main{flex:1;display:flex;flex-direction:column}.view-root{flex:1;width:100%;display:flex;flex-direction:column;gap:2rem;padding:var(--layout-padding);box-sizing:border-box;margin:0 auto}.view-root--wide{width:min(100%,1200px)}.view-root--narrow{max-width:540px}.view-header{display:flex;flex-direction:column;gap:.75rem}.view-header h1{margin:0;font-weight:600;color:var(--color-heading)}.view-lede{margin:0;color:var(--color-text-muted);font-size:1rem}.section-block{display:flex;flex-direction:column;gap:1rem}.section-block h2{margin:0;font-size:clamp(1.25rem,1.5vw + 1rem,1.65rem);font-weight:600;color:var(--color-heading)}.section-body{display:flex;flex-direction:column;gap:1rem}.section-description{margin:0;color:var(--color-text-muted)}.button-row{display:flex;flex-wrap:nowrap;gap:.75rem;justify-content:flex-start}.button-row button{min-width:0}.surface{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-lg);box-shadow:var(--shadow-soft)}.surface--tight{padding:var(--space-md)}button{font-family:inherit;font-size:1rem;font-weight:500;border-radius:var(--radius-sm);border:1px solid transparent;padding:.65rem 1.1rem;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;background:var(--color-surface);color:var(--color-text)}button:disabled{cursor:not-allowed;filter:opacity(.6)}.btn-primary{background:var(--color-accent);color:var(--color-accent-contrast);border-color:var(--color-accent);box-shadow:var(--shadow-soft)}.btn-primary:hover:not(:disabled){background:var(--color-accent-strong);border-color:var(--color-accent-strong)}.btn-secondary{background:transparent;color:var(--color-text);border-color:var(--color-border)}.btn-secondary:hover:not(:disabled){border-color:var(--color-border-strong);background:var(--color-surface-subtle)}.btn-danger{background:var(--color-danger);color:var(--color-accent-contrast);border-color:transparent}.btn-danger:hover:not(:disabled){filter:brightness(.92)}.btn-primary:focus-visible,.btn-secondary:focus-visible,.btn-danger:focus-visible{outline:1px solid var(-webkit-focus-ring-color)}input[type=text],input[type=search],input[type=email],textarea,select{font:inherit;width:100%;padding:.65rem .75rem;border-radius:var(--radius-sm);border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text);transition:border-color var(--transition-base),box-shadow var(--transition-base)}label{display:flex;flex-direction:column;gap:.5rem;color:var(--color-text)}p{margin:0;color:var(--color-text)}small{color:var(--color-text-muted)}.table-wrapper{overflow-x:auto;background:var(--color-surface);border:1px solid var(--color-border)}table{width:100%;border-collapse:collapse;font-size:.95rem}thead tr{background:var(--color-surface-subtle);color:var(--color-text-muted)}td,th{padding:.65rem .75rem;border-bottom:1px solid var(--color-border);text-align:left}.center{text-align:center}.badge{display:inline-flex;align-items:center;gap:.35rem;padding:.2rem .6rem;border-radius:var(--radius-sm);background:var(--color-surface-subtle);border:1px solid var(--color-border);color:var(--color-text-muted);font-size:.75rem}.global-status{position:fixed;top:1.5rem;left:0;right:0;margin:0 auto;z-index:1200;width:fit-content;min-width:min(520px,calc(100% - 2rem));max-width:calc(100% - 2rem);display:none}.global-status .status{display:flex;align-items:center;justify-content:center;padding:.85rem 1.25rem;border-radius:var(--radius-sm);border-width:1px;border-style:solid;background:var(--color-surface);box-shadow:var(--shadow-soft);font-weight:550}.status.info{border-color:#3b82f6;color:var(--color-info-text);background:var(--color-info-bg)}.status.success{border-color:#16a34a;color:var(--color-success-text);background:var(--color-success-bg)}.status.error{border-color:#dc2626;color:var(--color-error-text);background:var(--color-error-bg)}.dialog-overlay{position:fixed;inset:0;background:transparent;z-index:1100;display:flex;align-items:center;justify-content:center;padding:1.5rem}.device-dialog,.modal{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);width:min(520px,100%);max-height:calc(100vh - 3rem);overflow-y:auto;padding:1.75rem;box-shadow:var(--shadow-soft);color:var(--color-text)}.qr-container{display:flex;flex-direction:column;align-items:center;gap:.75rem;text-align:center;color:var(--color-text-muted)}.qr-code{padding:1rem;background:#fff;box-shadow:var(--shadow-soft)}.link-container,.token-display,.token-info{background:var(--color-surface-subtle);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:.75rem;color:var(--color-text)}:root{--card-width: 16rem}.record-list,.credential-list,.session-list{width:100%;display:grid;grid-auto-flow:row;grid-template-columns:repeat(auto-fill,minmax(var(--card-width),1fr));justify-content:start;gap:.5rem;align-items:stretch;margin:0 auto;outline:none}@media (max-width: 720px){.record-list{display:flex;flex-direction:column;max-width:100%}}.record-item,.credential-item,.session-item{display:flex;flex-direction:column;padding:.5rem;border-radius:var(--radius-md);background:var(--color-surface);height:100%;transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;position:relative;cursor:pointer}.record-item:hover,.credential-item:hover,.session-item:hover{border-color:var(--color-border-strong);box-shadow:0 10px 24px #0f172a1f;transform:translateY(-1px)}.record-item.is-current,.credential-item.current-session,.credential-item.is-hovered,.session-item.is-current,.session-item.is-hovered,.credential-item.is-linked-session,.session-item.is-linked-credential{border-color:var(--color-accent);background-color:var(--color-surface-subtle)}.credential-item:focus,.session-item:focus{outline:1px solid var(-webkit-focus-ring-color)}.item-top{display:flex;align-items:center;height:2.5rem}.item-icon{width:40px;height:40px;display:grid;place-items:center;flex-shrink:0}.auth-icon{border-radius:var(--radius-sm)}.icon{flex:0 0 auto;font-size:1.5em;width:40px}.item-title{flex:1;margin:0;font-size:1rem;font-weight:600;color:var(--color-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item-actions{flex-shrink:0;display:flex;align-items:center}.item-actions .badge+.btn-card-delete{margin-left:.25rem}.item-actions .badge+.badge{margin-left:.25rem}.item-details{margin-left:40px}.credential-dates,.session-dates{display:grid;grid-auto-flow:row;grid-template-columns:8em 1fr;font-size:.75rem;align-items:center}.date-label{font-weight:500;color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis}.date-value{color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn-card-delete{background:transparent;border:none;color:var(--color-danger);padding:.35rem .5rem;font-size:1.05rem;line-height:1;border-radius:var(--radius-sm);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.btn-card-delete:hover:not(:disabled){background:#fee}.btn-card-delete:disabled{filter:opacity(.4);cursor:not-allowed}.session-emoji{font-size:1.2rem}.session-group{position:relative}.session-group:focus-visible{outline:1px solid var(-webkit-focus-ring-color)}.session-group-host{display:flex;align-items:center;font-size:1.5rem;font-weight:600;margin:.5rem 0}.session-group-icon{margin-left:-1.5rem}.session-group-host a{color:var(--color-text);text-decoration:none}.session-group:focus-visible .session-group-host,.session-group:focus-visible .session-group-host a{color:var(--color-heading)}.btn-card-delete{display:none}.session-item:focus .btn-card-delete{display:block}.badge{padding:.2rem .5rem;border-radius:var(--radius-sm);font-size:.8rem;font-weight:500;white-space:nowrap}.badge-current{background:var(--color-accent);color:var(--color-accent-contrast);box-shadow:0 0 0 1px var(--color-accent) inset}.badge:not(.badge-current){background:var(--color-surface-subtle);color:var(--color-text-muted);border:1px solid var(--color-border)}.session-meta-info{font-size:.75rem;color:var(--color-text-muted);font-family:monospace}.empty-state{text-align:center;padding:var(--space-lg);color:var(--color-text-muted)}.empty-state p{margin:0}.user-info{display:grid;border-radius:var(--radius-md);background:var(--color-surface);padding:1.1rem 1.25rem}.user-details{display:grid;grid-template-columns:7em 1fr;gap:0 .5rem;padding-left:40px;font-size:.75rem}.toggle-link{color:var(--color-link);cursor:pointer}.toggle-link:hover{color:var(--color-link-hover)}.token-info code{font-family:var(--font-mono)}@media (max-width: 720px){.view-root{padding:clamp(1rem,3vw + .75rem,2rem);gap:1.75rem}.global-status{top:1rem}}.dialog-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background:transparent;backdrop-filter:blur(.1rem) brightness(.7);-webkit-backdrop-filter:blur(.1rem) brightness(.7);display:flex;align-items:center;justify-content:center;z-index:1000}.dialog-container{max-width:90vw;max-height:90vh;overflow-y:auto}.dialog-content{flex:none;width:100%;max-width:480px;padding:2rem;background:var(--color-surface);border-radius:var(--radius-lg);box-shadow:0 20px 60px #1e293b;border:1px solid var(--color-border)}.dialog-content--wide{max-width:540px}.dialog-content--narrow{max-width:420px}@media (max-width: 720px){.dialog-content{padding:1.5rem}}.slot-machine{padding:.875rem 1rem;background:var(--color-surface-hover, rgba(0, 0, 0, .03));border:1px solid var(--color-border);border-radius:var(--radius-sm);font-family:SF Mono,Monaco,Cascadia Code,Roboto Mono,Consolas,Courier New,monospace;display:flex;align-items:center;-webkit-user-select:none;user-select:none;pointer-events:none;white-space:nowrap;overflow:hidden}.slot-reel{display:inline-flex;align-items:center;justify-content:center;flex:1;min-width:0;height:1.8em;position:relative}
@@ -1 +0,0 @@
1
- import{_ as re,r as k,c as I,b as p,d as m,e as o,f as T,t as A,F as C,i as X,j as Re,C as te,B as J,D as ie,l as Ce,L as De,y as G,x as ae,E as ke,H as P,A as _e,k as z,h as ne,v as oe,z as ge,o as Se,a as Oe,N as et,q as tt,u as st,w as nt,J as ot,K as at}from"./_plugin-vue_export-helper-D2l53SUz.js";import{u as Ae,U as it,_ as rt,a as lt,R as ut,N as me,M as dt,b as ct,L as mt,A as fe,B as ft,c as gt}from"./AccessDenied-DAdzg_MJ.js";import"./helpers-DzjFIx78.js";const vt={key:0},yt=["onClick"],pt=["onClick"],ht={class:"role-names"},bt={class:"center"},wt={key:0,class:"center"},$t=["onClick"],Dt={key:0,class:"permissions-section"},kt={class:"matrix-scroll"},St=["title"],Ot=["title"],Rt={class:"display-text"},Ct=["checked","onChange"],At={class:"perm-name-cell"},Ut={class:"perm-title"},Et={class:"display-text"},Mt=["onClick"],Pt={class:"perm-id-info"},xt={class:"id-text"},qt={class:"perm-domain"},Nt={class:"perm-members center"},Tt={class:"perm-actions center"},Lt=["onClick"],Ft={__name:"AdminOverview",props:{info:Object,orgs:Array,permissions:Array,permissionSummary:Object,navigationDisabled:{type:Boolean,default:!1}},emits:["createOrg","openOrg","updateOrg","deleteOrg","toggleOrgPermission","openDialog","deletePermission","renamePermissionDisplay","navigateOut"],setup(n,{expose:V,emit:Y}){const S=n,L=Y,E=k(null),c=k(null),y=k(null),x=k(null),N=k(null),B=k(null),q=I(()=>[...S.orgs].sort((r,t)=>{const s=r.display_name.localeCompare(t.display_name);return s!==0?s:r.uuid.localeCompare(t.uuid)})),w=I(()=>[...S.permissions].sort((r,t)=>r.scope.localeCompare(t.scope))),F=I(()=>S.info?.ctx.permissions.includes("auth:admin")),$=I(()=>S.info?.ctx.permissions.includes("auth:org:admin"));function _(r){return r.roles.slice().sort((t,s)=>t.display_name.localeCompare(s.display_name)).map(t=>t.display_name).join(", ")}function Z(r,t){if(S.navigationDisabled)return;const s=J(r);if(!s)return;const D=r.target,l=D.closest("tr");if(!l)return;const d=l.closest("tbody");if(!d)return;const h=Array.from(d.querySelectorAll("tr")),R=h.indexOf(l);if(R===-1)return;if(s==="left"||s==="right"){r.preventDefault();const M=Array.from(l.querySelectorAll("a, button:not([disabled])")),K=M.indexOf(D);if(K===-1)return;s==="left"&&K>0?M[K-1].focus():s==="right"&&K<M.length-1&&M[K+1].focus();return}let j=R;if(s==="up"&&R>0)j=R-1;else if(s==="down"&&R<h.length-1)j=R+1;else if(s==="up"&&R===0){r.preventDefault(),t==="org"?te(c.value,{itemSelector:"button"}):t==="perm"&&te(N.value,{itemSelector:"button"});return}else if(s==="down"&&R===h.length-1){if(r.preventDefault(),t==="org"&&F.value&&x.value){const M=x.value.querySelector('input[type="checkbox"]');M?M.focus():te(N.value,{itemSelector:"button"})}return}if(j!==R){r.preventDefault();const K=h[j].querySelector("a, button:not([disabled])");K&&K.focus()}}function ee(r){if(S.navigationDisabled)return;const t=J(r);if(t){if(r.preventDefault(),t==="left"||t==="right")ie(c.value,r.target,t,{itemSelector:"button"});else if(t==="up")L("navigateOut","up");else if(t==="down"){const s=y.value?.querySelector("tbody tr a, tbody tr button:not([disabled])");s&&s.focus()}}}function g(r){if(S.navigationDisabled)return;const t=J(r);if(!t)return;const s=r.target;if(s.tagName!=="INPUT")return;r.preventDefault();const D=Array.from(x.value.querySelectorAll('input[type="checkbox"]')),l=D.indexOf(s);if(l===-1)return;const d=q.value.length,h=w.value.length;if(d===0||h===0)return;const R=Math.floor(l/d),j=l%d;let M=l;if(t==="left")j>0&&(M=l-1);else if(t==="right")j<d-1&&(M=l+1);else if(t==="up")if(R>0)M=l-d;else{const le=y.value?.querySelector("tbody tr:last-child")?.querySelector("a, button:not([disabled])");le&&le.focus();return}else if(t==="down")if(R<h-1)M=l+d;else{te(N.value,{itemSelector:"button"});return}M!==l&&D[M]&&D[M].focus()}function u(r){if(S.navigationDisabled)return;const t=J(r);if(t){if(r.preventDefault(),t==="left"||t==="right")ie(N.value,r.target,t,{itemSelector:"button"});else if(t==="up"){const s=x.value?.querySelectorAll('input[type="checkbox"]');if(s?.length){const D=q.value.length,d=(w.value.length-1)*D;s[d]?s[d].focus():s[0].focus()}else{const l=y.value?.querySelector("tbody tr:last-child")?.querySelector("a, button:not([disabled])");l&&l.focus()}}else if(t==="down"){const s=B.value?.querySelector("tbody tr button:not([disabled])");s&&s.focus()}}}function f(){if(F.value)te(c.value,{itemSelector:"button"});else{const r=y.value?.querySelector("tbody tr a, tbody tr button:not([disabled])");r&&r.focus()}}return V({focusFirstElement:f}),(r,t)=>(m(),p(C,null,[o("div",{class:"permissions-section",ref_key:"orgSection",ref:E},[o("h2",null,A(F.value?"Organizations":"Your Organizations"),1),o("div",{class:"actions",ref_key:"orgActionsRef",ref:c,onKeydown:ee},[F.value?(m(),p("button",{key:0,onClick:t[0]||(t[0]=s=>r.$emit("createOrg"))},"+ Create Org")):T("",!0)],544),o("table",{class:"org-table",ref_key:"orgTableRef",ref:y,onKeydown:t[1]||(t[1]=s=>Z(s,"org"))},[o("thead",null,[o("tr",null,[t[4]||(t[4]=o("th",null,"Name",-1)),t[5]||(t[5]=o("th",null,"Roles",-1)),t[6]||(t[6]=o("th",null,"Members",-1)),F.value?(m(),p("th",vt,"Actions")):T("",!0)])]),o("tbody",null,[(m(!0),p(C,null,X(q.value,s=>(m(),p("tr",{key:s.uuid},[o("td",null,[o("a",{href:"#org/{{o.uuid}}",onClick:Ce(D=>r.$emit("openOrg",s),["prevent"])},A(s.display_name),9,yt),F.value||$.value?(m(),p("button",{key:0,onClick:D=>r.$emit("updateOrg",s),class:"icon-btn edit-org-btn","aria-label":"Rename organization",title:"Rename organization"},"✏️",8,pt)):T("",!0)]),o("td",ht,A(_(s)),1),o("td",bt,A(s.roles.reduce((D,l)=>D+l.users.length,0)),1),F.value?(m(),p("td",wt,[o("button",{onClick:D=>r.$emit("deleteOrg",s),class:"icon-btn delete-icon","aria-label":"Delete organization",title:"Delete organization"},"❌",8,$t)])):T("",!0)]))),128))])],544)],512),F.value?(m(),p("div",Dt,[t[10]||(t[10]=o("h2",null,"Permissions",-1)),o("div",{class:"matrix-wrapper",ref_key:"permMatrixRef",ref:x,onKeydown:g},[o("div",kt,[o("div",{class:"perm-matrix-grid",style:Re({gridTemplateColumns:"minmax(180px, 1fr) "+q.value.map(()=>"2.2rem").join(" ")})},[t[7]||(t[7]=o("div",{class:"grid-head perm-head"},"Permission",-1)),(m(!0),p(C,null,X(q.value,s=>(m(),p("div",{key:"head-"+s.uuid,class:"grid-head org-head",title:s.display_name},[o("span",null,A(s.display_name),1)],8,St))),128)),(m(!0),p(C,null,X(w.value,s=>(m(),p(C,{key:s.uuid},[o("div",{class:"perm-name",title:s.scope},[o("span",Rt,A(s.display_name),1)],8,Ot),(m(!0),p(C,null,X(q.value,D=>(m(),p("div",{key:D.uuid+"-"+s.uuid,class:"matrix-cell"},[o("input",{type:"checkbox",checked:D.permissions.includes(s.uuid),onChange:l=>r.$emit("toggleOrgPermission",D,s.uuid,l.target.checked)},null,40,Ct)]))),128))],64))),128))],4)]),t[8]||(t[8]=o("p",{class:"matrix-hint muted"},"Toggle which permissions each organization can grant to its members.",-1))],544),o("div",{class:"actions",ref_key:"permActionsRef",ref:N,onKeydown:u},[F.value?(m(),p("button",{key:0,onClick:t[2]||(t[2]=s=>r.$emit("openDialog","perm-create",{display_name:"",scope:"",domain:""}))},"+ Create Permission")):T("",!0)],544),o("table",{class:"org-table",ref_key:"permTableRef",ref:B,onKeydown:t[3]||(t[3]=s=>Z(s,"perm"))},[t[9]||(t[9]=o("thead",null,[o("tr",null,[o("th",{scope:"col"},"Permission"),o("th",{scope:"col"},"Domain"),o("th",{scope:"col",class:"center"},"Members"),o("th",{scope:"col",class:"center"},"Actions")])],-1)),o("tbody",null,[(m(!0),p(C,null,X(w.value,s=>(m(),p("tr",{key:s.uuid},[o("td",At,[o("div",Ut,[o("span",Et,A(s.display_name),1),o("button",{onClick:D=>r.$emit("renamePermissionDisplay",s),class:"icon-btn edit-display-btn","aria-label":"Edit permission",title:"Edit permission"},"✏️",8,Mt)]),o("div",Pt,[o("span",xt,A(s.scope),1)])]),o("td",qt,A(s.domain||"—"),1),o("td",Nt,A(n.permissionSummary[s.uuid]?.userCount||0),1),o("td",Tt,[o("button",{onClick:D=>r.$emit("deletePermission",s),class:"icon-btn delete-icon","aria-label":"Delete permission",title:"Delete permission"},"❌",8,Lt)])]))),128))])],544)])):T("",!0)],64))}},It=re(Ft,[["__scopeId","data-v-56228c4a"]]),Kt=["title"],Bt={class:"org-name"},zt={class:"matrix-scroll"},Vt=["title"],jt=["title"],Ht=["checked","onChange"],Gt=["onDrop"],Jt=["onKeydown"],Yt=["title"],Wt=["onClick"],Zt={class:"role-actions"},Qt=["onClick"],Xt=["onDragstart","onClick","onKeydown","title"],_t={class:"name"},es={class:"meta"},ts=["onKeydown"],ss=["onClick"],ns={__name:"AdminOrgDetail",props:{selectedOrg:Object,permissions:Array,navigationDisabled:{type:Boolean,default:!1}},emits:["updateOrg","createRole","updateRole","deleteRole","createUserInRole","openUser","toggleRolePermission","onRoleDragOver","onRoleDrop","onUserDragStart","navigateOut"],setup(n,{expose:V,emit:Y}){const S=n,L=Y,E=k(null),c=k(null),y=k(null),x=I(()=>[...S.selectedOrg.roles].sort((g,u)=>{const f=g.display_name.toLowerCase(),r=u.display_name.toLowerCase();return f!==r?f.localeCompare(r):g.uuid.localeCompare(u.uuid)})),N=I(()=>{const g=new Set(S.selectedOrg.permissions||[]);return S.permissions.filter(u=>g.has(u.uuid))});function B(g,u,f){L("toggleRolePermission",g,u,f)}function q(g){if(S.navigationDisabled)return;const u=J(g);if(u){if(g.preventDefault(),u==="left"||u==="right")ie(E.value,g.target,u,{itemSelector:"button"});else if(u==="up")L("navigateOut","up");else if(u==="down"){const f=c.value?.querySelector('input[type="checkbox"]');f?f.focus():Z()}}}function w(g){if(S.navigationDisabled)return;const u=J(g);if(!u)return;const f=g.target;if(f.tagName!=="INPUT")return;g.preventDefault();const r=Array.from(c.value.querySelectorAll('input[type="checkbox"]')),t=r.indexOf(f);if(t===-1)return;const s=x.value.length,D=S.selectedOrg.permissions.length,l=Math.floor(t/s),d=t%s;let h=t;if(u==="left"&&d>0)h=t-1;else if(u==="right"&&d<s-1)h=t+1;else if(u==="up"&&l>0)h=t-s;else if(u==="down"&&l<D-1)h=t+s;else if(u==="up"&&l===0){const R=E.value?.querySelector("button");R&&R.focus();return}else if(u==="down"&&l===D-1){Z();return}h!==t&&r[h]&&r[h].focus()}function F(g){if(S.navigationDisabled)return;const u=J(g);if(!u)return;const f=g.target;if(!f.classList.contains("user-chip"))return;const r=f.closest(".user-list");if(!r)return;const t=Array.from(r.querySelectorAll(".user-chip")),s=t.indexOf(f);if(s!==-1){if(u==="up"&&s>0){g.preventDefault(),t[s-1].focus();return}else if(u==="down"&&s<t.length-1){g.preventDefault(),t[s+1].focus();return}if(u==="up"&&s===0){g.preventDefault();const l=r.closest(".role-column")?.querySelector(".role-header button");l&&l.focus();return}if(!(u==="down"&&s===t.length-1)&&(u==="left"||u==="right")){g.preventDefault();const D=Array.from(y.value?.querySelectorAll(".role-column")||[]),l=r.closest(".role-column"),d=D.indexOf(l);let h=u==="left"?d-1:d+1;if(h>=0&&h<D.length){const R=D[h],j=R.querySelectorAll(".user-chip"),M=Math.min(s,j.length-1);if(j[M])j[M].focus();else{const K=R.querySelector(".plus-btn");K&&K.focus()}}else if(u==="left"&&d===0){const R=c.value?.querySelector('input[type="checkbox"]:last-of-type');R&&R.focus()}}}}function $(g,u){if(S.navigationDisabled)return;const f=J(g);if(!f)return;const r=Array.from(y.value?.querySelectorAll(".role-column")||[]);if(f==="left"||f==="right"){g.preventDefault();const t=g.currentTarget.querySelectorAll("button:not([disabled])"),s=Array.from(t).indexOf(g.target);if(f==="left"&&s>0)t[s-1].focus();else if(f==="right"&&s<t.length-1)t[s+1].focus();else if(f==="left"&&s===0&&u>0){const l=r[u-1]?.querySelectorAll(".role-header button");l?.length&&l[l.length-1].focus()}else if(f==="right"&&s===t.length-1&&u<r.length-1){const l=r[u+1]?.querySelector(".role-header button");l&&l.focus()}}else if(f==="up"){g.preventDefault();const t=c.value?.querySelectorAll('input[type="checkbox"]');if(t?.length){const s=x.value.length,l=(S.selectedOrg.permissions.length-1)*s+u;t[l]?t[l].focus():t[t.length-1].focus()}else{const s=E.value?.querySelector("button");s&&s.focus()}}else if(f==="down"){g.preventDefault();const s=r[u]?.querySelector(".user-chip");s&&s.focus()}}function _(g,u){if(S.navigationDisabled)return;const f=J(g);if(!f)return;const r=Array.from(y.value?.querySelectorAll(".role-column")||[]);if(f==="up"){g.preventDefault();const s=r[u]?.querySelector(".role-header button");s&&s.focus()}else if(f==="left"&&u>0){g.preventDefault();const t=r[u-1],s=t?.querySelector(".empty-role button"),D=t?.querySelector(".user-chip:last-child");s?s.focus():D&&D.focus()}else if(f==="right"&&u<r.length-1){g.preventDefault();const t=r[u+1],s=t?.querySelector(".empty-role button"),D=t?.querySelector(".user-chip");s?s.focus():D&&D.focus()}}function Z(){const u=y.value?.querySelector(".role-column")?.querySelector(".role-header button");u&&u.focus()}function ee(){const g=E.value?.querySelector("button");g&&g.focus()}return V({focusFirstElement:ee}),(g,u)=>(m(),p(C,null,[o("h2",{class:"org-title",ref_key:"orgTitleRef",ref:E,onKeydown:q,title:n.selectedOrg.uuid},[o("span",Bt,A(n.selectedOrg.display_name),1),o("button",{onClick:u[0]||(u[0]=f=>g.$emit("updateOrg",n.selectedOrg)),class:"icon-btn","aria-label":"Rename organization",title:"Rename organization"},"✏️")],40,Kt),o("div",{class:"matrix-wrapper",ref_key:"permMatrixRef",ref:c,onKeydown:w},[o("div",zt,[o("div",{class:"perm-matrix-grid",style:Re({gridTemplateColumns:"minmax(180px, 1fr) "+x.value.map(()=>"2.2rem").join(" ")+" 2.2rem"})},[u[5]||(u[5]=o("div",{class:"grid-head perm-head"},"Permission",-1)),(m(!0),p(C,null,X(x.value,f=>(m(),p("div",{key:"head-"+f.uuid,class:"grid-head role-head",title:f.display_name},[o("span",null,A(f.display_name),1)],8,Vt))),128)),o("div",{class:"grid-head role-head add-role-head",title:"Add role",onClick:u[1]||(u[1]=f=>g.$emit("createRole",n.selectedOrg)),role:"button",tabindex:"0",onKeydown:u[2]||(u[2]=De(f=>g.$emit("createRole",n.selectedOrg),["enter"]))},"➕",32),(m(!0),p(C,null,X(N.value,f=>(m(),p(C,{key:f.uuid},[o("div",{class:"perm-name",title:f.scope},A(f.display_name),9,jt),(m(!0),p(C,null,X(x.value,r=>(m(),p("div",{key:r.uuid+"-"+f.uuid,class:"matrix-cell"},[o("input",{type:"checkbox",checked:r.permissions.includes(f.uuid),onChange:t=>B(r,f.uuid,t.target.checked)},null,40,Ht)]))),128)),u[4]||(u[4]=o("div",{class:"matrix-cell add-role-cell"},null,-1))],64))),128))],4)]),u[6]||(u[6]=o("p",{class:"matrix-hint muted"},"Toggle which permissions each role grants.",-1))],544),o("div",{class:"roles-grid",ref_key:"rolesGridRef",ref:y},[(m(!0),p(C,null,X(x.value,(f,r)=>(m(),p("div",{key:f.uuid,class:"role-column",onDragover:u[3]||(u[3]=t=>g.$emit("onRoleDragOver",t)),onDrop:t=>g.$emit("onRoleDrop",t,n.selectedOrg,f)},[o("div",{class:"role-header",onKeydown:t=>$(t,r)},[o("strong",{class:"role-name",title:f.uuid},[o("span",null,A(f.display_name),1),o("button",{onClick:t=>g.$emit("updateRole",f),class:"icon-btn","aria-label":"Edit role",title:"Edit role"},"✏️",8,Wt)],8,Yt),o("div",Zt,[o("button",{onClick:t=>g.$emit("createUserInRole",n.selectedOrg,f),class:"plus-btn","aria-label":"Add user",title:"Add user"},"➕",8,Qt)])],40,Jt),f.users.length>0?(m(),p("ul",{key:0,class:"user-list",onKeydown:F},[(m(!0),p(C,null,X(f.users.slice().sort((t,s)=>{const D=t.display_name.toLowerCase(),l=s.display_name.toLowerCase();return D!==l?D.localeCompare(l):t.uuid.localeCompare(s.uuid)}),t=>(m(),p("li",{key:t.uuid,class:"user-chip",tabindex:"0",draggable:"true",onDragstart:s=>g.$emit("onUserDragStart",s,t,n.selectedOrg.uuid),onClick:s=>g.$emit("openUser",t),onKeydown:De(s=>g.$emit("openUser",t),["enter"]),title:t.uuid},[o("span",_t,A(t.display_name),1),o("span",es,A(t.last_seen?new Date(t.last_seen).toLocaleDateString():"—"),1)],40,Xt))),128))],32)):(m(),p("div",{key:1,class:"empty-role",onKeydown:t=>_(t,r)},[u[7]||(u[7]=o("p",{class:"empty-text muted"},"No members",-1)),o("button",{onClick:t=>g.$emit("deleteRole",f),class:"icon-btn delete-icon","aria-label":"Delete empty role",title:"Delete role"},"❌",8,ss)],40,ts))],40,Gt))),128))],512)],64))}},os=re(ns,[["__scopeId","data-v-f76fbbc3"]]),as={class:"user-detail"},is={key:0,class:"error small"},rs=["disabled"],ls={class:"section-block","data-section":"registered-passkeys"},us={class:"section-body"},ds={__name:"AdminUserDetail",props:{selectedUser:Object,userDetail:Object,selectedOrg:Object,loading:Boolean,showRegModal:Boolean,navigationDisabled:{type:Boolean,default:!1}},emits:["generateUserRegistrationLink","goOverview","openOrg","onUserNameSaved","closeRegModal","editUserName","refreshUserDetail","navigateOut"],setup(n,{expose:V,emit:Y}){const S=n,L=Y,E=Ae(),c=k({}),y=k(null),x=k(null),N=k(null),B=k(null),q=k(null),w=k(null),F=k(null),$=I(()=>S.showRegModal);function _(){E.showMessage(`📋 Link copied! Send it to ${S.selectedUser.display_name}.`),L("closeRegModal")}function Z(){L("editUserName",S.selectedUser)}async function ee(l){try{const d=await P(`/auth/api/admin/orgs/${S.selectedUser.org}/users/${S.selectedUser.uuid}/credentials/${l.credential}`,{method:"DELETE"});d.status==="ok"?L("onUserNameSaved"):console.error("Failed to delete credential",d)}catch(d){console.error("Delete credential error",d)}}async function g(l){const d=l?.id;if(d){c.value={...c.value,[d]:!0};try{const h=await P(`/auth/api/admin/orgs/${S.selectedUser.org}/users/${S.selectedUser.uuid}/sessions/${d}`,{method:"DELETE"});if(h.status==="ok"){if(h.current_session_terminated){sessionStorage.clear(),location.reload();return}L("refreshUserDetail"),E.showMessage("Session terminated","success",2500)}else E.showMessage(h.detail||"Failed to terminate session","error")}catch(h){console.error("Terminate session error",h),E.showMessage(h.message||"Failed to terminate session","error")}finally{const h={...c.value};delete h[d],c.value=h}}}function u(l){if($.value||S.navigationDisabled)return;const d=J(l);d&&(l.preventDefault(),d==="left"||d==="right"?ie(N.value,l.target,d,{itemSelector:".mini-btn"}):d==="up"?L("navigateOut","up"):d==="down"&&te(B.value,{itemSelector:"button"}))}function f(l){if($.value||S.navigationDisabled)return;const d=J(l);d&&(l.preventDefault(),d==="left"||d==="right"?ie(B.value,l.target,d,{itemSelector:"button"}):d==="up"?te(N.value,{itemSelector:".mini-btn"}):d==="down"&&q.value?.$el?.focus())}function r(l){$.value||S.navigationDisabled||(l==="up"?te(B.value,{itemSelector:"button"}):l==="down"&&ke(w.value?.$el,0,{itemSelector:".session-group"}))}function t(l){if(!($.value||S.navigationDisabled)){if(l==="up")q.value?.$el?.focus();else if(l==="down"){const d=F.value?.querySelector("button");d&&d.focus()}}}function s(l){if($.value||S.navigationDisabled)return;const d=J(l);d&&(l.preventDefault(),d==="up"&&ke(w.value?.$el,-1,{itemSelector:".session-group"}))}function D(){te(N.value,{itemSelector:".mini-btn"})}return V({focusFirstElement:D}),(l,d)=>(m(),p("div",as,[o("div",{ref_key:"userInfoRef",ref:N,onKeydown:u},[n.userDetail&&!n.userDetail.error?(m(),G(it,{key:0,name:n.userDetail.display_name||n.selectedUser.display_name,visits:n.userDetail.visits,"created-at":n.userDetail.created_at,"last-seen":n.userDetail.last_seen,loading:n.loading,"org-display-name":n.userDetail.org.display_name,"role-name":n.userDetail.role,"update-endpoint":`/auth/api/admin/orgs/${n.selectedUser.org}/users/${n.selectedUser.uuid}/display-name`,onSaved:d[0]||(d[0]=h=>l.$emit("onUserNameSaved")),onEditName:Z},null,8,["name","visits","created-at","last-seen","loading","org-display-name","role-name","update-endpoint"])):T("",!0)],544),n.userDetail?.error?(m(),p("div",is,A(n.userDetail.error),1)):T("",!0),n.userDetail&&!n.userDetail.error?(m(),p(C,{key:1},[o("div",{class:"registration-actions",ref_key:"regActionsRef",ref:B,onKeydown:f},[o("button",{class:"btn-secondary reg-token-btn",onClick:d[1]||(d[1]=h=>l.$emit("generateUserRegistrationLink",n.selectedUser)),disabled:n.loading},"Generate Registration Token",8,rs),d[6]||(d[6]=o("p",{class:"matrix-hint muted"}," Generate a one-time registration link so this user can register or add another passkey. Copy the link from the dialog and send it to the user, or have the user scan the QR code on their device. ",-1))],544),o("section",ls,[d[7]||(d[7]=o("div",{class:"section-header"},[o("h2",null,"Registered Passkeys")],-1)),o("div",us,[ae(rt,{ref_key:"credentialListRef",ref:q,credentials:n.userDetail.credentials,"aaguid-info":n.userDetail.aaguid_info,"allow-delete":!0,"hovered-credential-uuid":y.value,"hovered-session-credential-uuid":x.value?.credential,"navigation-disabled":$.value,onDelete:ee,onCredentialHover:d[2]||(d[2]=h=>y.value=h),onNavigateOut:r},null,8,["credentials","aaguid-info","hovered-credential-uuid","hovered-session-credential-uuid","navigation-disabled"])])]),ae(lt,{ref_key:"sessionListRef",ref:w,sessions:n.userDetail.sessions||[],"terminating-sessions":c.value,"hovered-credential-uuid":y.value,"navigation-disabled":$.value,"empty-message":"This user has no active sessions.","section-description":"View and manage the active sessions for this user.",onTerminate:g,onSessionHover:d[3]||(d[3]=h=>x.value=h),onNavigateOut:t},null,8,["sessions","terminating-sessions","hovered-credential-uuid","navigation-disabled"])],64)):T("",!0),o("div",{class:"actions ancillary-actions",ref_key:"backButtonRef",ref:F,onKeydown:s},[n.selectedOrg?(m(),p("button",{key:0,onClick:d[4]||(d[4]=h=>l.$emit("openOrg",n.selectedOrg)),class:"icon-btn",title:"Back to Org"},"↩️")):T("",!0)],544),n.showRegModal?(m(),G(ut,{key:2,endpoint:`/auth/api/admin/orgs/${n.selectedUser.org}/users/${n.selectedUser.uuid}/create-link`,"user-name":n.userDetail?.display_name||n.selectedUser.display_name,onClose:d[5]||(d[5]=h=>l.$emit("closeRegModal")),onCopied:_},null,8,["endpoint","user-name"])):T("",!0)]))}},cs=re(ds,[["__scopeId","data-v-738bccea"]]),ms={class:"modal-title"},fs={key:0},gs={key:2},vs={class:"small muted"},ys=["placeholder","pattern"],ps={class:"small muted"},hs={key:7},bs={key:8,class:"error small"},ws={key:9,class:"modal-actions"},$s=["disabled"],Ds=["disabled"],ks={__name:"AdminDialogs",props:{dialog:Object,PERMISSION_ID_PATTERN:String,settings:Object},emits:["submitDialog","closeDialog"],setup(n,{emit:V}){const Y=n,S=new Set(["org-update","role-update","user-update-name"]),L=I(()=>Y.settings?.rp_id||"the configured domain");return(E,c)=>n.dialog.type?(m(),G(dt,{key:0,onClose:c[14]||(c[14]=y=>E.$emit("closeDialog"))},{default:_e(()=>[o("h3",ms,[n.dialog.type==="org-create"?(m(),p(C,{key:0},[z("Create Organization")],64)):n.dialog.type==="org-update"?(m(),p(C,{key:1},[z("Rename Organization")],64)):n.dialog.type==="role-create"?(m(),p(C,{key:2},[z("Create Role")],64)):n.dialog.type==="role-update"?(m(),p(C,{key:3},[z("Edit Role")],64)):n.dialog.type==="user-create"?(m(),p(C,{key:4},[z("Add User To Role")],64)):n.dialog.type==="user-update-name"?(m(),p(C,{key:5},[z("Edit User Name")],64)):n.dialog.type==="perm-create"||n.dialog.type==="perm-display"?(m(),p(C,{key:6},[z(A(n.dialog.type==="perm-create"?"Create Permission":"Edit Permission"),1)],64)):n.dialog.type==="confirm"?(m(),p(C,{key:7},[z("Confirm")],64)):T("",!0)]),o("form",{onSubmit:c[13]||(c[13]=Ce(y=>E.$emit("submitDialog"),["prevent"])),class:"modal-form"},[n.dialog.type==="org-create"?(m(),p("label",fs,[c[15]||(c[15]=z("Name ",-1)),ne(o("input",{ref:"nameInput","onUpdate:modelValue":c[0]||(c[0]=y=>n.dialog.data.name=y),required:""},null,512),[[oe,n.dialog.data.name]])])):n.dialog.type==="org-update"?(m(),G(me,{key:1,label:"Organization Name",modelValue:n.dialog.data.name,"onUpdate:modelValue":c[1]||(c[1]=y=>n.dialog.data.name=y),busy:n.dialog.busy,error:n.dialog.error,onCancel:c[2]||(c[2]=y=>E.$emit("closeDialog"))},null,8,["modelValue","busy","error"])):n.dialog.type==="role-create"?(m(),p("label",gs,[c[16]||(c[16]=z("Role Name ",-1)),ne(o("input",{"onUpdate:modelValue":c[3]||(c[3]=y=>n.dialog.data.name=y),placeholder:"Role name",required:""},null,512),[[oe,n.dialog.data.name]])])):n.dialog.type==="role-update"?(m(),G(me,{key:3,label:"Role Name",modelValue:n.dialog.data.name,"onUpdate:modelValue":c[4]||(c[4]=y=>n.dialog.data.name=y),busy:n.dialog.busy,error:n.dialog.error,onCancel:c[5]||(c[5]=y=>E.$emit("closeDialog"))},null,8,["modelValue","busy","error"])):n.dialog.type==="user-create"?(m(),p(C,{key:4},[o("p",vs,"Role: "+A(n.dialog.data.role.display_name),1),o("label",null,[c[17]||(c[17]=z("Display Name ",-1)),ne(o("input",{"onUpdate:modelValue":c[6]||(c[6]=y=>n.dialog.data.name=y),placeholder:"User display name",required:""},null,512),[[oe,n.dialog.data.name]])])],64)):n.dialog.type==="user-update-name"?(m(),G(me,{key:5,label:"Display Name",modelValue:n.dialog.data.name,"onUpdate:modelValue":c[7]||(c[7]=y=>n.dialog.data.name=y),busy:n.dialog.busy,error:n.dialog.error,onCancel:c[8]||(c[8]=y=>E.$emit("closeDialog"))},null,8,["modelValue","busy","error"])):n.dialog.type==="perm-create"||n.dialog.type==="perm-display"?(m(),p(C,{key:6},[o("label",null,[c[18]||(c[18]=z("Display Name ",-1)),ne(o("input",{ref:"displayNameInput","onUpdate:modelValue":c[9]||(c[9]=y=>n.dialog.data.display_name=y),required:""},null,512),[[oe,n.dialog.data.display_name]])]),o("label",null,[c[19]||(c[19]=z("Permission Scope ",-1)),ne(o("input",{"onUpdate:modelValue":c[10]||(c[10]=y=>n.dialog.data.scope=y),placeholder:n.dialog.type==="perm-create"?"yourapp:permission":n.dialog.data.permission.scope,required:"",pattern:n.PERMISSION_ID_PATTERN,title:"Allowed: A-Za-z0-9:._~-","data-form-type":"other"},null,8,ys),[[oe,n.dialog.data.scope]])]),c[21]||(c[21]=o("p",{class:"small muted"},"E.g. yourapp:reports. Changing the scope name may break deployed applications.",-1)),o("label",null,[c[20]||(c[20]=z("Domain Scope ",-1)),ne(o("input",{"onUpdate:modelValue":c[11]||(c[11]=y=>n.dialog.data.domain=y),placeholder:"e.g. app.example.com","data-form-type":"other"},null,512),[[oe,n.dialog.data.domain]])]),o("p",ps,"If set, this permission is effective only on the specified domain, which can be "+A(L.value)+" or its subdomain.",1)],64)):n.dialog.type==="confirm"?(m(),p("p",hs,A(n.dialog.data.message),1)):T("",!0),n.dialog.error&&!ge(S).has(n.dialog.type)?(m(),p("div",bs,A(n.dialog.error),1)):T("",!0),ge(S).has(n.dialog.type)?T("",!0):(m(),p("div",ws,[o("button",{type:"button",class:"btn-secondary",onClick:c[12]||(c[12]=y=>E.$emit("closeDialog")),disabled:n.dialog.busy}," Cancel ",8,$s),o("button",{type:"submit",class:"btn-primary",disabled:n.dialog.busy},A(n.dialog.type==="confirm"?"OK":"Save"),9,Ds)]))],32)]),_:1})):T("",!0)}},Ss=re(ks,[["__scopeId","data-v-8d16c6cc"]]),Os={class:"app-shell admin-shell"},Rs={class:"app-main"},Cs={key:4,class:"view-root view-root--wide view-admin"},As={class:"view-header"},Us={class:"section-block admin-section"},Es={class:"section-body admin-section-body"},Ms={class:"admin-panels"},Ps="^[A-Za-z0-9:._~-]+$",xs={__name:"AdminApp",setup(n){const V=k(null),Y=k(!0),S=k("Loading..."),L=k(!1),E=k(!1),c=k(null),y=k([]),x=k([]),N=k(null),B=k(null),q=k(null),w=Ae(),F=k(null);k(null),k(""),k(null),k("");const $=k({type:null,data:null,busy:!1,error:""}),_=k(null),Z=k(null),ee=k(null),g=k(null),u=k(null),f=I(()=>$.value.type!==null||ue.value),r=I(()=>V.value?.ctx.permissions.includes("auth:admin")),t=I(()=>V.value?.ctx.permissions.includes("auth:org:admin"));function s(e){if(!F.value)return;const a=e.target.closest(".org-add-menu"),i=e.target.closest(".add-org-btn");!a&&!i&&(F.value=null)}Se(async()=>{document.addEventListener("click",s),window.addEventListener("hashchange",d),await w.loadSettings(),w.settings?.rp_name&&(document.title=w.settings.rp_name+" Admin"),await Ee()}),Oe(()=>{document.removeEventListener("click",s),window.removeEventListener("hashchange",d)});const D=I(()=>{const e={};for(const i of y.value){const v={uuid:i.uuid,display_name:i.display_name},b=new Set(i.permissions||[]);for(const O of i.permissions||[])e[O]||(e[O]={orgs:[],orgSet:new Set,userCount:0}),e[O].orgSet.has(i.uuid)||(e[O].orgs.push(v),e[O].orgSet.add(i.uuid));for(const O of i.roles)for(const U of O.permissions)b.has(U)&&(e[U]||(e[U]={orgs:[],orgSet:new Set,userCount:0}),e[U].orgSet.has(i.uuid)||(e[U].orgs.push(v),e[U].orgSet.add(i.uuid)),e[U].userCount+=O.users.length)}const a={};for(const[i,v]of Object.entries(e))a[i]={orgs:v.orgs.sort((b,O)=>b.display_name.localeCompare(O.display_name)),userCount:v.userCount};return a});function l(e){Q("perm-display",{permission:e,scope:e.scope,display_name:e.display_name,domain:e.domain||""})}function d(){const e=window.location.hash||"";N.value=null,B.value=null,e.startsWith("#org/")?N.value=e.slice(5):e.startsWith("#user/")&&(B.value=e.slice(6))}async function h(){const e=await P("/auth/api/admin/orgs");y.value=e.map(a=>{const i=a.roles.map(b=>({...b,org:a.uuid,users:[]})),v=Object.fromEntries(i.map(b=>[b.display_name,b]));for(const b of a.users||[])v[b.role]&&v[b.role].users.push(b);return{...a,roles:i}})}async function R(){x.value=await P("/auth/api/admin/permissions")}async function j(){const e=await P("/auth/api/validate",{method:"POST"});V.value=e,L.value=!0}function M(){V.value=null,y.value=[],x.value=[],q.value=null,L.value=!1}function K(e){M(),e.name==="AuthCancelledError"?E.value=!0:c.value=e.message}const le=()=>V.value?.ctx.user.uuid,ve=new et(le,K);Se(()=>ve.start()),Oe(()=>ve.stop());async function Ee(){Y.value=!0,S.value="Loading...",c.value=null;try{await Promise.all([h(),R()]),await j(),!r.value&&t.value&&y.value.length===1&&(!window.location.hash||window.location.hash==="#overview")?(N.value=y.value[0].uuid,window.location.hash=`#org/${N.value}`,w.showMessage(`Navigating to ${y.value[0].display_name} Administration`,"info",3e3)):d()}catch(e){K(e)}finally{Y.value=!1}}function Me(){Q("org-create",{})}function ye(e){Q("org-update",{org:e,name:e.display_name})}function Pe(e){Q("user-update-name",{user:e,name:e.display_name})}async function pe(e){await P(`/auth/api/admin/orgs/${e}`,{method:"DELETE"}),await Promise.all([h(),R()])}function xe(e){if(e.roles.reduce((b,O)=>b+O.users.length,0)===0){pe(e.uuid).then(()=>{w.showMessage(`Organization "${e.display_name}" deleted.`,"success",2500)}).catch(b=>{w.showMessage(b.message||"Failed to delete organization","error")});return}const v=e.roles.filter(b=>b.users.length>0).map(b=>`${b.users.length} ${b.display_name}`).join(", ");Q("confirm",{message:`Delete organization "${e.display_name}", including accounts of ${v})?`,action:async()=>{await pe(e.uuid)}})}function qe(e,a){Q("user-create",{org:e,role:a})}async function Ne(e,a,i){if(a.role!==i)try{await P(`/auth/api/admin/orgs/${e.uuid}/users/${a.uuid}/role`,{method:"PATCH",body:{role:i}}),await h()}catch(v){w.showMessage(v.message||"Failed to update user role")}}function Te(e,a,i){e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify({user_uuid:a.uuid,org:i}))}function Le(e){e.preventDefault(),e.dataTransfer.dropEffect="move"}function Fe(e,a,i){e.preventDefault();try{const v=JSON.parse(e.dataTransfer.getData("text/plain"));if(v.org!==a.uuid)return;const b=a.roles.flatMap(O=>O.users).find(O=>O.uuid===v.user_uuid);b&&Ne(a,b,i.display_name)}catch{}}function Ie(e){Q("role-create",{org:e})}function Ke(e){Q("role-update",{role:e,name:e.display_name})}function Be(e){P(`/auth/api/admin/orgs/${e.org}/roles/${e.uuid}`,{method:"DELETE"}).then(()=>{w.showMessage(`Role "${e.display_name}" deleted.`,"success",2500),h()}).catch(a=>{w.showMessage(a.message||"Failed to delete role","error")})}async function ze(e,a,i){const v=[...e.permissions],b=i?[...e.permissions,a]:e.permissions.filter(O=>O!==a);e.permissions=b;try{const O=i?"POST":"DELETE";await P(`/auth/api/admin/orgs/${e.org}/roles/${e.uuid}/permissions/${a}`,{method:O}),await h()}catch(O){w.showMessage(O.message||"Failed to update role permission"),e.permissions=v}}async function he(e){const a=new URLSearchParams({permission_uuid:e});await P(`/auth/api/admin/permission?${a.toString()}`,{method:"DELETE"}),await R()}function Ve(e){const a=D.value[e.uuid]?.userCount||0;let i=0;for(const O of y.value)for(const U of O.roles)U.permissions.includes(e.uuid)&&i++;if(i===0){he(e.uuid).then(()=>{w.showMessage(`Permission "${e.display_name}" deleted.`,"success",2500)}).catch(O=>{w.showMessage(O.message||"Failed to delete permission","error")});return}const v=[];i>0&&v.push(`${i} role${i!==1?"s":""}`),a>0&&v.push(`${a} user${a!==1?"s":""}`);const b=v.join(", ");Q("confirm",{message:`Delete permission "${e.display_name}" (${b})?`,action:async()=>{await he(e.uuid)}})}const se=I(()=>y.value.find(e=>e.uuid===N.value)||null);function be(e){window.location.hash=`#org/${e.uuid}`}function je(){window.location.hash="#overview"}function He(e){window.location.hash=`#user/${e.uuid}`}const H=I(()=>{if(!B.value)return null;for(const e of y.value)for(const a of e.roles){const i=a.users.find(v=>v.uuid===B.value);if(i)return{...i,org:e.uuid,role_display_name:a.display_name}}return null}),Ge=I(()=>H.value?"Admin: User":se.value?"Admin: Org":(w.settings?.rp_name||"Master")+" Admin"),Je=I(()=>{const e=[{label:"Auth",href:tt()},{label:"Admin",href:st()}];let a=null;H.value&&(a=y.value.find(v=>v.uuid===H.value.org)||null);const i=se.value||a;return i&&e.push({label:i.display_name,href:`#org/${i.uuid}`}),H.value&&e.push({label:H.value.display_name,href:`#user/${H.value.uuid}`}),e});nt(H,async e=>{if(!e){q.value=null;return}try{q.value=await P(`/auth/api/admin/orgs/${e.org}/users/${e.uuid}`)}catch(a){q.value={error:a.message}}});const ue=k(!1);function Ye(e){ue.value=!0}async function We(e,a,i){const v=e.permissions.includes(a);if(i&&v||!i&&!v)return;const b=i?[...e.permissions,a]:e.permissions.filter(U=>U!==a),O=[...e.permissions];e.permissions=b;try{const U=new URLSearchParams({permission_uuid:a});await P(`/auth/api/admin/orgs/${e.uuid}/permission?${U.toString()}`,{method:i?"POST":"DELETE"}),await h()}catch(U){w.showMessage(U.message||"Failed to update organization permission","error"),e.permissions=O}}function Q(e,a){const i=document.activeElement;if(_.value=i,e==="confirm"&&i){const v=i.closest("tr");if(v){const b=v.closest("tbody");if(b){const O=Array.from(b.querySelectorAll("tr")),U=O.indexOf(v);$.value.focusContext={tbody:b,index:U,total:O.length,selector:"button:not([disabled]), a"}}}}$.value={...$.value,type:e,data:a,busy:!1,error:""}}function W(){const e=_.value,a=$.value.focusContext;$.value={type:null,data:null,busy:!1,error:""},Ze(e,a),_.value=null}function Ze(e,a){if(!e)return;if(document.body.contains(e)&&!e.disabled){e.focus();return}if(a?.tbody&&a.selector){const b=Array.from(a.tbody.querySelectorAll("tr"));if(b.length>0){const O=Math.min(a.index,b.length-1),de=b[O]?.querySelector(a.selector);if(de){de.focus();return}}}const i=document.querySelector(".admin-panels");if(!i)return;const v=i.querySelector('button:not([disabled]), a, input:not([disabled]), [tabindex="0"]');v&&v.focus()}function Qe(e){if(f.value)return;const a=J(e);a&&a==="down"&&(e.preventDefault(),ee.value?ee.value.focusFirstElement?.():g.value?g.value.focusFirstElement?.():u.value&&u.value.focusFirstElement?.())}function ce(e){f.value||e==="up"&&Z.value?.focusCurrent?.()}async function we(){if(await h(),H.value)try{q.value=await P(`/auth/api/admin/orgs/${H.value.org}/users/${H.value.uuid}`)}catch(e){w.showMessage(e.message||"Failed to reload user","error")}}async function $e(){await we(),w.showMessage("User renamed","success",1500)}async function Xe(){if(!(!$.value.type||$.value.busy)){$.value.busy=!0,$.value.error="";try{const e=$.value.type;if(e==="org-create"){const a=$.value.data.name?.trim();if(!a)throw new Error("Name required");W(),P("/auth/api/admin/orgs",{method:"POST",body:{display_name:a,permissions:[]}}).then(()=>{w.showMessage(`Organization "${a}" created.`,"success",2500),Promise.all([h(),R()])}).catch(i=>{w.showMessage(i.message||"Failed to create organization","error")});return}else if(e==="org-update"){const{org:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.uuid}`,{method:"PATCH",body:{display_name:i}}).then(()=>{w.showMessage(`Organization renamed to "${i}".`,"success",2500),h()}).catch(v=>{w.showMessage(v.message||"Failed to update organization","error")});return}else if(e==="role-create"){const{org:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.uuid}/roles`,{method:"POST",body:{display_name:i,permissions:[]}}).then(()=>{w.showMessage(`Role "${i}" created.`,"success",2500),h()}).catch(v=>{w.showMessage(v.message||"Failed to create role","error")});return}else if(e==="role-update"){const{role:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.org}/roles/${a.uuid}`,{method:"PATCH",body:{display_name:i}}).then(()=>{w.showMessage(`Role renamed to "${i}".`,"success",2500),h()}).catch(v=>{w.showMessage(v.message||"Failed to update role","error")});return}else if(e==="user-create"){const{org:a,role:i}=$.value.data,v=$.value.data.name?.trim();if(!v)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.uuid}/users`,{method:"POST",body:{display_name:v,role:i.display_name}}).then(()=>{w.showMessage(`User "${v}" added to ${i.display_name} role.`,"success",2500),h()}).catch(b=>{w.showMessage(b.message||"Failed to add user","error")});return}else if(e==="user-update-name"){const{user:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.org}/users/${a.uuid}/display-name`,{method:"PATCH",body:{display_name:i}}).then(()=>{w.showMessage(`User renamed to "${i}".`,"success",2500),$e()}).catch(v=>{w.showMessage(v.message||"Failed to update user name","error")});return}else if(e==="perm-display"){const{permission:a}=$.value.data,i=$.value.data.scope?.trim(),v=$.value.data.display_name?.trim(),b=$.value.data.domain?.trim()||"";if(!v)throw new Error("Display name required");if(!i)throw new Error("Scope required");W();const O=a.domain||"";if(i===a.scope&&v===a.display_name&&b===O)return;const U=new URLSearchParams({permission_uuid:a.uuid});i!==a.scope&&U.set("scope",i),v!==a.display_name&&U.set("display_name",v),b!==O&&U.set("domain",b||""),P(`/auth/api/admin/permission?${U.toString()}`,{method:"PATCH"}).then(()=>{w.showMessage(`Permission "${v}" updated.`,"success",2500),R()}).catch(de=>{w.showMessage(de.message||"Failed to update permission","error")});return}else if(e==="perm-create"){const a=$.value.data.scope?.trim();if(!a)throw new Error("Scope required");const i=$.value.data.display_name?.trim();if(!i)throw new Error("Display name required");const v=$.value.data.domain?.trim()||"";W(),P("/auth/api/admin/permissions",{method:"POST",body:{scope:a,display_name:i,domain:v||void 0}}).then(()=>{w.showMessage(`Permission "${i}" created.`,"success",2500),R()}).catch(b=>{w.showMessage(b.message||"Failed to create permission","error")});return}else if(e==="confirm"){const a=$.value.data.action;if(W(),a)try{await a()}catch(i){w.showMessage(i.message||"Action failed","error")}return}W()}catch(e){$.value.error=e.message||"Error"}finally{$.value.busy=!1}}}return(e,a)=>(m(),p("div",Os,[ae(ct),o("main",Rs,[Y.value?(m(),G(mt,{key:0,message:S.value},null,8,["message"])):E.value?(m(),G(fe,{key:1})):c.value?(m(),G(fe,{key:2,icon:"⚠️",title:"Error",message:c.value},null,8,["message"])):L.value&&!r.value&&!t.value?(m(),G(fe,{key:3,icon:"⛔",message:"You do not have admin permissions for this application."})):L.value&&(r.value||t.value)?(m(),p("section",Cs,[o("header",As,[o("h1",null,A(Ge.value),1),ae(ft,{ref_key:"breadcrumbsRef",ref:Z,entries:Je.value,onKeydown:Qe},null,8,["entries"])]),o("section",Us,[o("div",Es,[o("div",Ms,[!H.value&&!se.value&&(r.value||t.value)?(m(),G(It,{key:0,ref_key:"adminOverviewRef",ref:ee,info:V.value,orgs:y.value,permissions:x.value,"navigation-disabled":f.value,"permission-summary":D.value,onCreateOrg:Me,onOpenOrg:be,onUpdateOrg:ye,onDeleteOrg:xe,onToggleOrgPermission:We,onOpenDialog:Q,onDeletePermission:Ve,onRenamePermissionDisplay:l,onNavigateOut:ce},null,8,["info","orgs","permissions","navigation-disabled","permission-summary"])):H.value?(m(),G(cs,{key:1,ref_key:"adminUserDetailRef",ref:u,"selected-user":H.value,"user-detail":q.value,"selected-org":se.value,loading:Y.value,"show-reg-modal":ue.value,"navigation-disabled":f.value,onGenerateUserRegistrationLink:Ye,onGoOverview:je,onOpenOrg:be,onOnUserNameSaved:$e,onRefreshUserDetail:we,onEditUserName:Pe,onCloseRegModal:a[0]||(a[0]=i=>ue.value=!1),onNavigateOut:ce},null,8,["selected-user","user-detail","selected-org","loading","show-reg-modal","navigation-disabled"])):se.value?(m(),G(os,{key:2,ref_key:"adminOrgDetailRef",ref:g,"selected-org":se.value,permissions:x.value,"navigation-disabled":f.value,onUpdateOrg:ye,onCreateRole:Ie,onUpdateRole:Ke,onDeleteRole:Be,onCreateUserInRole:qe,onOpenUser:He,onToggleRolePermission:ze,onOnRoleDragOver:Le,onNavigateOut:ce,onOnRoleDrop:Fe,onOnUserDragStart:Te},null,8,["selected-org","permissions","navigation-disabled"])):T("",!0)])])])])):T("",!0)]),ae(Ss,{dialog:$.value,"permission-id-pattern":Ps,settings:ge(w).settings,onSubmitDialog:Xe,onCloseDialog:W},null,8,["dialog","settings"])]))}},qs=re(xs,[["__scopeId","data-v-6d820553"]]),Ue=ot(qs);Ue.use(gt());Ue.mount("#admin-app");at();