@puddle-code/cli 0.1.5 → 0.1.7

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 (53) hide show
  1. package/CHANGELOG.md +5 -2
  2. package/dist/index.js +101 -4
  3. package/dist/public/assets/Dashboard-CK6pd6yc.js +1 -0
  4. package/dist/public/assets/EditorTabClose-NXE25Hkk.js +1 -0
  5. package/dist/public/assets/LazyTerminal-YJYBkGGG.js +2 -0
  6. package/dist/public/assets/{ModelRefcount-DICQmr_U.js → ModelRefcount-qiBWxl8V.js} +1 -1
  7. package/dist/public/assets/PaneEditorBody-CSxRXAbs.js +548 -0
  8. package/dist/public/assets/PdfViewer-CNMgA3ee.js +2 -0
  9. package/dist/public/assets/SettingsDialog-DA4x9Y9W.js +1 -0
  10. package/dist/public/assets/{Terminal-CaSnRa97.js → Terminal-UR8urwx4.js} +2 -2
  11. package/dist/public/assets/Workspace-DbEp1PKp.js +8 -0
  12. package/dist/public/assets/api-IpGGhtRp.js +73 -0
  13. package/dist/public/assets/{buffer-store-BcP5NZY1.js → buffer-store-C_9Ib5qf.js} +3 -3
  14. package/dist/public/assets/chevron-down-DNyOBhEl.js +1 -0
  15. package/dist/public/assets/context-menu-Ca0Uv2BE.js +1 -0
  16. package/dist/public/assets/{cssMode-D_s8-LG-.js → cssMode-gGXxIWCL.js} +1 -1
  17. package/dist/public/assets/dialog-CFa2VFV0.js +41 -0
  18. package/dist/public/assets/dist-DEu2RD64.js +1 -0
  19. package/dist/public/assets/{drafts-aCUyv99S.js → drafts-DJULaAJ0.js} +1 -1
  20. package/dist/public/assets/file-links-CcWnhnkT.js +1 -0
  21. package/dist/public/assets/{htmlMode-w2PMeqkB.js → htmlMode-C2tT4YRo.js} +1 -1
  22. package/dist/public/assets/index-C_32FmnW.css +2 -0
  23. package/dist/public/assets/index-fAfi8H1Y.js +10 -0
  24. package/dist/public/assets/{jsonMode-7M0M5N_r.js → jsonMode-BphVURBo.js} +1 -1
  25. package/dist/public/assets/jsx-runtime-ffCh33zF.js +1 -0
  26. package/dist/public/assets/media-refresh-store-CDq91uhk.js +1 -0
  27. package/dist/public/assets/pdf-EQHMWEbX.js +54 -0
  28. package/dist/public/assets/pdf.worker.min-C8Ts8bNu.js +1 -0
  29. package/dist/public/assets/pdf.worker.min-CHFwMXne.mjs +29 -0
  30. package/dist/public/assets/session-seed-D2FbVBft.js +1 -0
  31. package/dist/public/assets/{tsMode-Waowb1hW.js → tsMode-B6jh6JrU.js} +1 -1
  32. package/dist/public/assets/use-find-controls-B_INkoQ4.js +1 -0
  33. package/dist/public/assets/x-cVj9N3GX.js +1 -0
  34. package/dist/public/index.html +7 -6
  35. package/package.json +1 -1
  36. package/dist/public/assets/Dashboard-D9s9d3s7.js +0 -1
  37. package/dist/public/assets/EditorTabClose-t3P2bAhW.js +0 -1
  38. package/dist/public/assets/LazyTerminal-CUvKopns.js +0 -2
  39. package/dist/public/assets/PaneEditorBody-D13ri3kV.js +0 -515
  40. package/dist/public/assets/SettingsDialog-n1xotqjt.js +0 -1
  41. package/dist/public/assets/Workspace-DK_11zYW.js +0 -7
  42. package/dist/public/assets/chevron-down-59O6CgEo.js +0 -1
  43. package/dist/public/assets/context-menu-3M2mwQQE.js +0 -1
  44. package/dist/public/assets/dialog-DjL0qoAv.js +0 -41
  45. package/dist/public/assets/dist-DDFe8e3m.js +0 -1
  46. package/dist/public/assets/editor-context-DBjXfTll.js +0 -1
  47. package/dist/public/assets/file-links-BJG9RIby.js +0 -1
  48. package/dist/public/assets/hotkeys-CekBkaTu.js +0 -73
  49. package/dist/public/assets/index-BBk5N4Nn.css +0 -2
  50. package/dist/public/assets/index-D_YMr1MK.js +0 -10
  51. package/dist/public/assets/session-seed-Cp2CWmMa.js +0 -1
  52. package/dist/public/assets/use-find-controls-DT8ORgZB.js +0 -1
  53. package/dist/public/assets/x-BJOrp_m5.js +0 -1
@@ -1,4 +1,4 @@
1
- import{h as e,p as t}from"./editor.api2-4X9Vh9Zw.js";import{h as n}from"./buffer-store-BcP5NZY1.js";import{_ as r,a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b}from"./lspLanguageFeatures-x2nWJpem.js";var x=120*1e3,S=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>x&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=n({moduleId:`vs/language/json/jsonWorker`,createWorker:()=>new Worker(new URL(`/assets/json.worker-Oa9UrkKE.js`,``+import.meta.url),{type:`module`}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}};function C(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&E(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&E(e.charCodeAt(r)))for(r++;r<e.length&&E(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&E(e.charCodeAt(r))){for(r++;r<e.length&&E(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
1
+ import{h as e,p as t}from"./editor.api2-4X9Vh9Zw.js";import{h as n}from"./buffer-store-C_9Ib5qf.js";import{_ as r,a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b}from"./lspLanguageFeatures-x2nWJpem.js";var x=120*1e3,S=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>x&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=n({moduleId:`vs/language/json/jsonWorker`,createWorker:()=>new Worker(new URL(`/assets/json.worker-Oa9UrkKE.js`,``+import.meta.url),{type:`module`}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}};function C(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&E(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&E(e.charCodeAt(r)))for(r++;r<e.length&&E(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&E(e.charCodeAt(r))){for(r++;r<e.length&&E(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
2
2
  `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(T(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(w(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(w(t));return o=15}if(T(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
3
3
  `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!T(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,T(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!E(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(w(e)||T(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function w(e){return e===32||e===9}function T(e){return e===10||e===13}function E(e){return e>=48&&e<=57}var D;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(D||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var O=200;Array(O).fill(0).map((e,t)=>`
4
4
  `+` `.repeat(t)),Array(O).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(O).fill(0).map((e,t)=>`\r
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";var n=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),r=e(((e,t)=>{function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()})),i=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),a=e(((e,t)=>{t.exports=i()}));export{r as n,a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{T as r,n as i,r as a}from"./api-IpGGhtRp.js";import{n as o}from"./x-cVj9N3GX.js";import{Wn as s,dr as c,fr as l,hr as u,lr as d,mr as f,pr as p,ur as m}from"./index-fAfi8H1Y.js";var h=class extends p{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,d=i&&c===`forward`,p=o&&c===`backward`,m=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(t,n.data),hasPreviousPage:u(t,n.data),isFetchNextPageError:l,isFetchingNextPage:d,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:s&&!l&&!p,isRefetching:a&&!d&&!m}}};function ee(e,t){return c(e,h,t)}var g=o(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),_=50;function v(e){return e===void 0?``:`&root=${encodeURIComponent(e)}`}function y(e){return e?{placeholderData:e=>e}:{}}function b(e,t,n){let r=e!==void 0;return m({queryKey:n===void 0?[`wt-tree`,e,t]:[`wt-tree`,e,t,n],queryFn:()=>i(`GET`,`/api/worktrees/${e}/tree?path=${encodeURIComponent(t)}${v(n)}`),enabled:r,...y(r)})}function x(e,t,n){let r=n?.root;return m({queryKey:r===void 0?[`wt-file`,e,t]:[`wt-file`,e,t,r],queryFn:()=>i(`GET`,`/api/worktrees/${e}/file?path=${encodeURIComponent(t)}${v(r)}`),enabled:e!==void 0&&(n?.enabled??!0),...n?.live===!0?{refetchInterval:s(3e3),refetchOnWindowFocus:!0}:{}})}function te(e,t){let n=l();return d({mutationFn:({path:n,...r})=>i(`PUT`,`/api/worktrees/${e}/file?path=${encodeURIComponent(n)}${v(t)}`,r),onSuccess:(r,{path:i})=>{n.invalidateQueries({queryKey:t===void 0?[`wt-file`,e,i]:[`wt-file`,e,i,t]}),n.invalidateQueries({queryKey:[`wt-diff`,e]})}})}function ne(e,t){let n=t?.against??`base`,r=t?.area,a=t?.root,o=e!==void 0&&(t?.enabled??!0);return m({queryKey:a===void 0?[`wt-diff`,e,n,r]:[`wt-diff`,e,n,r,a],queryFn:()=>{let t=r===void 0?``:`&area=${r}`;return i(`GET`,`/api/worktrees/${e}/diff?against=${n}${t}${v(a)}`)},enabled:o,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...y(o)})}function re(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return m({queryKey:n===void 0?[`git-repositories`,e]:[`git-repositories`,e,n],queryFn:()=>i(`GET`,`/api/worktrees/${e}/git-repositories${S(n)}`),enabled:r,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...y(r)})}function ie(e,t,n){let r=n?.root,a=e!==void 0&&(n?.enabled??!0);return m({queryKey:[`git-original`,e,t,r],queryFn:()=>i(`GET`,`/api/worktrees/${e}/git-original?path=${encodeURIComponent(t)}${v(r)}`),enabled:a,refetchInterval:s(1e4),refetchOnWindowFocus:!0})}function ae(e,t,n){let r=n?.root;return m({queryKey:[`git-index-file`,e,t,r],queryFn:()=>i(`GET`,`/api/worktrees/${e}/index-file?path=${encodeURIComponent(t)}${v(r)}`),enabled:e!==void 0&&(n?.enabled??!0)})}function oe(e,t){let n=l();return d({mutationFn:({action:n,...r})=>i(`POST`,`/api/worktrees/${e}/git-${n}${S(t)}`,r),onSuccess:()=>{n.invalidateQueries({queryKey:[`git-repositories`,e]}),n.invalidateQueries({queryKey:[`wt-git-status`,e]}),n.invalidateQueries({queryKey:[`wt-diff`,e]}),n.invalidateQueries({queryKey:[`wt-log`,e]}),n.invalidateQueries({queryKey:[`wt-show`,e]}),n.invalidateQueries({queryKey:[`git-original`,e]}),n.invalidateQueries({queryKey:[`git-index-file`,e]})}})}function se(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return m({queryKey:n===void 0?[`wt-git-status`,e]:[`wt-git-status`,e,n],queryFn:()=>i(`GET`,`/api/worktrees/${e}/git-status${S(n)}`),enabled:r,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...y(r)})}function S(e){return e===void 0?``:`?root=${encodeURIComponent(e)}`}function ce(e,t,n,r){return i(`POST`,`/api/worktrees/${e}/create${S(r)}`,{path:t,kind:n})}function le(e,t,n,r){return i(`POST`,`/api/worktrees/${e}/rename${S(r)}`,{from:t,to:n})}function ue(e,t,n,r){return i(`POST`,`/api/worktrees/${e}/copy${S(r)}`,{from:t,to:n})}function de(e,t,n){return i(`POST`,`/api/worktrees/${e}/transfer${S(n)}`,t)}function fe(e,t,n){return i(`POST`,`/api/worktrees/${e}/delete${S(n)}`,{path:t})}function pe(e,t,n){let{query:r,regex:a,caseSensitive:o,wholeWord:s}=t;return m({queryKey:[`wt-search`,e,r,a,o,s,n],queryFn:()=>{let t=new URLSearchParams({q:r});return a&&t.set(`regex`,`1`),o&&t.set(`case`,`1`),s&&t.set(`word`,`1`),n!==void 0&&t.set(`root`,n),i(`GET`,`/api/worktrees/${e}/search?${t.toString()}`)},enabled:e!==void 0&&r.length>0,staleTime:2e3})}function me(e,t,n,r){let a=r?.root;return m({queryKey:[`wt-file-at`,e,t,n,a],queryFn:()=>i(`GET`,`/api/worktrees/${e}/file-at?ref=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}${v(a)}`),enabled:e!==void 0&&(r?.enabled??!0),staleTime:1/0})}function C(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return ee({queryKey:n===void 0?[`wt-log`,e]:[`wt-log`,e,n],queryFn:({pageParam:t})=>i(`GET`,`/api/worktrees/${e}/log?limit=${_}&skip=${t}${v(n)}`),initialPageParam:0,getNextPageParam:(e,t)=>e.has_more?t.length*_:void 0,enabled:r,...y(r)})}function w(e,t,n){return m({queryKey:n===void 0?[`wt-show`,e,t]:[`wt-show`,e,t,n],queryFn:()=>i(`GET`,`/api/worktrees/${e}/show/${t}${S(n)}`),enabled:e!==void 0&&t!==void 0,staleTime:1/0})}var T=64*1024*1024;function E(e,t){let n=[],r=[],i=0;for(let a of e)r.length>0&&i+a.size>t&&(n.push(r),r=[],i=0),r.push(a),i+=a.size;return r.length>0&&n.push(r),n}async function D(e,t,n,r){let i=[];for(let o of E(n,T)){let n=new FormData;for(let e of o)n.append(`files`,e,e.name);let s=await a(`POST`,`/api/worktrees/${e}/upload?dir=${encodeURIComponent(t)}${v(r)}`,{body:n});i.push(...(await s.json()).files)}return{files:i}}function O(e,t){if(!e)return t;let n=/filename\*=UTF-8''([^;]+)/i.exec(e);if(n?.[1])try{return decodeURIComponent(n[1])}catch{return t}return/filename="?([^"; ]+)"?/i.exec(e)?.[1]??t}async function k(e,t,n){let r=await a(`GET`,`/api/worktrees/${e}/download?path=${encodeURIComponent(t)}${v(n)}`),i=await r.blob(),o=t.split(`/`).filter(Boolean).pop()??`worktree`,s=O(r.headers.get(`content-disposition`),o),c=URL.createObjectURL(i);try{let e=document.createElement(`a`);e.href=c,e.download=s,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(c)}}var A=e(t(),1),j=[],M=new Map,N=new Map,P=new Map;function F(e,t){let n=M.get(e)??j;t.length===0?M.delete(e):M.set(e,t);let r=new Set([...n.map(e=>B(e.source)),...t.map(e=>B(e.source))]);for(let e of r)z(e)}function I(e){F(e,j)}function L(e,t,n){let r=B({session:e,path:t,...n===void 0?{}:{root:n}});return(0,A.useSyncExternalStore)((0,A.useCallback)(e=>he(r,e),[r]),()=>R({session:e,path:t,...n===void 0?{}:{root:n}}))}function R(e){return N.get(B(e))??j}function z(e){let t=[...M.values()].flatMap(t=>t.filter(t=>B(t.source)===e));t.length===0?N.delete(e):N.set(e,t);for(let t of P.get(e)??[])t()}function he(e,t){let n=P.get(e)??new Set;return n.add(t),P.set(e,n),()=>{n.delete(t),n.size===0&&P.delete(e)}}function B(e){return JSON.stringify([e.session,e.root??null,e.path])}function V(e,t,n){let r=`${encodeURIComponent(e)}:${encodeURIComponent(t)}`;return n===void 0?r:`${r}:${encodeURIComponent(n)}`}var H=new Map;function ge(e,t,n){let r={save:t,...n?{target:n}:{}};return H.set(e,r),()=>{H.get(e)===r&&H.delete(e)}}function _e(e){if(e===null)return!1;let t=H.get(e);return t?(t.save(),!0):!1}async function ve(e,t){let n=V(e.session,e.path,e.root),r=[...H.entries()].flatMap(([r,i])=>{let a=i.target;if(!a||a.session!==e.session||a.root!==e.root)return[];let o=ye(a.path);return r!==n&&!t.has(o)?[]:[Promise.resolve(i.save())]});return(await Promise.all(r)).every(e=>e!==!1)}function ye(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<0?``:t.slice(n+1).toLowerCase()}var be=`UTC`;function xe(e){return new Date(e).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,timeZone:be})}var U=60,W=60*U,G=24*W,Se=7*G;function Ce(e,t=new Date){let n=new Date(e).getTime(),r=Math.max(0,Math.floor((t.getTime()-n)/1e3));return r<U?`just now`:r<W?`${Math.floor(r/U)} m ago`:r<G?`${Math.floor(r/W)} h ago`:r<Se?`${Math.floor(r/G)} d ago`:xe(n)}function we(e,t){return t?`added`:e}function Te(e){return i(`POST`,`/api/profiles/${e}/untitled`)}function K(e,t){return[`untitled`,e,t]}function Ee(e,t){return m({queryKey:K(e,t),queryFn:()=>i(`GET`,`/api/profiles/${e}/untitled/${t}`),enabled:e!==null,staleTime:1/0})}function De(e,t,n,r){e.setQueryData(K(t,n),e=>e===void 0?e:{...e,content:r})}function Oe(e,t,n){return i(`PUT`,`/api/profiles/${e}/untitled/${t}`,{content:n})}function ke(e,t){return i(`DELETE`,`/api/profiles/${e}/untitled/${t}`)}var q=null,J=new Map;function Ae(e){q=e}function je(e){q?.(e)}function Me(e,t){J.set(e,t)}function Ne(e){return J.get(e)}function Pe(e){J.delete(e)}var Y=n(),X=(0,A.createContext)({openFile:()=>void 0,handler:null,setHandler:()=>void 0});function Fe({children:e}){let[t,n]=(0,A.useState)(null),i=(0,A.useCallback)(e=>n(()=>e),[]),a=(0,A.useCallback)((e,n,i,a)=>{if(!t){r(`The editor is not ready yet.`);return}t(e,n,i,a)},[t]),o=(0,A.useMemo)(()=>({openFile:a,handler:t,setHandler:i}),[a,t,i]);return(0,Y.jsx)(X.Provider,{value:o,children:e})}function Ie(){let{openFile:e}=(0,A.useContext)(X);return{openFile:e}}function Le(e){let{setHandler:t}=(0,A.useContext)(X),n=(0,A.useRef)(e);n.current=e,(0,A.useEffect)(()=>(t((e,t,r,i)=>n.current(e,t,r,i)),()=>t(null)),[t])}var Z=new Map,Q=new Map;function Re(e,t,n){let r=$(e,t,n);Z.set(r,(Z.get(r)??0)+1);for(let e of Q.get(r)??[])e()}function ze(e,t,n){let r=$(e,t,n),i=(0,A.useCallback)(e=>Be(r,e),[r]),a=(0,A.useCallback)(()=>Z.get(r)??0,[r]);return(0,A.useSyncExternalStore)(i,a,a)}function Be(e,t){let n=Q.get(e);return n||(n=new Set,Q.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&Q.delete(e)}}function $(e,t,n){return JSON.stringify([e,n??null,t])}export{v as A,ne as B,F as C,fe as D,ce as E,oe as F,b as G,se as H,ie as I,g as K,re as L,D as M,w as N,k as O,me as P,ae as R,I as S,ue as T,C as U,x as V,pe as W,Ce as _,Le as a,ve as b,je as c,Te as d,ke as f,we as g,Ee as h,Ie as i,de as j,le as k,Ae as l,De as m,ze as n,Pe as o,Oe as p,Fe as r,Me as s,Re as t,Ne as u,ge as v,L as w,V as x,_e as y,te as z};