@rizom/brain 0.2.0-alpha.868 → 0.2.0-alpha.869

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/brain.js +6 -6
  2. package/dist/chunks/app-6ya0ev45.js +5 -0
  3. package/dist/chunks/{index-2129s41z.js → index-02pt9z7t.js} +2 -2
  4. package/dist/chunks/{index-n569mach.js → index-dmggce5b.js} +2 -2
  5. package/dist/chunks/{index-151stz0p.js → index-gnbfdewj.js} +3 -3
  6. package/dist/chunks/{index-151stz0p.js.map → index-gnbfdewj.js.map} +6 -6
  7. package/dist/chunks/{index-bgybe5r3.js → index-nnwk2h8n.js} +2 -2
  8. package/dist/chunks/{index-f6mq05th.js → index-sv87ptaj.js} +3 -3
  9. package/dist/chunks/{index-f6mq05th.js.map → index-sv87ptaj.js.map} +1 -1
  10. package/dist/chunks/{index-21c4j6d8.js → index-wete5qfn.js} +2 -2
  11. package/dist/chunks/{package-hdjj3mg3.js → package-gcdazntk.js} +3 -3
  12. package/dist/chunks/{package-hdjj3mg3.js.map → package-gcdazntk.js.map} +1 -1
  13. package/dist/entities.d.ts +11 -0
  14. package/dist/entities.js +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/interfaces.js +1 -1
  17. package/dist/model.js +5 -5
  18. package/dist/model.js.map +6 -6
  19. package/dist/services.d.ts +17 -0
  20. package/dist/services.js +1 -1
  21. package/dist/testing.js +1 -1
  22. package/dist/ui/{studio-app-wgdxs5zd.js → studio-app-dx99m4vs.js} +3 -3
  23. package/dist/ui/studio-asset-manifest.json +21 -21
  24. package/dist/ui/studio-chunks/{account-view-063wwkww.js → account-view-pf71e4d1.js} +1 -1
  25. package/dist/ui/studio-chunks/{main-a91pxdfw.js → main-8zx47tjg.js} +1 -1
  26. package/dist/ui/studio-chunks/{main-yfr70kka.js → main-e098kfma.js} +1 -1
  27. package/dist/ui/studio-chunks/{main-wv4cygtj.js → main-ecwfbj4t.js} +1 -1
  28. package/dist/ui/studio-chunks/{main-6d8fnk33.js → main-eh2baz0t.js} +1 -1
  29. package/dist/ui/studio-chunks/{main-2dnw093e.js → main-g15rdsa4.js} +2 -2
  30. package/dist/ui/studio-chunks/{main-2dnw093e.js.map → main-g15rdsa4.js.map} +6 -6
  31. package/dist/ui/studio-chunks/{main-g05whm36.js → main-j4wezmkn.js} +3 -3
  32. package/dist/ui/studio-chunks/{main-g05whm36.js.map → main-j4wezmkn.js.map} +3 -3
  33. package/dist/ui/studio-chunks/{studio-ask-panel-h8vy1aj5.js → studio-ask-panel-cgmkp80w.js} +1 -1
  34. package/dist/ui/studio-chunks/{studio-chat-workspace-5kxn0f0c.js → studio-chat-workspace-c3xe9bre.js} +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunks/app-esb1afkk.js +0 -5
  37. /package/dist/chunks/{app-esb1afkk.js.map → app-6ya0ev45.js.map} +0 -0
  38. /package/dist/chunks/{index-2129s41z.js.map → index-02pt9z7t.js.map} +0 -0
  39. /package/dist/chunks/{index-n569mach.js.map → index-dmggce5b.js.map} +0 -0
  40. /package/dist/chunks/{index-bgybe5r3.js.map → index-nnwk2h8n.js.map} +0 -0
  41. /package/dist/chunks/{index-21c4j6d8.js.map → index-wete5qfn.js.map} +0 -0
  42. /package/dist/ui/{studio-app-wgdxs5zd.js.map → studio-app-dx99m4vs.js.map} +0 -0
  43. /package/dist/ui/studio-chunks/{account-view-063wwkww.js.map → account-view-pf71e4d1.js.map} +0 -0
  44. /package/dist/ui/studio-chunks/{main-a91pxdfw.js.map → main-8zx47tjg.js.map} +0 -0
  45. /package/dist/ui/studio-chunks/{main-yfr70kka.js.map → main-e098kfma.js.map} +0 -0
  46. /package/dist/ui/studio-chunks/{main-wv4cygtj.js.map → main-ecwfbj4t.js.map} +0 -0
  47. /package/dist/ui/studio-chunks/{main-6d8fnk33.js.map → main-eh2baz0t.js.map} +0 -0
  48. /package/dist/ui/studio-chunks/{studio-ask-panel-h8vy1aj5.js.map → studio-ask-panel-cgmkp80w.js.map} +0 -0
  49. /package/dist/ui/studio-chunks/{studio-chat-workspace-5kxn0f0c.js.map → studio-chat-workspace-c3xe9bre.js.map} +0 -0
@@ -1,46 +1,46 @@
1
1
  {
2
2
  "version": 2,
3
3
  "entrypoints": {
4
- "script": "studio-app-wgdxs5zd.js",
4
+ "script": "studio-app-dx99m4vs.js",
5
5
  "stylesheet": "studio-app-52032946342ba9bbe65238644c7c7c5b96a58973cfefc9377ffc4db842917c56.css"
6
6
  },
7
7
  "assets": {
8
8
  "studio-app-52032946342ba9bbe65238644c7c7c5b96a58973cfefc9377ffc4db842917c56.css": "studio-app-52032946342ba9bbe65238644c7c7c5b96a58973cfefc9377ffc4db842917c56.css",
9
- "studio-app-wgdxs5zd.js": "studio-app-wgdxs5zd.js",
10
- "studio-app-wgdxs5zd.js.map": "studio-app-wgdxs5zd.js.map",
11
- "studio-chunks/account-view-063wwkww.js": "studio-chunks/account-view-063wwkww.js",
12
- "studio-chunks/account-view-063wwkww.js.map": "studio-chunks/account-view-063wwkww.js.map",
9
+ "studio-app-dx99m4vs.js": "studio-app-dx99m4vs.js",
10
+ "studio-app-dx99m4vs.js.map": "studio-app-dx99m4vs.js.map",
11
+ "studio-chunks/account-view-pf71e4d1.js": "studio-chunks/account-view-pf71e4d1.js",
12
+ "studio-chunks/account-view-pf71e4d1.js.map": "studio-chunks/account-view-pf71e4d1.js.map",
13
13
  "studio-chunks/chat-db7d7t9x.js": "studio-chunks/chat-db7d7t9x.js",
14
14
  "studio-chunks/chat-db7d7t9x.js.map": "studio-chunks/chat-db7d7t9x.js.map",
15
15
  "studio-chunks/highlighted-body-OFNGDK62-4dbebe14.js": "studio-chunks/highlighted-body-OFNGDK62-4dbebe14.js",
16
16
  "studio-chunks/highlighted-body-OFNGDK62-4dbebe14.js.map": "studio-chunks/highlighted-body-OFNGDK62-4dbebe14.js.map",
17
- "studio-chunks/main-2dnw093e.js": "studio-chunks/main-2dnw093e.js",
18
- "studio-chunks/main-2dnw093e.js.map": "studio-chunks/main-2dnw093e.js.map",
19
17
  "studio-chunks/main-2vaawyz9.js": "studio-chunks/main-2vaawyz9.js",
20
18
  "studio-chunks/main-2vaawyz9.js.map": "studio-chunks/main-2vaawyz9.js.map",
21
19
  "studio-chunks/main-4qxa4jpx.js": "studio-chunks/main-4qxa4jpx.js",
22
20
  "studio-chunks/main-4qxa4jpx.js.map": "studio-chunks/main-4qxa4jpx.js.map",
23
- "studio-chunks/main-6d8fnk33.js": "studio-chunks/main-6d8fnk33.js",
24
- "studio-chunks/main-6d8fnk33.js.map": "studio-chunks/main-6d8fnk33.js.map",
25
- "studio-chunks/main-a91pxdfw.js": "studio-chunks/main-a91pxdfw.js",
26
- "studio-chunks/main-a91pxdfw.js.map": "studio-chunks/main-a91pxdfw.js.map",
21
+ "studio-chunks/main-8zx47tjg.js": "studio-chunks/main-8zx47tjg.js",
22
+ "studio-chunks/main-8zx47tjg.js.map": "studio-chunks/main-8zx47tjg.js.map",
23
+ "studio-chunks/main-e098kfma.js": "studio-chunks/main-e098kfma.js",
24
+ "studio-chunks/main-e098kfma.js.map": "studio-chunks/main-e098kfma.js.map",
27
25
  "studio-chunks/main-eakaz9w9.js": "studio-chunks/main-eakaz9w9.js",
28
26
  "studio-chunks/main-eakaz9w9.js.map": "studio-chunks/main-eakaz9w9.js.map",
27
+ "studio-chunks/main-ecwfbj4t.js": "studio-chunks/main-ecwfbj4t.js",
28
+ "studio-chunks/main-ecwfbj4t.js.map": "studio-chunks/main-ecwfbj4t.js.map",
29
+ "studio-chunks/main-eh2baz0t.js": "studio-chunks/main-eh2baz0t.js",
30
+ "studio-chunks/main-eh2baz0t.js.map": "studio-chunks/main-eh2baz0t.js.map",
29
31
  "studio-chunks/main-fdxmnsj6.js": "studio-chunks/main-fdxmnsj6.js",
30
32
  "studio-chunks/main-fdxmnsj6.js.map": "studio-chunks/main-fdxmnsj6.js.map",
31
- "studio-chunks/main-g05whm36.js": "studio-chunks/main-g05whm36.js",
32
- "studio-chunks/main-g05whm36.js.map": "studio-chunks/main-g05whm36.js.map",
33
+ "studio-chunks/main-g15rdsa4.js": "studio-chunks/main-g15rdsa4.js",
34
+ "studio-chunks/main-g15rdsa4.js.map": "studio-chunks/main-g15rdsa4.js.map",
35
+ "studio-chunks/main-j4wezmkn.js": "studio-chunks/main-j4wezmkn.js",
36
+ "studio-chunks/main-j4wezmkn.js.map": "studio-chunks/main-j4wezmkn.js.map",
33
37
  "studio-chunks/main-s8r820px.js": "studio-chunks/main-s8r820px.js",
34
38
  "studio-chunks/main-s8r820px.js.map": "studio-chunks/main-s8r820px.js.map",
35
- "studio-chunks/main-wv4cygtj.js": "studio-chunks/main-wv4cygtj.js",
36
- "studio-chunks/main-wv4cygtj.js.map": "studio-chunks/main-wv4cygtj.js.map",
37
- "studio-chunks/main-yfr70kka.js": "studio-chunks/main-yfr70kka.js",
38
- "studio-chunks/main-yfr70kka.js.map": "studio-chunks/main-yfr70kka.js.map",
39
39
  "studio-chunks/mermaid-GHXKKRXX-taaxh7ab.js": "studio-chunks/mermaid-GHXKKRXX-taaxh7ab.js",
40
40
  "studio-chunks/mermaid-GHXKKRXX-taaxh7ab.js.map": "studio-chunks/mermaid-GHXKKRXX-taaxh7ab.js.map",
41
- "studio-chunks/studio-ask-panel-h8vy1aj5.js": "studio-chunks/studio-ask-panel-h8vy1aj5.js",
42
- "studio-chunks/studio-ask-panel-h8vy1aj5.js.map": "studio-chunks/studio-ask-panel-h8vy1aj5.js.map",
43
- "studio-chunks/studio-chat-workspace-5kxn0f0c.js": "studio-chunks/studio-chat-workspace-5kxn0f0c.js",
44
- "studio-chunks/studio-chat-workspace-5kxn0f0c.js.map": "studio-chunks/studio-chat-workspace-5kxn0f0c.js.map"
41
+ "studio-chunks/studio-ask-panel-cgmkp80w.js": "studio-chunks/studio-ask-panel-cgmkp80w.js",
42
+ "studio-chunks/studio-ask-panel-cgmkp80w.js.map": "studio-chunks/studio-ask-panel-cgmkp80w.js.map",
43
+ "studio-chunks/studio-chat-workspace-c3xe9bre.js": "studio-chunks/studio-chat-workspace-c3xe9bre.js",
44
+ "studio-chunks/studio-chat-workspace-c3xe9bre.js.map": "studio-chunks/studio-chat-workspace-c3xe9bre.js.map"
45
45
  }
46
46
  }
@@ -1,3 +1,3 @@
1
- import{Ac as we,qc as c,rc as o,sc as d,uc as me,vc as $e,wc as Me,xc as Le,yc as ve}from"./main-g05whm36.js";import{Dc as Ve,Hc as ze,Ic as Je}from"./main-a91pxdfw.js";import{$c as Ke,Bd as H,Cd as F,Nc as x,Pc as y,Qc as J,Tc as te,Wd as Ce,Zc as He,ad as Ye,bd as M,cd as L,ce as qe,de as ee,pd as ke,ud as X,vd as A,wd as je}from"./main-2dnw093e.js";import{Ee as i}from"./main-4qxa4jpx.js";import{Qf as ne}from"./main-2vaawyz9.js";import{wg as b}from"./main-s8r820px.js";var K=b(ne(),1);var We=i.object({displayName:i.string(),role:i.enum(["admin","trusted","public"]),profileEntityId:i.string().optional(),passkeys:i.array(i.object({id:i.string(),transports:i.array(i.string()).optional(),credentialDeviceType:i.string().optional(),credentialBackedUp:i.boolean(),createdAt:i.number(),updatedAt:i.number()})),appPasswords:i.array(i.object({id:i.string(),username:i.string(),label:i.string(),access:i.enum(["read","write"]),createdAt:i.number(),expiresAt:i.number(),lastUsedAt:i.number().optional()})),connectedChannels:i.array(i.object({type:i.string(),label:i.string(),verifiedAt:i.number()})),pluginSettings:i.array(i.object({id:i.string(),title:i.string(),description:i.string().optional(),configured:i.boolean(),revision:i.number().nullable(),fields:i.array(i.object({name:i.string(),label:i.string(),control:i.enum(["text","url","number","checkbox"]),secret:i.boolean(),required:i.boolean(),value:i.union([i.string(),i.number(),i.boolean(),i.null()]).optional(),set:i.boolean().optional()}))})),sessions:i.array(i.object({id:i.string(),current:i.boolean(),createdAt:i.number(),expiresAt:i.number()}))});function Ge(e){return We.safeParse(e).success}var ge=i.custom(Ge,{message:"Invalid account response"}),ie=i.object({account:ge}),Ze=i.object({account:ge.optional(),appPassword:i.object({username:i.string(),password:i.string()}).optional(),revoked:i.object({sessions:i.number(),refreshTokens:i.number().optional()}).optional(),signedOut:i.boolean().optional()});function Qe(e){return Ze.safeParse(e).success}var Xe=i.custom(Qe,{message:"Invalid account mutation response"}),et=i.custom((e)=>{if(!X(e))return!1;return typeof e.challenge==="string"&&X(e.rp)&&X(e.user)&&Array.isArray(e.pubKeyCredParams)},{message:"Invalid passkey registration options"});class he extends Error{status;constructor(e,t){super(e);this.name="AccountApiError",this.status=t}}async function V(e,t){let n;try{n=await e.json()}catch{n={}}if(!e.ok){let a=typeof n==="object"&&n!==null&&"error"in n&&typeof n.error==="string"?n.error:"Account request failed";throw new he(a,e.status)}return t.parse(n)}function se(e){let t=e.replaceAll("-","+").replaceAll("_","/").padEnd(Math.ceil(e.length/4)*4,"=");return Uint8Array.from(atob(t),(n)=>n.charCodeAt(0)).buffer}function re(e){let t=new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return btoa(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function tt(e){return{challenge:se(e.challenge),rp:e.rp,user:{...e.user,id:se(e.user.id)},pubKeyCredParams:e.pubKeyCredParams,...e.timeout!==void 0?{timeout:e.timeout}:{},...e.excludeCredentials?{excludeCredentials:e.excludeCredentials.map((t)=>({...t,id:se(t.id)}))}:{},...e.authenticatorSelection?{authenticatorSelection:e.authenticatorSelection}:{},...e.attestation?{attestation:e.attestation}:{},...e.extensions?{extensions:e.extensions}:{}}}var nt=(e,t)=>fetch(e,t);class ce{fetchFn;constructor(e={}){this.fetchFn=e.fetch??nt}async fetchAccount(){return(await V(await this.fetchFn("/auth/account",{credentials:"same-origin",cache:"no-store"}),ie)).account}async mutatePluginSettings(e){return(await V(await this.fetchFn("/auth/account/plugin-settings",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ie)).account}async mutateAccount(e){return V(await this.fetchFn("/auth/account/mutations",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xe)}async registerPasskey(){let e=await V(await this.fetchFn("/auth/account/passkeys/options",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),et),t=await navigator.credentials.create({publicKey:tt(e)});if(!(t instanceof PublicKeyCredential))throw Error("Passkey registration was cancelled");if(!(t.response instanceof AuthenticatorAttestationResponse))throw Error("Authenticator returned an invalid passkey response");let n=t.response,a={id:t.id,rawId:re(t.rawId),type:t.type,...t.authenticatorAttachment?{authenticatorAttachment:t.authenticatorAttachment}:{},clientExtensionResults:t.getClientExtensionResults(),response:{clientDataJSON:re(n.clientDataJSON),attestationObject:re(n.attestationObject),transports:typeof n.getTransports==="function"?n.getTransports():[]}};return(await V(await this.fetchFn("/auth/account/passkeys/verify",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),ie.extend({verified:i.literal(!0)}))).account}}function ye(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function Ae(e,t){let n=t.indexOf("/");if(n<=0||n===t.length-1)return;let a=t.slice(0,n),s=t.slice(n+1);return`${e==="/"?"":e.replace(/\/+$/,"")}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`}function j(e,t=!1){return new Date(t?e:e*1000).toISOString()}var R=b(x(),1);function z(e){return R.jsxDEV(y,{variant:e.tone==="danger"?"danger":e.tone==="primary"?"primary":"outline",type:e.type??"button",onClick:e.onClick,disabled:e.disabled,children:e.children},void 0,!1,void 0,this)}function U(e){return R.jsxDEV("div",{className:o("account-access-item",c.access),children:[R.jsxDEV(ve,{density:"comfortable",title:e.kind,description:e.description,metadata:e.metadata??[]},void 0,!1,void 0,this),e.action]},void 0,!0,void 0,this)}function C(e){return R.jsxDEV("section",{className:o("account-detail-section",c.section),children:[R.jsxDEV("div",{className:"account-section-label",children:[R.jsxDEV("h3",{className:o("",c.heading,ee.section,e.titleHidden===!0&&c.headingHidden),children:e.title},void 0,!1,void 0,this),e.description?R.jsxDEV("p",{className:o("",c.description),children:e.description},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),R.jsxDEV("div",{className:o("people-stack",c.stack),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function be(e,t){let n=Object.fromEntries(t.entries());for(let a of e)if(a.control==="checkbox")n[a.name]=t.has(a.name);else if(a.control==="number"&&typeof n[a.name]==="string"&&n[a.name]!=="")n[a.name]=Number(n[a.name]);return n}function Se(e){if(e.secret)return"password";if(e.control==="url"||e.control==="number")return e.control;return"text"}var r=b(x(),1);function Ne(e){let{account:t,actions:n,title:a,studioPath:s}=e,g=t.role,h=t.profileEntityId?Ae(s,t.profileEntityId):void 0;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV(C,{title:"Profile",titleHidden:!0,children:[r.jsxDEV("div",{className:o("account-identity",c.identity),children:r.jsxDEV("div",{className:o("people-detail-person",c.person),children:[r.jsxDEV("span",{className:o("people-avatar people-avatar--large",c.avatar),children:ye(a)},void 0,!1,void 0,this),r.jsxDEV("span",{className:o("",c.personCopy),children:[r.jsxDEV("span",{className:o("people-detail-name",c.name,ee.secondaryDisplay),children:a},void 0,!1,void 0,this),r.jsxDEV("span",{"data-account-role":g,className:o("account-role",c.role),children:ke(g)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t.profileEntityId?r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("account-profile-note",c.description),children:"Managed by the Anchor profile — your account name follows the published profile."},void 0,!1,void 0,this),r.jsxDEV(U,{kind:"Anchor profile",description:a,action:h?r.jsxDEV(y,{asChild:!0,variant:"link",children:r.jsxDEV("a",{href:h,children:"Edit Anchor Profile →"},void 0,!1,void 0,this)},void 0,!1,void 0,this):void 0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(O)=>{O.preventDefault(),n.saveName()},children:[r.jsxDEV("label",{className:o("",c.formLabel),htmlFor:"display-name",children:"Display name"},void 0,!1,void 0,this),r.jsxDEV(J,{id:"display-name",maxLength:200,autoComplete:"name",required:!0,value:n.displayName,onChange:(O)=>n.setDisplayName(O.target.value)},void 0,!1,void 0,this),r.jsxDEV(z,{type:"submit",disabled:n.busy,children:"Save name"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV("p",{className:o("",c.description),children:"Your role controls access to this brain. An administrator manages access in Administration."},void 0,!1,void 0,this),g==="admin"&&r.jsxDEV(y,{asChild:!0,variant:"outline",children:r.jsxDEV("a",{href:Ce(s,"admin:administration"),children:"Manage people in Administration →"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Te(e){let t=e.account.connectedChannels;return r.jsxDEV(C,{title:"Linked identities",titleHidden:!0,description:"How this brain recognizes messages from you. These are your identities, not services configured for the whole brain.",children:t.length===0?r.jsxDEV("p",{className:o("people-empty",c.empty),children:"No linked identities."},void 0,!1,void 0,this):t.map((n)=>r.jsxDEV(U,{kind:n.type,description:n.label,metadata:[`Verified: ${j(n.verifiedAt,!0)}`]},`${n.type}:${n.label}`,!1,void 0,this))},void 0,!1,void 0,this)}function Pe(e){let{account:t,actions:n}=e;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("",c.description),children:"Settings for your account only. These do not configure shared services for the brain."},void 0,!1,void 0,this),t.pluginSettings.map((a)=>r.jsxDEV(we,{label:a.title,density:"comfortable",presentation:"disclosure",children:[r.jsxDEV("p",{className:o("account-settings-description",c.description),children:a.description??"Private settings for this account."},void 0,!1,void 0,this),r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(s)=>{s.preventDefault(),n.saveSettings(a,new FormData(s.currentTarget))},children:[a.fields.map((s)=>r.jsxDEV("label",{htmlFor:`setting-${a.id}-${s.name}`,className:o("",c.field),children:[r.jsxDEV("span",{className:o("",c.formLabel),children:s.label},void 0,!1,void 0,this),s.control==="checkbox"?r.jsxDEV(te,{id:`setting-${a.id}-${s.name}`,name:s.name,defaultChecked:s.value===!0},void 0,!1,void 0,this):r.jsxDEV(J,{id:`setting-${a.id}-${s.name}`,name:s.name,type:Se(s),required:s.required&&(!a.configured||s.secret)&&!s.set,defaultValue:s.secret?"":typeof s.value==="string"||typeof s.value==="number"?s.value:"",placeholder:s.secret&&s.set?"Stored — leave blank to keep":void 0,autoComplete:"off"},void 0,!1,void 0,this)]},s.name,!0,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:[r.jsxDEV(z,{type:"submit",tone:"primary",disabled:n.busy,children:"Save settings"},void 0,!1,void 0,this),a.configured?r.jsxDEV(y,{variant:"danger",disabled:n.busy,type:"button",onClick:()=>n.removeSettings(a),children:"Remove"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},`${a.id}:${a.revision??"unset"}`,!0,void 0,this)]},a.id,!0,void 0,this))]},void 0,!0,void 0,this)}function xe(e){let{account:t,actions:n}=e,{busy:a}=n;return r.jsxDEV("div",{className:o("",c.column),children:[r.jsxDEV(C,{title:"Sign-in",description:"Passkeys used to access this account. Your final passkey is protected from revocation.",children:[t.passkeys.map((s)=>r.jsxDEV(U,{kind:s.credentialBackedUp?"Synced passkey":"Device passkey",metadata:[`Added: ${j(s.createdAt,!0)}`],action:t.passkeys.length>1?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokePasskey(s.id),children:"Revoke"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:r.jsxDEV(y,{variant:"outline",disabled:a,type:"button",onClick:n.addPasskey,children:"Add passkey"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV(C,{title:"Signed-in sessions",children:t.sessions.map((s)=>r.jsxDEV(U,{kind:s.current?"This session":"Browser session",metadata:[`Started: ${j(s.createdAt)}`,...s.current?["Current browser"]:[]],action:!s.current?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokeSession(s.id),children:"End"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this))},void 0,!1,void 0,this),r.jsxDEV("footer",{className:o("account-session-actions",c.footer),children:[r.jsxDEV("small",{children:"Access changes require an Admin."},void 0,!1,void 0,this),r.jsxDEV("div",{className:o("",c.actions),children:[r.jsxDEV(z,{disabled:a||t.sessions.every((s)=>s.current),onClick:n.revokeOtherSessions,children:"End other sessions"},void 0,!1,void 0,this),r.jsxDEV(z,{tone:"danger",disabled:a,onClick:n.revokeAllSessions,children:"Sign out everywhere"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ee=b(ne(),1);function de(e){return new URL(e).host.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function le(e){return JSON.stringify(e,null,2)}function Oe(e,t,n){return["Already have servers there? Add only the ",{code:`"${n}"`}," entry inside ",{code:`"${t}"`},` of ${e}.`]}function Re(e){let t=de(e),n="Sign in with your passkey when asked.";return[{id:"claude",group:"primary",name:"Claude",note:["Desktop app and claude.ai."],steps:[["Open Settings → Connectors → Add custom connector."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when asked."]]},{id:"chatgpt",group:"primary",name:"ChatGPT",steps:[["Open Settings → Apps & Connectors → Advanced and turn on Developer mode."],["Choose Create, name it ",{code:t},", paste your brain’s address and pick OAuth."],["Sign in with your passkey when asked."]]},{id:"claude-code",group:"developer",name:"Claude Code",lead:[["Add the server in your terminal:"]],snippet:{label:"Claude Code command",code:`claude mcp add --transport http ${t} ${e}`},after:[["Then start Claude Code, run ",{code:"/mcp"},", choose ",{code:t}," and sign in with your passkey."]]},{id:"cursor",group:"developer",name:"Cursor",steps:[["Open Cursor Settings → MCP → Add new global MCP server."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when Cursor asks."]],lead:[["Or add it to ",{code:"~/.cursor/mcp.json"},":"]],snippet:{label:"Cursor configuration",code:le({mcpServers:{[t]:{url:e}}})},after:[Oe("the file","mcpServers",t)]},{id:"vscode",group:"developer",name:"VS Code",steps:[["Open the Command Palette and run ",{code:"MCP: Add Server"},"."],["Choose HTTP, paste your brain’s address and name it ",{code:t},"."],["Choose Global, then sign in with your passkey when asked."]],lead:[["Or run ",{code:"MCP: Open User Configuration"}," and add:"]],snippet:{label:"VS Code configuration",code:le({servers:{[t]:{type:"http",url:e}}})},after:[Oe("your user configuration","servers",t)]},{id:"other",group:"developer",name:"Any other MCP client",inlineName:"any other MCP client",note:["Look for “add MCP server”, “connector” or “integration” in the tool’s settings and fill in:"],fields:[{label:"Name",value:[{code:t}]},{label:"Type",value:["Remote server, Streamable HTTP — not stdio, not SSE"]},{label:"URL",value:[{code:e}]},{label:"Authentication",value:["OAuth. Leave API key, token, client ID and secret empty; the tool registers itself."]}],lead:[["When you connect, your browser opens “Authorize <tool>?” on your brain. Approve MCP access with your passkey. The tool then has two tools: ",{code:"chat"},", to ask your brain anything as you would in chat, and ",{code:"confirm"},", to approve changes when the brain asks."],["Tool only takes local (stdio) servers, or insists on an API key? Bridge it with ",{code:"mcp-remote"},", which handles the sign-in:"]],snippet:{label:"mcp-remote bridge configuration",code:le({mcpServers:{[t]:{command:"npx",args:["-y","mcp-remote",e]}}})}}]}var u=b(x(),1);function W(e){return u.jsxDEV(u.Fragment,{children:e.text.map((t,n)=>typeof t==="string"?t:u.jsxDEV("code",{className:o("",d.code),children:t.code},n,!1,void 0,this))},void 0,!1,void 0,this)}function _(e){let[t,n]=Ee.useState("idle"),a=async()=>{try{await navigator.clipboard.writeText(e.code),n("copied")}catch{n("unavailable")}};return u.jsxDEV("div",{className:o("ai-tools-snippet",d.snippet),children:[u.jsxDEV("pre",{className:o("",d.snippetCode),"aria-label":e.label,children:e.code},void 0,!1,void 0,this),u.jsxDEV(y,{variant:"outline",size:"sm",onClick:()=>void a(),"aria-label":`Copy ${e.label}`,children:t==="copied"?"Copied":t==="unavailable"?"Select to copy":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function G(e){let{client:t}=e;return u.jsxDEV("article",{className:o("ai-tools-client",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:t.name},void 0,!1,void 0,this),t.note?u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:t.note},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,t.steps?u.jsxDEV("ol",{className:o("",d.steps),children:t.steps.map((n,a)=>u.jsxDEV("li",{children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):null,t.fields?u.jsxDEV("dl",{className:o("",d.fields),children:t.fields.map((n)=>u.jsxDEV("div",{className:o("",d.field),children:[u.jsxDEV("dt",{className:o("",d.fieldLabel),children:n.label},void 0,!1,void 0,this),u.jsxDEV("dd",{className:o("",d.fieldValue),children:u.jsxDEV(W,{text:n.value},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},n.label,!0,void 0,this))},void 0,!1,void 0,this):null,t.lead?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`lead-${a}`,!1,void 0,this)),t.snippet?u.jsxDEV(_,{...t.snippet},void 0,!1,void 0,this):null,t.after?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`after-${a}`,!1,void 0,this))]},void 0,!0,void 0,this)}function ot(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function De(e){let t=Re(e.mcpUrl),n=t.filter((s)=>s.group==="primary"),a=t.filter((s)=>s.group==="developer");return u.jsxDEV(C,{title:"AI tools",description:"Connect AI tools you already use to this brain. A connected tool talks to the brain as you do in chat — asking, saving and updating within your access — after you sign in with your passkey.",children:[u.jsxDEV("article",{className:o("ai-tools-address",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s address"},void 0,!1,void 0,this),u.jsxDEV(_,{label:"brain address",code:e.mcpUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients),children:n.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this),u.jsxDEV("details",{className:o("ai-tools-developer",d.developer),children:[u.jsxDEV("summary",{className:o("",d.developerSummary),children:["Developer tools and other clients",u.jsxDEV("span",{className:o("",d.developerHint),children:ot(a.map((s)=>s.inlineName??s.name))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients,d.developerClients),children:a.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Z=b(ne(),1);var ue="Enter the username and password of an app password from this page.";function Ie(e){let t=new URL(e),n=`${t.protocol==="https:"?"davs":"dav"}://${t.host}${t.pathname}`,a=de(e);return[{id:"macos",group:"file-manager",name:"macOS",note:["Finder, on any Mac."],steps:[["In Finder, choose Go → Connect to Server (⌘K)."],["Paste the address below and click Connect."],["Choose Registered User. ",ue]],snippet:{label:"macOS address",code:e}},{id:"windows",group:"file-manager",name:"Windows",note:["File Explorer, on Windows 10 and 11."],steps:[["In File Explorer, open This PC and choose Map network drive."],["Paste the address below as the folder, tick Connect using different credentials, and click Finish."],[ue]],snippet:{label:"Windows address",code:e}},{id:"gnome-files",group:"file-manager",name:"GNOME Files",note:["The file manager on Ubuntu, Fedora and other GNOME desktops."],steps:[["Open Files → Other Locations (or Network)."],["Under Connect to Server, enter the address below and connect."],[ue]],snippet:{label:"GNOME Files address",code:n}},{id:"rclone",group:"command-line",name:"rclone",note:["Linux, macOS and Windows, from a terminal."],lead:[["Store the drive as a remote, with your app password’s username and password:"]],snippet:{label:"rclone remote command",code:`rclone config create ${a} webdav url=${e} vendor=other user=YOUR_USERNAME pass=YOUR_PASSWORD --obscure`},after:[["Then mount it on an empty folder: ",{code:`rclone mount ${a}: ~/Brain --vfs-cache-mode writes`},"."]]}]}var l=b(x(),1),oe="app-password-label",Ue="app-password-write";function pe(e){return j(e).slice(0,10)}function at(e,t){return[`Created: ${pe(e.createdAt)}`,`${e.expiresAt<=t?"Expired":"Expires"}: ${pe(e.expiresAt)}`,e.lastUsedAt===void 0?"Never used":`Last used: ${pe(e.lastUsedAt)}`]}function Fe(e){let{account:t,actions:n,connect:a}=e,{busy:s,createdAppPassword:g}=n,[h,O]=Z.useState(void 0),v=a!==void 0&&h!==void 0?$e(g,h,t.appPasswords,me(a)):null;Z.useEffect(()=>{if(a&&v)Me(a,v)},[a,v]);let N=Math.floor(Date.now()/1000),[T,S]=Z.useState(!1),D=Ie(e.davUrl),I=D.filter((f)=>f.group==="file-manager"),E=D.filter((f)=>f.group==="command-line");return l.jsxDEV("div",{className:o("",c.column),children:[l.jsxDEV(C,{title:"Drive",description:"Mount this brain as a network drive. It shows the notes, posts and files you can see here, as folders and files, to open and edit on your computer.",children:[a?l.jsxDEV(Le,{connect:a,created:v,busy:s||h!==void 0&&v===null,onConnect:()=>{O(g?.username??null),n.createAppPassword(me(a),"write")}},void 0,!1,void 0,this):null,l.jsxDEV("article",{className:o("drive-address",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s drive address"},void 0,!1,void 0,this),l.jsxDEV(_,{label:"drive address",code:e.davUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"App passwords",description:"A mount signs in with an app password instead of your passkey. It works only for the drive, expires after a year and can be revoked here. It can only read unless you allow saving changes.",children:[g&&g!==v?l.jsxDEV("article",{"data-app-password-reveal":!0,className:o("drive-reveal",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your new app password"},void 0,!1,void 0,this),l.jsxDEV("p",{className:o("",d.text),children:"Copy both now. The password is shown only once."},void 0,!1,void 0,this),l.jsxDEV(_,{label:"username",code:g.username},void 0,!1,void 0,this),l.jsxDEV(_,{label:"password",code:g.password},void 0,!1,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",type:"button",onClick:n.dismissCreatedAppPassword,children:"Done"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t.appPasswords.length===0?l.jsxDEV("p",{className:o("",d.text),children:"No app passwords yet."},void 0,!1,void 0,this):t.appPasswords.map((f)=>l.jsxDEV(U,{kind:f.label,description:`${f.username} · ${f.access==="write"?"Read and write":"Read-only"}`,metadata:at(f,N),action:l.jsxDEV(y,{variant:"danger",disabled:s,type:"button",onClick:()=>n.revokeAppPassword(f.id),children:"Revoke"},void 0,!1,void 0,this)},f.id,!1,void 0,this)),l.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(f)=>{f.preventDefault();let Y=f.currentTarget,P=String(new FormData(Y).get(oe)??"");if(P.trim()==="")return;n.createAppPassword(P.trim(),T?"write":"read"),Y.reset(),S(!1)},children:[l.jsxDEV("label",{htmlFor:oe,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Name it after the computer it is for"},void 0,!1,void 0,this),l.jsxDEV(J,{id:oe,name:oe,type:"text",required:!0,maxLength:100,placeholder:"Laptop",autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("label",{htmlFor:Ue,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Allow saving changes"},void 0,!1,void 0,this),l.jsxDEV(te,{id:Ue,"aria-label":"Allow saving changes",checked:T,onCheckedChange:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",disabled:s,type:"submit",children:"New app password"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"Use it in Obsidian",description:"Keep an Obsidian vault on your computer in step with your brain. Obsidian stays fast and works offline; notes and images sync in the background.",children:l.jsxDEV("article",{className:o("drive-obsidian",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Rizom Brain"},void 0,!1,void 0,this),l.jsxDEV("ol",{className:o("",d.steps),children:[l.jsxDEV("li",{children:"Install the Rizom Brain plugin in Obsidian and turn it on."},void 0,!1,void 0,this),l.jsxDEV("li",{children:["In its settings, enter your brain’s address:"," ",l.jsxDEV("code",{children:new URL(e.davUrl).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("li",{children:"Choose Connect, and confirm on the page that opens here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(C,{title:"Connect your computer",description:"Use your computer’s own file manager. The brain then appears as a drive beside your other folders.",children:[l.jsxDEV("div",{className:o("drive-clients",d.clients),children:I.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this),l.jsxDEV("details",{className:o("drive-command-line",d.developer),children:[l.jsxDEV("summary",{className:o("",d.developerSummary),children:["Command line",l.jsxDEV("span",{className:o("",d.developerHint),children:E.map((f)=>f.name).join(", ")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("drive-command-line-clients",d.clients,d.developerClients),children:E.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var w=b(ne(),1);var ae={revokePasskey:{title:"Revoke this passkey?",message:"You will not be able to use this passkey again.",confirmLabel:"Revoke passkey",pending:"Revoking passkey…",complete:"Passkey revoked."},revokeSession:{title:"End this browser session?",message:"That browser will need a passkey to sign in again.",confirmLabel:"End session",pending:"Ending session…",complete:"Session ended."},revokeAppPassword:{title:"Revoke this app password?",message:"Anything mounted with it stops working at once. Its password cannot be recovered.",confirmLabel:"Revoke app password",pending:"Revoking app password…",complete:"App password revoked."},revokeOtherSessions:{title:"End every other browser session?",message:"Your current browser will remain signed in.",confirmLabel:"End other sessions",pending:"Ending other sessions…",complete:"Other sessions ended."}};function Be(e){return je(e,"Account request failed")}function _e(e){let{client:t,initialAccount:n}=e,[a,s]=w.useState(n),[g,h]=w.useState(n?.displayName??e.initialDisplayName),[O,v]=w.useState(""),[N,T]=w.useState(!1),[S,D]=w.useState(!1),[I,E]=w.useState(null),[f,Y]=w.useState(null);w.useEffect(()=>{if(n)return;let p=!1;return t.fetchAccount().then((k)=>{if(p)return;s(k),h(k.displayName)}).catch((k)=>{if(p)return;T(!0),v(Be(k))}),()=>{p=!0}},[t,n]);let P=w.useCallback(async(p,k,B)=>{D(!0),T(!1),v(p);try{let q=await B();if(q)s(q),h(q.displayName);v(k)}catch(q){T(!0),v(Be(q))}finally{D(!1)}},[]),fe=async(p)=>(await t.mutateAccount(p)).account,Q=(p,k)=>E({title:p.title,message:p.message,confirmLabel:p.confirmLabel,action:()=>{P(p.pending,p.complete,()=>fe(k))}});return{account:a,displayName:g,setDisplayName:h,status:O,error:N,busy:S,confirmation:I,cancelConfirmation:()=>E(null),confirm:()=>{if(!I)return;E(null),I.action()},saveName:()=>{P("Saving…","Display name updated.",()=>fe({action:A.updateDisplayName,confirmation:A.updateDisplayName,displayName:g}))},addPasskey:()=>{P("Waiting for your authenticator…","Passkey added.",()=>t.registerPasskey())},revokePasskey:(p)=>Q(ae.revokePasskey,{action:A.revokePasskey,confirmation:A.revokePasskey,credentialId:p}),revokeSession:(p)=>Q(ae.revokeSession,{action:A.revokeSession,confirmation:A.revokeSession,sessionId:p}),revokeOtherSessions:()=>Q(ae.revokeOtherSessions,{action:A.revokeOtherSessions,confirmation:A.revokeOtherSessions}),revokeAllSessions:()=>E({title:"Sign out everywhere?",message:"This ends every session, including this one. You will need your passkey to return.",confirmLabel:"Sign out everywhere",action:()=>{P("Signing out everywhere…","Signed out.",async()=>{await t.mutateAccount({action:A.revokeAllSessions,confirmation:A.revokeAllSessions}),window.location.assign(`/login?return_to=${encodeURIComponent(e.routePath)}`);return})}}),saveSettings:(p,k)=>{let B=be(p.fields,k);P(`Saving ${p.title}…`,`${p.title} updated.`,()=>t.mutatePluginSettings({action:"save",definitionId:p.id,values:B}))},createdAppPassword:f,createAppPassword:(p,k)=>{P("Creating app password…","App password created.",async()=>{let B=await t.mutateAccount({action:A.createAppPassword,confirmation:A.createAppPassword,label:p,...k==="write"?{access:k}:{}});return Y(B.appPassword??null),B.account})},dismissCreatedAppPassword:()=>Y(null),revokeAppPassword:(p)=>Q(ae.revokeAppPassword,{action:A.revokeAppPassword,confirmation:A.revokeAppPassword,appPasswordId:p}),removeSettings:(p)=>E({title:`Remove ${p.title}?`,message:"The stored settings for this integration will be removed from your account only.",confirmLabel:"Remove settings",action:()=>{P(`Removing ${p.title}…`,`${p.title} removed.`,()=>t.mutatePluginSettings({action:"delete",definitionId:p.id}))}})}}var m=b(x(),1),it=["profile","security","identities","settings",H,F];function st(e){let t=e.connect?F:it.find((n)=>n===e.initialSection);if(!t||t===H&&!e.mcpUrl||t===F&&!e.davUrl)return"profile";return t}function rt(e){let t=["your profile","sign-in security","linked identities",...e.settings?["personal settings"]:[],...e.aiTools?["AI tools"]:[],...e.drive?["your drive"]:[]];return`Your account on this brain. Manage ${`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} here—not shared services or other people’s access.`}function cn({bootstrap:e,initialAccount:t,client:n}){let a=qe(),s=K.useMemo(()=>n??new ce({fetch:a.fetch}),[n,a]),g=_e({client:s,initialAccount:t,initialDisplayName:e.displayName,routePath:e.routePath}),{account:h,status:O,error:v,busy:N,confirmation:T}=g,[S,D]=K.useState(()=>st(e));K.useEffect(()=>{document.querySelector('.account-tabs [role="tab"][aria-selected="true"]')?.scrollIntoView({block:"nearest",inline:"nearest"})},[S]);let I=h?.displayName??e.displayName;return m.jsxDEV(m.Fragment,{children:[m.jsxDEV("div",{className:o("account-shell",c.shell,Ve.inset),children:[m.jsxDEV(Je,{model:{access:ze("public"),title:"Your account",totals:[]}},void 0,!1,void 0,this),m.jsxDEV("p",{className:o("account-scope",c.description),children:rt({settings:(h?.pluginSettings.length??0)>0,aiTools:Boolean(e.mcpUrl),drive:Boolean(e.davUrl)})},void 0,!1,void 0,this),m.jsxDEV("p",{className:o(`account-status${v?" is-error":""}`,c.feedback,v&&c.feedbackError),role:"status","aria-live":"polite",children:O},void 0,!1,void 0,this),!h?m.jsxDEV("p",{className:o("account-loading",c.loading),children:"Reading your account…"},void 0,!1,void 0,this):m.jsxDEV(Ke,{className:"account-details",value:S,onValueChange:D,children:[m.jsxDEV(Ye,{"aria-label":"Account sections",className:o("account-tabs",c.tabs),children:[m.jsxDEV(M,{value:"profile",disabled:N,children:"Profile"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"security",disabled:N,children:"Sign-in & sessions"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"identities",disabled:N,children:"Linked identities"},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(M,{value:"settings",disabled:N,children:"Personal settings"},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(M,{value:H,disabled:N,children:"AI tools"},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(M,{value:F,disabled:N,children:"Drive"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV(L,{value:"profile",forceMount:!0,hidden:S!=="profile",className:o("account-detail-sections",c.tabPanel),children:m.jsxDEV(Ne,{account:h,actions:g,title:I,studioPath:e.studioPath},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"identities",forceMount:!0,hidden:S!=="identities",className:o("",c.tabPanel),children:m.jsxDEV(Te,{account:h},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(L,{value:"settings",forceMount:!0,hidden:S!=="settings",className:o("",c.tabPanel),children:m.jsxDEV(Pe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"security",forceMount:!0,hidden:S!=="security",className:o("",c.tabPanel),children:m.jsxDEV(xe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(L,{value:H,forceMount:!0,hidden:S!==H,className:o("",c.tabPanel),children:m.jsxDEV(De,{mcpUrl:e.mcpUrl},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(L,{value:F,forceMount:!0,hidden:S!==F,className:o("",c.tabPanel),children:m.jsxDEV(Fe,{davUrl:e.davUrl,account:h,actions:g,connect:e.connect},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T&&m.jsxDEV(He,{mark:"!",title:T.title,titleId:"account-confirmation-title",cancelLabel:"Cancel",confirmLabel:T.confirmLabel,confirmVariant:"danger",pending:N,onCancel:g.cancelConfirmation,onConfirm:g.confirm,children:m.jsxDEV("p",{children:T.message},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{cn as AccountApp};
1
+ import{Ac as we,qc as c,rc as o,sc as d,uc as me,vc as $e,wc as Me,xc as Le,yc as ve}from"./main-j4wezmkn.js";import{Dc as Ve,Hc as ze,Ic as Je}from"./main-8zx47tjg.js";import{$c as Ke,Bd as H,Cd as F,Nc as x,Pc as y,Qc as J,Tc as te,Wd as Ce,Zc as He,ad as Ye,bd as M,cd as L,ce as qe,de as ee,pd as ke,ud as X,vd as A,wd as je}from"./main-g15rdsa4.js";import{Ee as i}from"./main-4qxa4jpx.js";import{Qf as ne}from"./main-2vaawyz9.js";import{wg as b}from"./main-s8r820px.js";var K=b(ne(),1);var We=i.object({displayName:i.string(),role:i.enum(["admin","trusted","public"]),profileEntityId:i.string().optional(),passkeys:i.array(i.object({id:i.string(),transports:i.array(i.string()).optional(),credentialDeviceType:i.string().optional(),credentialBackedUp:i.boolean(),createdAt:i.number(),updatedAt:i.number()})),appPasswords:i.array(i.object({id:i.string(),username:i.string(),label:i.string(),access:i.enum(["read","write"]),createdAt:i.number(),expiresAt:i.number(),lastUsedAt:i.number().optional()})),connectedChannels:i.array(i.object({type:i.string(),label:i.string(),verifiedAt:i.number()})),pluginSettings:i.array(i.object({id:i.string(),title:i.string(),description:i.string().optional(),configured:i.boolean(),revision:i.number().nullable(),fields:i.array(i.object({name:i.string(),label:i.string(),control:i.enum(["text","url","number","checkbox"]),secret:i.boolean(),required:i.boolean(),value:i.union([i.string(),i.number(),i.boolean(),i.null()]).optional(),set:i.boolean().optional()}))})),sessions:i.array(i.object({id:i.string(),current:i.boolean(),createdAt:i.number(),expiresAt:i.number()}))});function Ge(e){return We.safeParse(e).success}var ge=i.custom(Ge,{message:"Invalid account response"}),ie=i.object({account:ge}),Ze=i.object({account:ge.optional(),appPassword:i.object({username:i.string(),password:i.string()}).optional(),revoked:i.object({sessions:i.number(),refreshTokens:i.number().optional()}).optional(),signedOut:i.boolean().optional()});function Qe(e){return Ze.safeParse(e).success}var Xe=i.custom(Qe,{message:"Invalid account mutation response"}),et=i.custom((e)=>{if(!X(e))return!1;return typeof e.challenge==="string"&&X(e.rp)&&X(e.user)&&Array.isArray(e.pubKeyCredParams)},{message:"Invalid passkey registration options"});class he extends Error{status;constructor(e,t){super(e);this.name="AccountApiError",this.status=t}}async function V(e,t){let n;try{n=await e.json()}catch{n={}}if(!e.ok){let a=typeof n==="object"&&n!==null&&"error"in n&&typeof n.error==="string"?n.error:"Account request failed";throw new he(a,e.status)}return t.parse(n)}function se(e){let t=e.replaceAll("-","+").replaceAll("_","/").padEnd(Math.ceil(e.length/4)*4,"=");return Uint8Array.from(atob(t),(n)=>n.charCodeAt(0)).buffer}function re(e){let t=new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return btoa(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function tt(e){return{challenge:se(e.challenge),rp:e.rp,user:{...e.user,id:se(e.user.id)},pubKeyCredParams:e.pubKeyCredParams,...e.timeout!==void 0?{timeout:e.timeout}:{},...e.excludeCredentials?{excludeCredentials:e.excludeCredentials.map((t)=>({...t,id:se(t.id)}))}:{},...e.authenticatorSelection?{authenticatorSelection:e.authenticatorSelection}:{},...e.attestation?{attestation:e.attestation}:{},...e.extensions?{extensions:e.extensions}:{}}}var nt=(e,t)=>fetch(e,t);class ce{fetchFn;constructor(e={}){this.fetchFn=e.fetch??nt}async fetchAccount(){return(await V(await this.fetchFn("/auth/account",{credentials:"same-origin",cache:"no-store"}),ie)).account}async mutatePluginSettings(e){return(await V(await this.fetchFn("/auth/account/plugin-settings",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ie)).account}async mutateAccount(e){return V(await this.fetchFn("/auth/account/mutations",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xe)}async registerPasskey(){let e=await V(await this.fetchFn("/auth/account/passkeys/options",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),et),t=await navigator.credentials.create({publicKey:tt(e)});if(!(t instanceof PublicKeyCredential))throw Error("Passkey registration was cancelled");if(!(t.response instanceof AuthenticatorAttestationResponse))throw Error("Authenticator returned an invalid passkey response");let n=t.response,a={id:t.id,rawId:re(t.rawId),type:t.type,...t.authenticatorAttachment?{authenticatorAttachment:t.authenticatorAttachment}:{},clientExtensionResults:t.getClientExtensionResults(),response:{clientDataJSON:re(n.clientDataJSON),attestationObject:re(n.attestationObject),transports:typeof n.getTransports==="function"?n.getTransports():[]}};return(await V(await this.fetchFn("/auth/account/passkeys/verify",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),ie.extend({verified:i.literal(!0)}))).account}}function ye(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function Ae(e,t){let n=t.indexOf("/");if(n<=0||n===t.length-1)return;let a=t.slice(0,n),s=t.slice(n+1);return`${e==="/"?"":e.replace(/\/+$/,"")}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`}function j(e,t=!1){return new Date(t?e:e*1000).toISOString()}var R=b(x(),1);function z(e){return R.jsxDEV(y,{variant:e.tone==="danger"?"danger":e.tone==="primary"?"primary":"outline",type:e.type??"button",onClick:e.onClick,disabled:e.disabled,children:e.children},void 0,!1,void 0,this)}function U(e){return R.jsxDEV("div",{className:o("account-access-item",c.access),children:[R.jsxDEV(ve,{density:"comfortable",title:e.kind,description:e.description,metadata:e.metadata??[]},void 0,!1,void 0,this),e.action]},void 0,!0,void 0,this)}function C(e){return R.jsxDEV("section",{className:o("account-detail-section",c.section),children:[R.jsxDEV("div",{className:"account-section-label",children:[R.jsxDEV("h3",{className:o("",c.heading,ee.section,e.titleHidden===!0&&c.headingHidden),children:e.title},void 0,!1,void 0,this),e.description?R.jsxDEV("p",{className:o("",c.description),children:e.description},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),R.jsxDEV("div",{className:o("people-stack",c.stack),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function be(e,t){let n=Object.fromEntries(t.entries());for(let a of e)if(a.control==="checkbox")n[a.name]=t.has(a.name);else if(a.control==="number"&&typeof n[a.name]==="string"&&n[a.name]!=="")n[a.name]=Number(n[a.name]);return n}function Se(e){if(e.secret)return"password";if(e.control==="url"||e.control==="number")return e.control;return"text"}var r=b(x(),1);function Ne(e){let{account:t,actions:n,title:a,studioPath:s}=e,g=t.role,h=t.profileEntityId?Ae(s,t.profileEntityId):void 0;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV(C,{title:"Profile",titleHidden:!0,children:[r.jsxDEV("div",{className:o("account-identity",c.identity),children:r.jsxDEV("div",{className:o("people-detail-person",c.person),children:[r.jsxDEV("span",{className:o("people-avatar people-avatar--large",c.avatar),children:ye(a)},void 0,!1,void 0,this),r.jsxDEV("span",{className:o("",c.personCopy),children:[r.jsxDEV("span",{className:o("people-detail-name",c.name,ee.secondaryDisplay),children:a},void 0,!1,void 0,this),r.jsxDEV("span",{"data-account-role":g,className:o("account-role",c.role),children:ke(g)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t.profileEntityId?r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("account-profile-note",c.description),children:"Managed by the Anchor profile — your account name follows the published profile."},void 0,!1,void 0,this),r.jsxDEV(U,{kind:"Anchor profile",description:a,action:h?r.jsxDEV(y,{asChild:!0,variant:"link",children:r.jsxDEV("a",{href:h,children:"Edit Anchor Profile →"},void 0,!1,void 0,this)},void 0,!1,void 0,this):void 0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(O)=>{O.preventDefault(),n.saveName()},children:[r.jsxDEV("label",{className:o("",c.formLabel),htmlFor:"display-name",children:"Display name"},void 0,!1,void 0,this),r.jsxDEV(J,{id:"display-name",maxLength:200,autoComplete:"name",required:!0,value:n.displayName,onChange:(O)=>n.setDisplayName(O.target.value)},void 0,!1,void 0,this),r.jsxDEV(z,{type:"submit",disabled:n.busy,children:"Save name"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV("p",{className:o("",c.description),children:"Your role controls access to this brain. An administrator manages access in Administration."},void 0,!1,void 0,this),g==="admin"&&r.jsxDEV(y,{asChild:!0,variant:"outline",children:r.jsxDEV("a",{href:Ce(s,"admin:administration"),children:"Manage people in Administration →"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Te(e){let t=e.account.connectedChannels;return r.jsxDEV(C,{title:"Linked identities",titleHidden:!0,description:"How this brain recognizes messages from you. These are your identities, not services configured for the whole brain.",children:t.length===0?r.jsxDEV("p",{className:o("people-empty",c.empty),children:"No linked identities."},void 0,!1,void 0,this):t.map((n)=>r.jsxDEV(U,{kind:n.type,description:n.label,metadata:[`Verified: ${j(n.verifiedAt,!0)}`]},`${n.type}:${n.label}`,!1,void 0,this))},void 0,!1,void 0,this)}function Pe(e){let{account:t,actions:n}=e;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("",c.description),children:"Settings for your account only. These do not configure shared services for the brain."},void 0,!1,void 0,this),t.pluginSettings.map((a)=>r.jsxDEV(we,{label:a.title,density:"comfortable",presentation:"disclosure",children:[r.jsxDEV("p",{className:o("account-settings-description",c.description),children:a.description??"Private settings for this account."},void 0,!1,void 0,this),r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(s)=>{s.preventDefault(),n.saveSettings(a,new FormData(s.currentTarget))},children:[a.fields.map((s)=>r.jsxDEV("label",{htmlFor:`setting-${a.id}-${s.name}`,className:o("",c.field),children:[r.jsxDEV("span",{className:o("",c.formLabel),children:s.label},void 0,!1,void 0,this),s.control==="checkbox"?r.jsxDEV(te,{id:`setting-${a.id}-${s.name}`,name:s.name,defaultChecked:s.value===!0},void 0,!1,void 0,this):r.jsxDEV(J,{id:`setting-${a.id}-${s.name}`,name:s.name,type:Se(s),required:s.required&&(!a.configured||s.secret)&&!s.set,defaultValue:s.secret?"":typeof s.value==="string"||typeof s.value==="number"?s.value:"",placeholder:s.secret&&s.set?"Stored — leave blank to keep":void 0,autoComplete:"off"},void 0,!1,void 0,this)]},s.name,!0,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:[r.jsxDEV(z,{type:"submit",tone:"primary",disabled:n.busy,children:"Save settings"},void 0,!1,void 0,this),a.configured?r.jsxDEV(y,{variant:"danger",disabled:n.busy,type:"button",onClick:()=>n.removeSettings(a),children:"Remove"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},`${a.id}:${a.revision??"unset"}`,!0,void 0,this)]},a.id,!0,void 0,this))]},void 0,!0,void 0,this)}function xe(e){let{account:t,actions:n}=e,{busy:a}=n;return r.jsxDEV("div",{className:o("",c.column),children:[r.jsxDEV(C,{title:"Sign-in",description:"Passkeys used to access this account. Your final passkey is protected from revocation.",children:[t.passkeys.map((s)=>r.jsxDEV(U,{kind:s.credentialBackedUp?"Synced passkey":"Device passkey",metadata:[`Added: ${j(s.createdAt,!0)}`],action:t.passkeys.length>1?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokePasskey(s.id),children:"Revoke"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:r.jsxDEV(y,{variant:"outline",disabled:a,type:"button",onClick:n.addPasskey,children:"Add passkey"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV(C,{title:"Signed-in sessions",children:t.sessions.map((s)=>r.jsxDEV(U,{kind:s.current?"This session":"Browser session",metadata:[`Started: ${j(s.createdAt)}`,...s.current?["Current browser"]:[]],action:!s.current?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokeSession(s.id),children:"End"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this))},void 0,!1,void 0,this),r.jsxDEV("footer",{className:o("account-session-actions",c.footer),children:[r.jsxDEV("small",{children:"Access changes require an Admin."},void 0,!1,void 0,this),r.jsxDEV("div",{className:o("",c.actions),children:[r.jsxDEV(z,{disabled:a||t.sessions.every((s)=>s.current),onClick:n.revokeOtherSessions,children:"End other sessions"},void 0,!1,void 0,this),r.jsxDEV(z,{tone:"danger",disabled:a,onClick:n.revokeAllSessions,children:"Sign out everywhere"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ee=b(ne(),1);function de(e){return new URL(e).host.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function le(e){return JSON.stringify(e,null,2)}function Oe(e,t,n){return["Already have servers there? Add only the ",{code:`"${n}"`}," entry inside ",{code:`"${t}"`},` of ${e}.`]}function Re(e){let t=de(e),n="Sign in with your passkey when asked.";return[{id:"claude",group:"primary",name:"Claude",note:["Desktop app and claude.ai."],steps:[["Open Settings → Connectors → Add custom connector."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when asked."]]},{id:"chatgpt",group:"primary",name:"ChatGPT",steps:[["Open Settings → Apps & Connectors → Advanced and turn on Developer mode."],["Choose Create, name it ",{code:t},", paste your brain’s address and pick OAuth."],["Sign in with your passkey when asked."]]},{id:"claude-code",group:"developer",name:"Claude Code",lead:[["Add the server in your terminal:"]],snippet:{label:"Claude Code command",code:`claude mcp add --transport http ${t} ${e}`},after:[["Then start Claude Code, run ",{code:"/mcp"},", choose ",{code:t}," and sign in with your passkey."]]},{id:"cursor",group:"developer",name:"Cursor",steps:[["Open Cursor Settings → MCP → Add new global MCP server."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when Cursor asks."]],lead:[["Or add it to ",{code:"~/.cursor/mcp.json"},":"]],snippet:{label:"Cursor configuration",code:le({mcpServers:{[t]:{url:e}}})},after:[Oe("the file","mcpServers",t)]},{id:"vscode",group:"developer",name:"VS Code",steps:[["Open the Command Palette and run ",{code:"MCP: Add Server"},"."],["Choose HTTP, paste your brain’s address and name it ",{code:t},"."],["Choose Global, then sign in with your passkey when asked."]],lead:[["Or run ",{code:"MCP: Open User Configuration"}," and add:"]],snippet:{label:"VS Code configuration",code:le({servers:{[t]:{type:"http",url:e}}})},after:[Oe("your user configuration","servers",t)]},{id:"other",group:"developer",name:"Any other MCP client",inlineName:"any other MCP client",note:["Look for “add MCP server”, “connector” or “integration” in the tool’s settings and fill in:"],fields:[{label:"Name",value:[{code:t}]},{label:"Type",value:["Remote server, Streamable HTTP — not stdio, not SSE"]},{label:"URL",value:[{code:e}]},{label:"Authentication",value:["OAuth. Leave API key, token, client ID and secret empty; the tool registers itself."]}],lead:[["When you connect, your browser opens “Authorize <tool>?” on your brain. Approve MCP access with your passkey. The tool then has two tools: ",{code:"chat"},", to ask your brain anything as you would in chat, and ",{code:"confirm"},", to approve changes when the brain asks."],["Tool only takes local (stdio) servers, or insists on an API key? Bridge it with ",{code:"mcp-remote"},", which handles the sign-in:"]],snippet:{label:"mcp-remote bridge configuration",code:le({mcpServers:{[t]:{command:"npx",args:["-y","mcp-remote",e]}}})}}]}var u=b(x(),1);function W(e){return u.jsxDEV(u.Fragment,{children:e.text.map((t,n)=>typeof t==="string"?t:u.jsxDEV("code",{className:o("",d.code),children:t.code},n,!1,void 0,this))},void 0,!1,void 0,this)}function _(e){let[t,n]=Ee.useState("idle"),a=async()=>{try{await navigator.clipboard.writeText(e.code),n("copied")}catch{n("unavailable")}};return u.jsxDEV("div",{className:o("ai-tools-snippet",d.snippet),children:[u.jsxDEV("pre",{className:o("",d.snippetCode),"aria-label":e.label,children:e.code},void 0,!1,void 0,this),u.jsxDEV(y,{variant:"outline",size:"sm",onClick:()=>void a(),"aria-label":`Copy ${e.label}`,children:t==="copied"?"Copied":t==="unavailable"?"Select to copy":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function G(e){let{client:t}=e;return u.jsxDEV("article",{className:o("ai-tools-client",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:t.name},void 0,!1,void 0,this),t.note?u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:t.note},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,t.steps?u.jsxDEV("ol",{className:o("",d.steps),children:t.steps.map((n,a)=>u.jsxDEV("li",{children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):null,t.fields?u.jsxDEV("dl",{className:o("",d.fields),children:t.fields.map((n)=>u.jsxDEV("div",{className:o("",d.field),children:[u.jsxDEV("dt",{className:o("",d.fieldLabel),children:n.label},void 0,!1,void 0,this),u.jsxDEV("dd",{className:o("",d.fieldValue),children:u.jsxDEV(W,{text:n.value},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},n.label,!0,void 0,this))},void 0,!1,void 0,this):null,t.lead?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`lead-${a}`,!1,void 0,this)),t.snippet?u.jsxDEV(_,{...t.snippet},void 0,!1,void 0,this):null,t.after?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`after-${a}`,!1,void 0,this))]},void 0,!0,void 0,this)}function ot(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function De(e){let t=Re(e.mcpUrl),n=t.filter((s)=>s.group==="primary"),a=t.filter((s)=>s.group==="developer");return u.jsxDEV(C,{title:"AI tools",description:"Connect AI tools you already use to this brain. A connected tool talks to the brain as you do in chat — asking, saving and updating within your access — after you sign in with your passkey.",children:[u.jsxDEV("article",{className:o("ai-tools-address",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s address"},void 0,!1,void 0,this),u.jsxDEV(_,{label:"brain address",code:e.mcpUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients),children:n.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this),u.jsxDEV("details",{className:o("ai-tools-developer",d.developer),children:[u.jsxDEV("summary",{className:o("",d.developerSummary),children:["Developer tools and other clients",u.jsxDEV("span",{className:o("",d.developerHint),children:ot(a.map((s)=>s.inlineName??s.name))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients,d.developerClients),children:a.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Z=b(ne(),1);var ue="Enter the username and password of an app password from this page.";function Ie(e){let t=new URL(e),n=`${t.protocol==="https:"?"davs":"dav"}://${t.host}${t.pathname}`,a=de(e);return[{id:"macos",group:"file-manager",name:"macOS",note:["Finder, on any Mac."],steps:[["In Finder, choose Go → Connect to Server (⌘K)."],["Paste the address below and click Connect."],["Choose Registered User. ",ue]],snippet:{label:"macOS address",code:e}},{id:"windows",group:"file-manager",name:"Windows",note:["File Explorer, on Windows 10 and 11."],steps:[["In File Explorer, open This PC and choose Map network drive."],["Paste the address below as the folder, tick Connect using different credentials, and click Finish."],[ue]],snippet:{label:"Windows address",code:e}},{id:"gnome-files",group:"file-manager",name:"GNOME Files",note:["The file manager on Ubuntu, Fedora and other GNOME desktops."],steps:[["Open Files → Other Locations (or Network)."],["Under Connect to Server, enter the address below and connect."],[ue]],snippet:{label:"GNOME Files address",code:n}},{id:"rclone",group:"command-line",name:"rclone",note:["Linux, macOS and Windows, from a terminal."],lead:[["Store the drive as a remote, with your app password’s username and password:"]],snippet:{label:"rclone remote command",code:`rclone config create ${a} webdav url=${e} vendor=other user=YOUR_USERNAME pass=YOUR_PASSWORD --obscure`},after:[["Then mount it on an empty folder: ",{code:`rclone mount ${a}: ~/Brain --vfs-cache-mode writes`},"."]]}]}var l=b(x(),1),oe="app-password-label",Ue="app-password-write";function pe(e){return j(e).slice(0,10)}function at(e,t){return[`Created: ${pe(e.createdAt)}`,`${e.expiresAt<=t?"Expired":"Expires"}: ${pe(e.expiresAt)}`,e.lastUsedAt===void 0?"Never used":`Last used: ${pe(e.lastUsedAt)}`]}function Fe(e){let{account:t,actions:n,connect:a}=e,{busy:s,createdAppPassword:g}=n,[h,O]=Z.useState(void 0),v=a!==void 0&&h!==void 0?$e(g,h,t.appPasswords,me(a)):null;Z.useEffect(()=>{if(a&&v)Me(a,v)},[a,v]);let N=Math.floor(Date.now()/1000),[T,S]=Z.useState(!1),D=Ie(e.davUrl),I=D.filter((f)=>f.group==="file-manager"),E=D.filter((f)=>f.group==="command-line");return l.jsxDEV("div",{className:o("",c.column),children:[l.jsxDEV(C,{title:"Drive",description:"Mount this brain as a network drive. It shows the notes, posts and files you can see here, as folders and files, to open and edit on your computer.",children:[a?l.jsxDEV(Le,{connect:a,created:v,busy:s||h!==void 0&&v===null,onConnect:()=>{O(g?.username??null),n.createAppPassword(me(a),"write")}},void 0,!1,void 0,this):null,l.jsxDEV("article",{className:o("drive-address",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s drive address"},void 0,!1,void 0,this),l.jsxDEV(_,{label:"drive address",code:e.davUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"App passwords",description:"A mount signs in with an app password instead of your passkey. It works only for the drive, expires after a year and can be revoked here. It can only read unless you allow saving changes.",children:[g&&g!==v?l.jsxDEV("article",{"data-app-password-reveal":!0,className:o("drive-reveal",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your new app password"},void 0,!1,void 0,this),l.jsxDEV("p",{className:o("",d.text),children:"Copy both now. The password is shown only once."},void 0,!1,void 0,this),l.jsxDEV(_,{label:"username",code:g.username},void 0,!1,void 0,this),l.jsxDEV(_,{label:"password",code:g.password},void 0,!1,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",type:"button",onClick:n.dismissCreatedAppPassword,children:"Done"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t.appPasswords.length===0?l.jsxDEV("p",{className:o("",d.text),children:"No app passwords yet."},void 0,!1,void 0,this):t.appPasswords.map((f)=>l.jsxDEV(U,{kind:f.label,description:`${f.username} · ${f.access==="write"?"Read and write":"Read-only"}`,metadata:at(f,N),action:l.jsxDEV(y,{variant:"danger",disabled:s,type:"button",onClick:()=>n.revokeAppPassword(f.id),children:"Revoke"},void 0,!1,void 0,this)},f.id,!1,void 0,this)),l.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(f)=>{f.preventDefault();let Y=f.currentTarget,P=String(new FormData(Y).get(oe)??"");if(P.trim()==="")return;n.createAppPassword(P.trim(),T?"write":"read"),Y.reset(),S(!1)},children:[l.jsxDEV("label",{htmlFor:oe,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Name it after the computer it is for"},void 0,!1,void 0,this),l.jsxDEV(J,{id:oe,name:oe,type:"text",required:!0,maxLength:100,placeholder:"Laptop",autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("label",{htmlFor:Ue,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Allow saving changes"},void 0,!1,void 0,this),l.jsxDEV(te,{id:Ue,"aria-label":"Allow saving changes",checked:T,onCheckedChange:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",disabled:s,type:"submit",children:"New app password"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"Use it in Obsidian",description:"Keep an Obsidian vault on your computer in step with your brain. Obsidian stays fast and works offline; notes and images sync in the background.",children:l.jsxDEV("article",{className:o("drive-obsidian",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Rizom Brain"},void 0,!1,void 0,this),l.jsxDEV("ol",{className:o("",d.steps),children:[l.jsxDEV("li",{children:"Install the Rizom Brain plugin in Obsidian and turn it on."},void 0,!1,void 0,this),l.jsxDEV("li",{children:["In its settings, enter your brain’s address:"," ",l.jsxDEV("code",{children:new URL(e.davUrl).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("li",{children:"Choose Connect, and confirm on the page that opens here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(C,{title:"Connect your computer",description:"Use your computer’s own file manager. The brain then appears as a drive beside your other folders.",children:[l.jsxDEV("div",{className:o("drive-clients",d.clients),children:I.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this),l.jsxDEV("details",{className:o("drive-command-line",d.developer),children:[l.jsxDEV("summary",{className:o("",d.developerSummary),children:["Command line",l.jsxDEV("span",{className:o("",d.developerHint),children:E.map((f)=>f.name).join(", ")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("drive-command-line-clients",d.clients,d.developerClients),children:E.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var w=b(ne(),1);var ae={revokePasskey:{title:"Revoke this passkey?",message:"You will not be able to use this passkey again.",confirmLabel:"Revoke passkey",pending:"Revoking passkey…",complete:"Passkey revoked."},revokeSession:{title:"End this browser session?",message:"That browser will need a passkey to sign in again.",confirmLabel:"End session",pending:"Ending session…",complete:"Session ended."},revokeAppPassword:{title:"Revoke this app password?",message:"Anything mounted with it stops working at once. Its password cannot be recovered.",confirmLabel:"Revoke app password",pending:"Revoking app password…",complete:"App password revoked."},revokeOtherSessions:{title:"End every other browser session?",message:"Your current browser will remain signed in.",confirmLabel:"End other sessions",pending:"Ending other sessions…",complete:"Other sessions ended."}};function Be(e){return je(e,"Account request failed")}function _e(e){let{client:t,initialAccount:n}=e,[a,s]=w.useState(n),[g,h]=w.useState(n?.displayName??e.initialDisplayName),[O,v]=w.useState(""),[N,T]=w.useState(!1),[S,D]=w.useState(!1),[I,E]=w.useState(null),[f,Y]=w.useState(null);w.useEffect(()=>{if(n)return;let p=!1;return t.fetchAccount().then((k)=>{if(p)return;s(k),h(k.displayName)}).catch((k)=>{if(p)return;T(!0),v(Be(k))}),()=>{p=!0}},[t,n]);let P=w.useCallback(async(p,k,B)=>{D(!0),T(!1),v(p);try{let q=await B();if(q)s(q),h(q.displayName);v(k)}catch(q){T(!0),v(Be(q))}finally{D(!1)}},[]),fe=async(p)=>(await t.mutateAccount(p)).account,Q=(p,k)=>E({title:p.title,message:p.message,confirmLabel:p.confirmLabel,action:()=>{P(p.pending,p.complete,()=>fe(k))}});return{account:a,displayName:g,setDisplayName:h,status:O,error:N,busy:S,confirmation:I,cancelConfirmation:()=>E(null),confirm:()=>{if(!I)return;E(null),I.action()},saveName:()=>{P("Saving…","Display name updated.",()=>fe({action:A.updateDisplayName,confirmation:A.updateDisplayName,displayName:g}))},addPasskey:()=>{P("Waiting for your authenticator…","Passkey added.",()=>t.registerPasskey())},revokePasskey:(p)=>Q(ae.revokePasskey,{action:A.revokePasskey,confirmation:A.revokePasskey,credentialId:p}),revokeSession:(p)=>Q(ae.revokeSession,{action:A.revokeSession,confirmation:A.revokeSession,sessionId:p}),revokeOtherSessions:()=>Q(ae.revokeOtherSessions,{action:A.revokeOtherSessions,confirmation:A.revokeOtherSessions}),revokeAllSessions:()=>E({title:"Sign out everywhere?",message:"This ends every session, including this one. You will need your passkey to return.",confirmLabel:"Sign out everywhere",action:()=>{P("Signing out everywhere…","Signed out.",async()=>{await t.mutateAccount({action:A.revokeAllSessions,confirmation:A.revokeAllSessions}),window.location.assign(`/login?return_to=${encodeURIComponent(e.routePath)}`);return})}}),saveSettings:(p,k)=>{let B=be(p.fields,k);P(`Saving ${p.title}…`,`${p.title} updated.`,()=>t.mutatePluginSettings({action:"save",definitionId:p.id,values:B}))},createdAppPassword:f,createAppPassword:(p,k)=>{P("Creating app password…","App password created.",async()=>{let B=await t.mutateAccount({action:A.createAppPassword,confirmation:A.createAppPassword,label:p,...k==="write"?{access:k}:{}});return Y(B.appPassword??null),B.account})},dismissCreatedAppPassword:()=>Y(null),revokeAppPassword:(p)=>Q(ae.revokeAppPassword,{action:A.revokeAppPassword,confirmation:A.revokeAppPassword,appPasswordId:p}),removeSettings:(p)=>E({title:`Remove ${p.title}?`,message:"The stored settings for this integration will be removed from your account only.",confirmLabel:"Remove settings",action:()=>{P(`Removing ${p.title}…`,`${p.title} removed.`,()=>t.mutatePluginSettings({action:"delete",definitionId:p.id}))}})}}var m=b(x(),1),it=["profile","security","identities","settings",H,F];function st(e){let t=e.connect?F:it.find((n)=>n===e.initialSection);if(!t||t===H&&!e.mcpUrl||t===F&&!e.davUrl)return"profile";return t}function rt(e){let t=["your profile","sign-in security","linked identities",...e.settings?["personal settings"]:[],...e.aiTools?["AI tools"]:[],...e.drive?["your drive"]:[]];return`Your account on this brain. Manage ${`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} here—not shared services or other people’s access.`}function cn({bootstrap:e,initialAccount:t,client:n}){let a=qe(),s=K.useMemo(()=>n??new ce({fetch:a.fetch}),[n,a]),g=_e({client:s,initialAccount:t,initialDisplayName:e.displayName,routePath:e.routePath}),{account:h,status:O,error:v,busy:N,confirmation:T}=g,[S,D]=K.useState(()=>st(e));K.useEffect(()=>{document.querySelector('.account-tabs [role="tab"][aria-selected="true"]')?.scrollIntoView({block:"nearest",inline:"nearest"})},[S]);let I=h?.displayName??e.displayName;return m.jsxDEV(m.Fragment,{children:[m.jsxDEV("div",{className:o("account-shell",c.shell,Ve.inset),children:[m.jsxDEV(Je,{model:{access:ze("public"),title:"Your account",totals:[]}},void 0,!1,void 0,this),m.jsxDEV("p",{className:o("account-scope",c.description),children:rt({settings:(h?.pluginSettings.length??0)>0,aiTools:Boolean(e.mcpUrl),drive:Boolean(e.davUrl)})},void 0,!1,void 0,this),m.jsxDEV("p",{className:o(`account-status${v?" is-error":""}`,c.feedback,v&&c.feedbackError),role:"status","aria-live":"polite",children:O},void 0,!1,void 0,this),!h?m.jsxDEV("p",{className:o("account-loading",c.loading),children:"Reading your account…"},void 0,!1,void 0,this):m.jsxDEV(Ke,{className:"account-details",value:S,onValueChange:D,children:[m.jsxDEV(Ye,{"aria-label":"Account sections",className:o("account-tabs",c.tabs),children:[m.jsxDEV(M,{value:"profile",disabled:N,children:"Profile"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"security",disabled:N,children:"Sign-in & sessions"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"identities",disabled:N,children:"Linked identities"},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(M,{value:"settings",disabled:N,children:"Personal settings"},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(M,{value:H,disabled:N,children:"AI tools"},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(M,{value:F,disabled:N,children:"Drive"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV(L,{value:"profile",forceMount:!0,hidden:S!=="profile",className:o("account-detail-sections",c.tabPanel),children:m.jsxDEV(Ne,{account:h,actions:g,title:I,studioPath:e.studioPath},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"identities",forceMount:!0,hidden:S!=="identities",className:o("",c.tabPanel),children:m.jsxDEV(Te,{account:h},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(L,{value:"settings",forceMount:!0,hidden:S!=="settings",className:o("",c.tabPanel),children:m.jsxDEV(Pe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"security",forceMount:!0,hidden:S!=="security",className:o("",c.tabPanel),children:m.jsxDEV(xe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(L,{value:H,forceMount:!0,hidden:S!==H,className:o("",c.tabPanel),children:m.jsxDEV(De,{mcpUrl:e.mcpUrl},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(L,{value:F,forceMount:!0,hidden:S!==F,className:o("",c.tabPanel),children:m.jsxDEV(Fe,{davUrl:e.davUrl,account:h,actions:g,connect:e.connect},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T&&m.jsxDEV(He,{mark:"!",title:T.title,titleId:"account-confirmation-title",cancelLabel:"Cancel",confirmLabel:T.confirmLabel,confirmVariant:"danger",pending:N,onCancel:g.cancelConfirmation,onConfirm:g.confirm,children:m.jsxDEV("p",{children:T.message},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{cn as AccountApp};
2
2
 
3
3
  //# debugId=BFBE14544609986064756E2164756E21
@@ -1,4 +1,4 @@
1
- import{Kc as s,Nc as h,md as u,sd as v,td as x}from"./main-2dnw093e.js";import{Qf as y}from"./main-2vaawyz9.js";import{wg as i}from"./main-s8r820px.js";var e={saveStatus:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kAzted:"xu0aao5",kg3NbH:"xfn1xvj",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",khDVqt:"xuxw1ft",$$css:!0},inset:{kLKAdn:"xijc0j3",kg3NbH:"x1tcxzho",k3VDzK:"xvl5zoi",kr1LIo:"xn3xmfv",$$css:!0},documentInset:{keoZOQ:"xseo6mj",kUOVxO:"x1i847zn",kcJqd2:"xg0897w",kLZkdG:"xhl984y",$$css:!0},root:{k1xSpc:"xrvj5dj",kOIVth:"x167g77z",kogj98:"x1ghz6dp",kGO01o:"x1hhzuzn",kt9PQ7:"xlxy82",kfdmCh:"x1q0q8m5",kL6WhQ:"x1594w68",kh9fTk:"xzuy7g3",$$css:!0},navigation:{kBCFzs:"x1osaytk",$$css:!0},hasAction:{kumcoG:"xju1xpo",$$css:!0},control:{kSGwAc:"xamitd3",kFhvOy:"x1qab1bc",k7Eaqz:"xeuugli",kCrP1I:"x1yagzmq",kV7FkP:"x1re7oy7",$$css:!0},row:{k1xSpc:"xrvj5dj",kumcoG:"x1mkdm3x",kGNEyG:"x1pha0wt",kOIVth:"x1v2ro7d",k7Eaqz:"xeuugli",kAzted:"x1gg8mnh",$$css:!0},copy:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x1pha0wt",kOIVth:"x1v2ro7d",k7Eaqz:"xeuugli",$$css:!0},titleGrow:{k1xSpc:"xrvj5dj",k5JduY:"x68pbbn",kVb13B:"x1snja1x",kMEsQN:"xx0cqyw",kduyaJ:"xajgrl3",kcTWDK:"xvikt2r",$$css:!0},titleInput:{k1xSpc:"x1lliihq",kJuA4N:"x1b1wf8y",kzqmXN:"xh8yej3",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kHenm0:"xtt52l0",kHjlTd:"xj0a0fe",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kMzoRj:"xc342km",kaIpWk:"x12oqio5",kWkggS:"xjbqb8w",kMwMTN:"x1heor9g",kVVagm:"xln7xf2",ka26j:"xkyhvkk",kb6lSQ:"x4gjf66",kLWn49:"x15bjb6t",k8Qsv1:"x1wku8z5",kMeerF:"x784prv xcpyg62",k3XXqK:"x9v5kkp x19ahsqg",kjBf7l:"xxh1od1 x1iau5pp",kInvED:"x1hl8ikr",$$css:!0},titleIssue:{k1xSpc:"x1lliihq",keoZOQ:"x1k70j0n",kMwMTN:"x1mel2pz",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xo1l8bm",kb6lSQ:"x12oo3zp",$$css:!0},title:{k7Eaqz:"xeuugli",ks0D6T:"x193iq5w",kogj98:"x1ghz6dp",kMwMTN:"xqvuw85",kMv6JI:"xssy22x",kGuDYH:"xqozcyj",ka26j:"x17owtcr",k63SB2:"x1s688f",kb6lSQ:"x1w69ole",kLWn49:"x1159mfc",kHjlTd:"xj0a0fe",kr4CYY:"x13i2va0",kFKdQ1:"xc3hpf1",kHdLCk:"x5dg28r",kOqvnJ:"xmi8g4k",kN0ZIM:"x5ih01h",keaIxW:"xhmgfki",$$css:!0},metadata:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",kMwMTN:"x1ar3pfp",kGuDYH:"x1qt5hsa",kr4CYY:"xxgfmko",$$css:!0},phoneHidden:{k7Eaqz:"xeuugli",kHdLCk:"xkaaz9w",$$css:!0},phoneBarred:{kt9PQ7:"xlxy82 xg3gpzv",kGO01o:"x1hhzuzn xlw6zc2",$$css:!0},statusDetail:{kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",kLWn49:"x1evy7pa",$$css:!0},facts:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kOIVth:"xhypsl1",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kB88ic:"xe8uvvx",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"xif65rj",kr4CYY:"x1yzm3l3",$$css:!0},fact:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",$$css:!0},factMark:{kzqmXN:"x1xc55vz",kZKoxP:"xdk7pt",kmuXW:"x2lah0s",kaIpWk:"x16rqkct",kWkggS:"xtwfq29",$$css:!0},totals:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kOIVth:"x1v2ro7d",kogj98:"x1ghz6dp",$$css:!0},total:{k1xSpc:"x3nfvp2",kGNEyG:"x1pha0wt",kOIVth:"x1nejdyq",$$css:!0},totalLabel:{kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",$$css:!0},totalValue:{kogj98:"x1ghz6dp",kMwMTN:"xqvuw85",kMv6JI:"xa9opjo",kGuDYH:"xfifm61",k63SB2:"x1s688f",$$css:!0},action:{kVAEAm:"x1n2onr6",kY2c9j:"xoegz02",koQZXg:"x8x9d4c",ks0D6T:"x193iq5w",kmuXW:"x2lah0s",kKwN1N:"x1pyp8la",kKq9zD:"xfl54mv",kRugJJ:"x13bo2ae",kpC6i:"xb8kata",kfD2x5:"xoco0x4",ku5HWf:"xlpsox",kfX6GZ:"x170sw7g",kp4SAw:"x1ynha1y",$$css:!0}};var m={body:{kUk6DE:"x98rzlu",kAzted:"x2lwn1j",k1xSpc:"xrvj5dj",kGNEyG:"x1qjc9v5",k9llMU:"x5o4joa",kRnz6y:"x13me3c",k9pwkU:"xch1w8t x8mpkbv",kSQbcb:"x1mgqk5d",keaIxW:"x7zq708 x1sqw5yv",$$css:!0},editor:{k1xSpc:"xrvj5dj",kumcoG:"x1q0n783 x1l1zzp x1efj4vi x4jmfmw",k9llMU:"xxq7klm",kAzted:"x2lwn1j",k7Eaqz:"xeuugli",k9pwkU:"x1y6iwit",keaIxW:"xhmgfki",$$css:!0},head:{kBCFzs:"x1osaytk",kbNqZ1:"x1ms6mhf",$$css:!0},colophon:{kBCFzs:"x1npkx4u x1gw0dv9",kbNqZ1:"x7sv70a",kAzted:"x2lwn1j",k7Eaqz:"xeuugli",kORKVm:"x1odjw0f",kZ1KPB:"xe0pwq",k4WBpm:"x19ypqd9",kaZRDh:"xlsyykk",k1xSpc:"x1tugbw3 x1idufoc",kWkggS:"xbslqsl",kmVPX3:"xga4tv",kubnTK:"x1llo3lq",kOLLwu:"x4pt66b",kU6wY8:"xnoo4qv",kRugJJ:"x1pvtvnk",kq8Ghq:"x171z6dy",$$css:!0},detailsSheet:{kVAEAm:"x12u6v07",kbCHJM:"x172uiah",kCIrl2:"x106zgql",krVfgx:"x1imafyg",kY2c9j:"x1u2u1qb",kskxy:"x13cfglm",kORKVm:"x1odjw0f xscgqpg",kZeWKH:"xg0x1tt",kIxVMA:"x126vn7o",ksF3WI:"x1abwb35",kLKAdn:"x9desvi x1vy0343",kGO01o:"xefzj8c xw27878",kGVxlE:"x12br0k5",$$css:!0},fullWidthProperties:{kBCFzs:"x1osaytk",kZ1KPB:"xyj58a3",$$css:!0},fields:{kMzoRj:"xc342km",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",k7Eaqz:"xeuugli",$$css:!0},manuscript:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kBCFzs:"xgkxs2y",kbNqZ1:"x7sv70a",kAzted:"x2lwn1j",k7Eaqz:"xeuugli",k9g6sI:"x12h1iku",kWkggS:"x18s3upu",kRnz6y:"x13me3c",kCrP1I:"x1gw0dv9",kU6wY8:"xnoo4qv",kKq9zD:"xscgqpg",kHdLCk:"x1ux6vrq",$$css:!0},colophonHidden:{k1xSpc:"x1s85apg",$$css:!0},inspectorToggle:{k1xSpc:"xkaaz9w",$$css:!0},pipeline:{kBCFzs:"x1osaytk",kbNqZ1:"xz51j44",kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1v2ro7d",kwnvtZ:"x1a02dak",kmVPX3:"xxmtint",kAzted:"xvkrg5o",kEmTf6:"x1anjdel",kBoZxP:"xj3o16p",kCrP1I:"x1gw0dv9",kU6wY8:"x1dhnagk",kHdLCk:"x10acg2q",k1JLwA:"x1lk34zc",kLyoy9:"x1d3ddqg",kTWfjk:"xiyjfb3",kRugJJ:"x11btecl",kLZC3w:"xvg7k2t",kWkggS:"x18s3upu x1r2i3kv",$$css:!0},detailsToggle:{k1xSpc:"x1s85apg x13v5x0x",kAzted:"x1gg8mnh",$$css:!0},saveState:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x1pha0wt",k1C7PZ:"x1amjocr",khm7nJ:"x1dbijih",$$css:!0},compactStatus:{k1xSpc:"x1s85apg xdsa2pc xfsj286 xbuh8fq",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kMwMTN:"xulty9s x15g7g0v",kMv6JI:"xa9opjo",kGuDYH:"xdzlmae",kb6lSQ:"x2ujxvm",kLWn49:"x1xfvgam",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},compactValue:{k1xSpc:"x1lliihq",kVQacm:"xb3r6kr",kMwMTN:"x19k5i5u",kGuDYH:"xvwhms9",kg5iWk:"xlyipyv",$$css:!0}};var f=i(y(),1);var r=i(y(),1),l=null,c=new Set;function p(){for(let t of c)t()}function w(t){return c.add(t),()=>{c.delete(t)}}function I(){return r.useSyncExternalStore(w,()=>l?.content??null,()=>null)}function g(t,o){r.useLayoutEffect(()=>{if(!o)return;return l={owner:t,content:o},p(),()=>{if(l?.owner!==t)return;l=null,p()}})}var a=i(h(),1);function j(t){switch(t){case"public":return{kind:"session",label:"Signed in"};case"trusted":return{kind:"permission",label:"Trusted"};case"admin":return{kind:"permission",label:"Admin only"}}}function R(t){let o=t.model.metadata?.slice(0,4)??[],d=t.model.totals.slice(0,4),[S]=f.useState(()=>Symbol("page head")),b=t.appearance!=="document";g(S,b?{title:t.model.title,...t.back?{back:t.back}:{},...t.action?{action:t.action}:{}}:null);let z=o.length===0&&!t.model.status&&d.length===0&&!t.model.facts?.length&&!t.control;if(t.appearance==="document")return a.jsxDEV("header",{className:x("studio-page-head",e.root,e.row,Boolean(t.action)&&e.hasAction,e.documentInset,m.head,!t.titleEditor&&e.phoneHidden),"data-studio-page-head":"true","data-has-status":"false","data-has-totals":"false",children:[t.navigation?a.jsxDEV("nav",{"aria-label":"Collection navigation",...s(e.navigation,e.phoneHidden),children:t.navigation},void 0,!1,void 0,this):null,a.jsxDEV("div",{...s(e.copy),children:a.jsxDEV("h1",{className:x("",e.title),children:t.titleEditor??t.model.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),t.action?a.jsxDEV("div",{className:x("studio-page-head-action",e.action,e.phoneHidden),children:t.action},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return a.jsxDEV("header",{className:x("studio-page-head",e.root,e.phoneBarred,z&&e.phoneHidden),"aria-description":t.model.description,"data-studio-page-head":"true","data-studio-head-barred":"","data-has-status":t.model.status?"true":"false","data-has-totals":d.length>0?"true":"false",children:[t.navigation?a.jsxDEV("nav",{"aria-label":"Collection navigation",...s(e.navigation),children:t.navigation},void 0,!1,void 0,this):null,a.jsxDEV("div",{className:x("studio-page-head-title-row",e.row,Boolean(t.action??t.control)&&e.hasAction),children:[a.jsxDEV("div",{...s(e.copy),children:[a.jsxDEV("h1",{...s(e.title,e.phoneHidden),children:t.titleEditor??t.model.title},void 0,!1,void 0,this),o.length>0&&a.jsxDEV("div",{className:x("studio-page-head-metadata",e.metadata),children:o.map((n,k)=>a.jsxDEV("span",{...s(k>0&&e.phoneHidden),children:[k>0&&a.jsxDEV("span",{"aria-hidden":"true",children:"· "},void 0,!1,void 0,this),n]},`${n}:${k}`,!0,void 0,this))},void 0,!1,void 0,this),t.model.status&&a.jsxDEV("span",{className:x("studio-head-status",v.status,u(t.model.status.tone),d.length>0&&e.phoneHidden),"data-tone":t.model.status.tone??"neutral",children:[t.model.status.label,t.model.status.detail&&a.jsxDEV("small",{...s(e.statusDetail),children:t.model.status.detail},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d.length>0&&a.jsxDEV("dl",{className:x("studio-page-head-totals",e.totals),children:d.map((n,k)=>a.jsxDEV("div",{"data-tone":n.tone??"neutral",...s(e.total,k>0&&n.tone!=="warn"&&n.tone!=="error"&&e.phoneHidden),children:[a.jsxDEV("dt",{...s(e.totalLabel),children:n.label},void 0,!1,void 0,this),a.jsxDEV("dd",{...s(e.totalValue,u(n.tone)),children:n.value},void 0,!1,void 0,this)]},`${n.label}:${k}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.control&&a.jsxDEV("div",{...s(e.control),"data-studio-head-control":"",children:t.control},void 0,!1,void 0,this),t.action&&a.jsxDEV("div",{className:x("studio-page-head-action",e.action,e.phoneHidden),"data-studio-primary-action":"true","data-operator-action-popover":"",children:t.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.model.facts&&t.model.facts.length>0&&a.jsxDEV("ul",{"aria-label":"Status",...s(e.facts),children:t.model.facts.map((n,k)=>a.jsxDEV("li",{"data-tone":n.tone??"neutral",...s(e.fact),children:[a.jsxDEV("span",{"aria-hidden":"true",...s(e.factMark,u(n.tone))},void 0,!1,void 0,this),n.label]},`${n.label}:${k}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function O(t,o){return{...o.kicker?{kicker:o.kicker}:{},access:j(t.permission),title:o.title??t.label,...o.description?{description:o.description}:{},...o.status?{status:o.status}:{},...o.facts?.length?{facts:o.facts}:{},totals:[],...o.primaryAction?{primaryAction:o.primaryAction}:{}}}
1
+ import{Kc as s,Nc as h,md as u,sd as v,td as x}from"./main-g15rdsa4.js";import{Qf as y}from"./main-2vaawyz9.js";import{wg as i}from"./main-s8r820px.js";var e={saveStatus:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kAzted:"xu0aao5",kg3NbH:"xfn1xvj",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",khDVqt:"xuxw1ft",$$css:!0},inset:{kLKAdn:"xijc0j3",kg3NbH:"x1tcxzho",k3VDzK:"xvl5zoi",kr1LIo:"xn3xmfv",$$css:!0},documentInset:{keoZOQ:"xseo6mj",kUOVxO:"x1i847zn",kcJqd2:"xg0897w",kLZkdG:"xhl984y",$$css:!0},root:{k1xSpc:"xrvj5dj",kOIVth:"x167g77z",kogj98:"x1ghz6dp",kGO01o:"x1hhzuzn",kt9PQ7:"xlxy82",kfdmCh:"x1q0q8m5",kL6WhQ:"x1594w68",kh9fTk:"xzuy7g3",$$css:!0},navigation:{kBCFzs:"x1osaytk",$$css:!0},hasAction:{kumcoG:"xju1xpo",$$css:!0},control:{kSGwAc:"xamitd3",kFhvOy:"x1qab1bc",k7Eaqz:"xeuugli",kCrP1I:"x1yagzmq",kV7FkP:"x1re7oy7",$$css:!0},row:{k1xSpc:"xrvj5dj",kumcoG:"x1mkdm3x",kGNEyG:"x1pha0wt",kOIVth:"x1v2ro7d",k7Eaqz:"xeuugli",kAzted:"x1gg8mnh",$$css:!0},copy:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x1pha0wt",kOIVth:"x1v2ro7d",k7Eaqz:"xeuugli",$$css:!0},titleGrow:{k1xSpc:"xrvj5dj",k5JduY:"x68pbbn",kVb13B:"x1snja1x",kMEsQN:"xx0cqyw",kduyaJ:"xajgrl3",kcTWDK:"xvikt2r",$$css:!0},titleInput:{k1xSpc:"x1lliihq",kJuA4N:"x1b1wf8y",kzqmXN:"xh8yej3",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kHenm0:"xtt52l0",kHjlTd:"xj0a0fe",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kMzoRj:"xc342km",kaIpWk:"x12oqio5",kWkggS:"xjbqb8w",kMwMTN:"x1heor9g",kVVagm:"xln7xf2",ka26j:"xkyhvkk",kb6lSQ:"x4gjf66",kLWn49:"x15bjb6t",k8Qsv1:"x1wku8z5",kMeerF:"x784prv xcpyg62",k3XXqK:"x9v5kkp x19ahsqg",kjBf7l:"xxh1od1 x1iau5pp",kInvED:"x1hl8ikr",$$css:!0},titleIssue:{k1xSpc:"x1lliihq",keoZOQ:"x1k70j0n",kMwMTN:"x1mel2pz",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xo1l8bm",kb6lSQ:"x12oo3zp",$$css:!0},title:{k7Eaqz:"xeuugli",ks0D6T:"x193iq5w",kogj98:"x1ghz6dp",kMwMTN:"xqvuw85",kMv6JI:"xssy22x",kGuDYH:"xqozcyj",ka26j:"x17owtcr",k63SB2:"x1s688f",kb6lSQ:"x1w69ole",kLWn49:"x1159mfc",kHjlTd:"xj0a0fe",kr4CYY:"x13i2va0",kFKdQ1:"xc3hpf1",kHdLCk:"x5dg28r",kOqvnJ:"xmi8g4k",kN0ZIM:"x5ih01h",keaIxW:"xhmgfki",$$css:!0},metadata:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",kMwMTN:"x1ar3pfp",kGuDYH:"x1qt5hsa",kr4CYY:"xxgfmko",$$css:!0},phoneHidden:{k7Eaqz:"xeuugli",kHdLCk:"xkaaz9w",$$css:!0},phoneBarred:{kt9PQ7:"xlxy82 xg3gpzv",kGO01o:"x1hhzuzn xlw6zc2",$$css:!0},statusDetail:{kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",kLWn49:"x1evy7pa",$$css:!0},facts:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kOIVth:"xhypsl1",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kB88ic:"xe8uvvx",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"xif65rj",kr4CYY:"x1yzm3l3",$$css:!0},fact:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",$$css:!0},factMark:{kzqmXN:"x1xc55vz",kZKoxP:"xdk7pt",kmuXW:"x2lah0s",kaIpWk:"x16rqkct",kWkggS:"xtwfq29",$$css:!0},totals:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kOIVth:"x1v2ro7d",kogj98:"x1ghz6dp",$$css:!0},total:{k1xSpc:"x3nfvp2",kGNEyG:"x1pha0wt",kOIVth:"x1nejdyq",$$css:!0},totalLabel:{kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",$$css:!0},totalValue:{kogj98:"x1ghz6dp",kMwMTN:"xqvuw85",kMv6JI:"xa9opjo",kGuDYH:"xfifm61",k63SB2:"x1s688f",$$css:!0},action:{kVAEAm:"x1n2onr6",kY2c9j:"xoegz02",koQZXg:"x8x9d4c",ks0D6T:"x193iq5w",kmuXW:"x2lah0s",kKwN1N:"x1pyp8la",kKq9zD:"xfl54mv",kRugJJ:"x13bo2ae",kpC6i:"xb8kata",kfD2x5:"xoco0x4",ku5HWf:"xlpsox",kfX6GZ:"x170sw7g",kp4SAw:"x1ynha1y",$$css:!0}};var m={body:{kUk6DE:"x98rzlu",kAzted:"x2lwn1j",k1xSpc:"xrvj5dj",kGNEyG:"x1qjc9v5",k9llMU:"x5o4joa",kRnz6y:"x13me3c",k9pwkU:"xch1w8t x8mpkbv",kSQbcb:"x1mgqk5d",keaIxW:"x7zq708 x1sqw5yv",$$css:!0},editor:{k1xSpc:"xrvj5dj",kumcoG:"x1q0n783 x1l1zzp x1efj4vi x4jmfmw",k9llMU:"xxq7klm",kAzted:"x2lwn1j",k7Eaqz:"xeuugli",k9pwkU:"x1y6iwit",keaIxW:"xhmgfki",$$css:!0},head:{kBCFzs:"x1osaytk",kbNqZ1:"x1ms6mhf",$$css:!0},colophon:{kBCFzs:"x1npkx4u x1gw0dv9",kbNqZ1:"x7sv70a",kAzted:"x2lwn1j",k7Eaqz:"xeuugli",kORKVm:"x1odjw0f",kZ1KPB:"xe0pwq",k4WBpm:"x19ypqd9",kaZRDh:"xlsyykk",k1xSpc:"x1tugbw3 x1idufoc",kWkggS:"xbslqsl",kmVPX3:"xga4tv",kubnTK:"x1llo3lq",kOLLwu:"x4pt66b",kU6wY8:"xnoo4qv",kRugJJ:"x1pvtvnk",kq8Ghq:"x171z6dy",$$css:!0},detailsSheet:{kVAEAm:"x12u6v07",kbCHJM:"x172uiah",kCIrl2:"x106zgql",krVfgx:"x1imafyg",kY2c9j:"x1u2u1qb",kskxy:"x13cfglm",kORKVm:"x1odjw0f xscgqpg",kZeWKH:"xg0x1tt",kIxVMA:"x126vn7o",ksF3WI:"x1abwb35",kLKAdn:"x9desvi x1vy0343",kGO01o:"xefzj8c xw27878",kGVxlE:"x12br0k5",$$css:!0},fullWidthProperties:{kBCFzs:"x1osaytk",kZ1KPB:"xyj58a3",$$css:!0},fields:{kMzoRj:"xc342km",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",k7Eaqz:"xeuugli",$$css:!0},manuscript:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kBCFzs:"xgkxs2y",kbNqZ1:"x7sv70a",kAzted:"x2lwn1j",k7Eaqz:"xeuugli",k9g6sI:"x12h1iku",kWkggS:"x18s3upu",kRnz6y:"x13me3c",kCrP1I:"x1gw0dv9",kU6wY8:"xnoo4qv",kKq9zD:"xscgqpg",kHdLCk:"x1ux6vrq",$$css:!0},colophonHidden:{k1xSpc:"x1s85apg",$$css:!0},inspectorToggle:{k1xSpc:"xkaaz9w",$$css:!0},pipeline:{kBCFzs:"x1osaytk",kbNqZ1:"xz51j44",kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1v2ro7d",kwnvtZ:"x1a02dak",kmVPX3:"xxmtint",kAzted:"xvkrg5o",kEmTf6:"x1anjdel",kBoZxP:"xj3o16p",kCrP1I:"x1gw0dv9",kU6wY8:"x1dhnagk",kHdLCk:"x10acg2q",k1JLwA:"x1lk34zc",kLyoy9:"x1d3ddqg",kTWfjk:"xiyjfb3",kRugJJ:"x11btecl",kLZC3w:"xvg7k2t",kWkggS:"x18s3upu x1r2i3kv",$$css:!0},detailsToggle:{k1xSpc:"x1s85apg x13v5x0x",kAzted:"x1gg8mnh",$$css:!0},saveState:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x1pha0wt",k1C7PZ:"x1amjocr",khm7nJ:"x1dbijih",$$css:!0},compactStatus:{k1xSpc:"x1s85apg xdsa2pc xfsj286 xbuh8fq",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kMwMTN:"xulty9s x15g7g0v",kMv6JI:"xa9opjo",kGuDYH:"xdzlmae",kb6lSQ:"x2ujxvm",kLWn49:"x1xfvgam",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},compactValue:{k1xSpc:"x1lliihq",kVQacm:"xb3r6kr",kMwMTN:"x19k5i5u",kGuDYH:"xvwhms9",kg5iWk:"xlyipyv",$$css:!0}};var f=i(y(),1);var r=i(y(),1),l=null,c=new Set;function p(){for(let t of c)t()}function w(t){return c.add(t),()=>{c.delete(t)}}function I(){return r.useSyncExternalStore(w,()=>l?.content??null,()=>null)}function g(t,o){r.useLayoutEffect(()=>{if(!o)return;return l={owner:t,content:o},p(),()=>{if(l?.owner!==t)return;l=null,p()}})}var a=i(h(),1);function j(t){switch(t){case"public":return{kind:"session",label:"Signed in"};case"trusted":return{kind:"permission",label:"Trusted"};case"admin":return{kind:"permission",label:"Admin only"}}}function R(t){let o=t.model.metadata?.slice(0,4)??[],d=t.model.totals.slice(0,4),[S]=f.useState(()=>Symbol("page head")),b=t.appearance!=="document";g(S,b?{title:t.model.title,...t.back?{back:t.back}:{},...t.action?{action:t.action}:{}}:null);let z=o.length===0&&!t.model.status&&d.length===0&&!t.model.facts?.length&&!t.control;if(t.appearance==="document")return a.jsxDEV("header",{className:x("studio-page-head",e.root,e.row,Boolean(t.action)&&e.hasAction,e.documentInset,m.head,!t.titleEditor&&e.phoneHidden),"data-studio-page-head":"true","data-has-status":"false","data-has-totals":"false",children:[t.navigation?a.jsxDEV("nav",{"aria-label":"Collection navigation",...s(e.navigation,e.phoneHidden),children:t.navigation},void 0,!1,void 0,this):null,a.jsxDEV("div",{...s(e.copy),children:a.jsxDEV("h1",{className:x("",e.title),children:t.titleEditor??t.model.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),t.action?a.jsxDEV("div",{className:x("studio-page-head-action",e.action,e.phoneHidden),children:t.action},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return a.jsxDEV("header",{className:x("studio-page-head",e.root,e.phoneBarred,z&&e.phoneHidden),"aria-description":t.model.description,"data-studio-page-head":"true","data-studio-head-barred":"","data-has-status":t.model.status?"true":"false","data-has-totals":d.length>0?"true":"false",children:[t.navigation?a.jsxDEV("nav",{"aria-label":"Collection navigation",...s(e.navigation),children:t.navigation},void 0,!1,void 0,this):null,a.jsxDEV("div",{className:x("studio-page-head-title-row",e.row,Boolean(t.action??t.control)&&e.hasAction),children:[a.jsxDEV("div",{...s(e.copy),children:[a.jsxDEV("h1",{...s(e.title,e.phoneHidden),children:t.titleEditor??t.model.title},void 0,!1,void 0,this),o.length>0&&a.jsxDEV("div",{className:x("studio-page-head-metadata",e.metadata),children:o.map((n,k)=>a.jsxDEV("span",{...s(k>0&&e.phoneHidden),children:[k>0&&a.jsxDEV("span",{"aria-hidden":"true",children:"· "},void 0,!1,void 0,this),n]},`${n}:${k}`,!0,void 0,this))},void 0,!1,void 0,this),t.model.status&&a.jsxDEV("span",{className:x("studio-head-status",v.status,u(t.model.status.tone),d.length>0&&e.phoneHidden),"data-tone":t.model.status.tone??"neutral",children:[t.model.status.label,t.model.status.detail&&a.jsxDEV("small",{...s(e.statusDetail),children:t.model.status.detail},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d.length>0&&a.jsxDEV("dl",{className:x("studio-page-head-totals",e.totals),children:d.map((n,k)=>a.jsxDEV("div",{"data-tone":n.tone??"neutral",...s(e.total,k>0&&n.tone!=="warn"&&n.tone!=="error"&&e.phoneHidden),children:[a.jsxDEV("dt",{...s(e.totalLabel),children:n.label},void 0,!1,void 0,this),a.jsxDEV("dd",{...s(e.totalValue,u(n.tone)),children:n.value},void 0,!1,void 0,this)]},`${n.label}:${k}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.control&&a.jsxDEV("div",{...s(e.control),"data-studio-head-control":"",children:t.control},void 0,!1,void 0,this),t.action&&a.jsxDEV("div",{className:x("studio-page-head-action",e.action,e.phoneHidden),"data-studio-primary-action":"true","data-operator-action-popover":"",children:t.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.model.facts&&t.model.facts.length>0&&a.jsxDEV("ul",{"aria-label":"Status",...s(e.facts),children:t.model.facts.map((n,k)=>a.jsxDEV("li",{"data-tone":n.tone??"neutral",...s(e.fact),children:[a.jsxDEV("span",{"aria-hidden":"true",...s(e.factMark,u(n.tone))},void 0,!1,void 0,this),n.label]},`${n.label}:${k}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function O(t,o){return{...o.kicker?{kicker:o.kicker}:{},access:j(t.permission),title:o.title??t.label,...o.description?{description:o.description}:{},...o.status?{status:o.status}:{},...o.facts?.length?{facts:o.facts}:{},totals:[],...o.primaryAction?{primaryAction:o.primaryAction}:{}}}
2
2
  export{e as Dc,m as Ec,I as Fc,g as Gc,j as Hc,R as Ic,O as Jc};
3
3
 
4
4
  //# debugId=7500B7E2D21499DA64756E2164756E21