getborg 0.0.119 → 0.0.125

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 (103) hide show
  1. package/dist/{FetchHttpClient-C-jciW95.mjs → FetchHttpClient-DkBX_tvM.mjs} +814 -814
  2. package/dist/{FileSystem-NX0EtGtm.mjs → FileSystem-B8SvsKCB.mjs} +87 -18
  3. package/dist/{Mime-C6O17O_3.mjs → Mime-mwjBDTG5.mjs} +945 -945
  4. package/dist/{NodeHttpIncomingMessage-CylGKvlB.mjs → NodeHttpIncomingMessage-Caou0eJc.mjs} +3 -3
  5. package/dist/{NodeHttpServer-EarHJJzn.mjs → NodeHttpServer-CiwRW4qX.mjs} +7 -7
  6. package/dist/{NodePtyAdapter-C6ioPYk6.mjs → NodePtyAdapter-DCy0YCxP.mjs} +2 -2
  7. package/dist/{NodeServices-C18DO3cx.mjs → NodeServices-KA4IGVlf.mjs} +4 -4
  8. package/dist/{NodeSqliteClient-CWkKfsSo.mjs → NodeSqliteClient-y7W-gFvl.mjs} +3 -3
  9. package/dist/{NodeStream-1N7oXzTp.mjs → NodeStream-Cwt3mZYs.mjs} +2 -2
  10. package/dist/{SqlClient-Cusaqpaw.mjs → SqlClient-D-oF89aw.mjs} +2 -2
  11. package/dist/bin.mjs +29698 -21001
  12. package/dist/{borgTelemetryNode-CHLcRFOW.mjs → borgTelemetryNode-BTLPaUwA.mjs} +5 -5
  13. package/dist/client/.vite/manifest.json +396 -320
  14. package/dist/client/assets/{ArrowRight-CgvCTAzu.js → ArrowRight-D8u8fAtz.js} +2 -2
  15. package/dist/client/assets/{ArrowSquareOut-C1CwJQ7R.js → ArrowSquareOut-B_f6YUhV.js} +2 -2
  16. package/dist/client/assets/{ArrowsClockwise-CBwAQTtQ.js → ArrowsClockwise-DQYZ1Xbo.js} +2 -2
  17. package/dist/client/assets/{CaretLeft-Bk0n02vc.js → CaretLeft-CfrkuxuJ.js} +2 -2
  18. package/dist/client/assets/ChatMarkdown-DvWtIvZP.js +249 -0
  19. package/dist/client/assets/CircleNotch-BcVOnWaH.js +2 -0
  20. package/dist/client/assets/DesignWorkspace-5_CopTlF.js +3 -0
  21. package/dist/client/assets/DiffPanel-BETQvwD0.js +2 -0
  22. package/dist/client/assets/DiffWorkerPoolProvider-B0GAJHHf.js +10 -0
  23. package/dist/client/assets/{DocxPreview-B7-febv_.js → DocxPreview-B3Ldhzps.js} +4 -4
  24. package/dist/client/assets/FilePreviewPanel-DG9JDM1b.js +2237 -0
  25. package/dist/client/assets/HtmlPreview-Cln7r1CE.js +2 -0
  26. package/dist/client/assets/{PdfPreview-W5mTp32l.js → PdfPreview-C5IVpvDo.js} +3 -3
  27. package/dist/client/assets/PptxPreview-DgUlZkyA.js +3 -0
  28. package/dist/client/assets/PreviewPanel-D9Co2Yoo.js +2 -0
  29. package/dist/client/assets/PullRequestCodeTab-Can_YY2q.js +6 -0
  30. package/dist/client/assets/PullRequestReactions-DagCwQZQ.js +12 -0
  31. package/dist/client/assets/{RightPanelResizeHandle-DBci-Ee2.js → RightPanelResizeHandle-XlC9gY5e.js} +2 -2
  32. package/dist/client/assets/VirtualizedFile-CFgSsBl7.js +2 -0
  33. package/dist/client/assets/XlsxPreview-D-aoM4SG.js +3 -0
  34. package/dist/client/assets/accountData-BKyjOPQm.js +16 -0
  35. package/dist/client/assets/assetUrls-BKDVxvlE.js +2 -0
  36. package/dist/client/assets/assets-B29JwqPY.js +2 -0
  37. package/dist/client/assets/{browserHistoryStore-DLbnuO9R.js → browserHistoryStore-DKruSW2y.js} +3 -3
  38. package/dist/client/assets/browserRecording-CZz89Zcp.js +2 -0
  39. package/dist/client/assets/clientAnalytics-D4y5ZOAM.js +1 -0
  40. package/dist/client/assets/clientPersistenceStorage-CeJLSpQl.js +2 -0
  41. package/dist/client/assets/combobox-r8GBhxUE.js +2 -0
  42. package/dist/client/assets/composerMentionDrag-3h9AstHI.js +2 -0
  43. package/dist/client/assets/designCanvas.logic-BT66Jt7h.js +8 -0
  44. package/dist/client/assets/{designOpenFileContext-CCL9VKvQ.js → designOpenFileContext-CThLSHGp.js} +2 -2
  45. package/dist/client/assets/{diffFileContents-CgDa-z2d.js → diffFileContents-Cw_j-FVi.js} +3 -3
  46. package/dist/client/assets/{empty-CLS3rXBc.js → empty--ZI_pbsa.js} +2 -2
  47. package/dist/client/assets/entities-D-MTx85j.js +2 -0
  48. package/dist/client/assets/followUpQueuePersistence-igYPNSUl.js +1 -0
  49. package/dist/client/assets/{index-DnoL7z0M.js → index-CaTemWmz.js} +3 -3
  50. package/dist/client/assets/{input-BbliVf4z.js → input-DrYFVaUj.js} +2 -2
  51. package/dist/client/assets/{lib-CySB76JU.js → lib-D8z7BdAf.js} +2 -2
  52. package/dist/client/assets/main-C0iNAqq8.css +2 -0
  53. package/dist/client/assets/main-CZEtfXqq.js +167 -0
  54. package/dist/client/assets/{pdf-CdULDwXT.js → pdf-C0dNXL7f.js} +2 -2
  55. package/dist/client/assets/popover-CQHPzmuS.js +2 -0
  56. package/dist/client/assets/pptxDocument-DlyhIyQx.js +3 -0
  57. package/dist/client/assets/projectFilesQueryState-BV4ypgkS.js +2 -0
  58. package/dist/client/assets/queries-D_4HUuyY.js +2 -0
  59. package/dist/client/assets/{scroll-area-BW5o0Izf.js → scroll-area-D_qtwL2R.js} +36 -36
  60. package/dist/client/assets/session-qsdF94mu.js +68 -0
  61. package/dist/client/assets/spinner-K3N_kbJr.js +2 -0
  62. package/dist/client/assets/textarea-xndIoUCV.js +2 -0
  63. package/dist/client/assets/{toggle-DwBa6pBo.js → toggle-Sui8J_p3.js} +2 -2
  64. package/dist/client/assets/toggle-group-BDgfPfOF.js +2 -0
  65. package/dist/client/assets/useSettings-DD7ohMuP.js +5 -0
  66. package/dist/client/assets/{useWorkspaceMutationRefresh-DLI4brDf.js → useWorkspaceMutationRefresh-ApasU6PB.js} +2 -2
  67. package/dist/client/assets/utils-ClZ5OxbV.js +30 -0
  68. package/dist/client/assets/xlsxDocument-BTR6qc2R.js +2 -0
  69. package/dist/client/index.html +1 -1
  70. package/dist/service-launcher.mjs +1 -1
  71. package/package.json +2 -2
  72. package/dist/client/assets/ChatMarkdown-6kh9qKYW.js +0 -249
  73. package/dist/client/assets/DesignWorkspace-DPuyt5mw.js +0 -3
  74. package/dist/client/assets/DiffPanel-DzRhendL.js +0 -2
  75. package/dist/client/assets/DiffWorkerPoolProvider-BU7l1oGv.js +0 -10
  76. package/dist/client/assets/FilePreviewPanel-B3x43muL.js +0 -2231
  77. package/dist/client/assets/HtmlPreview-DY3PT2FT.js +0 -2
  78. package/dist/client/assets/PptxPreview-B02U0OAE.js +0 -3
  79. package/dist/client/assets/PreviewPanel-DhzZlEWJ.js +0 -2
  80. package/dist/client/assets/PullRequestCodeTab-CoB5ByAD.js +0 -6
  81. package/dist/client/assets/PullRequestReactions-DVg6Hz1F.js +0 -12
  82. package/dist/client/assets/VirtualizedFile-Bz5fGbNr.js +0 -2
  83. package/dist/client/assets/XlsxPreview-8ACeuCsx.js +0 -3
  84. package/dist/client/assets/accountData-C4ZvicpJ.js +0 -16
  85. package/dist/client/assets/assetUrls-CbeTQh3H.js +0 -2
  86. package/dist/client/assets/browserRecording-DpmNgRt_.js +0 -2
  87. package/dist/client/assets/clientPersistenceStorage-BlYjZvCd.js +0 -2
  88. package/dist/client/assets/combobox-CByZwSML.js +0 -2
  89. package/dist/client/assets/composerMentionDrag-1fGsNlV_.js +0 -2
  90. package/dist/client/assets/designCanvas.logic-BaQE_ItM.js +0 -8
  91. package/dist/client/assets/entities-DPi_gbtI.js +0 -2
  92. package/dist/client/assets/main-Ck7oK5At.js +0 -161
  93. package/dist/client/assets/main-YscGsfgO.css +0 -2
  94. package/dist/client/assets/popover-CFDsW-_z.js +0 -2
  95. package/dist/client/assets/pptxDocument-Dh-M0DL5.js +0 -3
  96. package/dist/client/assets/projectFilesQueryState-CmtzaSrb.js +0 -2
  97. package/dist/client/assets/queries-DRotn4pk.js +0 -2
  98. package/dist/client/assets/session-D3Szkrpk.js +0 -67
  99. package/dist/client/assets/spinner-DHhZaoFg.js +0 -2
  100. package/dist/client/assets/textarea-5SMJbr7K.js +0 -5
  101. package/dist/client/assets/toggle-group-BU7-0DcW.js +0 -2
  102. package/dist/client/assets/utils-DgzD4MA_.js +0 -30
  103. package/dist/client/assets/xlsxDocument-BMNJtufK.js +0 -2
@@ -0,0 +1,5 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{An as t,As as n,Bd as r,Di as i,Ds as a,Fd as o,Fi as s,Gn as c,Hd as l,Hn as u,Ii as d,Iu as f,Jo as p,Js as m,Ki as h,Kl as ee,Kn as te,Ks as ne,Lo as re,Lu as ie,Mi as ae,Ms as oe,Oi as se,Pd as ce,Qs as le,Ts as ue,Ud as de,Vd as fe,Vo as pe,Wd as me,Wi as he,Ys as ge,Zl as _e,ac as ve,ad as ye,af as be,b as g,bi as xe,cd as Se,cl as Ce,do as _,ea as we,el as Te,g as Ee,gl as De,hc as Oe,hd as ke,ho as Ae,jd as je,ks as Me,m as Ne,ma as Pe,md as Fe,nc as Ie,nu as Le,oc as Re,oi as ze,oo as Be,p as Ve,pc as He,qs as Ue,ri as We,rl as Ge,sc as Ke,tl as qe,to as Je,ur as Ye,v as Xe,va as Ze,wc as Qe,y as $e,zd as et,zn as tt,zs as nt}from"./accountData-BKyjOPQm.js";import{$o as rt,Zo as it,co as at,ns as ot,ts as st}from"./utils-ClZ5OxbV.js";import{A as ct,B as lt,Bn as ut,Cn as v,En as y,Fn as dt,H as ft,Hn as pt,In as mt,It as ht,Jt as gt,K as _t,Kt as b,L as vt,On as x,Ot as yt,Qt as bt,R as xt,U as St,Un as Ct,V as wt,Vn as Tt,W as Et,Wt as Dt,Xt as Ot,_n as kt,cn as At,dn as jt,fn as Mt,gn as Nt,hn as S,i as Pt,jn as C,kn as Ft,kt as It,ln as Lt,p as Rt,qt as w,r as zt,rn as Bt,sn as Vt,t as Ht,tn as Ut,un as Wt,vn as Gt,wn as Kt,xn as qt,yn as Jt,z as Yt,zn as Xt,zt as Zt}from"./session-qsdF94mu.js";import{a as Qt,n as $t,o as en,r as tn,t as nn}from"./clientPersistenceStorage-CeJLSpQl.js";var T=e($e(),1),E=Xe(),rn=re(Ye);function an(e){return rn(e)&&e.bootstrapThreadDisposition===`deleted`}var on=[/\bSocketCloseError\b/i,/\bSocketOpenError\b/i,/\bSocket is not connected\b/i,/Unable to connect to the Borg server WebSocket\./i,/\bis not connected\.$/i,/\bdisconnected\.$/i,/\bcould not establish a WebSocket connection\.$/i,/\bClientProtocolError\b/i,/\bRpcClientError\b/i,/\bping timeout\b/i];function sn(e){if(typeof e!=`string`)return!1;let t=e.trim();return t.length===0?!1:on.some(e=>e.test(t))}function cn(e){return sn(e)?null:e??null}var ln=Object.freeze({isReady:!1,entries:new Map});function un(e){let t=Dt(),n={mode:`serial`,key:()=>`environment-catalog`},r=e.atom(we(jt.pipe(Oe(e=>ut(e.entries).pipe(s(e=>({isReady:!0,entries:e})))))),{initialValue:ln}),i=x(e=>ce(Xt(e(r)),()=>ln)).pipe(C(`environment-catalog-value`)),a=e.atom(we(jt.pipe(Oe(e=>ut(e.networkStatus)))),{initialValue:`unknown`});return{catalogAtom:r,catalogValueAtom:i,networkStatusAtom:a,networkStatusValueAtom:x(e=>ce(Xt(e(a)),()=>`unknown`)).pipe(C(`environment-network-status-value`)),stateAtom:y(t=>e.atom(bt(t,we(Mt.pipe(Oe(e=>ut(e.state))))),{initialValue:Jt})),register:Ot(e,{label:`environment-catalog:register`,scheduler:t,concurrency:n,execute:e=>jt.pipe(ge(t=>t.register(e)))}),remove:Ot(e,{label:`environment-catalog:remove`,scheduler:t,concurrency:n,execute:e=>jt.pipe(ge(t=>t.remove(e)))}),retryNow:Ot(e,{label:`environment-catalog:retry-now`,scheduler:t,concurrency:n,execute:e=>jt.pipe(ge(t=>t.retryNow(e)))})}}var D=un(Pt);function dn(e,t){let n=(0,E.c)(6),r=(0,T.useContext)(Kt),i=typeof t==`string`?t:t?.label??e.label,a=typeof t==`string`?!0:t?.reportFailure??!0,o=typeof t==`string`?!0:t?.reportDefect??!0,s;return n[0]!==e||n[1]!==i||n[2]!==r||n[3]!==o||n[4]!==a?(s=t=>Ut(r,e,t,{label:i,reportFailure:a,reportDefect:o}),n[0]=e,n[1]=i,n[2]=r,n[3]=o,n[4]=a,n[5]=s):s=n[5],s}var fn=x(dt(!1)).pipe(C(`web-environment-query:empty`));function pn(e){let t=Le(e);return t instanceof Error&&t.message.trim().length>0?t.message:`The environment request failed.`}function mn(e){let t=(0,E.c)(10),n=e??fn,r=v(n),i=qt(n),a;t[0]===r?a=t[1]:(a=o(Xt(r)),t[0]=r,t[1]=a);let s;t[2]!==r._tag||t[3]!==r.cause?(s=r._tag===`Failure`?pn(r.cause):null,t[2]=r._tag,t[3]=r.cause,t[4]=s):s=t[4];let c=e!==null&&r.waiting,l;return t[5]!==i||t[6]!==a||t[7]!==s||t[8]!==c?(l={data:a,error:s,isPending:c,refresh:i},t[5]=i,t[6]=a,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}var hn=(e,t)=>{if(typeof e==`number`){if(t===3)return{mode:`rgb`,r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:`rgb`,r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:`rgb`,r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:`rgb`,r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},gn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},_n=e=>hn(gn[e.toLowerCase()],6),vn=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,yn=e=>{let t;return(t=e.match(vn))?hn(parseInt(t[1],16),t[1].length):void 0},O=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`;`${O}`;var bn=`${O}%`;`${O}`;var xn=`(?:${O}%|${O})`,Sn=`(?:${O}%|${O}|none)`,Cn=`(?:${O}(deg|grad|rad|turn)|${O})`;`${O}${O}`;var wn=`\\s*,\\s*`;RegExp(`^`+Sn+`$`);var Tn=RegExp(`^rgba?\\(\\s*${O}${wn}${O}${wn}${O}\\s*(?:,\\s*${xn}\\s*)?\\)$`),En=RegExp(`^rgba?\\(\\s*${bn}${wn}${bn}${wn}${bn}\\s*(?:,\\s*${xn}\\s*)?\\)$`),Dn=e=>{let t={mode:`rgb`},n;if(n=e.match(Tn))n[1]!==void 0&&(t.r=n[1]/255),n[2]!==void 0&&(t.g=n[2]/255),n[3]!==void 0&&(t.b=n[3]/255);else if(n=e.match(En))n[1]!==void 0&&(t.r=n[1]/100),n[2]!==void 0&&(t.g=n[2]/100),n[3]!==void 0&&(t.b=n[3]/100);else return;return n[4]===void 0?n[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[5]))):t.alpha=Math.max(0,Math.min(1,n[4]/100)),t},On=(e,t)=>e===void 0?void 0:typeof e==`object`?e.mode===void 0?t?{...e,mode:t}:void 0:e:Yn(e),kn=(e=`rgb`)=>t=>(t=On(t,e))===void 0?void 0:t.mode===e?t:k[t.mode][e]?k[t.mode][e](t):e===`rgb`?k[t.mode].rgb(t):k.rgb[e](k[t.mode].rgb(t)),k={},An={},jn=[],Mn={},Nn=e=>e,A=e=>(k[e.mode]={...k[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{k[t]||(k[t]={}),k[t][e.mode]=e.fromMode[t]}),e.ranges||={},e.difference||={},e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]==`function`&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=Nn)}),An[e.mode]=e,(e.parse||[]).forEach(t=>{Fn(t,e.mode)}),kn(e.mode)),Pn=e=>An[e],Fn=(e,t)=>{if(typeof e==`string`){if(!t)throw Error(`'mode' required when 'parser' is a string`);Mn[e]=t}else typeof e==`function`&&jn.indexOf(e)<0&&jn.push(e)},In=/[^\x00-\x7F]|[a-zA-Z_]/,Ln=/[^\x00-\x7F]|[-\w]/,j={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`},M=0;function Rn(e){let t=e[M],n=e[M+1];return t===`-`||t===`+`?/\d/.test(n)||n===`.`&&/\d/.test(e[M+2]):t===`.`?/\d/.test(n):/\d/.test(t)}function zn(e){if(M>=e.length)return!1;let t=e[M];if(In.test(t))return!0;if(t===`-`){if(e.length-M<2)return!1;let t=e[M+1];return!!(t===`-`||In.test(t))}return!1}var Bn={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function Vn(e){let t=``;if((e[M]===`-`||e[M]===`+`)&&(t+=e[M++]),t+=Hn(e),e[M]===`.`&&/\d/.test(e[M+1])&&(t+=e[M++]+Hn(e)),(e[M]===`e`||e[M]===`E`)&&((e[M+1]===`-`||e[M+1]===`+`)&&/\d/.test(e[M+2])?t+=e[M++]+e[M++]+Hn(e):/\d/.test(e[M+1])&&(t+=e[M++]+Hn(e))),zn(e)){let n=Un(e);return n===`deg`||n===`rad`||n===`turn`||n===`grad`?{type:j.Hue,value:t*Bn[n]}:void 0}return e[M]===`%`?(M++,{type:j.Percentage,value:+t}):{type:j.Number,value:+t}}function Hn(e){let t=``;for(;/\d/.test(e[M]);)t+=e[M++];return t}function Un(e){let t=``;for(;M<e.length&&Ln.test(e[M]);)t+=e[M++];return t}function Wn(e){let t=Un(e);return e[M]===`(`?(M++,{type:j.Function,value:t}):t===`none`?{type:j.None,value:void 0}:{type:j.Ident,value:t}}function Gn(e=``){let t=e.trim(),n=[],r;for(M=0;M<t.length;){if(r=t[M++],r===`
2
+ `||r===` `||r===` `){for(;M<t.length&&(t[M]===`
3
+ `||t[M]===` `||t[M]===` `);)M++;continue}if(r===`,`)return;if(r===`)`){n.push({type:j.ParenClose});continue}if(r===`+`){if(M--,Rn(t)){n.push(Vn(t));continue}return}if(r===`-`){if(M--,Rn(t)){n.push(Vn(t));continue}if(zn(t)){n.push({type:j.Ident,value:Un(t)});continue}return}if(r===`.`){if(M--,Rn(t)){n.push(Vn(t));continue}return}if(r===`/`){for(;M<t.length&&(t[M]===`
4
+ `||t[M]===` `||t[M]===` `);)M++;let e;if(Rn(t)&&(e=Vn(t),e.type!==j.Hue)){n.push({type:j.Alpha,value:e});continue}if(zn(t)&&Un(t)===`none`){n.push({type:j.Alpha,value:{type:j.None,value:void 0}});continue}return}if(/\d/.test(r)){M--,n.push(Vn(t));continue}if(In.test(r)){M--,n.push(Wn(t));continue}return}return n}function Kn(e){e._i=0;let t=e[e._i++];if(!t||t.type!==j.Function||t.value!==`color`||(t=e[e._i++],t.type!==j.Ident))return;let n=Mn[t.value];if(!n)return;let r={mode:n},i=qn(e,!1);if(!i)return;let a=Pn(n).channels;for(let e=0,t,n;e<a.length;e++)t=i[e],n=a[e],t.type!==j.None&&(r[n]=t.type===j.Number?t.value:t.value/100,n===`alpha`&&(r[n]=Math.max(0,Math.min(1,r[n]))));return r}function qn(e,t){let n=[],r;for(;e._i<e.length;){if(r=e[e._i++],r.type===j.None||r.type===j.Number||r.type===j.Alpha||r.type===j.Percentage||t&&r.type===j.Hue){n.push(r);continue}if(r.type===j.ParenClose){if(e._i<e.length)return;continue}return}if(!(n.length<3||n.length>4)){if(n.length===4){if(n[3].type!==j.Alpha)return;n[3]=n[3].value}return n.length===3&&n.push({type:j.None,value:void 0}),n.every(e=>e.type!==j.Alpha)?n:void 0}}function Jn(e,t){e._i=0;let n=e[e._i++];if(!n||n.type!==j.Function)return;let r=qn(e,t);if(r)return r.unshift(n.value),r}var Yn=e=>{if(typeof e!=`string`)return;let t=Gn(e),n=t?Jn(t,!0):void 0,r,i=0,a=jn.length;for(;i<a;)if((r=jn[i++](e,n))!==void 0)return r;return t?Kn(t):void 0};function Xn(e,t){if(!t||t[0]!==`rgb`&&t[0]!==`rgba`)return;let n={mode:`rgb`},[,r,i,a,o]=t;if(!(r.type===j.Hue||i.type===j.Hue||a.type===j.Hue))return r.type!==j.None&&(n.r=r.type===j.Number?r.value/255:r.value/100),i.type!==j.None&&(n.g=i.type===j.Number?i.value/255:i.value/100),a.type!==j.None&&(n.b=a.type===j.Number?a.value/255:a.value/100),o.type!==j.None&&(n.alpha=Math.min(1,Math.max(0,o.type===j.Number?o.value:o.value/100))),n}var Zn=e=>e===`transparent`?{mode:`rgb`,r:0,g:0,b:0,alpha:0}:void 0,Qn=(e,t,n)=>e+n*(t-e),$n=e=>{let t=[];for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1];r===void 0&&i===void 0?t.push(void 0):r!==void 0&&i!==void 0?t.push([r,i]):t.push(r===void 0?[i,i]:[r,r])}return t},N=(e=>t=>{let n=$n(t);return t=>{let r=t*n.length,i=t>=1?n.length-1:Math.max(Math.floor(r),0),a=n[i];return a===void 0?void 0:e(a[0],a[1],r-i)}})(Qn),P=e=>{let t=!1,n=e.map(e=>e===void 0?1:(t=!0,e));return t?n:e},er={mode:`rgb`,channels:[`r`,`g`,`b`,`alpha`],parse:[Xn,yn,Dn,_n,Zn,`srgb`],serialize:`srgb`,interpolate:{r:N,g:N,b:N,alpha:{use:N,fixup:P}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},tr=(e=0)=>Math.abs(e)**(563/256)*Math.sign(e),nr=e=>{let t=tr(e.r),n=tr(e.g),r=tr(e.b),i={mode:`xyz65`,x:.5766690429101305*t+.1855582379065463*n+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*n+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*n+.9913375368376386*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i},rr=e=>Math.abs(e)**(256/563)*Math.sign(e),ir=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`a98`,r:rr(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*n),g:rr(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*n),b:rr(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*n)};return r!==void 0&&(i.alpha=r),i},ar=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*((t+.055)/1.055)**2.4},or=({r:e,g:t,b:n,alpha:r})=>{let i={mode:`lrgb`,r:ar(e),g:ar(t),b:ar(n)};return r!==void 0&&(i.alpha=r),i},sr=e=>{let{r:t,g:n,b:r,alpha:i}=or(e),a={mode:`xyz65`,x:.4123907992659593*t+.357584339383878*n+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*n+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*n+.9505321522496607*r};return i!==void 0&&(a.alpha=i),a},cr=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*t**(1/2.4)-.055):e*12.92},lr=({r:e,g:t,b:n,alpha:r},i=`rgb`)=>{let a={mode:i,r:cr(e),g:cr(t),b:cr(n)};return r!==void 0&&(a.alpha=r),a},ur=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=lr({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*n,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*n,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*n});return r!==void 0&&(i.alpha=r),i},dr={...er,mode:`a98`,parse:[`a98-rgb`],serialize:`a98-rgb`,fromMode:{rgb:e=>ir(sr(e)),xyz65:ir},toMode:{rgb:e=>ur(nr(e)),xyz65:nr}},F=e=>(e%=360)<0?e+360:e;function fr({h:e,s:t,l:n,alpha:r}){e=F(e===void 0?0:e),t===void 0&&(t=0),n===void 0&&(n=0);let i=n+t*(n<.5?n:1-n),a=i-(i-n)*2*Math.abs(e/60%2-1),o;switch(Math.floor(e/60)){case 0:o={r:i,g:a,b:2*n-i};break;case 1:o={r:a,g:i,b:2*n-i};break;case 2:o={r:2*n-i,g:i,b:a};break;case 3:o={r:2*n-i,g:a,b:i};break;case 4:o={r:a,g:2*n-i,b:i};break;case 5:o={r:i,g:2*n-i,b:a};break;default:o={r:2*n-i,g:2*n-i,b:2*n-i}}return o.mode=`rgb`,r!==void 0&&(o.alpha=r),o}function pr({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.max(e,t,n),a=Math.min(e,t,n),o={mode:`hsl`,s:i===a?0:(i-a)/(1-Math.abs(i+a-1)),l:.5*(i+a)};return i-a!==0&&(o.h=(i===e?(t-n)/(i-a)+(t<n)*6:i===t?(n-e)/(i-a)+2:(e-t)/(i-a)+4)*60),r!==void 0&&(o.alpha=r),o}var mr=(e,t)=>{switch(t){case`deg`:return+e;case`rad`:return e/Math.PI*180;case`grad`:return e/10*9;case`turn`:return e*360}},hr=RegExp(`^hsla?\\(\\s*${Cn}${wn}${bn}${wn}${bn}\\s*(?:,\\s*${xn}\\s*)?\\)$`),gr=e=>{let t=e.match(hr);if(!t)return;let n={mode:`hsl`};return t[3]===void 0?t[1]!==void 0&&t[2]!==void 0&&(n.h=mr(t[1],t[2])):n.h=+t[3],t[4]!==void 0&&(n.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(n.l=Math.min(Math.max(0,t[5]/100),1)),t[6]===void 0?t[7]!==void 0&&(n.alpha=Math.max(0,Math.min(1,+t[7]))):n.alpha=Math.max(0,Math.min(1,t[6]/100)),n};function _r(e,t){if(!t||t[0]!==`hsl`&&t[0]!==`hsla`)return;let n={mode:`hsl`},[,r,i,a,o]=t;if(r.type!==j.None){if(r.type===j.Percentage)return;n.h=r.value}if(i.type!==j.None){if(i.type===j.Hue)return;n.s=i.value/100}if(a.type!==j.None){if(a.type===j.Hue)return;n.l=a.value/100}return o.type!==j.None&&(n.alpha=Math.min(1,Math.max(0,o.type===j.Number?o.value:o.value/100))),n}var vr=(e,t)=>e.map((n,r,i)=>{if(n===void 0)return n;let a=F(n);return r===0||e[r-1]===void 0?a:t(a-F(i[r-1]))}).reduce((e,t)=>!e.length||t===void 0||e[e.length-1]===void 0?(e.push(t),e):(e.push(t+e[e.length-1]),e),[]),yr=e=>vr(e,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),br=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let n=F(e.h),r=F(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*i},xr=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let n=F(e.h),r=F(t.h);return Math.abs(r-n)>180?n-(r-360*Math.sign(r-n)):r-n},Sr=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let n=F(e.h),r=F(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*i},Cr=e=>{let t=e.reduce((e,t)=>{if(t!==void 0){let n=t*Math.PI/180;e.sin+=Math.sin(n),e.cos+=Math.cos(n)}return e},{sin:0,cos:0}),n=Math.atan2(t.sin,t.cos)*180/Math.PI;return n<0?360+n:n},wr={mode:`hsl`,toMode:{rgb:fr},fromMode:{rgb:pr},channels:[`h`,`s`,`l`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[_r,gr],serialize:e=>`hsl(${e.h===void 0?`none`:e.h} ${e.s===void 0?`none`:e.s*100+`%`} ${e.l===void 0?`none`:e.l*100+`%`}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:N,fixup:yr},s:N,l:N,alpha:{use:N,fixup:P}},difference:{h:br},average:{h:Cr}};function Tr({h:e,s:t,v:n,alpha:r}){e=F(e===void 0?0:e),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:n,g:n*(1-t*i),b:n*(1-t)};break;case 1:a={r:n*(1-t*i),g:n,b:n*(1-t)};break;case 2:a={r:n*(1-t),g:n,b:n*(1-t*i)};break;case 3:a={r:n*(1-t),g:n*(1-t*i),b:n};break;case 4:a={r:n*(1-t*i),g:n*(1-t),b:n};break;case 5:a={r:n,g:n*(1-t),b:n*(1-t*i)};break;default:a={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return a.mode=`rgb`,r!==void 0&&(a.alpha=r),a}function Er({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.max(e,t,n),a=Math.min(e,t,n),o={mode:`hsv`,s:i===0?0:1-a/i,v:i};return i-a!==0&&(o.h=(i===e?(t-n)/(i-a)+(t<n)*6:i===t?(n-e)/(i-a)+2:(e-t)/(i-a)+4)*60),r!==void 0&&(o.alpha=r),o}var Dr={mode:`hsv`,toMode:{rgb:Tr},parse:[`--hsv`],serialize:`--hsv`,fromMode:{rgb:Er},channels:[`h`,`s`,`v`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,interpolate:{h:{use:N,fixup:yr},s:N,v:N,alpha:{use:N,fixup:P}},difference:{h:br},average:{h:Cr}};function Or({h:e,w:t,b:n,alpha:r}){if(t===void 0&&(t=0),n===void 0&&(n=0),t+n>1){let e=t+n;t/=e,n/=e}return Tr({h:e,s:n===1?1:1-t/(1-n),v:1-n,alpha:r})}function kr(e){let t=Er(e);if(t===void 0)return;let n=t.s===void 0?0:t.s,r=t.v===void 0?0:t.v,i={mode:`hwb`,w:(1-n)*r,b:1-r};return t.h!==void 0&&(i.h=t.h),t.alpha!==void 0&&(i.alpha=t.alpha),i}function Ar(e,t){if(!t||t[0]!==`hwb`)return;let n={mode:`hwb`},[,r,i,a,o]=t;if(r.type!==j.None){if(r.type===j.Percentage)return;n.h=r.value}if(i.type!==j.None){if(i.type===j.Hue)return;n.w=i.value/100}if(a.type!==j.None){if(a.type===j.Hue)return;n.b=a.value/100}return o.type!==j.None&&(n.alpha=Math.min(1,Math.max(0,o.type===j.Number?o.value:o.value/100))),n}var jr={mode:`hwb`,toMode:{rgb:Or},fromMode:{rgb:kr},channels:[`h`,`w`,`b`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[Ar],serialize:e=>`hwb(${e.h===void 0?`none`:e.h} ${e.w===void 0?`none`:e.w*100+`%`} ${e.b===void 0?`none`:e.b*100+`%`}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:N,fixup:yr},w:N,b:N,alpha:{use:N,fixup:P}},difference:{h:xr},average:{h:Cr}},Mr=29**3/3**3,Nr=6**3/29**3,Pr={X:.3457/.3585,Y:1,Z:.2958/.3585},Fr={X:.3127/.329,Y:1,Z:.3583/.329},Ir=e=>e**3>Nr?e**3:(116*e-16)/Mr,Lr=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+16)/116,a=t/500+i,o=i-n/200,s={mode:`xyz50`,x:Ir(a)*Pr.X,y:Ir(i)*Pr.Y,z:Ir(o)*Pr.Z};return r!==void 0&&(s.alpha=r),s},Rr=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=lr({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*n,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*n,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*n});return r!==void 0&&(i.alpha=r),i},zr=e=>Rr(Lr(e)),Br=e=>{let{r:t,g:n,b:r,alpha:i}=or(e),a={mode:`xyz50`,x:.436065742824811*t+.3851514688337912*n+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*n+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*n+.7140993584005155*r};return i!==void 0&&(a.alpha=i),a},Vr=e=>e>Nr?Math.cbrt(e):(Mr*e+16)/116,Hr=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Vr(e/Pr.X),a=Vr(t/Pr.Y),o=Vr(n/Pr.Z),s={mode:`lab`,l:116*a-16,a:500*(i-a),b:200*(a-o)};return r!==void 0&&(s.alpha=r),s},Ur=e=>{let t=Hr(Br(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};function Wr(e,t){if(!t||t[0]!==`lab`)return;let n={mode:`lab`},[,r,i,a,o]=t;if(!(r.type===j.Hue||i.type===j.Hue||a.type===j.Hue))return r.type!==j.None&&(n.l=Math.min(Math.max(0,r.value),100)),i.type!==j.None&&(n.a=i.type===j.Number?i.value:i.value*125/100),a.type!==j.None&&(n.b=a.type===j.Number?a.value:a.value*125/100),o.type!==j.None&&(n.alpha=Math.min(1,Math.max(0,o.type===j.Number?o.value:o.value/100))),n}var Gr={mode:`lab`,toMode:{xyz50:Lr,rgb:zr},fromMode:{xyz50:Hr,rgb:Ur},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[Wr],serialize:e=>`lab(${e.l===void 0?`none`:e.l} ${e.a===void 0?`none`:e.a} ${e.b===void 0?`none`:e.b}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{l:N,a:N,b:N,alpha:{use:N,fixup:P}}},Kr=29**3/3**3,qr=6**3/29**3,Jr=e=>e**3>qr?e**3:(116*e-16)/Kr,Yr=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+16)/116,a=t/500+i,o=i-n/200,s={mode:`xyz65`,x:Jr(a)*Fr.X,y:Jr(i)*Fr.Y,z:Jr(o)*Fr.Z};return r!==void 0&&(s.alpha=r),s},Xr=e=>ur(Yr(e)),Zr=e=>e>qr?Math.cbrt(e):(Kr*e+16)/116,Qr=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Zr(e/Fr.X),a=Zr(t/Fr.Y),o=Zr(n/Fr.Z),s={mode:`lab65`,l:116*a-16,a:500*(i-a),b:200*(a-o)};return r!==void 0&&(s.alpha=r),s},$r=e=>{let t=Qr(sr(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ei={...Gr,mode:`lab65`,parse:[`--lab-d65`],serialize:`--lab-d65`,toMode:{xyz65:Yr,rgb:Xr},fromMode:{xyz65:Qr,rgb:$r},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},ti=({l:e,a:t,b:n,alpha:r},i=`lch`)=>{t===void 0&&(t=0),n===void 0&&(n=0);let a=Math.sqrt(t*t+n*n),o={mode:i,l:e,c:a};return a&&(o.h=F(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(o.alpha=r),o},ni=({l:e,c:t,h:n,alpha:r},i=`lab`)=>{n===void 0&&(n=0);let a={mode:i,l:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(a.alpha=r),a};function ri(e,t){if(!t||t[0]!==`lch`)return;let n={mode:`lch`},[,r,i,a,o]=t;if(r.type!==j.None){if(r.type===j.Hue)return;n.l=Math.min(Math.max(0,r.value),100)}if(i.type!==j.None&&(n.c=Math.max(0,i.type===j.Number?i.value:i.value*150/100)),a.type!==j.None){if(a.type===j.Percentage)return;n.h=a.value}return o.type!==j.None&&(n.alpha=Math.min(1,Math.max(0,o.type===j.Number?o.value:o.value/100))),n}var ii={mode:`lch`,toMode:{lab:ni,rgb:e=>zr(ni(e))},fromMode:{rgb:e=>ti(Ur(e)),lab:ti},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[ri],serialize:e=>`lch(${e.l===void 0?`none`:e.l} ${e.c===void 0?`none`:e.c} ${e.h===void 0?`none`:e.h}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:N,fixup:yr},c:N,l:N,alpha:{use:N,fixup:P}},difference:{h:Sr},average:{h:Cr}},ai={...ii,mode:`lch65`,parse:[`--lch-d65`],serialize:`--lch-d65`,toMode:{lab65:e=>ni(e,`lab65`),rgb:e=>Xr(ni(e,`lab65`))},fromMode:{rgb:e=>ti($r(e),`lch65`),lab65:e=>ti(e,`lch65`)},ranges:{l:[0,100],c:[0,150],h:[0,360]}},oi={...er,mode:`lrgb`,toMode:{rgb:lr},fromMode:{rgb:or},parse:[`srgb-linear`],serialize:`srgb-linear`},si=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+.3963377773761749*t+.2158037573099136*n)**3,a=(e-.1055613458156586*t-.0638541728258133*n)**3,o=(e-.0894841775298119*t-1.2914855480194092*n)**3,s={mode:`lrgb`,r:4.076741636075957*i-3.3077115392580616*a+.2309699031821044*o,g:-1.2684379732850317*i+2.6097573492876887*a-.3413193760026573*o,b:-.0041960761386756*i-.7034186179359362*a+1.7076146940746117*o};return r!==void 0&&(s.alpha=r),s},ci=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*n),a=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*n),o=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*n),s={mode:`oklab`,l:.210454268309314*i+.7936177747023054*a-.0040720430116193*o,a:1.9779985324311684*i-2.42859224204858*a+.450593709617411*o,b:.0259040424655478*i+.7827717124575296*a-.8086757549230774*o};return r!==void 0&&(s.alpha=r),s},li=e=>{let t=ci(or(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ui=e=>lr(si(e));function di(e,t){if(!t||t[0]!==`oklab`)return;let n={mode:`oklab`},[,r,i,a,o]=t;if(!(r.type===j.Hue||i.type===j.Hue||a.type===j.Hue))return r.type!==j.None&&(n.l=Math.min(Math.max(0,r.type===j.Number?r.value:r.value/100),1)),i.type!==j.None&&(n.a=i.type===j.Number?i.value:i.value*.4/100),a.type!==j.None&&(n.b=a.type===j.Number?a.value:a.value*.4/100),o.type!==j.None&&(n.alpha=Math.min(1,Math.max(0,o.type===j.Number?o.value:o.value/100))),n}var fi={...Gr,mode:`oklab`,toMode:{lrgb:si,rgb:ui},fromMode:{lrgb:ci,rgb:li},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[di],serialize:e=>`oklab(${e.l===void 0?`none`:e.l} ${e.a===void 0?`none`:e.a} ${e.b===void 0?`none`:e.b}${e.alpha<1?` / ${e.alpha}`:``})`};function pi(e,t){if(!t||t[0]!==`oklch`)return;let n={mode:`oklch`},[,r,i,a,o]=t;if(r.type!==j.None){if(r.type===j.Hue)return;n.l=Math.min(Math.max(0,r.type===j.Number?r.value:r.value/100),1)}if(i.type!==j.None&&(n.c=Math.max(0,i.type===j.Number?i.value:i.value*.4/100)),a.type!==j.None){if(a.type===j.Percentage)return;n.h=a.value}return o.type!==j.None&&(n.alpha=Math.min(1,Math.max(0,o.type===j.Number?o.value:o.value/100))),n}var mi={...ii,mode:`oklch`,toMode:{oklab:e=>ni(e,`oklab`),rgb:e=>ui(ni(e,`oklab`))},fromMode:{rgb:e=>ti(li(e),`oklch`),oklab:e=>ti(e,`oklch`)},parse:[pi],serialize:e=>`oklch(${e.l===void 0?`none`:e.l} ${e.c===void 0?`none`:e.c} ${e.h===void 0?`none`:e.h}${e.alpha<1?` / ${e.alpha}`:``})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},hi=e=>{let{r:t,g:n,b:r,alpha:i}=or(e),a={mode:`xyz65`,x:.486570948648216*t+.265667693169093*n+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*n+.079286914093745*r,z:0*t+.0451133818589026*n+1.043944368900976*r};return i!==void 0&&(a.alpha=i),a},gi=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=lr({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*n,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*n,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*n},`p3`);return r!==void 0&&(i.alpha=r),i},_i={...er,mode:`p3`,parse:[`display-p3`],serialize:`display-p3`,fromMode:{rgb:e=>gi(sr(e)),xyz65:gi},toMode:{rgb:e=>ur(hi(e)),xyz65:hi}},vi=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*t**(1/1.8):16*e},yi=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`prophoto`,r:vi(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*n),g:vi(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*n),b:vi(e*0+t*0+1.2119675456389452*n)};return r!==void 0&&(i.alpha=r),i},bi=(e=0)=>{let t=Math.abs(e);return t>=16/512?Math.sign(e)*t**1.8:e/16},xi=e=>{let t=bi(e.r),n=bi(e.g),r=bi(e.b),i={mode:`xyz50`,x:.7977666449006423*t+.1351812974005331*n+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*n+899369387256e-16*r,z:0*t+0*n+.8251046025104602*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i},Si={...er,mode:`prophoto`,parse:[`prophoto-rgb`],serialize:`prophoto-rgb`,fromMode:{xyz50:yi,rgb:e=>yi(Br(e))},toMode:{xyz50:xi,rgb:e=>Rr(xi(e))}},Ci=1.09929682680944,wi=.018053968510807,Ti=e=>{let t=Math.abs(e);return t>wi?(Math.sign(e)||1)*(Ci*t**.45-(Ci-1)):4.5*e},Ei=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`rec2020`,r:Ti(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*n),g:Ti(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*n),b:Ti(e*.0176398574453108-t*.0427706132578085+.9421031212354739*n)};return r!==void 0&&(i.alpha=r),i},Di=1.09929682680944,Oi=.018053968510807,ki=(e=0)=>{let t=Math.abs(e);return t<Oi*4.5?e/4.5:(Math.sign(e)||1)*((t+Di-1)/Di)**(1/.45)},Ai=e=>{let t=ki(e.r),n=ki(e.g),r=ki(e.b),i={mode:`xyz65`,x:.6369580483012911*t+.1446169035862083*n+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*n+.059301716469862*r,z:0*t+.0280726930490874*n+1.0609850577107909*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i},ji={...er,mode:`rec2020`,fromMode:{xyz65:Ei,rgb:e=>Ei(sr(e))},toMode:{xyz65:Ai,rgb:e=>ur(Ai(e))},parse:[`rec2020`],serialize:`rec2020`},Mi={mode:`xyz50`,parse:[`xyz-d50`],serialize:`xyz-d50`,toMode:{rgb:Rr,lab:Hr},fromMode:{rgb:Br,lab:Lr},channels:[`x`,`y`,`z`,`alpha`],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:N,y:N,z:N,alpha:{use:N,fixup:P}}},Ni={mode:`xyz65`,toMode:{rgb:ur,xyz50:e=>{let{x:t,y:n,z:r,alpha:i}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let a={mode:`xyz50`,x:1.0479298208405488*t+.0229467933410191*n-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*n-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*n+.7518742899580008*r};return i!==void 0&&(a.alpha=i),a}},fromMode:{rgb:sr,xyz50:e=>{let{x:t,y:n,z:r,alpha:i}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let a={mode:`xyz65`,x:.9554734527042182*t-.0230985368742614*n+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*n+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*n+1.3303659366080753*r};return i!==void 0&&(a.alpha=i),a}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:[`x`,`y`,`z`,`alpha`],parse:[`xyz`,`xyz-d65`],serialize:`xyz-d65`,interpolate:{x:N,y:N,z:N,alpha:{use:N,fixup:P}}};A(dr),A(wr),A(Dr),A(jr),A(Gr),A(ei),A(ii),A(ai),A(oi),A(fi),A(mi),A(_i),A(Si),A(ji),A(er),A(Mi),A(Ni);var Pi=[`borg-chat`,`grove`,`ocean`,`ember`,`iris`];[...Pi];var Fi=new Set([`system`,`light`,`dark`,...Pi,`borg-chat-dark`,`borg-grove`,`borg-ocean`,`borg-ember`,`borg-iris`]);[...Fi];var Ii=`canvas.chrome.toolbar.toolbarForeground.toolbarBorder.toolbarControl.toolbarControlForeground.toolbarControlHover.surface.surfaceRaised.surfaceOverlay.text.textMuted.border.input.focus.accent.accentForeground.secondary.secondaryForeground.muted.mutedForeground.placeholder.secondaryLabel.iconMuted.error.errorForeground.errorSurface.warning.warningForeground.warningSurface.update.updateForeground.updateSurface.accentSurface.accentSurfaceForeground.messageSurface.messageForeground.messageAction.messageActionForeground.messageActionHover.codeBackground.codeForeground.sidebar.sidebarForeground.sidebarMutedForeground.sidebarControlSurface.sidebarRowHover.sidebarRowActive.sidebarRowSelected.sidebarBorder.terminalBackground.terminalForeground.terminalCursor.terminalSelection.terminalScrollbar.terminalScrollbarHover`.split(`.`),Li={id:`borg-chat`,label:`Graphite`,appearance:`light`,colors:{canvas:`oklch(0.967305 0.006973 88.643)`,chrome:`oklch(0.967305 0.006973 88.643)`,toolbar:`oklch(0.967305 0.006973 88.643)`,toolbarForeground:`oklch(0.28288 0.005564 121.81)`,toolbarBorder:`oklch(0.875154 0.012391 96.442)`,toolbarControl:`oklch(0.923767 0.009429 99.992)`,toolbarControlForeground:`oklch(0.33504 0.014287 123.934)`,toolbarControlHover:`oklch(0.894953 0.016444 118.15)`,surface:`oklch(0.949505 0.009867 87.472)`,surfaceRaised:`oklch(0.984761 0.005388 95.098)`,surfaceOverlay:`oklch(0.994198 0.006926 88.641)`,text:`oklch(0.28288 0.005564 121.81)`,textMuted:`oklch(0.506561 0.013956 112.038)`,border:`oklch(0.875154 0.012391 96.442)`,input:`oklch(0.635931 0.020953 119.975)`,focus:`oklch(0.467482 0.036118 125.854)`,accent:`oklch(0.40824 0.026494 130.456)`,accentForeground:`oklch(0.984761 0.005388 95.098)`,secondary:`oklch(0.923767 0.009429 99.992)`,secondaryForeground:`oklch(0.33504 0.014287 123.934)`,muted:`oklch(0.923767 0.009429 99.992)`,mutedForeground:`oklch(0.498014 0.017214 115.393)`,placeholder:`oklch(0.531639 0.020132 117.647)`,secondaryLabel:`oklch(0.506561 0.013956 112.038)`,iconMuted:`oklch(0.506561 0.013956 112.038)`,error:`oklch(0.544498 0.147346 27.573)`,errorForeground:`oklch(0.453883 0.122534 27.472)`,errorSurface:`oklch(0.932481 0.020608 48.49)`,warning:`oklch(0.562999 0.105593 72.296)`,warningForeground:`oklch(0.465404 0.086604 70.276)`,warningSurface:`oklch(0.935601 0.033493 88.062)`,update:`oklch(0.467482 0.036118 125.854)`,updateForeground:`oklch(0.40824 0.026494 130.456)`,updateSurface:`oklch(0.918794 0.018951 116.598)`,accentSurface:`oklch(0.918794 0.018951 116.598)`,accentSurfaceForeground:`oklch(0.347999 0.025987 131.94)`,messageSurface:`oklch(0.929557 0.010736 100.831)`,messageForeground:`oklch(0.329854 0.016396 126.859)`,messageAction:`oklch(0.40824 0.026494 130.456)`,messageActionForeground:`oklch(0.984761 0.005388 95.098)`,messageActionHover:`oklch(0.347999 0.025987 131.94)`,codeBackground:`oklch(0.942697 0.009576 93.572)`,codeForeground:`oklch(0.390749 0.024758 129.191)`,sidebar:`oklch(0.927307 0.010913 95.17)`,sidebarForeground:`oklch(0.28288 0.005564 121.81)`,sidebarMutedForeground:`oklch(0.498014 0.017214 115.393)`,sidebarControlSurface:`oklch(0.967305 0.006973 88.643)`,sidebarRowHover:`oklch(0.898877 0.012157 101.499)`,sidebarRowActive:`oklch(0.88726 0.020634 118.973)`,sidebarRowSelected:`oklch(0.876759 0.02355 120.236)`,sidebarBorder:`oklch(0.848066 0.016339 106.743)`,terminalBackground:`oklch(0.967305 0.006973 88.643)`,terminalForeground:`oklch(0.28288 0.005564 121.81)`,terminalCursor:`oklch(0.467482 0.036118 125.854)`,terminalSelection:`oklch(0.88726 0.020634 118.973)`,terminalScrollbar:`oklch(0.784651 0.021259 119.04)`,terminalScrollbarHover:`oklch(0.67672 0.032824 123.554)`},variants:{dark:{canvas:`oklch(0.265063 0.007842 128.794)`,chrome:`oklch(0.265063 0.007842 128.794)`,toolbar:`oklch(0.265063 0.007842 128.794)`,toolbarForeground:`oklch(0.956713 0.01066 100.824)`,toolbarBorder:`oklch(0.378063 0.016973 135.055)`,toolbarControl:`oklch(0.336417 0.018393 129.087)`,toolbarControlForeground:`oklch(0.916021 0.017657 117.311)`,toolbarControlHover:`oklch(0.40824 0.026494 130.456)`,surface:`oklch(0.296042 0.011427 128.898)`,surfaceRaised:`oklch(0.326567 0.013284 131.624)`,surfaceOverlay:`oklch(0.310751 0.013445 131.648)`,text:`oklch(0.956713 0.01066 100.824)`,textMuted:`oklch(0.7609 0.01711 118.223)`,border:`oklch(0.378063 0.016973 135.055)`,input:`oklch(0.56794 0.025863 128.979)`,focus:`oklch(0.818675 0.023707 117.687)`,accent:`oklch(0.875763 0.020496 116.008)`,accentForeground:`oklch(0.270962 0.015018 124.134)`,secondary:`oklch(0.336417 0.018393 129.087)`,secondaryForeground:`oklch(0.916021 0.017657 117.311)`,muted:`oklch(0.340619 0.016796 131.118)`,mutedForeground:`oklch(0.805895 0.021387 121.922)`,placeholder:`oklch(0.744644 0.023457 123.762)`,secondaryLabel:`oklch(0.7609 0.01711 118.223)`,iconMuted:`oklch(0.7609 0.01711 118.223)`,error:`oklch(0.723352 0.107389 28.537)`,errorForeground:`oklch(0.814737 0.071441 31.682)`,errorSurface:`oklch(0.330826 0.040116 33.542)`,warning:`oklch(0.788566 0.098461 83.995)`,warningForeground:`oklch(0.84724 0.074694 82.68)`,warningSurface:`oklch(0.354719 0.027878 87.108)`,update:`oklch(0.818675 0.023707 117.687)`,updateForeground:`oklch(0.890798 0.02631 121.219)`,updateSurface:`oklch(0.364917 0.033638 128.57)`,accentSurface:`oklch(0.384111 0.031808 129.43)`,accentSurfaceForeground:`oklch(0.921784 0.023539 122.741)`,messageSurface:`oklch(0.340619 0.016796 131.118)`,messageForeground:`oklch(0.926162 0.016131 114.39)`,messageAction:`oklch(0.875763 0.020496 116.008)`,messageActionForeground:`oklch(0.270962 0.015018 124.134)`,messageActionHover:`oklch(0.924599 0.020228 115.98)`,codeBackground:`oklch(0.250841 0.011893 129.001)`,codeForeground:`oklch(0.888254 0.028576 126.846)`,sidebar:`oklch(0.236012 0.006377 134.962)`,sidebarForeground:`oklch(0.956713 0.01066 100.824)`,sidebarMutedForeground:`oklch(0.7609 0.01711 118.223)`,sidebarControlSurface:`oklch(0.29037 0.015273 129.062)`,sidebarRowHover:`oklch(0.323132 0.022225 129.256)`,sidebarRowActive:`oklch(0.372516 0.033491 128.539)`,sidebarRowSelected:`oklch(0.412036 0.037581 127.832)`,sidebarBorder:`oklch(0.356598 0.025285 129.282)`,terminalBackground:`oklch(0.265063 0.007842 128.794)`,terminalForeground:`oklch(0.956713 0.01066 100.824)`,terminalCursor:`oklch(0.818675 0.023707 117.687)`,terminalSelection:`oklch(0.412036 0.037581 127.832)`,terminalScrollbar:`oklch(0.484481 0.036279 127.601)`,terminalScrollbarHover:`oklch(0.590047 0.047186 128.137)`}},sidebarArtwork:!0},Ri={id:`grove`,label:`Grove`,appearance:`light`,colors:{canvas:`oklch(0.972369 0.005497 157.15)`,chrome:`oklch(0.972369 0.005497 157.15)`,toolbar:`oklch(0.972369 0.005497 157.15)`,toolbarForeground:`oklch(0.222003 0.03479 328.979)`,toolbarBorder:`oklch(0.909438 0.021521 164.612)`,toolbarControl:`oklch(0.936464 0.014601 163.554)`,toolbarControlForeground:`oklch(0.222003 0.03479 328.979)`,toolbarControlHover:`oklch(0.909438 0.021521 164.612)`,surface:`oklch(0.972369 0.005497 157.15)`,surfaceRaised:`oklch(0.949276 0.004496 159.002)`,surfaceOverlay:`oklch(0.932695 0.003778 160.944)`,text:`oklch(0.222003 0.03479 328.979)`,textMuted:`oklch(0.540472 0.014944 326.176)`,border:`oklch(0.864831 0.01312 167.255)`,input:`oklch(0.829746 0.016084 168.234)`,focus:`oklch(0.523295 0.112292 158.089)`,accent:`oklch(0.523295 0.112292 158.089)`,accentForeground:`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.936464 0.014601 163.554)`,secondaryForeground:`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.945455 0.012308 162.879)`,mutedForeground:`oklch(0.527266 0.012309 320.683)`,placeholder:`oklch(0.529681 0.01551 326.299)`,secondaryLabel:`oklch(0.540472 0.014944 326.176)`,iconMuted:`oklch(0.540472 0.014944 326.176)`,error:`oklch(0.637823 0.237287 25.436)`,errorForeground:`oklch(0.509494 0.208583 28.513)`,errorSurface:`oklch(0.936968 0.014243 26.295)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.545036 0.155019 45.359)`,warningSurface:`oklch(0.953175 0.02009 93.379)`,update:`oklch(0.523295 0.112292 158.089)`,updateForeground:`oklch(0.388012 0.080082 158.768)`,updateSurface:`oklch(0.900411 0.02384 164.795)`,accentSurface:`oklch(0.909438 0.021521 164.612)`,accentSurfaceForeground:`oklch(0.222003 0.03479 328.979)`,messageSurface:`oklch(0.891377 0.026164 164.929)`,messageForeground:`oklch(0.222003 0.03479 328.979)`,messageAction:`oklch(0.535028 0.106403 77.549)`,messageActionForeground:`oklch(0.990339 0.008411 325.64)`,messageActionHover:`oklch(0.488753 0.096536 77.829)`,codeBackground:`oklch(0.955888 0.004783 158.391)`,codeForeground:`oklch(0.222003 0.03479 328.979)`,sidebar:`oklch(0.936464 0.014601 163.554)`,sidebarForeground:`oklch(0.222003 0.03479 328.979)`,sidebarMutedForeground:`oklch(0.515606 0.011938 318.897)`,sidebarControlSurface:`oklch(0.88585 0.011734 166.331)`,sidebarRowHover:`oklch(0.886676 0.027374 164.983)`,sidebarRowActive:`oklch(0.85335 0.03597 165.158)`,sidebarRowSelected:`oklch(0.836654 0.040284 165.149)`,sidebarBorder:`oklch(0.860274 0.010287 168.339)`,terminalBackground:`oklch(0.972369 0.005497 157.15)`,terminalForeground:`oklch(0.222003 0.03479 328.979)`,terminalCursor:`oklch(0.523295 0.112292 158.089)`,terminalSelection:`oklch(0.891377 0.026164 164.929)`,terminalScrollbar:`oklch(0.824752 0.001392 294.641)`,terminalScrollbarHover:`oklch(0.755495 0.004415 318.776)`},variants:{dark:{canvas:`oklch(0.260865 0.02152 162.75)`,chrome:`oklch(0.260865 0.02152 162.75)`,toolbar:`oklch(0.260865 0.02152 162.75)`,toolbarForeground:`oklch(0.990339 0.008411 325.64)`,toolbarBorder:`oklch(0.464636 0.066083 158.72)`,toolbarControl:`oklch(0.380487 0.048313 159.608)`,toolbarControlForeground:`oklch(0.990339 0.008411 325.64)`,toolbarControlHover:`oklch(0.437021 0.060312 158.962)`,surface:`oklch(0.260865 0.02152 162.75)`,surfaceRaised:`oklch(0.363192 0.016572 165.32)`,surfaceOverlay:`oklch(0.411828 0.014378 166.627)`,text:`oklch(0.990339 0.008411 325.64)`,textMuted:`oklch(0.666747 0.004239 187.292)`,border:`oklch(0.457475 0.044046 160.971)`,input:`oklch(0.519849 0.049896 160.863)`,focus:`oklch(0.796228 0.133058 157.319)`,accent:`oklch(0.796228 0.133058 157.319)`,accentForeground:`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.380487 0.048313 159.608)`,secondaryForeground:`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.339728 0.039456 160.274)`,mutedForeground:`oklch(0.715427 0.010896 171.428)`,placeholder:`oklch(0.739243 0.002222 223.225)`,secondaryLabel:`oklch(0.666747 0.004239 187.292)`,iconMuted:`oklch(0.666747 0.004239 187.292)`,error:`oklch(0.655108 0.221148 23.473)`,errorForeground:`oklch(0.704237 0.187511 22.228)`,errorSurface:`oklch(0.312773 0.02923 32.121)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.829017 0.171221 81.038)`,warningSurface:`oklch(0.345524 0.046882 99.736)`,update:`oklch(0.796228 0.133058 157.319)`,updateForeground:`oklch(0.86276 0.089288 159.704)`,updateSurface:`oklch(0.448116 0.062637 158.86)`,accentSurface:`oklch(0.437021 0.060312 158.962)`,accentSurfaceForeground:`oklch(0.990339 0.008411 325.64)`,messageSurface:`oklch(0.470111 0.067221 158.676)`,messageForeground:`oklch(0.990339 0.008411 325.64)`,messageAction:`oklch(0.791603 0.129713 83.299)`,messageActionForeground:`oklch(0.222003 0.03479 328.979)`,messageActionHover:`oklch(0.815227 0.117902 84.21)`,codeBackground:`oklch(0.312979 0.018942 164.082)`,codeForeground:`oklch(0.990339 0.008411 325.64)`,sidebar:`oklch(0.309925 0.032827 160.944)`,sidebarForeground:`oklch(0.990339 0.008411 325.64)`,sidebarMutedForeground:`oklch(0.711387 0.007643 175.89)`,sidebarControlSurface:`oklch(0.432727 0.024549 163.654)`,sidebarRowHover:`oklch(0.374959 0.047124 159.686)`,sidebarRowActive:`oklch(0.41688 0.056069 159.165)`,sidebarRowSelected:`oklch(0.437466 0.060406 158.958)`,sidebarBorder:`oklch(0.569253 0.015933 167.062)`,terminalBackground:`oklch(0.260865 0.02152 162.75)`,terminalForeground:`oklch(0.990339 0.008411 325.64)`,terminalCursor:`oklch(0.796228 0.133058 157.319)`,terminalSelection:`oklch(0.464636 0.066083 158.72)`,terminalScrollbar:`oklch(0.594692 0.006862 176.022)`,terminalScrollbarHover:`oklch(0.687968 0.00354 193.55)`}},sidebarArtwork:!0},zi={id:`ocean`,label:`Ocean`,appearance:`light`,colors:{canvas:`oklch(0.974199 0.002856 241.597)`,chrome:`oklch(0.974199 0.002856 241.597)`,toolbar:`oklch(0.974199 0.002856 241.597)`,toolbarForeground:`oklch(0.222003 0.03479 328.979)`,toolbarBorder:`oklch(0.91295 0.018827 241.836)`,toolbarControl:`oklch(0.939254 0.01193 241.729)`,toolbarControlForeground:`oklch(0.222003 0.03479 328.979)`,toolbarControlHover:`oklch(0.91295 0.018827 241.836)`,surface:`oklch(0.974199 0.002856 241.597)`,surfaceRaised:`oklch(0.951058 0.002962 258.339)`,surfaceOverlay:`oklch(0.934442 0.003181 269.1)`,text:`oklch(0.222003 0.03479 328.979)`,textMuted:`oklch(0.541555 0.017468 323.531)`,border:`oklch(0.867646 0.013482 252.362)`,input:`oklch(0.832939 0.017389 252.598)`,focus:`oklch(0.536684 0.120219 247.01)`,accent:`oklch(0.536684 0.120219 247.01)`,accentForeground:`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.939254 0.01193 241.729)`,secondaryForeground:`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.948004 0.009649 241.695)`,mutedForeground:`oklch(0.528741 0.01828 313.823)`,placeholder:`oklch(0.530733 0.01795 323.79)`,secondaryLabel:`oklch(0.541555 0.017468 323.531)`,iconMuted:`oklch(0.541555 0.017468 323.531)`,error:`oklch(0.637823 0.237287 25.436)`,errorForeground:`oklch(0.509494 0.208583 28.513)`,errorSurface:`oklch(0.938747 0.016377 7.186)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.546927 0.155556 45.359)`,warningSurface:`oklch(0.954846 0.016009 81.731)`,update:`oklch(0.536684 0.120219 247.01)`,updateForeground:`oklch(0.397497 0.084999 246.523)`,updateSurface:`oklch(0.904165 0.021144 241.874)`,accentSurface:`oklch(0.91295 0.018827 241.836)`,accentSurfaceForeground:`oklch(0.222003 0.03479 328.979)`,messageSurface:`oklch(0.895373 0.023469 241.913)`,messageForeground:`oklch(0.222003 0.03479 328.979)`,messageAction:`oklch(0.493961 0.08175 201.584)`,messageActionForeground:`oklch(0.990339 0.008411 325.64)`,messageActionHover:`oklch(0.45151 0.074407 201.516)`,codeBackground:`oklch(0.957684 0.002906 253.68)`,codeForeground:`oklch(0.222003 0.03479 328.979)`,sidebar:`oklch(0.939254 0.01193 241.729)`,sidebarForeground:`oklch(0.222003 0.03479 328.979)`,sidebarMutedForeground:`oklch(0.517366 0.018944 311.433)`,sidebarControlSurface:`oklch(0.888479 0.011475 251.638)`,sidebarRowHover:`oklch(0.890798 0.024681 241.933)`,sidebarRowActive:`oklch(0.858363 0.033325 242.089)`,sidebarRowSelected:`oklch(0.842113 0.037689 242.174)`,sidebarBorder:`oklch(0.862823 0.011384 256.926)`,terminalBackground:`oklch(0.974199 0.002856 241.597)`,terminalForeground:`oklch(0.222003 0.03479 328.979)`,terminalCursor:`oklch(0.536684 0.120219 247.01)`,terminalSelection:`oklch(0.895373 0.023469 241.913)`,terminalScrollbar:`oklch(0.826271 0.006191 305.456)`,terminalScrollbarHover:`oklch(0.756866 0.008685 313.721)`},variants:{dark:{canvas:`oklch(0.242641 0.024125 250.573)`,chrome:`oklch(0.242641 0.024125 250.573)`,toolbar:`oklch(0.242641 0.024125 250.573)`,toolbarForeground:`oklch(0.990339 0.008411 325.64)`,toolbarBorder:`oklch(0.439946 0.0561 243.479)`,toolbarControl:`oklch(0.358725 0.043145 244.911)`,toolbarControlForeground:`oklch(0.990339 0.008411 325.64)`,toolbarControlHover:`oklch(0.413315 0.051874 243.855)`,surface:`oklch(0.242641 0.024125 250.573)`,surfaceRaised:`oklch(0.348439 0.019942 253.696)`,surfaceOverlay:`oklch(0.398517 0.018232 255.72)`,text:`oklch(0.990339 0.008411 325.64)`,textMuted:`oklch(0.652227 0.01149 273.31)`,border:`oklch(0.438653 0.039496 245.44)`,input:`oklch(0.500905 0.043574 244.781)`,focus:`oklch(0.758933 0.105833 241.548)`,accent:`oklch(0.758933 0.105833 241.548)`,accentForeground:`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.358725 0.043145 244.911)`,secondaryForeground:`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.319287 0.036766 246.065)`,mutedForeground:`oklch(0.691936 0.016294 261.588)`,placeholder:`oklch(0.721641 0.010192 281.271)`,secondaryLabel:`oklch(0.652227 0.01149 273.31)`,iconMuted:`oklch(0.652227 0.01149 273.31)`,error:`oklch(0.655108 0.221148 23.473)`,errorForeground:`oklch(0.702184 0.189226 22.228)`,errorSurface:`oklch(0.298933 0.036443 350.094)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.829017 0.171221 81.038)`,warningSurface:`oklch(0.329449 0.028712 84.495)`,update:`oklch(0.758933 0.105833 241.548)`,updateForeground:`oklch(0.840844 0.069217 240.151)`,updateSurface:`oklch(0.424017 0.053575 243.695)`,accentSurface:`oklch(0.413315 0.051874 243.855)`,accentSurfaceForeground:`oklch(0.990339 0.008411 325.64)`,messageSurface:`oklch(0.445224 0.056936 243.413)`,messageForeground:`oklch(0.990339 0.008411 325.64)`,messageAction:`oklch(0.793363 0.105022 199.893)`,messageActionForeground:`oklch(0.222003 0.03479 328.979)`,messageActionHover:`oklch(0.815308 0.096174 199.862)`,codeBackground:`oklch(0.29661 0.021883 251.968)`,codeForeground:`oklch(0.990339 0.008411 325.64)`,sidebar:`oklch(0.290387 0.032043 247.274)`,sidebarForeground:`oklch(0.990339 0.008411 325.64)`,sidebarMutedForeground:`oklch(0.69099 0.01395 266.424)`,sidebarControlSurface:`oklch(0.417822 0.02535 250.162)`,sidebarRowHover:`oklch(0.353381 0.042285 245.043)`,sidebarRowActive:`oklch(0.393878 0.048778 244.179)`,sidebarRowSelected:`oklch(0.413744 0.051943 243.848)`,sidebarBorder:`oklch(0.55859 0.019001 256.223)`,terminalBackground:`oklch(0.242641 0.024125 250.573)`,terminalForeground:`oklch(0.990339 0.008411 325.64)`,terminalCursor:`oklch(0.758933 0.105833 241.548)`,terminalSelection:`oklch(0.439946 0.0561 243.479)`,terminalScrollbar:`oklch(0.58613 0.012959 267.22)`,terminalScrollbarHover:`oklch(0.681569 0.010909 276.465)`}},sidebarArtwork:!0},Bi={id:`ember`,label:`Ember`,appearance:`light`,colors:{canvas:`oklch(0.976527 0.002685 60.725)`,chrome:`oklch(0.976527 0.002685 60.725)`,toolbar:`oklch(0.976527 0.002685 60.725)`,toolbarForeground:`oklch(0.222003 0.03479 328.979)`,toolbarBorder:`oklch(0.916502 0.01832 49.597)`,toolbarControl:`oklch(0.942267 0.01151 50.785)`,toolbarControlForeground:`oklch(0.222003 0.03479 328.979)`,toolbarControlHover:`oklch(0.916502 0.01832 49.597)`,surface:`oklch(0.976527 0.002685 60.725)`,surfaceRaised:`oklch(0.953321 0.002701 42.266)`,surfaceOverlay:`oklch(0.936659 0.002879 29.96)`,text:`oklch(0.222003 0.03479 328.979)`,textMuted:`oklch(0.543023 0.017316 331.964)`,border:`oklch(0.870631 0.013204 39.431)`,input:`oklch(0.836213 0.017153 38.661)`,focus:`oklch(0.552831 0.129438 44.656)`,accent:`oklch(0.552831 0.129438 44.656)`,accentForeground:`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.942267 0.01151 50.785)`,secondaryForeground:`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.950842 0.009273 51.528)`,mutedForeground:`oklch(0.530413 0.018453 341.181)`,placeholder:`oklch(0.532339 0.017796 331.748)`,secondaryLabel:`oklch(0.543023 0.017316 331.964)`,iconMuted:`oklch(0.543023 0.017316 331.964)`,error:`oklch(0.637823 0.237287 25.436)`,errorForeground:`oklch(0.509494 0.208583 28.513)`,errorSurface:`oklch(0.941094 0.019938 19.375)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.549154 0.156188 45.359)`,warningSurface:`oklch(0.957148 0.020843 76.702)`,update:`oklch(0.552831 0.129438 44.656)`,updateForeground:`oklch(0.408647 0.091207 45.037)`,updateSurface:`oklch(0.907902 0.020621 49.36)`,accentSurface:`oklch(0.916502 0.01832 49.597)`,accentSurfaceForeground:`oklch(0.222003 0.03479 328.979)`,messageSurface:`oklch(0.899296 0.022939 49.163)`,messageForeground:`oklch(0.222003 0.03479 328.979)`,messageAction:`oklch(0.516323 0.161628 24.82)`,messageActionForeground:`oklch(0.990339 0.008411 325.64)`,messageActionHover:`oklch(0.471223 0.145843 24.688)`,codeBackground:`oklch(0.959965 0.002668 47.512)`,codeForeground:`oklch(0.222003 0.03479 328.979)`,sidebar:`oklch(0.942267 0.01151 50.785)`,sidebarForeground:`oklch(0.222003 0.03479 328.979)`,sidebarMutedForeground:`oklch(0.519146 0.019214 343.427)`,sidebarControlSurface:`oklch(0.891332 0.011179 40.596)`,sidebarRowHover:`oklch(0.894819 0.024151 49.073)`,sidebarRowActive:`oklch(0.863104 0.032855 48.586)`,sidebarRowSelected:`oklch(0.84723 0.037292 48.403)`,sidebarBorder:`oklch(0.865593 0.011154 35.246)`,terminalBackground:`oklch(0.976527 0.002685 60.725)`,terminalForeground:`oklch(0.222003 0.03479 328.979)`,terminalCursor:`oklch(0.552831 0.129438 44.656)`,terminalSelection:`oklch(0.899296 0.022939 49.163)`,terminalScrollbar:`oklch(0.828185 0.005884 349.533)`,terminalScrollbarHover:`oklch(0.758584 0.008423 341.16)`},variants:{dark:{canvas:`oklch(0.245899 0.019144 42.044)`,chrome:`oklch(0.245899 0.019144 42.044)`,toolbar:`oklch(0.245899 0.019144 42.044)`,toolbarForeground:`oklch(0.990339 0.008411 325.64)`,toolbarBorder:`oklch(0.442681 0.0608 50.795)`,toolbarControl:`oklch(0.361499 0.044052 49.515)`,toolbarControlForeground:`oklch(0.990339 0.008411 325.64)`,toolbarControlHover:`oklch(0.416048 0.055354 50.484)`,surface:`oklch(0.245899 0.019144 42.044)`,surfaceRaised:`oklch(0.351262 0.01565 37.592)`,surfaceOverlay:`oklch(0.401111 0.014308 34.896)`,text:`oklch(0.990339 0.008411 325.64)`,textMuted:`oklch(0.654017 0.009505 13.287)`,border:`oklch(0.44099 0.040202 48.807)`,input:`oklch(0.503003 0.045721 49.44)`,focus:`oklch(0.762174 0.124117 52.082)`,accent:`oklch(0.762174 0.124117 52.082)`,accentForeground:`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.361499 0.044052 49.515)`,secondaryForeground:`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.322144 0.03574 48.309)`,mutedForeground:`oklch(0.692479 0.015227 30.963)`,placeholder:`oklch(0.723533 0.008741 4.515)`,secondaryLabel:`oklch(0.654017 0.009505 13.287)`,iconMuted:`oklch(0.654017 0.009505 13.287)`,error:`oklch(0.655108 0.221148 23.473)`,errorForeground:`oklch(0.702184 0.189226 22.228)`,errorSurface:`oklch(0.310955 0.059624 24.334)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.829017 0.171221 81.038)`,warningSurface:`oklch(0.339137 0.055638 66.911)`,update:`oklch(0.762174 0.124117 52.082)`,updateForeground:`oklch(0.841456 0.079585 53.521)`,updateSurface:`oklch(0.426749 0.057547 50.618)`,accentSurface:`oklch(0.416048 0.055354 50.484)`,accentSurfaceForeground:`oklch(0.990339 0.008411 325.64)`,messageSurface:`oklch(0.447961 0.061874 50.849)`,messageForeground:`oklch(0.990339 0.008411 325.64)`,messageAction:`oklch(0.747955 0.135578 29.432)`,messageActionForeground:`oklch(0.222003 0.03479 328.979)`,messageActionHover:`oklch(0.775116 0.117953 29.014)`,codeBackground:`oklch(0.299662 0.017229 39.973)`,codeForeground:`oklch(0.990339 0.008411 325.64)`,sidebar:`oklch(0.293349 0.029554 46.882)`,sidebarForeground:`oklch(0.990339 0.008411 325.64)`,sidebarMutedForeground:`oklch(0.691874 0.012538 24.638)`,sidebarControlSurface:`oklch(0.420227 0.022893 43.226)`,sidebarRowHover:`oklch(0.356163 0.042933 49.385)`,sidebarRowActive:`oklch(0.396617 0.051353 50.201)`,sidebarRowSelected:`oklch(0.416477 0.055442 50.489)`,sidebarBorder:`oklch(0.560372 0.016998 36.179)`,terminalBackground:`oklch(0.245899 0.019144 42.044)`,terminalForeground:`oklch(0.990339 0.008411 325.64)`,terminalCursor:`oklch(0.762174 0.124117 52.082)`,terminalSelection:`oklch(0.442681 0.0608 50.795)`,terminalScrollbar:`oklch(0.587861 0.010463 20.444)`,terminalScrollbarHover:`oklch(0.682876 0.009156 9.796)`}},sidebarArtwork:!0},Vi={id:`iris`,label:`Iris`,appearance:`light`,colors:{canvas:`oklch(0.976531 0.003855 303.226)`,chrome:`oklch(0.976531 0.003855 303.226)`,toolbar:`oklch(0.976531 0.003855 303.226)`,toolbarForeground:`oklch(0.222003 0.03479 328.979)`,toolbarBorder:`oklch(0.914882 0.022965 299.986)`,toolbarControl:`oklch(0.941387 0.014687 300.474)`,toolbarControlForeground:`oklch(0.222003 0.03479 328.979)`,toolbarControlHover:`oklch(0.914882 0.022965 299.986)`,surface:`oklch(0.976531 0.003855 303.226)`,surfaceRaised:`oklch(0.953326 0.004536 307.676)`,surfaceOverlay:`oklch(0.936665 0.005041 310.132)`,text:`oklch(0.222003 0.03479 328.979)`,textMuted:`oklch(0.543042 0.018894 325.652)`,border:`oklch(0.869608 0.018226 303.859)`,input:`oklch(0.834773 0.023405 303.676)`,focus:`oklch(0.525348 0.15373 294.176)`,accent:`oklch(0.525348 0.15373 294.176)`,accentForeground:`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.941387 0.014687 300.474)`,secondaryForeground:`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.950194 0.011956 300.733)`,mutedForeground:`oklch(0.529955 0.022319 321.556)`,placeholder:`oklch(0.532177 0.019333 325.784)`,secondaryLabel:`oklch(0.543042 0.018894 325.652)`,iconMuted:`oklch(0.543042 0.018894 325.652)`,error:`oklch(0.637823 0.237287 25.436)`,errorForeground:`oklch(0.509494 0.208583 28.513)`,errorSurface:`oklch(0.941043 0.019582 4.235)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.549154 0.156188 45.359)`,warningSurface:`oklch(0.957054 0.016197 69.932)`,update:`oklch(0.525348 0.15373 294.176)`,updateForeground:`oklch(0.389926 0.10825 294.547)`,updateSurface:`oklch(0.90602 0.025754 299.867)`,accentSurface:`oklch(0.914882 0.022965 299.986)`,accentSurfaceForeground:`oklch(0.222003 0.03479 328.979)`,messageSurface:`oklch(0.897143 0.028558 299.758)`,messageForeground:`oklch(0.222003 0.03479 328.979)`,messageAction:`oklch(0.516084 0.185229 340.776)`,messageActionForeground:`oklch(0.990339 0.008411 325.64)`,messageActionHover:`oklch(0.471003 0.16748 340.687)`,codeBackground:`oklch(0.95997 0.004338 306.542)`,codeForeground:`oklch(0.222003 0.03479 328.979)`,sidebar:`oklch(0.941387 0.014687 300.474)`,sidebarForeground:`oklch(0.222003 0.03479 328.979)`,sidebarMutedForeground:`oklch(0.518417 0.023683 320.681)`,sidebarControlSurface:`oklch(0.890512 0.0155 303.803)`,sidebarRowHover:`oklch(0.892522 0.030022 299.704)`,sidebarRowActive:`oklch(0.85971 0.040501 299.36)`,sidebarRowSelected:`oklch(0.843236 0.045818 299.198)`,sidebarBorder:`oklch(0.864805 0.015938 305.371)`,terminalBackground:`oklch(0.976531 0.003855 303.226)`,terminalForeground:`oklch(0.222003 0.03479 328.979)`,terminalCursor:`oklch(0.525348 0.15373 294.176)`,terminalSelection:`oklch(0.897143 0.028558 299.758)`,terminalScrollbar:`oklch(0.828195 0.008526 318.858)`,terminalScrollbarHover:`oklch(0.758596 0.010892 321.538)`},variants:{dark:{canvas:`oklch(0.225975 0.031062 293.741)`,chrome:`oklch(0.225975 0.031062 293.741)`,toolbar:`oklch(0.225975 0.031062 293.741)`,toolbarForeground:`oklch(0.990339 0.008411 325.64)`,toolbarBorder:`oklch(0.395417 0.085554 294.182)`,toolbarControl:`oklch(0.325405 0.063614 294.23)`,toolbarControlForeground:`oklch(0.990339 0.008411 325.64)`,toolbarControlHover:`oklch(0.372436 0.07841 294.204)`,surface:`oklch(0.225975 0.031062 293.741)`,surfaceRaised:`oklch(0.335291 0.026008 296.394)`,surfaceOverlay:`oklch(0.386739 0.024023 297.509)`,text:`oklch(0.990339 0.008411 325.64)`,textMuted:`oklch(0.640465 0.016197 304.171)`,border:`oklch(0.40874 0.058536 295.893)`,input:`oklch(0.46756 0.065775 296.265)`,focus:`oklch(0.671712 0.169136 293.929)`,accent:`oklch(0.671712 0.169136 293.929)`,accentForeground:`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.325405 0.063614 294.23)`,secondaryForeground:`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.291515 0.05276 294.209)`,mutedForeground:`oklch(0.663321 0.025932 301.862)`,placeholder:`oklch(0.706249 0.014508 306.607)`,secondaryLabel:`oklch(0.640465 0.016197 304.171)`,iconMuted:`oklch(0.640465 0.016197 304.171)`,error:`oklch(0.655108 0.221148 23.473)`,errorForeground:`oklch(0.702184 0.189226 22.228)`,errorSurface:`oklch(0.291658 0.054707 352.238)`,warning:`oklch(0.772406 0.172798 65.367)`,warningForeground:`oklch(0.829017 0.171221 81.038)`,warningSurface:`oklch(0.318952 0.033845 51.646)`,update:`oklch(0.671712 0.169136 293.929)`,updateForeground:`oklch(0.785032 0.108439 296.344)`,updateSurface:`oklch(0.381668 0.081286 294.195)`,accentSurface:`oklch(0.372436 0.07841 294.204)`,accentSurfaceForeground:`oklch(0.990339 0.008411 325.64)`,messageSurface:`oklch(0.399975 0.086965 294.177)`,messageForeground:`oklch(0.990339 0.008411 325.64)`,messageAction:`oklch(0.789904 0.130063 337.621)`,messageActionForeground:`oklch(0.222003 0.03479 328.979)`,messageActionHover:`oklch(0.813537 0.114101 337.23)`,codeBackground:`oklch(0.281873 0.028308 295.193)`,codeForeground:`oklch(0.990339 0.008411 325.64)`,sidebar:`oklch(0.266743 0.044689 294.138)`,sidebarForeground:`oklch(0.990339 0.008411 325.64)`,sidebarMutedForeground:`oklch(0.668773 0.021522 302.949)`,sidebarControlSurface:`oklch(0.399977 0.035678 297.031)`,sidebarRowHover:`oklch(0.320808 0.062152 294.23)`,sidebarRowActive:`oklch(0.355677 0.073167 294.217)`,sidebarRowSelected:`oklch(0.372806 0.078525 294.203)`,sidebarBorder:`oklch(0.545895 0.027522 299.871)`,terminalBackground:`oklch(0.225975 0.031062 293.741)`,terminalForeground:`oklch(0.990339 0.008411 325.64)`,terminalCursor:`oklch(0.671712 0.169136 293.929)`,terminalSelection:`oklch(0.395417 0.085554 294.182)`,terminalScrollbar:`oklch(0.578663 0.017888 302.229)`,terminalScrollbarHover:`oklch(0.676012 0.015271 305.433)`}},sidebarArtwork:!0},Hi=[Li,Ri,zi,Bi,Vi];function Ui(e,t){return e.appearance===t?e.colors:e.variants?.[t]??null}var Wi=`borg-chat`;Li.label;var Gi=`grove`,Ki=`ocean`,qi=`ember`,Ji=`iris`,Yi=`borgcode:themes:v1`,Xi=`borgcode:theme-follow-system`,Zi=`borgcode:theme-appearance-mode`,I=`borgcode:theme-halves:v1`,Qi=`borg-chat-dark`,$i=_,ea=new Set(Ii),ta=[],na=new Set,ra=null,ia=new Set,aa=null;function oa(){return aa}function sa(e){return ia.add(e),()=>ia.delete(e)}function ca(e){if(aa!==e){aa=e;for(let e of ia)e()}}function L(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function la(e){return e===`light`||e===`dark`}function ua(e){return typeof e==`string`&&qa(e)!==null}function da(e){return typeof e==`string`&&/^[a-z0-9](?:[a-z0-9-]{0,47})$/.test(e)}function fa(e){return typeof e==`string`&&e.trim().length>0&&e.trim().length<=48}function pa(e){return L(e)&&typeof e.id==`string`&&/^[a-z0-9][a-z0-9.:-]{0,127}$/i.test(e.id)&&fa(e.label)?{id:e.id,label:e.label.trim()}:void 0}function ma(e){let t={};for(let[n,r]of Object.entries(e)){let e=qa(r);ea.has(n)&&e&&(t[n]=e)}return t}function ha(e,t){return L(e)?{...ho(t),...ma(e)}:null}function ga(e,t){if(e===void 0)return;if(!L(e))return null;let n={};for(let[r,i]of Object.entries(e)){if(!la(r))return null;if(r===t)continue;let e=ha(i,r);if(!e)return null;n[r]=e}return Object.keys(n).length>0?n:void 0}function _a(e){if(!L(e)||!da(e.id)||Fi.has(e.id)||!fa(e.label)||!la(e.appearance))return null;let t=ha(e.colors,e.appearance);if(!t)return null;let n=ga(e.variants,e.appearance);if(e.variants!==void 0&&n===null)return null;let r=pa(e.collection);return{id:e.id,label:e.label.trim(),appearance:e.appearance,colors:t,...n?{variants:n}:{},...r?{collection:r}:{},...e.managed===!0?{managed:!0}:{}}}function va(e){let t=[];for(let n of e){let e=_a(n);e&&!t.some(t=>t.id===e.id)&&t.push(e)}return t}function ya(){if(typeof window>`u`)return{status:`ready`,storedThemes:[],themes:[]};let e;try{e=window.localStorage.getItem(Yi)}catch(e){return{status:`unavailable`,reason:`storage-unavailable`,cause:e}}if(!e)return{status:`ready`,storedThemes:[],themes:[]};let t;try{t=JSON.parse(e)}catch{return{status:`unavailable`,reason:`malformed`}}return Array.isArray(t)?{status:`ready`,storedThemes:t,themes:va(t)}:{status:`unavailable`,reason:`malformed`}}function ba(){return ra===null&&(ra=ya()),ra}function xa(){for(let e of na)e()}function Sa(){ra=null,xa()}function Ca(){let e=ba();return e.status===`ready`?e.themes:[]}function wa(){return ta}function Ta(e){return be(ta,e)?!1:(ta=e,xa(),!0)}function Ea(e){return Fi.has(e)}function Da(e){return Do().themes.filter(t=>t.collection?.id===e)}function Oa(e){if(na.add(e),typeof window>`u`)return()=>na.delete(e);let t=e=>{(e.key===`borgcode:themes:v1`||e.key===null)&&Sa()};return window.addEventListener(`storage`,t),()=>{na.delete(e),window.removeEventListener(`storage`,t)}}var ka={[Qi]:Wi,"borg-grove":Gi,"borg-ocean":Ki,"borg-ember":qi,"borg-iris":Ji};function Aa(e){return ka[e]??e}function ja(e){return e===Qi?e:Aa(e)}function Ma(e){return Aa(e)}function Na(e){return e===Qi?`dark`:null}var Pa={canvas:`#fdfdfd`,chrome:`#eaf2f7`,toolbar:`#fdfdfd`,toolbarForeground:`#0b0f19`,toolbarBorder:`#ebebec`,toolbarControl:`#f7f8fa`,toolbarControlForeground:`#0b0f19`,toolbarControlHover:`#f2f2f3`,surface:`#ffffff`,surfaceRaised:`#ffffff`,surfaceOverlay:`#ffffff`,text:`#0b0f19`,textMuted:`#6b7280`,border:`#ebebec`,input:`#dbdcdd`,focus:`#7552b0`,accent:`#936bda`,accentForeground:`#ffffff`,secondary:`#f7f8fa`,secondaryForeground:`#0b0f19`,muted:`#f7f8fa`,mutedForeground:`#6b7280`,placeholder:`#6b7280`,secondaryLabel:`#545454`,iconMuted:`#6b7280`,error:`#ef4444`,errorForeground:`#b42318`,errorSurface:`#fceeee`,warning:`#e0a63c`,warningForeground:`#956416`,warningSurface:`#faf4ea`,update:`#936bda`,updateForeground:`#7552b0`,updateSurface:`#f1edf9`,accentSurface:`#f2f2f3`,accentSurfaceForeground:`#0b0f19`,messageSurface:`#f1edf9`,messageForeground:`#0b0f19`,messageAction:`#242832`,messageActionForeground:`#ffffff`,messageActionHover:`#3c3f49`,codeBackground:`#f7f8fa`,codeForeground:`#0b0f19`,sidebar:`#eaf2f7`,sidebarForeground:`#0b0f19`,sidebarMutedForeground:`#646b77`,sidebarControlSurface:`#ffffff`,sidebarRowHover:`#e0e8ed`,sidebarRowActive:`#dae2e8`,sidebarRowSelected:`#e0e3f4`,sidebarBorder:`#d9e1e6`,terminalBackground:`#fdfdfd`,terminalForeground:`#0b0f19`,terminalCursor:`#936bda`,terminalSelection:`#e1d5f0`,terminalScrollbar:`#dbdcdd`,terminalScrollbarHover:`#c9cacc`},Fa={canvas:`#171619`,chrome:`#0d0c0f`,toolbar:`#171619`,toolbarForeground:`#f7f6f2`,toolbarBorder:`#28272b`,toolbarControl:`#141317`,toolbarControlForeground:`#f7f6f2`,toolbarControlHover:`#252429`,surface:`#171619`,surfaceRaised:`#201e23`,surfaceOverlay:`#171619`,text:`#f7f6f2`,textMuted:`#a09ca4`,border:`#28272b`,input:`#38373c`,focus:`#be9dec`,accent:`#936bda`,accentForeground:`#ffffff`,secondary:`#141317`,secondaryForeground:`#f7f6f2`,muted:`#141317`,mutedForeground:`#a09ca4`,placeholder:`#a09ca4`,secondaryLabel:`#c4c1c6`,iconMuted:`#a09ca4`,error:`#f26d6d`,errorForeground:`#ff9a94`,errorSurface:`#3a2426`,warning:`#e0a63c`,warningForeground:`#e7bd7c`,warningSurface:`#373022`,update:`#936bda`,updateForeground:`#be9dec`,updateSurface:`#2b2338`,accentSurface:`#252429`,accentSurfaceForeground:`#f7f6f2`,messageSurface:`#2b2338`,messageForeground:`#f7f6f2`,messageAction:`#f7f6f2`,messageActionForeground:`#19171d`,messageActionHover:`#dedbd3`,codeBackground:`#141317`,codeForeground:`#f7f6f2`,sidebar:`#0d0c0f`,sidebarForeground:`#f7f6f2`,sidebarMutedForeground:`#a09ca4`,sidebarControlSurface:`#201e23`,sidebarRowHover:`#1b1a1e`,sidebarRowActive:`#252327`,sidebarRowSelected:`#221b2f`,sidebarBorder:`#1f1e23`,terminalBackground:`#171619`,terminalForeground:`#f7f6f2`,terminalCursor:`#936bda`,terminalSelection:`#4b365f`,terminalScrollbar:`#38373c`,terminalScrollbarHover:`#4b4950`};function Ia(e){return e===`dark`?Ra??=Za(Fa):La??=Za(Pa)}var La,Ra,za={r:255,g:250,b:255},Ba={r:36,g:21,b:35},Va={r:255,g:255,b:255},Ha={r:0,g:0,b:0},Ua=kn(`oklch`);function Wa(e){if(typeof e!=`string`)return null;let t=e.trim(),n=Yn(t);if(!n)return null;let r=Ua(n),i=r.l??0,a=r.c??0,o=r.h??0,s=/\/\s*none\s*\)$/i.test(t)?0:r.alpha??1;return[i,a,o,s].every(Number.isFinite)?{color:{L:Math.min(1,Math.max(0,i)),C:Math.max(0,a),h:o},alpha:Math.min(1,Math.max(0,s))}:null}function Ga(e,t){return(Math.abs(e)<10**-t/2?0:e).toFixed(t).replace(/(?:\.0+|(?:(\.[0-9]*?)0+))$/,`$1`)}function Ka(e,t=1){let n=e.C<5e-7?0:(e.h%360+360)%360,r=`${Ga(e.L,6)} ${Ga(e.C,6)} ${Ga(n,3)}`;return t<1?`oklch(${r} / ${Ga(t,4)})`:`oklch(${r})`}function qa(e){let t=Wa(e);return t?Ka(t.color,t.alpha):null}function Ja(e){let t=Wa(e),n=t?{rgb:V(t.color),alpha:t.alpha}:null;if(!n)return null;let r=Xa(n.rgb);return n.alpha>=1?r:`${r}${Math.round(n.alpha*255).toString(16).padStart(2,`0`)}`}function Ya(e,t){let n=Wa(e);return n?V(n.color):t}function Xa(e){return`#${[e.r,e.g,e.b].map(e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,`0`)).join(``)}`}function R(e){return Ka(to(e))}function Za(e){return Object.fromEntries(Ii.map(t=>{let n=qa(e[t]);if(!n)throw Error(`The color for "${t}" must be a literal CSS color such as oklch(0.62 0.2 280).`);return[t,n]}))}function Qa(e){return{...e,colors:Za(e.colors),...e.variants?{variants:Object.fromEntries(Object.entries(e.variants).map(([e,t])=>[e,Za(t)]))}:{}}}function z(e,t,n){return{r:e.r+(t.r-e.r)*n,g:e.g+(t.g-e.g)*n,b:e.b+(t.b-e.b)*n}}function B(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function $a(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function eo(e){let t=e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055;return Math.round(Math.min(1,Math.max(0,t))*255)}function to(e){let t=$a(e.r),n=$a(e.g),r=$a(e.b),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),o=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o;return{L:s,C:Math.hypot(c,l),h:Math.atan2(l,c)*180/Math.PI}}function no({L:e,C:t,h:n}){let r=n*Math.PI/180,i=t*Math.cos(r),a=t*Math.sin(r),o=(e+.3963377774*i+.2158037573*a)**3,s=(e-.1055613458*i-.0638541728*a)**3,c=(e-.0894841775*i-1.291485548*a)**3;return{r:4.0767416621*o-3.3077115913*s+.2309699292*c,g:-1.2684380046*o+2.6097574011*s-.3413193965*c,b:-.0041960863*o-.7034186147*s+1.707614701*c}}function ro(e){let t=t=>{let n=no({...e,C:t});return[n.r,n.g,n.b].every(e=>e>=-1e-4&&e<=1.0001)};if(t(e.C))return e;let n=0,r=e.C,i=1e-6,a=Math.max(1,Math.ceil(Math.log2(Math.max(e.C,i))-Math.log2(i)));for(let e=0;e<a;e+=1){let e=(n+r)/2;t(e)?n=e:r=e}return{...e,C:n}}function V(e){let t=no(ro(e));return{r:eo(t.r),g:eo(t.g),b:eo(t.b)}}function io(e){return Ka(ro(e))}function ao(e,t,n,r){let i=r===`lighter`?e.L:0,a=r===`lighter`?1:e.L,o={...e};if(H(V(o),t)>=n)return o;for(let s=0;s<18;s+=1){let s=(i+a)/2;o={...e,L:s},H(V(o),t)>=n?r===`lighter`?a=s:i=s:r===`lighter`?i=s:a=s}return{...e,L:r===`lighter`?a:i}}var oo={light:{error:`#fb2c36`,errorForeground:`#c10007`,warning:`#fe9a00`,warningForeground:`#bb4d00`},dark:{error:`#fb414a`,errorForeground:`#ff6467`,warning:`#fe9a00`,warningForeground:`#ffb900`}};function so(e){let t=B(e)<.179?`dark`:`light`,n=oo[t],r=t===`dark`?.16:.08,i=t=>z(e,Ya(t,e),r),a=(n,r)=>io(ao(to(Ya(n,e)),r,4.6,t===`dark`?`lighter`:`darker`)),o=i(n.error),s=i(n.warning);return{error:qa(n.error),errorForeground:a(n.errorForeground,o),errorSurface:R(o),warning:qa(n.warning),warningForeground:a(n.warningForeground,s),warningSurface:R(s)}}function co(e,t,n){let r=ho(e),i=Ya(t,e===`dark`?{r:24,g:15,b:27}:{r:250,g:245,b:250}),a=Ya(n,{r:168,g:67,b:112}),o=to(i),s=to(a),c=B(i)<.179,l=s.C<.02?o.h:s.h,u=Math.min(.045,Math.max(.008,s.C*.22)),d=c?1:-1,f=(e,t=u)=>({L:Math.min(.98,Math.max(.05,o.L+d*e)),C:t,h:l}),p=e=>io(e),m={L:c?.95:.2,C:Math.min(.035,s.C*.25),h:l},h=V(ao(m,i,7,c?`lighter`:`darker`)),ee=mo(i,h),te={L:Math.min(.85,Math.max(.35,s.L+(c?.06:-.02))),C:Math.max(s.C*.9,.06),h:(l+50)%360},ne=V(te),re=lo(ne),ie=lo(a),ae=f(.045,u*1.4),oe=V(ae),se=f(.015),ce=f(.05),le=V(ce),ue=f(.075),de=f(c?.16:.12,Math.min(.07,s.C*.35)),fe=f(c?.21:.16,Math.min(.08,s.C*.4)),pe=f(c?.1:.06,Math.min(.09,s.C*.5)),me=V(pe),he=f(c?.06:.04,Math.min(.06,s.C*.35)),ge=V(he),_e=f(c?.13:.08,Math.min(.11,s.C*.55)),ve=V(_e),ye=f(c?.16:.1,Math.min(.13,s.C*.6)),be=V(ye),g=f(.035,u*.8),xe=f(c?.14:.09,Math.min(.12,s.C*.55)),Se=e=>io(ao(m,e,4.6,c?`lighter`:`darker`)),Ce=Se(ge),_=R(uo(le,h,1,4.6)),we={...te,L:te.L+(c?.06:-.06)};return{...r,...so(i),canvas:R(i),chrome:R(i),toolbar:R(i),toolbarForeground:R(h),toolbarBorder:p(f(c?.14:.1,Math.min(.08,s.C*.4))),toolbarControl:p(f(c?.09:.05,u*1.3)),toolbarControlForeground:R(h),toolbarControlHover:p(f(c?.14:.09,u*1.6)),surface:p(se),surfaceRaised:p(ce),surfaceOverlay:p(ue),text:R(h),textMuted:R(ee),border:p(de),input:p(fe),focus:R(a),accent:R(a),accentForeground:R(ie),secondary:p(pe),secondaryForeground:Se(me),muted:p(he),mutedForeground:Ce,placeholder:_,secondaryLabel:R(ee),iconMuted:R(ee),update:R(a),updateForeground:Se(V(xe)),updateSurface:p(xe),accentSurface:p(_e),accentSurfaceForeground:Se(ve),messageSurface:p(ye),messageForeground:Se(be),messageAction:R(ne),messageActionForeground:R(re),messageActionHover:p(we),codeBackground:p(g),codeForeground:R(h),sidebar:p(ae),sidebarForeground:Se(oe),sidebarMutedForeground:R(mo(oe,h)),sidebarControlSurface:p(f(c?.1:.07,u*1.5)),sidebarRowHover:p(f(c?.08:.06,Math.min(.08,s.C*.45))),sidebarRowActive:p(f(c?.12:.09,Math.min(.1,s.C*.55))),sidebarRowSelected:p(f(c?.14:.1,Math.min(.11,s.C*.6))),sidebarBorder:p(f(c?.17:.12,Math.min(.08,s.C*.4))),terminalBackground:R(i),terminalForeground:R(h),terminalCursor:R(a),terminalSelection:p(f(c?.18:.12,Math.min(.12,s.C*.55))),terminalScrollbar:p(f(c?.22:.16,u)),terminalScrollbarHover:p(f(c?.3:.22,u))}}function H(e,t){let n=B(e),r=B(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)}function lo(e){let t=H(e,za),n=H(e,Ba);return Math.max(t,n)>=4.5?t>=n?za:Ba:H(e,Va)>=H(e,Ha)?Va:Ha}function uo(e,t,n,r){let i=z(t,e,n);if(H(i,e)>=r)return i;let a=t,o=0,s=n;for(let n=0;n<12;n+=1){let n=(o+s)/2,i=z(t,e,n);H(i,e)>=r?(a=i,o=n):s=n}return a}var fo=4.705,po=5.082;function mo(e,t){return uo(e,t,1,B(e)<.179?po:fo)}function ho(e){return e===`dark`?Li.variants.dark:Li.colors}function go(e,t,n,r){let i=Wa(r);if(!i)return{...t,[n]:r};let a=Ka(i.color,i.alpha),o=Ya(t.canvas,e===`dark`?{r:24,g:15,b:27}:{r:250,g:245,b:250}),s=V(i.color),c=e=>z(e,s,i.alpha),l=c(o),u=Ya(t.accent,{r:168,g:67,b:112}),d=B(o)<.179,f=B(l)<.179,p=e=>R(e),m=e=>p(lo(e)),h=e=>io(ao(i.color,e,4.6,B(e)<.179?`lighter`:`darker`)),ee=()=>{let e=z(o,l,d?.16:.08);return{foreground:h(e),surface:p(e)}};switch(n){case`canvas`:return{...t,canvas:a,chrome:a,toolbar:a};case`surface`:case`surfaceRaised`:case`surfaceOverlay`:case`input`:case`sidebarControlSurface`:return{...t,[n]:a};case`text`:return{...t,text:a,toolbarForeground:a,toolbarControlForeground:a};case`mutedForeground`:return{...t,textMuted:a,mutedForeground:a,placeholder:a,secondaryLabel:a,iconMuted:a,sidebarMutedForeground:a};case`border`:return{...t,border:a,toolbarBorder:a,sidebarBorder:a};case`secondary`:return{...t,secondary:a,secondaryForeground:m(l),muted:a,toolbarControl:a};case`accentSurface`:return{...t,accentSurface:a,accentSurfaceForeground:m(l),toolbarControlHover:a};case`accent`:{let e=z(o,l,d?.32:.16);return{...t,accent:a,accentForeground:m(l),focus:a,update:a,updateForeground:h(e),updateSurface:p(e),terminalCursor:a}}case`messageAction`:{let e=lo(l),n=z(s,e===za||e===Va?Ha:Va,.12);return{...t,messageAction:a,messageActionForeground:p(e),messageActionHover:Ka(to(n),i.alpha)}}case`messageSurface`:return{...t,messageSurface:a,messageForeground:m(l)};case`codeBackground`:return{...t,codeBackground:a,codeForeground:m(l)};case`sidebar`:return{...t,sidebar:a,sidebarForeground:m(l)};case`sidebarRowSelected`:{let e=Ya(t.sidebar,o),n=c(e);return{...t,sidebarRowHover:p(z(e,n,.5)),sidebarRowActive:p(z(e,n,.8)),sidebarRowSelected:a}}case`terminalBackground`:{let e=lo(l);return{...t,terminalBackground:a,terminalForeground:p(e),terminalSelection:p(z(l,u,f?.35:.18)),terminalScrollbar:p(z(l,e,f?.42:.22)),terminalScrollbarHover:p(z(l,e,f?.55:.32))}}case`error`:{let e=ee();return{...t,error:a,errorForeground:e.foreground,errorSurface:e.surface}}case`warning`:{let e=ee();return{...t,warning:a,warningForeground:e.foreground,warningSurface:e.surface}}default:return{...t,[n]:a}}}var _o=Hi;function U(e){let t=Ma(e);return _o.find(e=>e.id===t)??Ca().find(e=>e.id===t)??ta.find(e=>e.id===t)??null}function vo(e){let t=Ma(e);return _o.find(e=>e.id===t)?.sidebarArtwork===!0}function yo(e){let t=bo(e);return t.length===1?t[0]:null}function W(e,t){return t===e.appearance?e.colors:e.variants?.[t]??null}function bo(e){return[`light`,`dark`].filter(t=>W(e,t)!==null)}function xo(e){return e===`system`?null:e===`light`||e===`dark`?e:Na(e)||(U(e)?.appearance??null)}function So(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48)||`custom-theme`}var Co=class extends Ae()(`ThemeLibraryStorageError`,{storageKey:_,operation:Be([`read`,`write`]),reason:Be([`malformed`,`storage-unavailable`]),cause:pe(Je())}){get message(){let e=this.operation===`read`?`from`:`to`;return`Failed to ${this.operation} the theme library ${e} ${this.storageKey}.`}};re(Co);function wo(e,t){if(!(typeof window>`u`)){try{window.localStorage.setItem(Yi,JSON.stringify(e)),ra={status:`ready`,storedThemes:e,themes:t}}catch(e){throw new Co({storageKey:Yi,operation:`write`,reason:`storage-unavailable`,cause:e})}xa()}}function To(e){if(e.status===`unavailable`)throw new Co({storageKey:Yi,operation:`read`,reason:e.reason,...`cause`in e?{cause:e.cause}:{}});return e}function Eo(){return To(ba())}function Do(){return To(ya())}function Oo(e,t){return L(e)&&e.id===t}function ko(e,t){return L(e)&&L(e.collection)&&e.collection.id===t}function Ao(e){if(Fi.has(e.id))throw Error(`The theme id "${e.id}" is reserved.`);let t=Eo();if(_o.some(t=>t.id===e.id)||t.storedThemes.some(t=>Oo(t,e.id)))throw Error(`A theme named "${e.label}" is already installed.`);let n=Qa(e),r=[...t.themes,n];return wo([...t.storedThemes,n],r),n}function jo(e){if(Fi.has(e.id))throw Error(`The theme id "${e.id}" is reserved.`);let t=Eo(),n=t.themes,r=n.findIndex(t=>t.id===e.id);if(r===-1)throw Error(`The theme "${e.label}" is not installed.`);let i=Qa(e),a=[...n];a[r]=i;let o=[],s=!1;for(let n of t.storedThemes)Oo(n,e.id)?s||=(o.push(i),!0):o.push(n);return wo(o,a),i}function Mo(e,t,n){if(t.length===0)throw Error(`A theme collection cannot be empty.`);let r=t.map(e=>_a(e));if(r.some(t=>t===null||t.collection?.id!==e)||new Set(r.map(e=>e?.id)).size!==r.length)throw Error(`That theme collection is invalid.`);let i=r,a=Do(),o=a.themes.filter(t=>t.collection?.id===e);if(n?.expectedCollection&&JSON.stringify(o)!==JSON.stringify(n.expectedCollection))throw Error(`Your installed themes changed while this package was downloading. Try again.`);let s=new Set(_o.map(e=>e.id));for(let t of a.storedThemes)!ko(t,e)&&L(t)&&typeof t.id==`string`&&s.add(t.id);let c=i.find(e=>Fi.has(e.id)||s.has(e.id));if(c)throw Error(`A theme named "${c.label}" is already installed.`);let l=[],u=!1;for(let t of a.storedThemes)ko(t,e)?u||=(l.push(...i),!0):l.push(t);return u||l.push(...i),wo(l,va(l)),i}function No(e){Po([e])}function Po(e){let t=new Set(e);if(t.size===0)return;let n=Eo(),r=n.themes.filter(e=>!t.has(e.id));r.length!==n.themes.length&&wo(n.storedThemes.filter(e=>!L(e)||typeof e.id!=`string`||!t.has(e.id)),r)}function Fo(e){if(!L(e))throw Error(`Theme colors must be objects.`);let t={};for(let[n,r]of Object.entries(e)){if(!ea.has(n))throw Error(`"${n}" is not a supported theme color role.`);let e=qa(r);if(!e)throw Error(`The color for "${n}" must be a literal CSS color such as oklch(0.62 0.2 280).`);t[n]=e}if(Object.keys(t).length===0)throw Error(`Add at least one color role to the theme file.`);return t}function Io(e){if(!L(e))throw Error(`Theme files must contain a JSON object.`);if(e.version!==1)throw Error(`This theme file uses an unsupported version. Expected 1.`);let t=e.name,n=e.appearance,r=e.colors;if(!fa(t))throw Error(`Theme files need a name (48 characters or fewer).`);if(!la(n))throw Error(`Theme files need an appearance of "light" or "dark".`);if(!L(r))throw Error(`Theme files need a colors object.`);let i=e.id===void 0?So(t):e.id;if(!da(i))throw Error(`Theme ids may only contain lowercase letters, numbers, and hyphens.`);if(Fi.has(i))throw Error(`The theme id "${i}" is reserved.`);let a=Fo(r),o=pa(e.collection);if(e.collection!==void 0&&!o)throw Error(`Theme collections need a valid id and label.`);let s=ho(n),c={};if(e.variants!==void 0){if(!L(e.variants))throw Error(`Theme variants must be an object.`);for(let[t,r]of Object.entries(e.variants)){if(!la(t))throw Error(`Theme variants may only be named "light" or "dark".`);if(t===n)throw Error(`Theme variants must not repeat the base appearance "${n}".`);c[t]={...ho(t),...Fo(r)}}}return{id:i,label:t.trim(),appearance:n,colors:{...s,...a},...Object.keys(c).length>0?{variants:c}:{},...o?{collection:o}:{},...e.managed===!0?{managed:!0}:{}}}function Lo(e){let t=Qa(e),n={version:1,id:t.id,name:t.label,appearance:t.appearance,colors:t.colors,...t.variants?{variants:t.variants}:{},...t.collection?{collection:t.collection}:{},...t.managed?{managed:!0}:{}};return`${JSON.stringify(n,null,2)}\n`}var Ro={canvas:`--app-theme-canvas`,chrome:`--app-theme-chrome`,toolbar:`--app-theme-toolbar`,toolbarForeground:`--app-theme-toolbar-foreground`,toolbarBorder:`--app-theme-toolbar-border`,toolbarControl:`--app-theme-toolbar-control`,toolbarControlForeground:`--app-theme-toolbar-control-foreground`,toolbarControlHover:`--app-theme-toolbar-control-hover`,surface:`--app-theme-surface`,surfaceRaised:`--app-theme-surface-raised`,surfaceOverlay:`--app-theme-surface-overlay`,text:`--app-theme-text`,textMuted:`--app-theme-text-muted`,border:`--app-theme-border`,input:`--app-theme-input`,focus:`--app-theme-focus`,accent:`--app-theme-accent`,accentForeground:`--app-theme-accent-foreground`,secondary:`--app-theme-secondary`,secondaryForeground:`--app-theme-secondary-foreground`,muted:`--app-theme-muted`,mutedForeground:`--app-theme-muted-foreground`,placeholder:`--app-theme-placeholder`,secondaryLabel:`--app-theme-secondary-label`,iconMuted:`--app-theme-icon-muted`,error:`--app-theme-error`,errorForeground:`--app-theme-error-foreground`,errorSurface:`--app-theme-error-surface`,warning:`--app-theme-warning`,warningForeground:`--app-theme-warning-foreground`,warningSurface:`--app-theme-warning-surface`,update:`--app-theme-update`,updateForeground:`--app-theme-update-foreground`,updateSurface:`--app-theme-update-surface`,accentSurface:`--app-theme-accent-surface`,accentSurfaceForeground:`--app-theme-accent-surface-foreground`,messageSurface:`--app-theme-message-surface`,messageForeground:`--app-theme-message-foreground`,messageAction:`--app-theme-message-action`,messageActionForeground:`--app-theme-message-action-foreground`,messageActionHover:`--app-theme-message-action-hover`,codeBackground:`--app-theme-code-background`,codeForeground:`--app-theme-code-foreground`,sidebar:`--app-theme-sidebar`,sidebarForeground:`--app-theme-sidebar-foreground`,sidebarMutedForeground:`--app-theme-sidebar-muted-foreground`,sidebarControlSurface:`--app-theme-sidebar-control-surface`,sidebarRowHover:`--app-theme-sidebar-row-hover`,sidebarRowActive:`--app-theme-sidebar-row-active`,sidebarRowSelected:`--app-theme-sidebar-row-selected`,sidebarBorder:`--app-theme-sidebar-border`,terminalBackground:`--app-theme-terminal-background`,terminalForeground:`--app-theme-terminal-foreground`,terminalCursor:`--app-theme-terminal-cursor`,terminalSelection:`--app-theme-terminal-selection-background`,terminalScrollbar:`--app-theme-terminal-scrollbar`,terminalScrollbarHover:`--app-theme-terminal-scrollbar-hover`};function zo(e){return Ro[e]}var Bo=`__preview`;function Vo(e,t){if(typeof document>`u`)return;let n=document.documentElement;if(n?.style){ca(!1),n.dataset.themeId=Bo,n.classList.toggle(`dark`,t===`dark`);for(let[t,r]of Object.entries(e))ua(r)&&n.style.setProperty(Ro[t],r)}}function Ho(e,t){if(typeof document>`u`)return;let n=document.documentElement;if(!n?.style)return;ca(null);let r=U(e);if(r){n.dataset.themeId=r.id;let i=W(r,t??Na(e)??r.appearance)??r.colors;for(let[e,t]of Object.entries(i))n.style.setProperty(Ro[e],t);return}delete n.dataset.themeId;for(let e of Object.values(Ro))n.style.removeProperty(e)}function Uo(e,t,n,r,i){let a=t?`dark`:`light`,o=r??(n??e===`system`?`system`:null);if(o===`system`){if(i?.[a])return a;let t=U(e);return t&&W(t,a)===null?t.appearance:a}if(o===`light`||o===`dark`){if(i?.[o])return o;let t=U(e);return t&&W(t,o)===null?t.appearance:o}return xo(e)??`light`}function Wo(e,t,n,r){let i=n??(t??e===`system`?`system`:null);if(i===`system`){let t=U(e),n=r?.light!==void 0||t!==null&&W(t,`light`)!==null,i=r?.dark!==void 0||t!==null&&W(t,`dark`)!==null;return t&&(!n||!i)?t.appearance:`system`}if(i===`light`||i===`dark`){if(r?.[i])return i;let t=U(e);return t&&W(t,i)===null?t.appearance:i}return xo(e)??`system`}function Go(e){return e===`light`||e===`dark`||e===`system`?!0:U(e)!==null}function Ko(e){if(!e)return null;try{let t=JSON.parse(e);if(!L(t))return null;let n={};for(let e of[`light`,`dark`]){let r=t[e];if(typeof r!=`string`)continue;let i=U(r);i&&W(i,e)!==null&&(n[e]=i.id)}return n.light!==void 0||n.dark!==void 0?n:null}catch{return null}}function qo(e,t,n){return t?.[n]??e}var Jo=`borgcode:theme`,Yo=`(prefers-color-scheme: dark)`,Xo={theme:`light`,resolvedTheme:`light`,systemDark:!1,followSystem:!1,appearanceMode:`light`,themeHalves:null};function Zo(){return $o()}function Qo(){return typeof window>`u`?{}:es()}function $o(){if(typeof window>`u`)return null;try{return Ko(window.localStorage.getItem(I))}catch{return null}}function es(){try{let e=JSON.parse(window.localStorage.getItem(`borgcode:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function ts(e){return`${e?.light??``}|${e?.dark??``}`}var ns=`theme-color`,rs=`meta[name="${ns}"][data-dynamic-theme-color="true"]`,G=class extends Ae()(`ThemeStorageError`,{operation:Be([`read`,`write`]),storageKey:_,theme:pe($i),cause:Je()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},is=re(G),as=class extends Ae()(`DesktopThemeSyncError`,{theme:$i,cause:Je()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},os=re(as),ss=[],K=null,cs=!0,ls=null,q=null,us=null;function J(){cs=!0;for(let e of ss)e()}function ds(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(Yo).matches}function fs(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(Xi);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function ps(e){return e===`light`||e===`dark`||e===`system`}function ms(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(Zi);if(ps(e))return e}catch{}return fs(e)?`system`:xo(e)??`light`}function hs(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Zi,e)}catch(e){throw new G({operation:`write`,storageKey:Zi,cause:e})}}function gs(){if(typeof window>`u`)return Xo.theme;let e;try{e=window.localStorage.getItem(Jo)}catch(e){throw new G({operation:`read`,storageKey:Jo,cause:e})}return e!==null&&Go(e)?ja(e):Xo.theme}function _s(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Jo,e),us=null}catch(t){throw new G({operation:`write`,storageKey:Jo,theme:e,cause:t})}}function Y(){if(us!==null)return Xo.theme;try{return gs()}catch(e){let t=is(e)?e:new G({operation:`read`,storageKey:Jo,cause:e});return us=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...S(t)}),Xo.theme}}function vs(){let e=document.querySelector(rs);return e||(e=document.createElement(`meta`),e.name=ns,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function ys(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function bs(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function xs(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?ys(e.getPropertyValue(`--app-chrome-background`)):null,n=ys(getComputedStyle(bs()).backgroundColor),r=ys(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${ns}"]`);if(a.length===0){vs().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function X(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=ms(e),i=r===`system`,a=i?ds():!1,o=$o();if(q?.theme===e&&q.systemDark===a&&q.followSystem===i&&q.appearanceMode===r&&ts(q.themeHalves)===ts(o)){Cs(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=Uo(e,a,i,r,o);Ho(qo(e,o,s),s);let c=s===`dark`;document.documentElement.classList.toggle(`dark`,c),q={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},xs(),Cs(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function Ss(e,t,n,r,i=$o()){try{await e.setTheme(Wo(t,n,r,i))}catch(e){throw new as({theme:t,cause:e})}}function Cs(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=$o(),a=Wo(e,t,n,i);!r||typeof r.setTheme!=`function`||ls===a||(ls=a,Ss(r,e,t,n,i).catch(t=>{let n=os(t)?t:new as({theme:e,cause:t});console.error(n.message,{theme:n.theme,...S(n)}),ls===a&&(ls=null)}))}typeof document<`u`&&typeof window<`u`&&X(Y());function ws(){if(typeof window>`u`)return Xo;if(!cs&&K)return K;cs=!1;let e=Y(),t=ms(e),n=t===`system`,r=n?ds():!1,i=$o(),a=Uo(e,r,n,t,i);return K&&K.theme===e&&K.resolvedTheme===a&&K.systemDark===r&&K.followSystem===n&&K.appearanceMode===t&&ts(K.themeHalves)===ts(i)||(K={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),K}function Ts(){return Xo}function Es(){let e=Y();ms(e)===`system`&&X(e,{suppressTransitions:!0}),J()}function Ds(e){e.key===Jo?(us=null,X(Y(),{suppressTransitions:!0}),J()):e.key===`borgcode:theme-follow-system`||e.key===`borgcode:theme-appearance-mode`||e.key===`borgcode:theme-halves:v1`?(X(Y(),{suppressTransitions:!0}),J()):(e.key===`borgcode:themes:v1`||e.key===null)&&(e.key===null&&(us=null),Sa(),q=null,X(Y(),{suppressTransitions:!0}),J())}var Os=null;function ks(e){if(typeof window>`u`)return()=>{};if(ss.push(e),!Os){let e=typeof window.matchMedia==`function`?window.matchMedia(Yo):null;e?.addEventListener(`change`,Es),window.addEventListener(`storage`,Ds),Os=()=>{e?.removeEventListener(`change`,Es),window.removeEventListener(`storage`,Ds)}}return()=>{ss=ss.filter(t=>t!==e),ss.length===0&&(Os?.(),Os=null)}}function As(){let e=(0,T.useSyncExternalStore)(ks,ws,Ts),{theme:t,resolvedTheme:n}=e,r=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{hs(ms(Y()));let t=window.localStorage.getItem(I);window.localStorage.removeItem(I);try{_s(e)}catch(e){if(t!==null)try{window.localStorage.setItem(I,t)}catch{}throw e}}catch(t){let n=is(t)?t:new G({operation:`write`,storageKey:Jo,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...S(n)}),!1}return X(e,{suppressTransitions:!0}),J(),!0},[]),i=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{hs(e)}catch(e){let t=is(e)?e:new G({operation:`write`,storageKey:Zi,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...S(t)}),!1}return us=null,X(Y(),{suppressTransitions:!0}),J(),!0},[]),a=(0,T.useCallback)(e=>{let n=ms(t),r=e?`system`:n===`system`?xo(t)??`light`:n;return i(r)},[i,t]),o=(0,T.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...es()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(I):window.localStorage.setItem(I,JSON.stringify(n))}catch(e){let t=new G({operation:`write`,storageKey:I,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...S(t)}),!1}return X(Y(),{suppressTransitions:!0}),J(),!0},[]),s=(0,T.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(I)}catch(e){let t=new G({operation:`write`,storageKey:I,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...S(t)}),!1}return X(Y(),{suppressTransitions:!0}),J(),!0},[]),c=(0,T.useCallback)(({preservePreview:e=!1}={})=>{typeof window>`u`||(q=null,X(Y(),{suppressTransitions:!0,preservePreview:e}),J())},[]);return(0,T.useEffect)(()=>{X(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var js={status:`idle`},Ms=x(js).pipe(C(`environment-data:server:update-state:empty`)),Ns=y(e=>x(js).pipe(C(`environment-data:server:update-state:${e}`))),Ps=class extends Ae()(`ServerUpdateResumeTimeoutError`,{environmentId:_,targetVersion:_}){get message(){return`The server did not resume on version ${this.targetVersion}.`}},Fs=class extends Ae()(`ServerUpdateProgressIncompleteError`,{targetVersion:_}){get message(){return`The update to version ${this.targetVersion} ended before the server accepted the restart.`}},Is=class extends Ae()(`ServerUpdateTerminalError`,{targetVersion:_,status:Be([`committed`,`rolled-back`,`failed`]),reason:pe(_)}){get message(){return this.reason??`The update to version ${this.targetVersion} ${this.status}.`}},Ls=Fe(4);function Rs(e,t){return e.updateId===void 0?t.payload.environment.serverVersion===e.targetVersion:t.payload.updateOutcome?.id===e.updateId}function zs(e,t){if(e.updateId===void 0)return De;let n=t.payload.updateOutcome;return n?.id===e.updateId&&n.status===`committed`&&n.targetVersion===e.targetVersion&&t.payload.environment.serverVersion===e.targetVersion?De:Ue(new Is({targetVersion:e.targetVersion,status:n?.status??`failed`,reason:n?.reason??`The service launcher resumed without committing the requested server version.`}))}function Bs(e){return e.stateChanges.pipe(i(e=>e.phase===`backoff`||e.phase===`blocked`&&e.lastFailure?.reason===`authentication`),he(()=>Te(e.interval??ke(1)).pipe(a(e.retryNow))),Ce(Ls),Ke)}function Vs(e,t,n){return{status:`running`,stage:n.type===`complete`?`resuming`:n.stage,fromVersion:e,targetVersion:t}}function Hs(e,t){return e.status===`idle`||e.status===`running`||t===null||e.fromVersion===t?e:js}function Us(e){return e instanceof Error?e.message:`Server update failed.`}function Ws(e){if(!Vt(e))return!1;switch(e.reason._tag){case`SocketReadError`:case`SocketWriteError`:case`SocketCloseError`:return!0;default:return!1}}function Gs(e){return ee(e)?!0:e.reasons.length>0&&e.reasons.every(e=>_e(e)&&Ws(e.error))}function Ks(e,t,n){return r(t)&&(ie(n)||Gs(n.cause))?qe(t.value):f(n)?m(n.cause):Ue(new Fs({targetVersion:e}))}var qs=e=>({version:1,type:`snapshot`,config:e}),Js=le(`EnvironmentServerConfigState.make`)(function*(e){let t=yield*Mt,i=yield*Gt,a=t.target.environmentId,o=yield*pt(fe(yield*i.loadServerConfig(a).pipe(nt(e=>He(`Could not load cached server configuration.`).pipe(Me({environmentId:a,...S(e)}),n(de())))),e=>({config:kt(e),latestEvent:qs(kt(e)),source:`cache`}))),s=yield*Ze(1),c=yield*rt(de()),u=le(`EnvironmentServerConfigState.persist`)(function*(e){return yield*i.saveServerConfig(a,kt(e)).pipe(n(!0),nt(e=>He(`Could not persist cached server configuration.`).pipe(Me({environmentId:a,...S(e)}),n(!1))))}),d=le(`EnvironmentServerConfigState.persistPending`)(function*(e){(yield*u(e))&&(yield*ot(c,t=>r(t)&&t.value===e?de():t))});return yield*ae(s).pipe(xe(`500 millis`),he(d),ve),yield*Wt(g.subscribeServerConfig,e===!0?{environmentThemes:!0}:{}).pipe(he(e=>Re(function*(){let t=Nt(yield*Tt(o),e);et(t)||(yield*st(c,me(t.value.config)),yield*Ct(o,t),yield*Pe(s,t.value.config))})),ve),yield*ue(()=>it(c).pipe(ge(l({onNone:()=>De,onSome:e=>u(e).pipe(oe)})))),o});function Ys(e,t){return bt(e,we(Js(t).pipe(Oe(e=>ut(e).pipe(se(e=>l(e,{onNone:()=>ye,onSome:e=>Se(e)})))))))}function Xs(e,t){if(t.type!==`welcome`)return[e,[]];let n=t.payload;return[me(n),[n]]}function Zs(e,t){return e?.source===`live`&&(t===null||e.config.environment.serverVersion===t.environment.serverVersion)?e.config:t??e?.config??null}function Qs(e,t){let n=Dt(),r=Dt(),s={mode:`serial`,key:({environmentId:e})=>e},c=y(n=>e.atom(Ys(n,t.environmentThemes)).pipe(Ft(5*6e4),C(`environment-data:server:config-projection:${n}`))),l=e=>c(e.environmentId),u=x(null).pipe(C(`environment-data:server:config:empty`)),f=y(e=>e===null?u:x(n=>Zs(o(Xt(n(l({environmentId:e,input:{}})))),n(t.initialConfigValueAtom(e)))).pipe(C(`environment-data:server:config:${e}`))),p=y(e=>x(t=>Hs(t(Ns(e)),t(f(e))?.environment.serverVersion??null)).pipe(C(`environment-data:server:update-state-value:${e}`))),te=e=>e===null?Ms:p(e),re=Ot(e,{label:`environment-data:server:update-server`,scheduler:r,concurrency:s,execute:(e,t)=>{let r=Ns(e.environmentId),o=e.input.targetVersion,c=t.get(f(e.environmentId))?.environment.serverVersion??o,l=`downloading`;return t.set(r,{status:`running`,stage:l,fromVersion:c,targetVersion:o}),Re(function*(){let u=yield*jt,d=yield*Bt(t,n,s,e,Re(function*(){let n=t.get(f(e.environmentId));c=n?.environment.serverVersion??o,t.set(r,{status:`running`,stage:l,fromVersion:c,targetVersion:o});let i=n?.environment.capabilities.serverSelfUpdateProgress===!0?yield*Re(function*(){let n=yield*rt(de()),i=yield*u.runStream(e.environmentId,Lt(g.serverUpdateServerWithProgress,e.input)).pipe(he(e=>Ge(()=>{l=e.type===`complete`?`resuming`:e.stage,t.set(r,Vs(c,o,e))}).pipe(a(e.type===`complete`?st(n,me(e.result)):De))),ne);return yield*Ks(o,yield*it(n),i)}):yield*Re(function*(){let t=n?.environment.capabilities.serverSelfUpdate,r=yield*u.run(e.environmentId,At(g.serverUpdateServer,e.input)).pipe(ne);return ie(r)?r.value:(t===`boot-service`||t===`respawn`)&&Gs(r.cause)?{targetVersion:o,method:t}:yield*m(r.cause)});return l=`resuming`,t.set(r,{status:`running`,stage:l,fromVersion:c,targetVersion:o}),i}));yield*Bs({stateChanges:u.stateChanges(e.environmentId),retryNow:u.retryNow(e.environmentId)}).pipe(Ie);let p=yield*u.followStream(e.environmentId,Wt(g.subscribeServerLifecycle,{})).pipe(i(e=>e.type===`ready`&&Rs(d,e)),h,Ce(Ls),Oe(je));return et(p)?yield*new Ps({environmentId:e.environmentId,targetVersion:o}):(yield*zs(d,p.value),t.set(r,js),d)}).pipe(Qe(e=>Ge(()=>{if(!ie(e)){if(ee(e.cause)){t.set(r,js);return}t.set(r,{status:`failed`,stage:l,fromVersion:c,targetVersion:o,message:Us(Le(e.cause))})}})))}});return{configValueAtom:f,updateStateAtom:te,settingsValueAtom:y(e=>x(t=>t(f(e))?.settings??null).pipe(C(`environment-data:server:settings:${e}`))),providersValueAtom:y(e=>x(t=>t(f(e))?.providers??null).pipe(C(`environment-data:server:providers:${e}`))),traceDiagnostics:w(e,{label:`environment-data:server:trace-diagnostics`,tag:g.serverGetTraceDiagnostics}),processDiagnostics:w(e,{label:`environment-data:server:process-diagnostics`,tag:g.serverGetProcessDiagnostics}),processResourceHistory:w(e,{label:`environment-data:server:process-resource-history`,tag:g.serverGetProcessResourceHistory}),resourceTelemetry:gt(e,{label:`environment-data:server:resource-telemetry`,tag:g.subscribeResourceTelemetry,idleTtlMs:0}),resourceTelemetryHistory:w(e,{label:`environment-data:server:resource-telemetry-history`,tag:g.serverGetResourceTelemetryHistory,staleTimeMs:5e3}),usageSummary:w(e,{label:`environment-data:server:usage-summary`,tag:g.serverGetUsageSummary,staleTimeMs:6e4}),teamUsage:w(e,{label:`environment-data:server:team-usage`,tag:g.serverGetTeamUsage,staleTimeMs:6e4}),remoteThreads:w(e,{label:`environment-data:server:remote-threads`,tag:g.serverListRemoteThreads,staleTimeMs:15e3}),remoteThread:w(e,{label:`environment-data:server:remote-thread`,tag:g.serverGetRemoteThread,staleTimeMs:5e3}),configProjection:l,welcome:gt(e,{label:`environment-data:server:welcome`,tag:g.subscribeServerLifecycle,transform:e=>e.pipe(d(de,Xs))}),refreshProviders:b(e,{label:`environment-data:server:refresh-providers`,tag:g.serverRefreshProviders,concurrency:{mode:`singleFlight`,key:({environmentId:e})=>e}}),updateProvider:b(e,{label:`environment-data:server:update-provider`,tag:g.serverUpdateProvider,scheduler:n,concurrency:s}),updateServer:re,upsertKeybinding:b(e,{label:`environment-data:server:upsert-keybinding`,tag:g.serverUpsertKeybinding,scheduler:n,concurrency:s}),removeKeybinding:b(e,{label:`environment-data:server:remove-keybinding`,tag:g.serverRemoveKeybinding,scheduler:n,concurrency:s}),updateSettings:b(e,{label:`environment-data:server:update-settings`,tag:g.serverUpdateSettings,scheduler:n,concurrency:s}),recordClientEvent:b(e,{label:`environment-data:server:record-client-event`,tag:g.serverRecordClientEvent}),signalProcess:b(e,{label:`environment-data:server:signal-process`,tag:g.serverSignalProcess}),retryResourceTelemetry:b(e,{label:`environment-data:server:retry-resource-telemetry`,tag:g.serverRetryResourceTelemetry,concurrency:{mode:`singleFlight`,key:({environmentId:e})=>e}})}}async function $s(e,t,n,r){try{return(await Ut(e,t.recordClientEvent,{environmentId:n,input:r},{reportFailure:!1,reportDefect:!1}))._tag===`Success`}catch{return!1}}var ec=[{key:`mod+b`,command:`sidebar.toggle`},{key:`mod+shift+b`,command:`sidebar.switchView`},{key:`mod+j`,command:`terminal.toggle`},{key:`mod+alt+b`,command:`rightPanel.toggle`},{key:`mod+d`,command:`terminal.split`,when:`terminalFocus`},{key:`mod+shift+d`,command:`terminal.splitVertical`,when:`terminalFocus`},{key:`mod+n`,command:`terminal.new`,when:`terminalFocus`},{key:`mod+w`,command:`terminal.close`,when:`terminalFocus`},{key:`mod+d`,command:`diff.toggle`,when:`!terminalFocus`},{key:`mod+shift+j`,command:`preview.toggle`},{key:`mod+r`,command:`preview.refresh`,when:`previewFocus`},{key:`mod+l`,command:`preview.focusUrl`,when:`previewFocus`},{key:`mod+=`,command:`preview.zoomIn`,when:`previewFocus`},{key:`mod++`,command:`preview.zoomIn`,when:`previewFocus`},{key:`mod+-`,command:`preview.zoomOut`,when:`previewFocus`},{key:`mod+0`,command:`preview.resetZoom`,when:`previewFocus`},{key:`mod+k`,command:`commandPalette.toggle`,when:`!terminalFocus`},{key:`mod+p`,command:`filePicker.toggle`,when:`!terminalFocus`},{key:`mod+shift+f`,command:`projectSearch.toggle`,when:`!terminalFocus`},{key:`mod+alt+shift+t`,command:`themeEditor.toggle`},{key:`mod+s`,command:`composer.stash`,when:`!terminalFocus`},{key:`mod+n`,command:`chat.new`,when:`!terminalFocus`},{key:`mod+shift+n`,command:`chat.new`,when:`!terminalFocus`},{key:`mod+f`,command:`chat.find`,when:`!terminalFocus`},{key:`mod+l`,command:`chat.quoteSelection`,when:`!terminalFocus && !previewFocus`},{key:`mod+shift+m`,command:`modelPicker.toggle`,when:`!terminalFocus`},{key:`mod+o`,command:`editor.openFavorite`},{key:`mod+shift+[`,command:`thread.previous`},{key:`mod+shift+]`,command:`thread.next`},{key:`mod+shift+c`,command:`thread.copyReference`,when:`!terminalFocus`},{key:`mod+shift+s`,command:`thread.settle`,when:`!terminalFocus`},{key:`mod+shift+p`,command:`thread.pin`,when:`!terminalFocus`},...ze.map((e,t)=>({key:`mod+${t+1}`,command:e})),...We.map((e,t)=>({key:`mod+${t+1}`,command:e,when:`modelPickerOpen`}))];function tc(e){return e===`space`?` `:e===`esc`?`escape`:e}function nc(e){let t=[...e.toLowerCase().split(`+`).map(e=>e.trim())],n=0;for(;t[t.length-1]===``;)n+=1,t.pop();if(n>0&&t.push(`+`),t.some(e=>e.length===0)||t.length===0)return null;let r=null,i=!1,a=!1,o=!1,s=!1,c=!1;for(let e of t)switch(e){case`cmd`:case`meta`:i=!0;break;case`ctrl`:case`control`:a=!0;break;case`shift`:o=!0;break;case`alt`:case`option`:s=!0;break;case`mod`:c=!0;break;default:if(r!==null)return null;r=tc(e)}return r===null?null:{key:r,metaKey:i,ctrlKey:a,shiftKey:o,altKey:s,modKey:c}}function rc(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!r)break;if(/\s/.test(r)){n+=1;continue}if(e.startsWith(`&&`,n)){t.push({type:`and`}),n+=2;continue}if(e.startsWith(`||`,n)){t.push({type:`or`}),n+=2;continue}if(r===`!`){t.push({type:`not`}),n+=1;continue}if(r===`(`){t.push({type:`lparen`}),n+=1;continue}if(r===`)`){t.push({type:`rparen`}),n+=1;continue}let i=/^[A-Za-z_][A-Za-z0-9_.-]*/.exec(e.slice(n));if(!i)return null;t.push({type:`identifier`,value:i[0]}),n+=i[0].length}return t}function ic(e){let t=rc(e);if(!t||t.length===0)return null;let n=0,r=e=>{if(e>64)return null;let r=t[n];if(!r)return null;if(r.type===`identifier`)return n+=1,{type:`identifier`,name:r.value};if(r.type===`lparen`){n+=1;let r=o(e+1),i=t[n];return!r||!i||i.type!==`rparen`?null:(n+=1,r)}return null},i=e=>{let i=0;for(;t[n]?.type===`not`;)if(n+=1,i+=1,i>64)return null;let a=r(e);if(!a)return null;for(;i>0;)a={type:`not`,node:a},--i;return a},a=e=>{let r=i(e);if(!r)return null;for(;t[n]?.type===`and`;){n+=1;let t=i(e);if(!t)return null;r={type:`and`,left:r,right:t}}return r},o=e=>{let r=a(e);if(!r)return null;for(;t[n]?.type===`or`;){n+=1;let t=a(e);if(!t)return null;r={type:`or`,left:r,right:t}}return r},s=o(0);return!s||n!==t.length?null:s}function ac(e){let t=nc(e.key);if(!t)return null;if(e.when!==void 0){let n=ic(e.when);return n?{command:e.command,shortcut:t,whenAst:n}:null}return{command:e.command,shortcut:t}}function oc(e){let t=[];for(let n of e){let e=ac(n);e&&t.push(e)}return t.slice(-256)}var sc=oc(ec),cc=x(e=>{for(let[t,n]of e(D.catalogValueAtom).entries)if(n.target._tag===`PrimaryConnectionTarget`)return t;return null}).pipe(C(`web-primary-environment-id`)),Z=Qs(Pt,{initialConfigValueAtom:Ht.initialConfigValueAtom,environmentThemes:!0}),lc=It({catalogValueAtom:D.catalogValueAtom,serverConfigValueAtom:Z.configValueAtom}),uc=[],dc=[],fc={config:null,latestEvent:null,welcome:null},pc=x(e=>{let t=e(cc);if(t===null)return fc;let n={environmentId:t,input:{}},r=o(Xt(e(Z.configProjection(n)))),i=o(Xt(e(Z.welcome(n))));return{config:e(Z.configValueAtom(t)),latestEvent:r?.latestEvent??null,welcome:i}}).pipe(C(`web-primary-server-state`)),Q=x(e=>e(pc).config).pipe(C(`web-primary-server-config`)),mc=x(e=>e(pc).latestEvent).pipe(C(`web-primary-server-config-event`)),hc=x(e=>e(pc).welcome).pipe(C(`web-primary-server-welcome`)),gc=x(e=>e(Q)?.settings??u).pipe(C(`web-primary-server-settings`)),_c=x(e=>e(Q)?.providers??dc).pipe(C(`web-primary-server-providers`)),vc=x(e=>e(Q)?.keybindings??sc).pipe(C(`web-primary-server-keybindings`)),yc=x(e=>e(Q)?.availableEditors??uc).pipe(C(`web-primary-server-available-editors`)),bc=x(e=>e(Q)?.keybindingsConfigPath??null).pipe(C(`web-primary-server-keybindings-config-path`)),xc=[],Sc=x(e=>e(Q)?.environmentThemes??xc).pipe(C(`web-primary-server-environment-themes`)),Cc=x(e=>e(Q)?.observability??null).pipe(C(`web-primary-server-observability`)),wc=`searchatlas-gateway/`,Tc=e=>e.startsWith(wc)?at(e):e,Ec=e=>[...new Set(e.map(Tc))],Dc=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function Oc(e){let t=new Set,n=e.favorites.flatMap(e=>{let n=Tc(e.model),r=`${e.provider}\u0000${n}`;return t.has(r)?[]:(t.add(r),[n===e.model?e:{...e,model:n}])}),r=!Dc(n,e.favorites),i=Object.fromEntries(Object.entries(e.providerModelPreferences).map(([e,t])=>{let n=Ec(t.hiddenModels),i=Ec(t.modelOrder);return Dc(n,t.hiddenModels)&&Dc(i,t.modelOrder)?[e,t]:(r=!0,[e,{...t,hiddenModels:n,modelOrder:i}])}));return r?{...e,favorites:n,providerModelPreferences:i}:e}var $=class extends Error{status;constructor(e,t=`Settings request failed (${e}).`){super(t),this.name=`SettingsClientError`,this.status=e}};function kc(e){if(typeof e!=`object`||!e||Array.isArray(e))throw new $(502,`Settings response is invalid.`);let t=e;if(typeof t.namespace!=`string`||typeof t.values!=`object`||t.values===null||Array.isArray(t.values)||!Number.isSafeInteger(t.revision)||t.modified!==null&&typeof t.modified!=`string`)throw new $(502,`Settings response is invalid.`);return t}function Ac(e){let t=kc(e),n=e,r=n.sources;if(typeof r!=`object`||!r||Array.isArray(r))throw new $(502,`Settings response is invalid.`);for(let e of Object.values(r))if(e!==`user`&&e!==`customer`)throw new $(502,`Settings response is invalid.`);let i=n.customer_revision;return{...t,sources:r,customerRevision:Number.isSafeInteger(i)?i:0}}function jc(e,t){if(!/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/.test(t)||t===`.`||t===`..`)throw new $(400,`Settings namespace is invalid.`);if(!yt(e.customerId))throw new $(400,`Customer id is invalid.`);let n=String(e.customerId);return`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${n}/settings/${t}/`}async function Mc(e){let t=await e.getAccessToken();if(!t)throw new $(401,`Search Atlas authentication is required.`);return{authorization:`Bearer ${t}`}}function Nc(e){let t=e.fetch??globalThis.fetch;return{get:async n=>{let r=await t(jc(e,n),{headers:await Mc(e)});if(!r.ok)throw new $(r.status);return kc(await r.json())},put:async(n,r,i)=>{let a=await t(jc(e,n),{method:`PUT`,headers:{...await Mc(e),"content-type":`application/json`},body:JSON.stringify({values:r,expected_revision:i})});if(!a.ok)throw new $(a.status);return kc(await a.json())},getDefaults:async n=>{let r=await t(`${jc(e,n)}defaults/`,{headers:await Mc(e)});if(!r.ok)throw new $(r.status);return kc(await r.json())},putDefaults:async(n,r,i)=>{let a=await t(`${jc(e,n)}defaults/`,{method:`PUT`,headers:{...await Mc(e),"content-type":`application/json`},body:JSON.stringify({values:r,expected_revision:i})});if(!a.ok)throw new $(a.status);return kc(await a.json())},getEffective:async n=>{let r=await t(`${jc(e,n)}effective/`,{headers:await Mc(e)});if(!r.ok)throw new $(r.status);return Ac(await r.json())}}}var Pc=new Set(`allowDirectSourceBranch.browserAutoShowFloatingPreview.browserDefaultAppearance.browserDefaultViewport.browserDefaultZoomFactor.browserRecordingFrameRate.commanderName.confirmThreadArchive.confirmThreadDelete.confirmThreadUnpin.developerModeEnabled.onboardingStep.onboardingWorkType.onboardingWorkTitle.diffIgnoreWhitespace.dismissedProviderUpdateNotificationKeys.environmentIdentificationMode.favorites.followUpBehavior.hiddenRepositories.providerModelPreferences.routeToBorgs.showAllGatewayModels.showContextWindowUsage.showSkillsInSlashMenu.sidebarMode.sidebarProjectGroupingMode.sidebarProjectSortOrder.sidebarThreadPreviewCount.sidebarThreadSortOrder.suggestedRepositoryAccounts.timestampFormat.wordWrap`.split(`.`));function Fc(e){return Pc.has(e)}var Ic=new Set([`hiddenRepositories`,`providerModelPreferences`,`suggestedRepositoryAccounts`]);function Lc(e){return Ic.has(e)}var Rc={__borgDeleted:!0};function zc(e){return Bc(e)&&e.__borgDeleted===!0}function Bc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Vc(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Hc(e,t){let n=[];for(let[r,i]of Object.entries(t)){if(!Fc(r))continue;let t=e[r];if(Lc(r)&&Bc(i)&&Bc(t)){let e=[...Object.entries(i).filter(([e,n])=>!Vc(t[e],n)),...Object.keys(t).filter(e=>!(e in i)).map(e=>[e,Rc])];e.length>0&&n.push([r,Object.fromEntries(e)]);continue}Vc(t,i)||n.push([r,i])}return Object.fromEntries(n)}function Uc(e,t){let n={...e};for(let[e,r]of Object.entries(t)){if(!Fc(e))continue;let t=n[e];if(Lc(e)&&Bc(r)&&Bc(t)){let i={...t};for(let[e,t]of Object.entries(r))zc(t)?delete i[e]:i[e]=t;n[e]=i;continue}zc(r)||(n[e]=r)}return n}var Wc={state:`local-only`,lastSyncedAt:null,error:null,revision:0},Gc=Wc,Kc=new Set;function qc(){return Gc}function Jc(e){return Kc.add(e),()=>Kc.delete(e)}function Yc(e){Gc=e;for(let t of Kc)t(e)}function Xc(){Yc({...Gc,state:`syncing`,error:null})}function Zc(e,t){Yc({state:`synced`,lastSyncedAt:t,error:null,revision:e})}function Qc(){Yc({...Gc,state:`pending`,error:null})}function $c(e){Yc({...Gc,state:`failed`,error:e})}function el(){Yc({...Wc,lastSyncedAt:Gc.lastSyncedAt})}function tl(e){return e.state===`failed`&&e.error!==null&&!e.error.includes(`rejected`)}var nl={status:`idle`},rl=nl,il=null,al=[],ol=0,sl=new Set;function cl(e){rl=e;for(let e of sl)e()}function ll(e){il?.resolve(e);for(let t of al)t.resolve(e);il=null,al=[]}function ul(){return rl}function dl(e){return sl.add(e),()=>{sl.delete(e)}}function fl(){ol+=1;let e=!0;return()=>{e&&(e=!1,ol=Math.max(0,ol-1),ol===0&&(ll(!1),cl(nl)))}}function pl(e,t){if(ol!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(il||rl.status===`closing`){al.push(r);return}il=r,cl({status:`confirming`,message:e,variant:r.variant})})}function ml(e){if(rl.status!==`confirming`||!il)return;let t=il;il=null,t.resolve(e),cl({status:`closing`,message:rl.message,variant:rl.variant})}function hl(){if(rl.status!==`closing`)return;let e=al.shift();if(!e){cl(nl);return}il=e,cl({status:`confirming`,message:e.message,variant:e.variant})}var gl=`http://www.w3.org/2000/svg`,_l={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function vl(e,t){let n=_l[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(gl,`svg`);r.setAttribute(`xmlns`,gl),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(gl,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function yl(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function bl(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}function xl(e,t,n){if(t===0)return null;switch(e){case`ArrowDown`:return n<0?0:(n+1)%t;case`ArrowUp`:return n<=0?t-1:n-1;case`Home`:return 0;case`End`:return t-1;default:return null}}function Sl(e){return[...e.querySelectorAll(`button`)].filter(e=>!e.disabled)}var Cl=null;function wl(){Cl?.(),Cl=null}function Tl(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,Cl===c&&(Cl=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=bl(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{if(e.key===`Escape`||e.key===`Tab`){e.preventDefault(),l(null);return}let t=document.activeElement,n=i.findLast(e=>bl(t,[e]))??i.at(-1);if(!n)return;let r=Sl(n),a=r.findIndex(e=>e===t);if(e.key===`Enter`||e.key===` `){if(a<0)return;e.preventDefault(),r[a]?.click();return}let o=xl(e.key,r.length,a);o!==null&&(e.preventDefault(),r[o]?.focus({preventScroll:!0}))},d=e=>{!s||bl(e.target,i)||l(null)},f=e=>{!s||bl(e.target,i)||(e.preventDefault(),l(null))},p=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},m=(e,t,n,r,o)=>{p(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-32 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:8rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r),c.setAttribute(`role`,`menu`);let u=document.createElement(`div`);u.className=`max-h-[min(24rem,70vh)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:min(24rem,70vh);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`,a.setAttribute(`role`,`menuitem`);let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.icon==`string`){let e=vl(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=vl(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;m(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&yl(c,n.left-l.width-4,n.top),e&&Sl(c)[0]?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{p(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{yl(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),m(e,t?.x??0,t?.y??0,0),Cl&&Cl(),Cl=c,i[0]&&Sl(i[0])[0]?.focus({preventScroll:!0}),requestAnimationFrame(()=>{s=!0})})}var El;async function Dl(){let e=ct(),t=_t(),n=null;try{n=await e?.getAccessToken()??null}catch{n=null}if(!e||!t||!n)return null;let r=Ve(n)?.customerId;return r?Nc({apiUrl:t,customerId:r,getAccessToken:()=>e.getAccessToken()}):null}function Ol(){try{let e=Number.parseInt(window.localStorage.getItem(tn)??`0`,10);return Number.isSafeInteger(e)&&e>=0?e:0}catch{return 0}}function kl(e){try{window.localStorage.setItem(tn,String(e))}catch{}}function Al(){try{let e=window.localStorage.getItem($t);if(e===null)return null;let t=JSON.parse(e);return typeof t!=`object`||!t||Array.isArray(t)?null:t}catch{return null}}function jl(){try{let e=Number.parseInt(window.localStorage.getItem(nn)??`0`,10);return Number.isSafeInteger(e)&&e>=0?e:0}catch{return 0}}function Ml(e){try{window.localStorage.setItem(nn,String(e))}catch{}}function Nl(e){try{window.localStorage.setItem($t,JSON.stringify(e))}catch{}}function Pl(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>pl(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Tl(e,t),close:async()=>{window.desktopBridge||wl()}},persistence:{getClientSettings:async()=>{if(window.desktopBridge)return window.desktopBridge.getClientSettings();let e=Qt(),t=await Dl();if(!t)return el(),e;try{let n=await t.getEffective(`client`),r=Object.fromEntries(Object.entries(n.values).filter(([e])=>n.sources[e]===`user`)),i=n.revision<=Ol()&&n.customerRevision<=jl();if(e&&i)return Nl(r),Zc(Ol(),new Date().toISOString()),e;if(n.revision===0&&n.customerRevision===0)return Nl(r),Zc(0,new Date().toISOString()),e;let a=Uc({...tt,...e??{}},n.values);return en(a),kl(n.revision),Ml(n.customerRevision),Nl(r),Zc(n.revision,new Date().toISOString()),a}catch{return $c(`Borg Cloud could not be reached.`),e}},setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);let t=Qt();en(e);let n=await Dl();if(!n){el();return}let r=e,i=Hc({...tt,...t??{}},r),a=Al();Xc();let o=e=>{kl(e.revision),Nl(e.values),Zc(e.revision,new Date().toISOString())};try{if(a===null){let e=await n.get(`client`);o(await n.put(`client`,Uc(e.values,i),e.revision));return}o(await n.put(`client`,Uc(a,i),Ol()))}catch(e){if(!(e instanceof $)||e.status!==409){$c(e instanceof $&&e.status>=400&&e.status<500&&e.status!==408&&e.status!==429?`Borg Cloud rejected these settings.`:`Borg Cloud could not be reached.`);return}try{let e=await n.get(`client`);o(await n.put(`client`,Uc(e.values,i),e.revision))}catch{Qc()}}}}}}function Fl(){return Pl()}function Il(){if(!(typeof window>`u`))return El||(El=Fl(),El)}function Ll(){let e=Il();if(!e)throw Error(`Local API not found`);return e}var Rl=ft({capacity:20,account:vt,isReady:xt.isReady,defaultTarget:()=>{let e=Rt.get(cc);return e!==null&&xt.isReady(e)?e:void 0},send:(e,t)=>$s(Rt,Z,e,t),holdWhileClosed:e=>e.event===`auth.sign_in.started`});xt.subscribe(()=>Rl.flush()),Rt.subscribe(cc,()=>Rl.flush());function zl(e,t){Rl.record(e,null,t)}var Bl=300;function Vl(){let e=Rl.record({event:`auth.signed_out`,properties:{}});return Rl.closeAfterSignOut(),St(e,Bl)}function Hl(){vt.closed||Rl.closeAfterSignOut()}function Ul(){Rl.reopen()}var Wl=re(t);function Gl(e){return Object.keys(e).filter(Wl)}var Kl=lt({windowMs:Yt,capacity:64});function ql(e,t,n=Date.now(),r){let i=Gl(e);i.length!==0&&Kl(wt(i,t),n)&&zl({event:`settings.changed`,properties:{keys:i,scope:t}},r)}function Jl(e,t,n){let r=Et(vt,(e,r)=>ql(t,n,r,e));e.then(e=>{e&&r(Date.now())},()=>void 0)}function Yl(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function Xl(e){let t=y(t=>x(n=>{let r=n(e.catalogValueAtom).entries.get(t);return r===void 0?null:{entry:r,connection:Zt(ce(Xt(n(e.stateAtom(t))),()=>Jt)),serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(C(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:x(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return Yl(n,i)||(n=i),n}).pipe(C(`environment-presentations`))}}var Zl=Xl({catalogValueAtom:D.catalogValueAtom,stateAtom:D.stateAtom,serverConfigValueAtom:Z.configValueAtom}),Ql=x(null).pipe(C(`web-environment-presentation:empty`));function $l(e){let t=(0,E.c)(5),n=v(D.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?Ql:Zl.presentationAtom(e),t[0]=e,t[1]=r);let i=v(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}function eu(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:ht(t.entry)}}function tu(){let e=(0,E.c)(7),t=v(D.catalogValueAtom),n=v(D.networkStatusValueAtom),r=v(Zl.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(nu),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function nu(e){let[t,n]=e;return eu(t,n)}function ru(){let e=(0,E.c)(2),t=v(D.catalogAtom);if(!mt(t)||r(t.previousSuccess))return null;let n;e[0]===t.cause?n=e[1]:(n=Le(t.cause),e[0]=t.cause,e[1]=n);let i=n;return i instanceof Error?i.message:String(i)}function iu(){return v(cc)}function au(e){let t=(0,E.c)(3),{presentation:n}=$l(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:eu(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function ou(){return au(iu())}function su(e){let t=(0,E.c)(2),n=zt(e),i;return t[0]===n?i=t[1]:(i=r(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=i),i}var cu=`[CLIENT_SETTINGS]`,lu=new Set,uu=new Set,du=tt,fu=!1,pu=null,mu=0;function hu(){for(let e of lu)e()}function gu(){for(let e of uu)e()}function _u(){return du}function vu(e){du=e,hu()}function yu(e){fu!==e&&(fu=e,gu())}function bu(e){return lu.add(e),Cu(),()=>{lu.delete(e)}}function xu(){return fu}function Su(e){return uu.add(e),Cu(),()=>{uu.delete(e)}}async function Cu(){if(fu)return;if(pu)return pu;let e=mu,t=(async()=>{try{let t=await Ll().persistence.getClientSettings();if(e!==mu)return;t&&vu(Oc({...tt,...t}))}catch(e){console.error(`${cu} hydrate failed`,{operation:`hydrate`,...S(e)})}finally{e===mu&&yu(!0)}})().finally(()=>{pu===t&&(pu=null)});return pu=t,pu}function wu(e){return vu(e),Ll().persistence.setClientSettings(e).then(()=>!0,e=>(console.error(`${cu} persist failed`,{operation:`persist`,...S(e)}),!1))}function Tu(e,t){let n=wu({..._u(),...e});return t?.analytics!==!1&&Jl(n,e,`client`),n}var Eu=new Set(p(c.fields));function Du(e){let t={},n={};for(let[r,i]of Object.entries(e))Eu.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Ou(){return _u()}function ku(){return Cu()}async function Au(){mu+=1,pu=null,yu(!1),await Cu()}function ju(){return(0,T.useSyncExternalStore)(Su,xu,Mu)}function Mu(){return!1}function Nu(){return(0,T.useSyncExternalStore)(bu,_u,Pu)}function Pu(){return tt}function Fu(e,t){return{...t,...e}}function Iu(e,t){let n=(0,E.c)(6),r=Nu(),i;n[0]!==r||n[1]!==e?(i=Fu(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Lu(e){let t=(0,E.c)(3),n=Nu(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function Ru(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function zu(){let e=(0,E.c)(7),t=ju(),n=Nu().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=As(),o=(0,T.useSyncExternalStore)(sa,oa,Bu),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=qo(i,a,r),l=U(c);s=Ru({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??vo(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function Bu(){return null}function Vu(){let e=ju(),t=Nu().developerModeEnabled;return e&&t}var Hu=`borg:sidebar-mode`,Uu;function Wu(){if(Uu===void 0)try{Uu=Ne(Hu,te)}catch{Uu=null}return Uu??`inbox`}function Gu(e){if(Uu!==e){Uu=e;try{Ee(Hu,e,te)}catch{}}}function Ku(){let e=(0,E.c)(3),t=ju(),n=Nu().sidebarMode,r;return e[0]!==t||e[1]!==n?(r=t?n:Wu(),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}function qu(){let e=(0,E.c)(2),t=Nu(),n;return e[0]===t.commanderName?n=e[1]:(n=t.commanderName.trim(),e[0]=t.commanderName,e[1]=n),n||`Borg`}function Ju(e,t){let n=(0,E.c)(2),r;return n[0]===e?r=n[1]:(r=Z.settingsValueAtom(e),n[0]=e,n[1]=r),Iu(v(r)??u,t)}function Yu(e){return Iu(v(gc),e)}function Xu(e){let t=(0,E.c)(3),n=dn(Z.updateSettings,`server settings update`),r;return t[0]!==e||t[1]!==n?(r=t=>{let{serverPatch:r,clientPatch:i}=Du(t);Object.keys(r).length>0&&e&&Jl(n({environmentId:e,input:{patch:r}}).then(Zu),r,`server`),Object.keys(i).length>0&&Tu(i)},t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function Zu(e){return e._tag===`Success`}function Qu(e){return Xu(e)}function $u(){return Xu(ou()?.environmentId??null)}function ed(e){let t=(0,E.c)(2),n=e?.analytics!==!1,r;return t[0]===n?r=t[1]:(r=e=>{Tu(e,{analytics:n})},t[0]=n,t[1]=r),r}export{Z as $,Il as A,Ta as At,Nc as B,Vi as Bt,$l as C,ma as Ct,Vl as D,Mo as Dt,zl as E,Po as Et,dl as F,jo as Ft,mc as G,mn as Gt,lc as H,Ii as Ht,qc as I,go as It,bc as J,cn as Jt,Sc as K,dn as Kt,tl as L,Li as Lt,ul as M,Oa as Mt,fl as N,Ja as Nt,Ul as O,qo as Ot,ml as P,So as Pt,hc as Q,Jc as R,Bi as Rt,Zl as S,ua as St,Hl as T,No as Tt,yc as U,Ui as Ut,dc as V,zi as Vt,Q as W,pn as Wt,_c as X,Cc as Y,an as Yt,gc as Z,ru as _,W as _t,Lu as a,Qo as at,ou as b,Ao as bt,Vu as c,As as ct,Yu as d,Ca as dt,cc as et,Ku as f,ho as ft,au as g,zo as gt,$u as h,Da as ht,Gu as i,Zo as it,hl as j,yo as jt,Ll as k,Lo as kt,zu as l,Vo as lt,Qu as m,Ia as mt,Ou as n,ic as nt,ju as o,gs as ot,ed as p,wa as pt,vc as q,D as qt,Au as r,ms as rt,qu as s,xs as st,ku as t,sc as tt,Ju as u,co as ut,su as v,U as vt,Jl as w,Io as wt,iu as x,Ea as xt,tu as y,bo as yt,$ as z,Ri as zt};
5
+ //# sourceMappingURL=useSettings-DD7ohMuP.js.map
@@ -1,2 +1,2 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./accountData-C4ZvicpJ.js";var r=t(),i=e(n(),1),a=new Set([`command_execution`,`file_change`]);function o(e){return e.payload!==null&&typeof e.payload==`object`?e.payload:null}function s(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(!n)continue;let r=o(n),i=n.kind===`tool.updated`&&typeof r?.status==`string`&&r.status!==`inProgress`&&r.status!==`in_progress`;if(n.kind!==`tool.completed`&&!i)continue;let s=r?.itemType;if(typeof s==`string`&&a.has(s))return n.id}return null}function c(e,t){return t===null?null:`${e}\u0000${t}`}function l(e){let t=(0,r.c)(6),{enabled:n,mutationId:a,refresh:o,resourceKey:s}=e,l=n===void 0?!0:n,u=(0,i.useRef)(null),d,f;t[0]!==l||t[1]!==a||t[2]!==o||t[3]!==s?(d=()=>{if(!l)return;let e=c(s,a);e===null||e===u.current||(u.current=e,o())},f=[l,a,o,s],t[0]=l,t[1]=a,t[2]=o,t[3]=s,t[4]=d,t[5]=f):(d=t[4],f=t[5]),(0,i.useEffect)(d,f)}export{l as n,s as t};
2
- //# sourceMappingURL=useWorkspaceMutationRefresh-DLI4brDf.js.map
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./accountData-BKyjOPQm.js";var r=t(),i=e(n(),1),a=new Set([`command_execution`,`file_change`]);function o(e){return e.payload!==null&&typeof e.payload==`object`?e.payload:null}function s(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(!n)continue;let r=o(n),i=n.kind===`tool.updated`&&typeof r?.status==`string`&&r.status!==`inProgress`&&r.status!==`in_progress`;if(n.kind!==`tool.completed`&&!i)continue;let s=r?.itemType;if(typeof s==`string`&&a.has(s))return n.id}return null}function c(e,t){return t===null?null:`${e}\u0000${t}`}function l(e){let t=(0,r.c)(6),{enabled:n,mutationId:a,refresh:o,resourceKey:s}=e,l=n===void 0?!0:n,u=(0,i.useRef)(null),d,f;t[0]!==l||t[1]!==a||t[2]!==o||t[3]!==s?(d=()=>{if(!l)return;let e=c(s,a);e===null||e===u.current||(u.current=e,o())},f=[l,a,o,s],t[0]=l,t[1]=a,t[2]=o,t[3]=s,t[4]=d,t[5]=f):(d=t[4],f=t[5]),(0,i.useEffect)(d,f)}export{l as n,s as t};
2
+ //# sourceMappingURL=useWorkspaceMutationRefresh-ApasU6PB.js.map