@kahitsan/plugin-sdk 0.7.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +40 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/shell/_build/.vite/manifest.json +20 -19
- package/shell/_build/.vite/manifest.json.br +0 -0
- package/shell/_build/.vite/manifest.json.gz +0 -0
- package/shell/_build/assets/{_...slug_-BcdF4l5Z.js → _...slug_-B4-_ue16.js} +1 -1
- package/shell/_build/assets/_...slug_-B4-_ue16.js.br +0 -0
- package/shell/_build/assets/_...slug_-B4-_ue16.js.gz +0 -0
- package/shell/_build/assets/auth-Cej23JxT.js +72 -0
- package/shell/_build/assets/auth-Cej23JxT.js.br +0 -0
- package/shell/_build/assets/auth-Cej23JxT.js.gz +0 -0
- package/shell/_build/assets/client-BC2r94zJ.js +2 -0
- package/shell/_build/assets/client-BC2r94zJ.js.br +0 -0
- package/shell/_build/assets/client-BC2r94zJ.js.gz +0 -0
- package/shell/_build/assets/client-DHSje8fl.css +1 -0
- package/shell/_build/assets/client-DHSje8fl.css.br +0 -0
- package/shell/_build/assets/client-DHSje8fl.css.gz +0 -0
- package/shell/_build/assets/{index-CwObwzl5.js → index-CHZcwpj8.js} +1 -1
- package/shell/_build/assets/plugin-ui-CpJUaqcE.js +10 -0
- package/shell/_build/assets/plugin-ui-CpJUaqcE.js.br +0 -0
- package/shell/_build/assets/plugin-ui-CpJUaqcE.js.gz +0 -0
- package/shell/_build/assets/workspace-nav-aH0jw7aW.js +1 -0
- package/shell/_build/assets/workspace-nav-aH0jw7aW.js.br +0 -0
- package/shell/_build/assets/workspace-nav-aH0jw7aW.js.gz +0 -0
- package/shell/_server/assets/app-DHSje8fl.css +1 -0
- package/shell/_server/assets/app-DHSje8fl.css.br +0 -0
- package/shell/_server/assets/app-DHSje8fl.css.gz +0 -0
- package/shell/index.html +1 -1
- package/shell/index.html.br +0 -0
- package/shell/index.html.gz +0 -0
- package/shell/_build/assets/_...slug_-BcdF4l5Z.js.br +0 -0
- package/shell/_build/assets/_...slug_-BcdF4l5Z.js.gz +0 -0
- package/shell/_build/assets/auth-DnjIzX2B.js +0 -70
- package/shell/_build/assets/auth-DnjIzX2B.js.br +0 -0
- package/shell/_build/assets/auth-DnjIzX2B.js.gz +0 -0
- package/shell/_build/assets/client-BmadCoeU.css +0 -1
- package/shell/_build/assets/client-BmadCoeU.css.br +0 -0
- package/shell/_build/assets/client-BmadCoeU.css.gz +0 -0
- package/shell/_build/assets/client-StEn6jq1.js +0 -2
- package/shell/_build/assets/client-StEn6jq1.js.br +0 -0
- package/shell/_build/assets/client-StEn6jq1.js.gz +0 -0
- package/shell/_build/assets/plugin-ui-CBTroTyb.js +0 -10
- package/shell/_build/assets/plugin-ui-CBTroTyb.js.br +0 -0
- package/shell/_build/assets/plugin-ui-CBTroTyb.js.gz +0 -0
- package/shell/_build/assets/workspace-nav-fkYL3-AV.js +0 -1
- package/shell/_build/assets/workspace-nav-fkYL3-AV.js.br +0 -0
- package/shell/_build/assets/workspace-nav-fkYL3-AV.js.gz +0 -0
- package/shell/_server/assets/app-BmadCoeU.css +0 -1
- package/shell/_server/assets/app-BmadCoeU.css.br +0 -0
- package/shell/_server/assets/app-BmadCoeU.css.gz +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_...slug_-BcdF4l5Z.js","assets/routing-C6AwqsGL.js","assets/plugin-ui-CBTroTyb.js","assets/auth-DnjIzX2B.js","assets/components-CWmQ2MDX.js","assets/api-keys-BNWgFkG0.js","assets/dashboard-pbkizuaa.js","assets/index-CwObwzl5.js","assets/workspace-nav-fkYL3-AV.js","assets/login-pbkizuaa.js","assets/members-49i-57sG.js","assets/register-pbkizuaa.js","assets/settings-pbkizuaa.js","assets/users-pbkizuaa.js","assets/workspace-settings-pbkizuaa.js","assets/workspaces-pbkizuaa.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as Rr,a as pe,b as Tr,d as Or,e as t,m as ae,g as Dr,R as Wr,u as qr,s as zt,f as jr,S as v,o as tr,h as Fr,i as Ur,j as Br,k as V,l as Ge,n as tt,p as ce,q as Vr,r as Hr,t as Kr,v as Gr,w as Qr,x as He,y as U,z as a,A as u,B as rr,C as nr,D as ht,E as ft,F as Re,G as ir,H as ze,I as ee,J as O,K as oe,L as Z,M as ie,N as Xr,O as Fe,P as Yr,Q as sr,T as St,U as Ie,V as Ct,W as Zr,X as Jr,Y as en}from"./routing-C6AwqsGL.js";import{w as tn,c as rn,r as nn,u as ar,f as Mt,n as we,e as Ce,d as sn,A as or,M as an,P as on,a as ln}from"./plugin-ui-CBTroTyb.js";import{I as H,u as Te,a as cn,b as un,c as Ue,d as lr,e as dn,S as pn,B as Nt,F as Et,x as Oe,f as De,g as hn,s as At,m as Pt,l as fn,h as mn,T as gn,A as vn}from"./auth-DnjIzX2B.js";import{b as bn,u as xn,l as wn,a as $n,m as kn,c as cr,d as yn,e as _n,i as zn,f as mt,s as ur}from"./workspace-nav-fkYL3-AV.js";import{A as ge}from"./components-CWmQ2MDX.js";const rt="Invariant Violation",{setPrototypeOf:Sn=function(e,n){return e.__proto__=n,e}}=Object;class gt extends Error{framesToPop=1;name=rt;constructor(n=rt){super(typeof n=="number"?`${rt}: ${n} (see https://github.com/apollographql/invariant-packages)`:n),Sn(this,gt.prototype)}}function nt(e,n){if(!e)throw new gt(n)}const Cn=/^[A-Za-z]:\//;function Mn(e=""){return e&&e.replace(/\\/g,"/").replace(Cn,n=>n.toUpperCase())}const Nn=/^[/\\]{2}/,En=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,An=/^[A-Za-z]:$/,Pn=function(e){if(e.length===0)return".";e=Mn(e);const n=e.match(Nn),r=at(e),i=e[e.length-1]==="/";return e=Ln(e,!r),e.length===0?r?"/":i?"./":".":(i&&(e+="/"),An.test(e)&&(e+="/"),n?r?`//${e}`:`//./${e}`:r&&!at(e)?`/${e}`:e)},dr=function(...e){if(e.length===0)return".";let n;for(const r of e)r&&r.length>0&&(n===void 0?n=r:n+=`/${r}`);return n===void 0?".":Pn(n.replace(/\/\/+/g,"/"))};function Ln(e,n){let r="",i=0,s=-1,o=0,d=null;for(let c=0;c<=e.length;++c){if(c<e.length)d=e[c];else{if(d==="/")break;d="/"}if(d==="/"){if(!(s===c-1||o===1))if(o===2){if(r.length<2||i!==2||r[r.length-1]!=="."||r[r.length-2]!=="."){if(r.length>2){const f=r.lastIndexOf("/");f===-1?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),s=c,o=0;continue}else if(r.length>0){r="",i=0,s=c,o=0;continue}}n&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+=`/${e.slice(s+1,c)}`:r=e.slice(s+1,c),i=c-s-1;s=c,o=0}else d==="."&&o!==-1?++o:o=-1}return r}const at=function(e){return En.test(e)};function In(e){return`virtual:${e}`}function Rn(e){return e.handler?.endsWith(".html")?at(e.handler)?e.handler:dr(e.root,e.handler):`$vinxi/handler/${e.name}`}const Tn=new Proxy({},{get(e,n){return nt(typeof n=="string","Bundler name should be a string"),{name:n,type:"client",handler:In(Rn({name:n})),baseURL:"/_build",chunks:new Proxy({},{get(r,i){nt(typeof i=="string","Chunk expected");let s=dr("/_build",i+".mjs");return{import(){return import(s)},output:{path:s}}}}),inputs:new Proxy({},{get(r,i){nt(typeof i=="string","Input must be string");let s=window.manifest[i].output;return{async import(){return import(s)},async assets(){return window.manifest[i].assets},output:{path:s}}}})}}});globalThis.MANIFEST=Tn;const On=e=>n=>{const{base:r}=n,i=Rr(()=>n.children),s=pe(()=>Tr(i(),n.base||""));let o;const d=Or(e,s,()=>o,{base:r,singleFlight:n.singleFlight,transformUrl:n.transformUrl});return e.create&&e.create(d),t(Wr.Provider,{value:d,get children(){return t(Dn,{routerState:d,get root(){return n.root},get preload(){return n.rootPreload||n.rootLoad},get children(){return[ae(()=>(o=Dr())&&null),t(Wn,{routerState:d,get branches(){return s()}})]}})}})};function Dn(e){const n=e.routerState.location,r=e.routerState.params,i=pe(()=>e.preload&&qr(()=>{zt(!0),e.preload({params:r,location:n,intent:jr()||"initial"}),zt(!1)}));return t(v,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:s=>t(s,{params:r,location:n,get data(){return i()},get children(){return e.children}})})}function Wn(e){const n=[];let r;const i=pe(tr(e.routerState.matches,(s,o,d)=>{let c=o&&s.length===o.length;const f=[];for(let l=0,w=s.length;l<w;l++){const h=o&&o[l],y=s[l];d&&h&&y.route.key===h.route.key?f[l]=d[l]:(c=!1,n[l]&&n[l](),Ur(k=>{n[l]=k,f[l]=Br(e.routerState,f[l-1]||e.routerState.base,Lt(()=>i()[l+1]),()=>{const $=e.routerState.matches();return $[l]??$[0]})}))}return n.splice(s.length).forEach(l=>l()),d&&c?d:(r=f[0],f)}));return Lt(()=>i()&&r)()}const Lt=e=>()=>t(v,{get when(){return e()},keyed:!0,children:n=>t(Fr.Provider,{value:n,get children(){return n.outlet()}})});function qn([e,n],r,i){return[e,i?s=>n(i(s)):n]}function jn(e){let n=!1;const r=s=>typeof s=="string"?{value:s}:s,i=qn(V(r(e.get()),{equals:(s,o)=>s.value===o.value&&s.state===o.state}),void 0,s=>(!n&&e.set(s),tt.registry&&!tt.done&&(tt.done=!0),s));return e.init&&Ge(e.init((s=e.get())=>{n=!0,i[1](r(s)),n=!1})),On({signal:i,create:e.create,utils:e.utils})}function Fn(e,n,r){return e.addEventListener(n,r),()=>e.removeEventListener(n,r)}function Un(e,n){const r=e&&document.getElementById(e);r?r.scrollIntoView():n&&window.scrollTo(0,0)}const Bn=new Map;function Vn({preload:e=!0,explicitLinks:n=!1,actionBase:r="/_server",transformUrl:i}={}){return s=>{const o=s.base.path(),d=s.navigatorFactory(s.base);let c,f;function l(m){return m.namespaceURI==="http://www.w3.org/2000/svg"}function w(m){if(m.defaultPrevented||m.button!==0||m.metaKey||m.altKey||m.ctrlKey||m.shiftKey)return;const C=m.composedPath().find(x=>x instanceof Node&&x.nodeName.toUpperCase()==="A");if(!C||n&&!C.hasAttribute("link"))return;const b=l(C),_=b?C.href.baseVal:C.href;if((b?C.target.baseVal:C.target)||!_&&!C.hasAttribute("state"))return;const q=(C.getAttribute("rel")||"").split(/\s+/);if(C.hasAttribute("download")||q&&q.includes("external"))return;const P=b?new URL(_,document.baseURI):new URL(_);if(!(P.origin!==window.location.origin||o&&P.pathname&&!P.pathname.toLowerCase().startsWith(o.toLowerCase())))return[C,P]}function h(m){const C=w(m);if(!C)return;const[b,_]=C,R=s.parsePath(_.pathname+_.search+_.hash),q=b.getAttribute("state");m.preventDefault(),d(R,{resolve:!1,replace:b.hasAttribute("replace"),scroll:!b.hasAttribute("noscroll"),state:q?JSON.parse(q):void 0})}function y(m){const C=w(m);if(!C)return;const[b,_]=C;i&&(_.pathname=i(_.pathname)),s.preloadRoute(_,b.getAttribute("preload")!=="false")}function k(m){clearTimeout(c);const C=w(m);if(!C)return f=null;const[b,_]=C;f!==b&&(i&&(_.pathname=i(_.pathname)),c=setTimeout(()=>{s.preloadRoute(_,b.getAttribute("preload")!=="false"),f=b},20))}function $(m){if(m.defaultPrevented)return;let C=m.submitter&&m.submitter.hasAttribute("formaction")?m.submitter.getAttribute("formaction"):m.target.getAttribute("action");if(!C)return;if(!C.startsWith("https://action/")){const _=new URL(C,Vr);if(C=s.parsePath(_.pathname+_.search),!C.startsWith(r))return}if(m.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const b=Bn.get(C);if(b){m.preventDefault();const _=new FormData(m.target,m.submitter);b.call({r:s,f:m.target},m.target.enctype==="multipart/form-data"?_:new URLSearchParams(_))}}ce(["click","submit"]),document.addEventListener("click",h),e&&(document.addEventListener("mousemove",k,{passive:!0}),document.addEventListener("focusin",y,{passive:!0}),document.addEventListener("touchstart",y,{passive:!0})),document.addEventListener("submit",$),Ge(()=>{document.removeEventListener("click",h),e&&(document.removeEventListener("mousemove",k),document.removeEventListener("focusin",y),document.removeEventListener("touchstart",y)),document.removeEventListener("submit",$)})}}function Hn(e){const n=()=>{const i=window.location.pathname.replace(/^\/+/,"/")+window.location.search,s=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:i+window.location.hash,state:s}},r=Gr();return jn({get:n,set({value:i,replace:s,scroll:o,state:d}){s?window.history.replaceState(Hr(d),"",i):window.history.pushState(d,"",i),Un(decodeURIComponent(window.location.hash.slice(1)),o),Kr()},init:i=>Fn(window,"popstate",Qr(i,s=>{if(s)return!r.confirm(s);{const o=n();return!r.confirm(o.value,{state:o.state})}})),create:Vn({preload:e.preload,explicitLinks:e.explicitLinks,actionBase:e.actionBase,transformUrl:e.transformUrl}),utils:{go:i=>window.history.go(i),beforeLeave:r}})(e)}function Kn(e){e.forEach(n=>{if(!n.attrs.href)return;let r=document.head.querySelector(`link[href="${n.attrs.href}"]`);r||(r=document.createElement("link"),r.setAttribute("rel","preload"),r.setAttribute("as","style"),r.setAttribute("href",n.attrs.href),document.head.appendChild(r))})}var Gn=u("<style>"),Qn=u("<link>"),Xn=u("<script> "),Yn=u("<noscript>");const Zn={style:e=>(()=>{var n=Gn();return He(n,U(()=>e.attrs),!1,!0),a(n,()=>e.children),n})(),link:e=>(()=>{var n=Qn();return He(n,U(()=>e.attrs),!1,!1),n})(),script:e=>e.attrs.src?(()=>{var n=Xn();return He(n,U(()=>e.attrs,{get id(){return e.key}}),!1,!0),n})():null,noscript:e=>(()=>{var n=Yn();return He(n,U(()=>e.attrs),!1,!0),n})()};function Jn(e,n){let{tag:r,attrs:{key:i,...s}={key:void 0},children:o}=e;return Zn[r]({attrs:{...s,nonce:n},key:i,children:o})}function ei(e,n,r,i="default"){return rr(async()=>{{const o=(await e.import())[i],c=(await n.inputs?.[e.src].assets()).filter(l=>l.tag==="style"||l.attrs.rel==="stylesheet");return typeof window<"u"&&Kn(c),{default:l=>[...c.map(w=>Jn(w)),t(o,l)]}}})}const Le={NORMAL:0,WILDCARD:1,PLACEHOLDER:2};function ti(e={}){const n={options:e,rootNode:pr(),staticRoutesMap:{}},r=i=>e.strictTrailingSlash?i:i.replace(/\/$/,"")||"/";if(e.routes)for(const i in e.routes)It(n,r(i),e.routes[i]);return{ctx:n,lookup:i=>ri(n,r(i)),insert:(i,s)=>It(n,r(i),s),remove:i=>ni(n,r(i))}}function ri(e,n){const r=e.staticRoutesMap[n];if(r)return r.data;const i=n.split("/"),s={};let o=!1,d=null,c=e.rootNode,f=null;for(let l=0;l<i.length;l++){const w=i[l];c.wildcardChildNode!==null&&(d=c.wildcardChildNode,f=i.slice(l).join("/"));const h=c.children.get(w);if(h===void 0){if(c&&c.placeholderChildren.length>1){const y=i.length-l;c=c.placeholderChildren.find(k=>k.maxDepth===y)||null}else c=c.placeholderChildren[0]||null;if(!c)break;c.paramName&&(s[c.paramName]=w),o=!0}else c=h}return(c===null||c.data===null)&&d!==null&&(c=d,s[c.paramName||"_"]=f,o=!0),c?o?{...c.data,params:o?s:void 0}:c.data:null}function It(e,n,r){let i=!0;const s=n.split("/");let o=e.rootNode,d=0;const c=[o];for(const f of s){let l;if(l=o.children.get(f))o=l;else{const w=ii(f);l=pr({type:w,parent:o}),o.children.set(f,l),w===Le.PLACEHOLDER?(l.paramName=f==="*"?`_${d++}`:f.slice(1),o.placeholderChildren.push(l),i=!1):w===Le.WILDCARD&&(o.wildcardChildNode=l,l.paramName=f.slice(3)||"_",i=!1),c.push(l),o=l}}for(const[f,l]of c.entries())l.maxDepth=Math.max(c.length-f,l.maxDepth||0);return o.data=r,i===!0&&(e.staticRoutesMap[n]=o),o}function ni(e,n){let r=!1;const i=n.split("/");let s=e.rootNode;for(const o of i)if(s=s.children.get(o),!s)return r;if(s.data){const o=i.at(-1)||"";s.data=null,Object.keys(s.children).length===0&&s.parent&&(s.parent.children.delete(o),s.parent.wildcardChildNode=null,s.parent.placeholderChildren=[]),r=!0}return r}function pr(e={}){return{type:e.type||Le.NORMAL,maxDepth:0,parent:e.parent||null,children:new Map,data:e.data||null,paramName:e.paramName||null,wildcardChildNode:null,placeholderChildren:[]}}function ii(e){return e.startsWith("**")?Le.WILDCARD:e[0]===":"||e==="*"?Le.PLACEHOLDER:Le.NORMAL}const si="modulepreload",ai=function(e){return"/_build/"+e},Rt={},fe=function(n,r,i){let s=Promise.resolve();if(r&&r.length>0){let d=function(l){return Promise.all(l.map(w=>Promise.resolve(w).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");s=d(r.map(l=>{if(l=ai(l),l in Rt)return;Rt[l]=!0;const w=l.endsWith(".css"),h=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const y=document.createElement("link");if(y.rel=w?"stylesheet":si,w||(y.as="script"),y.crossOrigin="",y.href=l,f&&y.setAttribute("nonce",f),document.head.appendChild(y),w)return new Promise((k,$)=>{y.addEventListener("load",k),y.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(d){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=d,window.dispatchEvent(c),!c.defaultPrevented)throw d}return s.then(d=>{for(const c of d||[])c.status==="rejected"&&o(c.reason);return n().catch(o)})},hr=[{page:!0,$component:{src:"src/routes/[...slug].tsx?pick=default&pick=$css",build:()=>fe(()=>import("./_...slug_-BcdF4l5Z.js"),__vite__mapDeps([0,1,2,3,4])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/[...slug].tsx?pick=default&pick=$css"].output.path))},path:"/*slug",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/[...slug].tsx"},{page:!0,$component:{src:"src/routes/api-keys.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./api-keys-BNWgFkG0.js"),__vite__mapDeps([5,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/api-keys.tsx?pick=default&pick=$css"].output.path))},path:"/api-keys",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/api-keys.tsx"},{page:!0,$component:{src:"src/routes/dashboard.tsx?pick=thisWeekToken&pick=thisYearToken&pick=default&pick=$css",build:()=>fe(()=>import("./dashboard-pbkizuaa.js"),__vite__mapDeps([6,4,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/dashboard.tsx?pick=thisWeekToken&pick=thisYearToken&pick=default&pick=$css"].output.path))},path:"/dashboard",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/dashboard.tsx"},{page:!0,$component:{src:"src/routes/index.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./index-CwObwzl5.js"),__vite__mapDeps([7,1,3,4,8])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/index.tsx?pick=default&pick=$css"].output.path))},path:"/",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/index.tsx"},{page:!0,$component:{src:"src/routes/login.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./login-pbkizuaa.js"),__vite__mapDeps([9,4,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/login.tsx?pick=default&pick=$css"].output.path))},path:"/login",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/login.tsx"},{page:!0,$component:{src:"src/routes/members.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./members-49i-57sG.js"),__vite__mapDeps([10,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/members.tsx?pick=default&pick=$css"].output.path))},path:"/members",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/members.tsx"},{page:!0,$component:{src:"src/routes/register.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./register-pbkizuaa.js"),__vite__mapDeps([11,4,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/register.tsx?pick=default&pick=$css"].output.path))},path:"/register",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/register.tsx"},{page:!0,$component:{src:"src/routes/settings.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./settings-pbkizuaa.js"),__vite__mapDeps([12,4,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/settings.tsx?pick=default&pick=$css"].output.path))},path:"/settings",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/settings.tsx"},{page:!0,$component:{src:"src/routes/users.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./users-pbkizuaa.js"),__vite__mapDeps([13,4,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/users.tsx?pick=default&pick=$css"].output.path))},path:"/users",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/users.tsx"},{page:!0,$component:{src:"src/routes/workspace-settings.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./workspace-settings-pbkizuaa.js"),__vite__mapDeps([14,4,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/workspace-settings.tsx?pick=default&pick=$css"].output.path))},path:"/workspace-settings",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/workspace-settings.tsx"},{page:!0,$component:{src:"src/routes/workspaces.tsx?pick=default&pick=$css",build:()=>fe(()=>import("./workspaces-pbkizuaa.js"),__vite__mapDeps([15,4,1])),import:(()=>import(globalThis.MANIFEST.client.inputs["src/routes/workspaces.tsx?pick=default&pick=$css"].output.path))},path:"/workspaces",filePath:"/home/runner/work/plugin-sdk/plugin-sdk/shell-src/src/routes/workspaces.tsx"}],oi=li(hr.filter(e=>e.page));function li(e){function n(r,i,s,o){const d=Object.values(r).find(c=>s.startsWith(c.id+"/"));return d?(n(d.children||(d.children=[]),i,s.slice(d.id.length)),r):(r.push({...i,id:s,path:s.replace(/\([^)/]+\)/g,"").replace(/\/+/g,"/")}),r)}return e.sort((r,i)=>r.path.length-i.path.length).reduce((r,i)=>n(r,i,i.path,i.path),[])}function ci(e){return e.$HEAD||e.$GET||e.$POST||e.$PUT||e.$PATCH||e.$DELETE}ti({routes:hr.reduce((e,n)=>{if(!ci(n))return e;let r=n.path.replace(/\([^)/]+\)/g,"").replace(/\/+/g,"/").replace(/\*([^/]*)/g,(i,s)=>`**:${s}`).split("/").map(i=>i.startsWith(":")||i.startsWith("*")?i:encodeURIComponent(i)).join("/");if(/:[^/]*\?/g.test(r))throw new Error(`Optional parameters are not supported in API routes: ${r}`);if(e[r])throw new Error(`Duplicate API routes for "${r}" found at "${e[r].route.path}" and "${n.path}"`);return e[r]={route:n},e},{})});function ui(){function e(r){return{...r,...r.$$route?r.$$route.require().route:void 0,info:{...r.$$route?r.$$route.require().route.info:{},filesystem:!0},component:r.$component&&ei(r.$component,globalThis.MANIFEST.client,globalThis.MANIFEST.ssr),children:r.children?r.children.map(e):void 0}}return oi.map(e)}let Tt;const di=()=>Tt||(Tt=ui());var pi=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],hi=e=>t(H,U(e,{iconNode:pi,name:"plus"})),vt=hi,fi=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mi=e=>t(H,U(e,{iconNode:fi,name:"triangle-alert"})),gi=mi;function vi(e){e&&queueMicrotask(()=>{const n='input:not([type="hidden"]):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])',r='input:not([type="hidden"]):not([disabled]), textarea:not([disabled]), select:not([disabled])',i=e.querySelector("[data-autofocus]");if(i){if(i.matches(n)){i.focus();return}const d=i.querySelector(n);if(d){d.focus();return}}const s=e.querySelector(r);if(s){s.focus();return}e.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')?.focus()})}var bi=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xi=e=>t(H,U(e,{iconNode:bi,name:"check"})),je=xi,wi=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],$i=e=>t(H,U(e,{iconNode:wi,name:"chevron-left"})),ki=$i,yi=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_i=e=>t(H,U(e,{iconNode:yi,name:"chevron-right"})),zi=_i,Si=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Ci=e=>t(H,U(e,{iconNode:Si,name:"clock"})),Mi=Ci,Ni=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ei=e=>t(H,U(e,{iconNode:Ni,name:"search"})),bt=Ei,Ai=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Pi=e=>t(H,U(e,{iconNode:Ai,name:"at-sign"})),Li=Pi,Ii=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Ri=e=>t(H,U(e,{iconNode:Ii,name:"bell"})),fr=Ri,Ti=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Oi=e=>t(H,U(e,{iconNode:Ti,name:"boxes"})),mr=Oi,Di=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Wi=e=>t(H,U(e,{iconNode:Di,name:"calendar-days"})),qi=Wi,ji=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Fi=e=>t(H,U(e,{iconNode:ji,name:"circle-alert"})),Ui=Fi,Bi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],Vi=e=>t(H,U(e,{iconNode:Bi,name:"circle-slash"})),Hi=Vi,Ki=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Gi=e=>t(H,U(e,{iconNode:Ki,name:"clipboard-list"})),Qi=Gi,Xi=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],Yi=e=>t(H,U(e,{iconNode:Xi,name:"corner-down-right"})),Zi=Yi,Ji=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],es=e=>t(H,U(e,{iconNode:Ji,name:"ellipsis"})),ts=es,rs=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ns=e=>t(H,U(e,{iconNode:rs,name:"eye"})),is=ns,ss=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],as=e=>t(H,U(e,{iconNode:ss,name:"file-text"})),os=as,ls=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cs=e=>t(H,U(e,{iconNode:ls,name:"info"})),us=cs,ds=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ps=e=>t(H,U(e,{iconNode:ds,name:"key-round"})),hs=ps,fs=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],ms=e=>t(H,U(e,{iconNode:fs,name:"message-square"})),gs=ms,vs=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],bs=e=>t(H,U(e,{iconNode:vs,name:"package"})),xs=bs,ws=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],$s=e=>t(H,U(e,{iconNode:ws,name:"panel-left-close"})),ks=$s,ys=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],_s=e=>t(H,U(e,{iconNode:ys,name:"panel-left"})),zs=_s,Ss=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Cs=e=>t(H,U(e,{iconNode:Ss,name:"pencil"})),Ms=Cs,Ns=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Es=e=>t(H,U(e,{iconNode:Ns,name:"refresh-cw"})),As=Es,Ps=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ls=e=>t(H,U(e,{iconNode:Ps,name:"settings"})),Ne=Ls,Is=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],Rs=e=>t(H,U(e,{iconNode:Is,name:"shopping-cart"})),Ts=Rs,Os=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Ds=e=>t(H,U(e,{iconNode:Os,name:"sliders-horizontal"})),Ws=Ds,qs=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],js=e=>t(H,U(e,{iconNode:qs,name:"store"})),Fs=js,Us=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Bs=e=>t(H,U(e,{iconNode:Us,name:"trash-2"})),Vs=Bs,Hs=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],Ks=e=>t(H,U(e,{iconNode:Hs,name:"trophy"})),Gs=Ks,Qs=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Xs=e=>t(H,U(e,{iconNode:Qs,name:"users"})),Ys=Xs,Zs=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Js=e=>t(H,U(e,{iconNode:Zs,name:"volume-2"})),ea=Js,ta=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],ra=e=>t(H,U(e,{iconNode:ta,name:"volume-x"})),na=ra,ia=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],sa=e=>t(H,U(e,{iconNode:ia,name:"workflow"})),aa=sa;async function oa(e){if(!e)return new Set;const n=await fetch("/api/capabilities",{credentials:"include",headers:{"X-Workspace-Id":String(e)}});if(!n.ok)return new Set;const r=await n.json();return new Set(r.capabilities.filter(i=>i.enabled).map(i=>i.key))}const gr=ht(()=>new Set),la=e=>{const{activeWorkspace:n}=Te(),[r]=nr(()=>n()?.ws_id,oa),i=()=>r()??new Set;return t(gr.Provider,{value:i,get children(){return e.children}})};function ca(){return ft(gr)}const vr=ht();let ua=100;const Ot=e=>n=>n.map(r=>r.id===e?{...r,leaving:!0}:r),Dt=e=>n=>n.filter(r=>r.id!==e),da=e=>{const[n,r]=V([]),[i,s]=V([]),o=()=>i().filter(l=>l.unread).length,d=(l,w,h)=>{const y=++ua,k=l==="achievement"?4500:3500;r($=>[...$,{id:y,type:l,title:w,desc:h,dur:k,leaving:!1}]),s($=>[{id:y,type:l,title:w,desc:h,time:"now",unread:!0},...$]),setTimeout(()=>r(Ot(y)),k),setTimeout(()=>r(Dt(y)),k+240)},c=l=>{r(Ot(l)),setTimeout(()=>r(Dt(l)),240)},f=()=>{s(l=>l.map(w=>({...w,unread:!1})))};return t(vr.Provider,{value:{toasts:n,notifications:i,unreadCount:o,pushToast:d,dismissToast:c,markAllRead:f},get children(){return e.children}})};function pa(){const e=ft(vr);if(!e)throw new Error("useNotifications must be used within NotificationProvider");return e}const ha={boxes:mr,"key-round":hs,users:Ys,"building-2":yn,receipt:nn,package:xs,"calendar-days":qi,"file-text":os,"credit-card":rn,"clipboard-list":Qi,"message-square":gs,wallet:tn,"shopping-cart":Ts,clock:Mi,store:Fs,"layout-dashboard":cr,megaphone:kn,activity:$n,"layout-grid":wn,"users-round":xn,"book-open":bn},it=mr,Wt=new Map,fa=/^[a-z][a-z0-9-]{0,40}$/;function ot(e){if(!e)return it;const n=ha[e];if(n)return n;if(!fa.test(e))return it;let r=Wt.get(e);return r||(r=rr(async()=>{try{return{default:(await fe(()=>import(`lucide-solid/icons/${e}`),[])).default}}catch{return{default:it}}}),Wt.set(e,r)),r}function ma(e){const n=r=>({href:r.path??"",label:r.label,icon:ot(r.icon),capability:r.capability,requiredPermission:r.requiredPermission});return e.map(r=>r.type==="group"?{kind:"section",id:r.id??"",label:r.label,icon:ot(r.icon),items:(r.children??[]).map(n)}:n(r))}const br=ht(),ga=e=>{const n=Re(),r=ir();cn();const{theme:i,toggleTheme:s}=un(),o=pa(),d=typeof window<"u"?window.matchMedia("(max-width: 819px)"):null,[c,f]=V(d?.matches??!1);d&&d.addEventListener("change",M=>f(M.matches));const l=typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,[w,h]=V(l?.matches??!1);l&&l.addEventListener("change",M=>h(M.matches));const[y,k]=V(null),$=()=>{const M=y();return M===null?c():M},m=()=>{k(!$()),et()},[C,b]=V("root"),[_,R]=V("in"),[q,P]=V(""),[x,L]=V(!0),[W,A]=V(null),[B,Q]=V(0),[le,j]=V(!1),[se,J]=V(!1),[ue,E]=V(!1),[N,g]=V(!1),[p,z]=V(""),S=Ue(),{activeWorkspace:D,setActiveWsId:F}=Te(),G=lr(),I=()=>S()?.user?.role==="superuser",K=()=>D(),te=()=>S()?.workspaces??[],re=()=>K()?.ws_role,be=()=>te().length>1,ve=pe(()=>{const M=p().trim().toLowerCase();return M?te().filter(T=>T.ws_name.toLowerCase().includes(M)):te()}),Xe=()=>te().length>2,Ye=()=>I()?"superuser":re()||"member",$e=ca(),Ee=ar(),ke=pe(()=>{const M=Ee.navTree();return M?ma(M):_n(Ee.plugins().filter(T=>T.nav).map(T=>({href:T.href,label:T.nav.label,icon:ot(T.nav.icon),capability:T.capabilityKey,requiredPermission:T.navPermission??void 0,section:T.nav.section??void 0,order:T.nav.order??void 0})))}),xe=M=>{if(M.capability&&!$e().has(M.capability))return!1;if(I()||re()==="admin")return!0;if(M.requiredPermission)return G.has(M.requiredPermission);if(M.allowedWorkspaceRoles){const T=re();return T?M.allowedWorkspaceRoles.includes(T):!1}return!!re()},Se=pe(()=>{const M=S()?.devMode===!0,T=[],ne=[];for(const X of ke())if(zn(X)){const de=X.items.filter(me=>xe(me));de.length>0&&T.push({section:X,visibleItems:de})}else if(xe(X)){if(M&&X.href==="/dashboard")continue;ne.push(X)}return{sections:T,items:ne}}),Ae=()=>q().trim().toLowerCase(),We=M=>{const T=q().trim();if(!T)return[{text:M,match:!1}];const ne=M.toLowerCase().indexOf(T.toLowerCase());return ne===-1?[{text:M,match:!1}]:[{text:M.slice(0,ne),match:!1},{text:M.slice(ne,ne+T.length),match:!0},{text:M.slice(ne+T.length),match:!1}].filter(X=>X.text.length>0)},ye=M=>{const T=Ae();return T?M.toLowerCase().includes(T):!0},Ze=pe(()=>{if(!Ae())return[];const T=[];for(const X of Se().sections){const de=X.visibleItems.filter(me=>ye(me.label)).map(me=>({item:me,section:X.section.label}));(ye(X.section.label)||de.length>0)&&T.push({section:{id:X.section.id,label:X.section.label,icon:X.section.icon},items:de})}const ne=Se().items.filter(X=>ye(X.label)).map(X=>({item:X,section:"Workspace"}));if(ne.length>0&&T.unshift({section:{id:"_root",label:"Workspace",icon:cr},items:ne}),I()){const X=mt.filter(de=>ye(de.label)).map(de=>({item:de,section:"Platform"}));X.length>0&&T.push({section:{id:"_platform",label:"Platform",icon:ur},items:X})}return T}),Be=pe(()=>{const M=C();return M==="root"?null:Se().sections.find(T=>T.section.id===M)??null}),wt=pe(()=>{const M=n.pathname;for(const T of Se().sections)for(const ne of T.visibleItems)if(M===ne.href||M.startsWith(ne.href+"/"))return T.section.id;return null});let $t="";ze(()=>{if(!S()?.devMode)return;const M=n.pathname,T=wt();T&&M!==$t&&($t=M,R("in"),b(T))});const zr=M=>n.pathname===M,kt=M=>n.pathname===M.href||n.pathname.startsWith(M.href+"/")?!0:M.children?.some(T=>n.pathname===T.href)??!1,Sr=M=>M.items.some(T=>kt(T));let _e;const Ve=M=>{if(x())try{_e=_e||new(window.AudioContext||window.webkitAudioContext),_e.state==="suspended"&&_e.resume(),M.forEach((T,ne)=>{const X=_e.createOscillator(),de=_e.createGain();X.type="square",X.frequency.value=T;const me=_e.currentTime+ne*.07;de.gain.setValueAtTime(1e-4,me),de.gain.exponentialRampToValueAtTime(.06,me+.004),de.gain.exponentialRampToValueAtTime(1e-4,me+.07),X.connect(de),de.connect(_e.destination),X.start(me),X.stop(me+.08)})}catch{}},Cr=()=>Ve([760]),Je=()=>Ve([620]),yt=()=>Ve([360]),_t=()=>Ve([520]),Mr=M=>{R("in"),b(M),_t()},Nr=()=>{R("out"),b("root"),yt()},Er=M=>{r(M),A(null),P(""),Je()},Ar=M=>{r(M),b("root"),R("out"),P(""),g(!1),A(null),Je()},et=()=>{J(!1),j(!1),A(null),E(!1),g(!1),P("")},Pr=M=>{if(S()?.devMode){F(M.ws_id),J(!1),fetch("/api/_dev/view-as",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({workspaceId:M.ws_id})}).then(()=>window.location.reload()).catch(()=>window.location.reload());return}F(M.ws_id),J(!1),z(""),r("/",{replace:!0})},Lr=async()=>{await dn.signOut(),r("/login",{replace:!0})};if(typeof window<"u"){const M=T=>{(T.metaKey||T.ctrlKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),$()?(g(ne=>!ne),J(!1),j(!1),A(null)):document.querySelector("[data-sidebar-search]")?.focus()),T.key==="Escape"&&(P(""),et())};document.addEventListener("keydown",M),Ge(()=>document.removeEventListener("keydown",M))}if(typeof window<"u"){const M=T=>{const ne=T.target;ne&&(ne.closest("[data-user-menu]")||E(!1))};document.addEventListener("click",M),Ge(()=>document.removeEventListener("click",M))}const Ir={theme:i,toggleTheme:s,notifCtx:o,reducedMotion:w,collapsed:$,toggleCollapse:m,level:C,dir:_,query:q,setQuery:P,soundOn:x,setSoundOn:L,flyoutId:W,setFlyoutId:A,flyoutTop:B,setFlyoutTop:Q,notifOpen:le,setNotifOpen:j,wsOpen:se,setWsOpen:J,userMenuOpen:ue,setUserMenuOpen:E,searchFlyoutOpen:N,setSearchFlyoutOpen:g,wsQuery:p,setWsQuery:z,me:S,perms:G,isSuperuser:I,currentWorkspace:K,allWorkspaces:te,workspaceRole:re,hasMultipleOrgs:be,filteredWorkspaces:ve,showWorkspaceSearch:Xe,displayRole:Ye,navEntries:ke,canSee:xe,visibleEntries:Se,queryTrimmed:Ae,highlightSegments:We,matchesQuery:ye,nestedSearchResults:Ze,currentSection:Be,activeParent:wt,isActive:zr,isActiveOrChild:kt,sectionContainsActive:Sr,tickHover:Cr,tickClick:Je,tickBack:yt,tickSection:_t,goInto:Mr,goBack:Nr,choose:Er,chooseResult:Ar,closeAllPops:et,switchWorkspace:Pr,handleLogout:Lr};return t(br.Provider,{value:Ir,get children(){return e.children}})},he=()=>{const e=ft(br);if(!e)throw new Error("useSidebarState must be used within a SidebarStateProvider");return e},Y={"clip-path":"polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px)"},Qe={success:{icon:je,ring:"border-emerald-500/50",dot:"bg-emerald-400",text:"text-emerald-300"},info:{icon:us,ring:"border-sky-500/50",dot:"bg-sky-400",text:"text-sky-300"},warning:{icon:gi,ring:"border-amber-500/50",dot:"bg-amber-400",text:"text-amber-300"},error:{icon:Ui,ring:"border-red-500/50",dot:"bg-red-400",text:"text-red-300"},achievement:{icon:Gs,ring:"border-amber-400/70",dot:"bg-amber-300",text:"text-amber-300"}},va={admin:"text-amber-400 bg-amber-500/10 border-amber-500/20",accountant:"text-blue-400 bg-blue-500/10 border-blue-500/20",director:"text-emerald-400 bg-emerald-500/10 border-emerald-500/20",office_staff:"text-cyan-400 bg-cyan-500/10 border-cyan-500/20",workspace_member:"text-zinc-300 bg-zinc-700/30 border-zinc-600/30",superuser:"text-red-400 bg-red-500/10 border-red-500/20"},xr=e=>{const n=e.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():e.slice(0,2).toUpperCase()};var ba=u('<button type=button class="text-[10px] text-amber-300/90 hover:text-amber-300 cursor-pointer">Mark all read'),xa=u('<div class="fixed z-50 w-[252px] bg-zinc-900 border border-zinc-700/70 shadow-2xl shadow-black/60"role=dialog aria-label=Notifications style=top:8px><div class="flex items-center justify-between px-3 py-2 border-b border-zinc-800/70"><span class="text-[12px] font-semibold text-zinc-200">Notifications</span></div><div class="max-h-[280px] overflow-y-auto"></div><button type=button class="w-full text-center text-[11px] text-zinc-400 hover:text-zinc-200 py-2 cursor-pointer">View all'),wa=u('<div><div class="min-w-0 flex-1"><p class="text-[12px] text-zinc-200 leading-tight truncate"></p><p class="text-[11px] text-zinc-500 truncate"></p></div><span class="text-[10px] text-zinc-600 shrink-0">');const $a=()=>{const{notifOpen:e,collapsed:n,reducedMotion:r,notifCtx:i}=he();return t(v,{get when(){return e()},get children(){var s=xa(),o=s.firstChild;o.firstChild;var d=o.nextSibling;return a(o,t(v,{get when(){return i.unreadCount()>0},get children(){var c=ba();return c.$$click=()=>i.markAllRead(),c}}),null),a(d,t(ee,{get each(){return i.notifications()},children:c=>{const f=Qe[c.type]??Qe.info,l=f.icon;return(()=>{var w=wa(),h=w.firstChild,y=h.firstChild,k=y.nextSibling,$=h.nextSibling;return a(w,t(l,{size:15,get class(){return`shrink-0 mt-0.5 ${f.text}`}}),h),a(y,()=>c.title),a(k,()=>c.desc),a($,()=>c.time),O(()=>oe(w,`flex gap-2.5 px-3 py-2.5 border-b border-zinc-800/40 ${c.unread?"bg-amber-500/[0.04]":""}`)),w})()}})),O(c=>Z(s,{left:n()?"80px":"264px",...Y,...r()?{}:{animation:"pop .14s ease"}},c)),s}})};ce(["click"]);var ka=u('<div class="text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded p-3 mb-4">Only workspace admins can edit permissions.'),ya=u('<div class="text-xs text-zinc-500 text-center py-10">Loading…'),_a=u("<div class=space-y-3>"),za=u('<span class="text-[11px] text-zinc-500">Pick a role to start granting permissions'),Sa=u('<div class="mt-4 flex items-center gap-2">'),Ca=u('<div class="mt-4 p-2 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-xs">'),Ma=u(`<div class="flex flex-col min-h-0"><div class="flex-1 overflow-x-hidden overflow-y-auto p-5"><div class="flex items-start gap-2 rounded-lg border border-amber-500/20 bg-amber-500/5 p-3 mb-4"><div class="text-[11px] text-amber-200/90 leading-relaxed"><span class="font-medium text-amber-300">Admin</span> is a built-in role for every workspace. Admins of <span class=text-amber-200></span> always have full access to this page, so there's nothing to configure for them here.</div></div></div><div class="flex items-center justify-end gap-2 p-4 border-t border-zinc-800">`),Na=u('<div class="rounded-lg border border-dashed border-zinc-800 bg-zinc-900/30 p-6 text-center mb-4"><p class="text-xs text-zinc-500 mb-3">No roles are configured for this page yet. Admins always have access; add a role below to grant additional access.'),Ea=u('<div class="text-[11px] text-zinc-500 mt-0.5">'),Aa=u('<div class="mt-3 pt-3 border-t border-zinc-800 grid grid-cols-1 sm:grid-cols-2 gap-2">'),Pa=u('<div class="rounded-lg border border-zinc-800 bg-zinc-900/40 p-4"><div class="flex items-start justify-between gap-3 mb-3"><div class=min-w-0><div class="text-sm font-medium text-white truncate"></div></div><div class="flex items-center gap-2 shrink-0"><div class="inline-flex rounded-md border border-zinc-700 overflow-hidden text-[11px]"></div><button type=button class="text-zinc-500 hover:text-red-400 transition-colors cursor-pointer">'),La=u('<span class="block text-[10px] text-zinc-500 mt-0.5">'),Ia=u('<label class="flex items-start gap-2 p-2 rounded border border-zinc-800 hover:border-zinc-700 cursor-pointer transition-colors"><input type=checkbox class="mt-0.5 accent-amber-500"><span class="flex-1 min-w-0"><span class="block text-xs text-zinc-200 font-medium">'),Ra=u('<p class="text-[11px] text-zinc-500 italic">Every role in this workspace is already configured for this page.'),Ta=u('<button type=button class="inline-flex items-center gap-1 px-2 py-1 text-[11px] transition-colors cursor-pointer"><span>');function lt(e){return new Set(e.filter(n=>!n.is_destructive).map(n=>n.code))}function Oa(e,n){const r=n.map(s=>s.code),i=n.find(s=>s.action==="view")?.code;switch(e){case"none":return new Set;case"viewer":return new Set(i?[i]:[]);case"editor":return lt(n);case"full":return new Set(r);case"custom":return new Set}}function Da(e){return e.filter(r=>!r.is_destructive).some(r=>r.action!=="view")}function ct(e){return e.every(n=>!n.is_destructive)}function wr(e,n){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}function qt(e){return(n,r)=>{const i=e.find(o=>o.code===n),s=e.find(o=>o.code===r);return(i?.sort_order??0)-(s?.sort_order??0)}}function Wa(e,n,r,i){if(e.size===0)return!0;const s=n.find(o=>o.action==="view")?.code;return!!(s&&e.size===1&&e.has(s)||wr(e,r)&&!ct(n)||e.size===i)}function qa(e,n,r){const i=new Set;for(const s of n)s.role_code===e&&s.allowed&&r.has(s.permission_code)&&i.add(s.permission_code);return i}function ja(e,n){const r=new Set(n),i=new Map;for(const s of e){if(!s.allowed||!r.has(s.permission_code))continue;const o=i.get(s.role_code)??new Set;o.add(s.permission_code),i.set(s.role_code,o)}return i}function Fa(e,n,r){const i=[];for(const[s,o]of e){const d=n.get(s)??new Set;for(const c of r){const f=o.has(c),l=d.has(c);f!==l&&i.push({role_code:s,permission_code:c,allowed:f})}}return i}function Ua(e){const n=Ue(),{activeWorkspace:r}=Te(),i=lr(),s=()=>r()?.ws_id??null,[o,d]=V(null),[c,f]=V(!1),l=async()=>{const E=s();if(E){f(!0);try{const N=await fetch(`/api/workspaces/${E}/role-permissions`,{credentials:"include",headers:{"X-Workspace-Id":String(E)}});if(!N.ok){d(null);return}d(await N.json())}catch{d(null)}finally{f(!1)}}};ze(()=>{e.active&&s()&&l()});const[w,h]=V(new Map),[y,k]=V([]),[$,m]=V(new Set),[C,b]=V(!1),[_,R]=V("");ze(()=>{const E=o();if(!E)return;const N=E.permissions.filter(F=>F.module===e.module),g=new Set(N.map(F=>F.code)),p=new Map,z=[],S=new Set,D=lt(N);for(const F of E.roles){if(F.code==="admin")continue;const G=qa(F.code,E.grants,g);p.set(F.code,G),G.size>0&&(z.push(F.code),Wa(G,N,D,g.size)||S.add(F.code))}h(p),k(z.sort(qt(E.roles))),m(S),R("")});const q=pe(()=>{const E=o();return E?E.permissions.filter(N=>N.module===e.module).sort((N,g)=>N.sort_order-g.sort_order):[]}),P=pe(()=>{const E=o();return E?E.roles.filter(N=>N.code!=="admin"):[]}),x=pe(()=>{const E=new Set(y());return P().filter(N=>!E.has(N.code))}),L=E=>w().get(E)??new Set,W=E=>{if($().has(E))return"custom";const N=q(),g=N.map(D=>D.code),p=N.find(D=>D.action==="view")?.code,z=L(E);if(z.size===0)return"none";if(p&&z.size===1&&z.has(p))return"viewer";const S=lt(N);return wr(z,S)&&!ct(N)?"editor":z.size===g.length?"full":"custom"},A=(E,N)=>{h(g=>{const p=new Map(g);return p.set(E,N),p})},B=(E,N)=>{h(g=>{const p=new Map(g),z=new Set(p.get(E)??[]);return z.has(N)?z.delete(N):z.add(N),p.set(E,z),p})},Q=(E,N)=>{const g=q();if(N==="custom"){m(p=>{const z=new Set(p);return z.add(E),z});return}m(p=>{const z=new Set(p);return z.delete(E),z}),A(E,Oa(N,g))},le=E=>{k(N=>{if(N.includes(E))return N;const p=o()?.roles??[];return[...N,E].sort(qt(p))}),h(N=>{const g=new Map(N);return g.has(E)||g.set(E,new Set),g})},j=E=>{k(N=>N.filter(g=>g!==E)),h(N=>{const g=new Map(N);return g.set(E,new Set),g}),m(N=>{const g=new Set(N);return g.delete(E),g})},se=async()=>{const E=s();if(!E)return;const g=q().map(D=>D.code),p=o(),z=ja(p?.grants??[],g),S=Fa(w(),z,g);if(S.length===0){e.onClose?.();return}b(!0),R("");try{const D=await fetch(`/api/workspaces/${E}/role-permissions`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json","X-Workspace-Id":String(E)},body:JSON.stringify({grants:S})});if(!D.ok){const F=await D.json().catch(()=>({}));R(F.error||"Failed to save permissions");return}await l(),i.refetch(),e.onSaved?.(),e.onClose?.()}catch(D){R(D.message||"Failed to save permissions")}finally{b(!1)}},J=()=>n()?.user?.role==="superuser"||r()?.ws_role==="admin",ue=E=>o()?.roles.find(N=>N.code===E);return(()=>{var E=Ma(),N=E.firstChild,g=N.firstChild,p=g.firstChild,z=p.firstChild,S=z.nextSibling,D=S.nextSibling,F=N.nextSibling;return a(N,t(v,{get when(){return!J()},get children(){return ka()}}),g),a(g,t(ur,{size:14,class:"text-amber-400 mt-0.5 shrink-0"}),p),a(D,()=>r()?.ws_name),a(N,t(v,{get when(){return c()},get children(){return ya()}}),null),a(N,t(v,{get when(){return ae(()=>!c())()&&o()},get children(){return[t(v,{get when(){return y().length>0},get fallback(){return Na()},get children(){var G=_a();return a(G,t(ee,{get each(){return y()},children:I=>{const K=()=>W(I),te=()=>ue(I);return(()=>{var re=Pa(),be=re.firstChild,ve=be.firstChild,Xe=ve.firstChild,Ye=ve.nextSibling,$e=Ye.firstChild,Ee=$e.nextSibling;return a(Xe,()=>te()?.label??I),a(ve,t(v,{get when(){return te()?.description},get children(){var ke=Ea();return a(ke,()=>te().description),ke}}),null),a($e,t(qe,{get active(){return K()==="none"},onClick:()=>Q(I,"none"),icon:Hi,label:"No access"}),null),a($e,t(qe,{get active(){return K()==="viewer"},onClick:()=>Q(I,"viewer"),icon:is,label:"Viewer"}),null),a($e,t(v,{get when(){return ae(()=>!!Da(q()))()&&!ct(q())},get children(){return t(qe,{get active(){return K()==="editor"},onClick:()=>Q(I,"editor"),icon:Ms,label:"Editor"})}}),null),a($e,t(qe,{get active(){return K()==="full"},onClick:()=>Q(I,"full"),icon:je,label:"Full access"}),null),a($e,t(qe,{get active(){return K()==="custom"},onClick:()=>Q(I,"custom"),icon:Ws,label:"Custom"}),null),Ee.$$click=()=>j(I),a(Ee,t(Vs,{size:13})),a(re,t(v,{get when(){return K()==="custom"},get children(){var ke=Aa();return a(ke,t(ee,{get each(){return q()},children:xe=>{const Se=()=>L(I).has(xe.code);return(()=>{var Ae=Ia(),We=Ae.firstChild,ye=We.nextSibling,Ze=ye.firstChild;return We.addEventListener("change",()=>B(I,xe.code)),a(Ze,()=>xe.label),a(ye,t(v,{get when(){return xe.description},get children(){var Be=La();return a(Be,()=>xe.description),Be}}),null),O(()=>We.checked=Se()),Ae})()}})),ke}}),null),O(()=>ie(Ee,"title",`Remove ${te()?.label??I} from this page`)),re})()}})),G}}),(()=>{var G=Sa();return a(G,t(v,{get when(){return x().length>0},get fallback(){return Ra()},get children(){return[t(pn,{value:null,placeholder:"+ Add role",searchPlaceholder:"Search roles…",get options(){return x().map(I=>({value:I.code,label:I.label,description:I.description??void 0}))},onChange:I=>{I&&le(String(I.value))},triggerClass:"inline-flex items-center gap-1.5 text-xs text-amber-400/90 hover:text-amber-300 bg-amber-500/5 hover:bg-amber-500/10 border border-amber-500/20 rounded px-3 py-1.5 cursor-pointer transition-colors",noMatchLabel:"No matching roles",emptyLabel:"No roles available"}),t(v,{get when(){return y().length===0},get children(){return[t(vt,{size:11,class:"text-amber-400/60"}),za()]}})]}})),G})()]}}),null),a(N,t(v,{get when(){return _()},get children(){var G=Ca();return a(G,_),G}}),null),a(F,t(Nt,{intent:"secondary",variant:"clip2",type:"button",get disabled(){return C()},onClick:()=>e.onClose?.(),children:"Cancel"}),null),a(F,t(Nt,{intent:"primary",variant:"clip1",type:"button",get disabled(){return C()||!J()},onClick:se,get children(){return C()?"Saving…":"Save permissions"}}),null),E})()}function qe(e){return(()=>{var n=Ta(),r=n.firstChild;return n.$$click=()=>e.onClick(),a(n,t(Xr,{get component(){return e.icon},size:11}),r),a(r,()=>e.label),O(i=>Fe(n,{"bg-amber-500/10 text-amber-400":e.active,"text-zinc-400 hover:text-zinc-200":!e.active},i)),n})()}ce(["click"]);var Ba=u('<select class="text-[11px] bg-zinc-900 border border-zinc-700 rounded px-2 py-1 text-zinc-200 cursor-pointer">'),Va=u('<div class="flex items-center justify-between gap-3 mb-3"><p class="text-[11px] text-zinc-500">How <span class=text-zinc-300></span> works — drag nodes to arrange, click a node to focus its connections, scroll to zoom.</p><div class="flex shrink-0 items-center gap-2"><a class="text-[11px] rounded border border-zinc-700 px-2 py-1 text-zinc-300 hover:bg-zinc-800"title="Open full-screen flow spec (its own URL — survives refresh)"aria-label="Open full-screen flow spec">⤢ Full screen'),Ha=u('<p class="text-[11px] text-zinc-500 mb-3">Which roles can act on <span class=text-zinc-300></span>. Admins always have full access and are omitted. Drag to pan, scroll to zoom.'),Ka=u('<div class="flex flex-col min-h-0"><div class="flex items-center gap-1 px-5 pt-4"></div><div class="flex-1 overflow-auto p-5">'),Ga=u('<div class="text-xs text-zinc-500 text-center py-10">Loading…'),Qa=u('<div class="text-xs text-red-400 text-center py-10">'),Xa=u("<option>"),Ya=u('<button type=button class="px-3 py-1.5 text-xs rounded-md transition-colors cursor-pointer">');const Za={create:"Create",add:"Add",new:"Create",edit:"Edit",update:"Update",delete:"Delete",remove:"Delete",archive:"Archive",restore:"Restore",void:"Void",settle:"Settle",charge:"Charge",pay:"Pay",refund:"Refund",regenerate:"Regenerate",export:"Export",approve:"Approve",reject:"Reject",toggle:"Toggle"},Ja=new Set(["create","add","new","edit","update"]),Ke=e=>e.replace(/[^a-zA-Z0-9]+/g,"_");function eo(e,n,r){const i=e.permissions.map(l=>l.split(".").slice(1).join(".")).filter(l=>l&&l.split(".")[0]!=="view"),s=[we("open","trigger",`Open ${e.label}`,{out:[Ce("data")]})],o=[],d=[];for(const l of i){const w=l.split(".")[0].toLowerCase(),h=Za[w]??w.charAt(0).toUpperCase()+w.slice(1),y=`act_${Ke(l)}`;if(o.push(Ce(y,h)),Ja.has(w)){const k=`${y}_form`,$=`${y}_commit`;s.push(we(y,"trigger",`${h} button`,{out:[Ce(k)]})),s.push(we(k,"modal",`${e.label} form`,{out:[Ce($)]})),s.push(we($,"commit",h,{detail:`${e.key}.${l}`})),d.push($)}else{const k=`${y}_commit`;s.push(we(y,"trigger",`${h} button`,{out:[Ce(k)]})),s.push(we(k,"commit",h,{detail:`${e.key}.${l}`})),d.push(k)}}s.push(we("data","data",`${e.label} list`,{out:o}));const c=s.find(l=>l.id===(d[0]??"data"));c.out=c.out??[];const f=new Set;for(const l of n){const w=`call_${Ke(l.provider)}_${Ke(l.capability)}`;f.has(w)||(f.add(w),s.push(we(w,"call",`${r.get(l.provider)??l.provider}.${l.capability}`,{detail:`${l.provider}:${l.capability}`})),c.out.push(Ce(w,l.granted?void 0:"ungranted")))}for(const l of e.emits){const w=`emit_${Ke(l)}`;s.push(we(w,"emit",l)),c.out.push(Ce(w))}return sn({id:`${e.key}.surface`,title:e.label,nodes:s})}function to(e){const{activeWorkspace:n}=Te(),r=()=>n()?.ws_id??null,i=Re(),s=()=>`/${i.pathname.split("/").filter(Boolean)[0]||e.module}.spec`,[o,d]=V("flow"),[c,f]=V(null),[l,w]=V(null),[h,y]=V(!1),[k,$]=V("");ze(()=>{const x=r();if(!e.active||!x)return;const L=o();L==="flow"&&c()||L==="permissions"&&l()||m(L,x)});const m=async(x,L)=>{y(!0),$("");try{const W=x==="flow"?"/api/plugins/graph":`/api/workspaces/${L}/role-permissions`,A=await fetch(W,{credentials:"include",headers:{"X-Workspace-Id":String(L)}});if(!A.ok){$("Could not load this view.");return}const B=await A.json();x==="flow"?f(B):w(B)}catch{$("Could not load this view.")}finally{y(!1)}},C=()=>c()?.plugins.find(x=>x.key===e.module),b=()=>C()?.flows??[],[_,R]=V(0),q=pe(()=>{const x=c(),L=C();if(!x||!L)return{nodes:[],edges:[]};const W=b();if(W.length)return Mt(W[Math.min(_(),W.length-1)]);const A=new Map(x.plugins.map(Q=>[Q.name,Q.label])),B=x.edges.filter(Q=>Q.consumer===L.name);return Mt(eo(L,B,A))}),P=pe(()=>{const x=l();if(!x)return{nodes:[],edges:[]};const L=x.permissions.filter(j=>j.module===e.module).sort((j,se)=>Number(j.is_destructive)-Number(se.is_destructive)),W=new Set(L.map(j=>j.code)),A=new Set(x.grants.filter(j=>j.allowed&&W.has(j.permission_code)).map(j=>j.permission_code)),Q=[...x.roles.filter(j=>j.code!=="admin"&&x.grants.some(se=>se.role_code===j.code&&se.allowed&&W.has(se.permission_code))).map(j=>({id:`role:${j.code}`,label:j.label,sublabel:"role",accent:"info",lane:0})),...L.map(j=>({id:`perm:${j.code}`,label:j.label,sublabel:j.is_destructive?"destructive":"action",accent:A.has(j.code)?"primary":"muted",lane:1}))],le=x.grants.filter(j=>j.allowed&&W.has(j.permission_code)&&j.role_code!=="admin").map(j=>({from:`role:${j.role_code}`,to:`perm:${j.permission_code}`,accent:"success"}));return{nodes:Q,edges:le}});return(()=>{var x=Ka(),L=x.firstChild,W=L.nextSibling;return a(L,t(jt,{get active(){return o()==="flow"},onClick:()=>d("flow"),label:"Flow"}),null),a(L,t(jt,{get active(){return o()==="permissions"},onClick:()=>d("permissions"),label:"Permissions"}),null),a(W,t(v,{get when(){return!h()},get fallback(){return Ga()},get children(){return t(v,{get when(){return!k()},get fallback(){return(()=>{var A=Qa();return a(A,k),A})()},get children(){return[t(v,{get when(){return o()==="flow"},get children(){return[(()=>{var A=Va(),B=A.firstChild,Q=B.firstChild,le=Q.nextSibling,j=B.nextSibling,se=j.firstChild;return a(le,()=>e.moduleLabel),a(j,t(v,{get when(){return b().length>1},get children(){var J=Ba();return J.addEventListener("change",ue=>R(Number(ue.currentTarget.value))),a(J,t(ee,{get each(){return b()},children:(ue,E)=>(()=>{var N=Xa();return a(N,()=>ue.title),O(()=>N.value=E()),N})()})),O(()=>J.value=_()),J}}),se),O(()=>ie(se,"href",s())),A})(),t(Et,{get nodes(){return q().nodes},get edges(){return q().edges},layout:"layered",direction:"vertical",interactive:!0,animated:!0,height:440,get ariaLabel(){return`${e.moduleLabel} interaction flow`},emptyLabel:"This plugin declares no cross-plugin calls or events."})]}}),t(v,{get when(){return o()==="permissions"},get children(){return[(()=>{var A=Ha(),B=A.firstChild,Q=B.nextSibling;return a(Q,()=>e.moduleLabel),A})(),t(Et,{get nodes(){return P().nodes},get edges(){return P().edges},layout:"bipartite",interactive:!0,animated:!0,height:340,get ariaLabel(){return`${e.moduleLabel} role to permission map`},emptyLabel:"No roles are granted access to this page yet."})]}})]}})}})),x})()}function jt(e){return(()=>{var n=Ya();return n.$$click=()=>e.onClick(),a(n,()=>e.label),O(r=>Fe(n,{"bg-amber-500/10 text-amber-300":e.active,"text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50":!e.active},r)),n})()}ce(["click"]);var ro=u('<div class="fixed inset-0 z-[9999] flex items-center justify-center bg-black/60"><div class="card-bg rounded-xl border border-amber-500/30 w-full max-w-3xl max-h-[90vh] overflow-hidden flex flex-col"role=dialog aria-modal=true><div class="flex items-start justify-between p-5 border-b border-zinc-800"><div class="flex items-start gap-3"><div><h2 class="text-base font-semibold text-white"> settings</h2><p class="text-xs text-zinc-500 mt-0.5">Sharing & flow for <span class=text-zinc-300></span></p></div></div><button type=button class="text-zinc-500 hover:text-zinc-200 transition-colors cursor-pointer"title=Close aria-label=Close></button></div><div class="flex items-center gap-1 px-3 pt-2 border-b border-zinc-800/60"></div><div class="flex-1 min-h-0 overflow-hidden"><div class=h-full></div><div class=h-full>'),no=u('<button type=button class="px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer">');function io(e){const{activeWorkspace:n}=Te(),[r,i]=V("share");return t(Yr,{get children(){var s=ro(),o=s.firstChild,d=o.firstChild,c=d.firstChild,f=c.firstChild,l=f.firstChild,w=l.firstChild,h=l.nextSibling,y=h.firstChild,k=y.nextSibling,$=c.nextSibling,m=d.nextSibling,C=m.nextSibling,b=C.firstChild,_=b.nextSibling;return s.$$click=()=>e.onClose(),o.$$click=R=>R.stopPropagation(),sr(vi,o),a(c,t(Ne,{size:20,class:"text-amber-400 shrink-0 mt-0.5"}),f),a(l,()=>e.moduleLabel,w),a(k,()=>n()?.ws_name),$.$$click=()=>e.onClose(),a($,t(Oe,{size:18})),a(m,t(Ft,{get active(){return r()==="share"},onClick:()=>i("share"),label:"Share"}),null),a(m,t(Ft,{get active(){return r()==="flow"},onClick:()=>i("flow"),label:"Connections"}),null),a(b,t(Ua,{get module(){return e.module},get moduleLabel(){return e.moduleLabel},get active(){return ae(()=>!!e.open)()&&r()==="share"},onClose:()=>e.onClose()})),a(_,t(to,{get module(){return e.module},get moduleLabel(){return e.moduleLabel},get active(){return ae(()=>!!e.open)()&&r()==="flow"}})),O(R=>{var q={"opacity-0 pointer-events-none invisible":!e.open},P=`${e.moduleLabel} settings`,x=r()!=="share",L=r()!=="flow";return R.e=Fe(s,q,R.e),P!==R.t&&ie(o,"aria-label",R.t=P),x!==R.a&&b.classList.toggle("hidden",R.a=x),L!==R.o&&_.classList.toggle("hidden",R.o=L),R},{e:void 0,t:void 0,a:void 0,o:void 0}),s}})}function Ft(e){return(()=>{var n=no();return n.$$click=()=>e.onClick(),a(n,()=>e.label),O(r=>Fe(n,{"border-amber-400 text-amber-300":e.active,"border-transparent text-zinc-400 hover:text-zinc-200":!e.active},r)),n})()}ce(["click"]);var so=u("<button type=button>");function ut(e){const n=Ue(),r=De(),{activeWorkspace:i}=Te(),s=Re(),[o,d]=V(!1),[c,f]=V(!1);ze(tr(()=>s.pathname,()=>d(!1),{defer:!0}));const l=()=>r()||n()?.user?.role==="superuser"||i()?.ws_role==="admin",w=h=>{h.preventDefault(),h.stopPropagation(),f(!0),d(!0)};return t(v,{get when(){return l()},get children(){return[(()=>{var h=so();return h.$$click=w,a(h,t(Ne,{size:14})),O(y=>{var k=`${e.moduleLabel} settings`,$=`${e.moduleLabel} settings`,m=`inline-flex items-center justify-center w-6 h-6 rounded text-zinc-500 hover:text-amber-300 hover:bg-amber-500/10 transition-colors cursor-pointer ${e.class??""}`;return k!==y.e&&ie(h,"aria-label",y.e=k),$!==y.t&&ie(h,"title",y.t=$),m!==y.a&&oe(h,y.a=m),y},{e:void 0,t:void 0,a:void 0}),h})(),t(v,{get when(){return c()},get children(){return t(io,{get module(){return e.module},get moduleLabel(){return e.moduleLabel},get open(){return o()},onClose:()=>d(!1)})}})]}})}ce(["click"]);var ao=u('<div class="fixed z-50 w-[180px] bg-zinc-900 border border-zinc-700/70 shadow-2xl shadow-black/60 p-1.5"role=dialog style=left:76px><p class="text-[10px] uppercase tracking-[0.16em] text-zinc-600 px-2 py-1">'),oo=u('<div class="relative flex items-center"><button type=button><span class="text-[12px] truncate">');const lo=()=>{const{flyoutId:e,flyoutTop:n,reducedMotion:r,visibleEntries:i,isActive:s,choose:o}=he();return t(v,{get when(){return e()},children:d=>{const c=pe(()=>i().sections.find(f=>f.section.id===d()));return t(v,{get when(){return c()},children:f=>(()=>{var l=ao(),w=l.firstChild;return a(w,()=>f().section.label),a(l,t(ee,{get each(){return f().visibleItems},children:h=>{const y=h.icon;return(()=>{var k=oo(),$=k.firstChild,m=$.firstChild;return $.$$click=()=>o(h.href),a($,t(y,{size:15,class:"shrink-0"}),m),a(m,()=>h.label),a(k,t(v,{get when(){return h.capability},get children(){return t(ut,{get module(){return h.capability},get moduleLabel(){return h.label},class:"absolute right-1 top-1/2 -translate-y-1/2"})}}),null),O(()=>oe($,`navrow flex-1 min-w-0 flex items-center gap-2.5 px-2 py-2 cursor-pointer text-left ${h.capability?"pr-8":""} ${s(h.href)?"text-amber-300 bg-amber-500/[0.10]":"text-zinc-300 hover:bg-zinc-800/60"}`)),k})()}}),null),O(h=>{var y={top:`${Math.max(8,n())}px`,...Y,...r()?{}:{animation:"pop .14s ease"}},k=f().section.label;return h.e=Z(l,y,h.e),k!==h.t&&ie(l,"aria-label",h.t=k),h},{e:void 0,t:void 0}),l})()})}})};ce(["click"]);var co=u('<span class="grid place-items-center bg-gradient-to-br from-amber-400 to-orange-600 text-zinc-900 font-bold tracking-tight shrink-0"aria-hidden=true>'),uo=u("<img alt=Hilinga>"),po=u("<span>"),ho=u("<span aria-hidden>"),fo=u('<mark class="bg-amber-500/25 text-amber-200 rounded-sm px-0.5">');const dt=e=>(()=>{var n=co();return a(n,()=>xr(e.name)),O(r=>Z(n,{width:`${e.size??30}px`,height:`${e.size??30}px`,"font-size":`${Math.max(8,Math.floor((e.size??30)*.4))}px`,...Y},r)),n})(),$r=e=>(()=>{var n=uo();return O(r=>{var i=hn("/pwa-192.png"),s=e.size??16,o=e.size??16,d=`rounded shrink-0 ${e.class??""}`,c=`${e.size??16}px`,f=`${e.size??16}px`;return i!==r.e&&ie(n,"src",r.e=i),s!==r.t&&ie(n,"width",r.t=s),o!==r.a&&ie(n,"height",r.a=o),d!==r.o&&oe(n,r.o=d),c!==r.i&&St(n,"width",r.i=c),f!==r.n&&St(n,"height",r.n=f),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})(),mo=()=>{const{displayRole:e}=he();return(()=>{var n=po();return a(n,e),O(()=>oe(n,`inline-block text-[8px] font-semibold px-1.5 py-[1px] border uppercase tracking-[0.12em] leading-[1.2] ${va[e()]||"text-zinc-400 bg-zinc-800 border-zinc-700"}`)),n})()},Me=e=>{const{reducedMotion:n}=he();return(()=>{var r=ho();return O(i=>{var s=`absolute left-0 ${e.inset} w-[3px] bg-amber-400`,o=n()?void 0:{animation:"pulseBar 2s ease-in-out infinite"};return s!==i.e&&oe(r,i.e=s),i.t=Z(r,o,i.t),i},{e:void 0,t:void 0}),r})()},pt=e=>{const{highlightSegments:n}=he();return t(ee,{get each(){return n(e.label)},children:r=>t(v,{get when(){return r.match},get fallback(){return ae(()=>r.text)},get children(){var i=fo();return a(i,()=>r.text),i}})})};var go=u('<button type=button class="text-zinc-600 hover:text-zinc-300 cursor-pointer"aria-label="Clear search">'),vo=u('<div class="fixed z-50 w-[262px] bg-zinc-900 border border-zinc-700/70 shadow-2xl shadow-black/60 p-2"style=left:80px;top:8px><div class="w-full flex items-center gap-2 h-9 bg-zinc-950/60 border border-zinc-700/60 focus-within:border-amber-500/60 pl-2.5 pr-1.5"><input type=text placeholder="Search all menus…"class="text-[12px] text-zinc-200 placeholder:text-zinc-500 flex-1 min-w-0 bg-transparent border-0 outline-none"></div><div class="mt-2 max-h-[320px] overflow-y-auto">'),bo=u('<p class="text-[12px] text-zinc-600 px-3 py-6 text-center">Type to search every section.'),xo=u('<p class="text-[12px] text-zinc-600 px-3 py-6 text-center">Nothing matches “<!>”.'),wo=u('<div><p class="text-[10px] uppercase tracking-[0.16em] text-zinc-600 px-2 py-1">'),$o=u('<button type=button><span class="flex-1 text-[12px] truncate">');const ko=()=>{const{searchFlyoutOpen:e,collapsed:n,reducedMotion:r,query:i,setQuery:s,queryTrimmed:o,nestedSearchResults:d,isActive:c,chooseResult:f}=he();return t(v,{get when(){return ae(()=>!!e())()&&n()},get children(){var l=vo(),w=l.firstChild,h=w.firstChild,y=w.nextSibling;return a(w,t(bt,{size:14,class:"text-zinc-500 shrink-0"}),h),h.$$input=k=>s(k.currentTarget.value),sr(k=>{queueMicrotask(()=>k?.focus())},h),a(w,t(v,{get when(){return i().length>0},get children(){var k=go();return k.$$click=()=>s(""),a(k,t(Oe,{size:13})),k}}),null),a(y,t(v,{get when(){return o()},get fallback(){return bo()},get children(){return t(v,{get when(){return d().length>0},get fallback(){return(()=>{var k=xo(),$=k.firstChild,m=$.nextSibling;return m.nextSibling,a(k,()=>i().trim(),m),k})()},get children(){return t(ee,{get each(){return d()},children:k=>(()=>{var $=wo(),m=$.firstChild;return a(m,()=>k.section.label),a($,t(ee,{get each(){return k.items},children:C=>{const b=C.item.icon,_=()=>c(C.item.href);return(()=>{var R=$o(),q=R.firstChild;return R.$$click=()=>f(C.item.href),a(R,t(b,{size:15,class:"shrink-0"}),q),a(q,t(pt,{get label(){return C.item.label}})),O(()=>oe(R,`navrow w-full flex items-center gap-2.5 px-2.5 py-2 text-left cursor-pointer ${_()?"text-amber-300 bg-amber-500/[0.10]":"text-zinc-300 hover:bg-zinc-800/60"}`)),R})()}}),null),$})()})}})}})),O(k=>{var $={...Y,...r()?{}:{animation:"pop .14s ease"}},m=Y;return k.e=Z(l,$,k.e),k.t=Z(w,m,k.t),k},{e:void 0,t:void 0}),O(()=>h.value=i()),l}})};ce(["input","click"]);var yo=u('<div class="fixed bottom-4 right-4 z-[60] flex flex-col gap-2 w-[300px] pointer-events-none">'),_o=u('<p class="text-[9px] uppercase tracking-[0.2em] text-amber-400/80 mb-0.5">Achievement'),zo=u('<div><div class="flex items-start gap-2.5 p-3"><span></span><div class="min-w-0 flex-1"><p class="text-[13px] font-semibold text-zinc-100 leading-tight"></p><p class="text-[11px] text-zinc-400 leading-snug mt-0.5"></p></div><button type=button class="text-zinc-600 hover:text-zinc-300 cursor-pointer shrink-0"aria-label="Dismiss notification"></button></div><span>');const So=()=>{const{notifCtx:e,reducedMotion:n}=he();return(()=>{var r=yo();return a(r,t(ee,{get each(){return e.toasts()},children:i=>{const s=Qe[i.type]??Qe.info,o=s.icon,d=i.type==="achievement";return(()=>{var c=zo(),f=c.firstChild,l=f.firstChild,w=l.nextSibling,h=w.firstChild,y=h.nextSibling,k=w.nextSibling,$=f.nextSibling;return a(l,t(o,{size:15,get class(){return s.text}})),a(w,t(v,{when:d,get children(){return _o()}}),h),a(h,()=>i.title),a(y,()=>i.desc),k.$$click=()=>e.dismissToast(i.id),a(k,t(Oe,{size:13})),O(m=>{var C=`pointer-events-auto relative overflow-hidden bg-zinc-900 border ${s.ring} shadow-2xl shadow-black/50 ${d?"ring-1 ring-amber-400/30":""}`,b={...Y,...n()?{}:{animation:`${i.leaving?"toastOut":"toastIn"} .24s cubic-bezier(.2,.8,.2,1) forwards`}},_=`grid place-items-center w-7 h-7 shrink-0 border ${s.ring} ${d?"bg-amber-500/15":""}`,R=Y,q=`absolute bottom-0 left-0 h-[2px] ${s.dot}`,P=n()?void 0:{animation:`bar ${i.dur}ms linear forwards`};return C!==m.e&&oe(c,m.e=C),m.t=Z(c,b,m.t),_!==m.a&&oe(l,m.a=_),m.o=Z(l,R,m.o),q!==m.i&&oe($,m.i=q),m.n=Z($,P,m.n),m},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),c})()}})),r})()};ce(["click"]);var Co=u('<div class="px-2 py-1.5 border-b border-zinc-800"><input type=text placeholder="Search workspaces\\u2026"autofocus class="w-full px-2 py-1.5 text-xs bg-zinc-950 border border-zinc-800 text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:border-amber-500/50">'),Mo=u('<div class="h-px bg-zinc-800/70 my-1">'),Ut=u("<span class=text-[12px]>Workspace Settings"),Bt=u('<span class="text-[9px] uppercase tracking-wider text-zinc-600 border border-zinc-700/50 px-1 py-px rounded ml-auto">test'),No=u('<button type=button class="navrow w-full flex items-center gap-2.5 px-2 py-2 hover:bg-zinc-800/60 cursor-pointer text-left text-zinc-400"><span class="grid place-items-center border border-zinc-700 shrink-0"style=width:26px;height:26px></span><span class=text-[12px]>Add workspace'),Eo=u('<div class="fixed z-50 w-[228px] bg-zinc-900 border border-zinc-700/70 shadow-2xl shadow-black/60 p-1.5"role=dialog aria-label="Switch workspace"style=left:8px;top:52px><p class="text-[10px] uppercase tracking-[0.16em] text-zinc-600 px-2 py-1">Switch workspace</p><div class="max-h-64 overflow-y-auto">'),Ao=u('<div class="fixed z-50 w-[228px] bg-zinc-900 border border-zinc-700/70 shadow-2xl shadow-black/60 p-1.5"role=dialog aria-label="Switch workspace"style=left:76px;top:10px><p class="text-[10px] uppercase tracking-[0.16em] text-zinc-600 px-2 py-1">Switch workspace</p><div class="h-px bg-zinc-800/70 my-1">'),Po=u('<div class="px-3 py-3 text-xs text-zinc-500 text-center">No matches'),Vt=u('<button type=button class="navrow w-full flex items-center gap-2.5 px-2 py-2 hover:bg-zinc-800/60 cursor-pointer text-left"><span>');const Lo=()=>{const e=De(),{wsOpen:n,collapsed:r,currentWorkspace:i,reducedMotion:s,showWorkspaceSearch:o,wsQuery:d,setWsQuery:c,filteredWorkspaces:f,switchWorkspace:l,setWsOpen:w}=he();return[t(v,{get when(){return ae(()=>!!(n()&&!r()))()&&i()},get children(){var h=Eo(),y=h.firstChild,k=y.nextSibling;return a(h,t(v,{get when(){return o()},get children(){var $=Co(),m=$.firstChild;return m.$$input=C=>c(C.currentTarget.value),O(C=>Z(m,Y,C)),O(()=>m.value=d()),$}}),k),a(k,t(ee,{get each(){return f()},get fallback(){return Po()},children:$=>(()=>{var m=Vt(),C=m.firstChild;return m.$$click=()=>l($),a(m,t(dt,{get name(){return $.ws_name},size:26}),C),a(C,()=>$.ws_name),a(m,t(v,{get when(){return $.ws_id===i()?.ws_id},get children(){return t(je,{size:14,class:"text-amber-300 shrink-0"})}}),null),O(()=>oe(C,`text-[12px] truncate flex-1 ${$.ws_id===i()?.ws_id?"text-amber-400":"text-zinc-200"}`)),m})()}),null),a(k,t(v,{get when(){return!e()},get children(){return[Mo(),t(ge,{href:"/workspace-settings",onClick:()=>w(!1),class:"navrow w-full flex items-center gap-2.5 px-2 py-2 hover:bg-zinc-800/60 cursor-pointer text-left text-zinc-400",get children(){return[t(Ne,{size:14,class:"shrink-0"}),Ut(),Bt()]}}),(()=>{var $=No(),m=$.firstChild;return a(m,t(vt,{size:14})),O(C=>Z(m,{...Y},C)),$})()]}}),null),O($=>Z(h,{...Y,...s()?{}:{animation:"pop .14s ease"}},$)),h}}),t(v,{get when(){return ae(()=>!!(n()&&r()))()&&i()},get children(){var h=Ao(),y=h.firstChild,k=y.nextSibling;return a(h,t(ee,{get each(){return f()},children:$=>(()=>{var m=Vt(),C=m.firstChild;return m.$$click=()=>l($),a(m,t(dt,{get name(){return $.ws_name},size:26}),C),a(C,()=>$.ws_name),a(m,t(v,{get when(){return $.ws_id===i()?.ws_id},get children(){return t(je,{size:14,class:"text-amber-300 shrink-0"})}}),null),O(()=>oe(C,`text-[12px] truncate flex-1 ${$.ws_id===i()?.ws_id?"text-amber-400":"text-zinc-200"}`)),m})()}),k),a(h,t(ge,{href:"/workspace-settings",onClick:()=>w(!1),class:"navrow w-full flex items-center gap-2.5 px-2 py-2 hover:bg-zinc-800/60 cursor-pointer text-left text-zinc-400",get children(){return[t(Ne,{size:14,class:"shrink-0"}),Ut(),Bt()]}}),null),O($=>Z(h,{...Y,...s()?{}:{animation:"pop .14s ease"}},$)),h}})]};ce(["input","click"]);var Io=u('<div class="mx-2 mb-1 pb-1 border-b border-zinc-800/70 text-center"><span class="text-[9px] text-zinc-600 tracking-wide">v'),Ro=u('<button type=button class="w-full flex items-center justify-between gap-3 px-3 py-2 text-[12px] text-zinc-300 hover:bg-zinc-800/50 transition-colors"><span class="flex items-center gap-2 min-w-0"><span class=truncate></span></span><span class="ks-theme-toggle-track shrink-0 pointer-events-none"aria-hidden=true><span class="ks-theme-toggle-icon ks-theme-toggle-icon-moon"></span><span class="ks-theme-toggle-icon ks-theme-toggle-icon-sun">'),To=u("<span>Settings"),Ht=u('<div class="my-1 mx-2 border-t border-zinc-800/70">'),Oo=u('<div class="px-3 py-1 text-[9px] uppercase tracking-wider text-blue-300/70"> route'),Do=u('<a class="w-full flex items-center gap-2 px-3 py-1.5 text-[12px] text-zinc-300 hover:bg-blue-500/5 transition-colors"><span>View flow'),Wo=u('<div class="px-3 py-1 text-[9px] uppercase tracking-wider text-blue-300/70">View as user'),qo=u('<div class="px-3 pt-1.5 pb-1 text-[9px] uppercase tracking-wider text-blue-300/70">Role'),jo=u('<div class="flex flex-wrap gap-1 px-3 pb-1.5"><button type=button class="px-1.5 py-0.5 text-[10px] rounded border border-dashed border-zinc-600 text-zinc-400 hover:border-blue-500/40 hover:text-blue-200 flex items-center gap-0.5"> role'),Fo=u('<div class="text-[9px] text-blue-300/50"> permissions (this route)'),Uo=u('<div class="mx-3 mb-2 p-2 rounded border border-blue-500/20 bg-blue-500/[0.04] flex flex-col gap-1.5"><input type=text placeholder="role name (e.g. accountant)"class="w-full bg-zinc-900 border border-zinc-700 rounded px-1.5 py-1 text-[11px] text-zinc-200 focus:outline-none focus:border-blue-400/50"><div class="flex flex-col gap-0.5 max-h-32 overflow-y-auto"></div><button type=button class="text-[10px] rounded border border-blue-400/50 bg-blue-500/15 text-blue-100 px-2 py-1 disabled:opacity-40 hover:bg-blue-500/25">Create & apply role'),Bo=u('<button type=button class="w-full flex items-center gap-2 px-3 py-2 text-[12px] text-zinc-400 hover:text-red-400 hover:bg-red-500/5 transition-colors"><span>Sign out'),Vo=u('<button type=button class="w-full flex items-center justify-between gap-2 px-3 py-1.5 text-[12px] text-zinc-300 hover:bg-blue-500/5 transition-colors"><span class=truncate>'),Ho=u('<button type=button class="px-2 py-0.5 text-[10px] rounded border transition-colors">'),Ko=u('<label class="flex items-center gap-1.5 text-[10px] text-zinc-300 cursor-pointer"><input type=checkbox class=accent-blue-500><span class=truncate>'),Go=u('<div class="fixed z-50 w-[200px] bg-zinc-900 border border-zinc-700/70 shadow-2xl shadow-black/60 py-1"role=dialog aria-label="User menu"data-user-menu style=left:80px;bottom:12px>'),Qo=u('<div data-user-menu class="absolute left-0 right-0 bottom-full mb-1 z-50 bg-zinc-900 border border-zinc-700/70 shadow-2xl shadow-black/60 py-1"role=dialog aria-label="User menu">');async function Kt(e){await fetch("/api/_dev/view-as",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),window.location.reload()}async function Xo(e,n){await fetch("/api/_dev/roles",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e,permissions:n})}),window.location.reload()}const Gt=()=>{const{theme:e,toggleTheme:n,setUserMenuOpen:r,handleLogout:i}=he(),s=De(),o=Ue(),[d]=nr(s,async()=>{const b=await fetch("/api/_dev/info");return b.ok?await b.json():null}),c=Re(),f=()=>{const b=c.pathname.split("/")[1]??"";return d()?.plugins?.find(_=>_.routeBase===b)},l=()=>f()?.permissions??d()?.pluginPermissions??[],[w,h]=V(!1),[y,k]=V(""),[$,m]=V([]),C=b=>m(_=>_.includes(b)?_.filter(R=>R!==b):[..._,b]);return[(()=>{var b=Io(),_=b.firstChild;return _.firstChild,a(_,()=>"0.0.0",null),b})(),(()=>{var b=Ro(),_=b.firstChild,R=_.firstChild,q=_.nextSibling,P=q.firstChild,x=P.nextSibling;return b.$$click=()=>n(),a(_,t(v,{get when(){return e()==="dark"},get fallback(){return t(Pt,{size:13,class:"text-zinc-500"})},get children(){return t(At,{size:13,class:"text-zinc-500"})}}),R),a(R,()=>e()==="dark"?"Light mode":"Dark mode"),a(P,t(Pt,{size:12})),a(x,t(At,{size:12})),O(L=>{var W=`Switch to ${e()==="dark"?"light":"dark"} mode`,A=e()==="light"?"":void 0;return W!==L.e&&ie(b,"aria-label",L.e=W),A!==L.t&&ie(q,"data-active",L.t=A),L},{e:void 0,t:void 0}),b})(),t(v,{get when(){return!s()},get children(){return t(ge,{href:"/settings",onClick:()=>r(!1),class:"w-full flex items-center gap-2 px-3 py-2 text-[12px] text-zinc-300 hover:bg-zinc-800/50 transition-colors",get children(){return[t(Ne,{size:13,class:"text-zinc-500"}),To()]}})}}),t(v,{get when(){return s()},get children(){return[Ht(),t(v,{get when(){return f()},get children(){return[(()=>{var b=Oo(),_=b.firstChild;return a(b,()=>f().name,_),b})(),(()=>{var b=Do(),_=b.firstChild;return a(b,t(aa,{size:13,class:"text-blue-400/70"}),_),O(()=>ie(b,"href",`/${f().routeBase}.spec`)),b})()]}}),Wo(),t(ee,{get each(){return d()?.users},children:b=>(()=>{var _=Vo(),R=_.firstChild;return _.$$click=()=>void Kt({userId:b.id}),a(R,()=>b.name),a(_,t(v,{get when(){return o()?.user?.id===b.id},get children(){return t(je,{size:13,class:"text-blue-400 shrink-0"})}}),null),_})()}),qo(),(()=>{var b=jo(),_=b.firstChild,R=_.firstChild;return a(b,t(ee,{get each(){return d()?.roles},children:q=>(()=>{var P=Ho();return P.$$click=()=>void Kt({role:q}),a(P,q),O(x=>Fe(P,{"border-blue-400/60 bg-blue-500/15 text-blue-200":d()?.view.role===q,"border-zinc-700 text-zinc-400 hover:border-blue-500/30":d()?.view.role!==q},x)),P})()}),_),_.$$click=()=>h(q=>!q),a(_,t(vt,{size:10}),R),b})(),t(v,{get when(){return w()},get children(){var b=Uo(),_=b.firstChild,R=_.nextSibling,q=R.nextSibling;return _.$$input=P=>k(P.currentTarget.value),a(b,t(v,{get when(){return f()},get children(){var P=Fo(),x=P.firstChild;return a(P,()=>f().name,x),P}}),R),a(R,t(ee,{get each(){return l()},children:P=>(()=>{var x=Ko(),L=x.firstChild,W=L.nextSibling;return L.addEventListener("change",()=>C(P)),a(W,P),O(()=>L.checked=$().includes(P)),x})()})),q.$$click=()=>void Xo(y().trim(),$()),O(()=>q.disabled=!y().trim()),O(()=>_.value=y()),b}})]}}),t(v,{get when(){return!s()},get children(){return[Ht(),(()=>{var b=Bo(),_=b.firstChild;return b.$$click=()=>{r(!1),i()},a(b,t(fn,{size:13}),_),b})()]}})]},kr=e=>{const{userMenuOpen:n,collapsed:r,reducedMotion:i}=he();return t(v,{get when(){return ae(()=>e.variant==="rail")()?ae(()=>!!n())()&&r():n()},get children(){return t(v,{get when(){return e.variant==="rail"},get fallback(){return(()=>{var s=Qo();return a(s,t(Gt,{})),O(o=>Z(s,Y,o)),s})()},get children(){var s=Go();return a(s,t(Gt,{})),O(o=>Z(s,{...Y,...i()?{}:{animation:"pop .14s ease"}},o)),s}})}})};ce(["click","input"]);var Yo=u('<span class="absolute top-0.5 right-0.5 min-w-[14px] h-[14px] px-0.5 grid place-items-center text-[8px] font-bold text-zinc-900 bg-amber-400 rounded-full">'),Zo=u('<div class="flex flex-col items-center gap-1.5 py-2 border-b border-zinc-800/60 shrink-0"><button type=button title="Search (\\u2318K)"aria-label=Search class="navrow p-2 text-zinc-400 hover:text-amber-300 hover:bg-zinc-800/50 cursor-pointer"></button><button type=button title=Notifications aria-label=Notifications class="navrow relative p-2 text-zinc-400 hover:text-amber-300 hover:bg-zinc-800/50 cursor-pointer">'),Jo=u('<div class="w-8 h-px bg-zinc-800/60 my-1.5 mx-auto">'),el=u('<nav class="flex-1 overflow-y-auto py-2 space-y-1 overflow-x-visible">'),tl=u('<div class="border-t border-zinc-800/60 shrink-0">'),rl=u('<div class="p-2 shrink-0"><button type=button class="navrow w-full flex justify-center py-1 cursor-pointer"aria-label="User menu"data-user-menu>'),nl=u('<div class="border-t border-zinc-800/60 px-3 py-2 shrink-0 flex items-center justify-center">'),il=u('<button type=button class="grid place-items-center bg-gradient-to-br from-amber-400 to-orange-600 text-zinc-900 font-bold cursor-pointer"style=width:34px;height:34px;font-size:12px>'),sl=u("<div><button type=button><span class=relative><span></span></span><span>"),al=u('<span class="absolute -top-2 -right-2 z-10 grid place-items-center w-[20px] h-[20px] bg-amber-400 text-zinc-900 border-2 border-zinc-900 rounded-full">'),Qt=u("<span>"),Xt=u('<span class="w-full text-[9px] leading-tight text-center line-clamp-1">');const ol=()=>{const{collapsed:e,currentWorkspace:n,setWsOpen:r,setNotifOpen:i,setSearchFlyoutOpen:s,setFlyoutId:o,setFlyoutTop:d,tickClick:c,notifCtx:f,perms:l,visibleEntries:w,sectionContainsActive:h,activeParent:y,flyoutId:k,isActiveOrChild:$,reducedMotion:m,isActive:C,isSuperuser:b,me:_,userMenuOpen:R,setUserMenuOpen:q}=he();return t(v,{get when(){return e()},get children(){return[(()=>{var P=Zo(),x=P.firstChild,L=x.nextSibling;return a(P,t(v,{get when(){return n()},children:W=>(()=>{var A=il();return A.$$click=()=>{r(B=>!B),i(!1),s(!1),o(null),c()},a(A,()=>xr(W().ws_name)),O(B=>{var Q=W().ws_name,le={...Y};return Q!==B.e&&ie(A,"title",B.e=Q),B.t=Z(A,le,B.t),B},{e:void 0,t:void 0}),A})()}),x),x.$$click=()=>{s(W=>!W),r(!1),i(!1),o(null),c()},a(x,t(bt,{size:17})),L.$$click=()=>{i(W=>!W),r(!1),s(!1),o(null),c()},a(L,t(fr,{size:17}),null),a(L,t(v,{get when(){return f.unreadCount()>0},get children(){var W=Yo();return a(W,()=>f.unreadCount()),W}}),null),P})(),(()=>{var P=el();return a(P,t(v,{get when(){return!l.loading()},get children(){return[t(ee,{get each(){return w().sections},children:x=>{const L=()=>h(x.section),W=()=>y()===x.section.id,A=()=>L()||W(),B=()=>k()===x.section.id,Q=x.section.icon,le=W()?x.visibleItems.find(se=>$(se))?.icon:void 0,j=()=>A()?"border-amber-500/50 bg-amber-500/[0.14]":B()?"border-zinc-600 bg-zinc-800/40":"border-transparent";return(()=>{var se=sl(),J=se.firstChild,ue=J.firstChild,E=ue.firstChild,N=ue.nextSibling;return J.$$click=g=>{B()?o(null):(o(x.section.id),d(g.currentTarget.getBoundingClientRect().top),r(!1),i(!1),s(!1)),c()},a(J,t(v,{get when(){return A()},get children(){return t(Me,{inset:"top-1 bottom-1"})}}),ue),a(E,t(Q,{size:19,class:"ic"})),a(ue,t(v,{get when(){return W()&&le},children:g=>{const p=g();return(()=>{var z=al();return a(z,t(p,{size:12,"stroke-width":2.6})),O(S=>Z(z,m()?void 0:{animation:"pip .25s ease"},S)),z})()}}),null),a(N,(()=>{var g=ae(()=>!!W());return()=>g()?x.visibleItems.find(p=>$(p))?.label??x.section.label:x.section.label})()),O(g=>{var p=W()?`${x.section.label} › ${x.visibleItems.find(I=>$(I))?.label??""}`:x.section.label,z=W()?`${x.section.label} › ${x.visibleItems.find(I=>$(I))?.label??""}`:x.section.label,S=`navrow group relative w-full flex flex-col items-center gap-1 px-1 py-1 cursor-pointer ${A()?"text-amber-300":"text-zinc-500 hover:text-zinc-200"}`,D=`grid place-items-center p-2.5 border transition-colors ${j()}`,F=Y,G=`w-full text-[9px] leading-tight text-center line-clamp-1 ${W()?"text-amber-300/90 font-medium":""}`;return p!==g.e&&ie(J,"title",g.e=p),z!==g.t&&ie(J,"aria-label",g.t=z),S!==g.a&&oe(J,g.a=S),D!==g.o&&oe(E,g.o=D),g.i=Z(E,F,g.i),G!==g.n&&oe(N,g.n=G),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),se})()}}),t(ee,{get each(){return w().items},children:x=>{const L=()=>$(x),W=x.icon;return t(ge,{get href(){return x.href},get title(){return x.label},get"aria-label"(){return x.label},onClick:c,get class(){return`navrow group relative w-full flex flex-col items-center gap-1 px-1 py-1 cursor-pointer ${L()?"text-amber-300":"text-zinc-500 hover:text-zinc-200"}`},get children(){return[t(v,{get when(){return L()},get children(){return t(Me,{inset:"top-1 bottom-1"})}}),(()=>{var A=Qt();return a(A,t(W,{size:19,class:"ic"})),O(B=>{var Q=`grid place-items-center p-2.5 border transition-colors ${L()?"border-amber-500/50 bg-amber-500/[0.14]":"border-transparent"}`,le=Y;return Q!==B.e&&oe(A,B.e=Q),B.t=Z(A,le,B.t),B},{e:void 0,t:void 0}),A})(),(()=>{var A=Xt();return a(A,()=>x.label),A})()]}})}}),t(v,{get when(){return b()},get children(){return[Jo(),t(ee,{each:mt,children:x=>{const L=()=>C(x.href),W=x.icon;return t(ge,{get href(){return x.href},get title(){return x.label},get"aria-label"(){return x.label},onClick:c,get class(){return`navrow group relative w-full flex flex-col items-center gap-1 px-1 py-1 cursor-pointer ${L()?"text-amber-300":"text-zinc-500 hover:text-zinc-200"}`},get children(){return[t(v,{get when(){return L()},get children(){return t(Me,{inset:"top-1 bottom-1"})}}),(()=>{var A=Qt();return a(A,t(W,{size:19,class:"ic"})),O(B=>{var Q=`grid place-items-center p-2.5 border transition-colors ${L()?"border-amber-500/50 bg-amber-500/[0.14]":"border-transparent"}`,le=Y;return Q!==B.e&&oe(A,B.e=Q),B.t=Z(A,le,B.t),B},{e:void 0,t:void 0}),A})(),(()=>{var A=Xt();return a(A,()=>x.label),A})()]}})}})]}})]}})),P})(),(()=>{var P=tl();return a(P,t(ge,{href:"/workspace-settings",class:"navrow flex justify-center py-2 cursor-pointer text-zinc-400 hover:text-zinc-100",title:"Workspace Settings","aria-label":"Workspace Settings",get children(){return t(Ne,{size:16})}})),P})(),(()=>{var P=rl(),x=P.firstChild;return x.$$click=L=>{L.stopPropagation();const W=!R();q(W),W&&(r(!1),i(!1),o(null))},a(x,t(or,{get name(){return _()?.user?.name??""},get image(){return _()?.user?.image},size:"md"})),O(()=>ie(x,"title",_()?.user?.name??"")),P})(),(()=>{var P=nl();return a(P,t($r,{size:16})),P})()]}})};ce(["click"]);var ll=u('<span class="absolute top-1 right-1 min-w-[14px] h-[14px] px-0.5 grid place-items-center text-[8px] font-bold text-zinc-900 bg-amber-400 rounded-full">'),cl=u('<div class="h-14 flex items-center gap-1 px-2 border-b border-zinc-800/60 shrink-0"><button type=button title=Notifications aria-label=Notifications class="navrow relative p-2 text-zinc-400 hover:text-amber-300 hover:bg-zinc-800/50 cursor-pointer shrink-0">'),ul=u('<kbd class="px-1 py-0.5 rounded border border-zinc-700/60 bg-zinc-800/60 text-[10px] font-mono text-zinc-500 shrink-0 select-none pointer-events-none">⌘K'),dl=u('<button type=button class="text-zinc-600 hover:text-zinc-300 cursor-pointer"aria-label="Clear search">'),pl=u('<div class="p-2 shrink-0"><div class="w-full flex items-center gap-2 h-9 bg-zinc-950/60 border border-zinc-700/60 focus-within:border-amber-500/60 transition-colors pl-2.5 pr-1.5"><input data-sidebar-search type=text placeholder="Search anything…"class="text-[12px] text-zinc-200 placeholder:text-zinc-500 flex-1 min-w-0 bg-transparent border-0 outline-none">'),hl=u('<button type=button title="Back to sections"aria-label="Back to sections"class="navrow flex items-center gap-2 px-2.5 py-2 mb-1 shrink-0 w-full text-left cursor-pointer text-zinc-300 hover:text-amber-300 hover:bg-zinc-800/60 transition-colors">'),fl=u('<div class="text-[10px] font-semibold uppercase tracking-[0.18em] px-2.5 pt-2 pb-1 text-zinc-600">Workspace'),ml=u('<div class="text-[10px] font-semibold uppercase tracking-[0.18em] px-2.5 pt-4 pb-1 text-zinc-600">Platform'),gl=u('<nav class="flex-1 overflow-y-auto px-1.5 pb-2 overflow-x-hidden">'),vl=u('<span class="flex-1 font-medium truncate">Workspace Settings'),bl=u('<span class="text-[9px] uppercase tracking-wider text-zinc-600 border border-zinc-700/50 px-1 py-px rounded ml-1 shrink-0">test'),xl=u('<div class="border-t border-zinc-800/60 px-2 pt-1.5 shrink-0">'),wl=u('<div class="relative p-2 shrink-0"><div class="relative flex items-center gap-2.5 px-2 py-2 hover:bg-zinc-800/50 transition-colors"><button type=button class="flex items-center gap-2.5 flex-1 min-w-0 text-left cursor-pointer"aria-haspopup=dialog data-user-menu><div class="min-w-0 flex-1"><p class="text-[12px] text-zinc-200 font-medium truncate leading-tight"></p><div class=mt-0.5></div></div></button><button type=button class="p-1 text-zinc-500 hover:text-amber-300 cursor-pointer shrink-0"></button><button type=button class="text-zinc-600 hover:text-zinc-400 cursor-pointer shrink-0"aria-label="More options"data-user-menu>'),$l=u('<span class="text-[10px] text-blue-300/70 tracking-wide">running on <span class="text-blue-300 font-semibold">Plugin SDK</span> v'),kl=u('<div class="border-t border-zinc-800/60 px-3 py-2 shrink-0 flex items-center justify-center gap-2">'),yl=u('<button type=button class="navrow flex items-center gap-2 flex-1 min-w-0 px-1.5 py-1.5 hover:bg-zinc-800/50 cursor-pointer text-left"aria-haspopup=dialog><span class="text-[13px] font-semibold text-zinc-100 truncate flex-1">'),_l=u('<span class="text-[13px] font-semibold text-zinc-100 truncate flex-1">'),zl=u('<p class="text-[12px] text-zinc-600 px-3 py-6 text-center">Nothing matches “<!>”.'),Sl=u('<button type=button class="navrow w-full flex items-center gap-2.5 px-2.5 py-2 text-left cursor-pointer text-zinc-300 hover:bg-zinc-800/60"><div class="min-w-0 flex-1"><span class="block text-[13px] truncate"></span><span class="block text-[10px] text-zinc-500 truncate">section'),Cl=u('<div><div class="text-[10px] font-semibold uppercase tracking-[0.18em] px-2.5 pt-3 pb-1 text-zinc-600">'),Ml=u('<button type=button><span class="flex-1 text-[13px] truncate">'),st=u('<span class="flex-1 text-[14px] font-medium truncate">'),Yt=u('<div class="relative group/navrow">'),Nl=u('<span class="flex items-center gap-1 text-[10px] text-amber-300/80 truncate">'),El=u('<button type=button><div class="flex-1 min-w-0"><span class="block text-[14px] font-medium truncate">'),Al=u('<span class="text-[10px] text-zinc-500 tracking-wide">powered by <span class="text-zinc-300 font-semibold">Hilinga</span> v');function Pe(e){return e.capability??e.requiredPermission?.split(".")[0]}const Pl=()=>{const{collapsed:e,currentWorkspace:n,hasMultipleOrgs:r,setWsOpen:i,setNotifOpen:s,setFlyoutId:o,tickClick:d,wsOpen:c,notifCtx:f,query:l,setQuery:w,currentSection:h,queryTrimmed:y,goBack:k,reducedMotion:$,dir:m,perms:C,nestedSearchResults:b,matchesQuery:_,goInto:R,isActive:q,chooseResult:P,level:x,visibleEntries:L,isActiveOrChild:W,tickHover:A,sectionContainsActive:B,activeParent:Q,isSuperuser:le,userMenuOpen:j,setUserMenuOpen:se,me:J,soundOn:ue,setSoundOn:E}=he(),N=De();return t(v,{get when(){return!e()},get children(){return[(()=>{var g=cl(),p=g.firstChild;return a(g,t(v,{get when(){return n()},children:z=>(()=>{var S=yl(),D=S.firstChild;return S.$$click=()=>{r()&&(i(F=>!F),s(!1),o(null),d())},a(S,t(dt,{get name(){return z().ws_name},size:30}),D),a(D,()=>z().ws_name),a(S,t(v,{get when(){return r()},get children(){return t(mn,{size:13,class:"text-zinc-500 shrink-0"})}}),null),O(F=>{var G=c(),I=Y;return G!==F.e&&ie(S,"aria-expanded",F.e=G),F.t=Z(S,I,F.t),F},{e:void 0,t:void 0}),S})()}),p),p.$$click=()=>{s(z=>!z),i(!1),o(null),d()},a(p,t(fr,{size:17}),null),a(p,t(v,{get when(){return f.unreadCount()>0},get children(){var z=ll();return a(z,()=>f.unreadCount()),z}}),null),g})(),(()=>{var g=pl(),p=g.firstChild,z=p.firstChild;return a(p,t(bt,{size:14,class:"text-zinc-500 shrink-0"}),z),z.$$input=S=>w(S.currentTarget.value),a(p,t(v,{get when(){return l().length===0},get children(){return ul()}}),null),a(p,t(v,{get when(){return l().length>0},get children(){var S=dl();return S.$$click=()=>w(""),a(S,t(Oe,{size:13})),S}}),null),O(S=>Z(p,Y,S)),O(()=>z.value=l()),g})(),t(v,{get when(){return ae(()=>!!h())()&&!y()},get children(){var g=hl();return Ie(g,"click",k,!0),a(g,t(ki,{size:17,class:"shrink-0"}),null),a(g,t(v,{get when(){return h()},children:p=>{const z=p().section.icon;return[t(z,{size:16,class:"text-amber-300 shrink-0"}),(()=>{var S=_l();return a(S,()=>p().section.label),S})()]}}),null),O(p=>Z(g,Y,p)),g}}),(()=>{var g=gl();return a(g,t(v,{get when(){return!C.loading()},get children(){return[t(v,{get when(){return y()},get children(){return t(v,{get when(){return b().length>0},get fallback(){return(()=>{var p=zl(),z=p.firstChild,S=z.nextSibling;return S.nextSibling,a(p,()=>l().trim(),S),p})()},get children(){return t(ee,{get each(){return b()},children:p=>(()=>{var z=Cl(),S=z.firstChild;return a(S,()=>p.section.label),a(z,t(v,{get when(){return ae(()=>!!(_(p.section.label)&&p.section.id!=="_root"))()&&p.section.id!=="_platform"},get children(){var D=Sl(),F=D.firstChild,G=F.firstChild;return D.$$click=()=>{R(p.section.id),w(""),d()},a(D,()=>{const I=p.section.icon;return t(I,{size:16,class:"shrink-0"})},F),a(G,t(pt,{get label(){return p.section.label}})),D}}),null),a(z,t(ee,{get each(){return p.items},children:D=>{const F=D.item.icon,G=()=>q(D.item.href);return(()=>{var I=Ml(),K=I.firstChild;return I.$$click=()=>P(D.item.href),a(I,t(F,{size:15,class:"shrink-0"}),K),a(K,t(pt,{get label(){return D.item.label}})),O(()=>oe(I,`navrow w-full flex items-center gap-2.5 px-2.5 py-2 pl-6 text-left cursor-pointer ${G()?"text-amber-300 bg-amber-500/[0.10]":"text-zinc-300 hover:bg-zinc-800/60"}`)),I})()}}),null),z})()})}})}}),t(v,{get when(){return ae(()=>!y())()&&x()==="root"},get children(){return[fl(),t(ee,{get each(){return L().items},children:p=>{const z=p.icon,S=()=>W(p);return(()=>{var D=Yt();return a(D,t(ge,{get href(){return p.href},onMouseEnter:A,onClick:d,get class(){return`navrow group relative w-full flex items-center gap-3 py-2.5 px-2.5 text-left cursor-pointer ${Pe(p)?"pr-9":""} ${S()?"text-amber-300 bg-amber-500/[0.10]":"text-zinc-400 hover:text-zinc-100 hover:bg-zinc-800/50"}`},get style(){return S()?Y:void 0},get children(){return[t(v,{get when(){return S()},get children(){return t(Me,{inset:"top-1.5 bottom-1.5"})}}),t(z,{size:18,class:"ic shrink-0"}),(()=>{var F=st();return a(F,()=>p.label),F})()]}}),null),a(D,t(v,{get when(){return Pe(p)},get children(){return t(ut,{get module(){return Pe(p)},get moduleLabel(){return p.label},class:"absolute right-1.5 top-1/2 -translate-y-1/2 opacity-60 group-hover/navrow:opacity-100 focus-within:opacity-100"})}}),null),D})()}}),t(ee,{get each(){return L().sections},children:p=>{const z=()=>B(p.section),S=()=>Q()===p.section.id,D=S()?p.visibleItems.find(I=>W(I)):void 0,F=p.section.icon,G=()=>z()?"text-amber-300 bg-amber-500/[0.10]":S()?"text-zinc-100":"text-zinc-400 hover:text-zinc-100 hover:bg-zinc-800/50";return(()=>{var I=El(),K=I.firstChild,te=K.firstChild;return Ie(I,"mouseenter",A),I.$$click=()=>R(p.section.id),a(I,t(v,{get when(){return z()||S()},get children(){return t(Me,{inset:"top-1.5 bottom-1.5"})}}),K),a(I,t(F,{size:18,class:"ic shrink-0"}),K),a(te,()=>p.section.label),a(K,t(v,{get when(){return S()&&D},get children(){var re=Nl();return a(re,t(Zi,{size:10,class:"shrink-0"}),null),a(re,()=>D.label,null),re}}),null),a(I,t(zi,{size:16,class:"shrink-0 text-zinc-500"}),null),O(re=>{var be=`navrow group relative w-full flex items-center gap-3 py-2.5 px-2.5 text-left cursor-pointer ${G()}`,ve=z()?Y:void 0;return be!==re.e&&oe(I,re.e=be),re.t=Z(I,ve,re.t),re},{e:void 0,t:void 0}),I})()}}),t(v,{get when(){return le()},get children(){return[ml(),t(ee,{each:mt,children:p=>{const z=p.icon,S=()=>q(p.href);return t(ge,{get href(){return p.href},onMouseEnter:A,onClick:d,get class(){return`navrow group relative w-full flex items-center gap-3 py-2.5 px-2.5 text-left cursor-pointer ${S()?"text-amber-300 bg-amber-500/[0.10]":"text-zinc-400 hover:text-zinc-100 hover:bg-zinc-800/50"}`},get style(){return S()?Y:void 0},get children(){return[t(v,{get when(){return S()},get children(){return t(Me,{inset:"top-1.5 bottom-1.5"})}}),t(z,{size:18,class:"ic shrink-0"}),(()=>{var D=st();return a(D,()=>p.label),D})()]}})}})]}})]}}),t(v,{get when(){return ae(()=>!y()&&x()!=="root")()&&h()},get children(){return t(ee,{get each(){return h().visibleItems},children:p=>{const z=p.icon,S=()=>q(p.href);return(()=>{var D=Yt();return a(D,t(ge,{get href(){return p.href},onMouseEnter:A,onClick:d,get class(){return`navrow group relative w-full flex items-center gap-3 py-2.5 px-2.5 text-left cursor-pointer ${Pe(p)?"pr-9":""} ${S()?"text-amber-300 bg-amber-500/[0.10]":"text-zinc-400 hover:text-zinc-100 hover:bg-zinc-800/50"}`},get style(){return S()?Y:void 0},get children(){return[t(v,{get when(){return S()},get children(){return t(Me,{inset:"top-1.5 bottom-1.5"})}}),t(z,{size:17,class:"ic shrink-0"}),(()=>{var F=st();return a(F,()=>p.label),F})()]}}),null),a(D,t(v,{get when(){return Pe(p)},get children(){return t(ut,{get module(){return Pe(p)},get moduleLabel(){return p.label},class:"absolute right-1.5 top-1/2 -translate-y-1/2 opacity-60 group-hover/navrow:opacity-100 focus-within:opacity-100"})}}),null),D})()}})}})]}})),O(p=>Z(g,$()?void 0:{animation:`${y()||m()==="in"?"slideIn":"slideOut"} .18s ease`},p)),g})(),t(v,{get when(){return!N()},get children(){var g=xl();return a(g,t(ge,{href:"/workspace-settings",class:"navrow flex items-center gap-2.5 px-2 py-2 hover:bg-zinc-800/50 cursor-pointer text-[13px] text-zinc-400 hover:text-zinc-100",style:Y,get children(){return[t(Ne,{size:15,class:"shrink-0"}),vl(),bl()]}})),g}}),(()=>{var g=wl(),p=g.firstChild,z=p.firstChild,S=z.firstChild,D=S.firstChild,F=D.nextSibling,G=z.nextSibling,I=G.nextSibling;return z.$$click=K=>{K.stopPropagation();const te=!j();se(te),te&&(i(!1),s(!1),o(null))},a(z,t(or,{get name(){return J()?.user?.name??""},get image(){return J()?.user?.image},size:"md"}),S),a(D,()=>J()?.user?.name??""),a(F,t(mo,{})),G.$$click=K=>{K.stopPropagation(),E(te=>!te)},a(G,(()=>{var K=ae(()=>!!ue());return()=>K()?t(ea,{size:14}):t(na,{size:14})})()),I.$$click=K=>{K.stopPropagation();const te=!j();se(te),te&&(i(!1),s(!1),o(null))},a(I,t(ts,{size:14})),a(g,t(kr,{variant:"docked"}),null),O(K=>{var te=Y,re=j(),be=ue()?"Mute UI sound":"Enable UI sound",ve=ue()?"Mute UI sound":"Enable UI sound";return K.e=Z(p,te,K.e),re!==K.t&&ie(z,"aria-expanded",K.t=re),be!==K.a&&ie(G,"title",K.a=be),ve!==K.o&&ie(G,"aria-label",K.o=ve),K},{e:void 0,t:void 0,a:void 0,o:void 0}),g})(),(()=>{var g=kl();return a(g,t($r,{size:16,get class(){return N()?"[filter:sepia(1)_saturate(6)_hue-rotate(185deg)_brightness(0.95)]":""}}),null),a(g,t(v,{get when(){return N()},get fallback(){return(()=>{var p=Al(),z=p.firstChild,S=z.nextSibling;return S.nextSibling,a(p,()=>"0.0.0",null),p})()},get children(){var p=$l(),z=p.firstChild,S=z.nextSibling;return S.nextSibling,a(p,()=>J()?.sdkVersion||"?",null),p}}),null),g})()]}})};ce(["click","input"]);var Ll=u('<aside class="sticky left-0 top-0 h-screen z-40 flex flex-col border-r border-zinc-800/60 bg-zinc-900/95 backdrop-blur-xl shrink-0 overflow-visible transition-[width] duration-200 ease-out"><button type=button class="navrow absolute -right-3 top-16 z-30 w-6 h-6 grid place-items-center bg-zinc-800 border border-zinc-700 text-zinc-300 hover:text-amber-300 rounded-full cursor-pointer shadow">'),Il=u('<div class="fixed inset-0 z-40 cursor-default"aria-label=Close>');const Rl=()=>{const{collapsed:e,toggleCollapse:n,flyoutId:r,notifOpen:i,wsOpen:s,searchFlyoutOpen:o,closeAllPops:d}=he();return[(()=>{var c=Ll(),f=c.firstChild;return Ie(f,"click",n,!0),a(f,(()=>{var l=ae(()=>!!e());return()=>l()?t(zs,{size:13}):t(ks,{size:13})})()),a(c,t(ol,{}),null),a(c,t(kr,{variant:"rail"}),null),a(c,t(Pl,{}),null),O(l=>{var w=!e(),h=!!e(),y=e()?"Expand":"Collapse",k=e()?"Expand sidebar":"Collapse sidebar";return w!==l.e&&c.classList.toggle("w-[256px]",l.e=w),h!==l.t&&c.classList.toggle("w-[72px]",l.t=h),y!==l.a&&ie(f,"title",l.a=y),k!==l.o&&ie(f,"aria-label",l.o=k),l},{e:void 0,t:void 0,a:void 0,o:void 0}),c})(),t(v,{get when(){return s()||i()||r()||o()},get children(){var c=Il();return Ie(c,"click",d,!0),c}}),t(Lo,{}),t(ko,{}),t($a,{}),t(lo,{}),t(So,{})]},Tl=()=>t(ga,{get children(){return t(Rl,{})}});ce(["click"]);function Ol(){const e=new Image;e.onload=()=>{const r=document.createElement("canvas");r.width=64,r.height=64;const i=r.getContext("2d");if(!i)return;i.drawImage(e,0,0,64,64),i.globalCompositeOperation="color",i.fillStyle="#2563eb",i.fillRect(0,0,64,64),i.globalCompositeOperation="source-atop",i.fillStyle="rgba(37, 99, 235, 0.5)",i.fillRect(0,0,64,64);const s=r.toDataURL("image/png");document.querySelectorAll('link[rel~="icon"]').forEach(d=>d.remove());const o=document.createElement("link");o.rel="icon",o.type="image/png",o.href=s,document.head.appendChild(o)},e.src="/favicon-32.png"}function Dl(){const e=De();return ze(()=>{e()&&typeof document<"u"&&Ol()}),null}function Wl(){const e=De(),n=ar(),r=Re(),i=ir();return ze(()=>{if(!e()||!n.ready())return;const s=n.plugins();if(s.length===0)return;const o=r.pathname.split("/").filter(Boolean)[0]??"";if(s.some(c=>c.routeBase===o))return;const d=`/${s[0].routeBase}`;r.pathname!==d&&i(d,{replace:!0})}),null}var ql=u('<div class="bg-amber-500/10 border-b border-amber-500/20 px-4 py-2.5 flex items-center gap-3 text-sm"><span class="text-zinc-300 flex-1 min-w-0">Pick a username so you can sign in without your email next time.</span><button aria-label=Dismiss class="text-zinc-500 hover:text-zinc-300 shrink-0">');const yr="ks_username_banner_dismissed";function jl(){try{return localStorage.getItem(yr)==="1"}catch{return!1}}function Fl(){const e=Ue(),[n,r]=V(jl()),i=()=>!!e()?.user&&!e()?.user?.username&&!n(),s=()=>{try{localStorage.setItem(yr,"1")}catch{}r(!0)};return t(v,{get when(){return i()},get children(){var o=ql(),d=o.firstChild,c=d.nextSibling;return a(o,t(Li,{size:14,class:"text-amber-400 shrink-0"}),d),a(o,t(ge,{href:"/settings#username",class:"text-amber-400 hover:text-amber-300 text-xs uppercase tracking-widest font-medium shrink-0",children:"Set username"}),c),c.$$click=s,a(c,t(Oe,{size:14})),o}})}ce(["click"]);const[_r,xt]=V(null),Ul=_r;function Bl(){const e=_r();if(!e){window.location.reload();return}navigator.serviceWorker.addEventListener("controllerchange",()=>{window.location.reload()},{once:!0}),e.postMessage({type:"SKIP_WAITING"})}function Vl(){xt(null)}function Hl(e){e.addEventListener("statechange",()=>{e.state==="installed"&&navigator.serviceWorker.controller&&xt(e)})}function Kl(){typeof window>"u"||!("serviceWorker"in navigator)||window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").then(e=>{e.waiting&&navigator.serviceWorker.controller&&xt(e.waiting),e.addEventListener("updatefound",()=>{const n=e.installing;n&&Hl(n)})}).catch(()=>{})})}var Gl=u('<div role=status aria-live=polite class="fixed left-1/2 -translate-x-1/2 bottom-4 z-[60] card-bg border border-amber-500/40 rounded-md shadow-lg px-4 py-3 flex items-center gap-3 text-sm max-w-[90vw]"><span class="text-zinc-200 flex-1 min-w-0">A new version of Hilinga is available.</span><button class="text-amber-400 hover:text-amber-300 text-xs uppercase tracking-widest font-medium shrink-0">Reload</button><button aria-label="Dismiss update prompt"class="text-zinc-500 hover:text-zinc-300 shrink-0">');function Ql(){return t(v,{get when(){return Ul()},get children(){var e=Gl(),n=e.firstChild,r=n.nextSibling,i=r.nextSibling;return a(e,t(As,{size:14,class:"text-amber-400 shrink-0"}),n),Ie(r,"click",Bl,!0),Ie(i,"click",Vl,!0),a(i,t(Oe,{size:14})),e}})}ce(["click"]);const Xl="ks_active_workspace_id",Zt="__ksApiFetchPatched";function Yl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}function Zl(e){if(e.startsWith("/api/"))return!0;try{const n=new URL(e,typeof window<"u"?window.location.href:void 0);return n.origin===window.location.origin&&n.pathname.startsWith("/api/")}catch{return!1}}function Jl(){if(typeof window>"u")return;const e=window;if(e[Zt])return;e[Zt]=!0;const n=window.fetch.bind(window);window.fetch=async(r,i)=>{let s=!1;try{const d=Yl(r);if(s=Zl(d),s){let c=null;try{c=localStorage.getItem(Xl)}catch{}if(c){const f=new Headers(i?.headers??(r instanceof Request?r.headers:void 0));f.has("X-Workspace-Id")||(f.set("X-Workspace-Id",c),i={...i??{},headers:f})}}}catch{}const o=await n(r,i);return s&&o.status===401&&!ec()&&(window.location.href="/login"),o}}function ec(){const e=window.location.pathname;return e==="/login"||e==="/register"}Jl();var tc=u("<div class=ks-route-progress aria-hidden=true>"),rc=u('<div class="page-bg min-h-screen flex"><main class="flex-1 h-screen min-w-0 overflow-y-auto overflow-x-hidden flex flex-col">');function Jt(){const e=Zr();return t(v,{get when(){return e()},get children(){return tc()}})}function nc(e){let n=!1;return ze(()=>{n||(n=!0,e.onRender())}),null}function ic(e){const n=Re(),r=()=>n.pathname==="/login"||n.pathname==="/register",[i,s]=V(!1);return t(v,{get when(){return!r()},get fallback(){return[t(Jt,{}),t(Ct,{get children(){return e.children}})]},get children(){return t(vn,{get children(){return t(la,{get children(){return t(on,{get children(){return t(da,{get children(){var o=rc(),d=o.firstChild;return o.$$contextmenu=c=>{const f=c.target;f instanceof HTMLInputElement||f instanceof HTMLTextAreaElement||f instanceof HTMLElement&&f.isContentEditable||c.preventDefault()},a(o,t(Jt,{}),d),a(o,t(Dl,{}),d),a(o,t(Wl,{}),d),a(o,t(Tl,{}),d),a(d,t(Fl,{}),null),a(d,t(Ct,{get fallback(){return ae(()=>!!i())()?[]:t(ln,{})},get children(){return[t(nc,{onRender:()=>s(!0)}),ae(()=>e.children)]}}),null),o}})}})}})}})}})}function sc(){const e=Hn;return t(gn,{get children(){return t(an,{get children(){return[t(e,{root:ic,get children(){return t(di,{})}}),t(Ql,{})]}})}})}ce(["contextmenu"]);const ac=e=>null;var oc=u("<span style=font-size:1.5em;text-align:center;position:fixed;left:0px;bottom:55%;width:100%>");const lc=e=>{const n="Error | Uncaught Client Exception";return t(Jr,{fallback:r=>(console.error(r),[(()=>{var i=oc();return a(i,n),i})(),t(ac,{code:500})]),get children(){return e.children}})};function er(e){return e.children}function cc(){return t(er,{get children(){return t(er,{get children(){return t(lc,{get children(){return t(sc,{})}})}})}})}function uc(e,n){en(e,n)}const dc=localStorage.getItem("ks-erp-theme"),pc=dc||"dark";document.documentElement.classList.add(pc);uc(()=>t(cc,{}),document.getElementById("app"));Kl();const bc=void 0;export{bc as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{_ as N,$ as _,a0 as U,a1 as D,k as ge,e as f,x as te,D as me,a2 as Ce,E as ye,J as E,l as we,n as Te,y as S,z as g,S as v,M,K as B,T as ne,N as Ne,A as y,H as X,m as Q,Q as Re,a3 as ze,a4 as Ie,C as Ue}from"./routing-C6AwqsGL.js";import{I as O,g as re,P as De,d as Ke,i as Le,u as ve,S as He}from"./auth-DnjIzX2B.js";const j=Symbol("store-raw"),x=Symbol("store-node"),p=Symbol("store-has"),_e=Symbol("store-self");function be(e){let t=e[_];if(!t&&(Object.defineProperty(e,_,{value:t=new Proxy(e,We)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),i=Object.getPrototypeOf(e),o=i!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&i!==Object.prototype;if(o){const a=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(a)),Object.assign(r,a)}for(let a=0,l=n.length;a<l;a++){const s=n[a];o&&s==="constructor"||r[s].get&&Object.defineProperty(e,s,{configurable:!0,enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function k(e){let t;return e!=null&&typeof e=="object"&&(e[_]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function $(e,t=new Set){let n,r,i,o;if(n=e!=null&&e[j])return n;if(!k(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,l=e.length;a<l;a++)i=e[a],(r=$(i,t))!==i&&(e[a]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const a=Object.keys(e),l=Object.getOwnPropertyDescriptors(e);for(let s=0,c=a.length;s<c;s++)o=a[s],!l[o].get&&(i=e[o],(r=$(i,t))!==i&&(e[o]=r))}return e}function R(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function C(e,t,n){if(e[t])return e[t];const[r,i]=ge(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function qe(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===_||t===x||(delete n.value,delete n.writable,n.get=()=>e[_][t]),n}function Z(e){D()&&C(R(e,x),_e)()}function pe(e){return Z(e),Reflect.ownKeys(e)}const We={get(e,t,n){if(t===j)return e;if(t===_)return n;if(t===U)return Z(e),n;const r=R(e,x),i=r[t];let o=i?i():e[t];if(t===x||t===p||t==="__proto__")return o;if(!i){const a=Object.getOwnPropertyDescriptor(e,t);D()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(o=C(r,t,o)())}return k(o)?be(o):o},has(e,t){return t===j||t===_||t===U||t===x||t===p||t==="__proto__"?!0:(D()&&C(R(e,p),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:pe,getOwnPropertyDescriptor:qe};function w(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const i=e[t],o=e.length;n===void 0?(delete e[t],e[p]&&e[p][t]&&i!==void 0&&e[p][t].$()):(e[t]=n,e[p]&&e[p][t]&&i===void 0&&e[p][t].$());let a=R(e,x),l;if((l=C(a,t,i))&&l.$(()=>n),Array.isArray(e)&&e.length!==o){for(let s=e.length;s<o;s++)(l=a[s])&&l.$();(l=C(a,"length",o))&&l.$(e.length)}(l=a[_e])&&l.$()}function xe(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];ke(i)||w(e,i,t[i])}}function ke(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function Be(e,t){if(typeof t=="function"&&(t=t(e)),t=$(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&w(e,n,i)}w(e,"length",r)}else xe(e,t)}function I(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const a=typeof r,l=Array.isArray(e);if(a==="string"&&(r==="__proto__"||t.length>1&&ke(r)))return;if(Array.isArray(r)){for(let s=0;s<r.length;s++)I(e,[r[s]].concat(t),n);return}else if(l&&a==="function"){for(let s=0;s<e.length;s++)r(e[s],s)&&I(e,[s].concat(t),n);return}else if(l&&a==="object"){const{from:s=0,to:c=e.length-1,by:u=1}=r;for(let d=s;d<=c;d+=u)I(e,[d].concat(t),n);return}else if(t.length>1){I(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let o=t[0];typeof o=="function"&&(o=o(i,n),o===i)||r===void 0&&o==null||(o=$(o),r===void 0||k(i)&&k(o)&&!Array.isArray(o)?xe(i,o):w(e,r,o))}function Ve(...[e,t]){const n=$(e||{}),r=Array.isArray(n),i=be(n);function o(...a){N(()=>{r&&a.length===1?Be(n,a[0]):I(n,a)})}return[i,o]}function Fe(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||n.set||!n.configurable||t===_||t===x||(delete n.value,delete n.writable,n.get=()=>e[_][t],n.set=r=>e[_][t]=r),n}const Ge={get(e,t,n){if(t===j)return e;if(t===_)return n;if(t===U)return Z(e),n;const r=R(e,x),i=r[t];let o=i?i():e[t];if(t===x||t===p||t==="__proto__")return o;if(!i){const a=Object.getOwnPropertyDescriptor(e,t),l=typeof o=="function";if(D()&&(!l||e.hasOwnProperty(t))&&!(a&&a.get))o=C(r,t,o)();else if(o!=null&&l&&o===Array.prototype[t])return(...s)=>N(()=>Array.prototype[t].apply(n,s))}return k(o)?$e(o):o},has(e,t){return t===j||t===_||t===U||t===x||t===p||t==="__proto__"?!0:(D()&&C(R(e,p),t)(),t in e)},set(e,t,n){return N(()=>w(e,t,$(n))),!0},deleteProperty(e,t){return N(()=>w(e,t,void 0,!0)),!0},ownKeys:pe,getOwnPropertyDescriptor:Fe};function $e(e){let t=e[_];if(!t){Object.defineProperty(e,_,{value:t=new Proxy(e,Ge)});const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),i=Object.getPrototypeOf(e),o=i!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&i!==Object.prototype;if(o){let a=i;for(;a!=null;){const l=Object.getOwnPropertyDescriptors(a);n.push(...Object.keys(l)),Object.assign(r,l),a=Object.getPrototypeOf(a)}}for(let a=0,l=n.length;a<l;a++){const s=n[a];if(!(o&&s==="constructor")){if(r[s].get){const c=r[s].get.bind(t);Object.defineProperty(e,s,{get:c,configurable:!0})}if(r[s].set){const c=r[s].set;Object.defineProperty(e,s,{set:d=>N(()=>c.call(t,d)),configurable:!0})}}}}return t}function Ye(e,t){const n=$(e||{});return $e(n)}function Xe(e,t){N(()=>t($(e)))}const J=Symbol("store-root");function ie(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function T(e,t,n,r,i){if(ie(n))return;const o=t[n];if(e===o)return;const a=Array.isArray(e);if(n!==J&&(!k(e)||!k(o)||a!==Array.isArray(o)||i&&e[i]!==o[i])){w(t,n,e);return}if(a){if(e.length&&o.length&&(!r||i&&e[0]&&e[0][i]!=null)){let c,u,d,h,m,b,P,A;for(d=0,h=Math.min(o.length,e.length);d<h&&(o[d]===e[d]||i&&o[d]&&e[d]&&o[d][i]&&o[d][i]===e[d][i]);d++)T(e[d],o,d,r,i);const z=new Array(e.length),K=new Map;for(h=o.length-1,m=e.length-1;h>=d&&m>=d&&(o[h]===e[m]||i&&o[h]&&e[m]&&o[h][i]&&o[h][i]===e[m][i]);h--,m--)z[m]=o[h];if(d>m||d>h){for(u=d;u<=m;u++)w(o,u,e[u]);for(;u<e.length;u++)w(o,u,z[u]),T(e[u],o,u,r,i);o.length>e.length&&w(o,"length",e.length);return}for(P=new Array(m+1),u=m;u>=d;u--)b=e[u],A=i&&b?b[i]:b,c=K.get(A),P[u]=c===void 0?-1:c,K.set(A,u);for(c=d;c<=h;c++)b=o[c],A=i&&b?b[i]:b,u=K.get(A),u!==void 0&&u!==-1&&(z[u]=o[c],u=P[u],K.set(A,u));for(u=d;u<e.length;u++)u in z?(w(o,u,z[u]),T(e[u],o,u,r,i)):w(o,u,e[u])}else for(let c=0,u=e.length;c<u;c++)T(e[c],o,c,r,i);o.length>e.length&&w(o,"length",e.length);return}const l=Object.keys(e);for(let c=0,u=l.length;c<u;c++)ie(l[c])||T(e[l[c]],o,l[c],r,i);const s=Object.keys(o);for(let c=0,u=s.length;c<u;c++)e[s[c]]===void 0&&w(o,s[c],void 0)}function Je(e,t={}){const{merge:n,key:r="id"}=t,i=$(e);return o=>{if(!k(o)||!k(i))return i;const a=T(i,{[J]:o},J,n,r);return a===void 0?o:a}}const V=new WeakMap,Pe={get(e,t){if(t===j)return e;const n=e[t];if(t===_||t===U||t===x||t===p||t==="__proto__")return n;let r;return k(n)?V.get(n)||(V.set(n,r=new Proxy(n,Pe)),r):n},set(e,t,n){return w(e,t,$(n)),!0},deleteProperty(e,t){return w(e,t,void 0,!0),!0}};function Qe(e){return t=>{if(k(t)){let n;(n=V.get(t))||V.set(t,n=new Proxy(t,Pe)),e(n)}return t}}const Ze=void 0,et=Object.freeze(Object.defineProperty({__proto__:null,$RAW:j,DEV:Ze,createMutable:Ye,createStore:Ve,modifyMutable:Xe,produce:Qe,reconcile:Je,unwrap:$},Symbol.toStringTag,{value:"Module"})),Se=me(),tt=["title","meta"],oe=[],ae=["name","http-equiv","content","charset","media"].concat(["property"]),se=(e,t)=>{const n=Object.fromEntries(Object.entries(e.props).filter(([r])=>t.includes(r)).sort());return(Object.hasOwn(n,"name")||Object.hasOwn(n,"property"))&&(n.name=n.name||n.property,delete n.property),e.tag+JSON.stringify(n)};function nt(){if(!Te.context){const n=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(n,r=>r.parentNode.removeChild(r))}const e=new Map;function t(n){if(n.ref)return n.ref;let r=document.querySelector(`[data-sm="${n.id}"]`);return r?(r.tagName.toLowerCase()!==n.tag&&(r.parentNode&&r.parentNode.removeChild(r),r=document.createElement(n.tag)),r.removeAttribute("data-sm")):r=document.createElement(n.tag),r}return{addTag(n){if(tt.indexOf(n.tag)!==-1){const o=n.tag==="title"?oe:ae,a=se(n,o);e.has(a)||e.set(a,[]);let l=e.get(a),s=l.length;l=[...l,n],e.set(a,l);let c=t(n);n.ref=c,te(c,n.props);let u=null;for(var r=s-1;r>=0;r--)if(l[r]!=null){u=l[r];break}return c.parentNode!=document.head&&document.head.appendChild(c),u&&u.ref&&u.ref.parentNode&&document.head.removeChild(u.ref),s}let i=t(n);return n.ref=i,te(i,n.props),i.parentNode!=document.head&&document.head.appendChild(i),-1},removeTag(n,r){const i=n.tag==="title"?oe:ae,o=se(n,i);if(n.ref){const a=e.get(o);if(a){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let l=r-1;l>=0;l--)a[l]!=null&&document.head.appendChild(a[l].ref)}a[r]=null,e.set(o,a)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const Mn=e=>{const t=nt();return f(Se.Provider,{value:t,get children(){return e.children}})},rt=(e,t,n)=>(it({tag:e,props:t,setting:n,id:Ce(),get name(){return t.name||t.property}}),null);function it(e){const t=ye(Se);if(!t)throw new Error("<MetaProvider /> should be in the tree");E(()=>{const n=t.addTag(e);we(()=>t.removeTag(e,n))})}const Oe=e=>rt("title",e,{escape:!0,close:!0});var ot=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],at=e=>f(O,S(e,{iconNode:ot,name:"banknote"})),ee=at,st=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z",key:"yxxwt6"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],ct=e=>f(O,S(e,{iconNode:st,name:"landmark"})),lt=ct,ut=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],dt=e=>f(O,S(e,{iconNode:ut,name:"building"})),ft=dt,ht=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],gt=e=>f(O,S(e,{iconNode:ht,name:"credit-card"})),mt=gt,yt=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],wt=e=>f(O,S(e,{iconNode:yt,name:"smartphone"})),Ae=wt,vt=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],_t=e=>f(O,S(e,{iconNode:vt,name:"wallet"})),Me=_t,bt=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],pt=e=>f(O,S(e,{iconNode:bt,name:"coins"})),xt=pt,kt=[["path",{d:"M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z",key:"1piglc"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M2 8v1a2 2 0 0 0 2 2h1",key:"1env43"}]],$t=e=>f(O,S(e,{iconNode:kt,name:"piggy-bank"})),Ee=$t,Pt=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],St=e=>f(O,S(e,{iconNode:Pt,name:"dollar-sign"})),Ot=St,At=[["path",{d:"M12 17V7",key:"pyj7ub"}],["path",{d:"M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8",key:"1elt7d"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],Mt=e=>f(O,S(e,{iconNode:At,name:"receipt"})),Et=Mt;const jt=["banknote","landmark","building","credit-card","smartphone","wallet","coins","piggy-bank","dollar-sign","receipt"],Ct={banknote:ee,landmark:lt,building:ft,"credit-card":mt,smartphone:Ae,wallet:Me,coins:xt,"piggy-bank":Ee,"dollar-sign":Ot,receipt:Et},Tt={bank:ee,e_wallet:Ae,cash:Me,capital:Ee};function Nt(e){return e.icon&&jt.includes(e.icon)?Ct[e.icon]:Tt[e.type]??ee}function ce(e){return e&&/^https?:/i.test(e)?e:""}var Rt=y('<img class="w-full h-full rounded-full object-cover">'),zt=y("<span>"),It=y('<img class="w-full h-full rounded-md object-cover">');const F=["#e11d48","#db2777","#c026d3","#9333ea","#7c3aed","#4f46e5","#2563eb","#0284c7","#0891b2","#0d9488","#059669","#65a30d","#ca8a04","#ea580c","#dc2626"];function Ut(e){const t=e?.trim();if(!t)return"?";const n=t.split(/\s+/);return n.length===1?n[0].charAt(0).toUpperCase():(n[0].charAt(0)+n[n.length-1].charAt(0)).toUpperCase()}function Dt(e){if(!e)return F[0];let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return F[Math.abs(t)%F.length]}function le(e){const t=Ut(e),n=Dt(e),r=t.length>1?38:44,i=['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">',`<circle cx="50" cy="50" r="50" fill="${n}"/>`,`<text x="50" y="50" text-anchor="middle" dominant-baseline="central" fill="white" font-size="${r}" font-weight="bold" font-family="system-ui,-apple-system,sans-serif">${t}</text>`,"</svg>"].join("");return`data:image/svg+xml;utf8,${encodeURIComponent(i)}`}function Kt(e){const t=()=>e.size??28,n=()=>Math.max(12,Math.round(t()*.6)),r=()=>e.account.color?{color:e.account.color}:void 0,i=()=>e.variant==="user"||e.variant==null&&e.account.type==="user",o=()=>e.account.s3_link?ce(e.account.s3_link):e.account.image?e.account.image:e.account.name?le(e.account.name):null,a=()=>f(Ne,{get component(){return Nt(e.account)},get size(){return n()},get class(){return e.iconClass??"text-zinc-300"},get style(){return r()}});return(()=>{var l=zt();return g(l,f(v,{get when(){return i()},get fallback(){return f(v,{get when(){return e.account.s3_link},get fallback(){return a()},get children(){var s=It();return E(c=>{var u=ce(e.account.s3_link),d=e.alt??"";return u!==c.e&&M(s,"src",c.e=u),d!==c.t&&M(s,"alt",c.t=d),c},{e:void 0,t:void 0}),s}})},get children(){return f(v,{get when(){return o()},get fallback(){return a()},get children(){var s=Rt();return s.addEventListener("error",c=>{e.account.name&&!e.account.s3_link&&(c.currentTarget.src=le(e.account.name))}),E(c=>{var u=o(),d=e.alt??e.account.name??"";return u!==c.e&&M(s,"src",c.e=u),d!==c.t&&M(s,"alt",c.t=d),c},{e:void 0,t:void 0}),s}})}})),E(s=>{var c=`account-avatar-${e.account.id}`,u=`inline-flex items-center justify-center shrink-0 ${e.class??""}`,d=`${t()}px`,h=`${t()}px`,m=e.account.name;return c!==s.e&&M(l,"data-testid",s.e=c),u!==s.t&&B(l,s.t=u),d!==s.a&&ne(l,"width",s.a=d),h!==s.o&&ne(l,"height",s.o=h),m!==s.i&&M(l,"title",s.i=m),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()}function En(e,t){return t===void 0?{id:"out",to:e}:{id:t,to:e,label:t}}function jn(e,t,n,r){return{id:e,kind:t,label:n,detail:r?.detail,out:r?.out}}function Cn(e){const t=new Set(e.nodes.map(n=>n.id));for(const n of e.nodes)for(const r of n.out??[])if(!t.has(r.to))throw new Error(`flow "${e.id}": node "${n.id}" connects to unknown node "${r.to}"`);return e}const Lt={data:"info",trigger:"primary",modal:"info",load:"muted",call:"success",compute:"primary",condition:"danger",commit:"success",emit:"info",effect:"muted",terminal:"muted"};function Tn(e){const t=e.nodes.map(r=>({id:r.id,label:r.label,sublabel:r.detail??r.kind,kind:r.kind,accent:Lt[r.kind]})),n=e.nodes.flatMap(r=>(r.out??[]).map(i=>({from:r.id,to:i.to,label:i.label,dashed:i.id!=="out"})));return{nodes:t,edges:n}}const Ht={xs:20,sm:24,md:28,lg:40};function qt(e){return f(Kt,{account:{id:0,type:"user",get name(){return e.name},get image(){return e.image}},get size(){return Ht[e.size??"md"]},get class(){return e.class}})}var Wt=y(`<div data-testid=plugin-page-loader><style>
|
|
2
|
-
@keyframes pgGlow {
|
|
3
|
-
from { filter: brightness(1); }
|
|
4
|
-
to { filter: brightness(1.2) drop-shadow(0 0 12px rgba(100, 200, 255, 0.6)); }
|
|
5
|
-
}
|
|
6
|
-
@keyframes retryPulse {
|
|
7
|
-
0%, 100% { opacity: 1; }
|
|
8
|
-
50% { opacity: 0.45; }
|
|
9
|
-
}
|
|
10
|
-
</style><div class="flex flex-col items-center gap-5"><div class=relative style=width:120px;height:120px><img alt class="absolute inset-0 w-full h-full object-contain"style="z-index:1;filter:grayscale(100%) brightness(0.7);opacity:0.25"><img alt class="absolute inset-0 w-full h-full object-contain"style="z-index:2;filter:brightness(1.1);clip-path:polygon(0 100%, 100% 100%, 100% 100%, 0 100%)">`),Bt=y('<div class="flex flex-col items-center gap-2"><p class="text-zinc-300 text-xs uppercase tracking-[0.2em] font-medium"style="animation:retryPulse 1.2s ease-in-out infinite">Retrying…</p><p class="text-zinc-500 text-[0.625rem] uppercase tracking-[0.25em]">/'),Vt=y('<p class="text-zinc-500 text-xs uppercase tracking-[0.3em]">Loading');const Ft=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,Gt=(e,t)=>{const n=["0 100%"];for(let i=0;i<=40;i++){const o=i/40*100,a=i/40,l=Math.sin(t*.004+a*Math.PI*3)*10,s=Math.sin(t*.004*1.7+a*Math.PI*5.5)*4*(.8+.4*Math.sin(t*.001+a)),c=Math.sin(t*.004*2.3+a*Math.PI*8)*1.5*(.7+.6*Math.sin(t*.0015+a*3)),u=Math.sin(t*8e-4+a*7)*Math.cos(t*.0012+a*11)*2,d=100-e+l+s+c+u;n.push(`${o}% ${Math.max(0,Math.min(100,d))}%`)}return n.push("100% 100%","0 100%"),`polygon(${n.join(", ")})`},Yt=e=>{let t,n=null,r=null;const i=o=>{r||(r=o);const a=15e3,s=(o-r)%a/a;let c;if(s<1500/a)c=0;else if(s<13500/a){const u=(s-1500/a)/(12e3/a);c=Ft(u)*85}else c=85;t&&(t.style.clipPath=Gt(c,o)),n=requestAnimationFrame(i)};return X(()=>{r=null,n=requestAnimationFrame(i),we(()=>{n&&cancelAnimationFrame(n)})}),(()=>{var o=Wt(),a=o.firstChild,l=a.nextSibling,s=l.firstChild,c=s.firstChild,u=c.nextSibling,d=t;return typeof d=="function"?Re(d,u):t=u,g(l,(()=>{var h=Q(()=>!!e.retrying);return()=>h()?(()=>{var m=Bt(),b=m.firstChild,P=b.nextSibling,A=P.firstChild;return g(P,()=>e.retrying.attempt,A),g(P,()=>e.retrying.maxAttempts,null),m})():Vt()})(),null),E(h=>{var m=`flex items-center justify-center min-h-[60vh] w-full ${e.class??""}`,b=re("/pwa-192.png"),P=re("/pwa-192.png");return m!==h.e&&B(o,h.e=m),b!==h.t&&M(c,"src",h.t=b),P!==h.a&&M(u,"src",h.a=P),h},{e:void 0,t:void 0,a:void 0}),o})()};var Xt=y('<span class="shrink-0 text-amber-400 flex items-center">'),Jt=y('<div class="text-xs font-bold tracking-[0.3em] gradient-text uppercase mb-0.5">'),Qt=y('<h1 class="text-lg sm:text-xl font-bold text-white leading-tight truncate">'),Zt=y('<p class="text-xs sm:text-sm text-zinc-400 mt-0.5 truncate">'),en=y('<div class="min-w-0 flex-1">'),tn=y('<div class="flex items-center gap-2 shrink-0">'),nn=y('<div class="px-4 sm:px-6 py-3 flex items-center justify-between gap-3"><div class="min-w-0 flex-1 flex items-center gap-3">'),rn=y("<div>"),on=y('<div class="px-4 sm:px-6 pb-2 flex items-center gap-2 overflow-x-auto border-t border-zinc-800/40 pt-2"data-testid=page-shell-tertiary>'),an=y("<div data-testid=page-shell-header>"),sn=y('<div class="p-4 sm:p-6">');function cn(e){const t=()=>!!(e.eyebrow||e.title||e.subtitle||e.icon),n=()=>t()||!!e.actions,r=()=>n()||!!e.secondaryRow||!!e.tertiaryRow;return[f(v,{get when(){return Q(()=>typeof e.title=="string")()&&e.title},get children(){return f(Oe,{get children(){return`${e.title} | Hilinga`}})}}),f(v,{get when(){return r()},get children(){var i=an();return g(i,f(v,{get when(){return n()},get children(){var o=nn(),a=o.firstChild;return g(a,f(v,{get when(){return e.icon},get children(){var l=Xt();return g(l,()=>e.icon),l}}),null),g(a,f(v,{get when(){return t()},get children(){var l=en();return g(l,f(v,{get when(){return e.eyebrow},get children(){var s=Jt();return g(s,()=>e.eyebrow),s}}),null),g(l,f(v,{get when(){return e.title},get children(){var s=Qt();return g(s,()=>e.title),s}}),null),g(l,f(v,{get when(){return e.subtitle},get children(){var s=Zt();return g(s,()=>e.subtitle),s}}),null),l}}),null),g(o,f(v,{get when(){return e.actions},get children(){var l=tn();return g(l,()=>e.actions),l}}),null),o}}),null),g(i,f(v,{get when(){return e.secondaryRow},get children(){var o=rn();return g(o,()=>e.secondaryRow),E(()=>B(o,`px-4 sm:px-6 ${n()?"pb-3":"py-3"} flex items-center gap-2 overflow-x-auto`)),o}}),null),g(i,f(v,{get when(){return e.tertiaryRow},get children(){var o=on();return g(o,()=>e.tertiaryRow),o}}),null),E(()=>B(i,`sticky top-0 z-30 border-b border-zinc-800/50 bg-zinc-900/70 backdrop-blur-md transition-transform duration-200 ease-out ${e.headerHidden?"-translate-y-full":"translate-y-0"}`)),i}}),f(v,{get when(){return!e.bare},get fallback(){return e.children},get children(){var i=sn();return g(i,()=>e.children),i}})]}function ln(e){return f(Oe,{get children(){return[Q(()=>e.name)," | Hilinga"]}})}function un(e){return[]}function dn(e,t,n){const r=Sn();return()=>r.resolveSetting(e,t,n)}async function fn(e,t,n){const r=new URLSearchParams({provider:t,capability:n}).toString(),i=await fetch(`/api/${e}/_call-token?${r}`,{method:"POST",credentials:"include"});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Error(`call-token mint denied (${i.status}): ${a.error??"unknown"}`)}return(await i.json()).token}const hn={PageShell:cn,PageTitle:ln,PageShareButton:un,SearchableSelect:He,Avatar:qt,PluginPageLoader:Yt,useActiveWorkspace:ve,useCan:Le,usePermissions:Ke,PermissionGate:De,useRouteSetting:dn,callToken:fn},[gn,mn]=ge(0),L={};function H(e){if(!e||typeof e!="object")return;let t=!1;for(const[n,r]of Object.entries(e))typeof r=="function"&&!L[n]&&(L[n]=r,t=!0);t&&(typeof window<"u"&&(window.__KSERP_UI_EXT__=L),mn(n=>n+1))}function yn(e){return gn(),L[e]}function wn(){typeof window>"u"||(window.__KSERP_GET_UI_EXT__=yn)}const ue="__KSERP_PLUGIN_REMOTE__",vn="__KSERP_REMOTES__",de=[500,1e3,2e3],q=3;let fe=!1;function _n(){if(fe)return;const e=window;e.__KSERP_SOLID_CORE__=ze,e.__KSERP_SOLID_WEB__=Ie,e.__KSERP_SOLID_STORE__=et,e.__KSERP_UI__=hn,fe=!0}function bn(e,t){const n=`kserp-remote-css-${e}`;if(document.getElementById(n))return;const r=t.replace(/remote\.js/,"remote.css");if(r===t)return;const i=document.createElement("link");i.id=n,i.rel="stylesheet",i.href=r,document.head.appendChild(i)}const G=new Map,W=new Map;function pn(e,t){const n=W.get(e);if(n)for(const r of n)try{r({attempt:t,maxAttempts:q})}catch{}}const he="__KSERP_REMOTE_LOAD_CHAIN__";function xn(e,t){const n=window,r=n[vn]??={};if(r[e]?.Component)return H(r[e].extensions),Promise.resolve(r[e]);const o=(n[he]??Promise.resolve()).then(()=>new Promise((a,l)=>{if(r[e]?.Component)return H(r[e].extensions),a(r[e]);n[ue]=void 0;const s=document.createElement("script");s.src=t,s.onload=()=>{const c=n[ue];c?.Component?(r[e]=c,H(c.extensions),a(c)):(s.remove(),l(new Error("remote bundle did not expose Component")))},s.onerror=()=>{s.remove(),l(new Error("failed to load remote UI bundle"))},document.head.appendChild(s)}));return n[he]=o.then(()=>{},()=>{}),o}async function kn(e,t){let n;for(let r=0;r<q;r++)try{return await xn(e,t)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),n.message!=="failed to load remote UI bundle")throw n;r<q-1&&(pn(e,r+2),console.warn(`[remote-loader] "${e}" load attempt ${r+1}/${q} failed, retrying in ${de[r]}ms`),await new Promise(o=>setTimeout(o,de[r]??2e3)))}throw n??new Error("failed to load remote UI bundle")}function $n(e,t,n){if(_n(),bn(e,t),n){const a=W.get(e);a?a.add(n):W.set(e,new Set([n]))}const r=G.get(e);if(r)return r.then(a=>(H(a.extensions),a));const i=kn(e,t);G.set(e,i),i.catch(()=>G.delete(e));const o=()=>W.delete(e);return i.then(o,o),i}const Y={tokens:{}};async function Pn(e){if(!e)return{plugins:[],routeSettings:{},theme:Y};const t=await fetch("/api/plugins/ui",{credentials:"include",headers:{"X-Workspace-Id":String(e)}});if(!t.ok)return{plugins:[],routeSettings:{},theme:Y};const n=await t.json();return{plugins:n.plugins??[],navTree:n.navTree,routeSettings:n.routeSettings??{},theme:n.theme??Y}}const je=me({plugins:()=>[],navTree:()=>{},ready:()=>!0,refetch:()=>{},routeSettings:()=>({}),resolveSetting:(e,t,n)=>n,theme:()=>({})}),Nn=e=>{const{activeWorkspace:t}=ve(),[n,{refetch:r}]=Ue(()=>t()?.ws_id,Pn),i=()=>n()?.routeSettings??{},o={plugins:()=>n()?.plugins??[],navTree:()=>n()?.navTree,refetch:()=>void r(),ready:()=>t()?.ws_id!=null&&(n.state==="ready"||n.state==="refreshing"),routeSettings:i,resolveSetting:(a,l,s)=>{const c=i()[a];return c?.userPref?.[l]??c?.workspaceDefault?.[l]??s},theme:()=>n()?.theme.tokens??{}};if(typeof window<"u"){let a=[];X(()=>{const l=n()?.theme.tokens??{},s=document.documentElement.style;for(const c of a)c in l||s.removeProperty(c);for(const[c,u]of Object.entries(l))s.setProperty(c,u);a=Object.keys(l)})}if(typeof window<"u"){wn();const a=new Set;X(()=>{const l=n()?.plugins??[];(async()=>{for(const s of l)if(!a.has(s.name)){a.add(s.name);try{await $n(s.name,s.remoteEntry)}catch(c){console.error(`[plugin-ui] eager load of "${s.name}" failed:`,c instanceof Error?c.message:String(c))}}})()})}return f(je.Provider,{value:o,get children(){return e.children}})};function Sn(){return ye(je)}export{qt as A,Mn as M,Nn as P,Yt as a,mt as c,Cn as d,En as e,Tn as f,$n as l,jn as n,Et as r,Sn as u,Me as w};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as i}from"./auth-DnjIzX2B.js";import{e as t,y as n}from"./routing-C6AwqsGL.js";var h=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],y=e=>t(i,n(e,{iconNode:h,name:"activity"})),f=y,p=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],k=e=>t(i,n(e,{iconNode:p,name:"book-open"})),v=k,m=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],g=e=>t(i,n(e,{iconNode:m,name:"building-2"})),b=g,x=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],N=e=>t(i,n(e,{iconNode:x,name:"layout-dashboard"})),M=N,w=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],_=e=>t(i,n(e,{iconNode:w,name:"layout-grid"})),q=_,P=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],A=e=>t(i,n(e,{iconNode:P,name:"megaphone"})),W=A,$=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],I=e=>t(i,n(e,{iconNode:$,name:"shield"})),O=I,R=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],C=e=>t(i,n(e,{iconNode:R,name:"users-round"})),V=C;function c(e){return e.kind==="section"}function l(e,o){if(o.push({href:e.href,requiredPermission:e.requiredPermission,allowedWorkspaceRoles:e.allowedWorkspaceRoles,superuserOnly:e.superuserOnly}),e.children)for(const r of e.children)l(r,o)}function z(e){const o=[];for(const r of e)if(c(r))for(const s of r.items)l(s,o);else l(r,o);return o}function B(e,o,r,s){return o||r==="admin"?!0:e.superuserOnly?!1:e.requiredPermission?s(e.requiredPermission):e.allowedWorkspaceRoles?r?e.allowedWorkspaceRoles.includes(r):!1:!!r}function U(e,o,r,s){const a=z(e);for(const d of a)if(B(d,o,r,s))return d.href;return null}const H=[{href:"/dashboard",label:"Dashboard",icon:M,requiredPermission:"dashboard.view"},{kind:"section",id:"engagement",label:"Engagement",icon:W,items:[]},{kind:"section",id:"staff",label:"Staff",icon:f,items:[]},{kind:"section",id:"catalog",label:"Catalog",icon:q,items:[]},{kind:"section",id:"customers",label:"Customers",icon:V,items:[]},{kind:"section",id:"bookkeeping",label:"Bookkeeping",icon:v,items:[]}],j=[{href:"/users",label:"Users",icon:O,superuserOnly:!0},{href:"/workspaces",label:"Workspaces",icon:b,superuserOnly:!0}];function L(e){const o=H.map(a=>c(a)?{...a,items:[...a.items]}:a),r=new Map;for(const a of o)c(a)&&r.set(a.id,a);const s=[...e].sort((a,d)=>(a.order??1/0)-(d.order??1/0));for(const a of s){const d={href:a.href,label:a.label,icon:a.icon,capability:a.capability,requiredPermission:a.requiredPermission},u=a.section?r.get(a.section):void 0;u?u.items.push(d):o.push(d)}return o}const E=L([]);export{f as a,v as b,M as c,b as d,L as e,j as f,U as g,c as i,q as l,W as m,O as s,V as u,E as w};
|
|
Binary file
|
|
Binary file
|