miki-moni 0.3.1

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/LICENSE +21 -0
  2. package/README.md +283 -0
  3. package/README.zh-CN.md +275 -0
  4. package/README.zh-TW.md +275 -0
  5. package/bin/miki.mjs +49 -0
  6. package/dist/web/assets/favicon-DFpLtP36.svg +13 -0
  7. package/dist/web/assets/index--89DkyV1.css +1 -0
  8. package/dist/web/assets/index-CyPlxvOn.js +64 -0
  9. package/dist/web/index.html +20 -0
  10. package/dist/web/pair-info.html +138 -0
  11. package/dist/web-phone/assets/app-CyQWCdKZ.js +64 -0
  12. package/dist/web-phone/assets/index-D5BUh7Uf.js +1 -0
  13. package/dist/web-phone/assets/index-D8vY_9ld.css +1 -0
  14. package/dist/web-phone/index.html +20 -0
  15. package/hooks/miki-emit.ps1 +56 -0
  16. package/package.json +89 -0
  17. package/shared/i18n.ts +915 -0
  18. package/src/cli/i18n-cli.ts +149 -0
  19. package/src/cli/miki.ts +168 -0
  20. package/src/cli/pair.ts +534 -0
  21. package/src/cli/prompt.ts +6 -0
  22. package/src/cli/pushable-iter.ts +45 -0
  23. package/src/cli/setup-self-host.ts +292 -0
  24. package/src/cli/setup-wizard.ts +130 -0
  25. package/src/cli/wrap.ts +742 -0
  26. package/src/config.ts +121 -0
  27. package/src/crypto.ts +66 -0
  28. package/src/data-dir.ts +31 -0
  29. package/src/ext-registry.ts +47 -0
  30. package/src/hook-handler.ts +86 -0
  31. package/src/index.ts +279 -0
  32. package/src/install-hooks.ts +107 -0
  33. package/src/notifier.ts +21 -0
  34. package/src/pairing.ts +100 -0
  35. package/src/protocol-ext.ts +46 -0
  36. package/src/relay-client.ts +468 -0
  37. package/src/relay-protocol.ts +57 -0
  38. package/src/server.ts +1134 -0
  39. package/src/session-resolver.ts +437 -0
  40. package/src/session-store.ts +131 -0
  41. package/src/types.ts +33 -0
  42. package/src/vscode-bridge.ts +407 -0
  43. package/src/wrap-process.ts +183 -0
  44. package/tools/tray.ps1 +286 -0
  45. package/worker/package.json +24 -0
  46. package/worker/src/daemon-relay.ts +348 -0
  47. package/worker/src/env.ts +11 -0
  48. package/worker/src/handshake.ts +63 -0
  49. package/worker/src/index.ts +81 -0
  50. package/worker/src/pairing-code.ts +39 -0
  51. package/worker/src/pairing-coordinator.ts +145 -0
  52. package/worker/wrangler-selfhost.toml +36 -0
  53. package/worker/wrangler.toml +29 -0
@@ -0,0 +1,64 @@
1
+ var zs=Object.defineProperty;var Ds=(t,e,n)=>e in t?zs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var X=(t,e,n)=>Ds(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();var _t,G,Kn,Ie,un,Un,qn,Lt,rt,Ge,jn,Nt,Et,$t,ut={},ht=[],Ws=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,bt=Array.isArray;function Se(t,e){for(var n in e)t[n]=e[n];return t}function Ft(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Os(t,e,n){var o,i,r,c={};for(r in e)r=="key"?o=e[r]:r=="ref"?i=e[r]:c[r]=e[r];if(arguments.length>2&&(c.children=arguments.length>3?_t.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)c[r]===void 0&&(c[r]=t.defaultProps[r]);return lt(t,c,o,i,null)}function lt(t,e,n,o,i){var r={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Kn,__i:-1,__u:0};return i==null&&G.vnode!=null&&G.vnode(r),r}function Ce(t){return t.children}function at(t,e){this.props=t,this.context=e}function qe(t,e){if(e==null)return t.__?qe(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?qe(t):null}function Bs(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],i=[],r=Se({},e);r.__v=e.__v+1,G.vnode&&G.vnode(r),Kt(t.__P,r,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,n??qe(e),!!(32&e.__u),i),r.__v=e.__v,r.__.__k[r.__i]=r,Gn(o,r,i),e.__e=e.__=null,r.__e!=n&&Xn(r)}}function Xn(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Xn(t)}function hn(t){(!t.__d&&(t.__d=!0)&&Ie.push(t)&&!gt.__r++||un!=G.debounceRendering)&&((un=G.debounceRendering)||Un)(gt)}function gt(){try{for(var t,e=1;Ie.length;)Ie.length>e&&Ie.sort(qn),t=Ie.shift(),e=Ie.length,Bs(t)}finally{Ie.length=gt.__r=0}}function Vn(t,e,n,o,i,r,c,a,l,p,h){var d,f,y,g,R,b,w,k=o&&o.__k||ht,I=e.length;for(l=Ms(n,e,k,l,I),d=0;d<I;d++)(y=n.__k[d])!=null&&(f=y.__i!=-1&&k[y.__i]||ut,y.__i=d,b=Kt(t,y,f,i,r,c,a,l,p,h),g=y.__e,y.ref&&f.ref!=y.ref&&(f.ref&&Ut(f.ref,null,y),h.push(y.ref,y.__c||g,y)),R==null&&g!=null&&(R=g),(w=!!(4&y.__u))||f.__k===y.__k?(l=Qn(y,l,t,w),w&&f.__e&&(f.__e=null)):typeof y.type=="function"&&b!==void 0?l=b:g&&(l=g.nextSibling),y.__u&=-7);return n.__e=R,l}function Ms(t,e,n,o,i){var r,c,a,l,p,h=n.length,d=h,f=0;for(t.__k=new Array(i),r=0;r<i;r++)(c=e[r])!=null&&typeof c!="boolean"&&typeof c!="function"?(typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?c=t.__k[r]=lt(null,c,null,null,null):bt(c)?c=t.__k[r]=lt(Ce,{children:c},null,null,null):c.constructor===void 0&&c.__b>0?c=t.__k[r]=lt(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):t.__k[r]=c,l=r+f,c.__=t,c.__b=t.__b+1,a=null,(p=c.__i=Hs(c,n,l,d))!=-1&&(d--,(a=n[p])&&(a.__u|=2)),a==null||a.__v==null?(p==-1&&(i>h?f--:i<h&&f++),typeof c.type!="function"&&(c.__u|=4)):p!=l&&(p==l-1?f--:p==l+1?f++:(p>l?f--:f++,c.__u|=4))):t.__k[r]=null;if(d)for(r=0;r<h;r++)(a=n[r])!=null&&!(2&a.__u)&&(a.__e==o&&(o=qe(a)),Jn(a,a));return o}function Qn(t,e,n,o){var i,r;if(typeof t.type=="function"){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=Qn(i[r],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=qe(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Hs(t,e,n,o){var i,r,c,a=t.key,l=t.type,p=e[n],h=p!=null&&(2&p.__u)==0;if(p===null&&a==null||h&&a==p.key&&l==p.type)return n;if(o>(h?1:0)){for(i=n-1,r=n+1;i>=0||r<e.length;)if((p=e[c=i>=0?i--:r++])!=null&&!(2&p.__u)&&a==p.key&&l==p.type)return c}return-1}function gn(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Ws.test(e)?n:n+"px"}function st(t,e,n,o,i){var r,c;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||gn(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||gn(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(jn,"$1")),c=e.toLowerCase(),e=c in t||e=="onFocusOut"||e=="onFocusIn"?c.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n[Ge]=o[Ge]:(n[Ge]=Nt,t.addEventListener(e,r?$t:Et,r)):t.removeEventListener(e,r?$t:Et,r);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function fn(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[rt]==null)e[rt]=Nt++;else if(e[rt]<n[Ge])return;return n(G.event?G.event(e):e)}}}function Kt(t,e,n,o,i,r,c,a,l,p){var h,d,f,y,g,R,b,w,k,I,x,C,A,F,S,B=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),r=[a=e.__e=n.__e]),(h=G.__b)&&h(e);e:if(typeof B=="function")try{if(w=e.props,k=B.prototype&&B.prototype.render,I=(h=B.contextType)&&o[h.__c],x=h?I?I.props.value:h.__:o,n.__c?b=(d=e.__c=n.__c).__=d.__E:(k?e.__c=d=new B(w,x):(e.__c=d=new at(w,x),d.constructor=B,d.render=Fs),I&&I.sub(d),d.state||(d.state={}),d.__n=o,f=d.__d=!0,d.__h=[],d._sb=[]),k&&d.__s==null&&(d.__s=d.state),k&&B.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Se({},d.__s)),Se(d.__s,B.getDerivedStateFromProps(w,d.__s))),y=d.props,g=d.state,d.__v=e,f)k&&B.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),k&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(k&&B.getDerivedStateFromProps==null&&w!==y&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(w,x),e.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(w,d.__s,x)===!1){e.__v!=n.__v&&(d.props=w,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(q){q&&(q.__=e)}),ht.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&c.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(w,d.__s,x),k&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(y,g,R)})}if(d.context=x,d.props=w,d.__P=t,d.__e=!1,C=G.__r,A=0,k)d.state=d.__s,d.__d=!1,C&&C(e),h=d.render(d.props,d.state,d.context),ht.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,C&&C(e),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++A<25);d.state=d.__s,d.getChildContext!=null&&(o=Se(Se({},o),d.getChildContext())),k&&!f&&d.getSnapshotBeforeUpdate!=null&&(R=d.getSnapshotBeforeUpdate(y,g)),F=h!=null&&h.type===Ce&&h.key==null?Zn(h.props.children):h,a=Vn(t,bt(F)?F:[F],e,n,o,i,r,c,a,l,p),d.base=e.__e,e.__u&=-161,d.__h.length&&c.push(d),b&&(d.__E=d.__=null)}catch(q){if(e.__v=null,l||r!=null)if(q.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,e.__e=a}else{for(S=r.length;S--;)Ft(r[S]);At(e)}else e.__e=n.__e,e.__k=n.__k,q.then||At(e);G.__e(q,e,n)}else r==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=Ns(n.__e,e,n,o,i,r,c,l,p);return(h=G.diffed)&&h(e),128&e.__u?void 0:a}function At(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(At))}function Gn(t,e,n){for(var o=0;o<n.length;o++)Ut(n[o],n[++o],n[++o]);G.__c&&G.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){G.__e(r,i.__v)}})}function Zn(t){return typeof t!="object"||t==null||t.__b>0?t:bt(t)?t.map(Zn):Se({},t)}function Ns(t,e,n,o,i,r,c,a,l){var p,h,d,f,y,g,R,b=n.props||ut,w=e.props,k=e.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(p=0;p<r.length;p++)if((y=r[p])&&"setAttribute"in y==!!k&&(k?y.localName==k:y.nodeType==3)){t=y,r[p]=null;break}}if(t==null){if(k==null)return document.createTextNode(w);t=document.createElementNS(i,k,w.is&&w),a&&(G.__m&&G.__m(e,r),a=!1),r=null}if(k==null)b===w||a&&t.data==w||(t.data=w);else{if(r=r&&_t.call(t.childNodes),!a&&r!=null)for(b={},p=0;p<t.attributes.length;p++)b[(y=t.attributes[p]).name]=y.value;for(p in b)y=b[p],p=="dangerouslySetInnerHTML"?d=y:p=="children"||p in w||p=="value"&&"defaultValue"in w||p=="checked"&&"defaultChecked"in w||st(t,p,null,y,i);for(p in w)y=w[p],p=="children"?f=y:p=="dangerouslySetInnerHTML"?h=y:p=="value"?g=y:p=="checked"?R=y:a&&typeof y!="function"||b[p]===y||st(t,p,y,b[p],i);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Vn(e.type=="template"?t.content:t,bt(f)?f:[f],e,n,o,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,c,r?r[0]:n.__k&&qe(n,0),a,l),r!=null)for(p=r.length;p--;)Ft(r[p]);a||(p="value",k=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[p]||k=="progress"&&!g||k=="option"&&g!=b[p])&&st(t,p,g,b[p],i),p="checked",R!=null&&R!=t[p]&&st(t,p,R,b[p],i))}return t}function Ut(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(i){G.__e(i,n)}}function Jn(t,e,n){var o,i;if(G.unmount&&G.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Ut(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){G.__e(r,e)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&Jn(o[i],e,n||typeof t.type!="function");n||Ft(t.__e),t.__c=t.__=t.__e=void 0}function Fs(t,e,n){return this.constructor(t,n)}function Ks(t,e,n){var o,i,r,c;e==document&&(e=document.documentElement),G.__&&G.__(t,e),i=(o=!1)?null:e.__k,r=[],c=[],Kt(e,t=e.__k=Os(Ce,null,[t]),i||ut,ut,e.namespaceURI,i?null:e.firstChild?_t.call(e.childNodes):null,r,i?i.__e:e.firstChild,o,c),Gn(r,t,c)}_t=ht.slice,G={__e:function(t,e,n,o){for(var i,r,c;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),c=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,o||{}),c=i.__d),c)return i.__E=i}catch(a){t=a}throw t}},Kn=0,at.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Se({},this.state),typeof t=="function"&&(t=t(Se({},n),this.props)),t&&Se(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),hn(this))},at.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),hn(this))},at.prototype.render=Ce,Ie=[],Un=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qn=function(t,e){return t.__v.__b-e.__v.__b},gt.__r=0,Lt=Math.random().toString(8),rt="__d"+Lt,Ge="__a"+Lt,jn=/(PointerCapture)$|Capture$/i,Nt=0,Et=fn(!1),$t=fn(!0);var Us=0;function s(t,e,n,o,i,r){e||(e={});var c,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?c=e[a]:l[a]=e[a];var p={type:t,props:l,key:n,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Us,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(c=t.defaultProps))for(a in c)l[a]===void 0&&(l[a]=c[a]);return G.vnode&&G.vnode(p),p}var Je,se,Rt,mn,ft=0,Yn=[],ie=G,yn=ie.__b,wn=ie.__r,kn=ie.diffed,_n=ie.__c,bn=ie.unmount,vn=ie.__;function qt(t,e){ie.__h&&ie.__h(se,t,ft||e),ft=0;var n=se.__H||(se.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function v(t){return ft=1,qs(ts,t)}function qs(t,e,n){var o=qt(Je++,2);if(o.t=t,!o.__c&&(o.__=[ts(void 0,e),function(a){var l=o.__N?o.__N[0]:o.__[0],p=o.t(l,a);l!==p&&(o.__N=[p,o.__[1]],o.__c.setState({}))}],o.__c=se,!se.__f)){var i=function(a,l,p){if(!o.__c.__H)return!0;var h=o.__c.__H.__.filter(function(f){return f.__c});if(h.every(function(f){return!f.__N}))return!r||r.call(this,a,l,p);var d=o.__c.props!==a;return h.some(function(f){if(f.__N){var y=f.__[0];f.__=f.__N,f.__N=void 0,y!==f.__[0]&&(d=!0)}}),r&&r.call(this,a,l,p)||d};se.__f=!0;var r=se.shouldComponentUpdate,c=se.componentWillUpdate;se.componentWillUpdate=function(a,l,p){if(this.__e){var h=r;r=void 0,i(a,l,p),r=h}c&&c.call(this,a,l,p)},se.shouldComponentUpdate=i}return o.__N||o.__}function j(t,e){var n=qt(Je++,3);!ie.__s&&es(n.__H,e)&&(n.__=t,n.u=e,se.__H.__h.push(n))}function ee(t){return ft=5,Oe(function(){return{current:t}},[])}function Oe(t,e){var n=qt(Je++,7);return es(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function js(){for(var t;t=Yn.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ct),e.__h.some(zt),e.__h=[]}catch(n){e.__h=[],ie.__e(n,t.__v)}}}ie.__b=function(t){se=null,yn&&yn(t)},ie.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vn&&vn(t,e)},ie.__r=function(t){wn&&wn(t),Je=0;var e=(se=t.__c).__H;e&&(Rt===se?(e.__h=[],se.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(ct),e.__h.some(zt),e.__h=[],Je=0)),Rt=se},ie.diffed=function(t){kn&&kn(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Yn.push(e)!==1&&mn===ie.requestAnimationFrame||((mn=ie.requestAnimationFrame)||Xs)(js)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Rt=se=null},ie.__c=function(t,e){e.some(function(n){try{n.__h.some(ct),n.__h=n.__h.filter(function(o){return!o.__||zt(o)})}catch(o){e.some(function(i){i.__h&&(i.__h=[])}),e=[],ie.__e(o,n.__v)}}),_n&&_n(t,e)},ie.unmount=function(t){bn&&bn(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(o){try{ct(o)}catch(i){e=i}}),n.__H=void 0,e&&ie.__e(e,n.__v))};var xn=typeof requestAnimationFrame=="function";function Xs(t){var e,n=function(){clearTimeout(o),xn&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);xn&&(e=requestAnimationFrame(n))}function ct(t){var e=se,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),se=e}function zt(t){var e=se;t.__c=t.__(),se=e}function es(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function ts(t,e){return typeof e=="function"?e(t):e}function jt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Me=jt();function ns(t){Me=t}var We={exec:()=>null};function N(t,e=""){let n=typeof t=="string"?t:t.source,o={replace:(i,r)=>{let c=typeof r=="string"?r:r.source;return c=c.replace(ae.caret,"$1"),n=n.replace(i,c),o},getRegex:()=>new RegExp(n,e)};return o}var Vs=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ae={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Qs=/^(?:[ \t]*(?:\n|$))+/,Gs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ye=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Js=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Xt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ss=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,is=N(ss).replace(/bull/g,Xt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ys=N(ss).replace(/bull/g,Xt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Vt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ei=/^[^\n]+/,Qt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ti=N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Qt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ni=N(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xt).getRegex(),vt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Gt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,si=N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Gt).replace("tag",vt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),os=N(Vt).replace("hr",Ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vt).getRegex(),ii=N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",os).getRegex(),Zt={blockquote:ii,code:Gs,def:ti,fences:Zs,heading:Js,hr:Ye,html:si,lheading:is,list:ni,newline:Qs,paragraph:os,table:We,text:ei},Sn=N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vt).getRegex(),oi={...Zt,lheading:Ys,table:Sn,paragraph:N(Vt).replace("hr",Ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vt).getRegex()},ri={...Zt,html:N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:We,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:N(Vt).replace("hr",Ye).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",is).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},li=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ai=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rs=/^( {2,}|\\)\n(?!\s*$)/,ci=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,je=/[\p{P}\p{S}]/u,xt=/[\s\p{P}\p{S}]/u,Jt=/[^\s\p{P}\p{S}]/u,di=N(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xt).getRegex(),ls=/(?!~)[\p{P}\p{S}]/u,pi=/(?!~)[\s\p{P}\p{S}]/u,ui=/(?:[^\s\p{P}\p{S}]|~)/u,hi=N(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Vs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),as=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gi=N(as,"u").replace(/punct/g,je).getRegex(),fi=N(as,"u").replace(/punct/g,ls).getRegex(),cs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mi=N(cs,"gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,xt).replace(/punct/g,je).getRegex(),yi=N(cs,"gu").replace(/notPunctSpace/g,ui).replace(/punctSpace/g,pi).replace(/punct/g,ls).getRegex(),wi=N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,xt).replace(/punct/g,je).getRegex(),ki=N(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,je).getRegex(),_i="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",bi=N(_i,"gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,xt).replace(/punct/g,je).getRegex(),vi=N(/\\(punct)/,"gu").replace(/punct/g,je).getRegex(),xi=N(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Si=N(Gt).replace("(?:-->|$)","-->").getRegex(),Ci=N("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Si).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ti=N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",mt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ds=N(/^!?\[(label)\]\[(ref)\]/).replace("label",mt).replace("ref",Qt).getRegex(),ps=N(/^!?\[(ref)\](?:\[\])?/).replace("ref",Qt).getRegex(),Li=N("reflink|nolink(?!\\()","g").replace("reflink",ds).replace("nolink",ps).getRegex(),Cn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Yt={_backpedal:We,anyPunctuation:vi,autolink:xi,blockSkip:hi,br:rs,code:ai,del:We,delLDelim:We,delRDelim:We,emStrongLDelim:gi,emStrongRDelimAst:mi,emStrongRDelimUnd:wi,escape:li,link:Ti,nolink:ps,punctuation:di,reflink:ds,reflinkSearch:Li,tag:Ci,text:ci,url:We},Ri={...Yt,link:N(/^!?\[(label)\]\((.*?)\)/).replace("label",mt).getRegex(),reflink:N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mt).getRegex()},Dt={...Yt,emStrongRDelimAst:yi,emStrongLDelim:fi,delLDelim:ki,delRDelim:bi,url:N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Cn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:N(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Cn).getRegex()},Ii={...Dt,br:N(rs).replace("{2,}","*").getRegex(),text:N(Dt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},it={normal:Zt,gfm:oi,pedantic:ri},Ve={normal:Yt,gfm:Dt,breaks:Ii,pedantic:Ri},Pi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Tn=t=>Pi[t];function _e(t,e){if(e){if(ae.escapeTest.test(t))return t.replace(ae.escapeReplace,Tn)}else if(ae.escapeTestNoEncode.test(t))return t.replace(ae.escapeReplaceNoEncode,Tn);return t}function Ln(t){try{t=encodeURI(t).replace(ae.percentDecode,"%")}catch{return null}return t}function Rn(t,e){var r;let n=t.replace(ae.findPipe,(c,a,l)=>{let p=!1,h=a;for(;--h>=0&&l[h]==="\\";)p=!p;return p?"|":" |"}),o=n.split(ae.splitPipe),i=0;if(o[0].trim()||o.shift(),o.length>0&&!((r=o.at(-1))!=null&&r.trim())&&o.pop(),e)if(o.length>e)o.splice(e);else for(;o.length<e;)o.push("");for(;i<o.length;i++)o[i]=o[i].trim().replace(ae.slashPipe,"|");return o}function Re(t,e,n){let o=t.length;if(o===0)return"";let i=0;for(;i<o&&t.charAt(o-i-1)===e;)i++;return t.slice(0,o-i)}function In(t){let e=t.split(`
3
+ `),n=e.length-1;for(;n>=0&&ae.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
4
+ `)}function Ei(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===e[0])n++;else if(t[o]===e[1]&&(n--,n<0))return o;return n>0?-2:-1}function $i(t,e=0){let n=e,o="";for(let i of t)if(i===" "){let r=4-n%4;o+=" ".repeat(r),n+=r}else o+=i,n++;return o}function Pn(t,e,n,o,i){let r=e.href,c=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1");o.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:r,title:c,text:a,tokens:o.inlineTokens(a)};return o.state.inLink=!1,l}function Ai(t,e,n){let o=t.match(n.other.indentCodeCompensation);if(o===null)return e;let i=o[1];return e.split(`
5
+ `).map(r=>{let c=r.match(n.other.beginningSpace);if(c===null)return r;let[a]=c;return a.length>=i.length?r.slice(i.length):r}).join(`
6
+ `)}var yt=class{constructor(t){X(this,"options");X(this,"rules");X(this,"lexer");this.options=t||Me}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:In(e[0]),o=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:o}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],o=Ai(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:o}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let o=Re(n,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(n=o.trim())}return{type:"heading",raw:Re(e[0],`
7
+ `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Re(e[0],`
8
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Re(e[0],`
9
+ `).split(`
10
+ `),o="",i="",r=[];for(;n.length>0;){let c=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),c=!0;else if(!c)a.push(n[l]);else break;n=n.slice(l);let p=a.join(`
11
+ `),h=p.replace(this.rules.other.blockquoteSetextReplace,`
12
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
13
+ ${p}`:p,i=i?`${i}
14
+ ${h}`:h;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=d,n.length===0)break;let f=r.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){let y=f,g=y.raw+`
15
+ `+n.join(`
16
+ `),R=this.blockquote(g);r[r.length-1]=R,o=o.substring(0,o.length-y.raw.length)+R.raw,i=i.substring(0,i.length-y.text.length)+R.text;break}else if((f==null?void 0:f.type)==="list"){let y=f,g=y.raw+`
17
+ `+n.join(`
18
+ `),R=this.list(g);r[r.length-1]=R,o=o.substring(0,o.length-f.raw.length)+R.raw,i=i.substring(0,i.length-y.raw.length)+R.raw,n=g.substring(r.at(-1).raw.length).split(`
19
+ `);continue}}return{type:"blockquote",raw:o,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let r=this.rules.other.listItemRegex(n),c=!1;for(;t;){let l=!1,p="",h="";if(!(e=r.exec(t))||this.rules.block.hr.test(t))break;p=e[0],t=t.substring(p.length);let d=$i(e[2].split(`
20
+ `,1)[0],e[1].length),f=t.split(`
21
+ `,1)[0],y=!d.trim(),g=0;if(this.options.pedantic?(g=2,h=d.trimStart()):y?g=e[1].length+1:(g=d.search(this.rules.other.nonSpaceChar),g=g>4?1:g,h=d.slice(g),g+=e[1].length),y&&this.rules.other.blankLine.test(f)&&(p+=f+`
22
+ `,t=t.substring(f.length+1),l=!0),!l){let R=this.rules.other.nextBulletRegex(g),b=this.rules.other.hrRegex(g),w=this.rules.other.fencesBeginRegex(g),k=this.rules.other.headingBeginRegex(g),I=this.rules.other.htmlBeginRegex(g),x=this.rules.other.blockquoteBeginRegex(g);for(;t;){let C=t.split(`
23
+ `,1)[0],A;if(f=C,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),A=f):A=f.replace(this.rules.other.tabCharGlobal," "),w.test(f)||k.test(f)||I.test(f)||x.test(f)||R.test(f)||b.test(f))break;if(A.search(this.rules.other.nonSpaceChar)>=g||!f.trim())h+=`
24
+ `+A.slice(g);else{if(y||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(d)||k.test(d)||b.test(d))break;h+=`
25
+ `+f}y=!f.trim(),p+=C+`
26
+ `,t=t.substring(C.length+1),d=A.slice(g)}}i.loose||(c?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(c=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),i.raw+=p}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items){this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]);let p=l.tokens[0];if(l.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let d={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1);if(!i.loose){let h=l.tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=d}}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=In(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:Re(e[0],`
27
+ `),href:o,title:i}}}table(t){var c;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Rn(e[1]),o=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(c=e[3])!=null&&c.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
28
+ `):[],r={type:"table",raw:Re(e[0],`
29
+ `),header:[],align:[],rows:[]};if(n.length===o.length){for(let a of o)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<n.length;a++)r.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:r.align[a]});for(let a of i)r.rows.push(Rn(a,r.header.length).map((l,p)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[p]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:Re(e[0],`
30
+ `),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
31
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let r=Re(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{let r=Ei(e[2],"()");if(r===-2)return;if(r>-1){let c=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,c).trim(),e[3]=""}}let o=e[2],i="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(o);r&&(o=r[1],i=r[3])}else i=e[3]?e[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?o=o.slice(1):o=o.slice(1,-1)),Pn(e,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[o.toLowerCase()];if(!i){let r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return Pn(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||!o[1]&&!o[2]&&!o[3]&&!o[4]||o[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...o[0]].length-1,r,c,a=i,l=0,p=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+i);(o=p.exec(e))!==null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r)continue;if(c=[...r].length,o[3]||o[4]){a+=c;continue}else if((o[5]||o[6])&&i%3&&!((i+c)%3)){l+=c;continue}if(a-=c,a>0)continue;c=Math.min(c,c+a+l);let h=[...o[0]][0].length,d=t.slice(0,i+o.index+h+c);if(Math.min(i,c)%2){let y=d.slice(1,-1);return{type:"em",raw:d,text:y,tokens:this.lexer.inlineTokens(y)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return o&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let o=this.rules.inline.delLDelim.exec(t);if(o&&(!o[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...o[0]].length-1,r,c,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(o=l.exec(e))!==null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r||(c=[...r].length,c!==i))continue;if(o[3]||o[4]){a+=c;continue}if(a-=c,a>0)continue;c=Math.min(c,c+a);let p=[...o[0]][0].length,h=t.slice(0,i+o.index+p+c),d=h.slice(i,-i);return{type:"del",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,o;return e[2]==="@"?(n=e[1],o="mailto:"+n):(n=e[1],o=n),{type:"link",raw:e[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let o,i;if(e[2]==="@")o=e[0],i="mailto:"+o;else{let r;do r=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(r!==e[0]);o=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},me=class Wt{constructor(e){X(this,"tokens");X(this,"options");X(this,"state");X(this,"inlineQueue");X(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Me,this.options.tokenizer=this.options.tokenizer||new yt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ae,block:it.normal,inline:Ve.normal};this.options.pedantic?(n.block=it.pedantic,n.inline=Ve.pedantic):this.options.gfm&&(n.block=it.gfm,this.options.breaks?n.inline=Ve.breaks:n.inline=Ve.gfm),this.tokenizer.rules=n}static get rules(){return{block:it,inline:Ve}}static lex(e,n){return new Wt(n).lex(e)}static lexInline(e,n){return new Wt(n).inlineTokens(e)}lex(e){e=e.replace(ae.carriageReturn,`
32
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let o=this.inlineQueue[n];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],o=!1){var r,c,a;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ae.tabCharGlobal," ").replace(ae.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let l;if((c=(r=this.options.extensions)==null?void 0:r.block)!=null&&c.some(h=>(l=h.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let h=n.at(-1);l.raw.length===1&&h!==void 0?h.raw+=`
33
+ `:n.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
34
+ `)?"":`
35
+ `)+l.raw,h.text+=`
36
+ `+l.text,this.inlineQueue.at(-1).src=h.text):n.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
37
+ `)?"":`
38
+ `)+l.raw,h.text+=`
39
+ `+l.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},n.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),n.push(l);continue}let p=e;if((a=this.options.extensions)!=null&&a.startBlock){let h=1/0,d=e.slice(1),f;this.options.extensions.startBlock.forEach(y=>{f=y.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(p=e.substring(0,h+1))}if(this.state.top&&(l=this.tokenizer.paragraph(p))){let h=n.at(-1);o&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
40
+ `)?"":`
41
+ `)+l.raw,h.text+=`
42
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(l),o=p.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
43
+ `)?"":`
44
+ `)+l.raw,h.text+=`
45
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var p,h,d,f,y;this.tokenizer.lexer=this;let o=e,i=null;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(o))!==null;)g.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(o))!==null;)o=o.slice(0,i.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(o))!==null;)r=i[2]?i[2].length:0,o=o.slice(0,i.index+r)+"["+"a".repeat(i[0].length-r-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},o))??o;let c=!1,a="",l=1/0;for(;e;){if(e.length<l)l=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}c||(a=""),c=!1;let g;if((f=(d=this.options.extensions)==null?void 0:d.inline)!=null&&f.some(b=>(g=b.call({lexer:this},e,n))?(e=e.substring(g.raw.length),n.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let b=n.at(-1);g.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):n.push(g);continue}if(g=this.tokenizer.emStrong(e,o,a)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.del(e,o,a)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),n.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),n.push(g);continue}let R=e;if((y=this.options.extensions)!=null&&y.startInline){let b=1/0,w=e.slice(1),k;this.options.extensions.startInline.forEach(I=>{k=I.call({lexer:this},w),typeof k=="number"&&k>=0&&(b=Math.min(b,k))}),b<1/0&&b>=0&&(R=e.substring(0,b+1))}if(g=this.tokenizer.inlineText(R)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(a=g.raw.slice(-1)),c=!0;let b=n.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):n.push(g);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},wt=class{constructor(t){X(this,"options");X(this,"parser");this.options=t||Me}space(t){return""}code({text:t,lang:e,escaped:n}){var r;let o=(r=(e||"").match(ae.notSpaceStart))==null?void 0:r[0],i=t.replace(ae.endingNewline,"")+`
46
+ `;return o?'<pre><code class="language-'+_e(o)+'">'+(n?i:_e(i,!0))+`</code></pre>
47
+ `:"<pre><code>"+(n?i:_e(i,!0))+`</code></pre>
48
+ `}blockquote({tokens:t}){return`<blockquote>
49
+ ${this.parser.parse(t)}</blockquote>
50
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
51
+ `}hr(t){return`<hr>
52
+ `}list(t){let e=t.ordered,n=t.start,o="";for(let c=0;c<t.items.length;c++){let a=t.items[c];o+=this.listitem(a)}let i=e?"ol":"ul",r=e&&n!==1?' start="'+n+'"':"";return"<"+i+r+`>
53
+ `+o+"</"+i+`>
54
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
55
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
56
+ `}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let o="";for(let i=0;i<t.rows.length;i++){let r=t.rows[i];n="";for(let c=0;c<r.length;c++)n+=this.tablecell(r[c]);o+=this.tablerow({text:n})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
57
+ <thead>
58
+ `+e+`</thead>
59
+ `+o+`</table>
60
+ `}tablerow({text:t}){return`<tr>
61
+ ${t}</tr>
62
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
63
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${_e(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let o=this.parser.parseInline(n),i=Ln(t);if(i===null)return o;t=i;let r='<a href="'+t+'"';return e&&(r+=' title="'+_e(e)+'"'),r+=">"+o+"</a>",r}image({href:t,title:e,text:n,tokens:o}){o&&(n=this.parser.parseInline(o,this.parser.textRenderer));let i=Ln(t);if(i===null)return _e(n);t=i;let r=`<img src="${t}" alt="${_e(n)}"`;return e&&(r+=` title="${_e(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:_e(t.text)}},en=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ye=class Ot{constructor(e){X(this,"options");X(this,"renderer");X(this,"textRenderer");this.options=e||Me,this.options.renderer=this.options.renderer||new wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new en}static parse(e,n){return new Ot(n).parse(e)}static parseInline(e,n){return new Ot(n).parseInline(e)}parse(e){var o,i;this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let c=e[r];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[c.type]){let l=c,p=this.options.extensions.renderers[l.type].call({parser:this},l);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=p||"";continue}}let a=c;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,n=this.renderer){var i,r;this.renderer.parser=this;let o="";for(let c=0;c<e.length;c++){let a=e[c];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[a.type]){let p=this.options.extensions.renderers[a.type].call({parser:this},a);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){o+=p||"";continue}}let l=a;switch(l.type){case"escape":{o+=n.text(l);break}case"html":{o+=n.html(l);break}case"link":{o+=n.link(l);break}case"image":{o+=n.image(l);break}case"checkbox":{o+=n.checkbox(l);break}case"strong":{o+=n.strong(l);break}case"em":{o+=n.em(l);break}case"codespan":{o+=n.codespan(l);break}case"br":{o+=n.br(l);break}case"del":{o+=n.del(l);break}case"text":{o+=n.text(l);break}default:{let p='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return o}},ot,Qe=(ot=class{constructor(t){X(this,"options");X(this,"block");this.options=t||Me}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?me.lex:me.lexInline}provideParser(t=this.block){return t?ye.parse:ye.parseInline}},X(ot,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),X(ot,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ot),zi=class{constructor(...t){X(this,"defaults",jt());X(this,"options",this.setOptions);X(this,"parse",this.parseMarkdown(!0));X(this,"parseInline",this.parseMarkdown(!1));X(this,"Parser",ye);X(this,"Renderer",wt);X(this,"TextRenderer",en);X(this,"Lexer",me);X(this,"Tokenizer",yt);X(this,"Hooks",Qe);this.use(...t)}walkTokens(t,e){var o,i;let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let c=r;for(let a of c.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of c.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,e));break}case"list":{let c=r;n=n.concat(this.walkTokens(c.items,e));break}default:{let c=r;(i=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&i[c.type]?this.defaults.extensions.childTokens[c.type].forEach(a=>{let l=c[a].flat(1/0);n=n.concat(this.walkTokens(l,e))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o={...n};if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...c){let a=i.renderer.apply(this,c);return a===!1&&(a=r.apply(this,c)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),o.extensions=e),n.renderer){let i=this.defaults.renderer||new wt(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let c=r,a=n.renderer[c],l=i[c];i[c]=(...p)=>{let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h||""}}o.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new yt(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let c=r,a=n.tokenizer[c],l=i[c];i[c]=(...p)=>{let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h}}o.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Qe;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let c=r,a=n.hooks[c],l=i[c];Qe.passThroughHooks.has(r)?i[c]=p=>{if(this.defaults.async&&Qe.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,p);return l.call(i,d)})();let h=a.call(i,p);return l.call(i,h)}:i[c]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,p);return d===!1&&(d=await l.apply(i,p)),d})();let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h}}o.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;o.walkTokens=function(c){let a=[];return a.push(r.call(this,c)),i&&(a=a.concat(i.call(this,c))),a}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return me.lex(t,e??this.defaults)}parser(t,e){return ye.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let o={...n},i={...this.defaults,...o},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let c=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?me.lex:me.lexInline)(c,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let p=await(i.hooks?await i.hooks.provideParser(t):t?ye.parse:ye.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(p):p})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let c=(i.hooks?i.hooks.provideLexer(t):t?me.lex:me.lexInline)(e,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?ye.parse:ye.parseInline)(c,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(c){return r(c)}}}onError(t,e){return n=>{if(n.message+=`
64
+ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+_e(n.message+"",!0)+"</pre>";return e?Promise.resolve(o):o}if(e)return Promise.reject(n);throw n}}},Be=new zi;function U(t,e){return Be.parse(t,e)}U.options=U.setOptions=function(t){return Be.setOptions(t),U.defaults=Be.defaults,ns(U.defaults),U};U.getDefaults=jt;U.defaults=Me;U.use=function(...t){return Be.use(...t),U.defaults=Be.defaults,ns(U.defaults),U};U.walkTokens=function(t,e){return Be.walkTokens(t,e)};U.parseInline=Be.parseInline;U.Parser=ye;U.parser=ye.parse;U.Renderer=wt;U.TextRenderer=en;U.Lexer=me;U.lexer=me.lex;U.Tokenizer=yt;U.Hooks=Qe;U.parse=U;U.options;U.setOptions;U.use;U.walkTokens;U.parseInline;ye.parse;me.lex;const Di=["zh-TW","zh-CN","en"],En={"zh-TW":"繁體中文","zh-CN":"简体中文",en:"English"},us="miki-moni:locale";function Wi(){try{const t=localStorage.getItem(us);if(t==="zh-TW"||t==="zh-CN"||t==="en")return t}catch{}try{const t=(navigator.language||"").toLowerCase();if(t.startsWith("zh-cn")||t.startsWith("zh-hans")||t==="zh")return"zh-CN";if(t.startsWith("zh"))return"zh-TW";if(t.startsWith("en"))return"en"}catch{}return"zh-TW"}let kt=Wi();const Bt=new Set;function hs(t){if(t!==kt){kt=t;try{localStorage.setItem(us,t)}catch{}Bt.forEach(e=>e(t))}}function Oi(){const[t,e]=v(kt);return j(()=>{const n=o=>e(o);return Bt.add(n),()=>{Bt.delete(n)}},[]),[t,hs]}const Bi={"status.active":"進行中","status.waiting":"等你回應","status.idle":"閒置","status.stale":"已斷線","time.secondsAgo":"{n} 秒前","time.minutesAgo":"{n} 分鐘前","time.hoursAgo":"{n} 小時前","time.daysAgo":"{n} 天前","ask.atLeastOne":"請至少回答一題","ask.claudeAsking":"❓ Claude 在問你問題","ask.placeholder":"或自己打答案(會跟勾選一起送)…","ask.prev":"← 上一題","ask.next":"下一題 →","ask.submitting":"送出中…","ask.submit":"Submit","ask.removeThis":"移除這張","expand.collapse":"收合","expand.expandIn":"展開 IN","expand.expandOut":"展開 OUT","expand.expand":"展開","transcript.empty":"(transcript 沒有可顯示的訊息)","transcript.conversation":"對話","transcript.countItems":"{n} 條","transcript.fileSize":"{kb} KB","transcript.lastModified":"最後修改 {time}","model.switchHint":"點擊切換目前 wrap session 的模型(SDK 動態切換,不會中斷對話)","model.menuTitle":"模型","model.defaultDesc":"用 SDK 預設模型(CLAUDE_DEFAULT_MODEL / Anthropic 預設)","model.aliasDesc":"切到 {id}","model.customPlaceholder":"claude-opus-4-7-20251122","model.applyCustom":"套用","transcript.viewOptions":"對話檢視選項","transcript.showTool":"顯示 TOOL","transcript.items10":"10 條","transcript.items20":"20 條","transcript.items50":"50 條","transcript.items100":"100 條","transcript.items200":"200 條","transcript.items500":"500 條","transcript.itemsAll":"全部","transcript.loadAll":"📜 載入全部","transcript.loadAllTitle":"把整個 session JSONL 全部讀進來(最多 10000 turn)","transcript.loading":"讀取中…","transcript.reload":"重新讀取","send.focusing":"叫起視窗:{label}","send.httpOk":"OK · HTTP {status}","send.httpFail":"失敗 HTTP {status}","send.claudeReplied":"Claude 已回覆 ({ms} ms)","send.sentToVSCode":"已送出到 VSCode panel(Enter 已自動按)","send.sendFailed":"送出失敗:{label}","focus.cliNotSupported":"🚫 CLI session 不支援 focus(URI handler 只開 VSCode)","focus.bringVSCode":"叫起 VSCode 視窗(focus)","focus.wrappedBadge":"🔌 wrapped","focus.wrappedTitle":"wrapper 接管中(CLI session)","focus.wrapperRunning":"wrapper 正在: {activity}","composer.imageIgnored":"⚠️ 圖片在這個 session 模式下會被忽略(只有 wrapped 才能傳圖)","composer.uploadImage":"附加圖片(從手機相簿/相機選擇)","composer.cliNotWrapped":"CLI session 沒接管 — 先在 terminal 跑:miki claude -r {short}…","composer.vscodeDisabledWrap":"VSCode panel mode 已停用 — 請改用 wrap:miki claude -r {short}…","composer.vscodeDisabledWrap2":"VSCode panel mode 已停用 — 請改 wrap:miki claude -r {short}…","composer.inputPrompt":"輸入 prompt(Ctrl+V 可貼圖)→ push 進 wrapper 的 query()…","composer.inputPromptShort":"輸入訊息…","composer.cliNotWrappedShort":"未接管 — 先 wrap:-r {short}…","composer.vscodeDisabledShort":"需要 wrap:-r {short}…","composer.interruptLong":"中斷目前 Claude 的回應(呼叫 SDK Query.interrupt())","composer.interruptShort":"中斷目前 Claude 的回應","composer.needWrapHint":"先 `miki claude -r <uuid>` 接管 (wrap-cli)","composer.needWrapHint2":"請先 `miki claude -r <uuid>` 接管 (wrap-cli)","composer.wrapWSHint":"走 wrap WS push 進 terminal 的 query()(免費,可帶圖)","composer.wrapWSShort":"走 wrap WS push 進 terminal 的 query()","composer.needWrapBadge":"需 wrap","composer.cliPanelNotWrapped":"📟","composer.cliNotWrappedStrong":"CLI session 沒接管","composer.pleaseUse":":請改用","composer.toTakeOver":"接管。","composer.advancedToggle":"advanced:切換送出模式","composer.headlessReal":"真送出模式(headless `claude -r -p`,會花 API 費用、不走你 panel session)","composer.keyEnter":"Enter 送出 · Shift+Enter 換行","composer.keyCtrlEnter":"⌘/Ctrl+Enter 送出 · Enter 換行","composer.escClose":" · Esc 關閉","composer.sendBusy":"⌛","composer.sendWrapped":"送出 🔌","composer.sendNeedWrap":"送出 (需 wrap)","header.all":"全覽","header.live":"進行中","header.idle":"閒置","header.stale":"已斷線","header.onlyShow":"只看 {label}","header.running":"目前正在運行","header.filtered":"· 已過濾 ({filter}) · 點 TOTAL 重設","header.liveLong":"進行中 / 等回應","header.wsConnected":"WS connected","header.wsConnecting":"connecting…","header.wsDisconnected":"WS disconnected","header.settingsBtn":"⚙️ 設定","header.settingsTitle":"設定","session.copyRestart":"複製重啟指令:pnpm --dir D:\\code\\cc-hub miki claude -r {uuid}","session.cliMarkTooltip":"標記為 CLI session — 預填送出已停用(URI handler 不支援 terminal)。點一下改回 VSCode。","session.vscodeMarkTooltip":"標記為 VSCode session — 點一下改成 CLI。","session.waitingBadge":"🔔 待回應","session.waitingTooltip":"Claude 還在等你回答 — 點開重新顯示問題","session.openTab":"開到 tab","session.wrappedDetailed":"這個 session 被 `miki claude` wrapper 接管(CLI session)— 送出走 push、不再 spawn / 不花 $$","session.empty":"(尚未開始對話)","session.quickSend":"快速送出(彈出小卡片,不展開 transcript)","session.openCli":"開 CLI","session.openCliPending":"...","session.openCliFailed":"失敗:{err}","session.openCliTooltip":"彈一個 Windows Terminal 跑 miki claude -r — 把這個 session 變成 wrapped","wrapNotice.title":"CLI 已啟動 — 請手動關閉 VSCode panel","wrapNotice.body":"{project} 現在被 CLI wrapper 接管。VSCode panel 還是「擁有」這個 session 的話,兩邊各打字會把 JSONL 切成分支、session 狀態就糊了。建議:把 VSCode 那個 Claude Code panel 關掉,之後只用 dashboard / CLI 互動。","wrapNotice.confirmCheck":"我已關閉對應的 VSCode panel","wrapNotice.confirm":"確認","wrapNotice.later":"稍後處理","wrapNotice.dismiss":"知道了","header.newCli":"新增 CLI","header.newCliTitle":"在指定資料夾開新的 CLI(miki claude --fresh)","newCli.heading":"新增 CLI","newCli.cwdLabel":"資料夾路徑","newCli.cwdPlaceholder":"路徑","newCli.recentCwds":"最近用過的路徑","newCli.submit":"開啟","newCli.submitting":"啟動中…","newCli.success":"已啟動 — 等 wrap 連回 daemon","newCli.error":"失敗:{err}","newCli.hint":'會在新的 Windows Terminal 裡跑 miki claude --fresh。先送一句 "hi" 啟動 SDK 後接管。',"spawnPending.title":"啟動中…","spawnPending.body":"在 {cwd} 跑 miki claude — 等 SDK init 完成、wrap 連回 daemon 後新卡片就會出現。約 3–5 秒。","spawnPending.timeout":"已超過 30 秒沒連回 — 看一下 wt 視窗是否有錯誤。","spawnPending.dismiss":"關閉","session.closeTab":"關閉 tab","session.closeKey":"關閉","session.modalClose":"關閉 (Esc)","session.claudeWaitingHere":"🔔 Claude 還在等你回答這個 session 的問題","session.showQuestion":"重新顯示問題","mode.lockedAcceptTitle":"Auto-accept edits mode:所有 edit/write 直接套用、不再確認。`miki claude --permission-mode acceptEdits` 啟動鎖定。","mode.lockedBypassTitle":"Bypass permissions:所有工具都不問就執行。極度危險,僅在 sandbox 使用。`miki claude --bypass-permissions` 啟動鎖定。","mode.lockedPlanTitle":"Plan mode:只規劃、不執行 mutation 類工具。`miki claude --permission-mode plan` 啟動鎖定。","mode.defaultDesc":"每次 edit 都問你","mode.defaultTitle":"Ask before edits:每個 mutation 工具會問你。","mode.acceptDesc":"Edit / write 直接套用","mode.acceptTitle":"Edit automatically:所有 edit/write 直接套用、不再確認。","mode.planDesc":"只規劃、不動檔案","mode.planTitle":"Plan mode:只規劃、不執行 mutation 類工具。","mode.autoDesc":"Claude 自己挑 mode","mode.autoTitle":"Auto mode:Claude 自動依任務選最適合的 mode。","mode.bypassDesc":"全部工具直接跑(危險)","mode.bypassTitle":"Bypass permissions:所有工具都不問就執行。極度危險,只在 sandbox 使用。","mode.switchHint":" · 點一下切換 mode","log.activity":"活動紀錄","log.syncedConsole":"同步輸出到 F12 Console","log.clear":"清空","log.empty":"尚無活動,按任何按鈕或等 hook 事件就會冒出來。","overview.title":"🗺️ 全覽","overview.noSessions":"目前沒有 session。","overview.openPanelHint":"在任何 VSCode 視窗開 Claude Code panel 就會冒出來。","overview.runHooks":"沒反應的話:","overview.sessionGone":"(session 不存在了,可能 daemon 重啟過)","settings.title":"設定","settings.sendKeySection":"送出鍵(全域)","settings.enterLabel":"Enter","settings.enterDesc":" 送出 · Shift+Enter 換行","settings.ctrlEnterLabel":"Ctrl/⌘ + Enter","settings.ctrlEnterDesc":" 送出 · Enter 換行","settings.sendKeyHelp":"套用到 dashboard 快速送出視窗 + 每個 tab 的 composer。Enter 模式下仍可用 Ctrl/⌘+Enter 強制送出。","settings.appearance":"外觀","settings.themeLight":"☀️ Light","settings.themeDark":"🌙 Dark","settings.themeSystem":"🖥 System","settings.themeSystemTitle":"跟隨 OS 設定(prefers-color-scheme)","settings.themeDarkTitle":"深色模式","settings.themeLightTitle":"淺色模式","settings.sortMode":"卡片排序","settings.sortPriorityLabel":"🔔 優先級","settings.sortPriorityTitle":"需要回應的 session 優先(waiting → active → idle → stale),同組內依 cwd 排序","settings.sortUuidLabel":"🆔 UUID 序","settings.sortUuidTitle":"依 session_uuid 排序;每個 session 永遠卡同一格,F5 / 重啟都不會位移(位置與專案名無關)","settings.sortRecentLabel":"⏱ 最近活動","settings.sortRecentTitle":"最近有事件的排前面(last_event_at DESC),會隨活動跳動","settings.sortHelp":"影響首頁卡片順序。F5 後位置會記住(除了「最近活動」模式,這個本來就會隨活動移動)。","settings.close":"關閉","settings.language":"語言","startup.starting":"啟動 — 抓 /sessions + previews","startup.getSessionsFailed":"GET /sessions 失敗","startup.gotSessions":"GET /sessions 200 — 收到 {n} 個 session","startup.wsConnecting":"WS 連線中","phone.pair.title":"miki-moni 配對","phone.pair.subtitle":"把這台裝置跟你電腦上的 miki-moni daemon 配對","phone.pair.instruction":"在電腦終端機跑 {cmd},輸入它顯示的 16 碼配對碼。","phone.pair.codeLabel":"配對碼","phone.pair.codePlaceholder":"XXXX-XXXX-XXXX-XXXX","phone.pair.errorBadCode":"Code must be 16 chars from the Crockford base32 alphabet","phone.pair.errorScannedQr":"掃到了但不是配對 QR:{text}","phone.pair.busy":"配對中…","phone.pair.submit":"開始配對","phone.pair.or":"或","phone.pair.scan":"掃 QR Code","phone.pair.autoTitle":"配對中…","phone.pair.autoHint":"正在跟 daemon 完成 handshake","phone.pair.relayLabel":"relay:","phone.tunnel.connecting":"連線中…","phone.tunnel.connectingHint":"透過 relay 連到 daemon · {daemon}…","phone.tunnel.error":"連線錯誤","phone.tunnel.resetAndRepair":"清除狀態並重新配對","phone.conn.connected":"已連線","phone.conn.connecting":"連線中…","phone.conn.reconnecting":"重新連線中…","phone.conn.error":"連線錯誤","phone.session.noUuid":"null(沒抓到,叫起/送出可能會開錯 session)","phone.session.focus":"叫起視窗","phone.session.promptPlaceholder":"輸入 prompt 送給這個 session…","phone.session.send":"送出","phone.empty.title":"⚪ 連上 relay,但還沒有 session","phone.empty.twoOptions":"兩個可能:","phone.empty.daemonNotRunning":"電腦的 daemon 沒在跑 → 終端機跑 {cmd}","phone.empty.noClaude":"daemon 有跑,但你還沒開任何 Claude Code session → 開一個就會出現","phone.empty.hooksHint":"若 hooks 還沒裝:{cmd}","phone.empty.waitingConn":"等待連線…","phone.header.unpair":"解除配對","phone.header.unpairing":"解除中…","phone.log.title":"活動紀錄","phone.log.consoleNote":"(同步輸出到 F12 Console)","phone.log.clear":"清空","phone.log.empty":"尚無活動。WS 連上、配對後送出 cmd、收到 event 都會即時顯示。","phone.log.wsError":"WS error","phone.log.wsCloseReconnect":"WS close — {delay}ms 後重連","phone.log.wsCloseReason":"(無)","phone.log.wsNonJson":"WS 收到非 JSON","phone.log.wsConnectingRelay":"WS 連線中 (relay)","phone.log.wsConnectingLegacy":"WS 連線中 (legacy)","phone.log.wsOpenSnapshot":"WS open — 送 request_snapshot","phone.log.unknownKind":"不認識的訊息 kind","phone.log.snapshotReceived":"state_snapshot — 收到 {n} 個 session","phone.log.eventReceived":"event — {project}","phone.log.envelopeFail":"envelope 解密失敗 — 可能對方不是這個 peer","phone.log.identityFail":"無法載入 identity","phone.log.sendFailWsClosed":"{label}: WS 未連線,無法送出","phone.log.encryptedSend":"加密送出 {label}","phone.log.registerPeer":"送 register_peer_id","phone.log.revokeRelay":"送 revoke_self 給 relay","phone.log.revokeOk":"relay 確認 revoke 完成,清除本地狀態","phone.log.revokeKicked":"daemon 主動解除配對,回到配對畫面","phone.log.unpairOffline":"WS 未連線;直接清本地(relay 端可能仍有 paired_phones entry,下次連會被擋掉)","phone.log.focusClick":"click 叫起視窗","phone.log.sendClick":"click 送出 prompt"},Mi={"status.active":"进行中","status.waiting":"等你回应","status.idle":"闲置","status.stale":"已断线","time.secondsAgo":"{n} 秒前","time.minutesAgo":"{n} 分钟前","time.hoursAgo":"{n} 小时前","time.daysAgo":"{n} 天前","ask.atLeastOne":"请至少回答一题","ask.claudeAsking":"❓ Claude 在问你问题","ask.placeholder":"或自己打答案(会跟勾选一起送)…","ask.prev":"← 上一题","ask.next":"下一题 →","ask.submitting":"送出中…","ask.submit":"Submit","ask.removeThis":"移除这张","expand.collapse":"收合","expand.expandIn":"展开 IN","expand.expandOut":"展开 OUT","expand.expand":"展开","transcript.empty":"(transcript 没有可显示的讯息)","transcript.conversation":"对话","transcript.countItems":"{n} 条","transcript.fileSize":"{kb} KB","transcript.lastModified":"最后修改 {time}","model.switchHint":"点击切换目前 wrap session 的模型(SDK 动态切换,不会中断对话)","model.menuTitle":"模型","model.defaultDesc":"用 SDK 默认模型(CLAUDE_DEFAULT_MODEL / Anthropic 默认)","model.aliasDesc":"切到 {id}","model.customPlaceholder":"claude-opus-4-7-20251122","model.applyCustom":"套用","transcript.viewOptions":"对话检视选项","transcript.showTool":"显示 TOOL","transcript.items10":"10 条","transcript.items20":"20 条","transcript.items50":"50 条","transcript.items100":"100 条","transcript.items200":"200 条","transcript.items500":"500 条","transcript.itemsAll":"全部","transcript.loadAll":"📜 加载全部","transcript.loadAllTitle":"把整个 session JSONL 全部读进来(最多 10000 turn)","transcript.loading":"读取中…","transcript.reload":"重新读取","send.focusing":"叫起窗口:{label}","send.httpOk":"OK · HTTP {status}","send.httpFail":"失败 HTTP {status}","send.claudeReplied":"Claude 已回复 ({ms} ms)","send.sentToVSCode":"已送出到 VSCode panel(Enter 已自动按)","send.sendFailed":"送出失败:{label}","focus.cliNotSupported":"🚫 CLI session 不支持 focus(URI handler 只开 VSCode)","focus.bringVSCode":"叫起 VSCode 窗口(focus)","focus.wrappedBadge":"🔌 wrapped","focus.wrappedTitle":"wrapper 接管中(CLI session)","focus.wrapperRunning":"wrapper 正在: {activity}","composer.imageIgnored":"⚠️ 图片在这个 session 模式下会被忽略(只有 wrapped 才能传图)","composer.uploadImage":"附加图片(从手机相册/相机选择)","composer.cliNotWrapped":"CLI session 没接管 — 先在 terminal 跑:miki claude -r {short}…","composer.vscodeDisabledWrap":"VSCode panel mode 已停用 — 请改用 wrap:miki claude -r {short}…","composer.vscodeDisabledWrap2":"VSCode panel mode 已停用 — 请改 wrap:miki claude -r {short}…","composer.inputPrompt":"输入 prompt(Ctrl+V 可贴图)→ push 进 wrapper 的 query()…","composer.inputPromptShort":"输入讯息…","composer.cliNotWrappedShort":"未接管 — 先 wrap:-r {short}…","composer.vscodeDisabledShort":"需要 wrap:-r {short}…","composer.interruptLong":"中断目前 Claude 的回应(呼叫 SDK Query.interrupt())","composer.interruptShort":"中断目前 Claude 的回应","composer.needWrapHint":"先 `miki claude -r <uuid>` 接管 (wrap-cli)","composer.needWrapHint2":"请先 `miki claude -r <uuid>` 接管 (wrap-cli)","composer.wrapWSHint":"走 wrap WS push 进 terminal 的 query()(免费,可带图)","composer.wrapWSShort":"走 wrap WS push 进 terminal 的 query()","composer.needWrapBadge":"需 wrap","composer.cliPanelNotWrapped":"📟","composer.cliNotWrappedStrong":"CLI session 没接管","composer.pleaseUse":":请改用","composer.toTakeOver":"接管。","composer.advancedToggle":"advanced:切换送出模式","composer.headlessReal":"真送出模式(headless `claude -r -p`,会花 API 费用、不走你 panel session)","composer.keyEnter":"Enter 送出 · Shift+Enter 换行","composer.keyCtrlEnter":"⌘/Ctrl+Enter 送出 · Enter 换行","composer.escClose":" · Esc 关闭","composer.sendBusy":"⌛","composer.sendWrapped":"送出 🔌","composer.sendNeedWrap":"送出 (需 wrap)","header.all":"全览","header.live":"进行中","header.idle":"闲置","header.stale":"已断线","header.onlyShow":"只看 {label}","header.running":"目前正在运行","header.filtered":"· 已过滤 ({filter}) · 点 TOTAL 重设","header.liveLong":"进行中 / 等回应","header.wsConnected":"WS connected","header.wsConnecting":"connecting…","header.wsDisconnected":"WS disconnected","header.settingsBtn":"⚙️ 设置","header.settingsTitle":"设置","session.copyRestart":"复制重启指令:pnpm --dir D:\\code\\cc-hub miki claude -r {uuid}","session.cliMarkTooltip":"标记为 CLI session — 预填送出已停用(URI handler 不支持 terminal)。点一下改回 VSCode。","session.vscodeMarkTooltip":"标记为 VSCode session — 点一下改成 CLI。","session.waitingBadge":"🔔 待回应","session.waitingTooltip":"Claude 还在等你回答 — 点开重新显示问题","session.openTab":"开到 tab","session.wrappedDetailed":"这个 session 被 `miki claude` wrapper 接管(CLI session)— 送出走 push、不再 spawn / 不花 $$","session.empty":"(尚未开始对话)","session.quickSend":"快速送出(弹出小卡片,不展开 transcript)","session.openCli":"开 CLI","session.openCliPending":"...","session.openCliFailed":"失败:{err}","session.openCliTooltip":"弹一个 Windows Terminal 跑 miki claude -r — 把这个 session 变成 wrapped","wrapNotice.title":"CLI 已启动 — 请手动关闭 VSCode panel","wrapNotice.body":"{project} 现在被 CLI wrapper 接管。VSCode panel 还是「拥有」这个 session 的话,两边各打字会把 JSONL 切成分支、session 状态就糊了。建议:把 VSCode 那个 Claude Code panel 关掉,之后只用 dashboard / CLI 互动。","wrapNotice.confirmCheck":"我已关闭对应的 VSCode panel","wrapNotice.confirm":"确认","wrapNotice.later":"稍后处理","wrapNotice.dismiss":"知道了","header.newCli":"新增 CLI","header.newCliTitle":"在指定文件夹开新的 CLI(miki claude --fresh)","newCli.heading":"新增 CLI","newCli.cwdLabel":"文件夹路径","newCli.cwdPlaceholder":"路径","newCli.recentCwds":"最近用过的路径","newCli.submit":"开启","newCli.submitting":"启动中…","newCli.success":"已启动 — 等 wrap 连回 daemon","newCli.error":"失败:{err}","newCli.hint":'会在新的 Windows Terminal 里跑 miki claude --fresh。先送一句 "hi" 启动 SDK 后接管。',"spawnPending.title":"启动中…","spawnPending.body":"在 {cwd} 跑 miki claude — 等 SDK init 完成、wrap 连回 daemon 后新卡片就会出现。约 3–5 秒。","spawnPending.timeout":"已超过 30 秒没连回 — 看一下 wt 视窗是否有错误。","spawnPending.dismiss":"关闭","session.closeTab":"关闭 tab","session.closeKey":"关闭","session.modalClose":"关闭 (Esc)","session.claudeWaitingHere":"🔔 Claude 还在等你回答这个 session 的问题","session.showQuestion":"重新显示问题","mode.lockedAcceptTitle":"Auto-accept edits mode:所有 edit/write 直接套用、不再确认。`miki claude --permission-mode acceptEdits` 启动锁定。","mode.lockedBypassTitle":"Bypass permissions:所有工具都不问就执行。极度危险,仅在 sandbox 使用。`miki claude --bypass-permissions` 启动锁定。","mode.lockedPlanTitle":"Plan mode:只规划、不执行 mutation 类工具。`miki claude --permission-mode plan` 启动锁定。","mode.defaultDesc":"每次 edit 都问你","mode.defaultTitle":"Ask before edits:每个 mutation 工具会问你。","mode.acceptDesc":"Edit / write 直接套用","mode.acceptTitle":"Edit automatically:所有 edit/write 直接套用、不再确认。","mode.planDesc":"只规划、不动文件","mode.planTitle":"Plan mode:只规划、不执行 mutation 类工具。","mode.autoDesc":"Claude 自己挑 mode","mode.autoTitle":"Auto mode:Claude 自动依任务选最适合的 mode。","mode.bypassDesc":"全部工具直接跑(危险)","mode.bypassTitle":"Bypass permissions:所有工具都不问就执行。极度危险,只在 sandbox 使用。","mode.switchHint":" · 点一下切换 mode","log.activity":"活动记录","log.syncedConsole":"同步输出到 F12 Console","log.clear":"清空","log.empty":"尚无活动,按任何按钮或等 hook 事件就会冒出来。","overview.title":"🗺️ 全览","overview.noSessions":"目前没有 session。","overview.openPanelHint":"在任何 VSCode 窗口开 Claude Code panel 就会冒出来。","overview.runHooks":"没反应的话:","overview.sessionGone":"(session 不存在了,可能 daemon 重启过)","settings.title":"设置","settings.sendKeySection":"送出键(全局)","settings.enterLabel":"Enter","settings.enterDesc":" 送出 · Shift+Enter 换行","settings.ctrlEnterLabel":"Ctrl/⌘ + Enter","settings.ctrlEnterDesc":" 送出 · Enter 换行","settings.sendKeyHelp":"应用到 dashboard 快速送出窗口 + 每个 tab 的 composer。Enter 模式下仍可用 Ctrl/⌘+Enter 强制送出。","settings.appearance":"外观","settings.themeLight":"☀️ Light","settings.themeDark":"🌙 Dark","settings.themeSystem":"🖥 System","settings.themeSystemTitle":"跟随 OS 设置(prefers-color-scheme)","settings.themeDarkTitle":"深色模式","settings.themeLightTitle":"浅色模式","settings.sortMode":"卡片排序","settings.sortPriorityLabel":"🔔 优先级","settings.sortPriorityTitle":"需要回应的 session 优先(waiting → active → idle → stale),同组内依 cwd 排序","settings.sortUuidLabel":"🆔 UUID 序","settings.sortUuidTitle":"依 session_uuid 排序;每个 session 永远卡同一格,F5 / 重启都不会位移(位置与项目名无关)","settings.sortRecentLabel":"⏱ 最近活动","settings.sortRecentTitle":"最近有事件的排前面(last_event_at DESC),会随活动跳动","settings.sortHelp":"影响首页卡片顺序。F5 后位置会记住(除了「最近活动」模式,这个本来就会随活动移动)。","settings.close":"关闭","settings.language":"语言","startup.starting":"启动 — 抓 /sessions + previews","startup.getSessionsFailed":"GET /sessions 失败","startup.gotSessions":"GET /sessions 200 — 收到 {n} 个 session","startup.wsConnecting":"WS 连线中","phone.pair.title":"miki-moni 配对","phone.pair.subtitle":"把这台设备跟你电脑上的 miki-moni daemon 配对","phone.pair.instruction":"在电脑终端机跑 {cmd},输入它显示的 16 码配对码。","phone.pair.codeLabel":"配对码","phone.pair.codePlaceholder":"XXXX-XXXX-XXXX-XXXX","phone.pair.errorBadCode":"Code must be 16 chars from the Crockford base32 alphabet","phone.pair.errorScannedQr":"扫到了但不是配对 QR:{text}","phone.pair.busy":"配对中…","phone.pair.submit":"开始配对","phone.pair.or":"或","phone.pair.scan":"扫 QR Code","phone.pair.autoTitle":"配对中…","phone.pair.autoHint":"正在跟 daemon 完成 handshake","phone.pair.relayLabel":"relay:","phone.tunnel.connecting":"连线中…","phone.tunnel.connectingHint":"通过 relay 连到 daemon · {daemon}…","phone.tunnel.error":"连线错误","phone.tunnel.resetAndRepair":"清除状态并重新配对","phone.conn.connected":"已连线","phone.conn.connecting":"连线中…","phone.conn.reconnecting":"重新连线中…","phone.conn.error":"连线错误","phone.session.noUuid":"null(没抓到,叫起/送出可能会开错 session)","phone.session.focus":"叫起窗口","phone.session.promptPlaceholder":"输入 prompt 送给这个 session…","phone.session.send":"送出","phone.empty.title":"⚪ 连上 relay,但还没有 session","phone.empty.twoOptions":"两个可能:","phone.empty.daemonNotRunning":"电脑的 daemon 没在跑 → 终端机跑 {cmd}","phone.empty.noClaude":"daemon 有跑,但你还没开任何 Claude Code session → 开一个就会出现","phone.empty.hooksHint":"若 hooks 还没装:{cmd}","phone.empty.waitingConn":"等待连线…","phone.header.unpair":"解除配对","phone.header.unpairing":"解除中…","phone.log.title":"活动记录","phone.log.consoleNote":"(同步输出到 F12 Console)","phone.log.clear":"清空","phone.log.empty":"尚无活动。WS 连上、配对后送出 cmd、收到 event 都会即时显示。","phone.log.wsError":"WS error","phone.log.wsCloseReconnect":"WS close — {delay}ms 后重连","phone.log.wsCloseReason":"(无)","phone.log.wsNonJson":"WS 收到非 JSON","phone.log.wsConnectingRelay":"WS 连线中 (relay)","phone.log.wsConnectingLegacy":"WS 连线中 (legacy)","phone.log.wsOpenSnapshot":"WS open — 送 request_snapshot","phone.log.unknownKind":"不认识的讯息 kind","phone.log.snapshotReceived":"state_snapshot — 收到 {n} 个 session","phone.log.eventReceived":"event — {project}","phone.log.envelopeFail":"envelope 解密失败 — 可能对方不是这个 peer","phone.log.identityFail":"无法加载 identity","phone.log.sendFailWsClosed":"{label}: WS 未连线,无法送出","phone.log.encryptedSend":"加密送出 {label}","phone.log.registerPeer":"送 register_peer_id","phone.log.revokeRelay":"送 revoke_self 给 relay","phone.log.revokeOk":"relay 确认 revoke 完成,清除本地状态","phone.log.revokeKicked":"daemon 主动解除配对,回到配对画面","phone.log.unpairOffline":"WS 未连线;直接清本地(relay 端可能仍有 paired_phones entry,下次连会被挡掉)","phone.log.focusClick":"click 叫起窗口","phone.log.sendClick":"click 送出 prompt"},Hi={"status.active":"Active","status.waiting":"Awaiting you","status.idle":"Idle","status.stale":"Disconnected","time.secondsAgo":"{n}s ago","time.minutesAgo":"{n}m ago","time.hoursAgo":"{n}h ago","time.daysAgo":"{n}d ago","ask.atLeastOne":"Please answer at least one question","ask.claudeAsking":"❓ Claude is asking you a question","ask.placeholder":"Or type your own answer (sent with the checked options)…","ask.prev":"← Prev","ask.next":"Next →","ask.submitting":"Submitting…","ask.submit":"Submit","ask.removeThis":"Remove this","expand.collapse":"Collapse","expand.expandIn":"Expand IN","expand.expandOut":"Expand OUT","expand.expand":"Expand","transcript.empty":"(no displayable messages in transcript)","transcript.conversation":"Conversation","transcript.countItems":"{n}","transcript.fileSize":"{kb} KB","transcript.lastModified":"Last modified {time}","model.switchHint":"Switch the current wrap session's model (SDK dynamic swap, doesn't break the conversation)","model.menuTitle":"Model","model.defaultDesc":"Use SDK default (CLAUDE_DEFAULT_MODEL / Anthropic default)","model.aliasDesc":"Switch to {id}","model.customPlaceholder":"claude-opus-4-7-20251122","model.applyCustom":"Apply","transcript.viewOptions":"Transcript view options","transcript.showTool":"Show TOOL","transcript.items10":"10","transcript.items20":"20","transcript.items50":"50","transcript.items100":"100","transcript.items200":"200","transcript.items500":"500","transcript.itemsAll":"All","transcript.loadAll":"📜 Load all","transcript.loadAllTitle":"Load the entire session JSONL (up to 10000 turns)","transcript.loading":"Loading…","transcript.reload":"Reload","send.focusing":"Focus window: {label}","send.httpOk":"OK · HTTP {status}","send.httpFail":"Failed HTTP {status}","send.claudeReplied":"Claude replied ({ms} ms)","send.sentToVSCode":"Sent to VSCode panel (Enter auto-pressed)","send.sendFailed":"Send failed: {label}","focus.cliNotSupported":"🚫 CLI session does not support focus (URI handler only opens VSCode)","focus.bringVSCode":"Bring up VSCode window (focus)","focus.wrappedBadge":"🔌 wrapped","focus.wrappedTitle":"Wrapper has taken over (CLI session)","focus.wrapperRunning":"wrapper running: {activity}","composer.imageIgnored":"⚠️ Images are ignored in this session mode (only wrapped sessions accept images)","composer.uploadImage":"Attach image (pick from gallery or camera)","composer.cliNotWrapped":"CLI session not wrapped — first run in terminal: miki claude -r {short}…","composer.vscodeDisabledWrap":"VSCode panel mode disabled — please wrap instead: miki claude -r {short}…","composer.vscodeDisabledWrap2":"VSCode panel mode disabled — please wrap: miki claude -r {short}…","composer.inputPrompt":"Type prompt (Ctrl+V to paste image) → push into wrapper's query()…","composer.inputPromptShort":"Type a message…","composer.cliNotWrappedShort":"Not wrapped — run: -r {short}…","composer.vscodeDisabledShort":"Needs wrap: -r {short}…","composer.interruptLong":"Interrupt current Claude response (calls SDK Query.interrupt())","composer.interruptShort":"Interrupt current Claude response","composer.needWrapHint":"First `miki claude -r <uuid>` to take over (wrap-cli)","composer.needWrapHint2":"Please `miki claude -r <uuid>` to take over (wrap-cli)","composer.wrapWSHint":"Use wrap WS push into terminal's query() (free, supports images)","composer.wrapWSShort":"Use wrap WS push into terminal's query()","composer.needWrapBadge":"needs wrap","composer.cliPanelNotWrapped":"📟","composer.cliNotWrappedStrong":"CLI session not wrapped","composer.pleaseUse":": please use","composer.toTakeOver":" to take over.","composer.advancedToggle":"advanced: toggle send mode","composer.headlessReal":"Real send mode (headless `claude -r -p`, costs API $$ and bypasses your panel session)","composer.keyEnter":"Enter to send · Shift+Enter for newline","composer.keyCtrlEnter":"⌘/Ctrl+Enter to send · Enter for newline","composer.escClose":" · Esc to close","composer.sendBusy":"⌛","composer.sendWrapped":"Send 🔌","composer.sendNeedWrap":"Send (needs wrap)","header.all":"All","header.live":"Live","header.idle":"Idle","header.stale":"Disconnected","header.onlyShow":"Only show {label}","header.running":"Currently running","header.filtered":"· filtered ({filter}) · click TOTAL to reset","header.liveLong":"Live / awaiting","header.wsConnected":"WS connected","header.wsConnecting":"connecting…","header.wsDisconnected":"WS disconnected","header.settingsBtn":"⚙️ Settings","header.settingsTitle":"Settings","session.copyRestart":"Copy restart command: pnpm --dir D:\\code\\cc-hub miki claude -r {uuid}","session.cliMarkTooltip":"Marked as CLI session — prefilled send is disabled (URI handler doesn't support terminal). Click to switch back to VSCode.","session.vscodeMarkTooltip":"Marked as VSCode session — click to switch to CLI.","session.waitingBadge":"🔔 Awaiting reply","session.waitingTooltip":"Claude is still waiting for your answer — click to re-show the question","session.openTab":"Open in tab","session.wrappedDetailed":"This session is taken over by the `miki claude` wrapper (CLI session) — sends go via push, no spawn / no $$","session.empty":"(no conversation yet)","session.quickSend":"Quick send (pops a small card, no transcript expand)","session.openCli":"Open CLI","session.openCliPending":"...","session.openCliFailed":"Failed: {err}","session.openCliTooltip":"Pop a Windows Terminal running miki claude -r — turns this session into a wrapped one","wrapNotice.title":"CLI started — please close the VSCode panel manually","wrapNotice.body":"{project} is now owned by the CLI wrapper. The VSCode panel still thinks it owns this session — typing in both will fork the JSONL transcript and corrupt session state. Recommended: close that Claude Code panel in VSCode, then interact only via dashboard / CLI.","wrapNotice.confirmCheck":"I've closed the corresponding VSCode panel","wrapNotice.confirm":"Confirm","wrapNotice.later":"Cancel","wrapNotice.dismiss":"Got it","header.newCli":"New CLI","header.newCliTitle":"Open a new CLI in a chosen folder (miki claude --fresh)","newCli.heading":"New CLI","newCli.cwdLabel":"Folder path","newCli.cwdPlaceholder":"Path","newCli.recentCwds":"Recent paths","newCli.submit":"Open","newCli.submitting":"Starting…","newCli.success":"Started — waiting for wrap to connect back","newCli.error":"Failed: {err}","newCli.hint":'Spawns miki claude --fresh in a new Windows Terminal. SDK initializes via a synthetic "hi" then takes over.',"spawnPending.title":"Starting…","spawnPending.body":"Running miki claude in {cwd} — once SDK init completes and wrap connects back, the new card will appear here. About 3–5s.","spawnPending.timeout":"Over 30s with no callback — check the wt window for errors.","spawnPending.dismiss":"Close","session.closeTab":"Close tab","session.closeKey":"Close","session.modalClose":"Close (Esc)","session.claudeWaitingHere":"🔔 Claude is still waiting for your answer on this session","session.showQuestion":"Re-show question","mode.lockedAcceptTitle":"Auto-accept edits mode: all edits/writes apply directly, no confirmation. Locked at start via `miki claude --permission-mode acceptEdits`.","mode.lockedBypassTitle":"Bypass permissions: all tools run without asking. Extremely dangerous, sandbox only. Locked at start via `miki claude --bypass-permissions`.","mode.lockedPlanTitle":"Plan mode: planning only, no mutation tools. Locked at start via `miki claude --permission-mode plan`.","mode.defaultDesc":"Ask before every edit","mode.defaultTitle":"Ask before edits: every mutation tool prompts you.","mode.acceptDesc":"Apply edits / writes directly","mode.acceptTitle":"Edit automatically: all edits/writes apply directly, no confirmation.","mode.planDesc":"Plan only, no file changes","mode.planTitle":"Plan mode: planning only, no mutation tools.","mode.autoDesc":"Claude picks the mode itself","mode.autoTitle":"Auto mode: Claude picks the most appropriate mode per task.","mode.bypassDesc":"All tools run (dangerous)","mode.bypassTitle":"Bypass permissions: all tools run without asking. Extremely dangerous, sandbox only.","mode.switchHint":" · click to switch mode","log.activity":"Activity log","log.syncedConsole":"Mirrored to F12 Console","log.clear":"Clear","log.empty":"No activity yet. Hit any button or wait for hook events.","overview.title":"🗺️ Overview","overview.noSessions":"No sessions yet.","overview.openPanelHint":"Open a Claude Code panel in any VSCode window — it shows up here.","overview.runHooks":"Nothing happening? Try:","overview.sessionGone":"(session no longer exists, daemon may have restarted)","settings.title":"Settings","settings.sendKeySection":"Send key (global)","settings.enterLabel":"Enter","settings.enterDesc":" to send · Shift+Enter for newline","settings.ctrlEnterLabel":"Ctrl/⌘ + Enter","settings.ctrlEnterDesc":" to send · Enter for newline","settings.sendKeyHelp":"Applies to the dashboard quick-send card + every tab's composer. In Enter mode, Ctrl/⌘+Enter still force-sends.","settings.appearance":"Appearance","settings.themeLight":"☀️ Light","settings.themeDark":"🌙 Dark","settings.themeSystem":"🖥 System","settings.themeSystemTitle":"Follow OS setting (prefers-color-scheme)","settings.themeDarkTitle":"Dark mode","settings.themeLightTitle":"Light mode","settings.sortMode":"Card sort","settings.sortPriorityLabel":"🔔 Priority","settings.sortPriorityTitle":"Sessions awaiting reply first (waiting → active → idle → stale), then by cwd","settings.sortUuidLabel":"🆔 UUID","settings.sortUuidTitle":"Sort by session_uuid; each session stays in its slot forever, no drift on F5/restart (independent of project name)","settings.sortRecentLabel":"⏱ Recent","settings.sortRecentTitle":"Most recent activity first (last_event_at DESC), shuffles as events arrive","settings.sortHelp":"Affects overview card ordering. Position persists across F5 (except for the Recent mode, which is meant to shuffle).","settings.close":"Close","settings.language":"Language","startup.starting":"Starting — fetching /sessions + previews","startup.getSessionsFailed":"GET /sessions failed","startup.gotSessions":"GET /sessions 200 — received {n} sessions","startup.wsConnecting":"WS connecting","phone.pair.title":"miki-moni pairing","phone.pair.subtitle":"Pair this device with the miki-moni daemon on your computer","phone.pair.instruction":"Run {cmd} in your computer's terminal and enter the 16-char pairing code it shows.","phone.pair.codeLabel":"Pairing code","phone.pair.codePlaceholder":"XXXX-XXXX-XXXX-XXXX","phone.pair.errorBadCode":"Code must be 16 chars from the Crockford base32 alphabet","phone.pair.errorScannedQr":"Scanned, but not a pairing QR: {text}","phone.pair.busy":"Pairing…","phone.pair.submit":"Start pairing","phone.pair.or":"or","phone.pair.scan":"Scan QR Code","phone.pair.autoTitle":"Pairing…","phone.pair.autoHint":"Completing handshake with daemon","phone.pair.relayLabel":"relay:","phone.tunnel.connecting":"Connecting…","phone.tunnel.connectingHint":"Connecting through relay to daemon · {daemon}…","phone.tunnel.error":"Connection error","phone.tunnel.resetAndRepair":"Clear state and re-pair","phone.conn.connected":"Connected","phone.conn.connecting":"Connecting…","phone.conn.reconnecting":"Reconnecting…","phone.conn.error":"Connection error","phone.session.noUuid":"null (not detected — focus/send may open the wrong session)","phone.session.focus":"Bring up window","phone.session.promptPlaceholder":"Type a prompt to send to this session…","phone.session.send":"Send","phone.empty.title":"⚪ Connected to relay, but no sessions yet","phone.empty.twoOptions":"Two possibilities:","phone.empty.daemonNotRunning":"Computer's daemon isn't running → in terminal run {cmd}","phone.empty.noClaude":"daemon is running but you haven't opened any Claude Code session yet → open one and it'll show up","phone.empty.hooksHint":"If hooks aren't installed yet: {cmd}","phone.empty.waitingConn":"Waiting for connection…","phone.header.unpair":"Unpair","phone.header.unpairing":"Unpairing…","phone.log.title":"Activity log","phone.log.consoleNote":" (mirrored to F12 Console)","phone.log.clear":"Clear","phone.log.empty":"No activity yet. Once WS connects, sends + events show up here in real time.","phone.log.wsError":"WS error","phone.log.wsCloseReconnect":"WS close — reconnecting in {delay}ms","phone.log.wsCloseReason":"(none)","phone.log.wsNonJson":"WS received non-JSON","phone.log.wsConnectingRelay":"WS connecting (relay)","phone.log.wsConnectingLegacy":"WS connecting (legacy)","phone.log.wsOpenSnapshot":"WS open — sending request_snapshot","phone.log.unknownKind":"Unknown message kind","phone.log.snapshotReceived":"state_snapshot — received {n} sessions","phone.log.eventReceived":"event — {project}","phone.log.envelopeFail":"envelope decryption failed — peer may not be this device","phone.log.identityFail":"Failed to load identity","phone.log.sendFailWsClosed":"{label}: WS not connected, can't send","phone.log.encryptedSend":"Encrypted send {label}","phone.log.registerPeer":"Sending register_peer_id","phone.log.revokeRelay":"Sending revoke_self to relay","phone.log.revokeOk":"Relay confirmed revoke, clearing local state","phone.log.revokeKicked":"Daemon force-unpaired us, returning to pair screen","phone.log.unpairOffline":"WS offline; cleared local state directly (relay may still have a paired_phones entry that blocks the next connection)","phone.log.focusClick":"click bring-up window","phone.log.sendClick":"click send prompt"},$n={"zh-TW":Bi,"zh-CN":Mi,en:Hi};function Ni(t,e){return e?t.replace(/\{(\w+)\}/g,(n,o)=>{const i=e[o];return i==null?`{${o}}`:String(i)}):t}function u(t,e){const o=$n[kt][t]??$n["zh-TW"][t]??t;return Ni(o,e)}let Mt=null;function Fi(t){Mt=t}function tn(){if(!Mt)throw new Error("api.ts: no Transport installed — call setTransport() in your bootstrap before mounting the app");return Mt}function de(t,e){return tn().fetch(t,e)}function Ki(t){return tn().openWebSocket(t)}class Ui{constructor(){X(this,"mode","local")}fetch(e,n){return window.fetch(e,n)}openWebSocket(e){const n=window.location.origin.replace(/^http/,"ws");return new window.WebSocket(n+e)}}const dt={active:"dot dot-active",waiting:"dot dot-waiting",idle:"dot dot-idle",stale:"dot dot-stale"},qi={active:"var(--pass)",waiting:"var(--warn)",idle:"var(--neutral)",stale:"var(--accent)"};function pt(t){return u(`status.${t}`)}const ji=50,nn="%c[miki-moni]",sn="color:#4b556a;font-weight:600";function An(t,e){console.log(nn,sn,t,e??"")}function zn(t,e){console.warn(nn,sn,t,e??"")}function Xi(t,e){console.error(nn,sn,t,e??"")}function Vi(t){const e=typeof t=="number"?new Date(t):new Date(t);return isNaN(e.getTime())?"":e.toLocaleString("zh-TW",{hour12:!1})}function Ze(t){const e=Math.max(0,Date.now()-t);return e<6e4?u("time.secondsAgo",{n:Math.floor(e/1e3)}):e<36e5?u("time.minutesAgo",{n:Math.floor(e/6e4)}):e<864e5?u("time.hoursAgo",{n:Math.floor(e/36e5)}):u("time.daysAgo",{n:Math.floor(e/864e5)})}function It(t){if(!t)return"";const e=Date.parse(t);return Number.isFinite(e)?Ze(e):""}function Qi({size:t=22}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-label":"miki-moni",children:[s("path",{d:"M4.5 13.2 L6 10 L7.6 13 L9.6 11 L11.4 13 C14.5 13 18.5 13.6 20 15.8 C20.8 17 20.4 18.3 18.6 18.7 C16 19.2 7 19.2 5.4 18.4 C3.8 17.5 3.6 14.5 4.5 13.2 Z"}),s("path",{d:"M6.8 15.2 q0.9 0.7 1.8 0","stroke-width":"1.3"}),s("path",{d:"M15 7 h2.4 l-2.4 2.6 h2.4","stroke-width":"1.3"}),s("path",{d:"M18.4 4.5 h1.6 l-1.6 1.8 h1.6","stroke-width":"1.1"})]})}function Gi({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),s("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function Zi({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",children:s("polyline",{points:"20 6 9 17 4 12"})})}function gs({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("path",{d:"m22 2-7 20-4-9-9-4Z"}),s("path",{d:"M22 2 11 13"})]})}function fs({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",children:s("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Ji({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:s("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}function Yi({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("rect",{x:"6",y:"4",width:"4",height:"16"}),s("rect",{x:"14",y:"4",width:"4",height:"16"})]})}function eo({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("path",{d:"M12 22v-5"}),s("path",{d:"M9 8V2"}),s("path",{d:"M15 8V2"}),s("path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z"}),s("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]})}function to({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("circle",{cx:"12",cy:"12",r:"3"}),s("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function no({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("path",{d:"M3 5a2 2 0 0 1 2-2h11"}),s("path",{d:"M21 11v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5"}),s("polyline",{points:"7 10 10 13 7 16"}),s("line",{x1:"13",y1:"16",x2:"17",y2:"16"}),s("line",{x1:"19",y1:"3",x2:"19",y2:"7"}),s("line",{x1:"17",y1:"5",x2:"21",y2:"5"})]})}function so({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),s("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),s("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),s("circle",{cx:"9",cy:"6",r:"2",fill:"var(--bg)"}),s("circle",{cx:"15",cy:"12",r:"2",fill:"var(--bg)"}),s("circle",{cx:"7",cy:"18",r:"2",fill:"var(--bg)"})]})}function ms({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2"}),s("circle",{cx:"8",cy:"8",r:"1.5"}),s("polyline",{points:"3 14 8 10 13 14 17 11"}),s("line",{x1:"19",y1:"15",x2:"19",y2:"21"}),s("line",{x1:"16",y1:"18",x2:"22",y2:"18"})]})}function Dn({size:t=13}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[s("polygon",{points:"12 2 2 7 12 12 22 7 12 2"}),s("polyline",{points:"2 17 12 22 22 17"}),s("polyline",{points:"2 12 12 17 22 12"})]})}function Wn({size:t=13,spinning:e=!1}){return s("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:e?{animation:"mm-spin 0.9s linear infinite"}:void 0,children:[s("polyline",{points:"23 4 23 10 17 10"}),s("polyline",{points:"1 20 1 14 7 14"}),s("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10"}),s("path",{d:"M20.49 15a9 9 0 0 1-14.85 3.36L1 14"})]})}U.setOptions({gfm:!0,breaks:!0});function ys({text:t}){const e=Oe(()=>{try{return U.parse(t,{async:!1})}catch{return`<pre>${io(t)}</pre>`}},[t]);return s("div",{class:"md",dangerouslySetInnerHTML:{__html:e}})}function io(t){return t.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function On(t){try{return U.parse(t,{async:!1}).replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi," ").replace(/<hr\s*\/?\s*>/gi," ").replace(/<\/(td|th|li)>/gi," · ").replace(/<\/(p|div|tr|thead|tbody|h[1-6]|blockquote)>/gi," ").replace(/<br\s*\/?\s*>/gi," ").replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/(\s*·\s*){2,}/g," · ").replace(/\s+/g," ").trim().replace(/^·\s*/,"").replace(/\s*·\s*$/,"")}catch{return t.replace(/\s+/g," ").trim()}}async function ws(t){var r;const e=await new Promise((c,a)=>{const l=new FileReader;l.onerror=()=>a(l.error),l.onload=()=>c(l.result),l.readAsDataURL(t)}),[n,o]=e.split(",");return{media_type:((r=n==null?void 0:n.match(/^data:([^;]+);/))==null?void 0:r[1])??"image/png",data:o??"",preview:e,bytes:t.size}}async function ks(t){var o;const e=(o=t.clipboardData)==null?void 0:o.items;if(!e)return[];const n=[];for(let i=0;i<e.length;i++){const r=e[i];if(!r.type.startsWith("image/"))continue;const c=r.getAsFile();c&&n.push(await ws(c))}return n}async function _s(t){if(!t)return[];const e=Array.from(t),n=[];for(const o of e)o.type.startsWith("image/")&&n.push(await ws(o));return n}function oo(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}function ro({sessionUuid:t,ask:e,onSubmitted:n,onDismiss:o}){const[i,r]=v(0),[c,a]=v({}),[l,p]=v({}),[h,d]=v(!1),[f,y]=v(null),g=e.questions[i];if(!g)return null;function R(w,k,I){a(x=>{const C=new Set(x[w]??[]);return I?C.has(k)?C.delete(k):C.add(k):(C.clear(),C.add(k)),{...x,[w]:C}})}async function b(){const w=e.questions.map((k,I)=>{const C=Array.from(c[I]??[]).map(F=>{var S;return((S=k.options[F])==null?void 0:S.label)??""}).filter(Boolean),A=(l[I]??"").trim();return A?[...C,A]:C});if(w.every(k=>k.length===0)){y(u("ask.atLeastOne"));return}d(!0),y(null);try{const k=await de("/wrap/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:t,question_id:e.question_id,answers:w})});if(!k.ok){y(`HTTP ${k.status}`);return}n()}catch(k){y(String(k))}finally{d(!1)}}return s(Ce,{children:[s("div",{class:"ask-modal-backdrop",onClick:w=>{w.stopPropagation(),o()}}),s("div",{class:"ask-modal",onClick:w=>w.stopPropagation(),children:[s("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[s("strong",{style:{fontSize:14},children:u("ask.claudeAsking")}),s("span",{style:{color:"var(--fg-subtle)",fontSize:11,marginLeft:"auto"},children:e.questions.length>1?`${i+1} / ${e.questions.length}`:""}),s("button",{class:"btn-ghost",style:{padding:"2px 8px"},onClick:o,children:"×"})]}),e.questions.length>1&&s("div",{style:{display:"flex",gap:4,marginBottom:10,flexWrap:"wrap"},children:e.questions.map((w,k)=>{var x,C,A;const I=(((x=c[k])==null?void 0:x.size)??0)>0||(((A=(C=l[k])==null?void 0:C.trim())==null?void 0:A.length)??0)>0;return s("button",{class:"ask-tab"+(k===i?" ask-tab-active":"")+(I?" ask-tab-done":""),onClick:()=>r(k),children:[I?"✓ ":"",w.header]},k)})}),s("div",{style:{fontSize:13,fontWeight:500,marginBottom:10},children:g.question}),s("div",{style:{display:"flex",flexDirection:"column",gap:6},children:g.options.map((w,k)=>{var C;const I=((C=c[i])==null?void 0:C.has(k))??!1,x=!!g.multiSelect;return s("label",{class:"ask-option"+(I?" ask-option-checked":""),children:[s("input",{type:x?"checkbox":"radio",name:`q-${i}`,checked:I,onChange:()=>R(i,k,x)}),s("div",{children:[s("div",{style:{fontWeight:500},children:w.label}),w.description&&s("div",{style:{fontSize:11,color:"var(--fg-subtle)"},children:w.description})]})]},k)})}),s("input",{type:"text",placeholder:u("ask.placeholder"),value:l[i]??"",onInput:w=>p(k=>({...k,[i]:w.currentTarget.value})),style:{width:"100%",marginTop:10}}),f&&s("div",{style:{marginTop:8,fontSize:12,color:"var(--accent)"},children:f}),s("div",{style:{display:"flex",gap:8,marginTop:12},children:[e.questions.length>1&&i>0&&s("button",{class:"btn-outline",onClick:()=>r(w=>w-1),children:u("ask.prev")}),e.questions.length>1&&i<e.questions.length-1&&s("button",{class:"btn-outline",onClick:()=>r(w=>w+1),children:u("ask.next")}),s("button",{class:"btn-primary",style:{marginLeft:"auto"},onClick:b,disabled:h,children:u(h?"ask.submitting":"ask.submit")})]})]})]})}function bs({images:t,onRemove:e,dimmed:n}){return t.length===0?null:s("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:6,opacity:n?.5:1},children:t.map((o,i)=>s("div",{style:{position:"relative",border:"1px solid var(--border)",borderRadius:4,padding:2},children:[s("img",{src:o.preview,alt:"",style:{display:"block",maxHeight:72,maxWidth:120,borderRadius:2}}),s("div",{style:{fontSize:9,color:"var(--fg-subtle)",textAlign:"center",marginTop:2},children:[o.media_type.replace("image/","")," · ",oo(o.bytes)]}),s("button",{type:"button",onClick:r=>{r.stopPropagation(),e(i)},style:{position:"absolute",top:-6,right:-6,background:"rgba(20,20,20,0.85)",color:"white",border:"1px solid white",borderRadius:"50%",width:18,height:18,padding:0,cursor:"pointer",fontSize:10,lineHeight:"16px"},title:u("ask.removeThis"),children:"×"})]},i))})}function lo({turn:t}){const e=t.tool_use,[n,o]=v(!1),i=typeof e.input=="string"?e.input:JSON.stringify(e.input,null,2);return s("div",{class:"toolbox",style:{marginTop:4},children:[s("div",{class:"toolbox-head",style:{cursor:"pointer",userSelect:"none"},onClick:()=>o(r=>!r),title:u(n?"expand.collapse":"expand.expandIn"),children:[s("span",{style:{color:"var(--fg-subtle)",fontSize:10,width:10,display:"inline-block"},children:n?"▾":"▸"}),s("span",{class:"dot dot-active",style:{width:6,height:6}}),s("span",{children:e.name}),e.description&&s("span",{style:{color:"var(--fg-subtle)"},children:e.description})]}),n&&s("div",{class:"toolbox-row",children:[s("div",{class:"toolbox-label",children:"IN"}),s("pre",{class:"toolbox-content",style:{margin:0},children:i})]})]})}function ao({turn:t}){const e=t.tool_result,[n,o]=v(!1),i=e.content||"(empty)",r=i.replace(/\s+/g," ").slice(0,120);return s("div",{class:"toolbox",style:{marginTop:4},children:[s("div",{class:"toolbox-head",style:{cursor:"pointer",userSelect:"none"},onClick:()=>o(c=>!c),title:u(n?"expand.collapse":"expand.expandOut"),children:[s("span",{style:{color:"var(--fg-subtle)",fontSize:10,width:10,display:"inline-block"},children:n?"▾":"▸"}),s("span",{class:"toolbox-label"+(e.is_error?" is-error":""),style:{margin:0},children:"OUT"}),!n&&s("span",{style:{color:"var(--fg-subtle)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:[r,i.length>120?"…":""]})]}),n&&s("div",{class:"toolbox-row",children:[s("div",{class:"toolbox-label",children:" "}),s("pre",{class:"toolbox-content"+(e.is_error?" is-error":""),style:{margin:0},children:[i,e.truncated&&s("div",{style:{color:"var(--fg-subtle)",fontSize:10,marginTop:4},children:"…[truncated]"})]})]})]})}function co({turn:t}){const e=t.role==="user"&&!t.tool_result,n=t.role==="system",o=!!(t.tool_use||t.tool_result),i=n?"system":e?"user":"claude",r=o||n?"var(--fg-subtle)":e?"var(--neutral)":"var(--pass)",c=o||n?"turn-bg-tool":e?"turn-bg-user":"turn-bg-assistant",a=o?3:6,l=o?11:12;return s("div",{class:`turn-row ${e?"turn-row-user":"turn-row-other"}`,children:s("div",{class:`turn-bubble ${c}${o?" turn-bubble-tool":""}`,children:[s("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:a,flexWrap:"wrap"},children:[s("span",{style:{color:r,fontWeight:600,fontSize:l},children:i}),s("span",{style:{color:"var(--fg-subtle)",fontSize:10},children:Vi(t.ts)}),t.tool_use&&s("span",{style:{color:"var(--fg-subtle)",fontSize:10},children:["· 🔧 ",t.tool_use.name]}),t.tool_result&&s("span",{style:{color:"var(--fg-subtle)",fontSize:10},children:"· 📤 tool result"})]}),t.text&&s(ys,{text:t.text}),t.tool_use&&s(lo,{turn:t}),t.tool_result&&s(ao,{turn:t})]})})}function po({turns:t}){const e=ee(null),n=ee(!0),o=t.length===0?"0":`${t.length}|${t[t.length-1].ts}|${t[t.length-1].text.length}`;j(()=>{n.current&&e.current&&(e.current.scrollTop=e.current.scrollHeight)},[o]);const i=64;function r(c){const a=c.currentTarget;n.current=a.scrollHeight-a.scrollTop-a.clientHeight<i}return t.length===0?s("div",{style:{padding:"12px 14px",color:"var(--fg-subtle)",fontSize:12},children:u("transcript.empty")}):s("div",{ref:e,onScroll:r,style:{overflowY:"auto",height:"100%",minHeight:0,overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},children:[s("div",{style:{position:"sticky",top:0,zIndex:1,padding:"6px 14px",fontSize:10,fontWeight:600,color:"var(--fg-subtle)",textTransform:"uppercase",letterSpacing:"0.08em",background:"var(--sl2)",borderBottom:"1px solid var(--border)"},children:[u("transcript.conversation")," · ",t.length]}),t.map((c,a)=>s(co,{turn:c},a))]})}function uo({s:t,defaultExpanded:e,clientType:n,onSetClientType:o,onFocus:i,onSend:r,sendKey:c,modalMode:a,onAfterSend:l,activity:p,transcript:h,transcriptLoading:d,transcriptError:f,transcriptLimit:y,onSetTranscriptLimit:g,onReloadTranscript:R,showTools:b,onSetShowTools:w,streamingText:k,streamingStartTs:I,userOverlayText:x,userOverlayTs:C}){const A=n==="cli",F=!!t.wrapped,S=!F,[B,q]=v(!e),[ne,re]=v(""),[E,te]=v([]),ge=ee(null);j(()=>{const $=ge.current;if($){if(ne===""){$.style.height="";return}requestAnimationFrame(()=>{$.style.height="auto",$.style.height=`${Math.min($.scrollHeight,a?160:260)}px`})}},[ne,a]);const[le,ce]=v(!1),W=ee(null);j(()=>{if(!le)return;function $(oe){var he;(he=W.current)!=null&&he.contains(oe.target)||ce(!1)}return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[le]);const M=F,[H,J]=v(!1),[be,Ee]=v(!1),[ve,He]=v(!1),[Ne,$e]=v(null),[xe,Ae]=v(null),pe=t.session_uuid??"";async function Fe(){An("click focus",{cwd:t.cwd,uuid:pe}),$e(null);const $=await i(pe);$e({ok:$.ok,label:$.ok?u("send.httpOk",{status:$.status}):u("send.httpFail",{status:$.status}),url:$.url,ts:Date.now()}),setTimeout(()=>$e(null),15e3)}async function et(){const $=ne.trim(),oe=E.length>0;if(!(!$&&!oe)){An("click send",{cwd:t.cwd,uuid:pe,mode:H?"submit":"prefill+enter",len:$.length,images:oe?E.length:0}),Ae(null),He(!0);try{const V=await r(pe,$,H,M?E:void 0),we=V.ok?H?u("send.claudeReplied",{ms:V.duration_ms??"?"}):u("send.sentToVSCode"):u("send.httpFail",{status:V.status});Ae({ok:V.ok,label:we,url:V.url,reply:V.reply,durationMs:V.duration_ms,diag:V.diag,error:V.error,ts:Date.now()}),V.ok&&(re(""),te([])),V.ok&&l&&l()}finally{He(!1)}setTimeout(()=>Ae(null),6e4)}}async function St($){const oe=await ks($);oe.length>0&&($.preventDefault(),te(he=>[...he,...oe]))}if(B)return s("div",{class:"card",style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px"},children:[s("span",{class:dt[t.status]}),s("span",{style:{fontWeight:500,minWidth:120},children:t.project_name}),s("span",{style:{color:"var(--fg-subtle)",fontSize:11,fontFamily:"ui-monospace, monospace"},children:t.cwd}),s("span",{style:{color:"var(--fg-muted)",fontSize:12,marginLeft:"auto"},children:pt(t.status)}),s("span",{style:{color:"var(--fg-subtle)",fontSize:11},children:Ze(t.last_event_at)}),s("button",{class:"btn-ghost",onClick:()=>q(!1),title:u("expand.expand"),children:"▾"})]});const Te=e;return s("div",{class:"card",style:a?{display:"flex",flexDirection:"column",height:"100%",minHeight:0,border:"none",borderRadius:0}:Te?{display:"flex",flexDirection:"column",height:"calc(100vh - 220px)",minHeight:480}:void 0,children:[s("div",{style:{display:"flex",alignItems:"center",gap:a?8:10,padding:a?"6px 12px":"12px 14px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[s("span",{class:dt[t.status]}),s("button",{class:"btn-ghost",style:{fontWeight:600,fontSize:a?14:15,padding:a?"0 4px":"2px 6px"},onClick:Fe,title:u(A?"focus.cliNotSupported":"focus.bringVSCode"),disabled:A,children:t.project_name}),t.wrapped?s("span",{class:"client-badge client-badge-wrap client-badge-md",title:u("focus.wrappedTitle"),children:u("focus.wrappedBadge")}):s(on,{type:n,onToggle:()=>o(pe,A?"vscode":"cli"),size:"md"}),!a&&s(Ce,{children:[s("span",{style:{color:"var(--fg-muted)",fontSize:12},children:pt(t.status)}),p&&s("span",{class:"cell-activity",title:u("focus.wrapperRunning",{activity:p}),children:[p,"…"]}),s("span",{style:{color:"var(--fg-subtle)",fontSize:11,marginLeft:8},children:Ze(t.last_event_at)}),t.wrapped&&s(Ht,{sessionUuid:t.session_uuid,mode:t.permission_mode??"default"})]}),!a&&s("button",{class:"btn-ghost",style:{marginLeft:"auto"},onClick:()=>q(!0),title:u("expand.collapse"),children:"▴"}),a&&s("div",{ref:W,style:{marginLeft:"auto",marginRight:36,position:"relative"},children:[s("button",{class:"btn-ghost icon-btn",style:{padding:"4px 6px"},onClick:()=>ce($=>!$),title:u("transcript.viewOptions"),"aria-label":u("transcript.viewOptions"),"aria-expanded":le,children:s(so,{size:15})}),le&&s("div",{style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:50,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:"10px 12px",boxShadow:"0 6px 24px rgba(0,0,0,0.18)",minWidth:200,display:"flex",flexDirection:"column",gap:8},children:[s("label",{style:{display:"inline-flex",alignItems:"center",gap:8,fontSize:12,color:"var(--fg-muted)",cursor:"pointer",userSelect:"none"},children:[s("input",{type:"checkbox",checked:b,onChange:$=>w($.currentTarget.checked),style:{margin:0}}),u("transcript.showTool")]}),s("select",{value:y,onChange:$=>g(parseInt($.currentTarget.value,10)),style:{width:"100%"},children:[s("option",{value:10,children:u("transcript.items10")}),s("option",{value:20,children:u("transcript.items20")}),s("option",{value:50,children:u("transcript.items50")}),s("option",{value:100,children:u("transcript.items100")}),s("option",{value:200,children:u("transcript.items200")}),s("option",{value:500,children:u("transcript.items500")}),s("option",{value:1e4,children:u("transcript.itemsAll")})]}),s("div",{style:{display:"flex",gap:6},children:[s("button",{class:"btn-outline",style:{flex:1,height:30,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,fontSize:12},onClick:()=>{g(1e4),ce(!1)},disabled:d,title:u("transcript.loadAllTitle"),children:[s(Dn,{size:13})," ",u("transcript.loadAll")]}),s("button",{class:"btn-outline",style:{height:30,padding:"0 10px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>{R(),ce(!1)},disabled:d,title:u(d?"transcript.loading":"transcript.reload"),"aria-label":u(d?"transcript.loading":"transcript.reload"),children:s(Wn,{size:13,spinning:d})})]})]})]})]}),s("div",{style:Te?{display:"flex",flexDirection:"column",flex:1,minHeight:0,borderBottom:"1px solid var(--border)"}:{borderBottom:"1px solid var(--border)"},children:[!a&&s("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 14px",flexShrink:0},children:[s("label",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,fontSize:11,color:"var(--fg-subtle)",cursor:"pointer",userSelect:"none"},children:[s("input",{type:"checkbox",checked:b,onChange:$=>w($.currentTarget.checked),style:{margin:0}}),u("transcript.showTool")]}),s("select",{value:y,onChange:$=>g(parseInt($.currentTarget.value,10)),children:[s("option",{value:10,children:u("transcript.items10")}),s("option",{value:20,children:u("transcript.items20")}),s("option",{value:50,children:u("transcript.items50")}),s("option",{value:100,children:u("transcript.items100")}),s("option",{value:200,children:u("transcript.items200")}),s("option",{value:500,children:u("transcript.items500")}),s("option",{value:1e4,children:u("transcript.itemsAll")})]}),s("button",{class:"btn-outline",style:{height:28,padding:"0 8px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>g(1e4),disabled:d,title:u("transcript.loadAllTitle"),"aria-label":u("transcript.loadAll"),children:s(Dn,{size:14})}),s("button",{class:"btn-outline",style:{height:28,padding:"0 8px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:R,disabled:d,title:u(d?"transcript.loading":"transcript.reload"),"aria-label":u(d?"transcript.loading":"transcript.reload"),children:s(Wn,{size:14,spinning:d})})]}),f&&s("div",{style:{padding:"8px 14px",color:"var(--accent)",fontSize:12},children:f}),h&&(()=>{const $=b?h.turns:h.turns.filter(V=>!V.tool_use&&!V.tool_result).slice(-y),oe=[];if(x&&C){let V=0;for(const we of h.turns){if(we.role!=="user"||we.tool_result)continue;const ze=Date.parse(we.ts)||0;ze>V&&(V=ze)}V<C&&oe.push({ts:new Date(C).toISOString(),role:"user",text:x,raw_type:"synthetic-user-overlay"})}if(k&&k.length>0){let V=0;for(const De of h.turns){if(De.role!=="assistant"||De.tool_use)continue;const Le=Date.parse(De.ts)||0;Le>V&&(V=Le)}const we=I??0;we>0&&V>=we||oe.push({ts:new Date().toISOString(),role:"assistant",text:k,raw_type:"synthetic-streaming"})}const he=oe.length>0?$.concat(oe):$;return s("div",{style:Te?{flex:1,minHeight:0,display:"flex"}:{maxHeight:480,overflow:"hidden",display:"flex"},children:s("div",{style:{flex:1,minWidth:0},children:s(po,{turns:he})})})})()]}),s("div",{style:{flexShrink:0},children:[Ne&&s("div",{style:{padding:"0 14px 8px",fontSize:12,color:Ne.ok?"var(--pass)":"var(--accent)"},children:u("send.focusing",{label:Ne.label})}),s("div",{style:{padding:"8px 14px 12px",display:"flex",flexDirection:"column",gap:6,borderTop:"1px solid var(--border)"},children:[a&&s("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",fontSize:11,color:"var(--fg-subtle)",marginBottom:2},children:[s("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s("span",{class:dt[t.status],style:{width:7,height:7}}),s("span",{style:{color:"var(--fg-muted)"},children:pt(t.status)})]}),t.wrapped&&s(Ce,{children:[s(wo,{sessionUuid:t.session_uuid,current:t.current_model}),s(Ht,{sessionUuid:t.session_uuid,mode:t.permission_mode??"default"})]}),s("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:[p&&s("span",{class:"cell-activity",title:u("focus.wrapperRunning",{activity:p}),children:[p,"…"]}),s("span",{children:Ze(t.last_event_at)})]})]}),s(bs,{images:E,onRemove:$=>te(oe=>oe.filter((he,V)=>V!==$)),dimmed:!M&&E.length>0}),!M&&E.length>0&&s("div",{style:{fontSize:10,color:"var(--warn)"},children:u("composer.imageIgnored")}),s("div",{style:{display:"flex",gap:8},children:[s("textarea",{ref:ge,autoFocus:a,style:{flex:1,minWidth:0,minHeight:a?20:38,maxHeight:a?160:260,fontSize:13,overflow:"hidden",resize:"none"},rows:a?1:2,placeholder:S?A?u(a?"composer.cliNotWrappedShort":"composer.cliNotWrapped",{short:pe.slice(0,8)}):u(a?"composer.vscodeDisabledShort":"composer.vscodeDisabledWrap",{short:pe.slice(0,8)}):u(a?"composer.inputPromptShort":"composer.inputPrompt"),value:ne,onInput:$=>re($.currentTarget.value),onPaste:$=>{St($)},onKeyDown:$=>{Rs($,c)&&($.preventDefault(),!ve&&!S&&(ne.trim()||E.length>0)&&et())},disabled:ve||S}),s("label",{class:"btn-ghost icon-btn",style:{height:34,width:34,padding:0,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:M&&!ve?"pointer":"not-allowed",opacity:M&&!ve?1:.5},title:u("composer.uploadImage"),"aria-label":u("composer.uploadImage"),children:[s(ms,{size:14}),s("input",{type:"file",accept:"image/*",multiple:!0,style:{display:"none"},disabled:!M||ve,onChange:async $=>{const oe=$.currentTarget,he=await _s(oe.files);he.length>0&&te(V=>[...V,...he]),oe.value=""}})]}),F&&s("button",{class:"btn-ghost icon-btn",style:{height:34,width:34,padding:0,fontSize:16,lineHeight:1,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>{de("/wrap/interrupt",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:pe})})},title:u("composer.interruptLong"),children:s(fs,{size:14})}),s("button",{class:F?"btn-primary icon-btn":"btn-ghost icon-btn",style:{height:34,width:34,padding:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},disabled:!ne.trim()&&E.length===0||ve||S,onClick:et,title:u(S?"composer.needWrapHint":F?"composer.wrapWSHint":"composer.needWrapBadge"),children:ve?"⌛":s(gs,{size:14})})]}),S&&A&&s("div",{style:{fontSize:10,color:"var(--fg-subtle)",lineHeight:1.5},children:["📟 ",s("strong",{style:{color:"#a8740d"},children:u("composer.cliNotWrappedStrong")}),u("composer.pleaseUse")," ",s("code",{children:["miki claude -r ",pe.slice(0,8),"…"]}),u("composer.toTakeOver")]}),!1,xe&&!xe.ok&&s("div",{style:{marginTop:4},children:[s("div",{style:{fontSize:12,color:"var(--accent)"},children:u("send.sendFailed",{label:xe.label})}),xe.error&&s("div",{style:{marginTop:6,fontSize:12,color:"var(--accent)",padding:8,background:"var(--bg-subtle)",borderRadius:4},children:["⚠️ ",xe.error]})]})]})]})]})}function ho({sessions:t,filter:e,onFilter:n}){const o=t.reduce((c,a)=>(c[a.status]=(c[a.status]??0)+1,c),{}),i=(o.active??0)+(o.waiting??0),r=c=>n(e===c?"all":c);return s("div",{style:{display:"inline-flex",alignItems:"center",gap:2,marginLeft:4},children:[s(Pt,{n:i,label:u("header.live"),icon:s(Ji,{}),dot:"dot-active",active:e==="live",onClick:()=>r("live")}),s(Pt,{n:o.idle??0,label:u("header.idle"),icon:s(Yi,{}),dot:"dot-idle",active:e==="idle",onClick:()=>r("idle")}),s(Pt,{n:o.stale??0,label:u("header.stale"),icon:s(eo,{}),dot:"dot-stale",active:e==="stale",onClick:()=>r("stale")})]})}function Pt({n:t,label:e,icon:n,dot:o,active:i,onClick:r}){return s("button",{type:"button",onClick:r,class:"header-stat"+(i?" is-active":""),title:u("header.onlyShow",{label:e}),"aria-label":u("header.onlyShow",{label:e}),children:[s("strong",{children:t}),o&&s("span",{class:`dot ${o}`}),n??s("span",{children:e})]})}const Bn=[{bg:"#fef3e2",border:"#f3d4a8",label:"#7c4a08"},{bg:"#fde6d3",border:"#f4c8a2",label:"#7d3f06"},{bg:"#fdedd3",border:"#f1d39c",label:"#76551a"},{bg:"#fce7e6",border:"#f0bdba",label:"#7e2924"},{bg:"#f9e3df",border:"#e9b6ae",label:"#75342a"},{bg:"#fbe6cc",border:"#eecca0",label:"#74471a"},{bg:"#fff4dc",border:"#f0d9a4",label:"#6f4f12"},{bg:"#f7ede4",border:"#dec9b4",label:"#5a4838"}];function go(t){let e=0;for(let n=0;n<t.length;n++)e=e*31+t.charCodeAt(n)>>>0;return Bn[e%Bn.length]}function fo({sessionUuid:t,compact:e}){const[n,o]=v(!1);function i(c){if(c.stopPropagation(),!t)return;const a=`pnpm --dir D:\\code\\cc-hub miki claude -r ${t}`;navigator.clipboard.writeText(a).then(()=>{o(!0),window.setTimeout(()=>o(!1),1500)},()=>{})}const r=e?11:13;return s("button",{class:"btn-ghost icon-btn",style:{padding:e?"3px 6px":"4px 8px"},onClick:i,title:u("session.copyRestart",{uuid:t}),disabled:!t,children:n?s(Zi,{size:r}):s(Gi,{size:r})})}function on({type:t,onToggle:e,size:n="sm"}){const o=t==="cli",i=o?"📟 CLI":"🖥️ VSCode",r=u(o?"session.cliMarkTooltip":"session.vscodeMarkTooltip");return s("button",{class:"client-badge"+(o?" client-badge-cli":" client-badge-vscode")+(n==="md"?" client-badge-md":""),onClick:c=>{c.stopPropagation(),e()},title:r,children:i})}function Mn({mode:t}){const e={width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};switch(t){case"default":return s("svg",{...e,children:[s("path",{d:"M11 12.5V5a1.7 1.7 0 0 0-3.4 0v8.5"}),s("path",{d:"M11 14V3.5a1.7 1.7 0 0 1 3.4 0V14"}),s("path",{d:"M14.4 13V6a1.7 1.7 0 0 1 3.4 0v8"}),s("path",{d:"M17.8 11.5a1.7 1.7 0 1 1 3.4 0V15a8 8 0 0 1-8 8h-2a4 4 0 0 1-4-4v-2.5a2 2 0 0 1 1.4-1.9"})]});case"acceptEdits":return s("svg",{...e,children:[s("polyline",{points:"9 6 3 12 9 18"}),s("polyline",{points:"15 6 21 12 15 18"})]});case"plan":return s("svg",{...e,children:[s("rect",{x:"5",y:"3",width:"14",height:"18",rx:"2"}),s("line",{x1:"9",y1:"8",x2:"15",y2:"8"}),s("line",{x1:"9",y1:"12",x2:"15",y2:"12"}),s("line",{x1:"9",y1:"16",x2:"13",y2:"16"})]});case"auto":return s("svg",{...e,children:s("polygon",{points:"13 2 4 14 11 14 10 22 20 10 13 10 13 2"})});case"bypassPermissions":return s("svg",{...e,children:[s("path",{d:"M10 14a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1"}),s("path",{d:"M14 10a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1"})]})}}const mo={default:{borderColor:"rgba(120,130,150,0.45)",color:"#60646c",background:"rgba(120,130,150,0.10)"},acceptEdits:{borderColor:"rgba(40,140,100,0.45)",color:"#1f7a4d",background:"rgba(40,140,100,0.12)"},plan:{borderColor:"rgba(40,110,200,0.45)",color:"#2c5fa8",background:"rgba(40,110,200,0.12)"},auto:{borderColor:"rgba(170,110,220,0.45)",color:"#7b3fb8",background:"rgba(170,110,220,0.12)"},bypassPermissions:{borderColor:"rgba(200,50,40,0.50)",color:"#b3261e",background:"rgba(200,50,40,0.12)"}},Pe={default:{short:"ask",cls:"pmode-chip-default",menuLabel:"Ask before edits",descKey:"mode.defaultDesc",titleKey:"mode.defaultTitle"},acceptEdits:{short:"edit auto",cls:"pmode-chip-auto",menuLabel:"Edit automatically",descKey:"mode.acceptDesc",titleKey:"mode.acceptTitle"},plan:{short:"plan",cls:"pmode-chip-plan",menuLabel:"Plan mode",descKey:"mode.planDesc",titleKey:"mode.planTitle"},auto:{short:"auto",cls:"pmode-chip-autopick",menuLabel:"Auto mode",descKey:"mode.autoDesc",titleKey:"mode.autoTitle"},bypassPermissions:{short:"bypass",cls:"pmode-chip-bypass",menuLabel:"Bypass permissions",descKey:"mode.bypassDesc",titleKey:"mode.bypassTitle"}};function yo(t){const e=Pe[t]??Pe.default;return{short:e.short,cls:e.cls,menuLabel:e.menuLabel,menuDesc:u(e.descKey),title:u(e.titleKey)}}function Ht({sessionUuid:t,mode:e}){const[n,o]=v(!1),[i,r]=v(null),[c,a]=v(null),l=ee(null),p=yo(e);j(()=>{if(!n)return;function f(y){var g;(g=l.current)!=null&&g.contains(y.target)||o(!1)}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[n]);async function h(f){if(!t||i||f===e){o(!1);return}r(f),a(null);try{const y=await de("/wrap/permission-mode",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:t,mode:f})});if(y.ok)o(!1);else{const g=await y.json().catch(()=>({}));a((g==null?void 0:g.error)??`HTTP ${y.status}`)}}catch(y){a(String(y))}finally{r(null)}}const d=f=>f.stopPropagation();return s("div",{ref:l,class:"pmode-chip-wrap",onClick:d,onMouseDown:d,children:[s("button",{class:`pmode-chip ${Pe[i??e].cls}`,title:p.title+u("mode.switchHint"),onClick:f=>{f.stopPropagation(),o(y=>!y)},onMouseDown:d,disabled:!t,children:[s(Mn,{mode:i??e}),s("span",{children:i?`${Pe[i].short}…`:p.short})]}),n&&s("div",{class:"pmode-menu",onClick:d,onMouseDown:d,children:[s("div",{class:"pmode-menu-head",children:"Modes"}),["default","acceptEdits","plan","auto","bypassPermissions"].map(f=>s("button",{class:"pmode-menu-item "+(f===e?"is-current":"")+" "+Pe[f].cls,onClick:y=>{y.stopPropagation(),h(f)},onMouseDown:d,disabled:!!i,title:u(Pe[f].titleKey),children:[s("span",{class:"pmode-menu-icon",children:s(Mn,{mode:f})}),s("div",{class:"pmode-menu-text",children:[s("div",{class:"pmode-menu-label",children:Pe[f].menuLabel}),s("div",{class:"pmode-menu-desc",children:u(Pe[f].descKey)})]}),f===e&&s("span",{class:"pmode-check",children:"✓"})]},f)),c&&s("div",{class:"pmode-err",children:c})]})]})}const vs=[{key:"default",label:"default",aliasFor:""},{key:"sonnet",label:"Sonnet",aliasFor:"sonnet"},{key:"opus",label:"Opus",aliasFor:"opus"},{key:"haiku",label:"Haiku",aliasFor:"haiku"}];function Hn(t){if(!t)return"default";const e=vs.find(n=>n.aliasFor===t);return e?e.label:t.replace(/^claude-/,"").replace(/-\d{8}$/,"")}function wo({sessionUuid:t,current:e}){const[n,o]=v(!1),[i,r]=v(null),[c,a]=v(null),[l,p]=v(""),h=ee(null),d=ee(null),[f,y]=v(null);j(()=>{if(!n)return;function w(k){var I;(I=h.current)!=null&&I.contains(k.target)||o(!1)}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[n]),j(()=>{if(!n){y(null);return}function w(){var q;const k=(q=d.current)==null?void 0:q.getBoundingClientRect();if(!k)return;const I=window.innerWidth,x=window.innerHeight,C=Math.min(300,I-16),A=k.left,F=I-C-8,S=Math.max(8,Math.min(A,F)),B=x-k.top+6;y({left:S,bottom:B,width:C})}return w(),window.addEventListener("resize",w),window.addEventListener("scroll",w,!0),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,!0)}},[n]);async function g(w){if(!(!t||i!==null)){r(w),a(null);try{const k=await de("/wrap/model",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:t,model:w})});if(k.ok)o(!1),p("");else{const I=await k.json().catch(()=>({}));a((I==null?void 0:I.error)??`HTTP ${k.status}`)}}catch(k){a(String(k))}finally{r(null)}}}const R=i!==null?`${Hn(i||null)}…`:Hn(e),b=w=>w.stopPropagation();return s("div",{ref:h,class:"pmode-chip-wrap",onClick:b,onMouseDown:b,children:[s("button",{ref:d,class:"pmode-chip pmode-chip-neutral",title:u("model.switchHint"),onClick:w=>{w.stopPropagation(),o(k=>!k)},onMouseDown:b,disabled:!t,children:s("span",{children:R})}),n&&f&&s("div",{class:"pmode-menu",onClick:b,onMouseDown:b,style:{position:"fixed",left:f.left,bottom:f.bottom,top:"auto",right:"auto",width:f.width,maxWidth:"none",minWidth:0},children:[s("div",{class:"pmode-menu-head",children:u("model.menuTitle")}),vs.map(w=>{const k=(e??"")===w.aliasFor;return s("button",{class:"pmode-menu-item "+(k?"is-current":""),onClick:I=>{I.stopPropagation(),g(w.aliasFor)},onMouseDown:b,disabled:i!==null,title:w.label,children:[s("div",{class:"pmode-menu-text",children:[s("div",{class:"pmode-menu-label",children:w.label}),s("div",{class:"pmode-menu-desc",children:w.aliasFor===""?u("model.defaultDesc"):u("model.aliasDesc",{id:w.aliasFor})})]}),k&&s("span",{class:"pmode-check",children:"✓"})]},w.key)}),s("div",{style:{padding:"8px 10px",borderTop:"1px solid var(--border)",display:"flex",gap:6},children:[s("input",{type:"text",placeholder:u("model.customPlaceholder"),value:l,onInput:w=>p(w.currentTarget.value),onKeyDown:w=>{w.key==="Enter"&&l.trim()&&(w.preventDefault(),g(l.trim()))},style:{flex:1,minWidth:0,fontSize:12,fontFamily:"ui-monospace, monospace"}}),s("button",{class:"btn-primary",style:{height:28,padding:"0 10px",fontSize:11},disabled:!l.trim()||i!==null,onClick:w=>{w.stopPropagation(),l.trim()&&g(l.trim())},children:u("model.applyCustom")})]}),c&&s("div",{class:"pmode-err",children:c})]})]})}function ko({sessionUuid:t}){function e(n){n.stopPropagation(),window.dispatchEvent(new CustomEvent("miki-moni:wrap-request",{detail:{sessionUuid:t}}))}return s("button",{class:"cell-wrap-btn cell-wrap-btn-icon",onClick:e,onMouseDown:n=>n.stopPropagation(),title:u("session.openCliTooltip"),"aria-label":u("session.openCli"),children:"🔌"})}function _o({sessionByUuid:t}){const[e,n]=v(null),[o,i]=v(!1),[r,c]=v(!1),[a,l]=v(null);j(()=>{function d(f){var w;const g=(w=f.detail)==null?void 0:w.sessionUuid;if(!g)return;const R=t.get(g),b=(R==null?void 0:R.project_name)??g.slice(0,8);n({sessionUuid:g,project:b}),i(!1),l(null)}return window.addEventListener("miki-moni:wrap-request",d),()=>window.removeEventListener("miki-moni:wrap-request",d)},[t]);function p(){n(null),i(!1),l(null)}async function h(){if(!(!e||!o||r)){c(!0),l(null);try{const d=await de("/wrap/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:e.sessionUuid})});if(d.ok)p();else{const f=await d.json().catch(()=>({}));l((f==null?void 0:f.error)??`HTTP ${d.status}`)}}catch(d){l(String(d))}finally{c(!1)}}}return j(()=>{if(!e)return;function d(f){f.key==="Escape"&&!r&&p()}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,r]),e?s("div",{role:"alertdialog","aria-modal":"false",style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:70,maxWidth:540,minWidth:360,padding:"12px 14px",background:"var(--bg)",border:"1px solid var(--warn)",borderLeft:"3px solid var(--warn)",borderRadius:6,boxShadow:"0 6px 24px rgba(0,0,0,0.22)",fontSize:12,lineHeight:1.5,color:"var(--fg)",animation:"miki-toast-in 0.18s ease-out"},children:s("div",{style:{display:"flex",alignItems:"flex-start",gap:10},children:[s("span",{style:{fontSize:16,lineHeight:1,marginTop:1},children:"⚠️"}),s("div",{style:{flex:1,minWidth:0},children:[s("div",{style:{fontWeight:600,marginBottom:4},children:u("wrapNotice.title")}),s("div",{style:{color:"var(--fg-muted)",marginBottom:10},children:u("wrapNotice.body",{project:e.project})}),s("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:r?"not-allowed":"pointer",marginBottom:10},children:[s("input",{type:"checkbox",checked:o,disabled:r,onInput:d=>i(d.target.checked),style:{margin:0}}),s("span",{children:u("wrapNotice.confirmCheck")})]}),a&&s("div",{style:{fontSize:11,color:"var(--accent)",marginBottom:8},children:a}),s("div",{style:{display:"flex",gap:8},children:[s("button",{class:"btn-primary",style:{height:28,padding:"0 12px",fontSize:12},disabled:!o||r,onClick:()=>void h(),children:u(r?"session.openCliPending":"wrapNotice.confirm")}),s("button",{class:"btn-ghost",style:{height:28,padding:"0 10px",fontSize:12},disabled:r,onClick:p,children:u("wrapNotice.later")})]})]})]})}):null}function bo({sessions:t}){const[e,n]=v([]);j(()=>{function i(r){var l;const a=(l=r.detail)==null?void 0:l.cwd;a&&n(p=>[...p.filter(d=>d.cwd.toLowerCase()!==a.toLowerCase()),{cwd:a,startedAt:Date.now(),timedOut:!1}])}return window.addEventListener("miki-moni:spawn-pending",i),()=>window.removeEventListener("miki-moni:spawn-pending",i)},[]),j(()=>{if(e.length===0)return;const i=window.setInterval(()=>{const r=Date.now();n(c=>c.map(a=>a.timedOut?a:r-a.startedAt>3e4?{...a,timedOut:!0}:a))},1e3);return()=>window.clearInterval(i)},[e.length]),j(()=>{e.length!==0&&n(i=>i.filter(r=>!t.find(a=>a.cwd.toLowerCase()===r.cwd.toLowerCase()&&a.last_event_at>=r.startedAt)))},[t,e.length]);function o(i){n(r=>r.filter(c=>c.cwd!==i))}return e.length===0?null:s("div",{style:{position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:65,display:"flex",flexDirection:"column",gap:8,maxWidth:"min(520px, calc(100vw - 24px))",width:"100%"},children:e.map(i=>s("div",{role:"status",style:{padding:"10px 14px",background:"var(--bg)",border:"1px solid var(--border)",borderLeft:`3px solid var(${i.timedOut?"--accent":"--pass"})`,borderRadius:6,boxShadow:"0 6px 24px rgba(0,0,0,0.18)",fontSize:12,lineHeight:1.5,color:"var(--fg)",display:"flex",alignItems:"flex-start",gap:10},children:[i.timedOut?s("span",{style:{fontSize:14,marginTop:1},children:"⚠️"}):s("span",{class:"spawn-pending-spinner","aria-hidden":"true",children:"⟳"}),s("div",{style:{flex:1,minWidth:0},children:[s("div",{style:{fontWeight:600,marginBottom:2},children:u("spawnPending.title")}),s("div",{style:{color:"var(--fg-muted)",overflowWrap:"anywhere"},children:i.timedOut?u("spawnPending.timeout"):u("spawnPending.body",{cwd:i.cwd})})]}),s("button",{class:"btn-ghost",style:{fontSize:11,padding:"2px 8px",flexShrink:0},onClick:()=>o(i.cwd),children:u("spawnPending.dismiss")})]},i.cwd))})}function vo({recentCwds:t}){const[e,n]=v(!1),[o,i]=v(""),[r,c]=v(!1),[a,l]=v(null),[p,h]=v(!1),d=ee(null),f=ee(null),y=ee(null),[g,R]=v(0),[b,w]=v(8);j(()=>{if(!e)return;function x(C){var A;(A=d.current)!=null&&A.contains(C.target)||n(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[e]),j(()=>{e&&(l(null),h(!1),queueMicrotask(()=>{var x;return(x=y.current)==null?void 0:x.focus()}))},[e]),j(()=>{if(!e)return;function x(){var A;const C=(A=f.current)==null?void 0:A.getBoundingClientRect();C&&(R(C.bottom+6),w(Math.max(8,window.innerWidth-C.right)))}return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[e]);async function k(){const x=o.trim();if(!(!x||r)){c(!0),l(null),h(!1);try{const C=await de("/wrap/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({cwd:x})});if(C.ok)h(!0),window.dispatchEvent(new CustomEvent("miki-moni:spawn-pending",{detail:{cwd:x}})),window.setTimeout(()=>{n(!1),i("")},800);else{const A=await C.json().catch(()=>({}));l((A==null?void 0:A.error)??`HTTP ${C.status}`)}}catch(C){l(String(C))}finally{c(!1)}}}function I(x){x.key==="Enter"&&!x.shiftKey?(x.preventDefault(),k()):x.key==="Escape"&&n(!1)}return s("div",{ref:d,style:{position:"relative",display:"inline-flex"},children:[s("button",{ref:f,class:"btn-ghost",style:{padding:"4px 6px",display:"inline-flex",alignItems:"center"},onClick:()=>n(x=>!x),title:u("header.newCliTitle"),"aria-label":u("header.newCli"),children:s(no,{size:15})}),e&&s("div",{style:{position:"fixed",top:g,right:b,zIndex:50,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:"12px 14px",width:"min(360px, calc(100vw - 16px))",maxWidth:"calc(100vw - 16px)",boxSizing:"border-box",boxShadow:"0 6px 24px rgba(0,0,0,0.18)"},children:[s("div",{style:{fontSize:12,fontWeight:600,marginBottom:8},children:u("newCli.heading")}),s("label",{style:{fontSize:11,color:"var(--fg-muted)",display:"block",marginBottom:4},children:u("newCli.cwdLabel")}),s("input",{ref:y,type:"text",list:"newcli-cwd-suggestions",value:o,onInput:x=>i(x.target.value),onKeyDown:I,placeholder:u("newCli.cwdPlaceholder"),spellcheck:!1,autoComplete:"off",style:{width:"100%",fontFamily:"ui-monospace, Consolas, monospace",fontSize:12}}),t.length>0&&s("datalist",{id:"newcli-cwd-suggestions",children:t.map(x=>s("option",{value:x},x))}),t.length>0&&s("select",{value:"",onChange:x=>{const C=x.currentTarget.value;C&&(i(C),x.currentTarget.value="",queueMicrotask(()=>{var A;return(A=y.current)==null?void 0:A.focus()}))},"aria-label":u("newCli.recentCwds"),style:{width:"100%",marginTop:6,fontFamily:"ui-monospace, Consolas, monospace",fontSize:12},children:[s("option",{value:"",children:[u("newCli.recentCwds"),"…"]}),t.map(x=>s("option",{value:x,children:x},x))]}),s("div",{style:{fontSize:10,color:"var(--fg-subtle)",marginTop:6,lineHeight:1.45},children:u("newCli.hint")}),s("div",{style:{display:"flex",gap:6,marginTop:10,alignItems:"center"},children:[s("button",{class:"btn-primary",style:{height:28,padding:"0 10px",fontSize:11},disabled:r||!o.trim(),onClick:()=>void k(),children:u(r?"newCli.submitting":"newCli.submit")}),a&&s("span",{style:{fontSize:10,color:"var(--accent)"},children:u("newCli.error",{err:a})}),p&&s("span",{style:{fontSize:10,color:"var(--pass)"},children:["✓ ",u("newCli.success")]})]})]})]})}function xo({s:t,preview:e,activity:n,streamingText:o,userOverlayText:i,pendingAsk:r,askDismissed:c,onReopenAsk:a,clientType:l,onSetClientType:p,onQuickSend:h,onOpenModal:d}){const f=(e==null?void 0:e.ai_title)??t.project_name,y=i&&i.length>0?i:e==null?void 0:e.last_user_text,g=o&&o.length>0?o:e==null?void 0:e.last_assistant_text,R=(e==null?void 0:e.last_tool_use)??null,b=Oe(()=>y?On(y):"",[y]),w=Oe(()=>g?On(g):"",[g]),k=!!o&&o.length>0,I=go(t.cwd),[x,C]=v(!1),A=ee(t.status),F=ee(void 0),S=ee(void 0);j(()=>{const W=A.current;A.current=t.status;function M(){F.current&&(window.clearTimeout(F.current),F.current=void 0),S.current&&(window.clearTimeout(S.current),S.current=void 0)}if(W==="waiting"&&t.status!=="waiting"){M(),C(!1);return}W!=="waiting"&&t.status==="waiting"&&(M(),F.current=window.setTimeout(()=>{F.current=void 0,C(!0),S.current=window.setTimeout(()=>{S.current=void 0,C(!1)},1e4)},1e4))},[t.status]),j(()=>()=>{F.current&&window.clearTimeout(F.current),S.current&&window.clearTimeout(S.current)},[]);const[B,q]=v(!1);j(()=>{if(t.status!=="waiting"){q(!1);return}if((e!=null&&e.last_user_ts?Date.parse(e.last_user_ts):0)>t.last_event_at){q(!1);return}const M=Date.now()-t.last_event_at;if(M>=6e4){q(!0);return}q(!1);const H=window.setTimeout(()=>q(!0),6e4-M);return()=>window.clearTimeout(H)},[t.status,t.last_event_at,e==null?void 0:e.last_user_ts]);const[ne,re]=v(!1),E=ee(null),te=ee(void 0),ge=`${(e==null?void 0:e.last_user_ts)??""}|${(e==null?void 0:e.last_assistant_ts)??""}|${(e==null?void 0:e.last_tool_use_ts)??""}`;j(()=>{const W=E.current;E.current=ge,W!==null&&W!==ge&&(te.current&&window.clearTimeout(te.current),re(!0),te.current=window.setTimeout(()=>{re(!1),te.current=void 0},1200))},[ge]),j(()=>()=>{te.current&&window.clearTimeout(te.current)},[]);const le=140,ce=260;return s("div",{class:"cell cell-clickable"+(x?" cell-flash":"")+(ne?" cell-flash-update":"")+(r&&c?" cell-ask-pending":""),style:{borderTop:`3px solid ${qi[t.status]}`},onClick:()=>d(t),children:[s("div",{class:"cell-head",children:[s("span",{class:"cell-title",title:f,children:f}),r&&c&&s("button",{class:"cell-ask-bell",onClick:W=>{W.stopPropagation(),t.session_uuid&&a&&a(t.session_uuid)},title:u("session.waitingTooltip"),children:u("session.waitingBadge")}),n&&s("span",{class:"cell-activity",title:u("focus.wrapperRunning",{activity:n}),children:[s("span",{class:"cell-activity-dot"})," ",n,"…"]}),!t.wrapped&&t.session_uuid&&s(ko,{sessionUuid:t.session_uuid}),s(fo,{sessionUuid:t.session_uuid??"",compact:!0})]}),s("div",{class:"cell-cwd",style:{color:I.label,display:"flex",alignItems:"center",gap:6},title:t.cwd,children:[s("strong",{style:{fontWeight:600},children:t.project_name}),t.wrapped?s("span",{class:"client-badge client-badge-wrap",title:u("session.wrappedDetailed"),children:u("focus.wrappedBadge")}):s(on,{type:l,onToggle:()=>p(t.session_uuid??"",l==="cli"?"vscode":"cli")}),R&&s("span",{class:"cell-tool-inline",title:R.description||R.name,children:[s("span",{class:"cell-tool-icon",children:"🔧"}),s("strong",{children:R.name}),R.description&&s("span",{class:"cell-tool-desc",children:[" · ",R.description]}),(e==null?void 0:e.last_tool_use_ts)&&s("span",{class:"cell-tool-ts",title:e.last_tool_use_ts,children:[" · ",It(e.last_tool_use_ts)]})]})]}),s("div",{class:"cell-preview cell-convo",children:!b&&!w?s("span",{class:"cell-empty",children:u("session.empty")}):s(Ce,{children:[w&&s("div",{class:"cell-turn cell-turn-assistant",children:[s("div",{class:"cell-turn-role",children:[s("span",{children:"claude"}),k?s("span",{class:"cell-turn-ts",style:{color:"var(--pass)"},children:"streaming…"}):(e==null?void 0:e.last_assistant_ts)&&s("span",{class:"cell-turn-ts",title:e.last_assistant_ts,children:It(e.last_assistant_ts)})]}),s("div",{class:"cell-turn-body",children:[w.slice(0,ce),w.length>ce?"…":"",k&&s("span",{class:"streaming-cursor",children:"▌"})]})]}),b&&s("div",{class:"cell-turn cell-turn-user",children:[s("div",{class:"cell-turn-role",children:[s("span",{children:"user"}),(e==null?void 0:e.last_user_ts)&&s("span",{class:"cell-turn-ts",title:e.last_user_ts,children:It(e.last_user_ts)})]}),s("div",{class:"cell-turn-body",children:[b.slice(0,le),b.length>le?"…":""]})]})]})}),s("div",{class:"cell-foot cell-foot-"+t.status,children:[s("span",{class:"cell-status",children:pt(t.status)}),s("span",{children:"·"}),s("span",{children:Ze(t.last_event_at)}),t.wrapped&&s(Ht,{sessionUuid:t.session_uuid,mode:t.permission_mode??"default"}),s("button",{class:"cell-send-btn icon-btn",style:t.wrapped?mo[t.permission_mode??"default"]:void 0,onClick:W=>{W.stopPropagation(),h(t,W.clientX,W.clientY)},title:u("session.quickSend"),children:s(gs,{size:12})})]})]})}function So({sessions:t,sortMode:e,previews:n,activities:o,streaming:i,userOverlay:r,pendingAsks:c,dismissedAsks:a,onReopenAsk:l,getClientType:p,onSetClientType:h,onQuickSend:d,onOpenModal:f}){const y=Oe(()=>t.slice().sort(No(e)),[t,e]);return s("div",{class:"cwd-group-grid",children:y.map(g=>{var R;return s(xo,{s:g,preview:g.session_uuid?n[g.session_uuid]:void 0,activity:g.session_uuid?o[g.session_uuid]:void 0,streamingText:g.session_uuid?i[g.session_uuid]:void 0,userOverlayText:g.session_uuid?(R=r[g.session_uuid])==null?void 0:R.text:void 0,pendingAsk:g.session_uuid?c[g.session_uuid]:void 0,askDismissed:g.session_uuid?a.has(g.session_uuid):!1,onReopenAsk:l,clientType:p(g.session_uuid),onSetClientType:h,onQuickSend:d,onOpenModal:f},g.session_uuid??g.cwd)})})}function Co({s:t,x:e,y:n,clientType:o,onSetClientType:i,onClose:r,onSend:c,sendKey:a}){var le,ce;const l=o==="cli",p=!!t.wrapped,h=!p,[d,f]=v(""),[y,g]=v([]),[R,b]=v(!1),[w,k]=v(!1),[I,x]=v(!1),[C,A]=v(null),F=ee(null),S=p,B=360,q=280,ne=typeof window<"u"&&window.innerWidth<560,re=ne?Math.max(8,(window.innerWidth-B)/2):Math.min(e+12,window.innerWidth-B-16),E=ne?Math.max(16,(window.innerHeight-q)/2):Math.min(n+12,window.innerHeight-q-16);j(()=>{function W(M){M.key==="Escape"&&r()}return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[r]);async function te(){const W=!!d.trim(),M=y.length>0;if(!(!W&&!M||!t.session_uuid)){x(!0),A(null);try{const H=S?y:void 0,J=await c(t.session_uuid,d.trim(),R,H);if(J.ok){f(""),g([]),r();return}const be=u("send.httpFail",{status:J.status});A({ok:J.ok,label:be,reply:J.reply})}finally{x(!1)}}}async function ge(W){const M=await ks(W);M.length>0&&(W.preventDefault(),g(H=>[...H,...M]))}return s(Ce,{children:[s("div",{class:"popover-backdrop",onClick:r}),s("div",{ref:F,class:"popover",style:{left:re,top:E},onClick:W=>W.stopPropagation(),children:[s("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[s("span",{class:dt[t.status]}),s("strong",{style:{fontSize:13},children:t.project_name}),t.wrapped?s("span",{class:"client-badge client-badge-wrap",title:u("focus.wrappedTitle"),children:u("focus.wrappedBadge")}):s(on,{type:o,onToggle:()=>i(t.session_uuid??"",l?"vscode":"cli")}),s("button",{class:"btn-ghost",style:{marginLeft:"auto",padding:"2px 8px"},onClick:r,title:u("session.closeKey"),children:"×"})]}),s("div",{style:{fontSize:10,color:"var(--fg-subtle)",fontFamily:"ui-monospace, monospace",marginBottom:8,wordBreak:"break-all"},children:[t.cwd,s("br",{}),t.session_uuid]}),s(bs,{images:y,onRemove:W=>g(M=>M.filter((H,J)=>J!==W)),dimmed:!S&&y.length>0}),!S&&y.length>0&&s("div",{style:{fontSize:10,color:"var(--warn)",marginBottom:4},children:u("composer.imageIgnored")}),s("textarea",{autoFocus:!0,placeholder:h?l?u("composer.cliNotWrapped",{short:((le=t.session_uuid)==null?void 0:le.slice(0,8))??""}):u("composer.vscodeDisabledWrap2",{short:((ce=t.session_uuid)==null?void 0:ce.slice(0,8))??""}):u("composer.inputPrompt"),value:d,onInput:W=>f(W.currentTarget.value),onPaste:W=>{ge(W)},onKeyDown:W=>{Rs(W,a)&&(W.preventDefault(),!I&&!h&&d.trim()&&te())},disabled:I||h,style:{width:"100%",minHeight:80,fontSize:13,fontFamily:"inherit",marginBottom:8}}),s("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s("label",{class:"btn-ghost",style:{height:32,padding:"0 10px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:S&&!I?"pointer":"not-allowed",opacity:S&&!I?1:.5},title:u("composer.uploadImage"),"aria-label":u("composer.uploadImage"),children:[s(ms,{size:14}),s("input",{type:"file",accept:"image/*",multiple:!0,style:{display:"none"},disabled:!S||I,onChange:async W=>{const M=W.currentTarget,H=await _s(M.files);H.length>0&&g(J=>[...J,...H]),M.value=""}})]}),p&&s("button",{class:"btn-ghost",style:{marginLeft:"auto",height:32,padding:"0 10px",fontSize:14,lineHeight:1},onClick:()=>{t.session_uuid&&de("/wrap/interrupt",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:t.session_uuid})})},title:u("composer.interruptShort"),children:s(fs,{size:14})}),s("button",{class:p?"btn-primary":"btn-ghost",disabled:!d.trim()||I||h,onClick:te,style:p?void 0:{marginLeft:"auto"},title:u(h?"composer.needWrapHint2":"composer.wrapWSShort"),children:u(I?"composer.sendBusy":p?"composer.sendWrapped":"composer.sendNeedWrap")})]}),s("div",{style:{marginTop:4,fontSize:10,color:"var(--fg-subtle)"},children:[u(a==="enter"?"composer.keyEnter":"composer.keyCtrlEnter"),u("composer.escClose")]}),C&&s("div",{style:{marginTop:8,padding:8,background:"var(--sl2)",border:"1px solid var(--border)",borderRadius:6},children:[s("div",{style:{fontSize:12,color:C.ok?"var(--pass)":"var(--accent)",marginBottom:C.reply?6:0},children:C.label}),C.reply&&s("div",{style:{maxHeight:160,overflowY:"auto"},children:s(ys,{text:C.reply})})]})]})]})}function To({s:t,onClose:e,clientType:n,onSetClientType:o,onFocus:i,onSend:r,sendKey:c,pendingAsk:a,askDismissed:l,onReopenAsk:p,activity:h,transcript:d,transcriptLoading:f,transcriptError:y,transcriptLimit:g,onSetTranscriptLimit:R,onReloadTranscript:b,showTools:w,onSetShowTools:k,streamingText:I,streamingStartTs:x,userOverlayText:C,userOverlayTs:A}){j(()=>{function S(B){B.key==="Escape"&&e()}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e]),j(()=>{const S=document.body,B={position:S.style.position,top:S.style.top,left:S.style.left,right:S.style.right,width:S.style.width,overflow:S.style.overflow},q=window.scrollY||window.pageYOffset||0;return S.style.position="fixed",S.style.top=`-${q}px`,S.style.left="0",S.style.right="0",S.style.width="100%",S.style.overflow="hidden",()=>{S.style.position=B.position,S.style.top=B.top,S.style.left=B.left,S.style.right=B.right,S.style.width=B.width,S.style.overflow=B.overflow,window.scrollTo(0,q)}},[]);const F=ee(null);return j(()=>{const S=F.current;if(!S)return;let B=0,q=0,ne=!1,re=!1,E=!1;function te(){ne=!1,re=!1,E=!1,S.style.transition="transform 0.18s ease-out",S.style.transform=""}function ge(M){const H=M;return H?!!(H.closest("textarea, input, select")||H.closest(".pmode-menu")):!1}function le(M){if(M.touches.length!==1){ne=!1;return}const H=M.touches[0];if(!S.contains(H.target)){ne=!1;return}B=H.clientX,q=H.clientY,ne=!0,re=!1,E=ge(H.target),S.style.transition="none"}function ce(M){if(!ne||E)return;const H=M.touches[0];if(!H)return;const J=H.clientX-B,be=H.clientY-q;if(!re){if(Math.abs(J)<8&&Math.abs(be)<8)return;if(Math.abs(be)>Math.abs(J)){ne=!1;return}re=!0}J>0?(S.style.transform=`translateX(${J}px)`,M.cancelable&&M.preventDefault()):S.style.transform=""}function W(M){if(!ne){te();return}const H=M.changedTouches[0];if(!H){te();return}const J=H.clientX-B,be=H.clientY-q;re&&J>80&&Math.abs(J)>Math.abs(be)*1.2?(S.style.transition="transform 0.16s ease-out",S.style.transform="translateX(100%)",window.setTimeout(()=>{e()},160)):te()}return document.addEventListener("touchstart",le,{passive:!0}),document.addEventListener("touchmove",ce,{passive:!1}),document.addEventListener("touchend",W,{passive:!0}),document.addEventListener("touchcancel",te,{passive:!0}),()=>{document.removeEventListener("touchstart",le),document.removeEventListener("touchmove",ce),document.removeEventListener("touchend",W),document.removeEventListener("touchcancel",te)}},[e]),s("div",{class:"cell-modal-backdrop",onClick:e,children:s("div",{ref:F,class:"cell-modal",onClick:S=>S.stopPropagation(),children:[s("button",{class:"cell-modal-close",onClick:e,title:u("session.modalClose"),children:"×"}),a&&l&&s("div",{class:"cell-modal-ask-banner",children:[s("span",{children:u("session.claudeWaitingHere")}),s("button",{class:"btn-primary",style:{height:26,padding:"0 10px",fontSize:12},onClick:()=>{t.session_uuid&&p&&p(t.session_uuid)},children:u("session.showQuestion")})]}),s(uo,{s:t,defaultExpanded:!0,activity:h,clientType:n,onSetClientType:o,onFocus:i,onSend:r,sendKey:c,modalMode:!0,transcript:d,transcriptLoading:f,transcriptError:y,transcriptLimit:g,onSetTranscriptLimit:R,onReloadTranscript:b,showTools:w,onSetShowTools:k,streamingText:I,streamingStartTs:x,userOverlayText:C,userOverlayTs:A})]})})}const xs="miki-moni:client-types";function Lo(){try{const t=localStorage.getItem(xs);if(!t)return{};const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function Ro(t){try{localStorage.setItem(xs,JSON.stringify(t))}catch{}}const Ss="miki-moni:send-key";function Io(){try{return localStorage.getItem(Ss)==="enter"?"enter":"ctrl-enter"}catch{return"ctrl-enter"}}function Po(t){try{localStorage.setItem(Ss,t)}catch{}}const Cs="miki-moni:theme";function Eo(){try{const t=localStorage.getItem(Cs);return t==="dark"||t==="light"||t==="system"?t:"light"}catch{return"light"}}function $o(t){try{localStorage.setItem(Cs,t)}catch{}}function Ao(t){var e;return t==="system"?typeof window<"u"&&((e=window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light":t}function Nn(t){document.documentElement.setAttribute("data-theme",Ao(t))}const Ts="miki-moni:sort-mode";function zo(){try{const t=localStorage.getItem(Ts);return t==="cwd"?"uuid":t==="uuid"||t==="recent"||t==="priority"?t:"uuid"}catch{return"uuid"}}function Do(t){try{localStorage.setItem(Ts,t)}catch{}}const Ls="miki-moni:status-filter";function Wo(){try{const t=localStorage.getItem(Ls);if(t==="all"||t==="live"||t==="idle"||t==="stale")return t}catch{}return"live"}function Oo(t){try{localStorage.setItem(Ls,t)}catch{}}function Fn(t){switch(t){case"waiting":return 0;case"active":return 1;case"idle":return 2;case"stale":return 3;default:return 4}}function Bo(t,e){const n=Fn(t.status),o=Fn(e.status);return n!==o?n-o:t.cwd.localeCompare(e.cwd)}function Mo(t,e){const n=t.session_uuid,o=e.session_uuid;return n&&o?n.localeCompare(o):n?-1:o?1:t.cwd.localeCompare(e.cwd)}function Ho(t,e){return t.last_event_at!==e.last_event_at?e.last_event_at-t.last_event_at:t.cwd.localeCompare(e.cwd)}function No(t){switch(t){case"uuid":return Mo;case"recent":return Ho;case"priority":default:return Bo}}function Rs(t,e){if(t.key!=="Enter"||t.isComposing||t.keyCode===229)return!1;const n=t.metaKey||t.ctrlKey;return e==="enter"?!t.shiftKey:n}function Fo(){var cn,dn;const[t]=Oi(),[e,n]=v([]),[o,i]=v({}),[r,c]=v({}),[a,l]=v({}),[p,h]=v({}),[d,f]=v({}),[y,g]=v({}),[R,b]=v(new Set),[w,k]=v("connecting"),[I,x]=v([]),[C,A]=v(()=>Lo()),[F,S]=v(()=>Io()),[B,q]=v(()=>Eo()),[ne,re]=v(!1),[E,te]=v(null),[ge,le]=v(null),[ce,W]=v(!1),[M,H]=v(null),[J,be]=v(20),[Ee,ve]=v(!1),He=ee(null),Ne=ee(0),$e=ee(null),xe=ee(20),Ae=ee(!1);function pe(m,T){return T?m:Math.min(1e4,m*4)}const[Fe,et]=v(()=>Wo());function St(m){et(m),Oo(m)}const[Te,rn]=v(()=>zo());function $(m){S(m),Po(m)}function oe(m){q(m),$o(m)}function he(m){rn(m),Do(m)}j(()=>{var L;if(Nn(B),B!=="system")return;const m=window.matchMedia("(prefers-color-scheme: dark)"),T=()=>Nn("system");return(L=m.addEventListener)==null||L.call(m,"change",T),()=>{var D;return(D=m.removeEventListener)==null?void 0:D.call(m,"change",T)}},[B]);function V(m){te(m)}function we(){te(null),le(null),H(null),He.current=null}j(()=>{$e.current=(E==null?void 0:E.session_uuid)??null},[E]),j(()=>{xe.current=J},[J]),j(()=>{Ae.current=Ee},[Ee]),j(()=>{const m=E==null?void 0:E.session_uuid;m&&nt(m,pe(J,Ee))},[E==null?void 0:E.session_uuid,J,Ee]);function ze(m,T){m&&A(L=>{const D={...L,[m]:T};return Ro(D),D})}function De(m){if(!m)return"vscode";const T=e.find(L=>L.session_uuid===m);return T!=null&&T.wrapped?"cli":C[m]??"vscode"}const[Le,ln]=v(null);function Y(m,T,L){const D={ts:Date.now(),level:m,msg:T,ctx:L};x(K=>[D,...K].slice(0,ji)),m==="error"?Xi(T,L):m==="warn"&&zn(T,L)}async function tt(){try{const m=await de("/sessions/previews");if(!m.ok){Y("warn",`GET /sessions/previews ${m.status}`);return}const T=await m.json(),L={};for(const D of T)L[D.session_uuid]=D;i(L),f(D=>{let K=!1;const ke={};for(const[O,_]of Object.entries(D)){const Z=L[O],P=Z!=null&&Z.last_user_ts?Date.parse(Z.last_user_ts):0;if(P&&P>=_.ts){K=!0;continue}ke[O]=_}return K?ke:D}),h(D=>{const K=new Set,ke={};for(const[O,_]of Object.entries(D)){const Z=L[O];if((Z!=null&&Z.last_assistant_ts?Date.parse(Z.last_assistant_ts):0)>=_){K.add(O);continue}ke[O]=_}return K.size>0&&l(O=>{const _={...O};for(const Z of K)delete _[Z];return _}),K.size>0?ke:D}),Y("info","previews loaded",{count:T.length})}catch(m){Y("error","previews fetch throw",{error:String(m)})}}async function nt(m,T){if(m){W(!0),H(null);try{const L=await de(`/sessions/${encodeURIComponent(m)}/transcript?limit=${T}`);if(!L.ok){const K=await L.text().catch(()=>"");H(`HTTP ${L.status}: ${K.slice(0,200)}`);return}const D=await L.json();le(D),He.current={last_modified:D.last_modified,file_size:D.file_size},Y("info","transcript loaded",{session_uuid:m,turns:D.turn_count})}catch(L){H(String(L))}finally{W(!1)}}}async function Is(m,T){if(m&&!(Date.now()<Ne.current))try{const L=await de(`/sessions/${encodeURIComponent(m)}/transcript-meta`);if(L.status===404){Ne.current=Date.now()+5e3,zn("transcript-meta 404 — meta poll paused for 5s (restart daemon to re-enable)");return}if(!L.ok)return;const D=await L.json(),K=He.current;(!K||D.last_modified!==K.last_modified||D.file_size!==K.file_size)&&nt(m,T)}catch{}}j(()=>{Y("info",u("startup.starting")),de("/sessions").then(O=>O.json().then(_=>({ok:O.ok,status:O.status,body:_}))).then(O=>{if(!O.ok){Y("error",u("startup.getSessionsFailed"),{status:O.status});return}const _=O.body;n(_);const Z={},P={};for(const z of _)z.session_uuid&&z.activity&&(Z[z.session_uuid]=z.activity),z.session_uuid&&z.pending_ask&&(P[z.session_uuid]=z.pending_ask);Object.keys(Z).length>0&&c(Z),Object.keys(P).length>0&&g(P),Y("info",u("startup.gotSessions",{n:_.length})),tt()}).catch(O=>Y("error","GET /sessions throw",{error:String(O)})),Y("info",u("startup.wsConnecting"),{url:"/ws (via transport)"});let m=null,T=0,L=!1;function D(){if(L)return;const O=Ki("/ws");m=O,O.onopen=()=>{k("open"),T>0?(Y("info",`WS reconnected after ${T} attempt(s) — refetching state`),de("/sessions").then(_=>_.json()).then(_=>{n(_);const Z={},P={};for(const z of _)z.session_uuid&&z.activity&&(Z[z.session_uuid]=z.activity),z.session_uuid&&z.pending_ask&&(P[z.session_uuid]=z.pending_ask);c(Z),g(P)}).catch(()=>{}),tt()):Y("info","WS open"),T=0},O.onclose=_=>{if(k("closed"),Y("warn","WS close",{code:_.code}),L)return;T++;const Z=Math.min(500*Math.pow(2,Math.min(T-1,4)),5e3);k("connecting"),setTimeout(D,Z)},O.onerror=()=>{Y("error","WS error")},O.onmessage=K}function K(O){var Z;let _;try{_=JSON.parse(O.data)}catch{return}if(_.type==="session_changed"){const P=_.session;Y("info","WS session_changed",{project:P.project_name,status:P.status,uuid:(Z=P.session_uuid)==null?void 0:Z.slice(0,8)}),n(z=>{const Q=z.filter(fe=>fe.session_uuid!==P.session_uuid);return[P,...Q].sort((fe,ue)=>ue.last_event_at-fe.last_event_at)}),Ct()}else if(_.type==="session_removed"){const P=_.session_uuid;Y("info","WS session_removed",{uuid:P.slice(0,8)}),n(z=>z.filter(Q=>Q.session_uuid!==P)),c(z=>{const Q={...z};return delete Q[P],Q})}else if(_.type==="activity"){const P=_.session_uuid,z=typeof _.label=="string"?_.label:null;c(Q=>{if(!z){const fe={...Q};return delete fe[P],fe}return Q[P]===z?Q:{...Q,[P]:z}})}else if(_.type==="assistant_delta_start"){const P=_.session_uuid;Y("info","WS assistant_delta_start",{uuid:P.slice(0,8)}),l(z=>({...z,[P]:""})),h(z=>({...z,[P]:Date.now()}))}else if(_.type==="assistant_delta"){const P=_.session_uuid,z=typeof _.text=="string"?_.text:"";if(!z)return;l(Q=>({...Q,[P]:(Q[P]??"")+z}))}else if(_.type==="assistant_delta_end"){const P=_.session_uuid;Y("info","WS assistant_delta_end",{uuid:P.slice(0,8)}),Ct()}else if(_.type==="user_message"){const P=_.session_uuid,z=typeof _.text=="string"?_.text:"",Q=typeof _.ts=="number"?_.ts:Date.now();P&&z&&f(fe=>({...fe,[P]:{text:z,ts:Q}}))}else if(_.type==="ask_question"){const P=_.session_uuid,z={question_id:_.question_id,questions:_.questions};g(Q=>({...Q,[P]:z}))}else if(_.type==="ask_question_done"){const P=_.session_uuid;g(z=>{const Q={...z};return delete Q[P],Q}),b(z=>{const Q=new Set(z);return Q.delete(P),Q})}}D();const ke=window.setInterval(()=>{if(L)return;de("/sessions").then(_=>_.ok?_.json():null).then(_=>{if(!_||L)return;n(P=>{const z=new Map(_.map(ue=>[ue.session_uuid??ue.cwd,ue])),Q=new Set,fe=[];for(const ue of P){const Ue=ue.session_uuid??ue.cwd,pn=z.get(Ue);pn&&(fe.push(pn),Q.add(Ue))}for(const ue of _){const Ue=ue.session_uuid??ue.cwd;Q.has(Ue)||fe.push(ue)}return fe.sort((ue,Ue)=>Ue.last_event_at-ue.last_event_at)});const Z={};for(const P of _)P.session_uuid&&P.activity&&(Z[P.session_uuid]=P.activity);c(P=>({...P,...Z}))}).catch(()=>{}),tt();const O=$e.current;O&&Is(O,pe(xe.current,Ae.current))},2e3);return()=>{L=!0,m&&m.close(),window.clearInterval(ke)}},[]);const Ke=ee(void 0),Xe=ee(void 0),Ps=1500;function Ct(){function m(){Ke.current&&(clearTimeout(Ke.current),Ke.current=void 0),Xe.current&&(clearTimeout(Xe.current),Xe.current=void 0),tt();const T=$e.current;T&&nt(T,pe(xe.current,Ae.current))}Ke.current&&clearTimeout(Ke.current),Ke.current=window.setTimeout(m,300),Xe.current||(Xe.current=window.setTimeout(m,Ps))}async function Es(m){Y("info","POST /focus",{uuid:m.slice(0,8)});try{const T=await de("/focus",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:m})});let L=null;try{L=await T.json()}catch{}return Y(T.ok?"info":"error",`/focus ${T.status}`,{url:L==null?void 0:L.url}),{ok:T.ok,status:T.status,url:L==null?void 0:L.url}}catch(T){return Y("error","/focus throw",{error:String(T)}),{ok:!1,status:0}}}async function an(m,T,L,D){var ke;const K=D==null?void 0:D.map(({media_type:O,data:_})=>({media_type:O,data:_}));Y("info",`POST /send (mode=${L?"submit":"prefill"})`,{uuid:m.slice(0,8),len:T.length,images:(K==null?void 0:K.length)??0});try{const O=await de("/send",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session_uuid:m,prompt:T,submit:L,images:K})});let _=null;try{_=await O.json()}catch{}return Y(O.ok?"info":"error",`/send ${O.status}`,{mode:_==null?void 0:_.mode,reply_preview:(ke=_==null?void 0:_.reply)==null?void 0:ke.slice(0,60),duration_ms:_==null?void 0:_.duration_ms,diag:_==null?void 0:_.diag}),O.ok&&L&&Ct(),{ok:O.ok,status:O.status,url:_==null?void 0:_.url,reply:_==null?void 0:_.reply,duration_ms:_==null?void 0:_.duration_ms,diag:_==null?void 0:_.diag,error:_==null?void 0:_.error}}catch(O){return Y("error","/send throw",{error:String(O)}),{ok:!1,status:0}}}function $s(m,T,L){ln({s:m,x:T,y:L})}const Tt=Oe(()=>{const m=new Map;for(const T of e)T.session_uuid&&m.set(T.session_uuid,T);return m},[e]),As=Oe(()=>{const m=new Set,T=[];for(const L of e){const D=L.cwd;if(!(!D||m.has(D))&&(m.add(D),T.push(D),T.length>=30))break}return T},[e]);return s("div",{class:"app-shell",children:[s("header",{style:{display:"flex",alignItems:"center",gap:12,paddingBottom:12,borderBottom:"1px solid var(--border)",position:"relative"},children:[s("h1",{style:{margin:0,display:"inline-flex",alignItems:"center",color:"var(--fg)"},title:"miki-moni","aria-label":"miki-moni",children:s(Qi,{size:24})}),s(ho,{sessions:e,filter:Fe,onFilter:St}),s("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--fg-subtle)"},children:[s(vo,{recentCwds:As}),s("button",{class:"btn-ghost",style:{fontSize:11,padding:"2px 6px",display:"inline-flex",alignItems:"center"},onClick:()=>re(m=>!m),title:u("settings.title"),"aria-label":u("settings.title"),children:s(to,{size:14})})]}),ne&&s("div",{class:"settings-popover",style:{position:"absolute",top:"100%",right:0,marginTop:6,zIndex:50,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:"12px 14px",minWidth:280,boxShadow:"0 6px 24px rgba(0,0,0,0.18)",maxHeight:"calc(100vh - 100px)",overflowY:"auto",overscrollBehavior:"contain"},children:[s("div",{style:{fontSize:12,fontWeight:600,marginBottom:8},children:u("settings.sendKeySection")}),s("div",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:12},children:[s("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[s("input",{type:"radio",name:"miki-moni-send-key",checked:F==="enter",onChange:()=>$("enter")}),s("span",{children:[s("strong",{children:u("settings.enterLabel")}),u("settings.enterDesc")]})]}),s("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[s("input",{type:"radio",name:"miki-moni-send-key",checked:F==="ctrl-enter",onChange:()=>$("ctrl-enter")}),s("span",{children:[s("strong",{children:u("settings.ctrlEnterLabel")}),u("settings.ctrlEnterDesc")]})]})]}),s("div",{style:{fontSize:10,color:"var(--fg-subtle)",marginTop:8,lineHeight:1.5},children:u("settings.sendKeyHelp")}),s("div",{style:{fontSize:12,fontWeight:600,marginTop:14,marginBottom:8,paddingTop:12,borderTop:"1px solid var(--border)"},children:u("settings.appearance")}),s("div",{style:{display:"flex",gap:4,fontSize:11},children:["light","dark","system"].map(m=>s("button",{class:"btn-outline",style:{flex:1,height:28,padding:"0 8px",fontSize:11,borderColor:B===m?"var(--fg)":"var(--border)",background:B===m?"var(--sl3)":"var(--bg)",fontWeight:B===m?600:400},onClick:()=>oe(m),title:u(m==="system"?"settings.themeSystemTitle":m==="dark"?"settings.themeDarkTitle":"settings.themeLightTitle"),children:u(m==="light"?"settings.themeLight":m==="dark"?"settings.themeDark":"settings.themeSystem")},m))}),s("div",{style:{fontSize:12,fontWeight:600,marginTop:14,marginBottom:8,paddingTop:12,borderTop:"1px solid var(--border)"},children:u("settings.sortMode")}),s("div",{style:{display:"flex",gap:4,fontSize:11},children:[{v:"priority",labelKey:"settings.sortPriorityLabel",titleKey:"settings.sortPriorityTitle"},{v:"uuid",labelKey:"settings.sortUuidLabel",titleKey:"settings.sortUuidTitle"},{v:"recent",labelKey:"settings.sortRecentLabel",titleKey:"settings.sortRecentTitle"}].map(m=>s("button",{class:"btn-outline",style:{flex:1,height:28,padding:"0 6px",fontSize:11,borderColor:Te===m.v?"var(--fg)":"var(--border)",background:Te===m.v?"var(--sl3)":"var(--bg)",fontWeight:Te===m.v?600:400},onClick:()=>he(m.v),title:u(m.titleKey),children:u(m.labelKey)},m.v))}),s("div",{style:{fontSize:10,color:"var(--fg-subtle)",marginTop:6,lineHeight:1.5},children:u("settings.sortHelp")}),s("div",{style:{fontSize:12,fontWeight:600,marginTop:14,marginBottom:8,paddingTop:12,borderTop:"1px solid var(--border)"},children:u("settings.language")}),s("div",{style:{display:"flex",gap:4,fontSize:11},children:Di.map(m=>{const T=t===m;return s("button",{class:"btn-outline",style:{flex:1,height:28,padding:"0 6px",fontSize:11,borderColor:T?"var(--fg)":"var(--border)",background:T?"var(--sl3)":"var(--bg)",fontWeight:T?600:400},onClick:()=>hs(m),title:En[m],children:En[m]},m)})}),s("div",{style:{marginTop:10,textAlign:"right"},children:s("button",{class:"btn-ghost",style:{fontSize:11,padding:"2px 8px"},onClick:()=>re(!1),children:u("settings.close")})})]})]}),s("div",{style:{marginTop:12,marginBottom:20}}),e.length===0?s("div",{class:"card",style:{padding:"24px 14px",textAlign:"center",color:"var(--fg-subtle)",fontSize:13},children:[s("div",{children:u("overview.noSessions")}),s("div",{style:{fontSize:11,marginTop:6},children:u("overview.openPanelHint")}),s("div",{style:{fontSize:11},children:[u("overview.runHooks"),s("code",{children:"pnpm install:hooks"})]})]}):s(So,{sessions:e.filter(m=>Fe==="all"?!0:Fe==="live"?m.status==="active"||m.status==="waiting":m.status===Fe),sortMode:Te,previews:o,activities:r,streaming:a,userOverlay:d,pendingAsks:y,dismissedAsks:R,onReopenAsk:m=>b(T=>{const L=new Set(T);return L.delete(m),L}),getClientType:De,onSetClientType:ze,onQuickSend:$s,onOpenModal:V}),!1,s(_o,{sessionByUuid:Tt}),s(bo,{sessions:e}),Le&&s(Co,{s:Le.s,x:Le.x,y:Le.y,clientType:De(Le.s.session_uuid),onSetClientType:ze,onClose:()=>ln(null),onSend:an,sendKey:F}),E&&s(To,{s:Tt.get(E.session_uuid??"")??E,onClose:we,clientType:De(E.session_uuid),onSetClientType:ze,onFocus:Es,onSend:an,sendKey:F,pendingAsk:E.session_uuid?y[E.session_uuid]:void 0,askDismissed:E.session_uuid?R.has(E.session_uuid):!1,onReopenAsk:m=>b(T=>{const L=new Set(T);return L.delete(m),L}),activity:E.session_uuid?r[E.session_uuid]:void 0,transcript:ge,transcriptLoading:ce,transcriptError:M,transcriptLimit:J,onSetTranscriptLimit:be,onReloadTranscript:()=>{E.session_uuid&&nt(E.session_uuid,pe(J,Ee))},showTools:Ee,onSetShowTools:ve,streamingText:E.session_uuid?a[E.session_uuid]:void 0,streamingStartTs:E.session_uuid?p[E.session_uuid]:void 0,userOverlayText:E.session_uuid?(cn=d[E.session_uuid])==null?void 0:cn.text:void 0,userOverlayTs:E.session_uuid?(dn=d[E.session_uuid])==null?void 0:dn.ts:void 0}),(()=>{const m=Object.keys(y).find(D=>!R.has(D));if(!m)return null;const T=y[m],L=Tt.get(m);return s(ro,{sessionUuid:m,ask:T,onSubmitted:()=>{g(D=>{const K={...D};return delete K[m],K}),b(D=>{const K=new Set(D);return K.delete(m),K}),Y("info","ask answered",{uuid:m.slice(0,8),project:L==null?void 0:L.project_name})},onDismiss:()=>{b(D=>{const K=new Set(D);return K.add(m),K})}})})()]})}function Ko(){Ks(s(Fo,{}),document.getElementById("app"))}try{tn()}catch{Fi(new Ui)}Ko();
@@ -0,0 +1,20 @@
1
+ <!doctype html>
2
+ <html lang="zh-Hant-TW">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
6
+ <title>miki-moni</title>
7
+ <link rel="icon" type="image/svg+xml" href="/assets/favicon-DFpLtP36.svg" />
8
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
+ <link
11
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Noto+Sans+TC:wght@400;500;600&display=swap"
12
+ rel="stylesheet"
13
+ />
14
+ <script type="module" crossorigin src="/assets/index-CyPlxvOn.js"></script>
15
+ <link rel="stylesheet" crossorigin href="/assets/index--89DkyV1.css">
16
+ </head>
17
+ <body>
18
+ <div id="app"></div>
19
+ </body>
20
+ </html>