claudekit-cli 4.3.1-dev.16 → 4.3.1-dev.17
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.
|
@@ -18,7 +18,7 @@ var hj=Object.defineProperty;var fj=(t,e,n)=>e in t?hj(t,e,{enumerable:!0,config
|
|
|
18
18
|
*/var iv=t=>{throw TypeError(t)},kj=(t,e,n)=>e.has(t)||iv("Cannot "+n),ku=(t,e,n)=>(kj(t,e,"read from private field"),n?n.call(t):e.get(t)),Sj=(t,e,n)=>e.has(t)?iv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Jm="popstate";function Cj(t={}){function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return Ro("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:ir(s)}return Nj(e,n,null,t)}function Pe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function qe(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function jj(){return Math.random().toString(36).substring(2,10)}function Zm(t,e){return{usr:t.state,key:t.key,idx:e}}function Ro(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ns(e):e,state:n,key:e&&e.key||r||jj()}}function ir({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ns(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function Nj(t,e,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a="POP",l=null,d=u();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function u(){return(o.state||{idx:null}).idx}function h(){a="POP";let b=u(),y=b==null?null:b-d;d=b,l&&l({action:a,location:x.location,delta:y})}function f(b,y){a="PUSH";let w=Ro(x.location,b,y);d=u()+1;let v=Zm(w,d),k=x.createHref(w);try{o.pushState(v,"",k)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(k)}i&&l&&l({action:a,location:x.location,delta:1})}function p(b,y){a="REPLACE";let w=Ro(x.location,b,y);d=u();let v=Zm(w,d),k=x.createHref(w);o.replaceState(v,"",k),i&&l&&l({action:a,location:x.location,delta:0})}function m(b){return ov(b)}let x={get action(){return a},get location(){return t(s,o)},listen(b){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Jm,h),l=b,()=>{s.removeEventListener(Jm,h),l=null}},createHref(b){return e(s,b)},createURL:m,encodeLocation(b){let y=m(b);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(b){return o.go(b)}};return x}function ov(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:ir(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var fo,eg=class{constructor(t){if(Sj(this,fo,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(ku(this,fo).has(t))return ku(this,fo).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){ku(this,fo).set(t,e)}};fo=new WeakMap;var Pj=new Set(["lazy","caseSensitive","path","id","index","children"]);function Dj(t){return Pj.has(t)}var Ej=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Oj(t){return Ej.has(t)}function Mj(t){return t.index===!0}function Io(t,e,n=[],r={},s=!1){return t.map((i,o)=>{let a=[...n,String(o)],l=typeof i.id=="string"?i.id:a.join("-");if(Pe(i.index!==!0||!i.children,"Cannot specify children on an index route"),Pe(s||!r[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),Mj(i)){let d={...i,id:l};return r[l]=tg(d,e(d)),d}else{let d={...i,id:l,children:void 0};return r[l]=tg(d,e(d)),i.children&&(d.children=Io(i.children,e,a,r,s)),d}})}function tg(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function Br(t,e,n="/"){return po(t,e,n,!1)}function po(t,e,n,r){let s=typeof e=="string"?ns(e):e,i=Cn(s.pathname||"/",n);if(i==null)return null;let o=av(t);Tj(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let d=Wj(i);a=Hj(o[l],d,r)}return a}function Aj(t,e){let{route:n,pathname:r,params:s}=t;return{id:n.id,pathname:r,params:s,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function av(t,e=[],n=[],r="",s=!1){let i=(o,a,l=s,d)=>{let u={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(r)&&l)return;Pe(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length)}let h=nr([r,u.relativePath]),f=n.concat(u);o.children&&o.children.length>0&&(Pe(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),av(o.children,e,f,h,l)),!(o.path==null&&!o.index)&&e.push({path:h,score:Fj(h,o.index),routesMeta:f})};return t.forEach((o,a)=>{if(o.path===""||!o.path?.includes("?"))i(o,a);else for(let l of lv(o.path))i(o,a,!0,l)}),e}function lv(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=lv(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function Tj(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:zj(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Lj=/^:[\w-]+$/,Rj=3,Ij=2,$j=1,Bj=10,_j=-2,ng=t=>t==="*";function Fj(t,e){let n=t.split("/"),r=n.length;return n.some(ng)&&(r+=_j),e&&(r+=Ij),n.filter(s=>!ng(s)).reduce((s,i)=>s+(Lj.test(i)?Rj:i===""?$j:Bj),r)}function zj(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function Hj(t,e,n=!1){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],d=a===r.length-1,u=i==="/"?e:e.slice(i.length)||"/",h=_c({path:l.relativePath,caseSensitive:l.caseSensitive,end:d},u),f=l.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=_c({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!h)return null;Object.assign(s,h.params),o.push({params:s,pathname:nr([i,h.pathname]),pathnameBase:Gj(nr([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=nr([i,h.pathnameBase]))}return o}function _c(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=Vj(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((d,{paramName:u,isOptional:h},f)=>{if(u==="*"){let m=a[f]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const p=a[f];return h&&!p?d[u]=void 0:d[u]=(p||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:t}}function Vj(t,e=!1,n=!0){qe(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function Wj(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return qe(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Cn(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function Kj({basename:t,pathname:e}){return e==="/"?t:nr([t,e])}var cv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rd=t=>cv.test(t);function Uj(t,e="/"){let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?ns(t):t,i;if(n)if(Rd(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),qe(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${n}`)}n.startsWith("/")?i=rg(n.substring(1),"/"):i=rg(n,e)}else i=e;return{pathname:i,search:qj(r),hash:Yj(s)}}function rg(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Su(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function dv(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Id(t){let e=dv(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function $d(t,e,n,r=!1){let s;typeof t=="string"?s=ns(t):(s={...t},Pe(!s.pathname||!s.pathname.includes("?"),Su("?","pathname","search",s)),Pe(!s.pathname||!s.pathname.includes("#"),Su("#","pathname","hash",s)),Pe(!s.search||!s.search.includes("#"),Su("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}a=h>=0?e[h]:"/"}let l=Uj(s,a),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(d||u)&&(l.pathname+="/"),l}var nr=t=>t.join("/").replace(/\/\/+/g,"/"),Gj=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qj=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Yj=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Za=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function $o(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function el(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var uv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hv(t,e){let n=t;if(typeof n!="string"||!cv.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(uv)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),a=Cn(o.pathname,e);o.origin===i.origin&&a!=null?n=a+o.search+o.hash:s=!0}catch{qe(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}var Vr=Symbol("Uninstrumented");function Xj(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(s=>s({id:e.id,index:e.index,path:e.path,instrument(i){let o=Object.keys(n);for(let a of o)i[a]&&n[a].push(i[a])}}));let r={};if(typeof e.lazy=="function"&&n.lazy.length>0){let s=Js(n.lazy,e.lazy,()=>{});s&&(r.lazy=s)}if(typeof e.lazy=="object"){let s=e.lazy;["middleware","loader","action"].forEach(i=>{let o=s[i],a=n[`lazy.${i}`];if(typeof o=="function"&&a.length>0){let l=Js(a,o,()=>{});l&&(r.lazy=Object.assign(r.lazy||{},{[i]:l}))}})}return["loader","action"].forEach(s=>{let i=e[s];if(typeof i=="function"&&n[s].length>0){let o=i[Vr]??i,a=Js(n[s],o,(...l)=>sg(l[0]));a&&(a[Vr]=o,r[s]=a)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(r.middleware=e.middleware.map(s=>{let i=s[Vr]??s,o=Js(n.middleware,i,(...a)=>sg(a[0]));return o?(o[Vr]=i,o):s})),r}function Qj(t,e){let n={navigate:[],fetch:[]};if(e.forEach(r=>r({instrument(s){let i=Object.keys(s);for(let o of i)s[o]&&n[o].push(s[o])}})),n.navigate.length>0){let r=t.navigate[Vr]??t.navigate,s=Js(n.navigate,r,(...i)=>{let[o,a]=i;return{to:typeof o=="number"||typeof o=="string"?o:o?ir(o):".",...ig(t,a??{})}});s&&(s[Vr]=r,t.navigate=s)}if(n.fetch.length>0){let r=t.fetch[Vr]??t.fetch,s=Js(n.fetch,r,(...i)=>{let[o,,a,l]=i;return{href:a??".",fetcherKey:o,...ig(t,l??{})}});s&&(s[Vr]=r,t.fetch=s)}return t}function Js(t,e,n){return t.length===0?null:async(...r)=>{let s=await fv(t,n(...r),()=>e(...r),t.length-1);if(s.type==="error")throw s.value;return s.value}}async function fv(t,e,n,r){let s=t[r],i;if(s){let o,a=async()=>(o?console.error("You cannot call instrumented handlers more than once"):o=fv(t,e,n,r-1),i=await o,Pe(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await s(a,e)}catch(l){console.error("An instrumentation function threw an error:",l)}o||await a(),await o}else try{i={type:"success",value:await n()}}catch(o){i={type:"error",value:o}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function sg(t){let{request:e,context:n,params:r,unstable_pattern:s}=t;return{request:Jj(e),params:{...r},unstable_pattern:s,context:Zj(n)}}function ig(t,e){return{currentUrl:ir(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function Jj(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function Zj(t){if(t5(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var e5=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function t5(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===e5}var pv=["POST","PUT","PATCH","DELETE"],n5=new Set(pv),r5=["GET",...pv],s5=new Set(r5),mv=new Set([301,302,303,307,308]),i5=new Set([307,308]),Cu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},o5={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ji={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},a5=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),gv="remix-router-transitions",xv=Symbol("ResetLoaderData");function l5(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";Pe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=t.hydrationRouteProperties||[],s=t.mapRouteProperties||a5,i=s;if(t.unstable_instrumentations){let L=t.unstable_instrumentations;i=_=>({...s(_),...Xj(L.map(H=>H.route).filter(Boolean),_)})}let o={},a=Io(t.routes,i,void 0,o),l,d=t.basename||"/";d.startsWith("/")||(d=`/${d}`);let u=t.dataStrategy||f5,h={...t.future},f=null,p=new Set,m=null,x=null,b=null,y=t.hydrationData!=null,w=Br(a,t.history.location,d),v=!1,k=null,C;if(w==null&&!t.patchRoutesOnNavigation){let L=mn(404,{pathname:t.history.location.pathname}),{matches:_,route:H}=Ml(a);C=!0,w=_,k={[H.id]:L}}else if(w&&!t.hydrationData&&rt(w,a,t.history.location.pathname).active&&(w=null),w)if(w.some(L=>L.route.lazy))C=!1;else if(!w.some(L=>xp(L.route)))C=!0;else{let L=t.hydrationData?t.hydrationData.loaderData:null,_=t.hydrationData?t.hydrationData.errors:null;if(_){let H=w.findIndex(Y=>_[Y.route.id]!==void 0);C=w.slice(0,H+1).every(Y=>!Gh(Y.route,L,_))}else C=w.every(H=>!Gh(H.route,L,_))}else{C=!1,w=[];let L=rt(null,a,t.history.location.pathname);L.active&&L.matches&&(v=!0,w=L.matches)}let N,S={historyAction:t.history.action,location:t.history.location,matches:w,initialized:C,navigation:Cu,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||k,fetchers:new Map,blockers:new Map},D="POP",E=null,M=!1,P,A=!1,R=new Map,j=null,O=!1,T=!1,$=new Set,I=new Map,B=0,V=-1,W=new Map,F=new Set,Q=new Map,G=new Map,X=new Set,se=new Map,ie,z=null;function Z(){if(f=t.history.listen(({action:L,location:_,delta:H})=>{if(ie){ie(),ie=void 0;return}qe(se.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Y=Ws({currentLocation:S.location,nextLocation:_,historyAction:L});if(Y&&H!=null){let ee=new Promise(fe=>{ie=fe});t.history.go(H*-1),Er(Y,{state:"blocked",location:_,proceed(){Er(Y,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),ee.then(()=>t.history.go(H))},reset(){let fe=new Map(S.blockers);fe.set(Y,Ji),te({blockers:fe})}}),E?.resolve(),E=null;return}return Se(L,_)}),n){M5(e,R);let L=()=>A5(e,R);e.addEventListener("pagehide",L),j=()=>e.removeEventListener("pagehide",L)}return S.initialized||Se("POP",S.location,{initialHydration:!0}),N}function J(){f&&f(),j&&j(),p.clear(),P&&P.abort(),S.fetchers.forEach((L,_)=>at(_)),S.blockers.forEach((L,_)=>Vs(_))}function ue(L){return p.add(L),()=>p.delete(L)}function te(L,_={}){L.matches&&(L.matches=L.matches.map(ee=>{let fe=o[ee.route.id],le=ee.route;return le.element!==fe.element||le.errorElement!==fe.errorElement||le.hydrateFallbackElement!==fe.hydrateFallbackElement?{...ee,route:fe}:ee})),S={...S,...L};let H=[],Y=[];S.fetchers.forEach((ee,fe)=>{ee.state==="idle"&&(X.has(fe)?H.push(fe):Y.push(fe))}),X.forEach(ee=>{!S.fetchers.has(ee)&&!I.has(ee)&&H.push(ee)}),[...p].forEach(ee=>ee(S,{deletedFetchers:H,newErrors:L.errors??null,viewTransitionOpts:_.viewTransitionOpts,flushSync:_.flushSync===!0})),H.forEach(ee=>at(ee)),Y.forEach(ee=>S.fetchers.delete(ee))}function he(L,_,{flushSync:H}={}){let Y=S.actionData!=null&&S.navigation.formMethod!=null&&Mt(S.navigation.formMethod)&&S.navigation.state==="loading"&&L.state?._isRedirect!==!0,ee;_.actionData?Object.keys(_.actionData).length>0?ee=_.actionData:ee=null:Y?ee=S.actionData:ee=null;let fe=_.loaderData?mg(S.loaderData,_.loaderData,_.matches||[],_.errors):S.loaderData,le=S.blockers;le.size>0&&(le=new Map(le),le.forEach((we,ge)=>le.set(ge,Ji)));let pe=O?!1:kt(L,_.matches||S.matches),me=M===!0||S.navigation.formMethod!=null&&Mt(S.navigation.formMethod)&&L.state?._isRedirect!==!0;l&&(a=l,l=void 0),O||D==="POP"||(D==="PUSH"?t.history.push(L,L.state):D==="REPLACE"&&t.history.replace(L,L.state));let xe;if(D==="POP"){let we=R.get(S.location.pathname);we&&we.has(L.pathname)?xe={currentLocation:S.location,nextLocation:L}:R.has(L.pathname)&&(xe={currentLocation:L,nextLocation:S.location})}else if(A){let we=R.get(S.location.pathname);we?we.add(L.pathname):(we=new Set([L.pathname]),R.set(S.location.pathname,we)),xe={currentLocation:S.location,nextLocation:L}}te({..._,actionData:ee,loaderData:fe,historyAction:D,location:L,initialized:!0,navigation:Cu,revalidation:"idle",restoreScrollPosition:pe,preventScrollReset:me,blockers:le},{viewTransitionOpts:xe,flushSync:H===!0}),D="POP",M=!1,A=!1,O=!1,T=!1,E?.resolve(),E=null,z?.resolve(),z=null}async function ke(L,_){if(E?.resolve(),E=null,typeof L=="number"){E||(E=yg());let Le=E.promise;return t.history.go(L),Le}let H=Uh(S.location,S.matches,d,L,_?.fromRouteId,_?.relative),{path:Y,submission:ee,error:fe}=og(!1,H,_),le=S.location,pe=Ro(S.location,Y,_&&_.state);pe={...pe,...t.history.encodeLocation(pe)};let me=_&&_.replace!=null?_.replace:void 0,xe="PUSH";me===!0?xe="REPLACE":me===!1||ee!=null&&Mt(ee.formMethod)&&ee.formAction===S.location.pathname+S.location.search&&(xe="REPLACE");let we=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,ge=(_&&_.flushSync)===!0,Te=Ws({currentLocation:le,nextLocation:pe,historyAction:xe});if(Te){Er(Te,{state:"blocked",location:pe,proceed(){Er(Te,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),ke(L,_)},reset(){let Le=new Map(S.blockers);Le.set(Te,Ji),te({blockers:Le})}});return}await Se(xe,pe,{submission:ee,pendingError:fe,preventScrollReset:we,replace:_&&_.replace,enableViewTransition:_&&_.viewTransition,flushSync:ge,callSiteDefaultShouldRevalidate:_&&_.unstable_defaultShouldRevalidate})}function Ne(){z||(z=yg()),pt(),te({revalidation:"loading"});let L=z.promise;return S.navigation.state==="submitting"?L:S.navigation.state==="idle"?(Se(S.historyAction,S.location,{startUninterruptedRevalidation:!0}),L):(Se(D||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:A===!0}),L)}async function Se(L,_,H){P&&P.abort(),P=null,D=L,O=(H&&H.startUninterruptedRevalidation)===!0,un(S.location,S.matches),M=(H&&H.preventScrollReset)===!0,A=(H&&H.enableViewTransition)===!0;let Y=l||a,ee=H&&H.overrideNavigation,fe=H?.initialHydration&&S.matches&&S.matches.length>0&&!v?S.matches:Br(Y,_,d),le=(H&&H.flushSync)===!0;if(fe&&S.initialized&&!T&&w5(S.location,_)&&!(H&&H.submission&&Mt(H.submission.formMethod))){he(_,{matches:fe},{flushSync:le});return}let pe=rt(fe,Y,_.pathname);if(pe.active&&pe.matches&&(fe=pe.matches),!fe){let{error:st,notFoundMatches:Ct,route:$e}=Ye(_.pathname);he(_,{matches:Ct,loaderData:{},errors:{[$e.id]:st}},{flushSync:le});return}P=new AbortController;let me=Ys(t.history,_,P.signal,H&&H.submission),xe=t.getContext?await t.getContext():new eg,we;if(H&&H.pendingError)we=[_r(fe).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&Mt(H.submission.formMethod)){let st=await Ge(me,_,H.submission,fe,xe,pe.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:le});if(st.shortCircuited)return;if(st.pendingActionResult){let[Ct,$e]=st.pendingActionResult;if(rn($e)&&$o($e.error)&&$e.error.status===404){P=null,he(_,{matches:st.matches,loaderData:{},errors:{[Ct]:$e.error}});return}}fe=st.matches||fe,we=st.pendingActionResult,ee=ju(_,H.submission),le=!1,pe.active=!1,me=Ys(t.history,me.url,me.signal)}let{shortCircuited:ge,matches:Te,loaderData:Le,errors:lt}=await vt(me,_,fe,xe,pe.active,ee,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,le,we,H&&H.callSiteDefaultShouldRevalidate);ge||(P=null,he(_,{matches:Te||fe,...gg(we),loaderData:Le,errors:lt}))}async function Ge(L,_,H,Y,ee,fe,le,pe={}){pt();let me=E5(_,H);if(te({navigation:me},{flushSync:pe.flushSync===!0}),fe){let ge=await St(Y,_.pathname,L.signal);if(ge.type==="aborted")return{shortCircuited:!0};if(ge.type==="error"){if(ge.partialMatches.length===0){let{matches:Le,route:lt}=Ml(a);return{matches:Le,pendingActionResult:[lt.id,{type:"error",error:ge.error}]}}let Te=_r(ge.partialMatches).route.id;return{matches:ge.partialMatches,pendingActionResult:[Te,{type:"error",error:ge.error}]}}else if(ge.matches)Y=ge.matches;else{let{notFoundMatches:Te,error:Le,route:lt}=Ye(_.pathname);return{matches:Te,pendingActionResult:[lt.id,{type:"error",error:Le}]}}}let xe,we=yc(Y,_);if(!we.route.action&&!we.route.lazy)xe={type:"error",error:mn(405,{method:L.method,pathname:_.pathname,routeId:we.route.id})};else{let ge=oi(i,o,L,Y,we,le?[]:r,ee),Te=await Ot(L,ge,ee,null);if(xe=Te[we.route.id],!xe){for(let Le of Y)if(Te[Le.route.id]){xe=Te[Le.route.id];break}}if(L.signal.aborted)return{shortCircuited:!0}}if(ys(xe)){let ge;return pe&&pe.replace!=null?ge=pe.replace:ge=hg(xe.response.headers.get("Location"),new URL(L.url),d)===S.location.pathname+S.location.search,await Et(L,xe,!0,{submission:H,replace:ge}),{shortCircuited:!0}}if(rn(xe)){let ge=_r(Y,we.route.id);return(pe&&pe.replace)!==!0&&(D="PUSH"),{matches:Y,pendingActionResult:[ge.route.id,xe,we.route.id]}}return{matches:Y,pendingActionResult:[we.route.id,xe]}}async function vt(L,_,H,Y,ee,fe,le,pe,me,xe,we,ge,Te){let Le=fe||ju(_,le),lt=le||pe||bg(Le),st=!O&&!xe;if(ee){if(st){let gt=ft(ge);te({navigation:Le,...gt!==void 0?{actionData:gt}:{}},{flushSync:we})}let Oe=await St(H,_.pathname,L.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:Or,route:pr}=Ml(a);return{matches:Or,loaderData:{},errors:{[pr.id]:Oe.error}}}let gt=_r(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,loaderData:{},errors:{[gt]:Oe.error}}}else if(Oe.matches)H=Oe.matches;else{let{error:gt,notFoundMatches:Or,route:pr}=Ye(_.pathname);return{matches:Or,loaderData:{},errors:{[pr.id]:gt}}}}let Ct=l||a,{dsMatches:$e,revalidatingFetchers:Bt}=ag(L,Y,i,o,t.history,S,H,lt,_,xe?[]:r,xe===!0,T,$,X,Q,F,Ct,d,t.patchRoutesOnNavigation!=null,ge,Te);if(V=++B,!t.dataStrategy&&!$e.some(Oe=>Oe.shouldLoad)&&!$e.some(Oe=>Oe.route.middleware&&Oe.route.middleware.length>0)&&Bt.length===0){let Oe=os();return he(_,{matches:H,loaderData:{},errors:ge&&rn(ge[1])?{[ge[0]]:ge[1].error}:null,...gg(ge),...Oe?{fetchers:new Map(S.fetchers)}:{}},{flushSync:we}),{shortCircuited:!0}}if(st){let Oe={};if(!ee){Oe.navigation=Le;let gt=ft(ge);gt!==void 0&&(Oe.actionData=gt)}Bt.length>0&&(Oe.fetchers=nt(Bt)),te(Oe,{flushSync:we})}Bt.forEach(Oe=>{Qe(Oe.key),Oe.controller&&I.set(Oe.key,Oe.controller)});let hr=()=>Bt.forEach(Oe=>Qe(Oe.key));P&&P.signal.addEventListener("abort",hr);let{loaderResults:as,fetcherResults:Vn}=await $t($e,Bt,L,Y);if(L.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",hr),Bt.forEach(Oe=>I.delete(Oe.key));let fn=Al(as);if(fn)return await Et(L,fn.result,!0,{replace:me}),{shortCircuited:!0};if(fn=Al(Vn),fn)return F.add(fn.key),await Et(L,fn.result,!0,{replace:me}),{shortCircuited:!0};let{loaderData:Qi,errors:ls}=pg(S,H,as,ge,Bt,Vn);xe&&S.errors&&(ls={...S.errors,...ls});let fr=os(),cs=zs(V),Ks=fr||cs||Bt.length>0;return{matches:H,loaderData:Qi,errors:ls,...Ks?{fetchers:new Map(S.fetchers)}:{}}}function ft(L){if(L&&!rn(L[1]))return{[L[0]]:L[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function nt(L){return L.forEach(_=>{let H=S.fetchers.get(_.key),Y=Zi(void 0,H?H.data:void 0);S.fetchers.set(_.key,Y)}),new Map(S.fetchers)}async function Wt(L,_,H,Y){Qe(L);let ee=(Y&&Y.flushSync)===!0,fe=l||a,le=Uh(S.location,S.matches,d,H,_,Y?.relative),pe=Br(fe,le,d),me=rt(pe,fe,le);if(me.active&&me.matches&&(pe=me.matches),!pe){re(L,_,mn(404,{pathname:le}),{flushSync:ee});return}let{path:xe,submission:we,error:ge}=og(!0,le,Y);if(ge){re(L,_,ge,{flushSync:ee});return}let Te=t.getContext?await t.getContext():new eg,Le=(Y&&Y.preventScrollReset)===!0;if(we&&Mt(we.formMethod)){await It(L,_,xe,pe,Te,me.active,ee,Le,we,Y&&Y.unstable_defaultShouldRevalidate);return}Q.set(L,{routeId:_,path:xe}),await dn(L,_,xe,pe,Te,me.active,ee,Le,we)}async function It(L,_,H,Y,ee,fe,le,pe,me,xe){pt(),Q.delete(L);let we=S.fetchers.get(L);K(L,O5(me,we),{flushSync:le});let ge=new AbortController,Te=Ys(t.history,H,ge.signal,me);if(fe){let Ve=await St(Y,new URL(Te.url).pathname,Te.signal,L);if(Ve.type==="aborted")return;if(Ve.type==="error"){re(L,_,Ve.error,{flushSync:le});return}else if(Ve.matches)Y=Ve.matches;else{re(L,_,mn(404,{pathname:H}),{flushSync:le});return}}let Le=yc(Y,H);if(!Le.route.action&&!Le.route.lazy){let Ve=mn(405,{method:me.formMethod,pathname:H,routeId:_});re(L,_,Ve,{flushSync:le});return}I.set(L,ge);let lt=B,st=oi(i,o,Te,Y,Le,r,ee),Ct=await Ot(Te,st,ee,L),$e=Ct[Le.route.id];if(!$e){for(let Ve of st)if(Ct[Ve.route.id]){$e=Ct[Ve.route.id];break}}if(Te.signal.aborted){I.get(L)===ge&&I.delete(L);return}if(X.has(L)){if(ys($e)||rn($e)){K(L,br(void 0));return}}else{if(ys($e))if(I.delete(L),V>lt){K(L,br(void 0));return}else return F.add(L),K(L,Zi(me)),Et(Te,$e,!1,{fetcherSubmission:me,preventScrollReset:pe});if(rn($e)){re(L,_,$e.error);return}}let Bt=S.navigation.location||S.location,hr=Ys(t.history,Bt,ge.signal),as=l||a,Vn=S.navigation.state!=="idle"?Br(as,S.navigation.location,d):S.matches;Pe(Vn,"Didn't find any matches after fetcher action");let fn=++B;W.set(L,fn);let Qi=Zi(me,$e.data);S.fetchers.set(L,Qi);let{dsMatches:ls,revalidatingFetchers:fr}=ag(hr,ee,i,o,t.history,S,Vn,me,Bt,r,!1,T,$,X,Q,F,as,d,t.patchRoutesOnNavigation!=null,[Le.route.id,$e],xe);fr.filter(Ve=>Ve.key!==L).forEach(Ve=>{let Us=Ve.key,El=S.fetchers.get(Us),Ol=Zi(void 0,El?El.data:void 0);S.fetchers.set(Us,Ol),Qe(Us),Ve.controller&&I.set(Us,Ve.controller)}),te({fetchers:new Map(S.fetchers)});let cs=()=>fr.forEach(Ve=>Qe(Ve.key));ge.signal.addEventListener("abort",cs);let{loaderResults:Ks,fetcherResults:Oe}=await $t(ls,fr,hr,ee);if(ge.signal.aborted)return;if(ge.signal.removeEventListener("abort",cs),W.delete(L),I.delete(L),fr.forEach(Ve=>I.delete(Ve.key)),S.fetchers.has(L)){let Ve=br($e.data);S.fetchers.set(L,Ve)}let gt=Al(Ks);if(gt)return Et(hr,gt.result,!1,{preventScrollReset:pe});if(gt=Al(Oe),gt)return F.add(gt.key),Et(hr,gt.result,!1,{preventScrollReset:pe});let{loaderData:Or,errors:pr}=pg(S,Vn,Ks,void 0,fr,Oe);zs(fn),S.navigation.state==="loading"&&fn>V?(Pe(D,"Expected pending action"),P&&P.abort(),he(S.navigation.location,{matches:Vn,loaderData:Or,errors:pr,fetchers:new Map(S.fetchers)})):(te({errors:pr,loaderData:mg(S.loaderData,Or,Vn,pr),fetchers:new Map(S.fetchers)}),T=!1)}async function dn(L,_,H,Y,ee,fe,le,pe,me){let xe=S.fetchers.get(L);K(L,Zi(me,xe?xe.data:void 0),{flushSync:le});let we=new AbortController,ge=Ys(t.history,H,we.signal);if(fe){let $e=await St(Y,new URL(ge.url).pathname,ge.signal,L);if($e.type==="aborted")return;if($e.type==="error"){re(L,_,$e.error,{flushSync:le});return}else if($e.matches)Y=$e.matches;else{re(L,_,mn(404,{pathname:H}),{flushSync:le});return}}let Te=yc(Y,H);I.set(L,we);let Le=B,lt=oi(i,o,ge,Y,Te,r,ee),Ct=(await Ot(ge,lt,ee,L))[Te.route.id];if(I.get(L)===we&&I.delete(L),!ge.signal.aborted){if(X.has(L)){K(L,br(void 0));return}if(ys(Ct))if(V>Le){K(L,br(void 0));return}else{F.add(L),await Et(ge,Ct,!1,{preventScrollReset:pe});return}if(rn(Ct)){re(L,_,Ct.error);return}K(L,br(Ct.data))}}async function Et(L,_,H,{submission:Y,fetcherSubmission:ee,preventScrollReset:fe,replace:le}={}){H||(E?.resolve(),E=null),_.response.headers.has("X-Remix-Revalidate")&&(T=!0);let pe=_.response.headers.get("Location");Pe(pe,"Expected a Location header on the redirect Response"),pe=hg(pe,new URL(L.url),d);let me=Ro(S.location,pe,{_isRedirect:!0});if(n){let lt=!1;if(_.response.headers.has("X-Remix-Reload-Document"))lt=!0;else if(Rd(pe)){const st=ov(pe,!0);lt=st.origin!==e.location.origin||Cn(st.pathname,d)==null}if(lt){le?e.location.replace(pe):e.location.assign(pe);return}}P=null;let xe=le===!0||_.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:we,formAction:ge,formEncType:Te}=S.navigation;!Y&&!ee&&we&&ge&&Te&&(Y=bg(S.navigation));let Le=Y||ee;if(i5.has(_.response.status)&&Le&&Mt(Le.formMethod))await Se(xe,me,{submission:{...Le,formAction:pe},preventScrollReset:fe||M,enableViewTransition:H?A:void 0});else{let lt=ju(me,Y);await Se(xe,me,{overrideNavigation:lt,fetcherSubmission:ee,preventScrollReset:fe||M,enableViewTransition:H?A:void 0})}}async function Ot(L,_,H,Y){let ee,fe={};try{ee=await m5(u,L,_,Y,H,!1)}catch(le){return _.filter(pe=>pe.shouldLoad).forEach(pe=>{fe[pe.route.id]={type:"error",error:le}}),fe}if(L.signal.aborted)return fe;if(!Mt(L.method))for(let le of _){if(ee[le.route.id]?.type==="error")break;!ee.hasOwnProperty(le.route.id)&&!S.loaderData.hasOwnProperty(le.route.id)&&(!S.errors||!S.errors.hasOwnProperty(le.route.id))&&le.shouldCallHandler()&&(ee[le.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${le.route.id}`)})}for(let[le,pe]of Object.entries(ee))if(j5(pe)){let me=pe.result;fe[le]={type:"redirect",response:y5(me,L,le,_,d)}}else fe[le]=await b5(pe);return fe}async function $t(L,_,H,Y){let ee=Ot(H,L,Y,null),fe=Promise.all(_.map(async me=>{if(me.matches&&me.match&&me.request&&me.controller){let we=(await Ot(me.request,me.matches,Y,me.key))[me.match.route.id];return{[me.key]:we}}else return Promise.resolve({[me.key]:{type:"error",error:mn(404,{pathname:me.path})}})})),le=await ee,pe=(await fe).reduce((me,xe)=>Object.assign(me,xe),{});return{loaderResults:le,fetcherResults:pe}}function pt(){T=!0,Q.forEach((L,_)=>{I.has(_)&&$.add(_),Qe(_)})}function K(L,_,H={}){S.fetchers.set(L,_),te({fetchers:new Map(S.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function re(L,_,H,Y={}){let ee=_r(S.matches,_);at(L),te({errors:{[ee.route.id]:H},fetchers:new Map(S.fetchers)},{flushSync:(Y&&Y.flushSync)===!0})}function ve(L){return G.set(L,(G.get(L)||0)+1),X.has(L)&&X.delete(L),S.fetchers.get(L)||o5}function Ce(L,_){Qe(L,_?.reason),K(L,br(null))}function at(L){let _=S.fetchers.get(L);I.has(L)&&!(_&&_.state==="loading"&&W.has(L))&&Qe(L),Q.delete(L),W.delete(L),F.delete(L),X.delete(L),$.delete(L),S.fetchers.delete(L)}function ur(L){let _=(G.get(L)||0)-1;_<=0?(G.delete(L),X.add(L)):G.set(L,_),te({fetchers:new Map(S.fetchers)})}function Qe(L,_){let H=I.get(L);H&&(H.abort(_),I.delete(L))}function Dr(L){for(let _ of L){let H=ve(_),Y=br(H.data);S.fetchers.set(_,Y)}}function os(){let L=[],_=!1;for(let H of F){let Y=S.fetchers.get(H);Pe(Y,`Expected fetcher: ${H}`),Y.state==="loading"&&(F.delete(H),L.push(H),_=!0)}return Dr(L),_}function zs(L){let _=[];for(let[H,Y]of W)if(Y<L){let ee=S.fetchers.get(H);Pe(ee,`Expected fetcher: ${H}`),ee.state==="loading"&&(Qe(H),W.delete(H),_.push(H))}return Dr(_),_.length>0}function Hs(L,_){let H=S.blockers.get(L)||Ji;return se.get(L)!==_&&se.set(L,_),H}function Vs(L){S.blockers.delete(L),se.delete(L)}function Er(L,_){let H=S.blockers.get(L)||Ji;Pe(H.state==="unblocked"&&_.state==="blocked"||H.state==="blocked"&&_.state==="blocked"||H.state==="blocked"&&_.state==="proceeding"||H.state==="blocked"&&_.state==="unblocked"||H.state==="proceeding"&&_.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${_.state}`);let Y=new Map(S.blockers);Y.set(L,_),te({blockers:Y})}function Ws({currentLocation:L,nextLocation:_,historyAction:H}){if(se.size===0)return;se.size>1&&qe(!1,"A router only supports one blocker at a time");let Y=Array.from(se.entries()),[ee,fe]=Y[Y.length-1],le=S.blockers.get(ee);if(!(le&&le.state==="proceeding")&&fe({currentLocation:L,nextLocation:_,historyAction:H}))return ee}function Ye(L){let _=mn(404,{pathname:L}),H=l||a,{matches:Y,route:ee}=Ml(H);return{notFoundMatches:Y,route:ee,error:_}}function wt(L,_,H){if(m=L,b=_,x=H||null,!y&&S.navigation===Cu){y=!0;let Y=kt(S.location,S.matches);Y!=null&&te({restoreScrollPosition:Y})}return()=>{m=null,b=null,x=null}}function mt(L,_){return x&&x(L,_.map(Y=>Aj(Y,S.loaderData)))||L.key}function un(L,_){if(m&&b){let H=mt(L,_);m[H]=b()}}function kt(L,_){if(m){let H=mt(L,_),Y=m[H];if(typeof Y=="number")return Y}return null}function rt(L,_,H){if(t.patchRoutesOnNavigation)if(L){if(Object.keys(L[0].params).length>0)return{active:!0,matches:po(_,H,d,!0)}}else return{active:!0,matches:po(_,H,d,!0)||[]};return{active:!1,matches:null}}async function St(L,_,H,Y){if(!t.patchRoutesOnNavigation)return{type:"success",matches:L};let ee=L;for(;;){let fe=l==null,le=l||a,pe=o;try{await t.patchRoutesOnNavigation({signal:H,path:_,matches:ee,fetcherKey:Y,patch:(we,ge)=>{H.aborted||lg(we,ge,le,pe,i,!1)}})}catch(we){return{type:"error",error:we,partialMatches:ee}}finally{fe&&!H.aborted&&(a=[...a])}if(H.aborted)return{type:"aborted"};let me=Br(le,_,d),xe=null;if(me){if(Object.keys(me[0].params).length===0)return{type:"success",matches:me};if(xe=po(le,_,d,!0),!(xe&&ee.length<xe.length&&Dn(ee,xe.slice(0,ee.length))))return{type:"success",matches:me}}if(xe||(xe=po(le,_,d,!0)),!xe||Dn(ee,xe))return{type:"success",matches:null};ee=xe}}function Dn(L,_){return L.length===_.length&&L.every((H,Y)=>H.route.id===_[Y].route.id)}function Je(L){o={},l=Io(L,i,void 0,o)}function hn(L,_,H=!1){let Y=l==null;lg(L,_,l||a,o,i,H),Y&&(a=[...a],te({}))}return N={get basename(){return d},get future(){return h},get state(){return S},get routes(){return a},get window(){return e},initialize:Z,subscribe:ue,enableScrollRestoration:wt,navigate:ke,fetch:Wt,revalidate:Ne,createHref:L=>t.history.createHref(L),encodeLocation:L=>t.history.encodeLocation(L),getFetcher:ve,resetFetcher:Ce,deleteFetcher:ur,dispose:J,getBlocker:Hs,deleteBlocker:Vs,patchRoutes:hn,_internalFetchControllers:I,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(L){te(L)}},t.unstable_instrumentations&&(N=Qj(N,t.unstable_instrumentations.map(L=>L.router).filter(Boolean))),N}function c5(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Uh(t,e,n,r,s,i){let o,a;if(s){o=[];for(let d of e)if(o.push(d),d.route.id===s){a=d;break}}else o=e,a=e[e.length-1];let l=$d(r||".",Id(o),Cn(t.pathname,n)||t.pathname,i==="path");if(r==null&&(l.search=t.search,l.hash=t.hash),(r==null||r===""||r===".")&&a){let d=yp(l.search);if(a.route.index&&!d)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!a.route.index&&d){let u=new URLSearchParams(l.search),h=u.getAll("index");u.delete("index"),h.filter(p=>p).forEach(p=>u.append("index",p));let f=u.toString();l.search=f?`?${f}`:""}}return n!=="/"&&(l.pathname=Kj({basename:n,pathname:l.pathname})),ir(l)}function og(t,e,n){if(!n||!c5(n))return{path:e};if(n.formMethod&&!D5(n.formMethod))return{path:e,error:mn(405,{method:n.formMethod})};let r=()=>({path:e,error:mn(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),o=Sv(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Mt(i))return r();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((f,[p,m])=>`${f}${p}=${m}
|
|
19
19
|
`,""):String(n.body);return{path:e,submission:{formMethod:i,formAction:o,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!Mt(i))return r();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:i,formAction:o,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return r()}}}Pe(typeof FormData=="function","FormData is not available in this environment");let a,l;if(n.formData)a=Yh(n.formData),l=n.formData;else if(n.body instanceof FormData)a=Yh(n.body),l=n.body;else if(n.body instanceof URLSearchParams)a=n.body,l=fg(a);else if(n.body==null)a=new URLSearchParams,l=new FormData;else try{a=new URLSearchParams(n.body),l=fg(a)}catch{return r()}let d={formMethod:i,formAction:o,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(Mt(d.formMethod))return{path:e,submission:d};let u=ns(e);return t&&u.search&&yp(u.search)&&a.append("index",""),u.search=`?${a}`,{path:ir(u),submission:d}}function ag(t,e,n,r,s,i,o,a,l,d,u,h,f,p,m,x,b,y,w,v,k){let C=v?rn(v[1])?v[1].error:v[1].data:void 0,N=s.createURL(i.location),S=s.createURL(l),D;if(u&&i.errors){let O=Object.keys(i.errors)[0];D=o.findIndex(T=>T.route.id===O)}else if(v&&rn(v[1])){let O=v[0];D=o.findIndex(T=>T.route.id===O)-1}let E=v?v[1].statusCode:void 0,M=E&&E>=400,P={currentUrl:N,currentParams:i.matches[0]?.params||{},nextUrl:S,nextParams:o[0].params,...a,actionResult:C,actionStatus:E},A=el(o),R=o.map((O,T)=>{let{route:$}=O,I=null;if(D!=null&&T>D?I=!1:$.lazy?I=!0:xp($)?u?I=Gh($,i.loaderData,i.errors):d5(i.loaderData,i.matches[T],O)&&(I=!0):I=!1,I!==null)return qh(n,r,t,A,O,d,e,I);let B=!1;typeof k=="boolean"?B=k:M?B=!1:(h||N.pathname+N.search===S.pathname+S.search||N.search!==S.search||u5(i.matches[T],O))&&(B=!0);let V={...P,defaultShouldRevalidate:B},W=wo(O,V);return qh(n,r,t,A,O,d,e,W,V,k)}),j=[];return m.forEach((O,T)=>{if(u||!o.some(G=>G.route.id===O.routeId)||p.has(T))return;let $=i.fetchers.get(T),I=$&&$.state!=="idle"&&$.data===void 0,B=Br(b,O.path,y);if(!B){if(w&&I)return;j.push({key:T,routeId:O.routeId,path:O.path,matches:null,match:null,request:null,controller:null});return}if(x.has(T))return;let V=yc(B,O.path),W=new AbortController,F=Ys(s,O.path,W.signal),Q=null;if(f.has(T))f.delete(T),Q=oi(n,r,F,B,V,d,e);else if(I)h&&(Q=oi(n,r,F,B,V,d,e));else{let G;typeof k=="boolean"?G=k:M?G=!1:G=h;let X={...P,defaultShouldRevalidate:G};wo(V,X)&&(Q=oi(n,r,F,B,V,d,e,X))}Q&&j.push({key:T,routeId:O.routeId,path:O.path,matches:Q,match:V,request:F,controller:W})}),{dsMatches:R,revalidatingFetchers:j}}function xp(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function Gh(t,e,n){if(t.lazy)return!0;if(!xp(t))return!1;let r=e!=null&&t.id in e,s=n!=null&&n[t.id]!==void 0;return!r&&s?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!s}function d5(t,e,n){let r=!e||n.route.id!==e.route.id,s=!t.hasOwnProperty(n.route.id);return r||s}function u5(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function wo(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function lg(t,e,n,r,s,i){let o;if(t){let d=r[t];Pe(d,`No route found to patch children into: routeId = ${t}`),d.children||(d.children=[]),o=d.children}else o=n;let a=[],l=[];if(e.forEach(d=>{let u=o.find(h=>bv(d,h));u?l.push({existingRoute:u,newRoute:d}):a.push(d)}),a.length>0){let d=Io(a,s,[t||"_","patch",String(o?.length||"0")],r);o.push(...d)}if(i&&l.length>0)for(let d=0;d<l.length;d++){let{existingRoute:u,newRoute:h}=l[d],f=u,[p]=Io([h],s,[],{},!0);Object.assign(f,{element:p.element?p.element:f.element,errorElement:p.errorElement?p.errorElement:f.errorElement,hydrateFallbackElement:p.hydrateFallbackElement?p.hydrateFallbackElement:f.hydrateFallbackElement})}}function bv(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>e.children?.some(s=>bv(n,s))):!1}var cg=new WeakMap,yv=({key:t,route:e,manifest:n,mapRouteProperties:r})=>{let s=n[e.id];if(Pe(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[t];if(!i)return;let o=cg.get(s);o||(o={},cg.set(s,o));let a=o[t];if(a)return a;let l=(async()=>{let d=Dj(t),h=s[t]!==void 0&&t!=="hasErrorBoundary";if(d)qe(!d,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),o[t]=Promise.resolve();else if(h)qe(!1,`Route "${s.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let f=await i();f!=null&&(Object.assign(s,{[t]:f}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[t]=void 0,Object.values(s.lazy).every(f=>f===void 0)&&(s.lazy=void 0))})();return o[t]=l,l},dg=new WeakMap;function h5(t,e,n,r,s){let i=n[t.id];if(Pe(i,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let u=dg.get(i);if(u)return{lazyRoutePromise:u,lazyHandlerPromise:u};let h=(async()=>{Pe(typeof t.lazy=="function","No lazy route function found");let f=await t.lazy(),p={};for(let m in f){let x=f[m];if(x===void 0)continue;let b=Oj(m),w=i[m]!==void 0&&m!=="hasErrorBoundary";b?qe(!b,"Route property "+m+" is not a supported property to be returned from a lazy route function. This property will be ignored."):w?qe(!w,`Route "${i.id}" has a static property "${m}" defined but its lazy function is also returning a value for this property. The lazy route property "${m}" will be ignored.`):p[m]=x}Object.assign(i,p),Object.assign(i,{...r(i),lazy:void 0})})();return dg.set(i,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let o=Object.keys(t.lazy),a=[],l;for(let u of o){if(s&&s.includes(u))continue;let h=yv({key:u,route:t,manifest:n,mapRouteProperties:r});h&&(a.push(h),u===e&&(l=h))}let d=a.length>0?Promise.all(a).then(()=>{}):void 0;return d?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:l}}async function ug(t){let e=t.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(e.map(s=>s.resolve()))).forEach((s,i)=>{n[e[i].route.id]=s}),n}async function f5(t){return t.matches.some(e=>e.route.middleware)?vv(t,()=>ug(t)):ug(t)}function vv(t,e){return p5(t,e,r=>{if(P5(r))throw r;return r},S5,n);function n(r,s,i){if(i)return Promise.resolve(Object.assign(i.value,{[s]:{type:"error",result:r}}));{let{matches:o}=t,a=Math.min(Math.max(o.findIndex(d=>d.route.id===s),0),Math.max(o.findIndex(d=>d.shouldCallHandler()),0)),l=_r(o,o[a].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:r}})}}}async function p5(t,e,n,r,s){let{matches:i,request:o,params:a,context:l,unstable_pattern:d}=t,u=i.flatMap(f=>f.route.middleware?f.route.middleware.map(p=>[f.route.id,p]):[]);return await wv({request:o,params:a,context:l,unstable_pattern:d},u,e,n,r,s)}async function wv(t,e,n,r,s,i,o=0){let{request:a}=t;if(a.signal.aborted)throw a.signal.reason??new Error(`Request aborted: ${a.method} ${a.url}`);let l=e[o];if(!l)return await n();let[d,u]=l,h,f=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await wv(t,e,n,r,s,i,o+1)},h.value}catch(p){return h={value:await i(p,d,h)},h.value}};try{let p=await u(t,f),m=p!=null?r(p):void 0;return s(m)?m:h?m??h.value:(h={value:await f()},h.value)}catch(p){return await i(p,d,h)}}function kv(t,e,n,r,s){let i=yv({key:"middleware",route:r.route,manifest:e,mapRouteProperties:t}),o=h5(r.route,Mt(n.method)?"action":"loader",e,t,s);return{middleware:i,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function qh(t,e,n,r,s,i,o,a,l=null,d){let u=!1,h=kv(t,e,n,s,i);return{...s,_lazyPromises:h,shouldLoad:a,shouldRevalidateArgs:l,shouldCallHandler(f){return u=!0,l?typeof d=="boolean"?wo(s,{...l,defaultShouldRevalidate:d}):typeof f=="boolean"?wo(s,{...l,defaultShouldRevalidate:f}):wo(s,l):a},resolve(f){let{lazy:p,loader:m,middleware:x}=s.route,b=u||a||f&&!Mt(n.method)&&(p||m),y=x&&x.length>0&&!m&&!p;return b&&(Mt(n.method)||!y)?g5({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:f,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function oi(t,e,n,r,s,i,o,a=null){return r.map(l=>l.route.id!==s.route.id?{...l,shouldLoad:!1,shouldRevalidateArgs:a,shouldCallHandler:()=>!1,_lazyPromises:kv(t,e,n,l,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:qh(t,e,n,el(r),l,i,o,!0,a))}async function m5(t,e,n,r,s,i){n.some(d=>d._lazyPromises?.middleware)&&await Promise.all(n.map(d=>d._lazyPromises?.middleware));let o={request:e,unstable_pattern:el(n),params:n[0].params,context:s,matches:n},l=await t({...o,fetcherKey:r,runClientMiddleware:d=>{let u=o;return vv(u,()=>d({...u,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>[d._lazyPromises?.handler,d._lazyPromises?.route]))}catch{}return l}async function g5({request:t,unstable_pattern:e,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:o}){let a,l,d=Mt(t.method),u=d?"action":"loader",h=f=>{let p,m=new Promise((y,w)=>p=w);l=()=>p(),t.signal.addEventListener("abort",l);let x=y=>typeof f!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${n.route.id}]`)):f({request:t,unstable_pattern:e,params:n.params,context:o},...y!==void 0?[y]:[]),b=(async()=>{try{return{type:"data",result:await(i?i(w=>x(w)):x())}}catch(y){return{type:"error",result:y}}})();return Promise.race([b,m])};try{let f=d?n.route.action:n.route.loader;if(r||s)if(f){let p,[m]=await Promise.all([h(f).catch(x=>{p=x}),r,s]);if(p!==void 0)throw p;a=m}else{await r;let p=d?n.route.action:n.route.loader;if(p)[a]=await Promise.all([h(p),s]);else if(u==="action"){let m=new URL(t.url),x=m.pathname+m.search;throw mn(405,{method:t.method,pathname:x,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(f)a=await h(f);else{let p=new URL(t.url),m=p.pathname+p.search;throw mn(404,{pathname:m})}}catch(f){return{type:"error",result:f}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function x5(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function b5(t){let{result:e,type:n}=t;if(bp(e)){let r;try{r=await x5(e)}catch(s){return{type:"error",error:s}}return n==="error"?{type:"error",error:new Za(e.status,e.statusText,r),statusCode:e.status,headers:e.headers}:{type:"data",data:r,statusCode:e.status,headers:e.headers}}return n==="error"?xg(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:k5(e),statusCode:$o(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:$o(e)?e.status:void 0}:xg(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function y5(t,e,n,r,s){let i=t.headers.get("Location");if(Pe(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Rd(i)){let o=r.slice(0,r.findIndex(a=>a.route.id===n)+1);i=Uh(new URL(e.url),o,s,i),t.headers.set("Location",i)}return t}function hg(t,e,n){if(Rd(t)){let r=t,s=r.startsWith("//")?new URL(e.protocol+r):new URL(r),i=Cn(s.pathname,n)!=null;if(s.origin===e.origin&&i)return s.pathname+s.search+s.hash}return t}function Ys(t,e,n,r){let s=t.createURL(Sv(e)).toString(),i={signal:n};if(r&&Mt(r.formMethod)){let{formMethod:o,formEncType:a}=r;i.method=o.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=Yh(r.formData):i.body=r.formData}return new Request(s,i)}function Yh(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function fg(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function v5(t,e,n,r=!1,s=!1){let i={},o=null,a,l=!1,d={},u=n&&rn(n[1])?n[1].error:void 0;return t.forEach(h=>{if(!(h.route.id in e))return;let f=h.route.id,p=e[f];if(Pe(!ys(p),"Cannot handle redirect results in processLoaderData"),rn(p)){let m=p.error;if(u!==void 0&&(m=u,u=void 0),o=o||{},s)o[f]=m;else{let x=_r(t,f);o[x.route.id]==null&&(o[x.route.id]=m)}r||(i[f]=xv),l||(l=!0,a=$o(p.error)?p.error.status:500),p.headers&&(d[f]=p.headers)}else i[f]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(a=p.statusCode),p.headers&&(d[f]=p.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:o,statusCode:a||200,loaderHeaders:d}}function pg(t,e,n,r,s,i){let{loaderData:o,errors:a}=v5(e,n,r);return s.filter(l=>!l.matches||l.matches.some(d=>d.shouldLoad)).forEach(l=>{let{key:d,match:u,controller:h}=l;if(h&&h.signal.aborted)return;let f=i[d];if(Pe(f,"Did not find corresponding fetcher result"),rn(f)){let p=_r(t.matches,u?.route.id);a&&a[p.route.id]||(a={...a,[p.route.id]:f.error}),t.fetchers.delete(d)}else if(ys(f))Pe(!1,"Unhandled fetcher revalidation redirect");else{let p=br(f.data);t.fetchers.set(d,p)}}),{loaderData:o,errors:a}}function mg(t,e,n,r){let s=Object.entries(e).filter(([,i])=>i!==xv).reduce((i,[o,a])=>(i[o]=a,i),{});for(let i of n){let o=i.route.id;if(!e.hasOwnProperty(o)&&t.hasOwnProperty(o)&&i.route.loader&&(s[o]=t[o]),r&&r.hasOwnProperty(o))break}return s}function gg(t){return t?rn(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function _r(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function Ml(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function mn(t,{pathname:e,routeId:n,method:r,type:s,message:i}={}){let o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",r&&e&&n?a=`You made a ${r} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(a="Unable to encode submission body")):t===403?(o="Forbidden",a=`Route "${n}" does not match URL "${e}"`):t===404?(o="Not Found",a=`No route matches URL "${e}"`):t===405&&(o="Method Not Allowed",r&&e&&n?a=`You made a ${r.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(a=`Invalid request method "${r.toUpperCase()}"`)),new Za(t||500,o,new Error(a),!0)}function Al(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,s]=e[n];if(ys(s))return{key:r,result:s}}}function Sv(t){let e=typeof t=="string"?ns(t):t;return ir({...e,hash:""})}function w5(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function k5(t){return new Za(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data)}function S5(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&C5(n))}function C5(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function j5(t){return bp(t.result)&&mv.has(t.result.status)}function rn(t){return t.type==="error"}function ys(t){return(t&&t.type)==="redirect"}function xg(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function bp(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function N5(t){return mv.has(t)}function P5(t){return bp(t)&&N5(t.status)&&t.headers.has("Location")}function D5(t){return s5.has(t.toUpperCase())}function Mt(t){return n5.has(t.toUpperCase())}function yp(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function yc(t,e){let n=typeof e=="string"?ns(e).search:e.search;if(t[t.length-1].route.index&&yp(n||""))return t[t.length-1];let r=dv(t);return r[r.length-1]}function bg(t){let{formMethod:e,formAction:n,formEncType:r,text:s,formData:i,json:o}=t;if(!(!e||!n||!r)){if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function ju(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function E5(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Zi(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function O5(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function br(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function M5(t,e){try{let n=t.sessionStorage.getItem(gv);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&e.set(s,new Set(i||[]))}}catch{}}function A5(t,e){if(e.size>0){let n={};for(let[r,s]of e)n[r]=[...s];try{t.sessionStorage.setItem(gv,JSON.stringify(n))}catch(r){qe(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function yg(){let t,e,n=new Promise((r,s)=>{t=async i=>{r(i);try{await n}catch{}},e=async i=>{s(i);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var Is=g.createContext(null);Is.displayName="DataRouter";var tl=g.createContext(null);tl.displayName="DataRouterState";var Cv=g.createContext(!1);function T5(){return g.useContext(Cv)}var vp=g.createContext({isTransitioning:!1});vp.displayName="ViewTransition";var jv=g.createContext(new Map);jv.displayName="Fetchers";var L5=g.createContext(null);L5.displayName="Await";var ln=g.createContext(null);ln.displayName="Navigation";var Bd=g.createContext(null);Bd.displayName="Location";var Nn=g.createContext({outlet:null,matches:[],isDataRoute:!1});Nn.displayName="Route";var wp=g.createContext(null);wp.displayName="RouteError";var Nv="REACT_ROUTER_ERROR",R5="REDIRECT",I5="ROUTE_ERROR_RESPONSE";function $5(t){if(t.startsWith(`${Nv}:${R5}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function B5(t){if(t.startsWith(`${Nv}:${I5}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new Za(e.status,e.statusText,e.data)}catch{}}function _5(t,{relative:e}={}){Pe(Ii(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=g.useContext(ln),{hash:s,pathname:i,search:o}=rl(t,{relative:e}),a=i;return n!=="/"&&(a=i==="/"?n:nr([n,i])),r.createHref({pathname:a,search:o,hash:s})}function Ii(){return g.useContext(Bd)!=null}function _n(){return Pe(Ii(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(Bd).location}var Pv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Dv(t){g.useContext(ln).static||g.useLayoutEffect(t)}function Lt(){let{isDataRoute:t}=g.useContext(Nn);return t?e3():F5()}function F5(){Pe(Ii(),"useNavigate() may be used only in the context of a <Router> component.");let t=g.useContext(Is),{basename:e,navigator:n}=g.useContext(ln),{matches:r}=g.useContext(Nn),{pathname:s}=_n(),i=JSON.stringify(Id(r)),o=g.useRef(!1);return Dv(()=>{o.current=!0}),g.useCallback((l,d={})=>{if(qe(o.current,Pv),!o.current)return;if(typeof l=="number"){n.go(l);return}let u=$d(l,JSON.parse(i),s,d.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:nr([e,u.pathname])),(d.replace?n.replace:n.push)(u,d.state,d)},[e,n,i,s,t])}var Ev=g.createContext(null);function z5(){return g.useContext(Ev)}function H5(t){let e=g.useContext(Nn).outlet;return g.useMemo(()=>e&&g.createElement(Ev.Provider,{value:t},e),[e,t])}function nl(){let{matches:t}=g.useContext(Nn),e=t[t.length-1];return e?e.params:{}}function rl(t,{relative:e}={}){let{matches:n}=g.useContext(Nn),{pathname:r}=_n(),s=JSON.stringify(Id(n));return g.useMemo(()=>$d(t,JSON.parse(s),r,e==="path"),[t,s,r,e])}function V5(t,e,n,r,s){Pe(Ii(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=g.useContext(ln),{matches:o}=g.useContext(Nn),a=o[o.length-1],l=a?a.params:{},d=a?a.pathname:"/",u=a?a.pathnameBase:"/",h=a&&a.route;{let w=h&&h.path||"";Mv(d,!h||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
20
20
|
|
|
21
|
-
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let f=_n(),p;p=f;let m=p.pathname||"/",x=m;if(u!=="/"){let w=u.replace(/^\//,"").split("/");x="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let b=Br(t,{pathname:x});return qe(h||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),qe(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),q5(b&&b.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:nr([u,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:nr([u,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),o,n,r,s)}function W5(){let t=Z5(),e=$o(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:i},"ErrorBoundary")," or"," ",g.createElement("code",{style:i},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},e),n?g.createElement("pre",{style:s},n):null,o)}var K5=g.createElement(W5,null),Ov=class extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=B5(t.digest);n&&(t=n)}let e=t!==void 0?g.createElement(Nn.Provider,{value:this.props.routeContext},g.createElement(wp.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?g.createElement(U5,{error:t},e):e}};Ov.contextType=Cv;var Nu=new WeakMap;function U5({children:t,error:e}){let{basename:n}=g.useContext(ln);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=$5(e.digest);if(r){let s=Nu.get(e);if(s)throw s;let i=hv(r.location,n);if(uv&&!Nu.get(e))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw Nu.set(e,o),o}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function G5({routeContext:t,match:e,children:n}){let r=g.useContext(Is);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),g.createElement(Nn.Provider,{value:t},n)}function q5(t,e=[],n=null,r=null,s=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,o=n?.errors;if(o!=null){let u=i.findIndex(h=>h.route.id&&o?.[h.route.id]!==void 0);Pe(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let a=!1,l=-1;if(n)for(let u=0;u<i.length;u++){let h=i[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=u),h.route.id){let{loaderData:f,errors:p}=n,m=h.route.loader&&!f.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||m){a=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}let d=n&&r?(u,h)=>{r(u,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:el(n.matches),errorInfo:h})}:void 0;return i.reduceRight((u,h,f)=>{let p,m=!1,x=null,b=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,x=h.route.errorElement||K5,a&&(l<0&&f===0?(Mv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,b=null):l===f&&(m=!0,b=h.route.hydrateFallbackElement||null)));let y=e.concat(i.slice(0,f+1)),w=()=>{let v;return p?v=x:m?v=b:h.route.Component?v=g.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=u,g.createElement(G5,{match:h,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?g.createElement(Ov,{location:n.location,revalidation:n.revalidation,component:x,error:p,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:d}):w()},null)}function kp(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y5(t){let e=g.useContext(Is);return Pe(e,kp(t)),e}function X5(t){let e=g.useContext(tl);return Pe(e,kp(t)),e}function Q5(t){let e=g.useContext(Nn);return Pe(e,kp(t)),e}function Sp(t){let e=Q5(t),n=e.matches[e.matches.length-1];return Pe(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function J5(){return Sp("useRouteId")}function Z5(){let t=g.useContext(wp),e=X5("useRouteError"),n=Sp("useRouteError");return t!==void 0?t:e.errors?.[n]}function e3(){let{router:t}=Y5("useNavigate"),e=Sp("useNavigate"),n=g.useRef(!1);return Dv(()=>{n.current=!0}),g.useCallback(async(s,i={})=>{qe(n.current,Pv),n.current&&(typeof s=="number"?await t.navigate(s):await t.navigate(s,{fromRouteId:e,...i}))},[t,e])}var vg={};function Mv(t,e,n){!e&&!vg[t]&&(vg[t]=!0,qe(!1,n))}var wg={};function kg(t,e){!t&&!wg[e]&&(wg[e]=!0,console.warn(e))}var t3="useOptimistic",Sg=pj[t3],n3=()=>{};function r3(t){return Sg?Sg(t):[t,n3]}function s3(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&qe(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:g.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&qe(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:g.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&qe(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:g.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var i3=["HydrateFallback","hydrateFallbackElement"],o3=class{constructor(){this.status="pending",this.promise=new Promise((t,e)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",e(n))}})}};function a3({router:t,flushSync:e,onError:n,unstable_useTransitions:r}){r=T5()||r;let[i,o]=g.useState(t.state),[a,l]=r3(i),[d,u]=g.useState(),[h,f]=g.useState({isTransitioning:!1}),[p,m]=g.useState(),[x,b]=g.useState(),[y,w]=g.useState(),v=g.useRef(new Map),k=g.useCallback((D,{deletedFetchers:E,newErrors:M,flushSync:P,viewTransitionOpts:A})=>{M&&n&&Object.values(M).forEach(j=>n(j,{location:D.location,params:D.matches[0]?.params??{},unstable_pattern:el(D.matches)})),D.fetchers.forEach((j,O)=>{j.data!==void 0&&v.current.set(O,j.data)}),E.forEach(j=>v.current.delete(j)),kg(P===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let R=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(kg(A==null||R,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!A||!R){e&&P?e(()=>o(D)):r===!1?o(D):g.startTransition(()=>{r===!0&&l(j=>Cg(j,D)),o(D)});return}if(e&&P){e(()=>{x&&(p?.resolve(),x.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:A.currentLocation,nextLocation:A.nextLocation})});let j=t.window.document.startViewTransition(()=>{e(()=>o(D))});j.finished.finally(()=>{e(()=>{m(void 0),b(void 0),u(void 0),f({isTransitioning:!1})})}),e(()=>b(j));return}x?(p?.resolve(),x.skipTransition(),w({state:D,currentLocation:A.currentLocation,nextLocation:A.nextLocation})):(u(D),f({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}))},[t.window,e,x,p,r,l,n]);g.useLayoutEffect(()=>t.subscribe(k),[t,k]),g.useEffect(()=>{h.isTransitioning&&!h.flushSync&&m(new o3)},[h]),g.useEffect(()=>{if(p&&d&&t.window){let D=d,E=p.promise,M=t.window.document.startViewTransition(async()=>{r===!1?o(D):g.startTransition(()=>{r===!0&&l(P=>Cg(P,D)),o(D)}),await E});M.finished.finally(()=>{m(void 0),b(void 0),u(void 0),f({isTransitioning:!1})}),b(M)}},[d,p,t.window,r,l]),g.useEffect(()=>{p&&d&&a.location.key===d.location.key&&p.resolve()},[p,x,a.location,d]),g.useEffect(()=>{!h.isTransitioning&&y&&(u(y.state),f({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),w(void 0))},[h.isTransitioning,y]);let C=g.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:D=>t.navigate(D),push:(D,E,M)=>t.navigate(D,{state:E,preventScrollReset:M?.preventScrollReset}),replace:(D,E,M)=>t.navigate(D,{replace:!0,state:E,preventScrollReset:M?.preventScrollReset})}),[t]),N=t.basename||"/",S=g.useMemo(()=>({router:t,navigator:C,static:!1,basename:N,onError:n}),[t,C,N,n]);return g.createElement(g.Fragment,null,g.createElement(Is.Provider,{value:S},g.createElement(tl.Provider,{value:a},g.createElement(jv.Provider,{value:v.current},g.createElement(vp.Provider,{value:h},g.createElement(u3,{basename:N,location:a.location,navigationType:a.historyAction,navigator:C,unstable_useTransitions:r},g.createElement(l3,{routes:t.routes,future:t.future,state:a,onError:n})))))),null)}function Cg(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var l3=g.memo(c3);function c3({routes:t,future:e,state:n,onError:r}){return V5(t,void 0,n,r,e)}function Av({to:t,replace:e,state:n,relative:r}){Pe(Ii(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=g.useContext(ln);qe(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=g.useContext(Nn),{pathname:o}=_n(),a=Lt(),l=$d(t,Id(i),o,r==="path"),d=JSON.stringify(l);return g.useEffect(()=>{a(JSON.parse(d),{replace:e,state:n,relative:r})},[a,d,r,e,n]),null}function d3(t){return H5(t.context)}function u3({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:o}){Pe(!Ii(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=g.useMemo(()=>({basename:a,navigator:s,static:i,unstable_useTransitions:o,future:{}}),[a,s,i,o]);typeof n=="string"&&(n=ns(n));let{pathname:d="/",search:u="",hash:h="",state:f=null,key:p="default"}=n,m=g.useMemo(()=>{let x=Cn(d,a);return x==null?null:{location:{pathname:x,search:u,hash:h,state:f,key:p},navigationType:r}},[a,d,u,h,f,p,r]);return qe(m!=null,`<Router basename="${a}"> is not able to match the URL "${d}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:g.createElement(ln.Provider,{value:l},g.createElement(Bd.Provider,{children:e,value:m}))}var vc="get",wc="application/x-www-form-urlencoded";function _d(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function h3(t){return _d(t)&&t.tagName.toLowerCase()==="button"}function f3(t){return _d(t)&&t.tagName.toLowerCase()==="form"}function p3(t){return _d(t)&&t.tagName.toLowerCase()==="input"}function m3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function g3(t,e){return t.button===0&&(!e||e==="_self")&&!m3(t)}function Xh(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function x3(t,e){let n=Xh(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}var Tl=null;function b3(){if(Tl===null)try{new FormData(document.createElement("form"),0),Tl=!1}catch{Tl=!0}return Tl}var y3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pu(t){return t!=null&&!y3.has(t)?(qe(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wc}"`),null):t}function v3(t,e){let n,r,s,i,o;if(f3(t)){let a=t.getAttribute("action");r=a?Cn(a,e):null,n=t.getAttribute("method")||vc,s=Pu(t.getAttribute("enctype"))||wc,i=new FormData(t)}else if(h3(t)||p3(t)&&(t.type==="submit"||t.type==="image")){let a=t.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=t.getAttribute("formaction")||a.getAttribute("action");if(r=l?Cn(l,e):null,n=t.getAttribute("formmethod")||a.getAttribute("method")||vc,s=Pu(t.getAttribute("formenctype"))||Pu(a.getAttribute("enctype"))||wc,i=new FormData(a,t),!b3()){let{name:d,type:u,value:h}=t;if(u==="image"){let f=d?`${d}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}else d&&i.append(d,h)}}else{if(_d(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=vc,r=null,s=wc,o=t}return i&&s==="text/plain"&&(o=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cp(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function w3(t,e,n){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname=`_root.${n}`:e&&Cn(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function k3(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function S3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function C3(t,e,n){let r=await Promise.all(t.map(async s=>{let i=e.routes[s.route.id];if(i){let o=await k3(i,n);return o.links?o.links():[]}return[]}));return D3(r.flat(1).filter(S3).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function jg(t,e,n,r,s,i){let o=(l,d)=>n[d]?l.route.id!==n[d].route.id:!0,a=(l,d)=>n[d].pathname!==l.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==l.params["*"];return i==="assets"?e.filter((l,d)=>o(l,d)||a(l,d)):i==="data"?e.filter((l,d)=>{let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(o(l,d)||a(l,d))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function j3(t,e,{includeHydrateFallback:n}={}){return N3(t.map(r=>{let s=e.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function N3(t){return[...new Set(t)]}function P3(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function D3(t,e){let n=new Set;return new Set(e),t.reduce((r,s)=>{let i=JSON.stringify(P3(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function Tv(){let t=g.useContext(Is);return Cp(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function E3(){let t=g.useContext(tl);return Cp(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var jp=g.createContext(void 0);jp.displayName="FrameworkContext";function Lv(){let t=g.useContext(jp);return Cp(t,"You must render this element inside a <HydratedRouter> element"),t}function O3(t,e){let n=g.useContext(jp),[r,s]=g.useState(!1),[i,o]=g.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:d,onMouseLeave:u,onTouchStart:h}=e,f=g.useRef(null);g.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let x=y=>{y.forEach(w=>{o(w.isIntersecting)})},b=new IntersectionObserver(x,{threshold:.5});return f.current&&b.observe(f.current),()=>{b.disconnect()}}},[t]),g.useEffect(()=>{if(r){let x=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(x)}}},[r]);let p=()=>{s(!0)},m=()=>{s(!1),o(!1)};return n?t!=="intent"?[i,f,{}]:[i,f,{onFocus:eo(a,p),onBlur:eo(l,m),onMouseEnter:eo(d,p),onMouseLeave:eo(u,m),onTouchStart:eo(h,p)}]:[!1,f,{}]}function eo(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function M3({page:t,...e}){let{router:n}=Tv(),r=g.useMemo(()=>Br(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?g.createElement(T3,{page:t,matches:r,...e}):null}function A3(t){let{manifest:e,routeModules:n}=Lv(),[r,s]=g.useState([]);return g.useEffect(()=>{let i=!1;return C3(t,e,n).then(o=>{i||s(o)}),()=>{i=!0}},[t,e,n]),r}function T3({page:t,matches:e,...n}){let r=_n(),{manifest:s,routeModules:i}=Lv(),{basename:o}=Tv(),{loaderData:a,matches:l}=E3(),d=g.useMemo(()=>jg(t,e,l,s,r,"data"),[t,e,l,s,r]),u=g.useMemo(()=>jg(t,e,l,s,r,"assets"),[t,e,l,s,r]),h=g.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let m=new Set,x=!1;if(e.forEach(y=>{let w=s.routes[y.route.id];!w||!w.hasLoader||(!d.some(v=>v.route.id===y.route.id)&&y.route.id in a&&i[y.route.id]?.shouldRevalidate||w.hasClientLoader?x=!0:m.add(y.route.id))}),m.size===0)return[];let b=w3(t,o,"data");return x&&m.size>0&&b.searchParams.set("_routes",e.filter(y=>m.has(y.route.id)).map(y=>y.route.id).join(",")),[b.pathname+b.search]},[o,a,r,s,d,e,t,i]),f=g.useMemo(()=>j3(u,s),[u,s]),p=A3(u);return g.createElement(g.Fragment,null,h.map(m=>g.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...n})),f.map(m=>g.createElement("link",{key:m,rel:"modulepreload",href:m,...n})),p.map(({key:m,link:x})=>g.createElement("link",{key:m,nonce:n.nonce,...x})))}function L3(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var R3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{R3&&(window.__reactRouterVersion="7.11.0")}catch{}function I3(t,e){return l5({basename:e?.basename,getContext:e?.getContext,future:e?.future,history:Cj({window:e?.window}),hydrationData:$3(),routes:t,mapRouteProperties:s3,hydrationRouteProperties:i3,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window,unstable_instrumentations:e?.unstable_instrumentations}).initialize()}function $3(){let t=window?.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:B3(t.errors)}),t}function B3(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,s]of e)if(s&&s.__type==="RouteErrorResponse")n[r]=new Za(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}var Rv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Iv=g.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:o,state:a,target:l,to:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},m){let{basename:x,unstable_useTransitions:b}=g.useContext(ln),y=typeof d=="string"&&Rv.test(d),w=hv(d,x);d=w.to;let v=_5(d,{relative:s}),[k,C,N]=O3(r,p),S=H3(d,{replace:o,state:a,target:l,preventScrollReset:u,relative:s,viewTransition:h,unstable_defaultShouldRevalidate:f,unstable_useTransitions:b});function D(M){e&&e(M),M.defaultPrevented||S(M)}let E=g.createElement("a",{...p,...N,href:w.absoluteURL||v,onClick:w.isExternal||i?e:D,ref:L3(m,C),target:l,"data-discover":!y&&n==="render"?"true":void 0});return k&&!y?g.createElement(g.Fragment,null,E,g.createElement(M3,{page:v})):E});Iv.displayName="Link";var _3=g.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:o,viewTransition:a,children:l,...d},u){let h=rl(o,{relative:d.relative}),f=_n(),p=g.useContext(tl),{navigator:m,basename:x}=g.useContext(ln),b=p!=null&&G3(h)&&a===!0,y=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,w=f.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(w=w.toLowerCase(),v=v?v.toLowerCase():null,y=y.toLowerCase()),v&&x&&(v=Cn(v,x)||v);const k=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let C=w===y||!s&&w.startsWith(y)&&w.charAt(k)==="/",N=v!=null&&(v===y||!s&&v.startsWith(y)&&v.charAt(y.length)==="/"),S={isActive:C,isPending:N,isTransitioning:b},D=C?e:void 0,E;typeof r=="function"?E=r(S):E=[r,C?"active":null,N?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(S):i;return g.createElement(Iv,{...d,"aria-current":D,className:E,ref:u,style:M,to:o,viewTransition:a},typeof l=="function"?l(S):l)});_3.displayName="NavLink";var F3=g.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:s,state:i,method:o=vc,action:a,onSubmit:l,relative:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:x}=g.useContext(ln),b=K3(),y=U3(a,{relative:d}),w=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&Rv.test(a),k=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let N=C.nativeEvent.submitter,S=N?.getAttribute("formmethod")||o,D=()=>b(N||C.currentTarget,{fetcherKey:e,method:S,navigate:n,replace:s,state:i,relative:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f});x&&n!==!1?g.startTransition(()=>D()):D()};return g.createElement("form",{ref:m,method:w,action:y,onSubmit:r?l:k,...p,"data-discover":!v&&t==="render"?"true":void 0})});F3.displayName="Form";function z3(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $v(t){let e=g.useContext(Is);return Pe(e,z3(t)),e}function H3(t,{target:e,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a,unstable_useTransitions:l}={}){let d=Lt(),u=_n(),h=rl(t,{relative:i});return g.useCallback(f=>{if(g3(f,e)){f.preventDefault();let p=n!==void 0?n:ir(u)===ir(h),m=()=>d(t,{replace:p,state:r,preventScrollReset:s,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a});l?g.startTransition(()=>m()):m()}},[u,d,h,n,r,e,t,s,i,o,a,l])}function sl(t){qe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=g.useRef(Xh(t)),n=g.useRef(!1),r=_n(),s=g.useMemo(()=>x3(r.search,n.current?null:e.current),[r.search]),i=Lt(),o=g.useCallback((a,l)=>{const d=Xh(typeof a=="function"?a(new URLSearchParams(s)):a);n.current=!0,i("?"+d,l)},[i,s]);return[s,o]}var V3=0,W3=()=>`__${String(++V3)}__`;function K3(){let{router:t}=$v("useSubmit"),{basename:e}=g.useContext(ln),n=J5(),r=t.fetch,s=t.navigate;return g.useCallback(async(i,o={})=>{let{action:a,method:l,encType:d,formData:u,body:h}=v3(i,e);if(o.navigate===!1){let f=o.fetcherKey||W3();await r(f,n,o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||l,formEncType:o.encType||d,flushSync:o.flushSync})}else await s(o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||l,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,s,e,n])}function U3(t,{relative:e}={}){let{basename:n}=g.useContext(ln),r=g.useContext(Nn);Pe(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...rl(t||".",{relative:e})},o=_n();if(t==null){i.search=o.search;let a=new URLSearchParams(i.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(h=>h).forEach(h=>a.append("index",h));let u=a.toString();i.search=u?`?${u}`:""}}return(!t||t===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:nr([n,i.pathname])),ir(i)}function G3(t,{relative:e}={}){let n=g.useContext(vp);Pe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=$v("useViewTransitionState"),s=rl(t,{relative:e});if(!n.isTransitioning)return!1;let i=Cn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Cn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _c(s.pathname,o)!=null||_c(s.pathname,i)!=null}function q3(t){return g.createElement(a3,{flushSync:bs.flushSync,...t})}const Y3={en:{loading:"Loading...",error:"Error",selectProject:"Select a project to view dashboard",controlCenter:"Control Center",settings:"Settings",sync:"Sync",offline:"Offline",switchToLight:"Switch to light mode",switchToDark:"Switch to dark mode",settingsSection:"Settings",overviewSection:"Overview",entitiesSection:"Entities",toolsSection:"Tools",configEditor:"Config Editor",projects:"Projects",addProject:"Add Project",global:"Global",skills:"Skills",skillsNav:"Skills",health:"Health",collapse:"Collapse",expand:"Expand",installing:"Installing...",manage:"Manage",uninstall:"Uninstall",installGlobally:"Install Globally",installGloballyDesc:"Available to all projects instead of current project only",selectAtLeastOneAgent:"Please select at least one agent",installationFailed:"Installation failed",allSkills:"All Skills",refresh:"Refresh",browseAndManageSkills:"Browse and manage skills for your agents",detected:"Detected",notDetected:"Not detected",sessions:"sessions",noSessions:"No sessions",terminal:"Terminal",terminalSub:"Open bash at path",editor:"Editor",editorSub:"Open in VS Code",useGlobalFallback:"Use global fallback",openAtPath:"Open at project path",openAppOnly:"Open app only",actionOptionsLoadFailed:"Could not load editor/terminal options",launch:"Launch",launchSub:"Start Claude Code",config:"Config",configSub:"Manage project settings",recentSessions:"Recent Sessions",viewAllHistory:"View All History",showLess:"Show Less",actionFailed:"Action failed",loadingSessions:"Loading sessions...",noSessionsFound:"No sessions found",configuration:"Claude Settings",planSettingsTitle:"Plan Settings",activeKit:"Active Kit",aiModel:"Model",hooks:"Hooks",active:"active",mcpServers:"MCP Servers",connected:"connected",plansDirectory:"Plans Directory",validationMode:"Validation Mode",planScopeLabel:"Scope",planScopeProject:"project",planScopeGlobal:"global",activePlansLabel:"Active Plans",activePlansTitle:"Active Plans",noActivePlansFound:"No active plans found",openPlan:"Open Plan",openKanban:"Open Kanban",blockedByLabel:"Blocked by",progressLabel:"Progress",editProjectConfig:"Edit Project Config",projectPreferenceSaveFailed:"Failed to save preference",globalSettings:"(Global)",globalSkills:"Global Skills",loadingSkills:"Loading skills...",noDescription:"No description",browseSkillsMarketplace:"Browse Skills Marketplace",backToDashboard:"Back to Dashboard",educationalConfigEditor:"Educational Config Editor",discard:"Discard",saveChanges:"Save Changes",mergedView:"Merged View",localConfig:"Local (.ck.json)",globalConfig:"Global",syntaxValid:"Syntax Valid",configurationHelp:"Configuration Help",field:"Field",type:"Type",default:"Default",description:"Description",validValues:"Valid Values",systemEffect:"System Effect",exampleUsage:"Example Usage",knowledgeBase:"Knowledge Base",clickToSeeHelp:"Click on any configuration field to see detailed documentation and usage examples.",extractedFrom:"Extracted from ClaudeKit v2.x Specification",resetToDefault:"Reset",saving:"Saving...",saved:"Saved",confirmReset:"Reset to Default?",confirmResetMessage:"All changes will be lost and replaced with default values.",confirm:"Confirm",saveFailed:"Save failed",configTab:"Config",systemTab:"System",formTab:"Form",jsonTab:"JSON",readOnly:"Read-only",installedKit:"Installed Kit",kitVersion:"Kit Version",installedOn:"Installed On",noKitInstalled:"No kit installed",components:"Components",agents:"Agents",commands:"Commands",workflows:"Workflows",kitSkills:"Skills",fileOwnership:"File Ownership",ownershipCk:"kit-managed",ownershipUser:"user-owned",ownershipModified:"modified",componentInventory:"Component Inventory",installedHooks:"Installed Hooks",installedMcpServers:"MCP Servers",lastChecked:"Last update check",staleIndicator:"Stale",skippedVersion:"Skipped",filesModifiedFromDefaults:"files modified from kit defaults",cliCard:"ClaudeKit CLI",checkForUpdates:"Check for Updates",checking:"Checking...",upToDate:"Up to date",updateAvailable:"Update available",updateNow:"Update Now",updating:"Updating...",updateSuccess:"Update Complete!",updateFailed:"Update Failed",closeModal:"Close",showDetails:"Show Details",hideDetails:"Hide Details",environment:"Environment",claudeConfigPath:"Claude config",nodeVersion:"Node",bunVersion:"Bun",osVersion:"OS",envShell:"Shell",envHomeDir:"Home",envCpuCores:"CPU Cores",envTotalMemory:"Memory",cliPackageManager:"Package Manager",cliInstallLocation:"Install Location",cliGitVersion:"Git",cliGhVersion:"GitHub CLI",channelStable:"Stable",channelBeta:"Beta",betaBadge:"Beta",latestVersion:"Latest",selectVersion:"Select version",loadingVersions:"Loading versions...",prereleaseLabel:"Pre",currentVersionLabel:"Current",checkAll:"Check All",checkingAll:"Checking...",updateAll:"Update All",updatesAvailable:"{count} updates available",allUpToDate:"All up to date",systemControlTower:"System Control Tower",systemOverviewTitle:"Update & Runtime Overview",systemOverviewDesc:"Track CLI and kit health, then run upgrades from one place.",installedComponentsHeading:"Installed Components",updateReadiness:"Update Readiness",checkedComponents:"Checked",activeChannel:"Channel",readyToScan:"Ready to scan",noTrackedFiles:"No tracked files detected",kitsLabel:"Kits",componentFilterAll:"All",componentFilterUpdates:"Updates",componentFilterUpdatesCount:"Updates ({count})",componentFilterUpToDate:"Up to date",componentFilterUpToDateCount:"Up to date ({count})",componentFilterCli:"CLI",componentFilterKits:"Kits",noComponentsMatchFilter:"No components match the current filter.",runCheckAllForFilter:"Run Check All to populate this filter.",noUpdatesFound:"No updates found. Checked components are up to date.",noUpToDateYet:"No components are up to date yet.",configWorkspaceHint:"Edit configuration or manage system updates from one workspace.",settingsJsonHeading:"Claude Settings JSON",settingsJsonMissing:"No settings file found at ~/.claude/settings.json.",settingsJsonLoadFailed:"Failed to load ~/.claude/settings.json.",settingsLoadFailedDetail:"Error detail:",configLoadFailed:"Failed to load configuration.",configLoadFailedDetail:"Error detail:",settingsBackupSaved:"Backup saved",hookDiagnosticsTitle:"Hook Diagnostics",hookDiagnosticsDesc:"Inspect recent hook activity and failures without opening JSONL files manually.",hookDiagnosticsPathPending:"Resolving log path...",hookDiagnosticsScopeGlobal:"Global hooks",hookDiagnosticsEntries:"Entries",hookDiagnosticsCrashes:"Crashes",hookDiagnosticsWarnings:"Warnings",hookDiagnosticsBlocks:"Blocks",hookDiagnosticsLastEvent:"Last event",hookDiagnosticsLoading:"Loading hook diagnostics...",hookDiagnosticsLoadFailed:"Failed to load hook diagnostics",hookDiagnosticsMissing:"No hook log file found for this scope yet.",hookDiagnosticsEmpty:"Hook log is present but contains no readable entries.",hookDiagnosticsParseErrorsNotice:"Skipped {count} malformed log line(s) while loading diagnostics.",hookDiagnosticsTruncatedNotice:"Showing a bounded recent window to keep diagnostics responsive on large logs.",hookDiagnosticsToolLabel:"tool",hookDiagnosticsTargetLabel:"target",hookDiagnosticsUnknown:"Unknown",hookDiagnostics:"Hook Diagnostics",hookEvent:"Event",hookExecutions:"Executions",hookAvgLatency:"Avg Latency",hookFailureRate:"Failure Rate",hookLastRun:"Last Run",hookLatencyWarning:"Latency > 500ms",activityMetrics:"Activity",activityTotalSessions:"Total Sessions",activityMostActive:"Most Active Projects",activityPeriod24h:"24h",activityPeriod7d:"7d",activityPeriod30d:"30d",activityNoData:"No activity data",addProjectTitle:"Add Project",addProjectDescription:"Add a new ClaudeKit project to the control center",projectPath:"Project Path",pathPlaceholder:"/path/to/project",alias:"Alias",aliasOptional:"(optional)",aliasPlaceholder:"my-project",aliasDescription:"Custom display name for the project",pathRequired:"Path is required",failedToAdd:"Failed to add project",cancel:"Cancel",adding:"Adding...",somethingWentWrong:"Something went wrong",reloadApp:"Reload App",serverNotRunning:"Server Not Running",startServerMessage:"The Config UI requires the backend server to be running.",runThisCommand:"Run this command",tryAgain:"Try Again",projectConfig:"Project Config",inheritedFromGlobal:"Inherited from Global",localOverride:"Local Override",viewGlobalConfig:"This field inherits from global config. View",onboardingTitle:"Welcome to ClaudeKit",onboardingSubtitle:"Choose your kit and get started in minutes",kitEngineerName:"ClaudeKit Engineer",kitEngineerTagline:"AI-powered coding with skills, hooks, and multi-agent workflows",kitMarketingName:"ClaudeKit Marketing",kitMarketingTagline:"Content automation: campaigns, social media, analytics",featureAgents:"AI Agents",featureAgentsDesc:"Specialized agents for different tasks",featureHooks:"Lifecycle Hooks",featureHooksDesc:"Customize Claude's behavior at key moments",featureSkills:"Skills Library",featureSkillsDesc:"Pre-built capabilities you can activate",featureMultiAgent:"Multi-Agent Workflows",featureMultiAgentDesc:"Coordinate multiple agents for complex tasks",featureContent:"Content Generation",featureContentDesc:"Automated content creation and optimization",featureSocial:"Social Media Tools",featureSocialDesc:"Scheduling, analytics, and engagement automation",stepChooseKit:"Choose Kit",stepConfigure:"Configure",stepInstall:"Install",back:"Back",next:"Next",install:"Install",installSuccess:"Installation Complete!",installSuccessDesc:"{kit} is ready to use",getStarted:"Get Started",goToDashboard:"Go to Dashboard",kitConfig:"Kit Config",kitConfigSubtitle:"Configure ClaudeKit Engineer settings",scopeGlobal:"Global",scopeProject:"Project",sectionGeneral:"General",sectionPaths:"Paths",sectionPrivacy:"Privacy & Trust",sectionProject:"Project Detection",sectionIntegrations:"Integrations",sectionHooks:"Hooks",sectionAdvanced:"Advanced",fieldCodingLevel:"Coding Level",fieldCodingLevelDesc:"Your coding experience level (-1=auto, 0=beginner, 1=intermediate, 2=advanced, 3=expert, 4=tech-lead, 5=god-mode)",fieldStatusline:"Statusline Mode",fieldStatuslineDesc:"How much info to show in the status line",fieldStatuslineColors:"Statusline Colors",fieldStatuslineColorsDesc:"Enable ANSI color output in the statusline",fieldStatuslineQuota:"Statusline Quota Display",fieldStatuslineQuotaDesc:"Show the 5h / wk quota chips in the statusline",fieldThinkingLanguage:"Thinking Language",fieldThinkingLanguageDesc:"Language for Claude's internal reasoning (null=English)",fieldResponseLanguage:"Response Language",fieldResponseLanguageDesc:"Language for Claude's responses (null=match user)",fieldDocsPath:"Docs Directory",fieldDocsPathDesc:"Path to documentation directory",fieldPlansPath:"Plans Directory",fieldPlansPathDesc:"Path to plans directory",fieldGlobalPlansPath:"Global Plans Directory",fieldGlobalPlansPathDesc:"Path to global plans directory",fieldPrivacyBlock:"Privacy Block",fieldPrivacyBlockDesc:"Block access to sensitive files (.env, credentials)",fieldTrustEnabled:"Trust Mode",fieldTrustEnabledDesc:"Enable auto-approval for tool calls",fieldTrustPassphrase:"Trust Passphrase",fieldTrustPassphraseDesc:"Passphrase to enable trust mode",fieldProjectType:"Project Type",fieldProjectTypeDesc:"Override auto-detected project type",fieldPackageManager:"Package Manager",fieldPackageManagerDesc:"Override auto-detected package manager",fieldFramework:"Framework",fieldFrameworkDesc:"Override auto-detected framework",fieldGeminiModel:"Gemini Model",fieldGeminiModelDesc:"Gemini model for CLI commands; legacy gemini-3.0-* ids auto-map",geminiModel25Flash:"Gemini 2.5 Flash — All tiers",geminiModel25Pro:"Gemini 2.5 Pro — May hit capacity limits",geminiModel3FlashPreview:"Gemini 3 Flash Preview — Pro/Ultra only",geminiModel3ProPreview:"Gemini 3 Pro Preview — Pro/Ultra only",fieldResearchUseGemini:"Use Gemini for Research",fieldResearchUseGeminiDesc:"Use Gemini CLI instead of WebSearch",fieldDocsMaxLoc:"Max Lines per Doc",fieldDocsMaxLocDesc:"Maximum lines of code per documentation file",fieldPlanNamingFormat:"Plan Naming Format",fieldPlanNamingFormatDesc:"Format for plan directory names",fieldPlanDateFormat:"Plan Date Format",fieldPlanDateFormatDesc:"Date format for plan names (moment.js)",fieldPlanValidationMode:"Validation Mode",fieldPlanValidationModeDesc:"How to validate plans before implementation",fieldPlanMinQuestions:"Min Questions",fieldPlanMinQuestionsDesc:"Minimum validation questions",fieldPlanMaxQuestions:"Max Questions",fieldPlanMaxQuestionsDesc:"Maximum validation questions",fieldAssertions:"Assertions",fieldAssertionsDesc:"Code assertions and rules to enforce",fieldHookSessionInit:"Session Init",fieldHookSessionInitDesc:"Project detection and environment setup",fieldHookSubagentInit:"Subagent Init",fieldHookSubagentInitDesc:"Inject context to subagents",fieldHookDescriptiveName:"Descriptive Name",fieldHookDescriptiveNameDesc:"Enforce kebab-case descriptive file naming for scripts",fieldHookDevRulesReminder:"Dev Rules Reminder",fieldHookDevRulesReminderDesc:"Inject development rules context",fieldHookUsageContextAwareness:"Usage Prompt Awareness",fieldHookUsageContextAwarenessDesc:"Inject usage-limit awareness into prompts",fieldHookContextTracking:"Context Tracking",fieldHookContextTrackingDesc:"Context window tracking (% used, token counts)",fieldHookScoutBlock:"Scout Block",fieldHookScoutBlockDesc:"Block heavy directories from exploration",fieldHookPrivacyBlock:"Privacy Block Hook",fieldHookPrivacyBlockDesc:"Block sensitive files from reading",fieldHookSimplifyGate:"Simplify Gate",fieldHookSimplifyGateDesc:"UserPromptSubmit hook — opt-in. When enabled (simplify.gate.enabled=true), hard-blocks ship/merge/pr/deploy/publish and soft-warns commit/finalize/release when live diff exceeds thresholds.",sectionSimplify:"Simplify Gate",fieldSimplifyThresholdLocDelta:"Total LOC threshold",fieldSimplifyThresholdLocDeltaDesc:"Total LOC change (across all files) above which the gate fires.",fieldSimplifyThresholdFileCount:"File count threshold",fieldSimplifyThresholdFileCountDesc:"Number of changed files above which the gate fires.",fieldSimplifyThresholdSingleFileLoc:"Per-file LOC threshold",fieldSimplifyThresholdSingleFileLocDesc:"Per-file LOC change above which the gate fires.",fieldSimplifyGateEnabled:"Enabled",fieldSimplifyGateEnabledDesc:"Master toggle. Off by default (opt-in). Enable to activate the gate; env CK_SIMPLIFY_DISABLED=1 always bypasses.",fieldSimplifyGateHardVerbs:"Hard-block verbs",fieldSimplifyGateHardVerbsDesc:"Verbs that hard-block when thresholds breached.",fieldSimplifyGateSoftVerbs:"Soft-warn verbs",fieldSimplifyGateSoftVerbsDesc:"Verbs that emit a non-blocking warning.",sectionUpdatePipeline:"Update Pipeline",fieldAutoInitAfterUpdate:"Auto Init After Update",fieldAutoInitAfterUpdateDesc:"Automatically run ck init after ck update when kit has new version",fieldAutoMigrateAfterUpdate:"Auto Migrate After Update",fieldAutoMigrateAfterUpdateDesc:"Automatically run ck migrate after ck update (independent of init)",fieldMigrateProviders:"Migrate Providers",fieldMigrateProvidersDesc:"Which providers to auto-migrate. Use 'auto' to scan filesystem or a comma-separated list.",skillsPageTitle:"Skills Management",skillsPageDesc:"Install ClaudeKit skills to your coding agents",availableSkills:"Available Skills",installedSkills:"Installed Skills",noSkillsFound:"No skills found",installSkill:"Install",uninstallSkill:"Uninstall",manageSkill:"Manage",syncRegistry:"Sync",installSkillTitle:"Install Skill",selectAgents:"Select target agents",installLocation:"Installation location",globalInstall:"Global",projectInstall:"Project",confirmInstall:"Install to selected agents",installingSkill:"Installing...",skillInstallSuccess:"Skill installed successfully",skillInstallFailed:"Installation failed",agentClaudeCode:"Claude Code",agentCursor:"Cursor",agentCodex:"Codex",agentOpencode:"OpenCode",agentGoose:"Goose",agentGeminiCli:"Gemini CLI",agentAntigravity:"Antigravity",agentGithubCopilot:"GitHub Copilot",agentAmp:"Amp",agentKilo:"Kilo",agentRoo:"Roo",agentWindsurf:"Windsurf",agentCline:"Cline",agentOpenhands:"OpenHands",installed:"Installed",notInstalled:"Not installed",allAgents:"All Agents",filterByAgent:"Filter by agent",skillsTitle:"Skills",skillsSubtitle:"Browse, install, and manage skills for your coding agents",availableCount:"Available",installedCount:"Installed",agentsCount:"Agents",searchSkills:"Search skills...",searchShortcut:"/",sortAZ:"A-Z",sortCategory:"Category",sortInstalledFirst:"Installed first",listView:"List view",gridView:"Grid view",categoryAll:"All",categoryAI:"AI",categoryUIUX:"UI/UX",categoryBackend:"Backend",categorySecurity:"Security",categoryDevOps:"DevOps",categoryDatabase:"Database",categoryDevelopment:"Development",categoryResearch:"Research",categoryGeneral:"General",categoryCore:"Core",categoryDocumentation:"Documentation",categoryTooling:"Tooling",categoryMedia:"Media",categoryFrameworks:"Frameworks",skillsCountLabel:"{count} skills",installToAll:"Install to All Detected",scopeLabel:"Installation Scope",agentInstalled:"Installed",agentNotInstalled:"Not installed",skillSource:"Source location",skillSourceBadge:"Source",detailPanelClose:"Close",versionLabel:"v{version}",installAllToAllAgents:"Install All to All Agents",bulkInstallFailed:"Bulk install failed",noAgentsDetected:"No agents detected",kitBadgeEngineer:"Engineer",kitBadgeMarketing:"Marketing",customizedBadge:"Customized",installedVersionLabel:"Installed Version",installedAtLabel:"Installed At",sourceTimestampLabel:"Source Date",kitLabel:"Kit",skillMetadata:"Skill Info",migrate:"Migrate",migrateTitle:"Migrate",migrateSubtitle:"Migrate your Claude Code stack to other providers",migrateDetectedProviders:"Detected",migrateSelectedProviders:"Selected",migrateDiscovering:"Discovering migration sources...",migrateRefresh:"Refresh Discovery",migrateRun:"Run Migration",migrateRunning:"Migrating...",migrateSourceSummary:"Source Summary",migratePresetCodex:"Codex",migratePresetAntigravity:"Antigravity",migratePresetCore:"Codex + Antigravity + Droid",migratePresetDetected:"All Detected",migrateScope:"Scope",migrateScopeProject:"Project",migrateScopeGlobal:"Global",migrateTypes:"Portable Types",migrateTypeAgents:"Subagents",migrateTypeCommands:"Commands",migrateTypeSkills:"Skills",migrateTypeConfig:"Config",migrateTypeRules:"Rules",migrateTypeHooks:"Hooks",migrateSearchProviders:"Search providers...",migrateSelectVisible:"Select Visible",migrateClearSelection:"Clear Selection",migrateProvidersHeading:"Target Providers",migrateProvidersCountSuffix:"providers",migrateNoProvidersMatch:"No providers match current filters.",migrateSelectButton:"Select",migrateSelectedButton:"Selected",migrateSelectProviderAction:"Select Provider",migrateUnselectProvider:"Unselect Provider",migrateCapabilitiesLabel:"types",migrateCapabilitiesSection:"Capability Matrix",migrateSupported:"Supported",migrateUnsupportedShort:"Unsupported",migrateIncludedEnabled:"Enabled",migrateIncludedDisabled:"Disabled",migrateLatestTarget:"Latest Target",migrateNoResultForProvider:"No migration result for this provider yet.",migrateActionSummaryTitle:"Ready to Migrate",migrateGlobalOnlyCommandsShort:"Commands global only",migrateNoProviders:"No providers available.",migrateUnsupported:"Will be skipped (unsupported)",migrateGlobalForced:"Selected provider commands only support global scope. Use Global to install them.",migrateResults:"Migration Results",migrateInstalled:"Installed",migrateSkipped:"Skipped",migrateFailed:"Failed",migrateProvider:"Provider",migrateStatus:"Status",migratePath:"Path",migrateError:"Error",migrateStatusInstalled:"Installed",migrateStatusSkipped:"Skipped",migrateStatusFailed:"Failed",migrateNoResults:"No migration results yet.",migrateDetectFailed:"Failed to discover migration data",migrateExecuteFailed:"Migration execution failed",migrateSelectProvider:"Select at least one provider",migrateNoTypesEnabled:"Enable at least one portable type",migrateDetectedTag:"Detected",migrateNotDetectedTag:"Not detected",migrateFilterRecommended:"Recommended",migrateActionInstall:"Install",migrateActionUpdate:"Update",migrateActionSkip:"Skip",migrateActionConflict:"Conflict",migrateActionDelete:"Delete",migrateUnchanged:"unchanged",migrateConflictSectionTitle:"Conflicts",migrateConflictUseCK:"Use CK",migrateConflictKeepMine:"Keep Mine",migrateConflictSmartMerge:"Smart Merge",migrateConflictShowDiff:"Show Diff",migrateConflictHideDiff:"Hide Diff",migrateConflictResolved:"Resolved",migrateConflictManual:"Manual",migrateConflictOverwriteAll:"Overwrite All",migrateConflictKeepAll:"Keep All",migrateSummaryTitle:"Migration Complete",migrateSummaryNewMigration:"New Migration",migrateType:"Type",migrateItem:"Item",migrateReconciling:"Analyzing changes...",migrateReviewPlan:"Review Plan",migrateExecutePlan:"Execute Migration",migrateExecuting:"Executing migration...",migrateResolveConflicts:"Resolve all conflicts before executing",migrateReason_newItem:"New item from provider",migrateReason_newProviderForItem:"New provider for this item",migrateReason_targetDeletedSourceChanged:"Target was deleted but source has updates",migrateReason_targetDirEmptyReinstall:"Target directory is empty — reinstalling",migrateReason_forceReinstall:"Force reinstall requested",migrateReason_forceOverwrite:"Force overwrite (you edited this, --force active)",migrateReason_registryUpgradeReinstall:"Registry upgrade requires reinstall",migrateReason_sourceChanged:"Source has been updated",migrateReason_registryUpgradeHeal:"Healing stale target after registry upgrade",migrateReason_noChanges:"No changes detected",migrateReason_userEditsPreserved:"User edits preserved",migrateReason_userDeletedRespected:"User deletion respected",migrateReason_targetUpToDateBackfill:"Target is up to date",migrateReason_providerChecksumUnavailable:"Provider checksum unavailable",migrateReason_targetStateUnknown:"Target state could not be determined",migrateReason_sourceRemovedOrphan:"Source removed — cleaning up orphan",migrateReason_renamedCleanup:"Item renamed — removing old path",migrateReason_pathMigratedCleanup:"Path migrated — removing old location",migrateReason_bothChanged:"Both source and target changed",migrateReason_targetStateUnknownSourceChanged:"Source changed but target state unknown",migrateBanner_emptyDir_title:"Detected empty directory",migrateBanner_emptyDir_body:"items below will be reinstalled. Uncheck any to skip.",migrateBanner_emptyDirRespected_title:"Respecting your deletion",migrateBanner_emptyDirRespected_body:"is empty. Respecting your deletion.",migrateBanner_reinstallCta:"Reinstall these items",migrateModeLabel:"Migration mode",migrateModeReconcile:"Reconcile",migrateModeReconcileDesc:"Smart-detects drift",migrateModeInstall:"Install",migrateModeInstallDesc:"Pick items to install",migrateModeConfirmTitle:"Switch mode?",migrateModeConfirmBody:"You have {count} pending changes. Switching to {mode} mode will discard them.",migrateModeConfirmSwitch:"Switch & discard",migrateSmartDefaultInstall:"Fresh install detected — defaulting to Install mode",migrateSmartDefaultReconcile:"Existing registry found — defaulting to Reconcile mode",migrateInstallSelectAll:"Select all",migrateInstallDeselectAll:"Deselect all",migrateInstallDirItem:"dir",migrateInstallAlreadyInstalled:"installed",migrateInstallNoCandidates:"No installable items found for the selected providers.",migrateInstallSelectedCount:"{count} of {total} items selected",migrateInstallCta:"Install {count} selected items",migrateInstallInstalling:"Installing...",migrateInstallLoadingCandidates:"Fetching available items...",migrateFlip_moveToSkip:"Move to Skip",migrateFlip_moveToInstall:"Move to Install",migrateFlip_checkAll:"Check all",migrateFlip_uncheckAll:"Uncheck all",migrateFlip_toggleItem:"Toggle item",migrateConflictBanner_title:"Conflicts detected",migrateConflictBanner_cta:"Open conflict resolver",migrateConflictBanner_hide:"Hide conflict resolver",migrateShowSkippedItems:"Show skipped items",migrateHideSkippedItems:"Hide skipped items",migrateConflictBadge:"Conflict",migrateSummarySubtitle:"items migrated",migrateSummarySearchPlaceholder:"Search items...",migrateSummaryFilterAll:"All",migrateSummaryCollapseAll:"Collapse all",migrateSummaryExpandAll:"Expand all",migrateSummaryNoResults:"No items match your search",migrateSummaryProviders:"Providers",migrateTypeUnknown:"Other",kanbanTitle:"Plan Kanban",kanbanNoFile:"No plan file specified. Use ?file= parameter.",kanbanNoPhases:"No phases detected in this plan",kanbanError400:"Invalid request — missing file parameter",kanbanError403:"Access denied — file is outside the project directory",kanbanError404:"Plan file not found",kanbanComplete:"complete",kanbanStatus_pending:"Pending","kanbanStatus_in-progress":"In Progress",kanbanStatus_completed:"Completed",kanbanPhases:"phases",kanbanProgress:"Progress",kanbanLoadError:"Failed to load plan data",plansNav:"Plans",plansTitle:"Plans Dashboard",plansGlobalTitle:"All Projects",plansSubtitle:"Browse active plans, inspect phase timelines, and manage progress from one place.",plansEmpty:"No plans found",plansSearch:"Search plans...",plansProjectFilter:"Filter by project",plansAllProjects:"All projects",plansSortBy:"Sort by",plansViewGrid:"Grid",plansViewKanban:"Kanban",plansFilterAll:"All statuses",plansSortDateDesc:"Newest first",plansSortDateAsc:"Oldest first",plansSortNameAsc:"Name A-Z",plansSortNameDesc:"Name Z-A",plansSortProgress:"Highest progress",plansLabel:"Plan",plansStatusPending:"Pending",plansStatusInProgress:"In Progress",plansStatusInReview:"In Review",plansStatusDone:"Done",plansStatusCancelled:"Cancelled",plansCompletedCount:"{count} completed",plansProjectPlans:"{count} plans",plansProjectLoadIssues:"Some projects could not be scanned",plansStatusUnknown:"Unknown",plansBackToPlans:"Back to Plans",plansBackToPlan:"Back to Plan",plansPrevious:"Previous",plansNext:"Next",plansContents:"Contents",plansValidate:"Validate",plansStartNext:"Start Next",plansRestart:"Restart",plansStart:"Start",plansComplete:"Complete",plansReset:"Reset",plansTimeline:"Timeline",plansActivity:"Activity",plansActivitySubtitle:"Last 12 weeks",plansActivityCombined:"Combined",plansActivityCommits:"Commits",plansActivityFiles:"Files",plansActivityEmpty:"No activity data available.",plansHeatmapLoadError:"Failed to load activity heatmap.",plansHeatmapChanges:"{date} • {count} changes",plansRead:"Read",plansPhases:"Phases",plansPhase:"Phase",plansPhaseCountCompact:"PH-{count}",plansKanbanEmpty:"Empty",plansLoadingPlan:"Loading plan...",plansLoadingReader:"Loading document...",plansLoadPlanFailed:"Failed to load plan ({status})",plansLoadPlanFallback:"Failed to load plan",plansLoadFileFailed:"Failed to load document ({status})",plansLoadFileFallback:"Failed to load document",plansProgressComplete:"{count}% complete",plansPhaseCount:"{count} phases",plansPriority:"Priority",plansUpdated:"Updated",plansLastUpdated:"Last Updated",plansPriorityLabel:"Priority {value}",plansUpdatedLabel:"Updated {value}",plansTimelineAvgDays:"{count} avg days",plansNoEffort:"No effort",plansNotFound:"Plan not found",plansQuickInfoTitle:"Plan Overview",plansQuickInfoDescription:"Use this view to track phase progress, timeline coverage, and recent activity for this plan.",plansCurrentStatus:"Current Status",plansHeatmapMon:"Mon",plansHeatmapWed:"Wed",plansHeatmapFri:"Fri",developmentFeature:"Development",betaFeature:"Beta",experimentalFeature:"Experimental",sectionModelTaxonomy:"Model Taxonomy",taxonomyDescription:"Customize model mappings for portable migration to other coding agents.",taxonomyTierHeavy:"Heavy (opus)",taxonomyTierBalanced:"Balanced (sonnet)",taxonomyTierLight:"Light (haiku)",taxonomyModel:"Model",taxonomyEffort:"Effort",taxonomyResetProvider:"Reset",taxonomyTier:"Tier",statuslineBuilder:"Status Line Builder",statuslineBuilderDescription:"Visually design your Claude Code status-line using drag-and-drop",statuslineSections:"Sections",statuslinePreview:"Preview",statuslineTheme:"Color Theme",statuslineSettings:"General Settings",statuslineResetDefaults:"Reset to Defaults",statuslineSave:"Save",statuslineBaseMode:"Base Mode",statuslineBreakpoint:"Responsive Breakpoint",statuslineMaxAgents:"Max Agent Rows",statuslineTodoTruncation:"Todo Truncation",statuslineEnable:"Enable",statuslineDisable:"Disable",statuslineDragHint:"Drag to reorder, toggle to enable/disable sections",statuslinePresetDefault:"Default",statuslinePresetMonochrome:"Monochrome",statuslinePresetSolarized:"Solarized",statuslinePresetNord:"Nord",statuslinePresetDracula:"Dracula",statuslinePresetCatppuccin:"Catppuccin",statuslinePresetGruvbox:"Gruvbox",statuslinePresetTokyoNight:"Tokyo Night",statuslinePresetRosePine:"Rosé Pine",statuslinePresetOneDark:"One Dark",statuslinePresetAyu:"Ayu",statuslinePresetKanagawa:"Kanagawa",statuslinePresetStealth:"Stealth",statuslinePresetHacker:"Hacker",statuslineSaved:"Saved successfully",statuslineSaveError:"Save failed",statusline:"Status Line",statuslineCollapseSettings:"Collapse settings",statuslineExpandSettings:"Expand settings",statuslineIconOverride:"Icon override",statuslineLabelOverride:"Label override",statuslineMaxWidth:"Max width (chars)",statuslineIconPlaceholder:"e.g. 🤖",statuslineMaxWidthPlaceholder:"auto",statuslineCustomColors:"Custom colors",statuslineColorContextGroup:"Context Window",statuslineColorQuotaGroup:"Usage Quota",statuslineColorGeneralGroup:"General",statuslineColorSectionGroup:"Section Colors",statuslineColorContextLow:"Low (<50%)",statuslineColorContextMid:"Mid (50-75%)",statuslineColorContextHigh:"High (>75%)",statuslineColorAccent:"Accent",statuslineColorMuted:"Muted",statuslineColorSeparator:"Separator",statuslineModeFullDesc:"All sections visible",statuslineModeCompactDesc:"Condensed display",statuslineModeMinimalDesc:"Essential info only",statuslineModeNoneDesc:"Disabled",statuslinePreviewTitle:"Claude Code — statusline preview",statuslinePreviewEmptyLine:"(empty line)",statuslinePreviewNoLines:"(no lines configured)",statuslineSectionModelLabel:"Model",statuslineSectionContextLabel:"Context Window",statuslineSectionQuotaLabel:"Usage Quota",statuslineSectionDirectoryLabel:"Directory",statuslineSectionGitLabel:"Git Status",statuslineSectionCostLabel:"Cost",statuslineSectionChangesLabel:"Changes",statuslineSectionAgentsLabel:"Agents",statuslineSectionTodosLabel:"Tasks",statuslineSectionModelDesc:"AI model name and provider",statuslineSectionContextDesc:"Context window usage bar",statuslineSectionQuotaDesc:"5-hour and weekly usage quota",statuslineSectionDirectoryDesc:"Current working directory",statuslineSectionGitDesc:"Git branch, staged/unstaged changes",statuslineSectionCostDesc:"Session cost estimate",statuslineSectionChangesDesc:"Lines added and removed",statuslineSectionAgentsDesc:"Recent agent activity",statuslineSectionTodosDesc:"Current task progress",statuslineSectionsVisible:"sections visible",statuslineLoadErrorSaveDisabled:"Could not load saved layout. Saving is disabled to prevent data loss.",statuslineAddLine:"Add Line",statuslineRemoveLine:"Remove",statuslineHiddenSections:"Hidden Sections",statuslineDragToLine:"Drag sections to a line to show them",statuslineQuotaLow:"Quota Low",statuslineQuotaHigh:"Quota High",statuslineLine:"Line",sessionsTitle:"Sessions",sessionDetail:"Session Detail",sessionMessages:"messages",sessionToolCalls:"tool calls",sessionDuration:"Duration",noSessionsData:"No sessions found",sessionReadOnly:"Read-only view",sessionLastActive:"Last active",sessionProjectSessions:"Project Sessions",sessionBack:"Back",sessionLoading:"Loading...",sessionError:"Failed to load",sessionCount:"sessions",sessionToolInput:"Input",sessionToolResult:"Result",sessionToolsUsed:"Tools Used",sessionSystemContext:"System Context",sessionExpandAll:"Expand all",sessionCollapseAll:"Collapse all",sessionNoContent:"No text content",sessionUser:"User",sessionAssistant:"Assistant",sessionThinking:"Thinking...",sessionSearchPlaceholder:"Search in conversation...",sessionSearchResults:"results",sessionNoResults:"No matches",sessionGroupMessages:"messages",palettePlaceholder:"Search agents, commands, skills...",paletteNoResults:"No results found",paletteAgents:"Agents",paletteCommands:"Commands",paletteSkills:"Skills",paletteProjects:"Projects",paletteNavigation:"Navigation",skillsBrowser:"Skills",skillsCount:"{count} skills",skillDetail:"Skill Detail",searchSkillsBrowserPlaceholder:"Search skills...",noSkillsBrowserFound:"No skills found",backToSkillsBrowser:"Back to Skills",skillTriggers:"Triggers",skillLocal:"Local",skillGithub:"GitHub",systemNavLabel:"System",dashboardTitle:"Dashboard",dashboardAgents:"Agents",dashboardCommands:"Commands",dashboardSkills:"Skills",dashboardMcpServers:"MCP Servers",configured:"Configured",available:"Available",modelDistribution:"Model Distribution",recentAgents:"Recent Agents",suggestionsTitle:"Suggestions",acrossAgents:"across {count} agents",noAgentsConfigured:"No agents configured in ~/.claude/agents/",mcpTitle:"MCP Servers",mcpServerName:"Server",mcpCommand:"Command",mcpArgs:"Arguments",mcpSource:"Source",mcpStatus:"Status",mcpConfigured:"Configured",mcpNoServers:"No MCP servers configured",mcpSourceSettings:"settings.json",mcpSourceMcpJson:".mcp.json",mcpSourceProject:"Project",mcpToolCount:"Tools",agentsBrowser:"Agents",agentsBrowserCount:"{count} agents",filterAll:"All",agentDetail:"Agent Detail",agentInstructions:"Instructions",agentFrontmatter:"Configuration",searchAgentsPlaceholder:"Search agents...",noAgentsFound:"No agents found",backToAgents:"Back to Agents",commandsBrowser:"Commands",commandsCount:"{count} commands",commandDetail:"Command Detail",searchCommandsPlaceholder:"Search commands...",noCommandsFound:"No commands found",backToCommands:"Back to Commands",rootCommands:"Root",selectToView:"Select an item to view details",indexingFrom:"Indexing from",workflowsTitle:"Workflows",workflowsSubtitle:"Learn ClaudeKit through interactive workflow visualization.",workflowsCredit:"Workflows data and visualization layout inspired by",workflowImplementationRecipe:"Implementation Recipe",workflowSearchPlaceholder:"Search workflows...",workflowNoResults:"No workflows found",loadingWorkflows:"Loading workflows...",workflowCategoryAll:"All",workflowCategoryGettingStarted:"Getting Started",workflowCategoryDesignFrontend:"Design & Frontend",workflowCategoryDebuggingFixes:"Debugging & Fixes",workflowCategoryPlanningReview:"Planning & Review",workflowCategoryResearchDocs:"Research & Docs",workflowCategoryShipping:"Shipping",workflowCategoryBackendInfra:"Backend & Infra",workflowCategoryMediaCreative:"Media & Creative",workflowCategoryAdvanced:"Advanced",workflowComplexityBeginner:"Beginner",workflowComplexityIntermediate:"Intermediate",workflowComplexityAdvanced:"Advanced",workflowBuildFeature:"Build a New Feature",workflowBuildFeatureDesc:"Add new functionality to applications systematically.",workflowQuickImplementation:"Quick Implementation",workflowQuickImplementationDesc:"Fast track implementation for small, understood features.",workflowStartNewProject:"Start New Project",workflowStartNewProjectDesc:"Bootstrap a brand new project with right foundations.",workflowFrontendDesign:"Frontend Design",workflowFrontendDesignDesc:"Create beautiful user interfaces guided by design taste bots.",workflowAiDesignStitch:"AI Design Stitch",workflowAiDesignStitchDesc:"Orchestrate Google Stitch for generating designs from prompt.",workflowExcalidraw:"Excalidraw Design",workflowExcalidrawDesc:"Visualize architectures or mockups using Excalidraw JSON.",workflowFixBug:"Fix Bug",workflowFixBugDesc:"Identify root cause and automatically fix codebase issues.",workflowSecurityAudit:"Security Audit",workflowSecurityAuditDesc:"Thorough security check on the repository.",workflowTestScenarios:"Test Scenarios",workflowTestScenariosDesc:"Generate edge cases and test scenarios by decomposing features.",workflowStride:"STRIDE Analysis",workflowStrideDesc:"Perform a STRIDE + OWASP-based security audit threat model.",workflowCodeReview:"Code Review",workflowCodeReviewDesc:"Review code quality with adversarial rigor.",workflowPlanValidate:"Plan + Validate",workflowPlanValidateDesc:"Draft an architectural plan and rigorously validate its technical feasible.",workflowAdversarialReview:"Adversarial Review",workflowAdversarialReviewDesc:"Trigger a harsh red-team review mapping out potential failure modes.",workflowAutoresearch:"Autonomous Loop",workflowAutoresearchDesc:"Run an autonomous iterative optimization loop for any metric.",workflowXia:"Extract/Port Feature",workflowXiaDesc:"Port or extract a feature algorithm from an external codebase.",workflowVisualDocumentation:"Visual Documentation",workflowVisualDocumentationDesc:"Build diagrams outlining current repo logic and architectures.",workflowTechnicalResearch:"Technical Research",workflowTechnicalResearchDesc:"Investigate technological solutions deeply before writing code.",workflowLlmsTxt:"Generate llms.txt",workflowLlmsTxtDesc:"Analyze the codebase and construct a comprehensive llms.txt file.",workflowDevops:"DevOps / Release",workflowDevopsDesc:"Configure Docker, CI/CD and deploy standard web platforms.",workflowShip:"Ship Pipeline",workflowShipDesc:"Merge, test, review, commit, bump semantic version and PR.",workflowDatabaseOps:"Database Operations",workflowDatabaseOpsDesc:"Write complex aggregation pipelines or optimize database performance.",workflowRemotion:"Remotion Video",workflowRemotionDesc:"Build programmatic video sequences internally.",workflowShowOff:"Show Off Demo",workflowShowOffDesc:"Build an interactive self-contained HTML showcase for a repo.",workflowAgentTeams:"Agent Teams",workflowAgentTeamsDesc:"Spawn isolated team members for parallel coordinated labor.",workflowWorktree:"Worktree Parallelism",workflowWorktreeDesc:"Instantly isolate feature iterations in new worktrees."},vi:{loading:"Đang tải...",error:"Lỗi",selectProject:"Chọn dự án để xem bảng điều khiển",controlCenter:"Trung tâm điều khiển",settings:"Cài đặt",sync:"Đồng bộ",offline:"Ngoại tuyến",switchToLight:"Chuyển sang chế độ sáng",switchToDark:"Chuyển sang chế độ tối",settingsSection:"Cài đặt",overviewSection:"Tổng quan",entitiesSection:"Thực thể",toolsSection:"Công cụ",configEditor:"Trình chỉnh sửa cấu hình",projects:"Dự án",addProject:"Thêm dự án",global:"Toàn cục",skills:"Kỹ năng",skillsNav:"Kỹ năng",health:"Sức khỏe",collapse:"Thu gọn",expand:"Mở rộng",installing:"Đang cài đặt...",manage:"Quản lý",uninstall:"Gỡ cài đặt",installGlobally:"Cài đặt toàn cục",installGloballyDesc:"Khả dụng cho tất cả dự án thay vì chỉ dự án hiện tại",selectAtLeastOneAgent:"Vui lòng chọn ít nhất một agent",installationFailed:"Cài đặt thất bại",allSkills:"Tất cả kỹ năng",refresh:"Làm mới",browseAndManageSkills:"Duyệt và quản lý kỹ năng cho agents của bạn",detected:"Đã phát hiện",notDetected:"Chưa phát hiện",sessions:"phiên",noSessions:"Không có phiên",terminal:"Terminal",terminalSub:"Mở bash tại đường dẫn",editor:"Trình soạn thảo",editorSub:"Mở trong VS Code",useGlobalFallback:"Dùng fallback global",openAtPath:"Mở tại đường dẫn dự án",openAppOnly:"Chỉ mở ứng dụng",actionOptionsLoadFailed:"Không thể tải tùy chọn editor/terminal",launch:"Khởi chạy",launchSub:"Bắt đầu Claude Code",config:"Cấu hình",configSub:"Quản lý cài đặt dự án",recentSessions:"Phiên gần đây",viewAllHistory:"Xem tất cả lịch sử",showLess:"Thu gọn",actionFailed:"Thao tác thất bại",loadingSessions:"Đang tải phiên...",noSessionsFound:"Không tìm thấy phiên nào",configuration:"Cài đặt Claude",planSettingsTitle:"Cài đặt Kế hoạch",activeKit:"Kit hoạt động",aiModel:"Mô hình",hooks:"Hooks",active:"hoạt động",mcpServers:"Máy chủ MCP",connected:"kết nối",plansDirectory:"Thư mục kế hoạch",validationMode:"Chế độ xác thực",planScopeLabel:"Phạm vi",planScopeProject:"dự án",planScopeGlobal:"toàn cục",activePlansLabel:"Kế hoạch đang hoạt động",activePlansTitle:"Kế hoạch đang hoạt động",noActivePlansFound:"Không có kế hoạch đang hoạt động",openPlan:"Mở kế hoạch",openKanban:"Mở Kanban",blockedByLabel:"Bị chặn bởi",progressLabel:"Tiến độ",editProjectConfig:"Chỉnh sửa cấu hình dự án",projectPreferenceSaveFailed:"Không thể lưu tùy chọn",globalSettings:"(Toàn cục)",globalSkills:"Kỹ năng toàn cục",loadingSkills:"Đang tải kỹ năng...",noDescription:"Không có mô tả",browseSkillsMarketplace:"Duyệt Skills Marketplace",backToDashboard:"Quay lại bảng điều khiển",educationalConfigEditor:"Trình chỉnh sửa cấu hình hướng dẫn",discard:"Hủy bỏ",saveChanges:"Lưu thay đổi",mergedView:"Chế độ gộp",localConfig:"Cục bộ (.ck.json)",globalConfig:"Toàn cục",syntaxValid:"Cú pháp hợp lệ",configurationHelp:"Hướng dẫn cấu hình",field:"Trường",type:"Kiểu",default:"Mặc định",description:"Mô tả",validValues:"Giá trị hợp lệ",systemEffect:"Hiệu ứng hệ thống",exampleUsage:"Ví dụ sử dụng",knowledgeBase:"Cơ sở kiến thức",clickToSeeHelp:"Nhấp vào bất kỳ trường cấu hình nào để xem tài liệu chi tiết và ví dụ sử dụng.",extractedFrom:"Trích xuất từ ClaudeKit v2.x Specification",resetToDefault:"Đặt lại",saving:"Đang lưu...",saved:"Đã lưu",confirmReset:"Đặt lại về mặc định?",confirmResetMessage:"Tất cả thay đổi sẽ bị mất và được thay thế bằng giá trị mặc định.",confirm:"Xác nhận",saveFailed:"Lưu thất bại",configTab:"Cấu hình",systemTab:"Hệ thống",formTab:"Biểu mẫu",jsonTab:"JSON",readOnly:"Chỉ đọc",installedKit:"Kit đã cài",kitVersion:"Phiên bản Kit",installedOn:"Cài đặt vào",noKitInstalled:"Chưa cài kit",components:"Thành phần",agents:"Agents",commands:"Commands",workflows:"Workflows",kitSkills:"Skills",fileOwnership:"Quyền sở hữu tệp",ownershipCk:"do kit quản lý",ownershipUser:"do người dùng",ownershipModified:"đã chỉnh sửa",componentInventory:"Thành phần đã cài",installedHooks:"Hooks đã cài",installedMcpServers:"MCP Servers",lastChecked:"Kiểm tra cập nhật",staleIndicator:"Cũ",skippedVersion:"Đã bỏ qua",filesModifiedFromDefaults:"tệp đã sửa so với mặc định",cliCard:"ClaudeKit CLI",checkForUpdates:"Kiểm tra cập nhật",checking:"Đang kiểm tra...",upToDate:"Đã cập nhật",updateAvailable:"Có bản cập nhật",updateNow:"Cập nhật ngay",updating:"Đang cập nhật...",updateSuccess:"Cập nhật hoàn tất!",updateFailed:"Cập nhật thất bại",closeModal:"Đóng",showDetails:"Xem chi tiết",hideDetails:"Ẩn chi tiết",environment:"Môi trường",claudeConfigPath:"Cấu hình Claude",nodeVersion:"Node",bunVersion:"Bun",osVersion:"Hệ điều hành",envShell:"Shell",envHomeDir:"Thư mục gốc",envCpuCores:"Nhân CPU",envTotalMemory:"Bộ nhớ",cliPackageManager:"Trình quản lý gói",cliInstallLocation:"Vị trí cài đặt",cliGitVersion:"Git",cliGhVersion:"GitHub CLI",channelStable:"Ổn định",channelBeta:"Beta",betaBadge:"Beta",latestVersion:"Mới nhất",selectVersion:"Chọn phiên bản",loadingVersions:"Đang tải...",prereleaseLabel:"Thử nghiệm",currentVersionLabel:"Hiện tại",checkAll:"Kiểm tra tất cả",checkingAll:"Đang kiểm tra...",updateAll:"Cập nhật tất cả",updatesAvailable:"{count} bản cập nhật",allUpToDate:"Tất cả đã cập nhật",systemControlTower:"Trung tâm hệ thống",systemOverviewTitle:"Tổng quan cập nhật & môi trường",systemOverviewDesc:"Theo dõi CLI và kit, rồi nâng cấp từ một nơi.",installedComponentsHeading:"Thành phần đã cài",updateReadiness:"Mức sẵn sàng cập nhật",checkedComponents:"Đã kiểm tra",activeChannel:"Kênh",readyToScan:"Sẵn sàng kiểm tra",noTrackedFiles:"Không phát hiện tệp theo dõi",kitsLabel:"Kit",componentFilterAll:"Tất cả",componentFilterUpdates:"Bản cập nhật",componentFilterUpdatesCount:"Bản cập nhật ({count})",componentFilterUpToDate:"Đã cập nhật",componentFilterUpToDateCount:"Đã cập nhật ({count})",componentFilterCli:"CLI",componentFilterKits:"Kit",noComponentsMatchFilter:"Không có thành phần phù hợp bộ lọc hiện tại.",runCheckAllForFilter:"Hãy chạy Kiểm tra tất cả để nạp dữ liệu cho bộ lọc này.",noUpdatesFound:"Không có bản cập nhật. Các thành phần đã kiểm tra đều mới nhất.",noUpToDateYet:"Chưa có thành phần nào ở trạng thái đã cập nhật.",configWorkspaceHint:"Chỉnh sửa cấu hình hoặc quản lý cập nhật hệ thống trong một màn hình.",settingsJsonHeading:"JSON Cài đặt Claude",settingsJsonMissing:"Không tìm thấy tệp ~/.claude/settings.json.",settingsJsonLoadFailed:"Không thể tải ~/.claude/settings.json.",settingsLoadFailedDetail:"Chi tiết lỗi:",configLoadFailed:"Không thể tải cấu hình.",configLoadFailedDetail:"Chi tiết lỗi:",settingsBackupSaved:"Đã lưu bản sao lưu",hookDiagnosticsTitle:"Chẩn đoán Hook",hookDiagnosticsDesc:"Xem hoạt động hook gần đây và lỗi mà không cần mở tệp JSONL thủ công.",hookDiagnosticsPathPending:"Đang xác định đường dẫn log...",hookDiagnosticsScopeGlobal:"Hook toàn cục",hookDiagnosticsEntries:"Bản ghi",hookDiagnosticsCrashes:"Sự cố",hookDiagnosticsWarnings:"Cảnh báo",hookDiagnosticsBlocks:"Chặn",hookDiagnosticsLastEvent:"Sự kiện cuối",hookDiagnosticsLoading:"Đang tải chẩn đoán hook...",hookDiagnosticsLoadFailed:"Không thể tải chẩn đoán hook",hookDiagnosticsMissing:"Chưa tìm thấy tệp log hook cho phạm vi này.",hookDiagnosticsEmpty:"Tệp log hook có tồn tại nhưng không có bản ghi đọc được.",hookDiagnosticsParseErrorsNotice:"Đã bỏ qua {count} dòng log bị lỗi khi tải chẩn đoán.",hookDiagnosticsTruncatedNotice:"Đang hiển thị cửa sổ bản ghi gần đây để giữ giao diện phản hồi tốt với log lớn.",hookDiagnosticsToolLabel:"công cụ",hookDiagnosticsTargetLabel:"mục tiêu",hookDiagnosticsUnknown:"Không rõ",hookDiagnostics:"Chẩn đoán Hook",hookEvent:"Sự kiện",hookExecutions:"Lần chạy",hookAvgLatency:"Trung bình",hookFailureRate:"Tỉ lệ lỗi",hookLastRun:"Lần cuối",hookLatencyWarning:"Độ trễ > 500ms",activityMetrics:"Hoạt động",activityTotalSessions:"Tổng phiên",activityMostActive:"Dự án hoạt động nhiều nhất",activityPeriod24h:"24h",activityPeriod7d:"7 ngày",activityPeriod30d:"30 ngày",activityNoData:"Không có dữ liệu",addProjectTitle:"Thêm dự án",addProjectDescription:"Thêm dự án ClaudeKit mới vào trung tâm điều khiển",projectPath:"Đường dẫn dự án",pathPlaceholder:"/đường/dẫn/dự/án",alias:"Bí danh",aliasOptional:"(tùy chọn)",aliasPlaceholder:"dự-án-của-tôi",aliasDescription:"Tên hiển thị tùy chỉnh cho dự án",pathRequired:"Đường dẫn bắt buộc",failedToAdd:"Không thể thêm dự án",cancel:"Hủy",adding:"Đang thêm...",somethingWentWrong:"Đã xảy ra lỗi",reloadApp:"Tải lại ứng dụng",serverNotRunning:"Máy chủ không chạy",startServerMessage:"Config UI yêu cầu máy chủ backend đang chạy.",runThisCommand:"Chạy lệnh này",tryAgain:"Thử lại",projectConfig:"Cấu hình dự án",inheritedFromGlobal:"Kế thừa từ toàn cục",localOverride:"Ghi đè cục bộ",viewGlobalConfig:"Trường này kế thừa từ cấu hình toàn cục. Xem",onboardingTitle:"Chào mừng đến ClaudeKit",onboardingSubtitle:"Chọn kit của bạn và bắt đầu trong vài phút",kitEngineerName:"ClaudeKit Engineer",kitEngineerTagline:"Lập trình AI với skills, hooks và multi-agent",kitMarketingName:"ClaudeKit Marketing",kitMarketingTagline:"Tự động hóa nội dung: chiến dịch, mạng xã hội, phân tích",featureAgents:"AI Agents",featureAgentsDesc:"Các agent chuyên biệt cho từng tác vụ",featureHooks:"Lifecycle Hooks",featureHooksDesc:"Tùy chỉnh hành vi của Claude tại các thời điểm quan trọng",featureSkills:"Thư viện Skills",featureSkillsDesc:"Các khả năng có sẵn bạn có thể kích hoạt",featureMultiAgent:"Multi-Agent Workflows",featureMultiAgentDesc:"Phối hợp nhiều agent cho các tác vụ phức tạp",featureContent:"Tạo nội dung",featureContentDesc:"Tự động tạo và tối ưu nội dung",featureSocial:"Công cụ mạng xã hội",featureSocialDesc:"Lên lịch, phân tích và tự động tương tác",stepChooseKit:"Chọn Kit",stepConfigure:"Cấu hình",stepInstall:"Cài đặt",back:"Quay lại",next:"Tiếp theo",install:"Cài đặt",installSuccess:"Cài đặt hoàn tất!",installSuccessDesc:"{kit} đã sẵn sàng sử dụng",getStarted:"Bắt đầu",goToDashboard:"Đi đến Dashboard",kitConfig:"Cấu hình Kit",kitConfigSubtitle:"Cấu hình ClaudeKit Engineer",scopeGlobal:"Toàn cục",scopeProject:"Dự án",sectionGeneral:"Cài đặt chung",sectionPaths:"Đường dẫn",sectionPrivacy:"Bảo mật & Tin cậy",sectionProject:"Phát hiện dự án",sectionIntegrations:"Tích hợp",sectionHooks:"Hooks",sectionAdvanced:"Nâng cao",fieldCodingLevel:"Cấp độ lập trình",fieldCodingLevelDesc:"Cấp độ kinh nghiệm (-1=tự động, 0=mới bắt đầu, 1=trung cấp, 2=nâng cao, 3=chuyên gia, 4=tech-lead, 5=thần)",fieldStatusline:"Chế độ thanh trạng thái",fieldStatuslineDesc:"Lượng thông tin hiển thị trên thanh trạng thái",fieldStatuslineColors:"Màu thanh trạng thái",fieldStatuslineColorsDesc:"Bật màu ANSI trong thanh trạng thái",fieldStatuslineQuota:"Hiển thị Quota Statusline",fieldStatuslineQuotaDesc:"Hiển thị các nhãn quota 5h / wk trong statusline",fieldThinkingLanguage:"Ngôn ngữ suy nghĩ",fieldThinkingLanguageDesc:"Ngôn ngữ cho suy luận nội bộ của Claude (null=Tiếng Anh)",fieldResponseLanguage:"Ngôn ngữ phản hồi",fieldResponseLanguageDesc:"Ngôn ngữ cho phản hồi của Claude (null=theo người dùng)",fieldDocsPath:"Thư mục tài liệu",fieldDocsPathDesc:"Đường dẫn đến thư mục tài liệu",fieldPlansPath:"Thư mục kế hoạch",fieldPlansPathDesc:"Đường dẫn đến thư mục kế hoạch",fieldGlobalPlansPath:"Thư mục kế hoạch toàn cục",fieldGlobalPlansPathDesc:"Đường dẫn đến thư mục kế hoạch toàn cục",fieldPrivacyBlock:"Chặn quyền riêng tư",fieldPrivacyBlockDesc:"Chặn truy cập file nhạy cảm (.env, credentials)",fieldTrustEnabled:"Chế độ tin cậy",fieldTrustEnabledDesc:"Tự động phê duyệt các tool calls",fieldTrustPassphrase:"Mật khẩu tin cậy",fieldTrustPassphraseDesc:"Mật khẩu để bật chế độ tin cậy",fieldProjectType:"Loại dự án",fieldProjectTypeDesc:"Ghi đè loại dự án tự động phát hiện",fieldPackageManager:"Trình quản lý gói",fieldPackageManagerDesc:"Ghi đè trình quản lý gói tự động phát hiện",fieldFramework:"Framework",fieldFrameworkDesc:"Ghi đè framework tự động phát hiện",fieldGeminiModel:"Mô hình Gemini",fieldGeminiModelDesc:"Mô hình Gemini cho các lệnh CLI; id gemini-3.0-* cũ sẽ tự động ánh xạ",geminiModel25Flash:"Gemini 2.5 Flash — Mọi tài khoản",geminiModel25Pro:"Gemini 2.5 Pro — Có thể bị giới hạn dung lượng",geminiModel3FlashPreview:"Gemini 3 Flash Preview — Chỉ Pro/Ultra",geminiModel3ProPreview:"Gemini 3 Pro Preview — Chỉ Pro/Ultra",fieldResearchUseGemini:"Dùng Gemini cho nghiên cứu",fieldResearchUseGeminiDesc:"Dùng Gemini CLI thay vì WebSearch",fieldDocsMaxLoc:"Số dòng tối đa/tài liệu",fieldDocsMaxLocDesc:"Số dòng code tối đa cho mỗi file tài liệu",fieldPlanNamingFormat:"Định dạng tên kế hoạch",fieldPlanNamingFormatDesc:"Định dạng cho tên thư mục kế hoạch",fieldPlanDateFormat:"Định dạng ngày kế hoạch",fieldPlanDateFormatDesc:"Định dạng ngày cho tên kế hoạch (moment.js)",fieldPlanValidationMode:"Chế độ xác thực",fieldPlanValidationModeDesc:"Cách xác thực kế hoạch trước khi triển khai",fieldPlanMinQuestions:"Số câu hỏi tối thiểu",fieldPlanMinQuestionsDesc:"Số câu hỏi xác thực tối thiểu",fieldPlanMaxQuestions:"Số câu hỏi tối đa",fieldPlanMaxQuestionsDesc:"Số câu hỏi xác thực tối đa",fieldAssertions:"Assertions",fieldAssertionsDesc:"Các assertions và quy tắc cần thực thi",fieldHookSessionInit:"Khởi tạo phiên",fieldHookSessionInitDesc:"Phát hiện dự án và thiết lập môi trường",fieldHookSubagentInit:"Khởi tạo subagent",fieldHookSubagentInitDesc:"Inject context vào subagents",fieldHookDescriptiveName:"Tên mô tả",fieldHookDescriptiveNameDesc:"Bắt buộc đặt tên file dạng kebab-case mô tả cho scripts",fieldHookDevRulesReminder:"Nhắc nhở quy tắc dev",fieldHookDevRulesReminderDesc:"Inject context quy tắc phát triển",fieldHookUsageContextAwareness:"Nhận thức sử dụng cho prompt",fieldHookUsageContextAwarenessDesc:"Inject nhận thức giới hạn sử dụng vào prompt",fieldHookContextTracking:"Theo dõi ngữ cảnh",fieldHookContextTrackingDesc:"Theo dõi cửa sổ ngữ cảnh (% đã dùng, số token)",fieldHookScoutBlock:"Chặn Scout",fieldHookScoutBlockDesc:"Chặn thư mục nặng khỏi việc khám phá",fieldHookPrivacyBlock:"Hook chặn quyền riêng tư",fieldHookPrivacyBlockDesc:"Chặn đọc file nhạy cảm",fieldHookSimplifyGate:"Cổng đơn giản hóa",fieldHookSimplifyGateDesc:"Hook UserPromptSubmit — opt-in. Khi bật (simplify.gate.enabled=true), chặn cứng ship/merge/pr/deploy/publish và cảnh báo nhẹ commit/finalize/release khi diff vượt ngưỡng.",sectionSimplify:"Cổng đơn giản hóa",fieldSimplifyThresholdLocDelta:"Ngưỡng tổng LOC",fieldSimplifyThresholdLocDeltaDesc:"Tổng LOC thay đổi (toàn bộ file) vượt ngưỡng này thì cổng kích hoạt.",fieldSimplifyThresholdFileCount:"Ngưỡng số file",fieldSimplifyThresholdFileCountDesc:"Số file thay đổi vượt ngưỡng này thì cổng kích hoạt.",fieldSimplifyThresholdSingleFileLoc:"Ngưỡng LOC mỗi file",fieldSimplifyThresholdSingleFileLocDesc:"LOC thay đổi trong một file vượt ngưỡng này thì cổng kích hoạt.",fieldSimplifyGateEnabled:"Bật",fieldSimplifyGateEnabledDesc:"Công tắc chính. Tắt mặc định (opt-in). Bật để kích hoạt cổng; env CK_SIMPLIFY_DISABLED=1 luôn bỏ qua.",fieldSimplifyGateHardVerbs:"Động từ chặn cứng",fieldSimplifyGateHardVerbsDesc:"Động từ chặn cứng khi vượt ngưỡng.",fieldSimplifyGateSoftVerbs:"Động từ cảnh báo nhẹ",fieldSimplifyGateSoftVerbsDesc:"Động từ phát cảnh báo không chặn.",sectionUpdatePipeline:"Pipeline Cập nhật",fieldAutoInitAfterUpdate:"Tự động Init sau Update",fieldAutoInitAfterUpdateDesc:"Tự động chạy ck init sau ck update khi kit có phiên bản mới",fieldAutoMigrateAfterUpdate:"Tự động Migrate sau Update",fieldAutoMigrateAfterUpdateDesc:"Tự động chạy ck migrate sau ck update (độc lập với init)",fieldMigrateProviders:"Provider Migrate",fieldMigrateProvidersDesc:"Provider nào tự động migrate. Dùng 'auto' để quét hệ thống hoặc danh sách phân cách bằng dấu phẩy.",skillsPageTitle:"Quản lý Kỹ năng",skillsPageDesc:"Cài đặt kỹ năng ClaudeKit cho các agent lập trình",availableSkills:"Kỹ năng có sẵn",installedSkills:"Kỹ năng đã cài",noSkillsFound:"Không tìm thấy kỹ năng",installSkill:"Cài đặt",uninstallSkill:"Gỡ cài đặt",manageSkill:"Quản lý",syncRegistry:"Đồng bộ",installSkillTitle:"Cài đặt Kỹ năng",selectAgents:"Chọn agent đích",installLocation:"Vị trí cài đặt",globalInstall:"Toàn cục",projectInstall:"Dự án",confirmInstall:"Cài đặt cho các agent đã chọn",installingSkill:"Đang cài đặt...",skillInstallSuccess:"Cài đặt kỹ năng thành công",skillInstallFailed:"Cài đặt thất bại",agentClaudeCode:"Claude Code",agentCursor:"Cursor",agentCodex:"Codex",agentOpencode:"OpenCode",agentGoose:"Goose",agentGeminiCli:"Gemini CLI",agentAntigravity:"Antigravity",agentGithubCopilot:"GitHub Copilot",agentAmp:"Amp",agentKilo:"Kilo",agentRoo:"Roo",agentWindsurf:"Windsurf",agentCline:"Cline",agentOpenhands:"OpenHands",installed:"Đã cài",notInstalled:"Chưa cài",allAgents:"Tất cả Agent",filterByAgent:"Lọc theo agent",skillsTitle:"Kỹ năng",skillsSubtitle:"Duyệt, cài đặt và quản lý kỹ năng cho coding agents",availableCount:"Có sẵn",installedCount:"Đã cài",agentsCount:"Agents",searchSkills:"Tìm kiếm kỹ năng...",searchShortcut:"/",sortAZ:"A-Z",sortCategory:"Danh mục",sortInstalledFirst:"Đã cài trước",listView:"Dạng danh sách",gridView:"Dạng lưới",categoryAll:"Tất cả",categoryAI:"AI",categoryUIUX:"UI/UX",categoryBackend:"Backend",categorySecurity:"Bảo mật",categoryDevOps:"DevOps",categoryDatabase:"Cơ sở dữ liệu",categoryDevelopment:"Phát triển",categoryResearch:"Nghiên cứu",categoryGeneral:"Tổng quát",categoryCore:"Cốt lõi",categoryDocumentation:"Tài liệu",categoryTooling:"Công cụ",categoryMedia:"Phương tiện",categoryFrameworks:"Framework",skillsCountLabel:"{count} kỹ năng",installToAll:"Cài cho tất cả đã phát hiện",scopeLabel:"Phạm vi cài đặt",agentInstalled:"Đã cài",agentNotInstalled:"Chưa cài",skillSource:"Vị trí nguồn",skillSourceBadge:"Nguồn",detailPanelClose:"Đóng",versionLabel:"v{version}",installAllToAllAgents:"Cài tất cả cho tất cả Agent",bulkInstallFailed:"Cài hàng loạt thất bại",noAgentsDetected:"Không phát hiện agent nào",kitBadgeEngineer:"Engineer",kitBadgeMarketing:"Marketing",customizedBadge:"Đã tùy chỉnh",installedVersionLabel:"Phiên bản cài đặt",installedAtLabel:"Cài đặt lúc",sourceTimestampLabel:"Ngày nguồn",kitLabel:"Kit",skillMetadata:"Thông tin Skill",migrate:"Di trú",migrateTitle:"Di trú",migrateSubtitle:"Chuyển toàn bộ stack Claude Code sang provider khác",migrateDetectedProviders:"Đã phát hiện",migrateSelectedProviders:"Đã chọn",migrateDiscovering:"Đang quét nguồn di trú...",migrateRefresh:"Làm mới quét",migrateRun:"Chạy di trú",migrateRunning:"Đang di trú...",migrateSourceSummary:"Tổng quan nguồn",migratePresetCodex:"Codex",migratePresetAntigravity:"Antigravity",migratePresetCore:"Codex + Antigravity + Droid",migratePresetDetected:"Tất cả đã phát hiện",migrateScope:"Phạm vi",migrateScopeProject:"Dự án",migrateScopeGlobal:"Toàn cục",migrateTypes:"Loại di trú",migrateTypeAgents:"Subagents",migrateTypeCommands:"Commands",migrateTypeSkills:"Skills",migrateTypeConfig:"Config",migrateTypeRules:"Rules",migrateTypeHooks:"Hooks",migrateSearchProviders:"Tìm provider...",migrateSelectVisible:"Chọn phần đang hiện",migrateClearSelection:"Bỏ chọn tất cả",migrateProvidersHeading:"Provider đích",migrateProvidersCountSuffix:"provider",migrateNoProvidersMatch:"Không có provider khớp bộ lọc hiện tại.",migrateSelectButton:"Chọn",migrateSelectedButton:"Đã chọn",migrateSelectProviderAction:"Chọn provider",migrateUnselectProvider:"Bỏ chọn provider",migrateCapabilitiesLabel:"loại",migrateCapabilitiesSection:"Ma trận khả năng",migrateSupported:"Hỗ trợ",migrateUnsupportedShort:"Không hỗ trợ",migrateIncludedEnabled:"Đang bật",migrateIncludedDisabled:"Đang tắt",migrateLatestTarget:"Đích gần nhất",migrateNoResultForProvider:"Chưa có kết quả di trú cho provider này.",migrateActionSummaryTitle:"Sẵn sàng di trú",migrateGlobalOnlyCommandsShort:"Commands chỉ hỗ trợ global",migrateNoProviders:"Không có provider khả dụng.",migrateUnsupported:"Sẽ bỏ qua (không hỗ trợ)",migrateGlobalForced:"Provider đã chọn chỉ hỗ trợ command ở global scope. Chọn Global để cài.",migrateResults:"Kết quả di trú",migrateInstalled:"Đã cài",migrateSkipped:"Đã bỏ qua",migrateFailed:"Lỗi",migrateProvider:"Provider",migrateStatus:"Trạng thái",migratePath:"Đường dẫn",migrateError:"Lỗi",migrateStatusInstalled:"Đã cài",migrateStatusSkipped:"Đã bỏ qua",migrateStatusFailed:"Lỗi",migrateNoResults:"Chưa có kết quả di trú.",migrateDetectFailed:"Không thể quét dữ liệu di trú",migrateExecuteFailed:"Chạy di trú thất bại",migrateSelectProvider:"Vui lòng chọn ít nhất một provider",migrateNoTypesEnabled:"Bật ít nhất một loại di trú",migrateDetectedTag:"Đã phát hiện",migrateNotDetectedTag:"Chưa phát hiện",migrateFilterRecommended:"Đề xuất",migrateActionInstall:"Cài",migrateActionUpdate:"Cập nhật",migrateActionSkip:"Bỏ qua",migrateActionConflict:"Xung đột",migrateActionDelete:"Xóa",migrateUnchanged:"chưa thay đổi",migrateConflictSectionTitle:"Xung đột",migrateConflictUseCK:"Dùng CK",migrateConflictKeepMine:"Giữ của tôi",migrateConflictSmartMerge:"Merge thông minh",migrateConflictShowDiff:"Hiện diff",migrateConflictHideDiff:"Ẩn diff",migrateConflictResolved:"Đã giải quyết",migrateConflictManual:"Thủ công",migrateConflictOverwriteAll:"Ghi đè tất cả",migrateConflictKeepAll:"Giữ tất cả",migrateSummaryTitle:"Di trú hoàn tất",migrateSummaryNewMigration:"Di trú mới",migrateType:"Loại",migrateItem:"Mục",migrateReconciling:"Đang phân tích thay đổi...",migrateReviewPlan:"Xem kế hoạch",migrateExecutePlan:"Thực hiện di trú",migrateExecuting:"Đang thực hiện di trú...",migrateResolveConflicts:"Giải quyết xung đột trước khi thực hiện",migrateReason_newItem:"Mục mới từ provider",migrateReason_newProviderForItem:"Provider mới cho mục này",migrateReason_targetDeletedSourceChanged:"Đích đã xóa nhưng nguồn có thay đổi mới",migrateReason_targetDirEmptyReinstall:"Thư mục đích trống — cài lại",migrateReason_forceReinstall:"Yêu cầu cài lại bắt buộc",migrateReason_forceOverwrite:"Ghi đè bắt buộc (bạn đã chỉnh sửa, --force đang bật)",migrateReason_registryUpgradeReinstall:"Nâng cấp registry yêu cầu cài lại",migrateReason_sourceChanged:"Nguồn đã được cập nhật",migrateReason_registryUpgradeHeal:"Sửa đích cũ sau nâng cấp registry",migrateReason_noChanges:"Không phát hiện thay đổi",migrateReason_userEditsPreserved:"Giữ nguyên chỉnh sửa của người dùng",migrateReason_userDeletedRespected:"Tôn trọng việc xóa của người dùng",migrateReason_targetUpToDateBackfill:"Đích đã cập nhật",migrateReason_providerChecksumUnavailable:"Không có checksum provider",migrateReason_targetStateUnknown:"Không xác định được trạng thái đích",migrateReason_sourceRemovedOrphan:"Nguồn đã xóa — dọn dẹp orphan",migrateReason_renamedCleanup:"Mục đã đổi tên — xóa đường dẫn cũ",migrateReason_pathMigratedCleanup:"Đường dẫn đã di chuyển — xóa vị trí cũ",migrateReason_bothChanged:"Cả nguồn và đích đều có thay đổi",migrateReason_targetStateUnknownSourceChanged:"Nguồn thay đổi nhưng trạng thái đích không rõ",migrateBanner_emptyDir_title:"Phát hiện thư mục trống",migrateBanner_emptyDir_body:"mục bên dưới sẽ được cài lại. Bỏ chọn để bỏ qua.",migrateBanner_emptyDirRespected_title:"Tôn trọng việc xóa của bạn",migrateBanner_emptyDirRespected_body:"đang trống. Tôn trọng việc xóa của bạn.",migrateBanner_reinstallCta:"Cài lại các mục này",migrateModeLabel:"Chế độ di chuyển",migrateModeReconcile:"Đồng bộ",migrateModeReconcileDesc:"Phát hiện thay đổi thông minh",migrateModeInstall:"Cài đặt",migrateModeInstallDesc:"Chọn mục để cài",migrateModeConfirmTitle:"Chuyển chế độ?",migrateModeConfirmBody:"Bạn có {count} thay đổi chờ xử lý. Chuyển sang chế độ {mode} sẽ hủy chúng.",migrateModeConfirmSwitch:"Chuyển & hủy",migrateSmartDefaultInstall:"Phát hiện cài đặt mới — mặc định chế độ Cài đặt",migrateSmartDefaultReconcile:"Đã có registry — mặc định chế độ Đồng bộ",migrateInstallSelectAll:"Chọn tất cả",migrateInstallDeselectAll:"Bỏ chọn tất cả",migrateInstallDirItem:"thư mục",migrateInstallAlreadyInstalled:"đã cài",migrateInstallNoCandidates:"Không tìm thấy mục cài đặt nào cho provider đã chọn.",migrateInstallSelectedCount:"Đã chọn {count} / {total} mục",migrateInstallCta:"Cài {count} mục đã chọn",migrateInstallInstalling:"Đang cài...",migrateInstallLoadingCandidates:"Đang tải danh sách mục...",migrateFlip_moveToSkip:"Chuyển sang Bỏ qua",migrateFlip_moveToInstall:"Chuyển sang Cài",migrateFlip_checkAll:"Chọn tất cả",migrateFlip_uncheckAll:"Bỏ chọn tất cả",migrateFlip_toggleItem:"Bật/tắt mục",migrateConflictBanner_title:"Phát hiện xung đột",migrateConflictBanner_cta:"Mở trình giải quyết xung đột",migrateConflictBanner_hide:"Ẩn trình giải quyết xung đột",migrateShowSkippedItems:"Hiện mục đã bỏ qua",migrateHideSkippedItems:"Ẩn mục đã bỏ qua",migrateConflictBadge:"Xung đột",migrateSummarySubtitle:"mục đã di trú",migrateSummarySearchPlaceholder:"Tìm kiếm...",migrateSummaryFilterAll:"Tất cả",migrateSummaryCollapseAll:"Thu gọn",migrateSummaryExpandAll:"Mở rộng",migrateSummaryNoResults:"Không tìm thấy mục nào",migrateSummaryProviders:"Provider",migrateTypeUnknown:"Khác",kanbanTitle:"Bảng Kanban Kế hoạch",kanbanNoFile:"Chưa chọn file kế hoạch. Dùng tham số ?file=.",kanbanNoPhases:"Không phát hiện giai đoạn nào trong kế hoạch này",kanbanError400:"Yêu cầu không hợp lệ — thiếu tham số file",kanbanError403:"Truy cập bị từ chối — file nằm ngoài thư mục dự án",kanbanError404:"Không tìm thấy file kế hoạch",kanbanComplete:"hoàn thành",kanbanStatus_pending:"Chờ xử lý","kanbanStatus_in-progress":"Đang thực hiện",kanbanStatus_completed:"Hoàn thành",kanbanPhases:"giai đoạn",kanbanProgress:"Tiến độ",kanbanLoadError:"Không thể tải dữ liệu kế hoạch",plansNav:"Kế hoạch",plansTitle:"Bảng điều khiển kế hoạch",plansGlobalTitle:"Tất cả dự án",plansSubtitle:"Xem mọi kế hoạch đang hoạt động, timeline giai đoạn và thao tác nhanh trong một nơi.",plansEmpty:"Không tìm thấy kế hoạch",plansSearch:"Tìm kế hoạch...",plansProjectFilter:"Lọc theo dự án",plansAllProjects:"Tất cả dự án",plansSortBy:"Sắp xếp theo",plansViewGrid:"Lưới",plansViewKanban:"Kanban",plansFilterAll:"Tất cả trạng thái",plansSortDateDesc:"Mới nhất",plansSortDateAsc:"Cũ nhất",plansSortNameAsc:"Tên A-Z",plansSortNameDesc:"Tên Z-A",plansSortProgress:"Tiến độ cao nhất",plansLabel:"Kế hoạch",plansStatusPending:"Chờ xử lý",plansStatusInProgress:"Đang thực hiện",plansStatusInReview:"Đang rà soát",plansStatusDone:"Hoàn tất",plansStatusCancelled:"Đã huỷ",plansCompletedCount:"{count} hoàn thành",plansProjectPlans:"{count} kế hoạch",plansProjectLoadIssues:"Một số dự án không thể quét",plansStatusUnknown:"Chưa rõ",plansBackToPlans:"Quay lại danh sách kế hoạch",plansBackToPlan:"Quay lại kế hoạch",plansPrevious:"Trước",plansNext:"Sau",plansContents:"Mục lục",plansValidate:"Kiểm tra",plansStartNext:"Bắt đầu tiếp theo",plansRestart:"Bắt đầu lại",plansStart:"Bắt đầu",plansComplete:"Hoàn thành",plansReset:"Đặt lại",plansTimeline:"Timeline",plansActivity:"Hoạt động",plansActivitySubtitle:"12 tuần gần đây",plansActivityCombined:"Tổng hợp",plansActivityCommits:"Commit",plansActivityFiles:"Tệp",plansActivityEmpty:"Chưa có dữ liệu hoạt động.",plansHeatmapLoadError:"Không thể tải heatmap hoạt động.",plansHeatmapChanges:"{date} • {count} thay đổi",plansRead:"Đọc",plansPhases:"Giai đoạn",plansPhase:"Giai đoạn",plansPhaseCountCompact:"GD-{count}",plansKanbanEmpty:"Trống",plansLoadingPlan:"Đang tải kế hoạch...",plansLoadingReader:"Đang tải tài liệu...",plansLoadPlanFailed:"Không thể tải kế hoạch ({status})",plansLoadPlanFallback:"Không thể tải kế hoạch",plansLoadFileFailed:"Không thể tải tài liệu ({status})",plansLoadFileFallback:"Không thể tải tài liệu",plansProgressComplete:"Hoàn thành {count}%",plansPhaseCount:"{count} giai đoạn",plansPriority:"Ưu tiên",plansUpdated:"Cập nhật",plansLastUpdated:"Cập nhật lần cuối",plansPriorityLabel:"Ưu tiên {value}",plansUpdatedLabel:"Cập nhật {value}",plansTimelineAvgDays:"Trung bình {count} ngày",plansNoEffort:"Chưa có effort",plansNotFound:"Không tìm thấy kế hoạch",plansQuickInfoTitle:"Tổng quan kế hoạch",plansQuickInfoDescription:"Dùng chế độ xem này để theo dõi tiến độ giai đoạn, phạm vi timeline và hoạt động gần đây của kế hoạch.",plansCurrentStatus:"Trạng thái hiện tại",plansHeatmapMon:"T Hai",plansHeatmapWed:"T Tư",plansHeatmapFri:"T Sáu",developmentFeature:"Đang phát triển",betaFeature:"Beta",experimentalFeature:"Thử nghiệm",sectionModelTaxonomy:"Phân loại mô hình",taxonomyDescription:"Tuỳ chỉnh ánh xạ mô hình cho migration portable sang coding agent khác.",taxonomyTierHeavy:"Nặng (opus)",taxonomyTierBalanced:"Cân bằng (sonnet)",taxonomyTierLight:"Nhẹ (haiku)",taxonomyModel:"Mô hình",taxonomyEffort:"Mức nỗ lực",taxonomyResetProvider:"Đặt lại",taxonomyTier:"Cấp độ",statuslineBuilder:"Trình tạo dòng trạng thái",statuslineBuilderDescription:"Thiết kế bố cục dòng trạng thái bằng kéo và thả",statuslineSections:"Các mục",statuslinePreview:"Xem trước",statuslineTheme:"Giao diện màu sắc",statuslineSettings:"Cài đặt chung",statuslineResetDefaults:"Đặt lại mặc định",statuslineSave:"Lưu",statuslineBaseMode:"Chế độ cơ bản",statuslineBreakpoint:"Điểm ngắt responsive",statuslineMaxAgents:"Số agent tối đa",statuslineTodoTruncation:"Cắt ngắn task",statuslineEnable:"Bật",statuslineDisable:"Tắt",statuslineDragHint:"Kéo để thay đổi thứ tự, bật/tắt từng mục",statuslinePresetDefault:"Mặc định",statuslinePresetMonochrome:"Đơn sắc",statuslinePresetSolarized:"Solarized",statuslinePresetNord:"Nord",statuslinePresetDracula:"Dracula",statuslinePresetCatppuccin:"Catppuccin",statuslinePresetGruvbox:"Gruvbox",statuslinePresetTokyoNight:"Tokyo Night",statuslinePresetRosePine:"Rosé Pine",statuslinePresetOneDark:"One Dark",statuslinePresetAyu:"Ayu",statuslinePresetKanagawa:"Kanagawa",statuslinePresetStealth:"Ẩn mình",statuslinePresetHacker:"Hacker",statuslineSaved:"Đã lưu thành công",statuslineSaveError:"Lưu thất bại",statusline:"Dòng trạng thái",statuslineCollapseSettings:"Thu gọn cài đặt",statuslineExpandSettings:"Mở rộng cài đặt",statuslineIconOverride:"Ghi đè biểu tượng",statuslineLabelOverride:"Ghi đè nhãn",statuslineMaxWidth:"Chiều rộng tối đa (ký tự)",statuslineIconPlaceholder:"vd. 🤖",statuslineMaxWidthPlaceholder:"tự động",statuslineCustomColors:"Màu tùy chỉnh",statuslineColorContextGroup:"Cửa sổ ngữ cảnh",statuslineColorQuotaGroup:"Hạn mức sử dụng",statuslineColorGeneralGroup:"Chung",statuslineColorSectionGroup:"Màu từng mục",statuslineColorContextLow:"Thấp (<50%)",statuslineColorContextMid:"Trung (50-75%)",statuslineColorContextHigh:"Cao (>75%)",statuslineColorAccent:"Nhấn mạnh",statuslineColorMuted:"Giảm nhạt",statuslineColorSeparator:"Dấu phân cách",statuslineModeFullDesc:"Hiển thị tất cả các mục",statuslineModeCompactDesc:"Hiển thị thu gọn",statuslineModeMinimalDesc:"Chỉ thông tin cần thiết",statuslineModeNoneDesc:"Đã tắt",statuslinePreviewTitle:"Claude Code — xem trước dòng trạng thái",statuslinePreviewEmptyLine:"(dòng trống)",statuslinePreviewNoLines:"(chưa cấu hình dòng nào)",statuslineSectionModelLabel:"Mô hình",statuslineSectionContextLabel:"Cửa sổ ngữ cảnh",statuslineSectionQuotaLabel:"Hạn mức sử dụng",statuslineSectionDirectoryLabel:"Thư mục",statuslineSectionGitLabel:"Trạng thái Git",statuslineSectionCostLabel:"Chi phí",statuslineSectionChangesLabel:"Thay đổi",statuslineSectionAgentsLabel:"Agents",statuslineSectionTodosLabel:"Nhiệm vụ",statuslineSectionModelDesc:"Tên mô hình AI và nhà cung cấp",statuslineSectionContextDesc:"Thanh sử dụng cửa sổ ngữ cảnh",statuslineSectionQuotaDesc:"Hạn mức sử dụng 5 giờ và hàng tuần",statuslineSectionDirectoryDesc:"Thư mục làm việc hiện tại",statuslineSectionGitDesc:"Nhánh Git, thay đổi đã/chưa staged",statuslineSectionCostDesc:"Ước tính chi phí phiên",statuslineSectionChangesDesc:"Dòng thêm và xóa",statuslineSectionAgentsDesc:"Hoạt động agent gần đây",statuslineSectionTodosDesc:"Tiến độ tác vụ hiện tại",statuslineSectionsVisible:"mục hiển thị",statuslineLoadErrorSaveDisabled:"Không thể tải bố cục đã lưu. Tính năng lưu đã bị tắt để tránh mất dữ liệu.",statuslineAddLine:"Thêm dòng",statuslineRemoveLine:"Xóa",statuslineHiddenSections:"Mục ẩn",statuslineDragToLine:"Kéo mục vào dòng để hiển thị",statuslineQuotaLow:"Hạn mức thấp",statuslineQuotaHigh:"Hạn mức cao",statuslineLine:"Dòng",sessionsTitle:"Phiên làm việc",sessionDetail:"Chi tiết phiên",sessionMessages:"tin nhắn",sessionToolCalls:"lệnh gọi",sessionDuration:"Thời lượng",noSessionsData:"Không tìm thấy phiên",sessionReadOnly:"Chế độ chỉ xem",sessionLastActive:"Hoạt động lần cuối",sessionProjectSessions:"Phiên dự án",sessionBack:"Quay lại",sessionLoading:"Đang tải...",sessionError:"Tải thất bại",sessionCount:"phiên",sessionToolInput:"Đầu vào",sessionToolResult:"Kết quả",sessionToolsUsed:"Công cụ đã dùng",sessionSystemContext:"Ngữ cảnh hệ thống",sessionExpandAll:"Mở rộng tất cả",sessionCollapseAll:"Thu gọn tất cả",sessionNoContent:"Không có nội dung",sessionUser:"Người dùng",sessionAssistant:"Trợ lý",sessionThinking:"Đang suy nghĩ...",sessionSearchPlaceholder:"Tìm trong hội thoại...",sessionSearchResults:"kết quả",sessionNoResults:"Không tìm thấy",sessionGroupMessages:"tin nhắn",palettePlaceholder:"Tìm agents, lệnh, skills...",paletteNoResults:"Không tìm thấy kết quả",paletteAgents:"Agents",paletteCommands:"Lệnh",paletteSkills:"Skills",paletteProjects:"Dự án",paletteNavigation:"Điều hướng",skillsBrowser:"Skills",skillsCount:"{count} skills",skillDetail:"Chi tiết Skill",searchSkillsBrowserPlaceholder:"Tìm skills...",noSkillsBrowserFound:"Không tìm thấy skill",backToSkillsBrowser:"Quay lại Skills",skillTriggers:"Kích hoạt",skillLocal:"Cục bộ",skillGithub:"GitHub",systemNavLabel:"Hệ thống",dashboardTitle:"Bảng điều khiển",dashboardAgents:"Agents",dashboardCommands:"Lệnh",dashboardSkills:"Skills",dashboardMcpServers:"MCP Servers",configured:"Đã cấu hình",available:"Có sẵn",modelDistribution:"Phân bổ Model",recentAgents:"Agents gần đây",suggestionsTitle:"Gợi ý",acrossAgents:"trên {count} agents",noAgentsConfigured:"Chưa có agents trong ~/.claude/agents/",mcpTitle:"MCP Servers",mcpServerName:"Server",mcpCommand:"Lệnh",mcpArgs:"Tham số",mcpSource:"Nguồn",mcpStatus:"Trạng thái",mcpConfigured:"Đã cấu hình",mcpNoServers:"Chưa cấu hình MCP server",mcpSourceSettings:"settings.json",mcpSourceMcpJson:".mcp.json",mcpSourceProject:"Dự án",mcpToolCount:"Công cụ",agentsBrowser:"Agents",agentsBrowserCount:"{count} agents",filterAll:"Tất cả",agentDetail:"Chi tiết Agent",agentInstructions:"Hướng dẫn",agentFrontmatter:"Cấu hình",searchAgentsPlaceholder:"Tìm agents...",noAgentsFound:"Không tìm thấy agent",backToAgents:"Quay lại Agents",commandsBrowser:"Lệnh",commandsCount:"{count} lệnh",commandDetail:"Chi tiết lệnh",searchCommandsPlaceholder:"Tìm lệnh...",noCommandsFound:"Không tìm thấy lệnh",backToCommands:"Quay lại Lệnh",rootCommands:"Gốc",selectToView:"Chọn mục để xem chi tiết",indexingFrom:"Lấy từ",workflowsTitle:"Quy trình",workflowsSubtitle:"Tìm hiểu ClaudeKit thông qua hình ảnh hóa quy trình tương tác.",workflowsCredit:"Dữ liệu quy trình và giao diện được lấy cảm hứng từ",workflowImplementationRecipe:"Công thức triển khai",workflowSearchPlaceholder:"Tìm quy trình...",workflowNoResults:"Không tìm thấy quy trình",loadingWorkflows:"Đang tải quy trình...",workflowCategoryAll:"Tất cả",workflowCategoryGettingStarted:"Bắt đầu",workflowCategoryDesignFrontend:"Thiết kế & Frontend",workflowCategoryDebuggingFixes:"Xóa lỗi & Kiểm thử",workflowCategoryPlanningReview:"Lập kế hoạch & Đánh giá",workflowCategoryResearchDocs:"Nghiên cứu & Tài liệu",workflowCategoryShipping:"Triển khai",workflowCategoryBackendInfra:"Backend & Hạ tầng",workflowCategoryMediaCreative:"Truyền thông & Sáng tạo",workflowCategoryAdvanced:"Nâng cao",workflowComplexityBeginner:"Cơ bản",workflowComplexityIntermediate:"Trung bình",workflowComplexityAdvanced:"Nâng cao",workflowBuildFeature:"Xây dựng tính năng mới",workflowBuildFeatureDesc:"Thêm chức năng mới vào ứng dụng một cách hệ thống.",workflowQuickImplementation:"Triển khai nhanh",workflowQuickImplementationDesc:"Triển khai nhanh chóng các tính năng nhỏ gọn.",workflowStartNewProject:"Bắt đầu dự án mới",workflowStartNewProjectDesc:"Tạo lập một dự án mới hoàn toàn với nền tảng tiêu chuẩn.",workflowFrontendDesign:"Thiết kế Frontend",workflowFrontendDesignDesc:"Tạo giao diện người dùng dựa trên nguyên tắc thẩm mỹ cao.",workflowAiDesignStitch:"Thiết kế bằng AI Stitch",workflowAiDesignStitchDesc:"Điều khiển Google Stitch để tạo bản thiết kế từ văn bản.",workflowExcalidraw:"Bản vẽ Excalidraw",workflowExcalidrawDesc:"Diễn họa kiến trúc hoạt động sử dụng Excalidraw JSON.",workflowFixBug:"Sửa lỗi (Fix Bug)",workflowFixBugDesc:"Xác định nguyên nhân gốc rễ và tự động sửa các lỗi trong mã nguồn.",workflowSecurityAudit:"Kiểm toán Bảo mật",workflowSecurityAuditDesc:"Kiểm tra bảo mật toàn diện trên kho ứng dụng.",workflowTestScenarios:"Tình huống thử nghiệm",workflowTestScenariosDesc:"Tạo các trường hợp biên và tình huống thử nghiệm tính năng con.",workflowStride:"Phân tích STRIDE",workflowStrideDesc:"Thực hiện mô hình hóa và phân tích rủi ro bảo mật theo chuẩn STRIDE.",workflowCodeReview:"Code Review",workflowCodeReviewDesc:"Đánh giá chất lượng mã nguồn một cách kỹ lưỡng.",workflowPlanValidate:"Lập Kế hoạch + Kiểm chứng",workflowPlanValidateDesc:"Lập bản thảo thiết kế kiến trúc và đánh giá tính khả thi kỹ thuật.",workflowAdversarialReview:"Đánh giá Đối kháng",workflowAdversarialReviewDesc:"Kích hoạt chức năng đánh giá mức độ rủi ro hệ thống.",workflowAutoresearch:"Vòng lặp tự động (Autoloop)",workflowAutoresearchDesc:"Chạy vòng lặp tối ưu hóa tự động cho bất kỳ chỉ số nào.",workflowXia:"Chuyển giao thuật toán",workflowXiaDesc:"Chuyển giao hoặc tách rời thuật toán từ một kho lưu trữ bên ngoài.",workflowVisualDocumentation:"Diễn họa Tài liệu",workflowVisualDocumentationDesc:"Tạo sơ đồ mô tả logic và kiến trúc trong hệ thống hiện tại.",workflowTechnicalResearch:"Nghiên cứu Kỹ thuật",workflowTechnicalResearchDesc:"Phân tích sâu rộng cho các giải pháp kiến trúc trước khi triển khai.",workflowLlmsTxt:"Tạo cấu trúc llms.txt",workflowLlmsTxtDesc:"Phân tích mã nguồn và sinh tập tin llms.txt tiêu chuẩn.",workflowDevops:"DevOps / Triển khai",workflowDevopsDesc:"Cấu hình Docker, CI/CD và triển khai quy trình nền tảng web.",workflowShip:"Cập bến (Ship Pipeline)",workflowShipDesc:"Hợp nhất, kiểm thử, đánh giá, commit, và tạo Pull Request mới.",workflowDatabaseOps:"Thao tác CSDL",workflowDatabaseOpsDesc:"Tái cấu trúc các pipeline dữ liệu phức tạp tăng cường hiệu năng CSDL.",workflowRemotion:"Remotion Video",workflowRemotionDesc:"Xây dựng chuỗi video code thông qua thư viện Remotion.",workflowShowOff:"Show-Off Demo",workflowShowOffDesc:"Tạo file demo HTML tĩnh và trực quan cho mục đích showcase ứng dụng.",workflowAgentTeams:"Đội ngũ Agents",workflowAgentTeamsDesc:"Sinh các agent song song thực hiện nhiều tác vụ kết nối với nhau.",workflowWorktree:"Worktree Song song",workflowWorktreeDesc:"Cách ly và làm việc đồng thời trên nhiều luồng phát triển bằng worktrees."}},Np=g.createContext(null),Bv="ck-dashboard-lang";function X3(){const t=localStorage.getItem(Bv);return t==="en"||t==="vi"?t:navigator.language.startsWith("vi")?"vi":"en"}function Q3({children:t}){const[e,n]=g.useState(X3),r=g.useCallback(o=>{localStorage.setItem(Bv,o),n(o)},[]),s=g.useCallback(o=>Y3[e][o],[e]),i=g.useMemo(()=>({lang:e,setLang:r,t:s}),[e,r,s]);return c.jsx(Np.Provider,{value:i,children:t})}function ne(){const t=g.useContext(Np);if(!t)throw new Error("useI18n must be used within I18nProvider");return t}class J3 extends g.Component{constructor(){super(...arguments);Xm(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("App error:",n,r.componentStack)}render(){if(this.state.hasError){const n=this.state.error?.name==="ServerUnavailableError";return c.jsx(Np.Consumer,{children:r=>c.jsx("div",{className:"flex h-screen items-center justify-center bg-dash-bg",children:c.jsx("div",{className:"text-center space-y-4 max-w-md px-6",children:n?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-16 h-16 mx-auto rounded-full bg-orange-500/10 border border-orange-500/30 flex items-center justify-center text-3xl",children:"🔌"}),c.jsx("h1",{className:"text-2xl font-bold text-orange-500",children:r?.t("serverNotRunning")??"Server Not Running"}),c.jsx("p",{className:"text-dash-text-secondary",children:r?.t("startServerMessage")??"The Config UI requires the backend server to be running."}),c.jsxs("div",{className:"bg-dash-surface border border-dash-border rounded-lg p-4",children:[c.jsx("p",{className:"text-xs text-dash-text-muted uppercase tracking-widest mb-2 font-bold",children:r?.t("runThisCommand")??"Run this command"}),c.jsx("code",{className:"block text-sm text-dash-accent font-mono bg-dash-bg px-3 py-2 rounded border border-dash-border",children:"ck config"})]}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-2 bg-dash-accent text-dash-bg rounded-lg font-bold hover:bg-dash-accent-hover transition-colors",children:r?.t("tryAgain")??"Try Again"})]}):c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-2xl font-bold text-red-500",children:r?.t("somethingWentWrong")??"Something went wrong"}),c.jsx("p",{className:"text-dash-text-muted",children:this.state.error?.message}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-dash-accent text-white rounded-md hover:opacity-90",children:r?.t("reloadApp")??"Reload App"})]})})})})}return this.props.children}}const kn=({direction:t="horizontal",isDragging:e=!1,onMouseDown:n})=>{const r=t==="horizontal";return c.jsx("div",{onMouseDown:n,className:`
|
|
21
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let f=_n(),p;p=f;let m=p.pathname||"/",x=m;if(u!=="/"){let w=u.replace(/^\//,"").split("/");x="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let b=Br(t,{pathname:x});return qe(h||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),qe(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),q5(b&&b.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:nr([u,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:nr([u,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),o,n,r,s)}function W5(){let t=Z5(),e=$o(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:i},"ErrorBoundary")," or"," ",g.createElement("code",{style:i},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},e),n?g.createElement("pre",{style:s},n):null,o)}var K5=g.createElement(W5,null),Ov=class extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=B5(t.digest);n&&(t=n)}let e=t!==void 0?g.createElement(Nn.Provider,{value:this.props.routeContext},g.createElement(wp.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?g.createElement(U5,{error:t},e):e}};Ov.contextType=Cv;var Nu=new WeakMap;function U5({children:t,error:e}){let{basename:n}=g.useContext(ln);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=$5(e.digest);if(r){let s=Nu.get(e);if(s)throw s;let i=hv(r.location,n);if(uv&&!Nu.get(e))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw Nu.set(e,o),o}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function G5({routeContext:t,match:e,children:n}){let r=g.useContext(Is);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),g.createElement(Nn.Provider,{value:t},n)}function q5(t,e=[],n=null,r=null,s=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,o=n?.errors;if(o!=null){let u=i.findIndex(h=>h.route.id&&o?.[h.route.id]!==void 0);Pe(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let a=!1,l=-1;if(n)for(let u=0;u<i.length;u++){let h=i[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=u),h.route.id){let{loaderData:f,errors:p}=n,m=h.route.loader&&!f.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||m){a=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}let d=n&&r?(u,h)=>{r(u,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:el(n.matches),errorInfo:h})}:void 0;return i.reduceRight((u,h,f)=>{let p,m=!1,x=null,b=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,x=h.route.errorElement||K5,a&&(l<0&&f===0?(Mv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,b=null):l===f&&(m=!0,b=h.route.hydrateFallbackElement||null)));let y=e.concat(i.slice(0,f+1)),w=()=>{let v;return p?v=x:m?v=b:h.route.Component?v=g.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=u,g.createElement(G5,{match:h,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?g.createElement(Ov,{location:n.location,revalidation:n.revalidation,component:x,error:p,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:d}):w()},null)}function kp(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y5(t){let e=g.useContext(Is);return Pe(e,kp(t)),e}function X5(t){let e=g.useContext(tl);return Pe(e,kp(t)),e}function Q5(t){let e=g.useContext(Nn);return Pe(e,kp(t)),e}function Sp(t){let e=Q5(t),n=e.matches[e.matches.length-1];return Pe(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function J5(){return Sp("useRouteId")}function Z5(){let t=g.useContext(wp),e=X5("useRouteError"),n=Sp("useRouteError");return t!==void 0?t:e.errors?.[n]}function e3(){let{router:t}=Y5("useNavigate"),e=Sp("useNavigate"),n=g.useRef(!1);return Dv(()=>{n.current=!0}),g.useCallback(async(s,i={})=>{qe(n.current,Pv),n.current&&(typeof s=="number"?await t.navigate(s):await t.navigate(s,{fromRouteId:e,...i}))},[t,e])}var vg={};function Mv(t,e,n){!e&&!vg[t]&&(vg[t]=!0,qe(!1,n))}var wg={};function kg(t,e){!t&&!wg[e]&&(wg[e]=!0,console.warn(e))}var t3="useOptimistic",Sg=pj[t3],n3=()=>{};function r3(t){return Sg?Sg(t):[t,n3]}function s3(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&qe(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:g.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&qe(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:g.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&qe(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:g.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var i3=["HydrateFallback","hydrateFallbackElement"],o3=class{constructor(){this.status="pending",this.promise=new Promise((t,e)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",e(n))}})}};function a3({router:t,flushSync:e,onError:n,unstable_useTransitions:r}){r=T5()||r;let[i,o]=g.useState(t.state),[a,l]=r3(i),[d,u]=g.useState(),[h,f]=g.useState({isTransitioning:!1}),[p,m]=g.useState(),[x,b]=g.useState(),[y,w]=g.useState(),v=g.useRef(new Map),k=g.useCallback((D,{deletedFetchers:E,newErrors:M,flushSync:P,viewTransitionOpts:A})=>{M&&n&&Object.values(M).forEach(j=>n(j,{location:D.location,params:D.matches[0]?.params??{},unstable_pattern:el(D.matches)})),D.fetchers.forEach((j,O)=>{j.data!==void 0&&v.current.set(O,j.data)}),E.forEach(j=>v.current.delete(j)),kg(P===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let R=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(kg(A==null||R,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!A||!R){e&&P?e(()=>o(D)):r===!1?o(D):g.startTransition(()=>{r===!0&&l(j=>Cg(j,D)),o(D)});return}if(e&&P){e(()=>{x&&(p?.resolve(),x.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:A.currentLocation,nextLocation:A.nextLocation})});let j=t.window.document.startViewTransition(()=>{e(()=>o(D))});j.finished.finally(()=>{e(()=>{m(void 0),b(void 0),u(void 0),f({isTransitioning:!1})})}),e(()=>b(j));return}x?(p?.resolve(),x.skipTransition(),w({state:D,currentLocation:A.currentLocation,nextLocation:A.nextLocation})):(u(D),f({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}))},[t.window,e,x,p,r,l,n]);g.useLayoutEffect(()=>t.subscribe(k),[t,k]),g.useEffect(()=>{h.isTransitioning&&!h.flushSync&&m(new o3)},[h]),g.useEffect(()=>{if(p&&d&&t.window){let D=d,E=p.promise,M=t.window.document.startViewTransition(async()=>{r===!1?o(D):g.startTransition(()=>{r===!0&&l(P=>Cg(P,D)),o(D)}),await E});M.finished.finally(()=>{m(void 0),b(void 0),u(void 0),f({isTransitioning:!1})}),b(M)}},[d,p,t.window,r,l]),g.useEffect(()=>{p&&d&&a.location.key===d.location.key&&p.resolve()},[p,x,a.location,d]),g.useEffect(()=>{!h.isTransitioning&&y&&(u(y.state),f({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),w(void 0))},[h.isTransitioning,y]);let C=g.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:D=>t.navigate(D),push:(D,E,M)=>t.navigate(D,{state:E,preventScrollReset:M?.preventScrollReset}),replace:(D,E,M)=>t.navigate(D,{replace:!0,state:E,preventScrollReset:M?.preventScrollReset})}),[t]),N=t.basename||"/",S=g.useMemo(()=>({router:t,navigator:C,static:!1,basename:N,onError:n}),[t,C,N,n]);return g.createElement(g.Fragment,null,g.createElement(Is.Provider,{value:S},g.createElement(tl.Provider,{value:a},g.createElement(jv.Provider,{value:v.current},g.createElement(vp.Provider,{value:h},g.createElement(u3,{basename:N,location:a.location,navigationType:a.historyAction,navigator:C,unstable_useTransitions:r},g.createElement(l3,{routes:t.routes,future:t.future,state:a,onError:n})))))),null)}function Cg(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var l3=g.memo(c3);function c3({routes:t,future:e,state:n,onError:r}){return V5(t,void 0,n,r,e)}function Av({to:t,replace:e,state:n,relative:r}){Pe(Ii(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=g.useContext(ln);qe(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=g.useContext(Nn),{pathname:o}=_n(),a=Lt(),l=$d(t,Id(i),o,r==="path"),d=JSON.stringify(l);return g.useEffect(()=>{a(JSON.parse(d),{replace:e,state:n,relative:r})},[a,d,r,e,n]),null}function d3(t){return H5(t.context)}function u3({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:o}){Pe(!Ii(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=g.useMemo(()=>({basename:a,navigator:s,static:i,unstable_useTransitions:o,future:{}}),[a,s,i,o]);typeof n=="string"&&(n=ns(n));let{pathname:d="/",search:u="",hash:h="",state:f=null,key:p="default"}=n,m=g.useMemo(()=>{let x=Cn(d,a);return x==null?null:{location:{pathname:x,search:u,hash:h,state:f,key:p},navigationType:r}},[a,d,u,h,f,p,r]);return qe(m!=null,`<Router basename="${a}"> is not able to match the URL "${d}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:g.createElement(ln.Provider,{value:l},g.createElement(Bd.Provider,{children:e,value:m}))}var vc="get",wc="application/x-www-form-urlencoded";function _d(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function h3(t){return _d(t)&&t.tagName.toLowerCase()==="button"}function f3(t){return _d(t)&&t.tagName.toLowerCase()==="form"}function p3(t){return _d(t)&&t.tagName.toLowerCase()==="input"}function m3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function g3(t,e){return t.button===0&&(!e||e==="_self")&&!m3(t)}function Xh(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function x3(t,e){let n=Xh(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}var Tl=null;function b3(){if(Tl===null)try{new FormData(document.createElement("form"),0),Tl=!1}catch{Tl=!0}return Tl}var y3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pu(t){return t!=null&&!y3.has(t)?(qe(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wc}"`),null):t}function v3(t,e){let n,r,s,i,o;if(f3(t)){let a=t.getAttribute("action");r=a?Cn(a,e):null,n=t.getAttribute("method")||vc,s=Pu(t.getAttribute("enctype"))||wc,i=new FormData(t)}else if(h3(t)||p3(t)&&(t.type==="submit"||t.type==="image")){let a=t.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=t.getAttribute("formaction")||a.getAttribute("action");if(r=l?Cn(l,e):null,n=t.getAttribute("formmethod")||a.getAttribute("method")||vc,s=Pu(t.getAttribute("formenctype"))||Pu(a.getAttribute("enctype"))||wc,i=new FormData(a,t),!b3()){let{name:d,type:u,value:h}=t;if(u==="image"){let f=d?`${d}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}else d&&i.append(d,h)}}else{if(_d(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=vc,r=null,s=wc,o=t}return i&&s==="text/plain"&&(o=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cp(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function w3(t,e,n){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname=`_root.${n}`:e&&Cn(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function k3(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function S3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function C3(t,e,n){let r=await Promise.all(t.map(async s=>{let i=e.routes[s.route.id];if(i){let o=await k3(i,n);return o.links?o.links():[]}return[]}));return D3(r.flat(1).filter(S3).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function jg(t,e,n,r,s,i){let o=(l,d)=>n[d]?l.route.id!==n[d].route.id:!0,a=(l,d)=>n[d].pathname!==l.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==l.params["*"];return i==="assets"?e.filter((l,d)=>o(l,d)||a(l,d)):i==="data"?e.filter((l,d)=>{let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(o(l,d)||a(l,d))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function j3(t,e,{includeHydrateFallback:n}={}){return N3(t.map(r=>{let s=e.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function N3(t){return[...new Set(t)]}function P3(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function D3(t,e){let n=new Set;return new Set(e),t.reduce((r,s)=>{let i=JSON.stringify(P3(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function Tv(){let t=g.useContext(Is);return Cp(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function E3(){let t=g.useContext(tl);return Cp(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var jp=g.createContext(void 0);jp.displayName="FrameworkContext";function Lv(){let t=g.useContext(jp);return Cp(t,"You must render this element inside a <HydratedRouter> element"),t}function O3(t,e){let n=g.useContext(jp),[r,s]=g.useState(!1),[i,o]=g.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:d,onMouseLeave:u,onTouchStart:h}=e,f=g.useRef(null);g.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let x=y=>{y.forEach(w=>{o(w.isIntersecting)})},b=new IntersectionObserver(x,{threshold:.5});return f.current&&b.observe(f.current),()=>{b.disconnect()}}},[t]),g.useEffect(()=>{if(r){let x=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(x)}}},[r]);let p=()=>{s(!0)},m=()=>{s(!1),o(!1)};return n?t!=="intent"?[i,f,{}]:[i,f,{onFocus:eo(a,p),onBlur:eo(l,m),onMouseEnter:eo(d,p),onMouseLeave:eo(u,m),onTouchStart:eo(h,p)}]:[!1,f,{}]}function eo(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function M3({page:t,...e}){let{router:n}=Tv(),r=g.useMemo(()=>Br(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?g.createElement(T3,{page:t,matches:r,...e}):null}function A3(t){let{manifest:e,routeModules:n}=Lv(),[r,s]=g.useState([]);return g.useEffect(()=>{let i=!1;return C3(t,e,n).then(o=>{i||s(o)}),()=>{i=!0}},[t,e,n]),r}function T3({page:t,matches:e,...n}){let r=_n(),{manifest:s,routeModules:i}=Lv(),{basename:o}=Tv(),{loaderData:a,matches:l}=E3(),d=g.useMemo(()=>jg(t,e,l,s,r,"data"),[t,e,l,s,r]),u=g.useMemo(()=>jg(t,e,l,s,r,"assets"),[t,e,l,s,r]),h=g.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let m=new Set,x=!1;if(e.forEach(y=>{let w=s.routes[y.route.id];!w||!w.hasLoader||(!d.some(v=>v.route.id===y.route.id)&&y.route.id in a&&i[y.route.id]?.shouldRevalidate||w.hasClientLoader?x=!0:m.add(y.route.id))}),m.size===0)return[];let b=w3(t,o,"data");return x&&m.size>0&&b.searchParams.set("_routes",e.filter(y=>m.has(y.route.id)).map(y=>y.route.id).join(",")),[b.pathname+b.search]},[o,a,r,s,d,e,t,i]),f=g.useMemo(()=>j3(u,s),[u,s]),p=A3(u);return g.createElement(g.Fragment,null,h.map(m=>g.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...n})),f.map(m=>g.createElement("link",{key:m,rel:"modulepreload",href:m,...n})),p.map(({key:m,link:x})=>g.createElement("link",{key:m,nonce:n.nonce,...x})))}function L3(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var R3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{R3&&(window.__reactRouterVersion="7.11.0")}catch{}function I3(t,e){return l5({basename:e?.basename,getContext:e?.getContext,future:e?.future,history:Cj({window:e?.window}),hydrationData:$3(),routes:t,mapRouteProperties:s3,hydrationRouteProperties:i3,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window,unstable_instrumentations:e?.unstable_instrumentations}).initialize()}function $3(){let t=window?.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:B3(t.errors)}),t}function B3(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,s]of e)if(s&&s.__type==="RouteErrorResponse")n[r]=new Za(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}var Rv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Iv=g.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:o,state:a,target:l,to:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},m){let{basename:x,unstable_useTransitions:b}=g.useContext(ln),y=typeof d=="string"&&Rv.test(d),w=hv(d,x);d=w.to;let v=_5(d,{relative:s}),[k,C,N]=O3(r,p),S=H3(d,{replace:o,state:a,target:l,preventScrollReset:u,relative:s,viewTransition:h,unstable_defaultShouldRevalidate:f,unstable_useTransitions:b});function D(M){e&&e(M),M.defaultPrevented||S(M)}let E=g.createElement("a",{...p,...N,href:w.absoluteURL||v,onClick:w.isExternal||i?e:D,ref:L3(m,C),target:l,"data-discover":!y&&n==="render"?"true":void 0});return k&&!y?g.createElement(g.Fragment,null,E,g.createElement(M3,{page:v})):E});Iv.displayName="Link";var _3=g.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:o,viewTransition:a,children:l,...d},u){let h=rl(o,{relative:d.relative}),f=_n(),p=g.useContext(tl),{navigator:m,basename:x}=g.useContext(ln),b=p!=null&&G3(h)&&a===!0,y=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,w=f.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(w=w.toLowerCase(),v=v?v.toLowerCase():null,y=y.toLowerCase()),v&&x&&(v=Cn(v,x)||v);const k=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let C=w===y||!s&&w.startsWith(y)&&w.charAt(k)==="/",N=v!=null&&(v===y||!s&&v.startsWith(y)&&v.charAt(y.length)==="/"),S={isActive:C,isPending:N,isTransitioning:b},D=C?e:void 0,E;typeof r=="function"?E=r(S):E=[r,C?"active":null,N?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(S):i;return g.createElement(Iv,{...d,"aria-current":D,className:E,ref:u,style:M,to:o,viewTransition:a},typeof l=="function"?l(S):l)});_3.displayName="NavLink";var F3=g.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:s,state:i,method:o=vc,action:a,onSubmit:l,relative:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:x}=g.useContext(ln),b=K3(),y=U3(a,{relative:d}),w=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&Rv.test(a),k=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let N=C.nativeEvent.submitter,S=N?.getAttribute("formmethod")||o,D=()=>b(N||C.currentTarget,{fetcherKey:e,method:S,navigate:n,replace:s,state:i,relative:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f});x&&n!==!1?g.startTransition(()=>D()):D()};return g.createElement("form",{ref:m,method:w,action:y,onSubmit:r?l:k,...p,"data-discover":!v&&t==="render"?"true":void 0})});F3.displayName="Form";function z3(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $v(t){let e=g.useContext(Is);return Pe(e,z3(t)),e}function H3(t,{target:e,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a,unstable_useTransitions:l}={}){let d=Lt(),u=_n(),h=rl(t,{relative:i});return g.useCallback(f=>{if(g3(f,e)){f.preventDefault();let p=n!==void 0?n:ir(u)===ir(h),m=()=>d(t,{replace:p,state:r,preventScrollReset:s,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a});l?g.startTransition(()=>m()):m()}},[u,d,h,n,r,e,t,s,i,o,a,l])}function sl(t){qe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=g.useRef(Xh(t)),n=g.useRef(!1),r=_n(),s=g.useMemo(()=>x3(r.search,n.current?null:e.current),[r.search]),i=Lt(),o=g.useCallback((a,l)=>{const d=Xh(typeof a=="function"?a(new URLSearchParams(s)):a);n.current=!0,i("?"+d,l)},[i,s]);return[s,o]}var V3=0,W3=()=>`__${String(++V3)}__`;function K3(){let{router:t}=$v("useSubmit"),{basename:e}=g.useContext(ln),n=J5(),r=t.fetch,s=t.navigate;return g.useCallback(async(i,o={})=>{let{action:a,method:l,encType:d,formData:u,body:h}=v3(i,e);if(o.navigate===!1){let f=o.fetcherKey||W3();await r(f,n,o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||l,formEncType:o.encType||d,flushSync:o.flushSync})}else await s(o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||l,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,s,e,n])}function U3(t,{relative:e}={}){let{basename:n}=g.useContext(ln),r=g.useContext(Nn);Pe(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...rl(t||".",{relative:e})},o=_n();if(t==null){i.search=o.search;let a=new URLSearchParams(i.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(h=>h).forEach(h=>a.append("index",h));let u=a.toString();i.search=u?`?${u}`:""}}return(!t||t===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:nr([n,i.pathname])),ir(i)}function G3(t,{relative:e}={}){let n=g.useContext(vp);Pe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=$v("useViewTransitionState"),s=rl(t,{relative:e});if(!n.isTransitioning)return!1;let i=Cn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Cn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _c(s.pathname,o)!=null||_c(s.pathname,i)!=null}function q3(t){return g.createElement(a3,{flushSync:bs.flushSync,...t})}const Y3={en:{loading:"Loading...",error:"Error",selectProject:"Select a project to view dashboard",controlCenter:"Control Center",settings:"Settings",sync:"Sync",offline:"Offline",switchToLight:"Switch to light mode",switchToDark:"Switch to dark mode",settingsSection:"Settings",overviewSection:"Overview",entitiesSection:"Entities",toolsSection:"Tools",configEditor:"Config Editor",projects:"Projects",addProject:"Add Project",global:"Global",skills:"Skills",skillsNav:"Skills",health:"Health",collapse:"Collapse",expand:"Expand",installing:"Installing...",manage:"Manage",uninstall:"Uninstall",installGlobally:"Install Globally",installGloballyDesc:"Available to all projects instead of current project only",selectAtLeastOneAgent:"Please select at least one agent",installationFailed:"Installation failed",allSkills:"All Skills",refresh:"Refresh",browseAndManageSkills:"Browse and manage skills for your agents",detected:"Detected",notDetected:"Not detected",sessions:"sessions",noSessions:"No sessions",terminal:"Terminal",terminalSub:"Open bash at path",editor:"Editor",editorSub:"Open in VS Code",useGlobalFallback:"Use global fallback",openAtPath:"Open at project path",openAppOnly:"Open app only",actionOptionsLoadFailed:"Could not load editor/terminal options",launch:"Launch",launchSub:"Start Claude Code",config:"Config",configSub:"Manage project settings",recentSessions:"Recent Sessions",viewAllHistory:"View All History",showLess:"Show Less",actionFailed:"Action failed",loadingSessions:"Loading sessions...",noSessionsFound:"No sessions found",configuration:"Claude Settings",planSettingsTitle:"Plan Settings",activeKit:"Active Kit",aiModel:"Model",hooks:"Hooks",active:"active",mcpServers:"MCP Servers",connected:"connected",plansDirectory:"Plans Directory",validationMode:"Validation Mode",planScopeLabel:"Scope",planScopeProject:"project",planScopeGlobal:"global",activePlansLabel:"Active Plans",activePlansTitle:"Active Plans",noActivePlansFound:"No active plans found",openPlan:"Open Plan",openKanban:"Open Kanban",blockedByLabel:"Blocked by",progressLabel:"Progress",editProjectConfig:"Edit Project Config",projectPreferenceSaveFailed:"Failed to save preference",globalSettings:"(Global)",globalSkills:"Global Skills",loadingSkills:"Loading skills...",noDescription:"No description",browseSkillsMarketplace:"Browse Skills Marketplace",backToDashboard:"Back to Dashboard",educationalConfigEditor:"Educational Config Editor",discard:"Discard",saveChanges:"Save Changes",mergedView:"Merged View",localConfig:"Local (.ck.json)",globalConfig:"Global",syntaxValid:"Syntax Valid",configurationHelp:"Configuration Help",field:"Field",type:"Type",default:"Default",description:"Description",validValues:"Valid Values",systemEffect:"System Effect",exampleUsage:"Example Usage",knowledgeBase:"Knowledge Base",clickToSeeHelp:"Click on any configuration field to see detailed documentation and usage examples.",extractedFrom:"Extracted from ClaudeKit v2.x Specification",resetToDefault:"Reset",saving:"Saving...",saved:"Saved",confirmReset:"Reset to Default?",confirmResetMessage:"All changes will be lost and replaced with default values.",confirm:"Confirm",saveFailed:"Save failed",configTab:"Config",systemTab:"System",formTab:"Form",jsonTab:"JSON",readOnly:"Read-only",installedKit:"Installed Kit",kitVersion:"Kit Version",installedOn:"Installed On",noKitInstalled:"No kit installed",components:"Components",agents:"Agents",commands:"Commands",workflows:"Workflows",kitSkills:"Skills",fileOwnership:"File Ownership",ownershipCk:"kit-managed",ownershipUser:"user-owned",ownershipModified:"modified",componentInventory:"Component Inventory",installedHooks:"Installed Hooks",installedMcpServers:"MCP Servers",lastChecked:"Last update check",staleIndicator:"Stale",skippedVersion:"Skipped",filesModifiedFromDefaults:"files modified from kit defaults",cliCard:"ClaudeKit CLI",checkForUpdates:"Check for Updates",checking:"Checking...",upToDate:"Up to date",updateAvailable:"Update available",updateNow:"Update Now",updating:"Updating...",updateSuccess:"Update Complete!",updateFailed:"Update Failed",closeModal:"Close",showDetails:"Show Details",hideDetails:"Hide Details",environment:"Environment",claudeConfigPath:"Claude config",nodeVersion:"Node",bunVersion:"Bun",osVersion:"OS",envShell:"Shell",envHomeDir:"Home",envCpuCores:"CPU Cores",envTotalMemory:"Memory",cliPackageManager:"Package Manager",cliInstallLocation:"Install Location",cliGitVersion:"Git",cliGhVersion:"GitHub CLI",channelStable:"Stable",channelBeta:"Beta",betaBadge:"Beta",latestVersion:"Latest",selectVersion:"Select version",loadingVersions:"Loading versions...",prereleaseLabel:"Pre",currentVersionLabel:"Current",checkAll:"Check All",checkingAll:"Checking...",updateAll:"Update All",updatesAvailable:"{count} updates available",allUpToDate:"All up to date",systemControlTower:"System Control Tower",systemOverviewTitle:"Update & Runtime Overview",systemOverviewDesc:"Track CLI and kit health, then run upgrades from one place.",installedComponentsHeading:"Installed Components",updateReadiness:"Update Readiness",checkedComponents:"Checked",activeChannel:"Channel",readyToScan:"Ready to scan",noTrackedFiles:"No tracked files detected",kitsLabel:"Kits",componentFilterAll:"All",componentFilterUpdates:"Updates",componentFilterUpdatesCount:"Updates ({count})",componentFilterUpToDate:"Up to date",componentFilterUpToDateCount:"Up to date ({count})",componentFilterCli:"CLI",componentFilterKits:"Kits",noComponentsMatchFilter:"No components match the current filter.",runCheckAllForFilter:"Run Check All to populate this filter.",noUpdatesFound:"No updates found. Checked components are up to date.",noUpToDateYet:"No components are up to date yet.",configWorkspaceHint:"Edit configuration or manage system updates from one workspace.",settingsJsonHeading:"Claude Settings JSON",settingsJsonMissing:"No settings file found at ~/.claude/settings.json.",settingsJsonLoadFailed:"Failed to load ~/.claude/settings.json.",settingsLoadFailedDetail:"Error detail:",configLoadFailed:"Failed to load configuration.",configLoadFailedDetail:"Error detail:",settingsBackupSaved:"Backup saved",hookDiagnosticsTitle:"Hook Diagnostics",hookDiagnosticsDesc:"Inspect recent hook activity and failures without opening JSONL files manually.",hookDiagnosticsPathPending:"Resolving log path...",hookDiagnosticsScopeGlobal:"Global hooks",hookDiagnosticsEntries:"Entries",hookDiagnosticsCrashes:"Crashes",hookDiagnosticsWarnings:"Warnings",hookDiagnosticsBlocks:"Blocks",hookDiagnosticsLastEvent:"Last event",hookDiagnosticsLoading:"Loading hook diagnostics...",hookDiagnosticsLoadFailed:"Failed to load hook diagnostics",hookDiagnosticsMissing:"No hook log file found for this scope yet.",hookDiagnosticsEmpty:"Hook log is present but contains no readable entries.",hookDiagnosticsParseErrorsNotice:"Skipped {count} malformed log line(s) while loading diagnostics.",hookDiagnosticsTruncatedNotice:"Showing a bounded recent window to keep diagnostics responsive on large logs.",hookDiagnosticsToolLabel:"tool",hookDiagnosticsTargetLabel:"target",hookDiagnosticsUnknown:"Unknown",hookDiagnostics:"Hook Diagnostics",hookEvent:"Event",hookExecutions:"Executions",hookAvgLatency:"Avg Latency",hookFailureRate:"Failure Rate",hookLastRun:"Last Run",hookLatencyWarning:"Latency > 500ms",activityMetrics:"Activity",activityTotalSessions:"Total Sessions",activityMostActive:"Most Active Projects",activityPeriod24h:"24h",activityPeriod7d:"7d",activityPeriod30d:"30d",activityNoData:"No activity data",addProjectTitle:"Add Project",addProjectDescription:"Add a new ClaudeKit project to the control center",projectPath:"Project Path",pathPlaceholder:"/path/to/project",alias:"Alias",aliasOptional:"(optional)",aliasPlaceholder:"my-project",aliasDescription:"Custom display name for the project",pathRequired:"Path is required",failedToAdd:"Failed to add project",cancel:"Cancel",adding:"Adding...",somethingWentWrong:"Something went wrong",reloadApp:"Reload App",serverNotRunning:"Server Not Running",startServerMessage:"The Config UI requires the backend server to be running.",runThisCommand:"Run this command",tryAgain:"Try Again",projectConfig:"Project Config",inheritedFromGlobal:"Inherited from Global",localOverride:"Local Override",viewGlobalConfig:"This field inherits from global config. View",onboardingTitle:"Welcome to ClaudeKit",onboardingSubtitle:"Choose your kit and get started in minutes",kitEngineerName:"ClaudeKit Engineer",kitEngineerTagline:"AI-powered coding with skills, hooks, and multi-agent workflows",kitMarketingName:"ClaudeKit Marketing",kitMarketingTagline:"Content automation: campaigns, social media, analytics",featureAgents:"AI Agents",featureAgentsDesc:"Specialized agents for different tasks",featureHooks:"Lifecycle Hooks",featureHooksDesc:"Customize Claude's behavior at key moments",featureSkills:"Skills Library",featureSkillsDesc:"Pre-built capabilities you can activate",featureMultiAgent:"Multi-Agent Workflows",featureMultiAgentDesc:"Coordinate multiple agents for complex tasks",featureContent:"Content Generation",featureContentDesc:"Automated content creation and optimization",featureSocial:"Social Media Tools",featureSocialDesc:"Scheduling, analytics, and engagement automation",stepChooseKit:"Choose Kit",stepConfigure:"Configure",stepInstall:"Install",back:"Back",next:"Next",install:"Install",installSuccess:"Installation Complete!",installSuccessDesc:"{kit} is ready to use",getStarted:"Get Started",goToDashboard:"Go to Dashboard",kitConfig:"Kit Config",kitConfigSubtitle:"Configure ClaudeKit Engineer settings",scopeGlobal:"Global",scopeProject:"Project",sectionGeneral:"General",sectionPaths:"Paths",sectionPrivacy:"Privacy & Trust",sectionProject:"Project Detection",sectionIntegrations:"Integrations",sectionHooks:"Hooks",sectionAdvanced:"Advanced",fieldCodingLevel:"Coding Level",fieldCodingLevelDesc:"Your coding experience level (-1=auto, 0=beginner, 1=intermediate, 2=advanced, 3=expert, 4=tech-lead, 5=god-mode)",fieldStatusline:"Statusline Mode",fieldStatuslineDesc:"How much info to show in the status line",fieldStatuslineColors:"Statusline Colors",fieldStatuslineColorsDesc:"Enable ANSI color output in the statusline",fieldStatuslineQuota:"Statusline Quota Display",fieldStatuslineQuotaDesc:"Show the 5h / wk quota chips in the statusline",fieldThinkingLanguage:"Thinking Language",fieldThinkingLanguageDesc:"Language for Claude's internal reasoning (null=English)",fieldResponseLanguage:"Response Language",fieldResponseLanguageDesc:"Language for Claude's responses (null=match user)",fieldDocsPath:"Docs Directory",fieldDocsPathDesc:"Path to documentation directory",fieldPlansPath:"Plans Directory",fieldPlansPathDesc:"Path to plans directory",fieldGlobalPlansPath:"Global Plans Directory",fieldGlobalPlansPathDesc:"Path to global plans directory",fieldPrivacyBlock:"Privacy Block",fieldPrivacyBlockDesc:"Block access to sensitive files (.env, credentials)",fieldTrustEnabled:"Trust Mode",fieldTrustEnabledDesc:"Enable auto-approval for tool calls",fieldTrustPassphrase:"Trust Passphrase",fieldTrustPassphraseDesc:"Passphrase to enable trust mode",fieldProjectType:"Project Type",fieldProjectTypeDesc:"Override auto-detected project type",fieldPackageManager:"Package Manager",fieldPackageManagerDesc:"Override auto-detected package manager",fieldFramework:"Framework",fieldFrameworkDesc:"Override auto-detected framework",fieldGeminiModel:"Gemini Model",fieldGeminiModelDesc:"Gemini model for CLI commands; legacy gemini-3.0-* ids auto-map",geminiModel25Flash:"Gemini 2.5 Flash — All tiers",geminiModel25Pro:"Gemini 2.5 Pro — May hit capacity limits",geminiModel3FlashPreview:"Gemini 3 Flash Preview — Pro/Ultra only",geminiModel3ProPreview:"Gemini 3 Pro Preview — Pro/Ultra only",fieldResearchUseGemini:"Use Gemini for Research",fieldResearchUseGeminiDesc:"Use Gemini CLI instead of WebSearch",fieldDocsMaxLoc:"Max Lines per Doc",fieldDocsMaxLocDesc:"Maximum lines of code per documentation file",fieldPlanNamingFormat:"Plan Naming Format",fieldPlanNamingFormatDesc:"Format for plan directory names",fieldPlanDateFormat:"Plan Date Format",fieldPlanDateFormatDesc:"Date format for plan names (moment.js)",fieldPlanValidationMode:"Validation Mode",fieldPlanValidationModeDesc:"How to validate plans before implementation",fieldPlanMinQuestions:"Min Questions",fieldPlanMinQuestionsDesc:"Minimum validation questions",fieldPlanMaxQuestions:"Max Questions",fieldPlanMaxQuestionsDesc:"Maximum validation questions",fieldAssertions:"Assertions",fieldAssertionsDesc:"Code assertions and rules to enforce",fieldHookSessionInit:"Session Init",fieldHookSessionInitDesc:"Project detection and environment setup",fieldHookSubagentInit:"Subagent Init",fieldHookSubagentInitDesc:"Inject context to subagents",fieldHookSessionState:"Session State",fieldHookSessionStateDesc:"Persist session state for handoff and statusline context",fieldHookCookAfterPlanReminder:"Cook After Plan Reminder",fieldHookCookAfterPlanReminderDesc:"Remind agents to continue implementation after planning",fieldHookDescriptiveName:"Descriptive Name",fieldHookDescriptiveNameDesc:"Enforce kebab-case descriptive file naming for scripts",fieldHookDevRulesReminder:"Dev Rules Reminder",fieldHookDevRulesReminderDesc:"Inject development rules context",fieldHookPlanFormatKanban:"Plan Format Kanban",fieldHookPlanFormatKanbanDesc:"Keep plan kanban metadata synchronized after edits",fieldHookUsageQuotaCacheRefresh:"Usage Quota Cache",fieldHookUsageQuotaCacheRefreshDesc:"Refresh cached usage quota information",fieldHookUsageContextAwareness:"Usage Prompt Awareness",fieldHookUsageContextAwarenessDesc:"Inject usage-limit awareness into prompts",fieldHookContextTracking:"Context Tracking",fieldHookContextTrackingDesc:"Context window tracking (% used, token counts)",fieldHookScoutBlock:"Scout Block",fieldHookScoutBlockDesc:"Block heavy directories from exploration",fieldHookPrivacyBlock:"Privacy Block Hook",fieldHookPrivacyBlockDesc:"Block sensitive files from reading",fieldHookSimplifyGate:"Simplify Gate",fieldHookSimplifyGateDesc:"UserPromptSubmit hook — opt-in. When enabled (simplify.gate.enabled=true), hard-blocks ship/merge/pr/deploy/publish and soft-warns commit/finalize/release when live diff exceeds thresholds.",sectionSimplify:"Simplify Gate",fieldSimplifyThresholdLocDelta:"Total LOC threshold",fieldSimplifyThresholdLocDeltaDesc:"Total LOC change (across all files) above which the gate fires.",fieldSimplifyThresholdFileCount:"File count threshold",fieldSimplifyThresholdFileCountDesc:"Number of changed files above which the gate fires.",fieldSimplifyThresholdSingleFileLoc:"Per-file LOC threshold",fieldSimplifyThresholdSingleFileLocDesc:"Per-file LOC change above which the gate fires.",fieldSimplifyGateEnabled:"Enabled",fieldSimplifyGateEnabledDesc:"Master toggle. Off by default (opt-in). Enable to activate the gate; env CK_SIMPLIFY_DISABLED=1 always bypasses.",fieldSimplifyGateHardVerbs:"Hard-block verbs",fieldSimplifyGateHardVerbsDesc:"Verbs that hard-block when thresholds breached.",fieldSimplifyGateSoftVerbs:"Soft-warn verbs",fieldSimplifyGateSoftVerbsDesc:"Verbs that emit a non-blocking warning.",sectionUpdatePipeline:"Update Pipeline",fieldAutoInitAfterUpdate:"Auto Init After Update",fieldAutoInitAfterUpdateDesc:"Automatically run ck init after ck update when kit has new version",fieldAutoMigrateAfterUpdate:"Auto Migrate After Update",fieldAutoMigrateAfterUpdateDesc:"Automatically run ck migrate after ck update (independent of init)",fieldMigrateProviders:"Migrate Providers",fieldMigrateProvidersDesc:"Which providers to auto-migrate. Use 'auto' to scan filesystem or a comma-separated list.",skillsPageTitle:"Skills Management",skillsPageDesc:"Install ClaudeKit skills to your coding agents",availableSkills:"Available Skills",installedSkills:"Installed Skills",noSkillsFound:"No skills found",installSkill:"Install",uninstallSkill:"Uninstall",manageSkill:"Manage",syncRegistry:"Sync",installSkillTitle:"Install Skill",selectAgents:"Select target agents",installLocation:"Installation location",globalInstall:"Global",projectInstall:"Project",confirmInstall:"Install to selected agents",installingSkill:"Installing...",skillInstallSuccess:"Skill installed successfully",skillInstallFailed:"Installation failed",agentClaudeCode:"Claude Code",agentCursor:"Cursor",agentCodex:"Codex",agentOpencode:"OpenCode",agentGoose:"Goose",agentGeminiCli:"Gemini CLI",agentAntigravity:"Antigravity",agentGithubCopilot:"GitHub Copilot",agentAmp:"Amp",agentKilo:"Kilo",agentRoo:"Roo",agentWindsurf:"Windsurf",agentCline:"Cline",agentOpenhands:"OpenHands",installed:"Installed",notInstalled:"Not installed",allAgents:"All Agents",filterByAgent:"Filter by agent",skillsTitle:"Skills",skillsSubtitle:"Browse, install, and manage skills for your coding agents",availableCount:"Available",installedCount:"Installed",agentsCount:"Agents",searchSkills:"Search skills...",searchShortcut:"/",sortAZ:"A-Z",sortCategory:"Category",sortInstalledFirst:"Installed first",listView:"List view",gridView:"Grid view",categoryAll:"All",categoryAI:"AI",categoryUIUX:"UI/UX",categoryBackend:"Backend",categorySecurity:"Security",categoryDevOps:"DevOps",categoryDatabase:"Database",categoryDevelopment:"Development",categoryResearch:"Research",categoryGeneral:"General",categoryCore:"Core",categoryDocumentation:"Documentation",categoryTooling:"Tooling",categoryMedia:"Media",categoryFrameworks:"Frameworks",skillsCountLabel:"{count} skills",installToAll:"Install to All Detected",scopeLabel:"Installation Scope",agentInstalled:"Installed",agentNotInstalled:"Not installed",skillSource:"Source location",skillSourceBadge:"Source",detailPanelClose:"Close",versionLabel:"v{version}",installAllToAllAgents:"Install All to All Agents",bulkInstallFailed:"Bulk install failed",noAgentsDetected:"No agents detected",kitBadgeEngineer:"Engineer",kitBadgeMarketing:"Marketing",customizedBadge:"Customized",installedVersionLabel:"Installed Version",installedAtLabel:"Installed At",sourceTimestampLabel:"Source Date",kitLabel:"Kit",skillMetadata:"Skill Info",migrate:"Migrate",migrateTitle:"Migrate",migrateSubtitle:"Migrate your Claude Code stack to other providers",migrateDetectedProviders:"Detected",migrateSelectedProviders:"Selected",migrateDiscovering:"Discovering migration sources...",migrateRefresh:"Refresh Discovery",migrateRun:"Run Migration",migrateRunning:"Migrating...",migrateSourceSummary:"Source Summary",migratePresetCodex:"Codex",migratePresetAntigravity:"Antigravity",migratePresetCore:"Codex + Antigravity + Droid",migratePresetDetected:"All Detected",migrateScope:"Scope",migrateScopeProject:"Project",migrateScopeGlobal:"Global",migrateTypes:"Portable Types",migrateTypeAgents:"Subagents",migrateTypeCommands:"Commands",migrateTypeSkills:"Skills",migrateTypeConfig:"Config",migrateTypeRules:"Rules",migrateTypeHooks:"Hooks",migrateSearchProviders:"Search providers...",migrateSelectVisible:"Select Visible",migrateClearSelection:"Clear Selection",migrateProvidersHeading:"Target Providers",migrateProvidersCountSuffix:"providers",migrateNoProvidersMatch:"No providers match current filters.",migrateSelectButton:"Select",migrateSelectedButton:"Selected",migrateSelectProviderAction:"Select Provider",migrateUnselectProvider:"Unselect Provider",migrateCapabilitiesLabel:"types",migrateCapabilitiesSection:"Capability Matrix",migrateSupported:"Supported",migrateUnsupportedShort:"Unsupported",migrateIncludedEnabled:"Enabled",migrateIncludedDisabled:"Disabled",migrateLatestTarget:"Latest Target",migrateNoResultForProvider:"No migration result for this provider yet.",migrateActionSummaryTitle:"Ready to Migrate",migrateGlobalOnlyCommandsShort:"Commands global only",migrateNoProviders:"No providers available.",migrateUnsupported:"Will be skipped (unsupported)",migrateGlobalForced:"Selected provider commands only support global scope. Use Global to install them.",migrateResults:"Migration Results",migrateInstalled:"Installed",migrateSkipped:"Skipped",migrateFailed:"Failed",migrateProvider:"Provider",migrateStatus:"Status",migratePath:"Path",migrateError:"Error",migrateStatusInstalled:"Installed",migrateStatusSkipped:"Skipped",migrateStatusFailed:"Failed",migrateNoResults:"No migration results yet.",migrateDetectFailed:"Failed to discover migration data",migrateExecuteFailed:"Migration execution failed",migrateSelectProvider:"Select at least one provider",migrateNoTypesEnabled:"Enable at least one portable type",migrateDetectedTag:"Detected",migrateNotDetectedTag:"Not detected",migrateFilterRecommended:"Recommended",migrateActionInstall:"Install",migrateActionUpdate:"Update",migrateActionSkip:"Skip",migrateActionConflict:"Conflict",migrateActionDelete:"Delete",migrateUnchanged:"unchanged",migrateConflictSectionTitle:"Conflicts",migrateConflictUseCK:"Use CK",migrateConflictKeepMine:"Keep Mine",migrateConflictSmartMerge:"Smart Merge",migrateConflictShowDiff:"Show Diff",migrateConflictHideDiff:"Hide Diff",migrateConflictResolved:"Resolved",migrateConflictManual:"Manual",migrateConflictOverwriteAll:"Overwrite All",migrateConflictKeepAll:"Keep All",migrateSummaryTitle:"Migration Complete",migrateSummaryNewMigration:"New Migration",migrateType:"Type",migrateItem:"Item",migrateReconciling:"Analyzing changes...",migrateReviewPlan:"Review Plan",migrateExecutePlan:"Execute Migration",migrateExecuting:"Executing migration...",migrateResolveConflicts:"Resolve all conflicts before executing",migrateReason_newItem:"New item from provider",migrateReason_newProviderForItem:"New provider for this item",migrateReason_targetDeletedSourceChanged:"Target was deleted but source has updates",migrateReason_targetDirEmptyReinstall:"Target directory is empty — reinstalling",migrateReason_forceReinstall:"Force reinstall requested",migrateReason_forceOverwrite:"Force overwrite (you edited this, --force active)",migrateReason_registryUpgradeReinstall:"Registry upgrade requires reinstall",migrateReason_sourceChanged:"Source has been updated",migrateReason_registryUpgradeHeal:"Healing stale target after registry upgrade",migrateReason_noChanges:"No changes detected",migrateReason_userEditsPreserved:"User edits preserved",migrateReason_userDeletedRespected:"User deletion respected",migrateReason_targetUpToDateBackfill:"Target is up to date",migrateReason_providerChecksumUnavailable:"Provider checksum unavailable",migrateReason_targetStateUnknown:"Target state could not be determined",migrateReason_sourceRemovedOrphan:"Source removed — cleaning up orphan",migrateReason_renamedCleanup:"Item renamed — removing old path",migrateReason_pathMigratedCleanup:"Path migrated — removing old location",migrateReason_bothChanged:"Both source and target changed",migrateReason_targetStateUnknownSourceChanged:"Source changed but target state unknown",migrateBanner_emptyDir_title:"Detected empty directory",migrateBanner_emptyDir_body:"items below will be reinstalled. Uncheck any to skip.",migrateBanner_emptyDirRespected_title:"Respecting your deletion",migrateBanner_emptyDirRespected_body:"is empty. Respecting your deletion.",migrateBanner_reinstallCta:"Reinstall these items",migrateModeLabel:"Migration mode",migrateModeReconcile:"Reconcile",migrateModeReconcileDesc:"Smart-detects drift",migrateModeInstall:"Install",migrateModeInstallDesc:"Pick items to install",migrateModeConfirmTitle:"Switch mode?",migrateModeConfirmBody:"You have {count} pending changes. Switching to {mode} mode will discard them.",migrateModeConfirmSwitch:"Switch & discard",migrateSmartDefaultInstall:"Fresh install detected — defaulting to Install mode",migrateSmartDefaultReconcile:"Existing registry found — defaulting to Reconcile mode",migrateInstallSelectAll:"Select all",migrateInstallDeselectAll:"Deselect all",migrateInstallDirItem:"dir",migrateInstallAlreadyInstalled:"installed",migrateInstallNoCandidates:"No installable items found for the selected providers.",migrateInstallSelectedCount:"{count} of {total} items selected",migrateInstallCta:"Install {count} selected items",migrateInstallInstalling:"Installing...",migrateInstallLoadingCandidates:"Fetching available items...",migrateFlip_moveToSkip:"Move to Skip",migrateFlip_moveToInstall:"Move to Install",migrateFlip_checkAll:"Check all",migrateFlip_uncheckAll:"Uncheck all",migrateFlip_toggleItem:"Toggle item",migrateConflictBanner_title:"Conflicts detected",migrateConflictBanner_cta:"Open conflict resolver",migrateConflictBanner_hide:"Hide conflict resolver",migrateShowSkippedItems:"Show skipped items",migrateHideSkippedItems:"Hide skipped items",migrateConflictBadge:"Conflict",migrateSummarySubtitle:"items migrated",migrateSummarySearchPlaceholder:"Search items...",migrateSummaryFilterAll:"All",migrateSummaryCollapseAll:"Collapse all",migrateSummaryExpandAll:"Expand all",migrateSummaryNoResults:"No items match your search",migrateSummaryProviders:"Providers",migrateTypeUnknown:"Other",kanbanTitle:"Plan Kanban",kanbanNoFile:"No plan file specified. Use ?file= parameter.",kanbanNoPhases:"No phases detected in this plan",kanbanError400:"Invalid request — missing file parameter",kanbanError403:"Access denied — file is outside the project directory",kanbanError404:"Plan file not found",kanbanComplete:"complete",kanbanStatus_pending:"Pending","kanbanStatus_in-progress":"In Progress",kanbanStatus_completed:"Completed",kanbanPhases:"phases",kanbanProgress:"Progress",kanbanLoadError:"Failed to load plan data",plansNav:"Plans",plansTitle:"Plans Dashboard",plansGlobalTitle:"All Projects",plansSubtitle:"Browse active plans, inspect phase timelines, and manage progress from one place.",plansEmpty:"No plans found",plansSearch:"Search plans...",plansProjectFilter:"Filter by project",plansAllProjects:"All projects",plansSortBy:"Sort by",plansViewGrid:"Grid",plansViewKanban:"Kanban",plansFilterAll:"All statuses",plansSortDateDesc:"Newest first",plansSortDateAsc:"Oldest first",plansSortNameAsc:"Name A-Z",plansSortNameDesc:"Name Z-A",plansSortProgress:"Highest progress",plansLabel:"Plan",plansStatusPending:"Pending",plansStatusInProgress:"In Progress",plansStatusInReview:"In Review",plansStatusDone:"Done",plansStatusCancelled:"Cancelled",plansCompletedCount:"{count} completed",plansProjectPlans:"{count} plans",plansProjectLoadIssues:"Some projects could not be scanned",plansStatusUnknown:"Unknown",plansBackToPlans:"Back to Plans",plansBackToPlan:"Back to Plan",plansPrevious:"Previous",plansNext:"Next",plansContents:"Contents",plansValidate:"Validate",plansStartNext:"Start Next",plansRestart:"Restart",plansStart:"Start",plansComplete:"Complete",plansReset:"Reset",plansTimeline:"Timeline",plansActivity:"Activity",plansActivitySubtitle:"Last 12 weeks",plansActivityCombined:"Combined",plansActivityCommits:"Commits",plansActivityFiles:"Files",plansActivityEmpty:"No activity data available.",plansHeatmapLoadError:"Failed to load activity heatmap.",plansHeatmapChanges:"{date} • {count} changes",plansRead:"Read",plansPhases:"Phases",plansPhase:"Phase",plansPhaseCountCompact:"PH-{count}",plansKanbanEmpty:"Empty",plansLoadingPlan:"Loading plan...",plansLoadingReader:"Loading document...",plansLoadPlanFailed:"Failed to load plan ({status})",plansLoadPlanFallback:"Failed to load plan",plansLoadFileFailed:"Failed to load document ({status})",plansLoadFileFallback:"Failed to load document",plansProgressComplete:"{count}% complete",plansPhaseCount:"{count} phases",plansPriority:"Priority",plansUpdated:"Updated",plansLastUpdated:"Last Updated",plansPriorityLabel:"Priority {value}",plansUpdatedLabel:"Updated {value}",plansTimelineAvgDays:"{count} avg days",plansNoEffort:"No effort",plansNotFound:"Plan not found",plansQuickInfoTitle:"Plan Overview",plansQuickInfoDescription:"Use this view to track phase progress, timeline coverage, and recent activity for this plan.",plansCurrentStatus:"Current Status",plansHeatmapMon:"Mon",plansHeatmapWed:"Wed",plansHeatmapFri:"Fri",developmentFeature:"Development",betaFeature:"Beta",experimentalFeature:"Experimental",sectionModelTaxonomy:"Model Taxonomy",taxonomyDescription:"Customize model mappings for portable migration to other coding agents.",taxonomyTierHeavy:"Heavy (opus)",taxonomyTierBalanced:"Balanced (sonnet)",taxonomyTierLight:"Light (haiku)",taxonomyModel:"Model",taxonomyEffort:"Effort",taxonomyResetProvider:"Reset",taxonomyTier:"Tier",statuslineBuilder:"Status Line Builder",statuslineBuilderDescription:"Visually design your Claude Code status-line using drag-and-drop",statuslineSections:"Sections",statuslinePreview:"Preview",statuslineTheme:"Color Theme",statuslineSettings:"General Settings",statuslineResetDefaults:"Reset to Defaults",statuslineSave:"Save",statuslineBaseMode:"Base Mode",statuslineBreakpoint:"Responsive Breakpoint",statuslineMaxAgents:"Max Agent Rows",statuslineTodoTruncation:"Todo Truncation",statuslineEnable:"Enable",statuslineDisable:"Disable",statuslineDragHint:"Drag to reorder, toggle to enable/disable sections",statuslinePresetDefault:"Default",statuslinePresetMonochrome:"Monochrome",statuslinePresetSolarized:"Solarized",statuslinePresetNord:"Nord",statuslinePresetDracula:"Dracula",statuslinePresetCatppuccin:"Catppuccin",statuslinePresetGruvbox:"Gruvbox",statuslinePresetTokyoNight:"Tokyo Night",statuslinePresetRosePine:"Rosé Pine",statuslinePresetOneDark:"One Dark",statuslinePresetAyu:"Ayu",statuslinePresetKanagawa:"Kanagawa",statuslinePresetStealth:"Stealth",statuslinePresetHacker:"Hacker",statuslineSaved:"Saved successfully",statuslineSaveError:"Save failed",statusline:"Status Line",statuslineCollapseSettings:"Collapse settings",statuslineExpandSettings:"Expand settings",statuslineIconOverride:"Icon override",statuslineLabelOverride:"Label override",statuslineMaxWidth:"Max width (chars)",statuslineIconPlaceholder:"e.g. 🤖",statuslineMaxWidthPlaceholder:"auto",statuslineCustomColors:"Custom colors",statuslineColorContextGroup:"Context Window",statuslineColorQuotaGroup:"Usage Quota",statuslineColorGeneralGroup:"General",statuslineColorSectionGroup:"Section Colors",statuslineColorContextLow:"Low (<50%)",statuslineColorContextMid:"Mid (50-75%)",statuslineColorContextHigh:"High (>75%)",statuslineColorAccent:"Accent",statuslineColorMuted:"Muted",statuslineColorSeparator:"Separator",statuslineModeFullDesc:"All sections visible",statuslineModeCompactDesc:"Condensed display",statuslineModeMinimalDesc:"Essential info only",statuslineModeNoneDesc:"Disabled",statuslinePreviewTitle:"Claude Code — statusline preview",statuslinePreviewEmptyLine:"(empty line)",statuslinePreviewNoLines:"(no lines configured)",statuslineSectionModelLabel:"Model",statuslineSectionContextLabel:"Context Window",statuslineSectionQuotaLabel:"Usage Quota",statuslineSectionDirectoryLabel:"Directory",statuslineSectionGitLabel:"Git Status",statuslineSectionCostLabel:"Cost",statuslineSectionChangesLabel:"Changes",statuslineSectionAgentsLabel:"Agents",statuslineSectionTodosLabel:"Tasks",statuslineSectionModelDesc:"AI model name and provider",statuslineSectionContextDesc:"Context window usage bar",statuslineSectionQuotaDesc:"5-hour and weekly usage quota",statuslineSectionDirectoryDesc:"Current working directory",statuslineSectionGitDesc:"Git branch, staged/unstaged changes",statuslineSectionCostDesc:"Session cost estimate",statuslineSectionChangesDesc:"Lines added and removed",statuslineSectionAgentsDesc:"Recent agent activity",statuslineSectionTodosDesc:"Current task progress",statuslineSectionsVisible:"sections visible",statuslineLoadErrorSaveDisabled:"Could not load saved layout. Saving is disabled to prevent data loss.",statuslineAddLine:"Add Line",statuslineRemoveLine:"Remove",statuslineHiddenSections:"Hidden Sections",statuslineDragToLine:"Drag sections to a line to show them",statuslineQuotaLow:"Quota Low",statuslineQuotaHigh:"Quota High",statuslineLine:"Line",sessionsTitle:"Sessions",sessionDetail:"Session Detail",sessionMessages:"messages",sessionToolCalls:"tool calls",sessionDuration:"Duration",noSessionsData:"No sessions found",sessionReadOnly:"Read-only view",sessionLastActive:"Last active",sessionProjectSessions:"Project Sessions",sessionBack:"Back",sessionLoading:"Loading...",sessionError:"Failed to load",sessionCount:"sessions",sessionToolInput:"Input",sessionToolResult:"Result",sessionToolsUsed:"Tools Used",sessionSystemContext:"System Context",sessionExpandAll:"Expand all",sessionCollapseAll:"Collapse all",sessionNoContent:"No text content",sessionUser:"User",sessionAssistant:"Assistant",sessionThinking:"Thinking...",sessionSearchPlaceholder:"Search in conversation...",sessionSearchResults:"results",sessionNoResults:"No matches",sessionGroupMessages:"messages",palettePlaceholder:"Search agents, commands, skills...",paletteNoResults:"No results found",paletteAgents:"Agents",paletteCommands:"Commands",paletteSkills:"Skills",paletteProjects:"Projects",paletteNavigation:"Navigation",skillsBrowser:"Skills",skillsCount:"{count} skills",skillDetail:"Skill Detail",searchSkillsBrowserPlaceholder:"Search skills...",noSkillsBrowserFound:"No skills found",backToSkillsBrowser:"Back to Skills",skillTriggers:"Triggers",skillLocal:"Local",skillGithub:"GitHub",systemNavLabel:"System",dashboardTitle:"Dashboard",dashboardAgents:"Agents",dashboardCommands:"Commands",dashboardSkills:"Skills",dashboardMcpServers:"MCP Servers",configured:"Configured",available:"Available",modelDistribution:"Model Distribution",recentAgents:"Recent Agents",suggestionsTitle:"Suggestions",acrossAgents:"across {count} agents",noAgentsConfigured:"No agents configured in ~/.claude/agents/",mcpTitle:"MCP Servers",mcpServerName:"Server",mcpCommand:"Command",mcpArgs:"Arguments",mcpSource:"Source",mcpStatus:"Status",mcpConfigured:"Configured",mcpNoServers:"No MCP servers configured",mcpSourceSettings:"settings.json",mcpSourceMcpJson:".mcp.json",mcpSourceProject:"Project",mcpToolCount:"Tools",agentsBrowser:"Agents",agentsBrowserCount:"{count} agents",filterAll:"All",agentDetail:"Agent Detail",agentInstructions:"Instructions",agentFrontmatter:"Configuration",searchAgentsPlaceholder:"Search agents...",noAgentsFound:"No agents found",backToAgents:"Back to Agents",commandsBrowser:"Commands",commandsCount:"{count} commands",commandDetail:"Command Detail",searchCommandsPlaceholder:"Search commands...",noCommandsFound:"No commands found",backToCommands:"Back to Commands",rootCommands:"Root",selectToView:"Select an item to view details",indexingFrom:"Indexing from",workflowsTitle:"Workflows",workflowsSubtitle:"Learn ClaudeKit through interactive workflow visualization.",workflowsCredit:"Workflows data and visualization layout inspired by",workflowImplementationRecipe:"Implementation Recipe",workflowSearchPlaceholder:"Search workflows...",workflowNoResults:"No workflows found",loadingWorkflows:"Loading workflows...",workflowCategoryAll:"All",workflowCategoryGettingStarted:"Getting Started",workflowCategoryDesignFrontend:"Design & Frontend",workflowCategoryDebuggingFixes:"Debugging & Fixes",workflowCategoryPlanningReview:"Planning & Review",workflowCategoryResearchDocs:"Research & Docs",workflowCategoryShipping:"Shipping",workflowCategoryBackendInfra:"Backend & Infra",workflowCategoryMediaCreative:"Media & Creative",workflowCategoryAdvanced:"Advanced",workflowComplexityBeginner:"Beginner",workflowComplexityIntermediate:"Intermediate",workflowComplexityAdvanced:"Advanced",workflowBuildFeature:"Build a New Feature",workflowBuildFeatureDesc:"Add new functionality to applications systematically.",workflowQuickImplementation:"Quick Implementation",workflowQuickImplementationDesc:"Fast track implementation for small, understood features.",workflowStartNewProject:"Start New Project",workflowStartNewProjectDesc:"Bootstrap a brand new project with right foundations.",workflowFrontendDesign:"Frontend Design",workflowFrontendDesignDesc:"Create beautiful user interfaces guided by design taste bots.",workflowAiDesignStitch:"AI Design Stitch",workflowAiDesignStitchDesc:"Orchestrate Google Stitch for generating designs from prompt.",workflowExcalidraw:"Excalidraw Design",workflowExcalidrawDesc:"Visualize architectures or mockups using Excalidraw JSON.",workflowFixBug:"Fix Bug",workflowFixBugDesc:"Identify root cause and automatically fix codebase issues.",workflowSecurityAudit:"Security Audit",workflowSecurityAuditDesc:"Thorough security check on the repository.",workflowTestScenarios:"Test Scenarios",workflowTestScenariosDesc:"Generate edge cases and test scenarios by decomposing features.",workflowStride:"STRIDE Analysis",workflowStrideDesc:"Perform a STRIDE + OWASP-based security audit threat model.",workflowCodeReview:"Code Review",workflowCodeReviewDesc:"Review code quality with adversarial rigor.",workflowPlanValidate:"Plan + Validate",workflowPlanValidateDesc:"Draft an architectural plan and rigorously validate its technical feasible.",workflowAdversarialReview:"Adversarial Review",workflowAdversarialReviewDesc:"Trigger a harsh red-team review mapping out potential failure modes.",workflowAutoresearch:"Autonomous Loop",workflowAutoresearchDesc:"Run an autonomous iterative optimization loop for any metric.",workflowXia:"Extract/Port Feature",workflowXiaDesc:"Port or extract a feature algorithm from an external codebase.",workflowVisualDocumentation:"Visual Documentation",workflowVisualDocumentationDesc:"Build diagrams outlining current repo logic and architectures.",workflowTechnicalResearch:"Technical Research",workflowTechnicalResearchDesc:"Investigate technological solutions deeply before writing code.",workflowLlmsTxt:"Generate llms.txt",workflowLlmsTxtDesc:"Analyze the codebase and construct a comprehensive llms.txt file.",workflowDevops:"DevOps / Release",workflowDevopsDesc:"Configure Docker, CI/CD and deploy standard web platforms.",workflowShip:"Ship Pipeline",workflowShipDesc:"Merge, test, review, commit, bump semantic version and PR.",workflowDatabaseOps:"Database Operations",workflowDatabaseOpsDesc:"Write complex aggregation pipelines or optimize database performance.",workflowRemotion:"Remotion Video",workflowRemotionDesc:"Build programmatic video sequences internally.",workflowShowOff:"Show Off Demo",workflowShowOffDesc:"Build an interactive self-contained HTML showcase for a repo.",workflowAgentTeams:"Agent Teams",workflowAgentTeamsDesc:"Spawn isolated team members for parallel coordinated labor.",workflowWorktree:"Worktree Parallelism",workflowWorktreeDesc:"Instantly isolate feature iterations in new worktrees."},vi:{loading:"Đang tải...",error:"Lỗi",selectProject:"Chọn dự án để xem bảng điều khiển",controlCenter:"Trung tâm điều khiển",settings:"Cài đặt",sync:"Đồng bộ",offline:"Ngoại tuyến",switchToLight:"Chuyển sang chế độ sáng",switchToDark:"Chuyển sang chế độ tối",settingsSection:"Cài đặt",overviewSection:"Tổng quan",entitiesSection:"Thực thể",toolsSection:"Công cụ",configEditor:"Trình chỉnh sửa cấu hình",projects:"Dự án",addProject:"Thêm dự án",global:"Toàn cục",skills:"Kỹ năng",skillsNav:"Kỹ năng",health:"Sức khỏe",collapse:"Thu gọn",expand:"Mở rộng",installing:"Đang cài đặt...",manage:"Quản lý",uninstall:"Gỡ cài đặt",installGlobally:"Cài đặt toàn cục",installGloballyDesc:"Khả dụng cho tất cả dự án thay vì chỉ dự án hiện tại",selectAtLeastOneAgent:"Vui lòng chọn ít nhất một agent",installationFailed:"Cài đặt thất bại",allSkills:"Tất cả kỹ năng",refresh:"Làm mới",browseAndManageSkills:"Duyệt và quản lý kỹ năng cho agents của bạn",detected:"Đã phát hiện",notDetected:"Chưa phát hiện",sessions:"phiên",noSessions:"Không có phiên",terminal:"Terminal",terminalSub:"Mở bash tại đường dẫn",editor:"Trình soạn thảo",editorSub:"Mở trong VS Code",useGlobalFallback:"Dùng fallback global",openAtPath:"Mở tại đường dẫn dự án",openAppOnly:"Chỉ mở ứng dụng",actionOptionsLoadFailed:"Không thể tải tùy chọn editor/terminal",launch:"Khởi chạy",launchSub:"Bắt đầu Claude Code",config:"Cấu hình",configSub:"Quản lý cài đặt dự án",recentSessions:"Phiên gần đây",viewAllHistory:"Xem tất cả lịch sử",showLess:"Thu gọn",actionFailed:"Thao tác thất bại",loadingSessions:"Đang tải phiên...",noSessionsFound:"Không tìm thấy phiên nào",configuration:"Cài đặt Claude",planSettingsTitle:"Cài đặt Kế hoạch",activeKit:"Kit hoạt động",aiModel:"Mô hình",hooks:"Hooks",active:"hoạt động",mcpServers:"Máy chủ MCP",connected:"kết nối",plansDirectory:"Thư mục kế hoạch",validationMode:"Chế độ xác thực",planScopeLabel:"Phạm vi",planScopeProject:"dự án",planScopeGlobal:"toàn cục",activePlansLabel:"Kế hoạch đang hoạt động",activePlansTitle:"Kế hoạch đang hoạt động",noActivePlansFound:"Không có kế hoạch đang hoạt động",openPlan:"Mở kế hoạch",openKanban:"Mở Kanban",blockedByLabel:"Bị chặn bởi",progressLabel:"Tiến độ",editProjectConfig:"Chỉnh sửa cấu hình dự án",projectPreferenceSaveFailed:"Không thể lưu tùy chọn",globalSettings:"(Toàn cục)",globalSkills:"Kỹ năng toàn cục",loadingSkills:"Đang tải kỹ năng...",noDescription:"Không có mô tả",browseSkillsMarketplace:"Duyệt Skills Marketplace",backToDashboard:"Quay lại bảng điều khiển",educationalConfigEditor:"Trình chỉnh sửa cấu hình hướng dẫn",discard:"Hủy bỏ",saveChanges:"Lưu thay đổi",mergedView:"Chế độ gộp",localConfig:"Cục bộ (.ck.json)",globalConfig:"Toàn cục",syntaxValid:"Cú pháp hợp lệ",configurationHelp:"Hướng dẫn cấu hình",field:"Trường",type:"Kiểu",default:"Mặc định",description:"Mô tả",validValues:"Giá trị hợp lệ",systemEffect:"Hiệu ứng hệ thống",exampleUsage:"Ví dụ sử dụng",knowledgeBase:"Cơ sở kiến thức",clickToSeeHelp:"Nhấp vào bất kỳ trường cấu hình nào để xem tài liệu chi tiết và ví dụ sử dụng.",extractedFrom:"Trích xuất từ ClaudeKit v2.x Specification",resetToDefault:"Đặt lại",saving:"Đang lưu...",saved:"Đã lưu",confirmReset:"Đặt lại về mặc định?",confirmResetMessage:"Tất cả thay đổi sẽ bị mất và được thay thế bằng giá trị mặc định.",confirm:"Xác nhận",saveFailed:"Lưu thất bại",configTab:"Cấu hình",systemTab:"Hệ thống",formTab:"Biểu mẫu",jsonTab:"JSON",readOnly:"Chỉ đọc",installedKit:"Kit đã cài",kitVersion:"Phiên bản Kit",installedOn:"Cài đặt vào",noKitInstalled:"Chưa cài kit",components:"Thành phần",agents:"Agents",commands:"Commands",workflows:"Workflows",kitSkills:"Skills",fileOwnership:"Quyền sở hữu tệp",ownershipCk:"do kit quản lý",ownershipUser:"do người dùng",ownershipModified:"đã chỉnh sửa",componentInventory:"Thành phần đã cài",installedHooks:"Hooks đã cài",installedMcpServers:"MCP Servers",lastChecked:"Kiểm tra cập nhật",staleIndicator:"Cũ",skippedVersion:"Đã bỏ qua",filesModifiedFromDefaults:"tệp đã sửa so với mặc định",cliCard:"ClaudeKit CLI",checkForUpdates:"Kiểm tra cập nhật",checking:"Đang kiểm tra...",upToDate:"Đã cập nhật",updateAvailable:"Có bản cập nhật",updateNow:"Cập nhật ngay",updating:"Đang cập nhật...",updateSuccess:"Cập nhật hoàn tất!",updateFailed:"Cập nhật thất bại",closeModal:"Đóng",showDetails:"Xem chi tiết",hideDetails:"Ẩn chi tiết",environment:"Môi trường",claudeConfigPath:"Cấu hình Claude",nodeVersion:"Node",bunVersion:"Bun",osVersion:"Hệ điều hành",envShell:"Shell",envHomeDir:"Thư mục gốc",envCpuCores:"Nhân CPU",envTotalMemory:"Bộ nhớ",cliPackageManager:"Trình quản lý gói",cliInstallLocation:"Vị trí cài đặt",cliGitVersion:"Git",cliGhVersion:"GitHub CLI",channelStable:"Ổn định",channelBeta:"Beta",betaBadge:"Beta",latestVersion:"Mới nhất",selectVersion:"Chọn phiên bản",loadingVersions:"Đang tải...",prereleaseLabel:"Thử nghiệm",currentVersionLabel:"Hiện tại",checkAll:"Kiểm tra tất cả",checkingAll:"Đang kiểm tra...",updateAll:"Cập nhật tất cả",updatesAvailable:"{count} bản cập nhật",allUpToDate:"Tất cả đã cập nhật",systemControlTower:"Trung tâm hệ thống",systemOverviewTitle:"Tổng quan cập nhật & môi trường",systemOverviewDesc:"Theo dõi CLI và kit, rồi nâng cấp từ một nơi.",installedComponentsHeading:"Thành phần đã cài",updateReadiness:"Mức sẵn sàng cập nhật",checkedComponents:"Đã kiểm tra",activeChannel:"Kênh",readyToScan:"Sẵn sàng kiểm tra",noTrackedFiles:"Không phát hiện tệp theo dõi",kitsLabel:"Kit",componentFilterAll:"Tất cả",componentFilterUpdates:"Bản cập nhật",componentFilterUpdatesCount:"Bản cập nhật ({count})",componentFilterUpToDate:"Đã cập nhật",componentFilterUpToDateCount:"Đã cập nhật ({count})",componentFilterCli:"CLI",componentFilterKits:"Kit",noComponentsMatchFilter:"Không có thành phần phù hợp bộ lọc hiện tại.",runCheckAllForFilter:"Hãy chạy Kiểm tra tất cả để nạp dữ liệu cho bộ lọc này.",noUpdatesFound:"Không có bản cập nhật. Các thành phần đã kiểm tra đều mới nhất.",noUpToDateYet:"Chưa có thành phần nào ở trạng thái đã cập nhật.",configWorkspaceHint:"Chỉnh sửa cấu hình hoặc quản lý cập nhật hệ thống trong một màn hình.",settingsJsonHeading:"JSON Cài đặt Claude",settingsJsonMissing:"Không tìm thấy tệp ~/.claude/settings.json.",settingsJsonLoadFailed:"Không thể tải ~/.claude/settings.json.",settingsLoadFailedDetail:"Chi tiết lỗi:",configLoadFailed:"Không thể tải cấu hình.",configLoadFailedDetail:"Chi tiết lỗi:",settingsBackupSaved:"Đã lưu bản sao lưu",hookDiagnosticsTitle:"Chẩn đoán Hook",hookDiagnosticsDesc:"Xem hoạt động hook gần đây và lỗi mà không cần mở tệp JSONL thủ công.",hookDiagnosticsPathPending:"Đang xác định đường dẫn log...",hookDiagnosticsScopeGlobal:"Hook toàn cục",hookDiagnosticsEntries:"Bản ghi",hookDiagnosticsCrashes:"Sự cố",hookDiagnosticsWarnings:"Cảnh báo",hookDiagnosticsBlocks:"Chặn",hookDiagnosticsLastEvent:"Sự kiện cuối",hookDiagnosticsLoading:"Đang tải chẩn đoán hook...",hookDiagnosticsLoadFailed:"Không thể tải chẩn đoán hook",hookDiagnosticsMissing:"Chưa tìm thấy tệp log hook cho phạm vi này.",hookDiagnosticsEmpty:"Tệp log hook có tồn tại nhưng không có bản ghi đọc được.",hookDiagnosticsParseErrorsNotice:"Đã bỏ qua {count} dòng log bị lỗi khi tải chẩn đoán.",hookDiagnosticsTruncatedNotice:"Đang hiển thị cửa sổ bản ghi gần đây để giữ giao diện phản hồi tốt với log lớn.",hookDiagnosticsToolLabel:"công cụ",hookDiagnosticsTargetLabel:"mục tiêu",hookDiagnosticsUnknown:"Không rõ",hookDiagnostics:"Chẩn đoán Hook",hookEvent:"Sự kiện",hookExecutions:"Lần chạy",hookAvgLatency:"Trung bình",hookFailureRate:"Tỉ lệ lỗi",hookLastRun:"Lần cuối",hookLatencyWarning:"Độ trễ > 500ms",activityMetrics:"Hoạt động",activityTotalSessions:"Tổng phiên",activityMostActive:"Dự án hoạt động nhiều nhất",activityPeriod24h:"24h",activityPeriod7d:"7 ngày",activityPeriod30d:"30 ngày",activityNoData:"Không có dữ liệu",addProjectTitle:"Thêm dự án",addProjectDescription:"Thêm dự án ClaudeKit mới vào trung tâm điều khiển",projectPath:"Đường dẫn dự án",pathPlaceholder:"/đường/dẫn/dự/án",alias:"Bí danh",aliasOptional:"(tùy chọn)",aliasPlaceholder:"dự-án-của-tôi",aliasDescription:"Tên hiển thị tùy chỉnh cho dự án",pathRequired:"Đường dẫn bắt buộc",failedToAdd:"Không thể thêm dự án",cancel:"Hủy",adding:"Đang thêm...",somethingWentWrong:"Đã xảy ra lỗi",reloadApp:"Tải lại ứng dụng",serverNotRunning:"Máy chủ không chạy",startServerMessage:"Config UI yêu cầu máy chủ backend đang chạy.",runThisCommand:"Chạy lệnh này",tryAgain:"Thử lại",projectConfig:"Cấu hình dự án",inheritedFromGlobal:"Kế thừa từ toàn cục",localOverride:"Ghi đè cục bộ",viewGlobalConfig:"Trường này kế thừa từ cấu hình toàn cục. Xem",onboardingTitle:"Chào mừng đến ClaudeKit",onboardingSubtitle:"Chọn kit của bạn và bắt đầu trong vài phút",kitEngineerName:"ClaudeKit Engineer",kitEngineerTagline:"Lập trình AI với skills, hooks và multi-agent",kitMarketingName:"ClaudeKit Marketing",kitMarketingTagline:"Tự động hóa nội dung: chiến dịch, mạng xã hội, phân tích",featureAgents:"AI Agents",featureAgentsDesc:"Các agent chuyên biệt cho từng tác vụ",featureHooks:"Lifecycle Hooks",featureHooksDesc:"Tùy chỉnh hành vi của Claude tại các thời điểm quan trọng",featureSkills:"Thư viện Skills",featureSkillsDesc:"Các khả năng có sẵn bạn có thể kích hoạt",featureMultiAgent:"Multi-Agent Workflows",featureMultiAgentDesc:"Phối hợp nhiều agent cho các tác vụ phức tạp",featureContent:"Tạo nội dung",featureContentDesc:"Tự động tạo và tối ưu nội dung",featureSocial:"Công cụ mạng xã hội",featureSocialDesc:"Lên lịch, phân tích và tự động tương tác",stepChooseKit:"Chọn Kit",stepConfigure:"Cấu hình",stepInstall:"Cài đặt",back:"Quay lại",next:"Tiếp theo",install:"Cài đặt",installSuccess:"Cài đặt hoàn tất!",installSuccessDesc:"{kit} đã sẵn sàng sử dụng",getStarted:"Bắt đầu",goToDashboard:"Đi đến Dashboard",kitConfig:"Cấu hình Kit",kitConfigSubtitle:"Cấu hình ClaudeKit Engineer",scopeGlobal:"Toàn cục",scopeProject:"Dự án",sectionGeneral:"Cài đặt chung",sectionPaths:"Đường dẫn",sectionPrivacy:"Bảo mật & Tin cậy",sectionProject:"Phát hiện dự án",sectionIntegrations:"Tích hợp",sectionHooks:"Hooks",sectionAdvanced:"Nâng cao",fieldCodingLevel:"Cấp độ lập trình",fieldCodingLevelDesc:"Cấp độ kinh nghiệm (-1=tự động, 0=mới bắt đầu, 1=trung cấp, 2=nâng cao, 3=chuyên gia, 4=tech-lead, 5=thần)",fieldStatusline:"Chế độ thanh trạng thái",fieldStatuslineDesc:"Lượng thông tin hiển thị trên thanh trạng thái",fieldStatuslineColors:"Màu thanh trạng thái",fieldStatuslineColorsDesc:"Bật màu ANSI trong thanh trạng thái",fieldStatuslineQuota:"Hiển thị Quota Statusline",fieldStatuslineQuotaDesc:"Hiển thị các nhãn quota 5h / wk trong statusline",fieldThinkingLanguage:"Ngôn ngữ suy nghĩ",fieldThinkingLanguageDesc:"Ngôn ngữ cho suy luận nội bộ của Claude (null=Tiếng Anh)",fieldResponseLanguage:"Ngôn ngữ phản hồi",fieldResponseLanguageDesc:"Ngôn ngữ cho phản hồi của Claude (null=theo người dùng)",fieldDocsPath:"Thư mục tài liệu",fieldDocsPathDesc:"Đường dẫn đến thư mục tài liệu",fieldPlansPath:"Thư mục kế hoạch",fieldPlansPathDesc:"Đường dẫn đến thư mục kế hoạch",fieldGlobalPlansPath:"Thư mục kế hoạch toàn cục",fieldGlobalPlansPathDesc:"Đường dẫn đến thư mục kế hoạch toàn cục",fieldPrivacyBlock:"Chặn quyền riêng tư",fieldPrivacyBlockDesc:"Chặn truy cập file nhạy cảm (.env, credentials)",fieldTrustEnabled:"Chế độ tin cậy",fieldTrustEnabledDesc:"Tự động phê duyệt các tool calls",fieldTrustPassphrase:"Mật khẩu tin cậy",fieldTrustPassphraseDesc:"Mật khẩu để bật chế độ tin cậy",fieldProjectType:"Loại dự án",fieldProjectTypeDesc:"Ghi đè loại dự án tự động phát hiện",fieldPackageManager:"Trình quản lý gói",fieldPackageManagerDesc:"Ghi đè trình quản lý gói tự động phát hiện",fieldFramework:"Framework",fieldFrameworkDesc:"Ghi đè framework tự động phát hiện",fieldGeminiModel:"Mô hình Gemini",fieldGeminiModelDesc:"Mô hình Gemini cho các lệnh CLI; id gemini-3.0-* cũ sẽ tự động ánh xạ",geminiModel25Flash:"Gemini 2.5 Flash — Mọi tài khoản",geminiModel25Pro:"Gemini 2.5 Pro — Có thể bị giới hạn dung lượng",geminiModel3FlashPreview:"Gemini 3 Flash Preview — Chỉ Pro/Ultra",geminiModel3ProPreview:"Gemini 3 Pro Preview — Chỉ Pro/Ultra",fieldResearchUseGemini:"Dùng Gemini cho nghiên cứu",fieldResearchUseGeminiDesc:"Dùng Gemini CLI thay vì WebSearch",fieldDocsMaxLoc:"Số dòng tối đa/tài liệu",fieldDocsMaxLocDesc:"Số dòng code tối đa cho mỗi file tài liệu",fieldPlanNamingFormat:"Định dạng tên kế hoạch",fieldPlanNamingFormatDesc:"Định dạng cho tên thư mục kế hoạch",fieldPlanDateFormat:"Định dạng ngày kế hoạch",fieldPlanDateFormatDesc:"Định dạng ngày cho tên kế hoạch (moment.js)",fieldPlanValidationMode:"Chế độ xác thực",fieldPlanValidationModeDesc:"Cách xác thực kế hoạch trước khi triển khai",fieldPlanMinQuestions:"Số câu hỏi tối thiểu",fieldPlanMinQuestionsDesc:"Số câu hỏi xác thực tối thiểu",fieldPlanMaxQuestions:"Số câu hỏi tối đa",fieldPlanMaxQuestionsDesc:"Số câu hỏi xác thực tối đa",fieldAssertions:"Assertions",fieldAssertionsDesc:"Các assertions và quy tắc cần thực thi",fieldHookSessionInit:"Khởi tạo phiên",fieldHookSessionInitDesc:"Phát hiện dự án và thiết lập môi trường",fieldHookSubagentInit:"Khởi tạo subagent",fieldHookSubagentInitDesc:"Inject context vào subagents",fieldHookSessionState:"Trạng thái phiên",fieldHookSessionStateDesc:"Lưu trạng thái phiên cho bàn giao và statusline",fieldHookCookAfterPlanReminder:"Nhắc cook sau plan",fieldHookCookAfterPlanReminderDesc:"Nhắc agent tiếp tục triển khai sau khi lập kế hoạch",fieldHookDescriptiveName:"Tên mô tả",fieldHookDescriptiveNameDesc:"Bắt buộc đặt tên file dạng kebab-case mô tả cho scripts",fieldHookDevRulesReminder:"Nhắc nhở quy tắc dev",fieldHookDevRulesReminderDesc:"Inject context quy tắc phát triển",fieldHookPlanFormatKanban:"Định dạng kanban plan",fieldHookPlanFormatKanbanDesc:"Đồng bộ metadata kanban của plan sau khi chỉnh sửa",fieldHookUsageQuotaCacheRefresh:"Cache hạn mức sử dụng",fieldHookUsageQuotaCacheRefreshDesc:"Làm mới cache thông tin hạn mức sử dụng",fieldHookUsageContextAwareness:"Nhận thức sử dụng cho prompt",fieldHookUsageContextAwarenessDesc:"Inject nhận thức giới hạn sử dụng vào prompt",fieldHookContextTracking:"Theo dõi ngữ cảnh",fieldHookContextTrackingDesc:"Theo dõi cửa sổ ngữ cảnh (% đã dùng, số token)",fieldHookScoutBlock:"Chặn Scout",fieldHookScoutBlockDesc:"Chặn thư mục nặng khỏi việc khám phá",fieldHookPrivacyBlock:"Hook chặn quyền riêng tư",fieldHookPrivacyBlockDesc:"Chặn đọc file nhạy cảm",fieldHookSimplifyGate:"Cổng đơn giản hóa",fieldHookSimplifyGateDesc:"Hook UserPromptSubmit — opt-in. Khi bật (simplify.gate.enabled=true), chặn cứng ship/merge/pr/deploy/publish và cảnh báo nhẹ commit/finalize/release khi diff vượt ngưỡng.",sectionSimplify:"Cổng đơn giản hóa",fieldSimplifyThresholdLocDelta:"Ngưỡng tổng LOC",fieldSimplifyThresholdLocDeltaDesc:"Tổng LOC thay đổi (toàn bộ file) vượt ngưỡng này thì cổng kích hoạt.",fieldSimplifyThresholdFileCount:"Ngưỡng số file",fieldSimplifyThresholdFileCountDesc:"Số file thay đổi vượt ngưỡng này thì cổng kích hoạt.",fieldSimplifyThresholdSingleFileLoc:"Ngưỡng LOC mỗi file",fieldSimplifyThresholdSingleFileLocDesc:"LOC thay đổi trong một file vượt ngưỡng này thì cổng kích hoạt.",fieldSimplifyGateEnabled:"Bật",fieldSimplifyGateEnabledDesc:"Công tắc chính. Tắt mặc định (opt-in). Bật để kích hoạt cổng; env CK_SIMPLIFY_DISABLED=1 luôn bỏ qua.",fieldSimplifyGateHardVerbs:"Động từ chặn cứng",fieldSimplifyGateHardVerbsDesc:"Động từ chặn cứng khi vượt ngưỡng.",fieldSimplifyGateSoftVerbs:"Động từ cảnh báo nhẹ",fieldSimplifyGateSoftVerbsDesc:"Động từ phát cảnh báo không chặn.",sectionUpdatePipeline:"Pipeline Cập nhật",fieldAutoInitAfterUpdate:"Tự động Init sau Update",fieldAutoInitAfterUpdateDesc:"Tự động chạy ck init sau ck update khi kit có phiên bản mới",fieldAutoMigrateAfterUpdate:"Tự động Migrate sau Update",fieldAutoMigrateAfterUpdateDesc:"Tự động chạy ck migrate sau ck update (độc lập với init)",fieldMigrateProviders:"Provider Migrate",fieldMigrateProvidersDesc:"Provider nào tự động migrate. Dùng 'auto' để quét hệ thống hoặc danh sách phân cách bằng dấu phẩy.",skillsPageTitle:"Quản lý Kỹ năng",skillsPageDesc:"Cài đặt kỹ năng ClaudeKit cho các agent lập trình",availableSkills:"Kỹ năng có sẵn",installedSkills:"Kỹ năng đã cài",noSkillsFound:"Không tìm thấy kỹ năng",installSkill:"Cài đặt",uninstallSkill:"Gỡ cài đặt",manageSkill:"Quản lý",syncRegistry:"Đồng bộ",installSkillTitle:"Cài đặt Kỹ năng",selectAgents:"Chọn agent đích",installLocation:"Vị trí cài đặt",globalInstall:"Toàn cục",projectInstall:"Dự án",confirmInstall:"Cài đặt cho các agent đã chọn",installingSkill:"Đang cài đặt...",skillInstallSuccess:"Cài đặt kỹ năng thành công",skillInstallFailed:"Cài đặt thất bại",agentClaudeCode:"Claude Code",agentCursor:"Cursor",agentCodex:"Codex",agentOpencode:"OpenCode",agentGoose:"Goose",agentGeminiCli:"Gemini CLI",agentAntigravity:"Antigravity",agentGithubCopilot:"GitHub Copilot",agentAmp:"Amp",agentKilo:"Kilo",agentRoo:"Roo",agentWindsurf:"Windsurf",agentCline:"Cline",agentOpenhands:"OpenHands",installed:"Đã cài",notInstalled:"Chưa cài",allAgents:"Tất cả Agent",filterByAgent:"Lọc theo agent",skillsTitle:"Kỹ năng",skillsSubtitle:"Duyệt, cài đặt và quản lý kỹ năng cho coding agents",availableCount:"Có sẵn",installedCount:"Đã cài",agentsCount:"Agents",searchSkills:"Tìm kiếm kỹ năng...",searchShortcut:"/",sortAZ:"A-Z",sortCategory:"Danh mục",sortInstalledFirst:"Đã cài trước",listView:"Dạng danh sách",gridView:"Dạng lưới",categoryAll:"Tất cả",categoryAI:"AI",categoryUIUX:"UI/UX",categoryBackend:"Backend",categorySecurity:"Bảo mật",categoryDevOps:"DevOps",categoryDatabase:"Cơ sở dữ liệu",categoryDevelopment:"Phát triển",categoryResearch:"Nghiên cứu",categoryGeneral:"Tổng quát",categoryCore:"Cốt lõi",categoryDocumentation:"Tài liệu",categoryTooling:"Công cụ",categoryMedia:"Phương tiện",categoryFrameworks:"Framework",skillsCountLabel:"{count} kỹ năng",installToAll:"Cài cho tất cả đã phát hiện",scopeLabel:"Phạm vi cài đặt",agentInstalled:"Đã cài",agentNotInstalled:"Chưa cài",skillSource:"Vị trí nguồn",skillSourceBadge:"Nguồn",detailPanelClose:"Đóng",versionLabel:"v{version}",installAllToAllAgents:"Cài tất cả cho tất cả Agent",bulkInstallFailed:"Cài hàng loạt thất bại",noAgentsDetected:"Không phát hiện agent nào",kitBadgeEngineer:"Engineer",kitBadgeMarketing:"Marketing",customizedBadge:"Đã tùy chỉnh",installedVersionLabel:"Phiên bản cài đặt",installedAtLabel:"Cài đặt lúc",sourceTimestampLabel:"Ngày nguồn",kitLabel:"Kit",skillMetadata:"Thông tin Skill",migrate:"Di trú",migrateTitle:"Di trú",migrateSubtitle:"Chuyển toàn bộ stack Claude Code sang provider khác",migrateDetectedProviders:"Đã phát hiện",migrateSelectedProviders:"Đã chọn",migrateDiscovering:"Đang quét nguồn di trú...",migrateRefresh:"Làm mới quét",migrateRun:"Chạy di trú",migrateRunning:"Đang di trú...",migrateSourceSummary:"Tổng quan nguồn",migratePresetCodex:"Codex",migratePresetAntigravity:"Antigravity",migratePresetCore:"Codex + Antigravity + Droid",migratePresetDetected:"Tất cả đã phát hiện",migrateScope:"Phạm vi",migrateScopeProject:"Dự án",migrateScopeGlobal:"Toàn cục",migrateTypes:"Loại di trú",migrateTypeAgents:"Subagents",migrateTypeCommands:"Commands",migrateTypeSkills:"Skills",migrateTypeConfig:"Config",migrateTypeRules:"Rules",migrateTypeHooks:"Hooks",migrateSearchProviders:"Tìm provider...",migrateSelectVisible:"Chọn phần đang hiện",migrateClearSelection:"Bỏ chọn tất cả",migrateProvidersHeading:"Provider đích",migrateProvidersCountSuffix:"provider",migrateNoProvidersMatch:"Không có provider khớp bộ lọc hiện tại.",migrateSelectButton:"Chọn",migrateSelectedButton:"Đã chọn",migrateSelectProviderAction:"Chọn provider",migrateUnselectProvider:"Bỏ chọn provider",migrateCapabilitiesLabel:"loại",migrateCapabilitiesSection:"Ma trận khả năng",migrateSupported:"Hỗ trợ",migrateUnsupportedShort:"Không hỗ trợ",migrateIncludedEnabled:"Đang bật",migrateIncludedDisabled:"Đang tắt",migrateLatestTarget:"Đích gần nhất",migrateNoResultForProvider:"Chưa có kết quả di trú cho provider này.",migrateActionSummaryTitle:"Sẵn sàng di trú",migrateGlobalOnlyCommandsShort:"Commands chỉ hỗ trợ global",migrateNoProviders:"Không có provider khả dụng.",migrateUnsupported:"Sẽ bỏ qua (không hỗ trợ)",migrateGlobalForced:"Provider đã chọn chỉ hỗ trợ command ở global scope. Chọn Global để cài.",migrateResults:"Kết quả di trú",migrateInstalled:"Đã cài",migrateSkipped:"Đã bỏ qua",migrateFailed:"Lỗi",migrateProvider:"Provider",migrateStatus:"Trạng thái",migratePath:"Đường dẫn",migrateError:"Lỗi",migrateStatusInstalled:"Đã cài",migrateStatusSkipped:"Đã bỏ qua",migrateStatusFailed:"Lỗi",migrateNoResults:"Chưa có kết quả di trú.",migrateDetectFailed:"Không thể quét dữ liệu di trú",migrateExecuteFailed:"Chạy di trú thất bại",migrateSelectProvider:"Vui lòng chọn ít nhất một provider",migrateNoTypesEnabled:"Bật ít nhất một loại di trú",migrateDetectedTag:"Đã phát hiện",migrateNotDetectedTag:"Chưa phát hiện",migrateFilterRecommended:"Đề xuất",migrateActionInstall:"Cài",migrateActionUpdate:"Cập nhật",migrateActionSkip:"Bỏ qua",migrateActionConflict:"Xung đột",migrateActionDelete:"Xóa",migrateUnchanged:"chưa thay đổi",migrateConflictSectionTitle:"Xung đột",migrateConflictUseCK:"Dùng CK",migrateConflictKeepMine:"Giữ của tôi",migrateConflictSmartMerge:"Merge thông minh",migrateConflictShowDiff:"Hiện diff",migrateConflictHideDiff:"Ẩn diff",migrateConflictResolved:"Đã giải quyết",migrateConflictManual:"Thủ công",migrateConflictOverwriteAll:"Ghi đè tất cả",migrateConflictKeepAll:"Giữ tất cả",migrateSummaryTitle:"Di trú hoàn tất",migrateSummaryNewMigration:"Di trú mới",migrateType:"Loại",migrateItem:"Mục",migrateReconciling:"Đang phân tích thay đổi...",migrateReviewPlan:"Xem kế hoạch",migrateExecutePlan:"Thực hiện di trú",migrateExecuting:"Đang thực hiện di trú...",migrateResolveConflicts:"Giải quyết xung đột trước khi thực hiện",migrateReason_newItem:"Mục mới từ provider",migrateReason_newProviderForItem:"Provider mới cho mục này",migrateReason_targetDeletedSourceChanged:"Đích đã xóa nhưng nguồn có thay đổi mới",migrateReason_targetDirEmptyReinstall:"Thư mục đích trống — cài lại",migrateReason_forceReinstall:"Yêu cầu cài lại bắt buộc",migrateReason_forceOverwrite:"Ghi đè bắt buộc (bạn đã chỉnh sửa, --force đang bật)",migrateReason_registryUpgradeReinstall:"Nâng cấp registry yêu cầu cài lại",migrateReason_sourceChanged:"Nguồn đã được cập nhật",migrateReason_registryUpgradeHeal:"Sửa đích cũ sau nâng cấp registry",migrateReason_noChanges:"Không phát hiện thay đổi",migrateReason_userEditsPreserved:"Giữ nguyên chỉnh sửa của người dùng",migrateReason_userDeletedRespected:"Tôn trọng việc xóa của người dùng",migrateReason_targetUpToDateBackfill:"Đích đã cập nhật",migrateReason_providerChecksumUnavailable:"Không có checksum provider",migrateReason_targetStateUnknown:"Không xác định được trạng thái đích",migrateReason_sourceRemovedOrphan:"Nguồn đã xóa — dọn dẹp orphan",migrateReason_renamedCleanup:"Mục đã đổi tên — xóa đường dẫn cũ",migrateReason_pathMigratedCleanup:"Đường dẫn đã di chuyển — xóa vị trí cũ",migrateReason_bothChanged:"Cả nguồn và đích đều có thay đổi",migrateReason_targetStateUnknownSourceChanged:"Nguồn thay đổi nhưng trạng thái đích không rõ",migrateBanner_emptyDir_title:"Phát hiện thư mục trống",migrateBanner_emptyDir_body:"mục bên dưới sẽ được cài lại. Bỏ chọn để bỏ qua.",migrateBanner_emptyDirRespected_title:"Tôn trọng việc xóa của bạn",migrateBanner_emptyDirRespected_body:"đang trống. Tôn trọng việc xóa của bạn.",migrateBanner_reinstallCta:"Cài lại các mục này",migrateModeLabel:"Chế độ di chuyển",migrateModeReconcile:"Đồng bộ",migrateModeReconcileDesc:"Phát hiện thay đổi thông minh",migrateModeInstall:"Cài đặt",migrateModeInstallDesc:"Chọn mục để cài",migrateModeConfirmTitle:"Chuyển chế độ?",migrateModeConfirmBody:"Bạn có {count} thay đổi chờ xử lý. Chuyển sang chế độ {mode} sẽ hủy chúng.",migrateModeConfirmSwitch:"Chuyển & hủy",migrateSmartDefaultInstall:"Phát hiện cài đặt mới — mặc định chế độ Cài đặt",migrateSmartDefaultReconcile:"Đã có registry — mặc định chế độ Đồng bộ",migrateInstallSelectAll:"Chọn tất cả",migrateInstallDeselectAll:"Bỏ chọn tất cả",migrateInstallDirItem:"thư mục",migrateInstallAlreadyInstalled:"đã cài",migrateInstallNoCandidates:"Không tìm thấy mục cài đặt nào cho provider đã chọn.",migrateInstallSelectedCount:"Đã chọn {count} / {total} mục",migrateInstallCta:"Cài {count} mục đã chọn",migrateInstallInstalling:"Đang cài...",migrateInstallLoadingCandidates:"Đang tải danh sách mục...",migrateFlip_moveToSkip:"Chuyển sang Bỏ qua",migrateFlip_moveToInstall:"Chuyển sang Cài",migrateFlip_checkAll:"Chọn tất cả",migrateFlip_uncheckAll:"Bỏ chọn tất cả",migrateFlip_toggleItem:"Bật/tắt mục",migrateConflictBanner_title:"Phát hiện xung đột",migrateConflictBanner_cta:"Mở trình giải quyết xung đột",migrateConflictBanner_hide:"Ẩn trình giải quyết xung đột",migrateShowSkippedItems:"Hiện mục đã bỏ qua",migrateHideSkippedItems:"Ẩn mục đã bỏ qua",migrateConflictBadge:"Xung đột",migrateSummarySubtitle:"mục đã di trú",migrateSummarySearchPlaceholder:"Tìm kiếm...",migrateSummaryFilterAll:"Tất cả",migrateSummaryCollapseAll:"Thu gọn",migrateSummaryExpandAll:"Mở rộng",migrateSummaryNoResults:"Không tìm thấy mục nào",migrateSummaryProviders:"Provider",migrateTypeUnknown:"Khác",kanbanTitle:"Bảng Kanban Kế hoạch",kanbanNoFile:"Chưa chọn file kế hoạch. Dùng tham số ?file=.",kanbanNoPhases:"Không phát hiện giai đoạn nào trong kế hoạch này",kanbanError400:"Yêu cầu không hợp lệ — thiếu tham số file",kanbanError403:"Truy cập bị từ chối — file nằm ngoài thư mục dự án",kanbanError404:"Không tìm thấy file kế hoạch",kanbanComplete:"hoàn thành",kanbanStatus_pending:"Chờ xử lý","kanbanStatus_in-progress":"Đang thực hiện",kanbanStatus_completed:"Hoàn thành",kanbanPhases:"giai đoạn",kanbanProgress:"Tiến độ",kanbanLoadError:"Không thể tải dữ liệu kế hoạch",plansNav:"Kế hoạch",plansTitle:"Bảng điều khiển kế hoạch",plansGlobalTitle:"Tất cả dự án",plansSubtitle:"Xem mọi kế hoạch đang hoạt động, timeline giai đoạn và thao tác nhanh trong một nơi.",plansEmpty:"Không tìm thấy kế hoạch",plansSearch:"Tìm kế hoạch...",plansProjectFilter:"Lọc theo dự án",plansAllProjects:"Tất cả dự án",plansSortBy:"Sắp xếp theo",plansViewGrid:"Lưới",plansViewKanban:"Kanban",plansFilterAll:"Tất cả trạng thái",plansSortDateDesc:"Mới nhất",plansSortDateAsc:"Cũ nhất",plansSortNameAsc:"Tên A-Z",plansSortNameDesc:"Tên Z-A",plansSortProgress:"Tiến độ cao nhất",plansLabel:"Kế hoạch",plansStatusPending:"Chờ xử lý",plansStatusInProgress:"Đang thực hiện",plansStatusInReview:"Đang rà soát",plansStatusDone:"Hoàn tất",plansStatusCancelled:"Đã huỷ",plansCompletedCount:"{count} hoàn thành",plansProjectPlans:"{count} kế hoạch",plansProjectLoadIssues:"Một số dự án không thể quét",plansStatusUnknown:"Chưa rõ",plansBackToPlans:"Quay lại danh sách kế hoạch",plansBackToPlan:"Quay lại kế hoạch",plansPrevious:"Trước",plansNext:"Sau",plansContents:"Mục lục",plansValidate:"Kiểm tra",plansStartNext:"Bắt đầu tiếp theo",plansRestart:"Bắt đầu lại",plansStart:"Bắt đầu",plansComplete:"Hoàn thành",plansReset:"Đặt lại",plansTimeline:"Timeline",plansActivity:"Hoạt động",plansActivitySubtitle:"12 tuần gần đây",plansActivityCombined:"Tổng hợp",plansActivityCommits:"Commit",plansActivityFiles:"Tệp",plansActivityEmpty:"Chưa có dữ liệu hoạt động.",plansHeatmapLoadError:"Không thể tải heatmap hoạt động.",plansHeatmapChanges:"{date} • {count} thay đổi",plansRead:"Đọc",plansPhases:"Giai đoạn",plansPhase:"Giai đoạn",plansPhaseCountCompact:"GD-{count}",plansKanbanEmpty:"Trống",plansLoadingPlan:"Đang tải kế hoạch...",plansLoadingReader:"Đang tải tài liệu...",plansLoadPlanFailed:"Không thể tải kế hoạch ({status})",plansLoadPlanFallback:"Không thể tải kế hoạch",plansLoadFileFailed:"Không thể tải tài liệu ({status})",plansLoadFileFallback:"Không thể tải tài liệu",plansProgressComplete:"Hoàn thành {count}%",plansPhaseCount:"{count} giai đoạn",plansPriority:"Ưu tiên",plansUpdated:"Cập nhật",plansLastUpdated:"Cập nhật lần cuối",plansPriorityLabel:"Ưu tiên {value}",plansUpdatedLabel:"Cập nhật {value}",plansTimelineAvgDays:"Trung bình {count} ngày",plansNoEffort:"Chưa có effort",plansNotFound:"Không tìm thấy kế hoạch",plansQuickInfoTitle:"Tổng quan kế hoạch",plansQuickInfoDescription:"Dùng chế độ xem này để theo dõi tiến độ giai đoạn, phạm vi timeline và hoạt động gần đây của kế hoạch.",plansCurrentStatus:"Trạng thái hiện tại",plansHeatmapMon:"T Hai",plansHeatmapWed:"T Tư",plansHeatmapFri:"T Sáu",developmentFeature:"Đang phát triển",betaFeature:"Beta",experimentalFeature:"Thử nghiệm",sectionModelTaxonomy:"Phân loại mô hình",taxonomyDescription:"Tuỳ chỉnh ánh xạ mô hình cho migration portable sang coding agent khác.",taxonomyTierHeavy:"Nặng (opus)",taxonomyTierBalanced:"Cân bằng (sonnet)",taxonomyTierLight:"Nhẹ (haiku)",taxonomyModel:"Mô hình",taxonomyEffort:"Mức nỗ lực",taxonomyResetProvider:"Đặt lại",taxonomyTier:"Cấp độ",statuslineBuilder:"Trình tạo dòng trạng thái",statuslineBuilderDescription:"Thiết kế bố cục dòng trạng thái bằng kéo và thả",statuslineSections:"Các mục",statuslinePreview:"Xem trước",statuslineTheme:"Giao diện màu sắc",statuslineSettings:"Cài đặt chung",statuslineResetDefaults:"Đặt lại mặc định",statuslineSave:"Lưu",statuslineBaseMode:"Chế độ cơ bản",statuslineBreakpoint:"Điểm ngắt responsive",statuslineMaxAgents:"Số agent tối đa",statuslineTodoTruncation:"Cắt ngắn task",statuslineEnable:"Bật",statuslineDisable:"Tắt",statuslineDragHint:"Kéo để thay đổi thứ tự, bật/tắt từng mục",statuslinePresetDefault:"Mặc định",statuslinePresetMonochrome:"Đơn sắc",statuslinePresetSolarized:"Solarized",statuslinePresetNord:"Nord",statuslinePresetDracula:"Dracula",statuslinePresetCatppuccin:"Catppuccin",statuslinePresetGruvbox:"Gruvbox",statuslinePresetTokyoNight:"Tokyo Night",statuslinePresetRosePine:"Rosé Pine",statuslinePresetOneDark:"One Dark",statuslinePresetAyu:"Ayu",statuslinePresetKanagawa:"Kanagawa",statuslinePresetStealth:"Ẩn mình",statuslinePresetHacker:"Hacker",statuslineSaved:"Đã lưu thành công",statuslineSaveError:"Lưu thất bại",statusline:"Dòng trạng thái",statuslineCollapseSettings:"Thu gọn cài đặt",statuslineExpandSettings:"Mở rộng cài đặt",statuslineIconOverride:"Ghi đè biểu tượng",statuslineLabelOverride:"Ghi đè nhãn",statuslineMaxWidth:"Chiều rộng tối đa (ký tự)",statuslineIconPlaceholder:"vd. 🤖",statuslineMaxWidthPlaceholder:"tự động",statuslineCustomColors:"Màu tùy chỉnh",statuslineColorContextGroup:"Cửa sổ ngữ cảnh",statuslineColorQuotaGroup:"Hạn mức sử dụng",statuslineColorGeneralGroup:"Chung",statuslineColorSectionGroup:"Màu từng mục",statuslineColorContextLow:"Thấp (<50%)",statuslineColorContextMid:"Trung (50-75%)",statuslineColorContextHigh:"Cao (>75%)",statuslineColorAccent:"Nhấn mạnh",statuslineColorMuted:"Giảm nhạt",statuslineColorSeparator:"Dấu phân cách",statuslineModeFullDesc:"Hiển thị tất cả các mục",statuslineModeCompactDesc:"Hiển thị thu gọn",statuslineModeMinimalDesc:"Chỉ thông tin cần thiết",statuslineModeNoneDesc:"Đã tắt",statuslinePreviewTitle:"Claude Code — xem trước dòng trạng thái",statuslinePreviewEmptyLine:"(dòng trống)",statuslinePreviewNoLines:"(chưa cấu hình dòng nào)",statuslineSectionModelLabel:"Mô hình",statuslineSectionContextLabel:"Cửa sổ ngữ cảnh",statuslineSectionQuotaLabel:"Hạn mức sử dụng",statuslineSectionDirectoryLabel:"Thư mục",statuslineSectionGitLabel:"Trạng thái Git",statuslineSectionCostLabel:"Chi phí",statuslineSectionChangesLabel:"Thay đổi",statuslineSectionAgentsLabel:"Agents",statuslineSectionTodosLabel:"Nhiệm vụ",statuslineSectionModelDesc:"Tên mô hình AI và nhà cung cấp",statuslineSectionContextDesc:"Thanh sử dụng cửa sổ ngữ cảnh",statuslineSectionQuotaDesc:"Hạn mức sử dụng 5 giờ và hàng tuần",statuslineSectionDirectoryDesc:"Thư mục làm việc hiện tại",statuslineSectionGitDesc:"Nhánh Git, thay đổi đã/chưa staged",statuslineSectionCostDesc:"Ước tính chi phí phiên",statuslineSectionChangesDesc:"Dòng thêm và xóa",statuslineSectionAgentsDesc:"Hoạt động agent gần đây",statuslineSectionTodosDesc:"Tiến độ tác vụ hiện tại",statuslineSectionsVisible:"mục hiển thị",statuslineLoadErrorSaveDisabled:"Không thể tải bố cục đã lưu. Tính năng lưu đã bị tắt để tránh mất dữ liệu.",statuslineAddLine:"Thêm dòng",statuslineRemoveLine:"Xóa",statuslineHiddenSections:"Mục ẩn",statuslineDragToLine:"Kéo mục vào dòng để hiển thị",statuslineQuotaLow:"Hạn mức thấp",statuslineQuotaHigh:"Hạn mức cao",statuslineLine:"Dòng",sessionsTitle:"Phiên làm việc",sessionDetail:"Chi tiết phiên",sessionMessages:"tin nhắn",sessionToolCalls:"lệnh gọi",sessionDuration:"Thời lượng",noSessionsData:"Không tìm thấy phiên",sessionReadOnly:"Chế độ chỉ xem",sessionLastActive:"Hoạt động lần cuối",sessionProjectSessions:"Phiên dự án",sessionBack:"Quay lại",sessionLoading:"Đang tải...",sessionError:"Tải thất bại",sessionCount:"phiên",sessionToolInput:"Đầu vào",sessionToolResult:"Kết quả",sessionToolsUsed:"Công cụ đã dùng",sessionSystemContext:"Ngữ cảnh hệ thống",sessionExpandAll:"Mở rộng tất cả",sessionCollapseAll:"Thu gọn tất cả",sessionNoContent:"Không có nội dung",sessionUser:"Người dùng",sessionAssistant:"Trợ lý",sessionThinking:"Đang suy nghĩ...",sessionSearchPlaceholder:"Tìm trong hội thoại...",sessionSearchResults:"kết quả",sessionNoResults:"Không tìm thấy",sessionGroupMessages:"tin nhắn",palettePlaceholder:"Tìm agents, lệnh, skills...",paletteNoResults:"Không tìm thấy kết quả",paletteAgents:"Agents",paletteCommands:"Lệnh",paletteSkills:"Skills",paletteProjects:"Dự án",paletteNavigation:"Điều hướng",skillsBrowser:"Skills",skillsCount:"{count} skills",skillDetail:"Chi tiết Skill",searchSkillsBrowserPlaceholder:"Tìm skills...",noSkillsBrowserFound:"Không tìm thấy skill",backToSkillsBrowser:"Quay lại Skills",skillTriggers:"Kích hoạt",skillLocal:"Cục bộ",skillGithub:"GitHub",systemNavLabel:"Hệ thống",dashboardTitle:"Bảng điều khiển",dashboardAgents:"Agents",dashboardCommands:"Lệnh",dashboardSkills:"Skills",dashboardMcpServers:"MCP Servers",configured:"Đã cấu hình",available:"Có sẵn",modelDistribution:"Phân bổ Model",recentAgents:"Agents gần đây",suggestionsTitle:"Gợi ý",acrossAgents:"trên {count} agents",noAgentsConfigured:"Chưa có agents trong ~/.claude/agents/",mcpTitle:"MCP Servers",mcpServerName:"Server",mcpCommand:"Lệnh",mcpArgs:"Tham số",mcpSource:"Nguồn",mcpStatus:"Trạng thái",mcpConfigured:"Đã cấu hình",mcpNoServers:"Chưa cấu hình MCP server",mcpSourceSettings:"settings.json",mcpSourceMcpJson:".mcp.json",mcpSourceProject:"Dự án",mcpToolCount:"Công cụ",agentsBrowser:"Agents",agentsBrowserCount:"{count} agents",filterAll:"Tất cả",agentDetail:"Chi tiết Agent",agentInstructions:"Hướng dẫn",agentFrontmatter:"Cấu hình",searchAgentsPlaceholder:"Tìm agents...",noAgentsFound:"Không tìm thấy agent",backToAgents:"Quay lại Agents",commandsBrowser:"Lệnh",commandsCount:"{count} lệnh",commandDetail:"Chi tiết lệnh",searchCommandsPlaceholder:"Tìm lệnh...",noCommandsFound:"Không tìm thấy lệnh",backToCommands:"Quay lại Lệnh",rootCommands:"Gốc",selectToView:"Chọn mục để xem chi tiết",indexingFrom:"Lấy từ",workflowsTitle:"Quy trình",workflowsSubtitle:"Tìm hiểu ClaudeKit thông qua hình ảnh hóa quy trình tương tác.",workflowsCredit:"Dữ liệu quy trình và giao diện được lấy cảm hứng từ",workflowImplementationRecipe:"Công thức triển khai",workflowSearchPlaceholder:"Tìm quy trình...",workflowNoResults:"Không tìm thấy quy trình",loadingWorkflows:"Đang tải quy trình...",workflowCategoryAll:"Tất cả",workflowCategoryGettingStarted:"Bắt đầu",workflowCategoryDesignFrontend:"Thiết kế & Frontend",workflowCategoryDebuggingFixes:"Xóa lỗi & Kiểm thử",workflowCategoryPlanningReview:"Lập kế hoạch & Đánh giá",workflowCategoryResearchDocs:"Nghiên cứu & Tài liệu",workflowCategoryShipping:"Triển khai",workflowCategoryBackendInfra:"Backend & Hạ tầng",workflowCategoryMediaCreative:"Truyền thông & Sáng tạo",workflowCategoryAdvanced:"Nâng cao",workflowComplexityBeginner:"Cơ bản",workflowComplexityIntermediate:"Trung bình",workflowComplexityAdvanced:"Nâng cao",workflowBuildFeature:"Xây dựng tính năng mới",workflowBuildFeatureDesc:"Thêm chức năng mới vào ứng dụng một cách hệ thống.",workflowQuickImplementation:"Triển khai nhanh",workflowQuickImplementationDesc:"Triển khai nhanh chóng các tính năng nhỏ gọn.",workflowStartNewProject:"Bắt đầu dự án mới",workflowStartNewProjectDesc:"Tạo lập một dự án mới hoàn toàn với nền tảng tiêu chuẩn.",workflowFrontendDesign:"Thiết kế Frontend",workflowFrontendDesignDesc:"Tạo giao diện người dùng dựa trên nguyên tắc thẩm mỹ cao.",workflowAiDesignStitch:"Thiết kế bằng AI Stitch",workflowAiDesignStitchDesc:"Điều khiển Google Stitch để tạo bản thiết kế từ văn bản.",workflowExcalidraw:"Bản vẽ Excalidraw",workflowExcalidrawDesc:"Diễn họa kiến trúc hoạt động sử dụng Excalidraw JSON.",workflowFixBug:"Sửa lỗi (Fix Bug)",workflowFixBugDesc:"Xác định nguyên nhân gốc rễ và tự động sửa các lỗi trong mã nguồn.",workflowSecurityAudit:"Kiểm toán Bảo mật",workflowSecurityAuditDesc:"Kiểm tra bảo mật toàn diện trên kho ứng dụng.",workflowTestScenarios:"Tình huống thử nghiệm",workflowTestScenariosDesc:"Tạo các trường hợp biên và tình huống thử nghiệm tính năng con.",workflowStride:"Phân tích STRIDE",workflowStrideDesc:"Thực hiện mô hình hóa và phân tích rủi ro bảo mật theo chuẩn STRIDE.",workflowCodeReview:"Code Review",workflowCodeReviewDesc:"Đánh giá chất lượng mã nguồn một cách kỹ lưỡng.",workflowPlanValidate:"Lập Kế hoạch + Kiểm chứng",workflowPlanValidateDesc:"Lập bản thảo thiết kế kiến trúc và đánh giá tính khả thi kỹ thuật.",workflowAdversarialReview:"Đánh giá Đối kháng",workflowAdversarialReviewDesc:"Kích hoạt chức năng đánh giá mức độ rủi ro hệ thống.",workflowAutoresearch:"Vòng lặp tự động (Autoloop)",workflowAutoresearchDesc:"Chạy vòng lặp tối ưu hóa tự động cho bất kỳ chỉ số nào.",workflowXia:"Chuyển giao thuật toán",workflowXiaDesc:"Chuyển giao hoặc tách rời thuật toán từ một kho lưu trữ bên ngoài.",workflowVisualDocumentation:"Diễn họa Tài liệu",workflowVisualDocumentationDesc:"Tạo sơ đồ mô tả logic và kiến trúc trong hệ thống hiện tại.",workflowTechnicalResearch:"Nghiên cứu Kỹ thuật",workflowTechnicalResearchDesc:"Phân tích sâu rộng cho các giải pháp kiến trúc trước khi triển khai.",workflowLlmsTxt:"Tạo cấu trúc llms.txt",workflowLlmsTxtDesc:"Phân tích mã nguồn và sinh tập tin llms.txt tiêu chuẩn.",workflowDevops:"DevOps / Triển khai",workflowDevopsDesc:"Cấu hình Docker, CI/CD và triển khai quy trình nền tảng web.",workflowShip:"Cập bến (Ship Pipeline)",workflowShipDesc:"Hợp nhất, kiểm thử, đánh giá, commit, và tạo Pull Request mới.",workflowDatabaseOps:"Thao tác CSDL",workflowDatabaseOpsDesc:"Tái cấu trúc các pipeline dữ liệu phức tạp tăng cường hiệu năng CSDL.",workflowRemotion:"Remotion Video",workflowRemotionDesc:"Xây dựng chuỗi video code thông qua thư viện Remotion.",workflowShowOff:"Show-Off Demo",workflowShowOffDesc:"Tạo file demo HTML tĩnh và trực quan cho mục đích showcase ứng dụng.",workflowAgentTeams:"Đội ngũ Agents",workflowAgentTeamsDesc:"Sinh các agent song song thực hiện nhiều tác vụ kết nối với nhau.",workflowWorktree:"Worktree Song song",workflowWorktreeDesc:"Cách ly và làm việc đồng thời trên nhiều luồng phát triển bằng worktrees."}},Np=g.createContext(null),Bv="ck-dashboard-lang";function X3(){const t=localStorage.getItem(Bv);return t==="en"||t==="vi"?t:navigator.language.startsWith("vi")?"vi":"en"}function Q3({children:t}){const[e,n]=g.useState(X3),r=g.useCallback(o=>{localStorage.setItem(Bv,o),n(o)},[]),s=g.useCallback(o=>Y3[e][o],[e]),i=g.useMemo(()=>({lang:e,setLang:r,t:s}),[e,r,s]);return c.jsx(Np.Provider,{value:i,children:t})}function ne(){const t=g.useContext(Np);if(!t)throw new Error("useI18n must be used within I18nProvider");return t}class J3 extends g.Component{constructor(){super(...arguments);Xm(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("App error:",n,r.componentStack)}render(){if(this.state.hasError){const n=this.state.error?.name==="ServerUnavailableError";return c.jsx(Np.Consumer,{children:r=>c.jsx("div",{className:"flex h-screen items-center justify-center bg-dash-bg",children:c.jsx("div",{className:"text-center space-y-4 max-w-md px-6",children:n?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-16 h-16 mx-auto rounded-full bg-orange-500/10 border border-orange-500/30 flex items-center justify-center text-3xl",children:"🔌"}),c.jsx("h1",{className:"text-2xl font-bold text-orange-500",children:r?.t("serverNotRunning")??"Server Not Running"}),c.jsx("p",{className:"text-dash-text-secondary",children:r?.t("startServerMessage")??"The Config UI requires the backend server to be running."}),c.jsxs("div",{className:"bg-dash-surface border border-dash-border rounded-lg p-4",children:[c.jsx("p",{className:"text-xs text-dash-text-muted uppercase tracking-widest mb-2 font-bold",children:r?.t("runThisCommand")??"Run this command"}),c.jsx("code",{className:"block text-sm text-dash-accent font-mono bg-dash-bg px-3 py-2 rounded border border-dash-border",children:"ck config"})]}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-2 bg-dash-accent text-dash-bg rounded-lg font-bold hover:bg-dash-accent-hover transition-colors",children:r?.t("tryAgain")??"Try Again"})]}):c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-2xl font-bold text-red-500",children:r?.t("somethingWentWrong")??"Something went wrong"}),c.jsx("p",{className:"text-dash-text-muted",children:this.state.error?.message}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-dash-accent text-white rounded-md hover:opacity-90",children:r?.t("reloadApp")??"Reload App"})]})})})})}return this.props.children}}const kn=({direction:t="horizontal",isDragging:e=!1,onMouseDown:n})=>{const r=t==="horizontal";return c.jsx("div",{onMouseDown:n,className:`
|
|
22
22
|
group flex items-center justify-center shrink-0
|
|
23
23
|
${r?"w-2 cursor-col-resize":"h-2 cursor-row-resize"}
|
|
24
24
|
${e?"bg-dash-accent/20":"hover:bg-dash-surface-hover/50"}
|
|
@@ -148,6 +148,14 @@ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}
|
|
|
148
148
|
"hooks": {
|
|
149
149
|
"subagent-init": false
|
|
150
150
|
}
|
|
151
|
+
}`},"hooks.session-state":{path:"hooks.session-state",type:"boolean",default:"true",description:"Persists session state for stop/subagent-stop handoff context and statusline activity.",descriptionVi:"Lưu trạng thái phiên cho ngữ cảnh bàn giao và hoạt động statusline.",effect:"When enabled, ClaudeKit can recover recent session context and expose activity state to the statusline.",effectVi:"Khi bật, ClaudeKit có thể khôi phục ngữ cảnh phiên gần đây và hiển thị trạng thái hoạt động lên statusline.",example:`{
|
|
152
|
+
"hooks": {
|
|
153
|
+
"session-state": false
|
|
154
|
+
}
|
|
155
|
+
}`},"hooks.cook-after-plan-reminder":{path:"hooks.cook-after-plan-reminder",type:"boolean",default:"true",description:"Reminds agents to continue implementation after a planning subagent finishes.",descriptionVi:"Nhắc agent tiếp tục triển khai sau khi subagent lập kế hoạch hoàn tất.",effect:"When enabled, plan-only subagent output gets a follow-up reminder so implementation does not stop at planning.",effectVi:"Khi bật, đầu ra của subagent lập kế hoạch nhận nhắc nhở tiếp tục để quy trình không dừng ở bước plan.",example:`{
|
|
156
|
+
"hooks": {
|
|
157
|
+
"cook-after-plan-reminder": false
|
|
158
|
+
}
|
|
151
159
|
}`},"hooks.descriptive-name":{path:"hooks.descriptive-name",type:"boolean",default:"true",description:"Injects language-aware naming context so agents generate meaningful, self-documenting file names.",descriptionVi:"Tiêm ngữ cảnh đặt tên theo ngôn ngữ để agent tạo tên tệp có ý nghĩa, tự tài liệu hóa.",effect:"When enabled, reminds the agent to prefer descriptive names while respecting language conventions such as snake_case for Python, Go, and Rust.",effectVi:"Khi bật, nhắc agent ưu tiên tên mô tả nhưng vẫn theo quy ước ngôn ngữ như snake_case cho Python, Go và Rust.",example:`{
|
|
152
160
|
"hooks": {
|
|
153
161
|
"descriptive-name": false
|
|
@@ -156,6 +164,14 @@ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}
|
|
|
156
164
|
"hooks": {
|
|
157
165
|
"dev-rules-reminder": false
|
|
158
166
|
}
|
|
167
|
+
}`},"hooks.plan-format-kanban":{path:"hooks.plan-format-kanban",type:"boolean",default:"true",description:"Keeps plan kanban metadata synchronized after plan files are edited.",descriptionVi:"Giữ metadata kanban của plan đồng bộ sau khi chỉnh sửa tệp kế hoạch.",effect:"When enabled, plan file edits can update kanban state so dashboards stay aligned with on-disk plans.",effectVi:"Khi bật, chỉnh sửa tệp kế hoạch có thể cập nhật trạng thái kanban để dashboard khớp với plan trên đĩa.",example:`{
|
|
168
|
+
"hooks": {
|
|
169
|
+
"plan-format-kanban": false
|
|
170
|
+
}
|
|
171
|
+
}`},"hooks.usage-quota-cache-refresh":{path:"hooks.usage-quota-cache-refresh",type:"boolean",default:"true",description:"Refreshes cached usage quota information during lifecycle events.",descriptionVi:"Làm mới cache thông tin hạn mức sử dụng trong các sự kiện vòng đời.",effect:"When enabled, ClaudeKit keeps quota data current for statusline and context-aware helpers.",effectVi:"Khi bật, ClaudeKit giữ dữ liệu hạn mức cập nhật cho statusline và trợ lý nhận biết ngữ cảnh.",example:`{
|
|
172
|
+
"hooks": {
|
|
173
|
+
"usage-quota-cache-refresh": false
|
|
174
|
+
}
|
|
159
175
|
}`},"hooks.usage-context-awareness":{path:"hooks.usage-context-awareness",type:"boolean",default:"true",description:"Injects usage-limit awareness into prompt context so the agent can react before overruns.",descriptionVi:"Tiêm nhận biết giới hạn sử dụng vào ngữ cảnh prompt để agent phản ứng trước khi vượt quá.",effect:"When enabled, reminder context can warn the agent to stay concise or split work when usage windows are tight.",effectVi:"Khi bật, ngữ cảnh nhắc nhở có thể cảnh báo agent nên ngắn gọn hơn hoặc chia nhỏ công việc khi cửa sổ sử dụng trở nên chặt.",example:`{
|
|
160
176
|
"hooks": {
|
|
161
177
|
"usage-context-awareness": false
|
|
@@ -275,7 +291,7 @@ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}
|
|
|
275
291
|
`))};if((ce.mac||ce.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:Ie.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Vp(e,h,q.single(this.toEditorPos(r.selectionStart,f),this.toEditorPos(r.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);i=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||i||new DOMRect,s.push(i)}n.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let i of r.getTextFormats()){let o=i.underlineStyle,a=i.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(i.rangeStart),d=this.toEditorPos(i.rangeEnd);if(l<d){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;s.push(ye.mark({attributes:{style:u}}).range(l,d))}}}e.dispatch({effects:X1.of(ye.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=Ko(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,o,a,l,d)=>{if(r)return;let u=d.length-(o-i);if(s&&o>=s.to)if(s.from==i&&s.to==o&&s.insert.eq(d)){s=this.pendingContextChange=null,n+=u,this.to+=u;return}else s=null,this.revertPending(e.state);if(i+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||o>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(o),d.toString()),this.to+=u}n+=u}),s&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ae{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(i=>r(i,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||gP(e.parent)||document,this.viewState=new y0(e.state||Ae.create(e)),e.scrollTo&&e.scrollTo.is(Hl)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Zs).map(s=>new $u(s));for(let s of this.plugins)s.update(this);this.observer=new BD(this),this.inputState=new aD(this),this.inputState.ensureHandlers(this.plugins),this.docView=new i0(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof ht?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,s,i=this.state;for(let f of e){if(f.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=f.state}if(this.destroyed){this.viewState.state=i;return}let o=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(pw))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=mw(i,o),l||(a=1));let d=this.observer.delayedAndroidKey,u=null;if(d?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(Ae.phrases)!=this.state.facet(Ae.phrases))return this.setState(i);s=Yc.create(this,i,e),s.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:p}=f.state.selection;h=new ui(p.empty?p:q.cursor(p.head,p.head>p.anchor?-1:1))}for(let p of f.effects)p.is(Hl)&&(h=p.value.clip(this.state))}this.viewState.update(s,h),this.bidiCache=Zc.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(mo)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(ql)!=s.state.facet(ql)&&(this.viewState.mustMeasureContent=!0),(n||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let f of this.state.facet(Cf))try{f(s)}catch(p){Yt(this.state,p,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!aw(this,u)&&d.force&&di(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new y0(e),this.plugins=e.facet(Zs).map(r=>new $u(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new i0(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Zs),r=e.state.facet(Zs);if(n!=r){let s=[];for(let i of r){let o=n.indexOf(i);if(o<0)s.push(new $u(i));else{let a=this.plugins[o];a.mustUpdate=e,s.push(a)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Yt(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(T1(r))i=-1,o=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(s);i=p.from,o=p.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];l&4||([this.measureRequests,d]=[d,this.measureRequests]);let u=d.map(p=>{try{return p.read(this)}catch(m){return Yt(this.state,m),S0}}),h=Yc.create(this,this.state,[]),f=!1;h.flags|=l,n?n.flags|=l:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let p=0;p<d.length;p++)if(u[p]!=S0)try{let m=d[p];m.write&&m.write(u[p],this)}catch(m){Yt(this.state,m)}if(f&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let m=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-o;if(m>1||m<-1){s=s+m,r.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Cf))a(n)}get themeClasses(){return Of+" "+(this.state.facet(Ef)?yw:bw)+" "+this.state.facet(ql)}updateAttrs(){let e=C0(this,Q1,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(vr)?"true":"false",class:"cm-content",style:`${ce.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),C0(this,zp,n);let r=this.observer.ignore(()=>{let s=Zg(this.contentDOM,this.contentAttrs,n),i=Zg(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(ae.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(mo);let e=this.state.facet(ae.cspNonce);Qr.mount(this.root,this.styleModules.concat(ID).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return zu(this,e,o0(this,e,n,r))}moveByGroup(e,n){return zu(this,e,o0(this,e,n,r=>JP(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return q.cursor(i.side(n,s)+e.from,i.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return QP(this,e,n,r)}moveVertically(e,n,r){return zu(this,e,ZP(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=Pf(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Pf(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),o=i[wr.find(i,e-s.from,-1,n)];return Uo(r,o.dir==ze.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(G1)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>zD)return _1(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||B1(i.isolates,r=n0(this,e))))return i.order;r||(r=n0(this,e));let s=CP(e.text,n,r);return this.bidiCache.push(new Zc(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ce.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{A1(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Hl.of(new ui(typeof e=="number"?q.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Hl.of(new ui(q.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return tt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return tt.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Qr.newName(),s=[ql.of(r),mo.of(Mf(`.${r}`,e))];return n&&n.dark&&s.push(Ef.of(!0)),s}static baseTheme(e){return Bs.lowest(mo.of(Mf("."+Of,e,vw)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&it.get(r)||it.get(e);return((n=s?.root)===null||n===void 0?void 0:n.view)||null}}ae.styleModule=mo;ae.inputHandler=K1;ae.clipboardInputFilter=_p;ae.clipboardOutputFilter=Fp;ae.scrollHandler=Y1;ae.focusChangeEffect=U1;ae.perLineTextDirection=G1;ae.exceptionSink=W1;ae.updateListener=Cf;ae.editable=vr;ae.mouseSelectionStyle=V1;ae.dragMovesSelection=H1;ae.clickAddsSelectionRange=z1;ae.decorations=qo;ae.blockWrappers=J1;ae.outerDecorations=Z1;ae.atomicRanges=al;ae.bidiIsolatedRanges=ew;ae.scrollMargins=tw;ae.darkTheme=Ef;ae.cspNonce=de.define({combine:t=>t.length?t[0]:""});ae.contentAttributes=zp;ae.editorAttributes=Q1;ae.lineWrapping=ae.contentAttributes.of({class:"cm-lineWrapping"});ae.announce=je.define();const zD=4096,S0={};class Zc{constructor(e,n,r,s,i,o){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=i,this.order=o}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:ze.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let o=e[i];o.dir==s&&!n.touchesRange(o.from,o.to)&&r.push(new Zc(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function C0(t,e,n){for(let r=t.state.facet(e),s=r.length-1;s>=0;s--){let i=r[s],o=typeof i=="function"?i(t):i;o&&Ip(o,n)}return n}const HD=ce.mac?"mac":ce.windows?"win":ce.linux?"linux":"key";function VD(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,i,o,a;for(let l=0;l<n.length-1;++l){const d=n[l];if(/^(cmd|meta|m)$/i.test(d))a=!0;else if(/^a(lt)?$/i.test(d))s=!0;else if(/^(c|ctrl|control)$/i.test(d))i=!0;else if(/^s(hift)?$/i.test(d))o=!0;else if(/^mod$/i.test(d))e=="mac"?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+d)}return s&&(r="Alt-"+r),i&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function Yl(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const WD=Bs.default(ae.domEventHandlers({keydown(t,e){return kw(ww(e.state),t,e,"editor")}})),Ud=de.define({enables:WD}),j0=new WeakMap;function ww(t){let e=t.facet(Ud),n=j0.get(e);return n||j0.set(e,n=GD(e.reduce((r,s)=>r.concat(s),[]))),n}function KD(t,e,n){return kw(ww(t.state),e,t,n)}let zr=null;const UD=4e3;function GD(t,e=HD){let n=Object.create(null),r=Object.create(null),s=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},i=(o,a,l,d,u)=>{var h,f;let p=n[o]||(n[o]=Object.create(null)),m=a.split(/ (?!$)/).map(y=>VD(y,e));for(let y=1;y<m.length;y++){let w=m.slice(0,y).join(" ");s(w,!0),p[w]||(p[w]={preventDefault:!0,stopPropagation:!1,run:[v=>{let k=zr={view:v,prefix:w,scope:o};return setTimeout(()=>{zr==k&&(zr=null)},UD),!0}]})}let x=m.join(" ");s(x,!1);let b=p[x]||(p[x]={preventDefault:!1,stopPropagation:!1,run:((f=(h=p._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&b.run.push(l),d&&(b.preventDefault=!0),u&&(b.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let d of a){let u=n[d]||(n[d]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in u)u[f].run.push(p=>h(p,Af))}let l=o[e]||o.key;if(l)for(let d of a)i(d,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&i(d,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return n}let Af=null;function kw(t,e,n,r){Af=e;let s=aP(e),i=Ut(s,0),o=Jn(i)==s.length&&s!=" ",a="",l=!1,d=!1,u=!1;zr&&zr.view==n&&zr.scope==r&&(a=zr.prefix+" ",dw.indexOf(e.keyCode)<0&&(d=!0,zr=null));let h=new Set,f=b=>{if(b){for(let y of b.run)if(!h.has(y)&&(h.add(y),y(n)))return b.stopPropagation&&(u=!0),!0;b.preventDefault&&(b.stopPropagation&&(u=!0),d=!0)}return!1},p=t[r],m,x;return p&&(f(p[a+Yl(s,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ce.windows&&e.ctrlKey&&e.altKey)&&!(ce.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=Jr[e.keyCode])&&m!=s?(f(p[a+Yl(m,e,!0)])||e.shiftKey&&(x=Vo[e.keyCode])!=s&&x!=m&&f(p[a+Yl(x,e,!1)]))&&(l=!0):o&&e.shiftKey&&f(p[a+Yl(s,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),d&&(l=!0),l&&u&&e.stopPropagation(),Af=null,l}class ll{constructor(e,n,r,s,i){this.className=e,this.left=n,this.top=r,this.width=s,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=Sw(e);return[new ll(n,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return qD(e,n,r)}}function Sw(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==ze.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function N0(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let i=t.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,a=t.posAtCoords({x:i.left+1,y:o}),l=t.posAtCoords({x:i.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function qD(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),i=t.textDirection==ze.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=Sw(t),d=o.querySelector(".cm-line"),u=d&&window.getComputedStyle(d),h=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=a.right-(u?parseInt(u.paddingRight):0),p=Nf(t,r,1),m=Nf(t,s,-1),x=p.type==Pt.Text?p:null,b=m.type==Pt.Text?m:null;if(x&&(t.lineWrapping||p.widgetLineBreaks)&&(x=N0(t,r,1,x)),b&&(t.lineWrapping||m.widgetLineBreaks)&&(b=N0(t,s,-1,b)),x&&b&&x.from==b.from&&x.to==b.to)return w(v(n.from,n.to,x));{let C=x?v(n.from,null,x):k(p,!1),N=b?v(null,n.to,b):k(m,!0),S=[];return(x||p).to<(b||m).from-(x&&b?1:0)||p.widgetLineBreaks>1&&C.bottom+t.defaultLineHeight/2<N.top?S.push(y(h,C.bottom,f,N.top)):C.bottom<N.top&&t.elementAtHeight((C.bottom+N.top)/2).type==Pt.Text&&(C.bottom=N.top=(C.bottom+N.top)/2),w(C).concat(S).concat(w(N))}function y(C,N,S,D){return new ll(e,C-l.left,N-l.top,S-C,D-N)}function w({top:C,bottom:N,horizontal:S}){let D=[];for(let E=0;E<S.length;E+=2)D.push(y(S[E],C,S[E+1],N));return D}function v(C,N,S){let D=1e9,E=-1e9,M=[];function P(j,O,T,$,I){let B=t.coordsAtPos(j,j==S.to?-2:2),V=t.coordsAtPos(T,T==S.from?2:-2);!B||!V||(D=Math.min(B.top,V.top,D),E=Math.max(B.bottom,V.bottom,E),I==ze.LTR?M.push(i&&O?h:B.left,i&&$?f:V.right):M.push(!i&&$?h:V.left,!i&&O?f:B.right))}let A=C??S.from,R=N??S.to;for(let j of t.visibleRanges)if(j.to>A&&j.from<R)for(let O=Math.max(j.from,A),T=Math.min(j.to,R);;){let $=t.state.doc.lineAt(O);for(let I of t.bidiSpans($)){let B=I.from+$.from,V=I.to+$.from;if(B>=T)break;V>O&&P(Math.max(B,O),C==null&&B<=A,Math.min(V,T),N==null&&V>=R,I.dir)}if(O=$.to+1,O>=T)break}return M.length==0&&P(A,C==null,R,N==null,t.textDirection),{top:D,bottom:E,horizontal:M}}function k(C,N){let S=a.top+(N?C.top:C.bottom);return{top:S,bottom:S,horizontal:[]}}}function YD(t,e){return t.constructor==e.constructor&&t.eq(e)}class XD{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Ec)!=e.state.facet(Ec)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Ec);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!YD(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,ce.safari&&ce.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ec=de.define();function Cw(t){return[tt.define(e=>new XD(e,t)),Ec.of(t)]}const Yo=de.define({combine(t){return lr(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function QD(t={}){return[Yo.of(t),JD,ZD,eE,q1.of(!0)]}function jw(t){return t.startState.facet(Yo)!=t.state.facet(Yo)}const JD=Cw({above:!0,markers(t){let{state:e}=t,n=e.facet(Yo),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||n.drawRangeCursor){let o=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=s.empty?s:q.cursor(s.head,s.head>s.anchor?-1:1);for(let l of ll.forRange(t,o,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=jw(t);return n&&P0(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){P0(e.state,t)},class:"cm-cursorLayer"});function P0(t,e){e.style.animationDuration=t.facet(Yo).cursorBlinkRate+"ms"}const ZD=Cw({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:ll.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||jw(t)},class:"cm-selectionLayer"}),eE=Bs.highest(ae.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Nw=je.define({map(t,e){return t==null?null:e.mapPos(t)}}),bo=Dt.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Nw)?r.value:n,t)}}),tE=tt.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(bo);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(bo)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(bo),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(bo)!=t&&this.view.dispatch({effects:Nw.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function nE(){return[bo,tE]}function D0(t,e,n,r,s){e.lastIndex=0;for(let i=t.iterRange(n,r),o=n,a;!i.next().done;o+=i.value.length)if(!i.lineBreak)for(;a=e.exec(i.value);)s(o+a.index,a)}function rE(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:s,to:i}of n)s=Math.max(t.state.doc.lineAt(s).from,s-e),i=Math.min(t.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=s?r[r.length-1].to=i:r.push({from:s,to:i});return r}class sE{constructor(e){const{regexp:n,decoration:r,decorate:s,boundary:i,maxLength:o=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,s)this.addMatch=(a,l,d,u)=>s(u,d,d+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,d,u)=>{let h=r(a,l,d);h&&u(d,d+a[0].length,h)};else if(r)this.addMatch=(a,l,d,u)=>u(d,d+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=o}createDeco(e){let n=new Sr,r=n.add.bind(n);for(let{from:s,to:i}of rE(e,this.maxLength))D0(e.state.doc,this.regexp,s,i,(o,a)=>this.addMatch(a,e,o,r));return n.finish()}updateDeco(e,n){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),s=Math.max(l,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,n.map(e.changes),r,s):n}updateRange(e,n,r,s){for(let i of e.visibleRanges){let o=Math.max(i.from,r),a=Math.min(i.to,s);if(a>=o){let l=e.state.doc.lineAt(o),d=l.to<a?e.state.doc.lineAt(a):l,u=Math.max(i.from,l.from),h=Math.min(i.to,d.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;a<d.to;a++)if(this.boundary.test(d.text[a-d.from])){h=a;break}}let f=[],p,m=(x,b,y)=>f.push(y.range(x,b));if(l==d)for(this.regexp.lastIndex=u-l.from;(p=this.regexp.exec(l.text))&&p.index<h-l.from;)this.addMatch(p,e,p.index+l.from,m);else D0(e.state.doc,this.regexp,u,h,(x,b)=>this.addMatch(b,e,x,m));n=n.update({filterFrom:u,filterTo:h,filter:(x,b)=>x<u||b>h,add:f})}}return n}}const Tf=/x/.unicode!=null?"gu":"g",iE=new RegExp(`[\0-\b
|
|
276
292
|
--\u2028\u2029\uFEFF-]`,Tf),oE={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Wu=null;function aE(){var t;if(Wu==null&&typeof document<"u"&&document.body){let e=document.body.style;Wu=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Wu||!1}const Oc=de.define({combine(t){let e=lr(t,{render:null,specialChars:iE,addSpecialChars:null});return(e.replaceTabs=!aE())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Tf)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Tf)),e}});function lE(t={}){return[Oc.of(t),cE()]}let E0=null;function cE(){return E0||(E0=tt.fromClass(class{constructor(t){this.view=t,this.decorations=ye.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Oc)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new sE({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:s}=n.state,i=Ut(e[0],0);if(i==9){let o=s.lineAt(r),a=n.state.tabSize,l=Bi(o.text,a,r-o.from);return ye.replace({widget:new fE((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=ye.replace({widget:new hE(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Oc);t.startState.facet(Oc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const dE="•";function uE(t){return t>=32?dE:t==10?"":String.fromCharCode(9216+t)}class hE extends cr{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=uE(this.code),r=e.state.phrase("Control character")+" "+(oE[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,n);if(s)return s;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class fE extends cr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function pE(){return gE}const mE=ye.line({class:"cm-activeLine"}),gE=tt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(mE.range(s.from)),e=s.from)}return ye.set(n)}},{decorations:t=>t.decorations});class xE extends cr{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?jo(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),s=Uo(n[0],r.direction!="rtl"),i=parseInt(r.lineHeight);return s.bottom-s.top>i*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+i}:s}ignoreEvent(){return!1}}function bE(t){let e=tt.fromClass(class{constructor(n){this.view=n,this.placeholder=t?ye.set([ye.widget({widget:new xE(t),side:1}).range(0)]):ye.none}get decorations(){return this.view.state.doc.length?ye.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,ae.contentAttributes.of({"aria-placeholder":t})]:e}const Lf=2e3;function yE(t,e,n){let r=Math.min(e.line,n.line),s=Math.max(e.line,n.line),i=[];if(e.off>Lf||n.off>Lf||e.col<0||n.col<0){let o=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=s;l++){let d=t.doc.line(l);d.length<=a&&i.push(q.range(d.from+o,d.to+a))}}else{let o=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=s;l++){let d=t.doc.line(l),u=ff(d.text,o,t.tabSize,!0);if(u<0)i.push(q.cursor(d.to));else{let h=ff(d.text,a,t.tabSize);i.push(q.range(d.from+u,d.from+h))}}}return i}function vE(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function O0(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),s=n-r.from,i=s>Lf?-1:s==r.length?vE(t,e.clientX):Bi(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:s}}function wE(t,e){let n=O0(t,e),r=t.state.selection;return n?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(n.line).from),o=s.state.doc.lineAt(i);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(s.changes)}},get(s,i,o){let a=O0(t,s);if(!a)return r;let l=yE(t.state,n,a);return l.length?o?q.create(l.concat(r.ranges)):q.create(l):r}}:null}function kE(t){let e=n=>n.altKey&&n.button==0;return ae.mouseSelectionStyle.of((n,r)=>e(r)?wE(n,r):null)}const SE={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},CE={style:"cursor: crosshair"};function jE(t={}){let[e,n]=SE[t.key||"Alt"],r=tt.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||n(s))},keyup(s){(s.keyCode==e||!n(s))&&this.set(!1)},mousemove(s){this.set(n(s))}}});return[r,ae.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?CE:null})]}const Xl="-10000px";class Pw{constructor(e,n,r,s){this.facet=n,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let i=null;this.tooltipViews=this.tooltips.map(o=>i=r(o,i))}update(e,n){var r;let s=e.state.facet(this.facet),i=s.filter(l=>l);if(s===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=n?[]:null;for(let l=0;l<i.length;l++){let d=i[l],u=-1;if(d){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==d.create&&(u=h)}if(u<0)o[l]=this.createTooltipView(d,l?o[l-1]:null),a&&(a[l]=!!d.above);else{let h=o[l]=this.tooltipViews[u];a&&(a[l]=n[u]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,d)=>n[d]=l),n.length=a.length),this.input=s,this.tooltips=i,this.tooltipViews=o,!0}}function NE(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Ku=de.define({combine:t=>{var e,n,r;return{position:ce.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(s=>s.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||NE}}}),M0=new WeakMap,Up=tt.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Ku);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Pw(t,Gp,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Ku);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",n.dom.appendChild(s)}return n.dom.style.position=this.position,n.dom.style.top=Xl,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ce.safari){let o=i.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=Hp(this.view);return{visible:{left:r.left+s.left,top:r.top+s.top,right:r.right-s.right,bottom:r.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Ku).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:s,scaleY:i}=t,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],d=this.manager.tooltipViews[a],{dom:u}=d,h=t.pos[a],f=t.size[a];if(!h||l.clip!==!1&&(h.bottom<=Math.max(n.top,r.top)||h.top>=Math.min(n.bottom,r.bottom)||h.right<Math.max(n.left,r.left)-.1||h.left>Math.min(n.right,r.right)+.1)){u.style.top=Xl;continue}let p=l.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,m=p?7:0,x=f.right-f.left,b=(e=M0.get(d))!==null&&e!==void 0?e:f.bottom-f.top,y=d.offset||DE,w=this.view.textDirection==ze.LTR,v=f.width>r.right-r.left?w?r.left:r.right-f.width:w?Math.max(r.left,Math.min(h.left-(p?14:0)+y.x,r.right-x)):Math.min(Math.max(r.left,h.left-x+(p?14:0)-y.x),r.right-x),k=this.above[a];!l.strictSide&&(k?h.top-b-m-y.y<r.top:h.bottom+b+m+y.y>r.bottom)&&k==r.bottom-h.bottom>h.top-r.top&&(k=this.above[a]=!k);let C=(k?h.top-r.top:r.bottom-h.bottom)-m;if(C<b&&d.resize!==!1){if(C<this.view.defaultLineHeight){u.style.top=Xl;continue}M0.set(d,b),u.style.height=(b=C)/i+"px"}else u.style.height&&(u.style.height="");let N=k?h.top-b-m-y.y:h.bottom+m+y.y,S=v+x;if(d.overlap!==!0)for(let D of o)D.left<S&&D.right>v&&D.top<N+b&&D.bottom>N&&(N=k?D.top-b-2-m:D.bottom+m+2);if(this.position=="absolute"?(u.style.top=(N-t.parent.top)/i+"px",A0(u,(v-t.parent.left)/s)):(u.style.top=N/i+"px",A0(u,v/s)),p){let D=h.left+(w?y.x:-y.x)-(v+14-7);p.style.left=D/s+"px"}d.overlap!==!0&&o.push({left:v,top:N,right:S,bottom:N+b}),u.classList.toggle("cm-tooltip-above",k),u.classList.toggle("cm-tooltip-below",!k),d.positioned&&d.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Xl}},{eventObservers:{scroll(){this.maybeMeasure()}}});function A0(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const PE=ae.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),DE={x:0,y:0},Gp=de.define({enables:[Up,PE]}),ed=de.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Gd{static create(e){return new Gd(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Pw(e,ed,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(n===void 0)n=s;else if(n!==s)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const EE=Gp.compute([ed],t=>{let e=t.facet(ed);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:Gd.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class OE{constructor(e,n,r,s,i){this.view=e,this.source=n,this.field=r,this.setHover=s,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.tile.nearest(n.target);if(!r)return;let s,i=1;if(r.isWidget())s=r.posAtStart;else{if(s=e.posAtCoords(n),s==null)return;let a=e.coordsAtPos(s);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-e.defaultCharacterWidth||n.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(s)).find(u=>u.from<=s&&u.to>=s),d=l&&l.dir==ze.RTL?-1:1;i=n.x<a.left?-d:d}let o=this.source(e,s,i);if(o?.then){let a=this.pending={pos:s};o.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Yt(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Up),n=e?e.manager.tooltips.findIndex(r=>r.create==Gd.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:i}=this;if(s.length&&i&&!ME(i.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,a=(r=(n=s[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!AE(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Ql=4;function ME(t,e){let{left:n,right:r,top:s,bottom:i}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();s=Math.min(a.top,s),i=Math.max(a.bottom,i)}return e.clientX>=n-Ql&&e.clientX<=r+Ql&&e.clientY>=s-Ql&&e.clientY<=i+Ql}function AE(t,e,n,r,s,i){let o=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>r||o.right<r||o.top>s||Math.min(o.bottom,a)<s)return!1;let l=t.posAtCoords({x:r,y:s},!1);return l>=e&&l<=n}function TE(t,e={}){let n=je.define(),r=Dt.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(i,o))),i.docChanged)){let o=[];for(let a of s){let l=i.changes.mapPos(a.pos,-1,Ft.TrackDel);if(l!=null){let d=Object.assign(Object.create(null),a);d.pos=l,d.end!=null&&(d.end=i.changes.mapPos(d.end)),o.push(d)}}s=o}for(let o of i.effects)o.is(n)&&(s=o.value),o.is(LE)&&(s=[]);return s},provide:s=>ed.from(s)});return{active:r,extension:[r,tt.define(s=>new OE(s,t,r,n,e.hoverTime||300)),EE]}}function Dw(t,e){let n=t.plugin(Up);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const LE=je.define(),T0=de.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Xo(t,e){let n=t.plugin(Ew),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Ew=tt.fromClass(class{constructor(t){this.input=t.state.facet(Qo),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(T0);this.top=new Jl(t,!0,e.topContainer),this.bottom=new Jl(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(T0);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Jl(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Jl(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Qo);if(n!=this.input){let r=n.filter(l=>l),s=[],i=[],o=[],a=[];for(let l of r){let d=this.specs.indexOf(l),u;d<0?(u=l(t.view),a.push(u)):(u=this.panels[d],u.update&&u.update(t)),s.push(u),(u.top?i:o).push(u)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ae.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Jl{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=L0(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=L0(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function L0(t){let e=t.nextSibling;return t.remove(),e}const Qo=de.define({enables:Ew});class jr extends Xr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}jr.prototype.elementClass="";jr.prototype.toDOM=void 0;jr.prototype.mapMode=Ft.TrackBefore;jr.prototype.startSide=jr.prototype.endSide=-1;jr.prototype.point=!0;const Mc=de.define(),RE=de.define(),IE={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ee.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Do=de.define();function $E(t){return[Ow(),Do.of({...IE,...t})]}const R0=de.define({combine:t=>t.some(e=>e)});function Ow(t){return[BE]}const BE=tt.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Do).map(e=>new $0(t,e)),this.fixed=!t.state.facet(R0);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(R0)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ee.iter(this.view.state.facet(Mc),this.view.viewport.from),r=[],s=this.gutters.map(i=>new _E(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let o=!0;for(let a of i.type)if(a.type==Pt.Text&&o){Rf(n,r,a.from);for(let l of s)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of s)l.widget(this.view,a)}else if(i.type==Pt.Text){Rf(n,r,i.from);for(let o of s)o.line(this.view,i,r)}else if(i.widget)for(let o of s)o.widget(this.view,i);for(let i of s)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Do),n=t.state.facet(Do),r=t.docChanged||t.heightChanged||t.viewportChanged||!Ee.eq(t.startState.facet(Mc),t.state.facet(Mc),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let i of n){let o=e.indexOf(i);o<0?s.push(new $0(this.view,i)):(this.gutters[o].update(t),s.push(this.gutters[o]))}for(let i of this.gutters)i.dom.remove(),s.indexOf(i)<0&&i.destroy();for(let i of s)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=s}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ae.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==ze.LTR?{left:r,right:s}:{right:r,left:s}})});function I0(t){return Array.isArray(t)?t:[t]}function Rf(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class _E{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Ee.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,i=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==s.elements.length){let a=new Mw(e,o,i,r);s.elements.push(a),s.dom.appendChild(a.dom)}else s.elements[this.i].update(e,o,i,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];Rf(this.cursor,s,n.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,n,s);i&&s.unshift(i);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let i of e.state.facet(RE)){let o=i(e,n.widget,n);o&&(s||(s=[])).push(o)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class $0{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,o;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let l=i.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=s.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,a,s)&&s.preventDefault()});this.markers=I0(n.markers(e)),n.initialSpacer&&(this.spacer=new Mw(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=I0(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!Ee.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Mw{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),FE(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,o=0;;){let a=o,l=i<n.length?n[i++]:null,d=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,d=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(s);let h=s.nextSibling;s.remove(),s=h}}if(!l)break;l.toDOM&&(d?s=s.nextSibling:this.dom.insertBefore(l.toDOM(e),s)),d&&o++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function FE(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const zE=de.define(),HE=de.define(),ei=de.define({combine(t){return lr(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let s in n){let i=r[s],o=n[s];r[s]=i?(a,l,d)=>i(a,l,d)||o(a,l,d):o}return r}})}});class Uu extends jr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Gu(t,e){return t.state.facet(ei).formatNumber(e,t.state)}const VE=Do.compute([ei],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(zE)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new Uu(Gu(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(HE)){let i=s(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(ei)!=e.state.facet(ei),initialSpacer(e){return new Uu(Gu(e,B0(e.state.doc.lines)))},updateSpacer(e,n){let r=Gu(n.view,B0(n.view.state.doc.lines));return r==e.number?e:new Uu(r)},domEventHandlers:t.facet(ei).domEventHandlers,side:"before"}));function WE(t={}){return[ei.of(t),Ow(),VE]}function B0(t){let e=9;for(;e<t;)e=e*10+9;return e}const KE=new class extends jr{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},UE=Mc.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(KE.range(s)))}return Ee.of(e)});function GE(){return UE}var qu;const ti=new De;function qE(t){return de.define({combine:t?e=>e.concat(t):void 0})}const YE=new De;class Tn{constructor(e,n,r=[],s=""){this.data=e,this.name=s,Ae.prototype.hasOwnProperty("tree")||Object.defineProperty(Ae.prototype,"tree",{get(){return Tt(this)}}),this.parser=n,this.extension=[es.of(this),Ae.languageData.of((i,o,a)=>{let l=_0(i,o,a),d=l.type.prop(ti);if(!d)return[];let u=i.facet(d),h=l.type.prop(YE);if(h){let f=l.resolve(o-l.from,a);for(let p of h)if(p.test(f,i)){let m=i.facet(p.facet);return p.type=="replace"?m:m.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return _0(e,n,r).type.prop(ti)==this.data}findRegions(e){let n=e.facet(es);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(i,o)=>{if(i.prop(ti)==this.data){r.push({from:o,to:o+i.length});return}let a=i.prop(De.mounted);if(a){if(a.tree.prop(ti)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+i.length});return}else if(a.overlay){let l=r.length;if(s(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<i.children.length;l++){let d=i.children[l];d instanceof et&&s(d,i.positions[l]+o)}};return s(Tt(e),0),r}get allowsNesting(){return!0}}Tn.setState=je.define();function _0(t,e,n){let r=t.facet(es),s=Tt(t).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(e,n,Xe.ExcludeBuffers|Xe.EnterBracketed))i.type.isTop&&(s=i);return s}class td extends Tn{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=qE(e.languageData);return new td(n,e.parser.configure({props:[ti.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new td(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Tt(t){let e=t.field(Tn.state,!1);return e?e.tree:et.empty}class XE{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let io=null;class nd{constructor(e,n,r=[],s,i,o,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new nd(e,n,[],et.empty,0,r,[],null)}startParse(){return this.parser.startParse(new XE(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=et.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Cs.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Cs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=io;io=this;try{return e()}finally{io=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=F0(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((d,u,h,f)=>l.push({fromA:d,toA:u,fromB:h,toB:f})),r=Cs.applyChanges(r,l),s=et.empty,i=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let d of this.skipped){let u=e.mapPos(d.from,1),h=e.mapPos(d.to,-1);u<h&&a.push({from:u,to:h})}}}return new nd(this.parser,n,r,s,i,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:i}=this.skipped[r];s<e.to&&i>e.from&&(this.fragments=F0(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends o1{createParse(n,r,s){let i=s[0].from,o=s[s.length-1].to;return{parsedPos:i,advance(){let l=io;if(l){for(let d of s)l.tempSkipped.push(d);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new et(Jt.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return io}}function F0(t,e,n){return Cs.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Ci{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Ci(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=nd.create(e.facet(es).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Ci(r)}}Tn.state=Dt.define({create:Ci.init,update(t,e){for(let n of e.effects)if(n.is(Tn.setState))return n.value;return e.startState.facet(es)!=e.state.facet(es)?Ci.init(e.state):t.apply(e)}});let Aw=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Aw=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Yu=typeof navigator<"u"&&(!((qu=navigator.scheduling)===null||qu===void 0)&&qu.isInputPending)?()=>navigator.scheduling.isInputPending():null,QE=tt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Tn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Tn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Aw(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,i=r.field(Tn.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Yu?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<s&&r.doc.length>s+1e3,l=i.context.work(()=>Yu&&Yu()||Date.now()>o,s+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Tn.setState.of(new Ci(i.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Yt(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),es=de.define({combine(t){return t.length?t[0]:null},enables:t=>[Tn.state,QE,ae.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class JE{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const ZE=de.define(),qd=de.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function rd(t){let e=t.facet(qd);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Jo(t,e){let n="",r=t.tabSize,s=t.facet(qd)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let i=0;i<e;i++)n+=s;return n}function qp(t,e){t instanceof Ae&&(t=new Yd(t));for(let r of t.state.facet(ZE)){let s=r(t,e);if(s!==void 0)return s}let n=Tt(t.state);return n.length>=e?eO(t,n,e):null}class Yd{constructor(e,n={}){this.state=e,this.options=n,this.unit=rd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==e?{text:"",from:e}:(n<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,n);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.countColumn(r,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return Bi(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let o=i(s);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Tw=new De;function eO(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let i=[];for(let o=s;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)i.push(o);for(let o=i.length-1;o>=0;o--)r={node:i[o],next:r}}return Lw(r,t,n)}function Lw(t,e,n){for(let r=t;r;r=r.next){let s=nO(r.node);if(s)return s(Yp.create(e,n,r))}return 0}function tO(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function nO(t){let e=t.type.prop(Tw);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(De.closedBy))){let s=t.lastChild,i=s&&r.indexOf(s.name)>-1;return o=>oO(o,!0,1,void 0,i&&!tO(o)?s.from:void 0)}return t.parent==null?rO:null}function rO(){return 0}class Yp extends Yd{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Yp(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(sO(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Lw(this.context.next,this.base,this.pos)}}function sO(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function iO(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),o=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let d=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+d}}a=l.to}}function oO(t,e,n,r,s){let i=t.textAfter,o=i.match(/^\s*/)[0].length,a=r&&i.slice(o,o+r.length)==r||s==t.pos+o,l=iO(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function z0({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const aO=200;function lO(){return Ae.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+aO)return t;let i=n.sliceString(s.from,r);if(!e.some(d=>d.test(i)))return t;let{state:o}=t,a=-1,l=[];for(let{head:d}of o.selection.ranges){let u=o.doc.lineAt(d);if(u.from==a)continue;a=u.from;let h=qp(o,u.from);if(h==null)continue;let f=/^\s*/.exec(u.text)[0],p=Jo(o,h);f!=p&&l.push({from:u.from,to:u.from+f.length,insert:p})}return l.length?[t,{changes:l,sequential:!0}]:t})}const cO=de.define(),Rw=new De;function dO(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function uO(t,e,n){let r=Tt(t);if(r.length<n)return null;let s=r.resolveStack(n,1),i=null;for(let o=s;o;o=o.next){let a=o.node;if(a.to<=n||a.from>n)continue;if(i&&a.from<e)break;let l=a.type.prop(Rw);if(l&&(a.to<r.length-50||r.length==t.doc.length||!hO(a))){let d=l(a,t);d&&d.from<=n&&d.from>=e&&d.to>n&&(i=d)}}return i}function hO(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function sd(t,e,n){for(let r of t.facet(cO)){let s=r(t,e,n);if(s)return s}return uO(t,e,n)}function Iw(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Xd=je.define({map:Iw}),cl=je.define({map:Iw});function $w(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const Os=Dt.define({create(){return ye.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=H0(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Xd)&&!fO(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Fw),s=r?ye.replace({widget:new vO(r(e.state,n.value))}):V0;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(cl)&&(t=t.update({filter:(r,s)=>n.value.from!=r||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=H0(t,e.selection.main.head)),t},provide:t=>ae.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,s)=>{n.push(r,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],s=t[n++];if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(V0.range(r,s))}return ye.set(e,!0)}});function H0(t,e,n=e){let r=!1;return t.between(e,n,(s,i)=>{s<n&&i>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(s,i)=>s>=n||i<=e}):t}function id(t,e,n){var r;let s=null;return(r=t.field(Os,!1))===null||r===void 0||r.between(e,n,(i,o)=>{(!s||s.from>i)&&(s={from:i,to:o})}),s}function fO(t,e,n){let r=!1;return t.between(e,e,(s,i)=>{s==e&&i==n&&(r=!0)}),r}function Bw(t,e){return t.field(Os,!1)?e:e.concat(je.appendConfig.of(zw()))}const pO=t=>{for(let e of $w(t)){let n=sd(t.state,e.from,e.to);if(n)return t.dispatch({effects:Bw(t.state,[Xd.of(n),_w(t,n)])}),!0}return!1},mO=t=>{if(!t.state.field(Os,!1))return!1;let e=[];for(let n of $w(t)){let r=id(t.state,n.from,n.to);r&&e.push(cl.of(r),_w(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function _w(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return ae.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const gO=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let s=t.lineBlockAt(r),i=sd(e,s.from,s.to);i&&n.push(Xd.of(i)),r=(i?t.lineBlockAt(i.to):s).to+1}return n.length&&t.dispatch({effects:Bw(t.state,n)}),!!n.length},xO=t=>{let e=t.state.field(Os,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,s)=>{n.push(cl.of({from:r,to:s}))}),t.dispatch({effects:n}),!0},bO=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:pO},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:mO},{key:"Ctrl-Alt-[",run:gO},{key:"Ctrl-Alt-]",run:xO}],yO={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Fw=de.define({combine(t){return lr(t,yO)}});function zw(t){return[Os,SO]}function Hw(t,e){let{state:n}=t,r=n.facet(Fw),s=o=>{let a=t.lineBlockAt(t.posAtDOM(o.target)),l=id(t.state,a.from,a.to);l&&t.dispatch({effects:cl.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const V0=ye.replace({widget:new class extends cr{toDOM(t){return Hw(t,null)}}});class vO extends cr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Hw(e,this.value)}}const wO={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Xu extends jr{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function kO(t={}){let e={...wO,...t},n=new Xu(e,!0),r=new Xu(e,!1),s=tt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(es)!=o.state.facet(es)||o.startState.field(Os,!1)!=o.state.field(Os,!1)||Tt(o.startState)!=Tt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new Sr;for(let l of o.viewportLineBlocks){let d=id(o.state,l.from,l.to)?r:sd(o.state,l.from,l.to)?n:null;d&&a.add(l.from,l.from,d)}return a.finish()}}),{domEventHandlers:i}=e;return[s,$E({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(s))===null||a===void 0?void 0:a.markers)||Ee.empty},initialSpacer(){return new Xu(e,!1)},domEventHandlers:{...i,click:(o,a,l)=>{if(i.click&&i.click(o,a,l))return!0;let d=id(o.state,a.from,a.to);if(d)return o.dispatch({effects:cl.of(d)}),!0;let u=sd(o.state,a.from,a.to);return u?(o.dispatch({effects:Xd.of(u)}),!0):!1}}}),zw()]}const SO=ae.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class _i{constructor(e,n){this.specs=e;let r;function s(a){let l=Qr.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const i=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,o=n.scope;this.scope=o instanceof Tn?a=>a.prop(ti)==o.data:o?a=>a==o:void 0,this.style=c1(e.map(a=>({tag:a.tag,class:a.class||s(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=r?new Qr(r):null,this.themeType=n.themeType}static define(e,n){return new _i(e,n||{})}}const If=de.define(),Vw=de.define({combine(t){return t.length?[t[0]]:null}});function Qu(t){let e=t.facet(If);return e.length?e:t.facet(Vw)}function Xp(t,e){let n=[jO],r;return t instanceof _i&&(t.module&&n.push(ae.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(Vw.of(t)):r?n.push(If.computeN([ae.darkTheme],s=>s.facet(ae.darkTheme)==(r=="dark")?[t]:[])):n.push(If.of(t)),n}class CO{constructor(e){this.markCache=Object.create(null),this.tree=Tt(e.state),this.decorations=this.buildDeco(e,Qu(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Tt(e.state),r=Qu(e.state),s=r!=Qu(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<i.to&&!s&&n.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return ye.none;let r=new Sr;for(let{from:s,to:i}of e.visibleRanges)LN(this.tree,n,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=ye.mark({class:l})))},s,i);return r.finish()}}const jO=Bs.high(tt.fromClass(CO,{decorations:t=>t.decorations})),NO=_i.define([{tag:U.meta,color:"#404740"},{tag:U.link,textDecoration:"underline"},{tag:U.heading,textDecoration:"underline",fontWeight:"bold"},{tag:U.emphasis,fontStyle:"italic"},{tag:U.strong,fontWeight:"bold"},{tag:U.strikethrough,textDecoration:"line-through"},{tag:U.keyword,color:"#708"},{tag:[U.atom,U.bool,U.url,U.contentSeparator,U.labelName],color:"#219"},{tag:[U.literal,U.inserted],color:"#164"},{tag:[U.string,U.deleted],color:"#a11"},{tag:[U.regexp,U.escape,U.special(U.string)],color:"#e40"},{tag:U.definition(U.variableName),color:"#00f"},{tag:U.local(U.variableName),color:"#30a"},{tag:[U.typeName,U.namespace],color:"#085"},{tag:U.className,color:"#167"},{tag:[U.special(U.variableName),U.macroName],color:"#256"},{tag:U.definition(U.propertyName),color:"#00c"},{tag:U.comment,color:"#940"},{tag:U.invalid,color:"#f00"}]),PO=ae.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ww=1e4,Kw="()[]{}",Uw=de.define({combine(t){return lr(t,{afterCursor:!0,brackets:Kw,maxScanDistance:Ww,renderMatch:OO})}}),DO=ye.mark({class:"cm-matchingBracket"}),EO=ye.mark({class:"cm-nonmatchingBracket"});function OO(t){let e=[],n=t.matched?DO:EO;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const MO=Dt.define({create(){return ye.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(Uw);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=er(e.state,s.head,-1,r)||s.head>0&&er(e.state,s.head-1,1,r)||r.afterCursor&&(er(e.state,s.head,1,r)||s.head<e.state.doc.length&&er(e.state,s.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,e.state)))}return ye.set(n,!0)},provide:t=>ae.decorations.from(t)}),AO=[MO,PO];function TO(t={}){return[Uw.of(t),AO]}const LO=new De;function $f(t,e,n){let r=t.prop(e<0?De.openedBy:De.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function Bf(t){let e=t.type.prop(LO);return e?e(t.node):t}function er(t,e,n,r={}){let s=r.maxScanDistance||Ww,i=r.brackets||Kw,o=Tt(t),a=o.resolveInner(e,n);for(let l=a;l;l=l.parent){let d=$f(l.type,n,i);if(d&&l.from<l.to){let u=Bf(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return RO(t,e,n,l,u,d,i)}}return IO(t,e,n,o,a.type,s,i)}function RO(t,e,n,r,s,i,o){let a=r.parent,l={from:s.from,to:s.to},d=0,u=a?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(d==0&&i.indexOf(u.type.name)>-1&&u.from<u.to){let h=Bf(u);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if($f(u.type,n,o))d++;else if($f(u.type,-n,o)){if(d==0){let h=Bf(u);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}d--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function IO(t,e,n,r,s,i,o){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),h=0;for(let f=0;!u.next().done&&f<=i;){let p=u.value;n<0&&(f+=p.length);let m=e+f*n;for(let x=n>0?0:p.length-1,b=n>0?p.length:-1;x!=b;x+=n){let y=o.indexOf(p[x]);if(!(y<0||r.resolveInner(m+x,1).type!=s))if(y%2==0==n>0)h++;else{if(h==1)return{start:d,end:{from:m+x,to:m+x+1},matched:y>>1==l>>1};h--}}n>0&&(f+=p.length)}return u.done?{start:d,matched:!1}:null}const $O=Object.create(null),W0=[Jt.none],K0=[],U0=Object.create(null),BO=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])BO[t]=_O($O,e);function Ju(t,e){K0.indexOf(t)>-1||(K0.push(t),console.warn(e))}function _O(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let d of a.split(".")){let u=t[d]||U[d];u?typeof u=="function"?l.length?l=l.map(u):Ju(d,`Modifier ${d} used at start of tag`):l.length?Ju(d,`Tag ${d} used as modifier`):l=Array.isArray(u)?u:[u]:Ju(d,`Unknown highlighting tag ${d}`)}for(let d of l)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(a=>a.id),i=U0[s];if(i)return i.id;let o=U0[s]=Jt.define({id:W0.length,name:r,props:[a1({[r]:n})]});return W0.push(o),o.id}ze.RTL,ze.LTR;const FO=td.define({name:"json",parser:BN.configure({props:[Tw.add({Object:z0({except:/^\s*\}/}),Array:z0({except:/^\s*\]/})}),Rw.add({"Object Array":dO})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function zO(){return new JE(FO)}function _f(){return _f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_f.apply(null,arguments)}function HO(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}const VO=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Jp(t.state,n.from);return r.line?WO(t):r.block?UO(t):!1};function Qp(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const WO=Qp(YO,0),KO=Qp(Gw,0),UO=Qp((t,e)=>Gw(t,e,qO(e)),0);function Jp(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const oo=50;function GO(t,{open:e,close:n},r,s){let i=t.sliceDoc(r-oo,r),o=t.sliceDoc(s,s+oo),a=/\s*$/.exec(i)[0].length,l=/^\s*/.exec(o)[0].length,d=i.length-a;if(i.slice(d-e.length,d)==e&&o.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:s+l,margin:l&&1}};let u,h;s-r<=2*oo?u=h=t.sliceDoc(r,s):(u=t.sliceDoc(r,r+oo),h=t.sliceDoc(s-oo,s));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(h)[0].length,m=h.length-p-n.length;return u.slice(f,f+e.length)==e&&h.slice(m,m+n.length)==n?{open:{pos:r+f+e.length,margin:/\s/.test(u.charAt(f+e.length))?1:0},close:{pos:s-p-n.length,margin:/\s/.test(h.charAt(m-1))?1:0}}:null}function qO(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function Gw(t,e,n=e.selection.ranges){let r=n.map(i=>Jp(e,i.from).block);if(!r.every(i=>i))return null;let s=n.map((i,o)=>GO(e,r[o],i.from,i.to));if(t!=2&&!s.every(i=>i))return{changes:e.changes(n.map((i,o)=>s[o]?[]:[{from:i.from,insert:r[o].open+" "},{from:i.to,insert:" "+r[o].close}]))};if(t!=1&&s.some(i=>i)){let i=[];for(let o=0,a;o<s.length;o++)if(a=s[o]){let l=r[o],{open:d,close:u}=a;i.push({from:d.pos-l.open.length,to:d.pos+d.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:i}}return null}function YO(t,e,n=e.selection.ranges){let r=[],s=-1;for(let{from:i,to:o}of n){let a=r.length,l=1e9,d=Jp(e,i).line;if(d){for(let u=i;u<=o;){let h=e.doc.lineAt(u);if(h.from>s&&(i==o||o>h.from)){s=h.from;let f=/^\s*/.exec(h.text)[0].length,p=f==h.length,m=h.text.slice(f,f+d.length)==d?f:-1;f<h.text.length&&f<l&&(l=f),r.push({line:h,comment:m,token:d,indent:f,empty:p,single:!1})}u=h.to+1}if(l<1e9)for(let u=a;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==a+1&&(r[a].single=!0)}}if(t!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:a,token:l,indent:d,empty:u,single:h}of r)(h||!u)&&i.push({from:a.from+d,insert:l+" "});let o=e.changes(i);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let d=o.from+a,u=d+l.length;o.text[u-o.from]==" "&&u++,i.push({from:d,to:u})}return{changes:i}}return null}const Ff=ar.define(),XO=ar.define(),QO=de.define(),qw=de.define({combine(t){return lr(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),Yw=Dt.define({create(){return tr.empty},update(t,e){let n=e.state.facet(qw),r=e.annotation(Ff);if(r){let l=Xt.fromTransaction(e,r.selection),d=r.side,u=d==0?t.undone:t.done;return l?u=od(u,u.length,n.minDepth,l):u=Jw(u,e.startState.selection),new tr(d==0?r.rest:u,d==0?u:r.rest)}let s=e.annotation(XO);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(ht.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=Xt.fromTransaction(e),o=e.annotation(ht.time),a=e.annotation(ht.userEvent);return i?t=t.addChanges(i,o,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new tr(t.done.map(Xt.fromJSON),t.undone.map(Xt.fromJSON))}});function JO(t={}){return[Yw,qw.of(t),ae.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?Xw:e.inputType=="historyRedo"?zf:null;return r?(e.preventDefault(),r(n)):!1}})]}function Qd(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(Yw,!1);if(!s)return!1;let i=s.pop(t,n,e);return i?(r(i),!0):!1}}const Xw=Qd(0,!1),zf=Qd(1,!1),ZO=Qd(0,!0),eM=Qd(1,!0);class Xt{constructor(e,n,r,s,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new Xt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Xt(e.changes&&ct.fromJSON(e.changes),[],e.mapped&&rr.fromJSON(e.mapped),e.startSelection&&q.fromJSON(e.startSelection),e.selectionsAfter.map(q.fromJSON))}static fromTransaction(e,n){let r=vn;for(let s of e.startState.facet(QO)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new Xt(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,vn)}static selection(e){return new Xt(void 0,vn,void 0,void 0,e)}}function od(t,e,n,r){let s=e+1>n+20?e-n-1:0,i=t.slice(s,e);return i.push(r),i}function tM(t,e){let n=[],r=!1;return t.iterChangedRanges((s,i)=>n.push(s,i)),e.iterChangedRanges((s,i,o,a)=>{for(let l=0;l<n.length;){let d=n[l++],u=n[l++];a>=d&&o<=u&&(r=!0)}}),r}function nM(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function Qw(t,e){return t.length?e.length?t.concat(e):t:e}const vn=[],rM=200;function Jw(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-rM));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),od(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Xt.selection([e])]}function sM(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Zu(t,e){if(!t.length)return t;let n=t.length,r=vn;for(;n;){let s=iM(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=t.slice(0,n);return i[n-1]=s,i}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[Xt.selection(r)]:vn}function iM(t,e,n){let r=Qw(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):vn,n);if(!t.changes)return Xt.selection(r);let s=t.changes.map(e),i=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(i):i;return new Xt(s,je.mapEffects(t.effects,e),o,t.startSelection.map(i),r)}const oM=/^(input\.type|delete)($|\.)/;class tr{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new tr(this.done,this.undone):this}addChanges(e,n,r,s,i){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||oM.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(i,tM(a.changes,e.changes))||r=="input.type.compose")?o=od(o,o.length-1,s.minDepth,new Xt(e.changes.compose(a.changes),Qw(je.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,vn)):o=od(o,o.length,s.minDepth,e),new tr(o,vn,n,r)}addSelection(e,n,r,s){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:vn;return i.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&nM(i[i.length-1],e)?this:new tr(Jw(this.done,e),this.undone,n,r)}addMapping(e){return new tr(Zu(this.done,e),Zu(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let i=s[s.length-1],o=i.selectionsAfter[0]||n.selection;if(r&&i.selectionsAfter.length)return n.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Ff.of({side:e,rest:sM(s),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=s.length==1?vn:s.slice(0,s.length-1);return i.mapped&&(a=Zu(a,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Ff.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}tr.empty=new tr(vn,vn);const aM=[{key:"Mod-z",run:Xw,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:zf,preventDefault:!0},{linux:"Ctrl-Shift-z",run:zf,preventDefault:!0},{key:"Mod-u",run:ZO,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:eM,preventDefault:!0}];function Fi(t,e){return q.create(t.ranges.map(e),t.mainIndex)}function Fn(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function zn({state:t,dispatch:e},n){let r=Fi(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Fn(t,r)),!0)}function Jd(t,e){return q.cursor(e?t.to:t.from)}function Zw(t,e){return zn(t,n=>n.empty?t.moveByChar(n,e):Jd(n,e))}function Rt(t){return t.textDirectionAt(t.state.selection.main.head)==ze.LTR}const e2=t=>Zw(t,!Rt(t)),t2=t=>Zw(t,Rt(t));function n2(t,e){return zn(t,n=>n.empty?t.moveByGroup(n,e):Jd(n,e))}const lM=t=>n2(t,!Rt(t)),cM=t=>n2(t,Rt(t));function dM(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Zd(t,e,n){let r=Tt(t).resolveInner(e.head),s=n?De.closedBy:De.openedBy;for(let l=e.head;;){let d=n?r.childAfter(l):r.childBefore(l);if(!d)break;dM(t,d,s)?r=d:l=n?d.to:d.from}let i=r.type.prop(s),o,a;return i&&(o=n?er(t,r.from,1):er(t,r.to,-1))&&o.matched?a=n?o.end.to:o.end.from:a=n?r.to:r.from,q.cursor(a,n?-1:1)}const uM=t=>zn(t,e=>Zd(t.state,e,!Rt(t))),hM=t=>zn(t,e=>Zd(t.state,e,Rt(t)));function r2(t,e){return zn(t,n=>{if(!n.empty)return Jd(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const s2=t=>r2(t,!1),i2=t=>r2(t,!0);function o2(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,s;if(e){for(let i of t.state.facet(ae.scrollMargins)){let o=i(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(r=Math.max(o?.bottom,r))}s=t.scrollDOM.clientHeight-n-r}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function a2(t,e){let n=o2(t),{state:r}=t,s=Fi(r.selection,o=>o.empty?t.moveVertically(o,e,n.height):Jd(o,e));if(s.eq(r.selection))return!1;let i;if(n.selfScroll){let o=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,d=a.bottom-n.marginBottom;o&&o.top>l&&o.bottom<d&&(i=ae.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-l}))}return t.dispatch(Fn(r,s),{effects:i}),!0}const G0=t=>a2(t,!1),Hf=t=>a2(t,!0);function rs(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=q.cursor(r.from+i))}return s}const fM=t=>zn(t,e=>rs(t,e,!0)),pM=t=>zn(t,e=>rs(t,e,!1)),mM=t=>zn(t,e=>rs(t,e,!Rt(t))),gM=t=>zn(t,e=>rs(t,e,Rt(t))),xM=t=>zn(t,e=>q.cursor(t.lineBlockAt(e.head).from,1)),bM=t=>zn(t,e=>q.cursor(t.lineBlockAt(e.head).to,-1));function yM(t,e,n){let r=!1,s=Fi(t.selection,i=>{let o=er(t,i.head,-1)||er(t,i.head,1)||i.head>0&&er(t,i.head-1,1)||i.head<t.doc.length&&er(t,i.head+1,-1);if(!o||!o.end)return i;r=!0;let a=o.start.from==i.head?o.end.to:o.end.from;return q.cursor(a)});return r?(e(Fn(t,s)),!0):!1}const vM=({state:t,dispatch:e})=>yM(t,e);function Pn(t,e){let n=Fi(t.state.selection,r=>{let s=e(r);return q.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Fn(t.state,n)),!0)}function l2(t,e){return Pn(t,n=>t.moveByChar(n,e))}const c2=t=>l2(t,!Rt(t)),d2=t=>l2(t,Rt(t));function u2(t,e){return Pn(t,n=>t.moveByGroup(n,e))}const wM=t=>u2(t,!Rt(t)),kM=t=>u2(t,Rt(t)),SM=t=>Pn(t,e=>Zd(t.state,e,!Rt(t))),CM=t=>Pn(t,e=>Zd(t.state,e,Rt(t)));function h2(t,e){return Pn(t,n=>t.moveVertically(n,e))}const f2=t=>h2(t,!1),p2=t=>h2(t,!0);function m2(t,e){return Pn(t,n=>t.moveVertically(n,e,o2(t).height))}const q0=t=>m2(t,!1),Y0=t=>m2(t,!0),jM=t=>Pn(t,e=>rs(t,e,!0)),NM=t=>Pn(t,e=>rs(t,e,!1)),PM=t=>Pn(t,e=>rs(t,e,!Rt(t))),DM=t=>Pn(t,e=>rs(t,e,Rt(t))),EM=t=>Pn(t,e=>q.cursor(t.lineBlockAt(e.head).from)),OM=t=>Pn(t,e=>q.cursor(t.lineBlockAt(e.head).to)),X0=({state:t,dispatch:e})=>(e(Fn(t,{anchor:0})),!0),Q0=({state:t,dispatch:e})=>(e(Fn(t,{anchor:t.doc.length})),!0),J0=({state:t,dispatch:e})=>(e(Fn(t,{anchor:t.selection.main.anchor,head:0})),!0),Z0=({state:t,dispatch:e})=>(e(Fn(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),MM=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),AM=({state:t,dispatch:e})=>{let n=eu(t).map(({from:r,to:s})=>q.range(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:q.create(n),userEvent:"select"})),!0},TM=({state:t,dispatch:e})=>{let n=Fi(t.selection,r=>{let s=Tt(t),i=s.resolveStack(r.from,1);if(r.empty){let o=s.resolveStack(r.from,-1);o.node.from>=i.node.from&&o.node.to<=i.node.to&&(i=o)}for(let o=i;o;o=o.next){let{node:a}=o;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return q.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(Fn(t,n)),!0)};function g2(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let i of n.selection.ranges){let o=n.doc.lineAt(i.head);if(e?o.to<t.state.doc.length:o.from>0)for(let a=i;;){let l=t.moveVertically(a,e);if(l.head<o.from||l.head>o.to){s.some(d=>d.head==l.head)||s.push(l);break}else{if(l.head==a.head)break;a=l}}}return s.length==r.ranges.length?!1:(t.dispatch(Fn(n,q.create(s,s.length-1))),!0)}const LM=t=>g2(t,!1),RM=t=>g2(t,!0),IM=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=q.create([n.main]):n.main.empty||(r=q.create([q.cursor(n.main.head)])),r?(e(Fn(t,r)),!0):!1};function dl(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(i=>{let{from:o,to:a}=i;if(o==a){let l=e(i);l<o?(n="delete.backward",l=Zl(t,l,!1)):l>o&&(n="delete.forward",l=Zl(t,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Zl(t,o,!1),a=Zl(t,a,!0);return o==a?{range:i}:{changes:{from:o,to:a},range:q.cursor(o,o<i.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ae.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Zl(t,e,n){if(t instanceof ae)for(let r of t.state.facet(ae.atomicRanges).map(s=>s(t)))r.between(e,e,(s,i)=>{s<e&&i>e&&(e=n?i:s)});return e}const x2=(t,e,n)=>dl(t,r=>{let s=r.from,{state:i}=t,o=i.doc.lineAt(s),a,l;if(n&&!e&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,s-o.from))){if(a[a.length-1]==" ")return s-1;let d=Bi(a,i.tabSize),u=d%rd(i)||rd(i);for(let h=0;h<u&&a[a.length-1-h]==" ";h++)s--;l=s}else l=ut(o.text,s-o.from,e,e)+o.from,l==s&&o.number!=(e?i.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,s-o.from))&&(l=ut(o.text,l-o.from,!1,!1)+o.from);return l}),Vf=t=>x2(t,!1,!0),b2=t=>x2(t,!0,!1),y2=(t,e)=>dl(t,n=>{let r=n.head,{state:s}=t,i=s.doc.lineAt(r),o=s.charCategorizer(r);for(let a=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let l=ut(i.text,r-i.from,e)+i.from,d=i.text.slice(Math.min(r,l)-i.from,Math.max(r,l)-i.from),u=o(d);if(a!=null&&u!=a)break;(d!=" "||r!=n.head)&&(a=u),r=l}return r}),v2=t=>y2(t,!1),$M=t=>y2(t,!0),BM=t=>dl(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),_M=t=>dl(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),FM=t=>dl(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),zM=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ie.of(["",""])},range:q.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},HM=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let s=r.from,i=t.doc.lineAt(s),o=s==i.from?s-1:ut(i.text,s-i.from,!1)+i.from,a=s==i.to?s+1:ut(i.text,s-i.from,!0)+i.from;return{changes:{from:o,to:a,insert:t.doc.slice(s,a).append(t.doc.slice(o,s))},range:q.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function eu(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=s.number){let o=e[e.length-1];o.to=i.to,o.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});n=i.number+1}return e}function w2(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let i of eu(t)){if(n?i.to==t.doc.length:i.from==0)continue;let o=t.doc.lineAt(n?i.to+1:i.from-1),a=o.length+1;if(n){r.push({from:i.to,to:o.to},{from:i.from,insert:o.text+t.lineBreak});for(let l of i.ranges)s.push(q.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:o.from,to:i.from},{from:i.to,insert:t.lineBreak+o.text});for(let l of i.ranges)s.push(q.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:q.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const VM=({state:t,dispatch:e})=>w2(t,e,!1),WM=({state:t,dispatch:e})=>w2(t,e,!0);function k2(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of eu(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});let s=t.changes(r);return e(t.update({changes:s,selection:t.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const KM=({state:t,dispatch:e})=>k2(t,e,!1),UM=({state:t,dispatch:e})=>k2(t,e,!0),GM=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(eu(e).map(({from:s,to:i})=>(s>0?s--:i<e.doc.length&&i++,{from:s,to:i}))),r=Fi(e.selection,s=>{let i;if(t.lineWrapping){let o=t.lineBlockAt(s.head),a=t.coordsAtPos(s.head,s.assoc||1);a&&(i=o.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function qM(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Tt(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(De.closedBy))&&i.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const ex=S2(!1),YM=S2(!0);function S2(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:o}=s,a=e.doc.lineAt(i),l=!t&&i==o&&qM(e,i);t&&(i=o=(o<=a.to?a:e.doc.lineAt(o)).to);let d=new Yd(e,{simulateBreak:i,simulateDoubleBreak:!!l}),u=qp(d,i);for(u==null&&(u=Bi(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:i,to:o}=l:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let h=["",Jo(e,u)];return l&&h.push(Jo(e,d.lineIndent(a.from,-1))),{changes:{from:i,to:o,insert:Ie.of(h)},range:q.cursor(i+1+h[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Zp(t,e){let n=-1;return t.changeByRange(r=>{let s=[];for(let o=r.from;o<=r.to;){let a=t.doc.lineAt(o);a.number>n&&(r.empty||r.to>a.from)&&(e(a,s,r),n=a.number),o=a.to+1}let i=t.changes(s);return{changes:s,range:q.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const XM=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Yd(t,{overrideIndentation:i=>{let o=n[i];return o??-1}}),s=Zp(t,(i,o,a)=>{let l=qp(r,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let d=/^\s*/.exec(i.text)[0],u=Jo(t,l);(d!=u||a.from<i.from+d.length)&&(n[i.from]=l,o.push({from:i.from,to:i.from+d.length,insert:u}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},C2=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Zp(t,(n,r)=>{r.push({from:n.from,insert:t.facet(qd)})}),{userEvent:"input.indent"})),!0),j2=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Zp(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let i=Bi(s,t.tabSize),o=0,a=Jo(t,Math.max(0,i-rd(t)));for(;o<s.length&&o<a.length&&s.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+s.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),QM=t=>(t.setTabFocusMode(),!0),JM=[{key:"Ctrl-b",run:e2,shift:c2,preventDefault:!0},{key:"Ctrl-f",run:t2,shift:d2},{key:"Ctrl-p",run:s2,shift:f2},{key:"Ctrl-n",run:i2,shift:p2},{key:"Ctrl-a",run:xM,shift:EM},{key:"Ctrl-e",run:bM,shift:OM},{key:"Ctrl-d",run:b2},{key:"Ctrl-h",run:Vf},{key:"Ctrl-k",run:BM},{key:"Ctrl-Alt-h",run:v2},{key:"Ctrl-o",run:zM},{key:"Ctrl-t",run:HM},{key:"Ctrl-v",run:Hf}],ZM=[{key:"ArrowLeft",run:e2,shift:c2,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:lM,shift:wM,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:mM,shift:PM,preventDefault:!0},{key:"ArrowRight",run:t2,shift:d2,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cM,shift:kM,preventDefault:!0},{mac:"Cmd-ArrowRight",run:gM,shift:DM,preventDefault:!0},{key:"ArrowUp",run:s2,shift:f2,preventDefault:!0},{mac:"Cmd-ArrowUp",run:X0,shift:J0},{mac:"Ctrl-ArrowUp",run:G0,shift:q0},{key:"ArrowDown",run:i2,shift:p2,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Q0,shift:Z0},{mac:"Ctrl-ArrowDown",run:Hf,shift:Y0},{key:"PageUp",run:G0,shift:q0},{key:"PageDown",run:Hf,shift:Y0},{key:"Home",run:pM,shift:NM,preventDefault:!0},{key:"Mod-Home",run:X0,shift:J0},{key:"End",run:fM,shift:jM,preventDefault:!0},{key:"Mod-End",run:Q0,shift:Z0},{key:"Enter",run:ex,shift:ex},{key:"Mod-a",run:MM},{key:"Backspace",run:Vf,shift:Vf,preventDefault:!0},{key:"Delete",run:b2,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:v2,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:$M,preventDefault:!0},{mac:"Mod-Backspace",run:_M,preventDefault:!0},{mac:"Mod-Delete",run:FM,preventDefault:!0}].concat(JM.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),e6=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:uM,shift:SM},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:hM,shift:CM},{key:"Alt-ArrowUp",run:VM},{key:"Shift-Alt-ArrowUp",run:KM},{key:"Alt-ArrowDown",run:WM},{key:"Shift-Alt-ArrowDown",run:UM},{key:"Mod-Alt-ArrowUp",run:LM},{key:"Mod-Alt-ArrowDown",run:RM},{key:"Escape",run:IM},{key:"Mod-Enter",run:YM},{key:"Alt-l",mac:"Ctrl-l",run:AM},{key:"Mod-i",run:TM,preventDefault:!0},{key:"Mod-[",run:j2},{key:"Mod-]",run:C2},{key:"Mod-Alt-\\",run:XM},{key:"Shift-Mod-k",run:GM},{key:"Shift-Mod-\\",run:vM},{key:"Mod-/",run:VO},{key:"Alt-A",run:KO},{key:"Ctrl-m",mac:"Shift-Alt-m",run:QM}].concat(ZM),t6={key:"Tab",run:C2,shift:j2},tx=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class ji{constructor(e,n,r=0,s=e.length,i,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,s),this.bufferStart=r,this.normalize=i?a=>i(tx(a)):tx,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ut(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=Mp(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Jn(e);let s=this.normalize(n);if(s.length)for(let i=0,o=r;;i++){let a=s.charCodeAt(i),l=this.match(a,o,this.bufferPos+this.bufferStart);if(i==s.length-1){if(l)return this.value=l,this;break}o==r&&i<n.length&&n.charCodeAt(i)==a&&o++}}}match(e,n,r){let s=null;for(let i=0;i<this.matches.length;i+=2){let o=this.matches[i],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?s={from:this.matches[i+1],to:r}:(this.matches[i]++,a=!0)),a||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:n,to:r}:this.matches.push(1,n)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(ji.prototype[Symbol.iterator]=function(){return this});const N2={from:-1,to:-1,match:/.*/.exec("")},em="gm"+(/x/.unicode==null?"":"u");class P2{constructor(e,n,r,s=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=N2,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new D2(e,n,r,s,i);this.re=new RegExp(n,em+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=ad(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=ad(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const eh=new WeakMap;class hi{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let s=eh.get(e);if(!s||s.from>=r||s.to<=n){let a=new hi(n,e.sliceString(n,r));return eh.set(e,a),a}if(s.from==n&&s.to==r)return s;let{text:i,from:o}=s;return o>n&&(i=e.sliceString(n,o)+i,o=n),s.to<r&&(i+=e.sliceString(s.to,r)),eh.set(e,new hi(o,i)),new hi(n,i.slice(n-o,r-o))}}class D2{constructor(e,n,r,s,i){this.text=e,this.to=i,this.done=!1,this.value=N2,this.matchPos=ad(e,s),this.re=new RegExp(n,em+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=hi.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=ad(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hi.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(P2.prototype[Symbol.iterator]=D2.prototype[Symbol.iterator]=function(){return this});function n6(t){try{return new RegExp(t,em),!0}catch{return!1}}function ad(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function Wf(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Be("input",{class:"cm-textfield",name:"line",value:e}),r=Be("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:Eo.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},Be("label",t.state.phrase("Go to line"),": ",n)," ",Be("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),Be("button",{name:"close",onclick:()=>{t.dispatch({effects:Eo.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:o}=t,a=o.doc.lineAt(o.selection.main.head),[,l,d,u,h]=i,f=u?+u.slice(1):0,p=d?+d:a.number;if(d&&h){let b=p/100;l&&(b=b*(l=="-"?-1:1)+a.number/o.doc.lines),p=Math.round(o.doc.lines*b)}else d&&l&&(p=p*(l=="-"?-1:1)+a.number);let m=o.doc.line(Math.max(1,Math.min(o.doc.lines,p))),x=q.cursor(m.from+Math.max(0,Math.min(f,m.length)));t.dispatch({effects:[Eo.of(!1),ae.scrollIntoView(x.from,{y:"center"})],selection:x}),t.focus()}return{dom:r}}const Eo=je.define(),nx=Dt.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(Eo)&&(t=n.value);return t},provide:t=>Qo.from(t,e=>e?Wf:null)}),r6=t=>{let e=Xo(t,Wf);if(!e){let n=[Eo.of(!0)];t.state.field(nx,!1)==null&&n.push(je.appendConfig.of([nx,s6])),t.dispatch({effects:n}),e=Xo(t,Wf)}return e&&e.dom.querySelector("input").select(),!0},s6=ae.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),i6={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},o6=de.define({combine(t){return lr(t,i6,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function a6(t){return[h6,u6]}const l6=ye.mark({class:"cm-selectionMatch"}),c6=ye.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function rx(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=We.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=We.Word)}function d6(t,e,n,r){return t(e.sliceDoc(n,n+1))==We.Word&&t(e.sliceDoc(r-1,r))==We.Word}const u6=tt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(o6),{state:n}=t,r=n.selection;if(r.ranges.length>1)return ye.none;let s=r.main,i,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return ye.none;let l=n.wordAt(s.head);if(!l)return ye.none;o=n.charCategorizer(s.head),i=n.sliceDoc(l.from,l.to)}else{let l=s.to-s.from;if(l<e.minSelectionLength||l>200)return ye.none;if(e.wholeWords){if(i=n.sliceDoc(s.from,s.to),o=n.charCategorizer(s.head),!(rx(o,n,s.from,s.to)&&d6(o,n,s.from,s.to)))return ye.none}else if(i=n.sliceDoc(s.from,s.to),!i)return ye.none}let a=[];for(let l of t.visibleRanges){let d=new ji(n.doc,i,l.from,l.to);for(;!d.next().done;){let{from:u,to:h}=d.value;if((!o||rx(o,n,u,h))&&(s.empty&&u<=s.from&&h>=s.to?a.push(c6.range(u,h)):(u>=s.to||h<=s.from)&&a.push(l6.range(u,h)),a.length>e.maxMatches))return ye.none}}return ye.set(a)}},{decorations:t=>t.decorations}),h6=ae.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),f6=({state:t,dispatch:e})=>{let{selection:n}=t,r=q.create(n.ranges.map(s=>t.wordAt(s.head)||q.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function p6(t,e){let{main:n,ranges:r}=t.selection,s=t.wordAt(n.head),i=s&&s.from==n.from&&s.to==n.to;for(let o=!1,a=new ji(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new ji(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(i){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const m6=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return f6({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let s=p6(t,r);return s?(e(t.update({selection:t.selection.addRange(q.range(s.from,s.to),!1),effects:ae.scrollIntoView(s.to)})),!0):!1},zi=de.define({combine(t){return lr(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new P6(e),scrollToMatch:e=>ae.scrollIntoView(e)})}});class E2{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||n6(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
277
293
|
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new y6(this):new x6(this)}getCursor(e,n=0,r){let s=e.doc?e:Ae.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?Qs(this,s,n,r):Xs(this,s,n,r)}}class O2{constructor(e){this.spec=e}}function Xs(t,e,n,r){return new ji(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?g6(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function g6(t,e){return(n,r,s,i)=>((i>n||i+s.length<r)&&(i=Math.max(0,n-2),s=t.sliceString(i,Math.min(t.length,r+2))),(e(ld(s,n-i))!=We.Word||e(cd(s,n-i))!=We.Word)&&(e(cd(s,r-i))!=We.Word||e(ld(s,r-i))!=We.Word))}class x6 extends O2{constructor(e){super(e)}nextMatch(e,n,r){let s=Xs(this.spec,e,r,e.doc.length).nextOverlapping();if(s.done){let i=Math.min(e.doc.length,n+this.spec.unquoted.length);s=Xs(this.spec,e,0,i).nextOverlapping()}return s.done||s.value.from==n&&s.value.to==r?null:s.value}prevMatchInRange(e,n,r){for(let s=r;;){let i=Math.max(n,s-1e4-this.spec.unquoted.length),o=Xs(this.spec,e,i,s),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(i==n)return null;s-=1e4}}prevMatch(e,n,r){let s=this.prevMatchInRange(e,0,n);return s||(s=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=n||s.to!=r)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Xs(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=Xs(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function Qs(t,e,n,r){return new P2(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?b6(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function ld(t,e){return t.slice(ut(t,e,!1),e)}function cd(t,e){return t.slice(e,ut(t,e))}function b6(t){return(e,n,r)=>!r[0].length||(t(ld(r.input,r.index))!=We.Word||t(cd(r.input,r.index))!=We.Word)&&(t(cd(r.input,r.index+r[0].length))!=We.Word||t(ld(r.input,r.index+r[0].length))!=We.Word)}class y6 extends O2{nextMatch(e,n,r){let s=Qs(this.spec,e,r,e.doc.length).next();return s.done&&(s=Qs(this.spec,e,0,n).next()),s.done?null:s.value}prevMatchInRange(e,n,r){for(let s=1;;s++){let i=Math.max(n,r-s*1e4),o=Qs(this.spec,e,i,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(i==n||a.from>i+10))return a;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let i=+r.slice(0,s);if(i>0&&i<e.match.length)return e.match[i]+r.slice(s)}return n})}matchAll(e,n){let r=Qs(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=Qs(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const Zo=je.define(),tm=je.define(),Gr=Dt.define({create(t){return new th(Kf(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Zo)?t=new th(n.value.create(),t.panel):n.is(tm)&&(t=new th(t.query,n.value?nm:null));return t},provide:t=>Qo.from(t,e=>e.panel)});class th{constructor(e,n){this.query=e,this.panel=n}}const v6=ye.mark({class:"cm-searchMatch"}),w6=ye.mark({class:"cm-searchMatch cm-searchMatch-selected"}),k6=tt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Gr))}update(t){let e=t.state.field(Gr);(e!=t.startState.field(Gr)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ye.none;let{view:n}=this,r=new Sr;for(let s=0,i=n.visibleRanges,o=i.length;s<o;s++){let{from:a,to:l}=i[s];for(;s<o-1&&l>i[s+1].from-2*250;)l=i[++s].to;t.highlight(n.state,a,l,(d,u)=>{let h=n.state.selection.ranges.some(f=>f.from==d&&f.to==u);r.add(d,u,h?w6:v6)})}return r.finish()}},{decorations:t=>t.decorations});function ul(t){return e=>{let n=e.state.field(Gr,!1);return n&&n.query.spec.valid?t(e,n):T2(e)}}const dd=ul((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let s=q.single(r.from,r.to),i=t.state.facet(zi);return t.dispatch({selection:s,effects:[rm(t,r),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),A2(t),!0}),ud=ul((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,s=e.prevMatch(n,r,r);if(!s)return!1;let i=q.single(s.from,s.to),o=t.state.facet(zi);return t.dispatch({selection:i,effects:[rm(t,s),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),A2(t),!0}),S6=ul((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:q.create(n.map(r=>q.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),C6=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,i=[],o=0;for(let a=new ji(t.doc,t.sliceDoc(r,s));!a.next().done;){if(i.length>1e3)return!1;a.value.from==r&&(o=i.length),i.push(q.range(a.value.from,a.value.to))}return e(t.update({selection:q.create(i,o),userEvent:"select.search.matches"})),!0},sx=ul((t,{query:e})=>{let{state:n}=t,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let o=i,a=[],l,d,u=[];o.from==r&&o.to==s&&(d=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:d}),o=e.nextMatch(n,o.from,o.to),u.push(ae.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let h=t.state.changes(a);return o&&(l=q.single(o.from,o.to).map(h),u.push(rm(t,o)),u.push(n.facet(zi).scrollToMatch(l.main,t))),t.dispatch({changes:h,selection:l,effects:u,userEvent:"input.replace"}),!0}),j6=ul((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:o}=s;return{from:i,to:o,insert:e.getReplacement(s)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:ae.announce.of(r),userEvent:"input.replace.all"}),!0});function nm(t){return t.state.facet(zi).createPanel(t)}function Kf(t,e){var n,r,s,i,o;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let d=t.facet(zi);return new E2({search:((n=e?.literal)!==null&&n!==void 0?n:d.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:d.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:d.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:d.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:d.wholeWord})}function M2(t){let e=Xo(t,nm);return e&&e.dom.querySelector("[main-field]")}function A2(t){let e=M2(t);e&&e==t.root.activeElement&&e.select()}const T2=t=>{let e=t.state.field(Gr,!1);if(e&&e.panel){let n=M2(t);if(n&&n!=t.root.activeElement){let r=Kf(t.state,e.query.spec);r.valid&&t.dispatch({effects:Zo.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[tm.of(!0),e?Zo.of(Kf(t.state,e.query.spec)):je.appendConfig.of(E6)]});return!0},L2=t=>{let e=t.state.field(Gr,!1);if(!e||!e.panel)return!1;let n=Xo(t,nm);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:tm.of(!1)}),!0},N6=[{key:"Mod-f",run:T2,scope:"editor search-panel"},{key:"F3",run:dd,shift:ud,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:dd,shift:ud,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:L2,scope:"editor search-panel"},{key:"Mod-Shift-l",run:C6},{key:"Mod-Alt-g",run:r6},{key:"Mod-d",run:m6,preventDefault:!0}];class P6{constructor(e){this.view=e;let n=this.query=e.state.field(Gr).query.spec;this.commit=this.commit.bind(this),this.searchField=Be("input",{value:n.search,placeholder:en(e,"Find"),"aria-label":en(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Be("input",{value:n.replace,placeholder:en(e,"Replace"),"aria-label":en(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Be("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Be("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Be("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,i,o){return Be("button",{class:"cm-button",name:s,onclick:i,type:"button"},o)}this.dom=Be("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>dd(e),[en(e,"next")]),r("prev",()=>ud(e),[en(e,"previous")]),r("select",()=>S6(e),[en(e,"all")]),Be("label",null,[this.caseField,en(e,"match case")]),Be("label",null,[this.reField,en(e,"regexp")]),Be("label",null,[this.wordField,en(e,"by word")]),...e.state.readOnly?[]:[Be("br"),this.replaceField,r("replace",()=>sx(e),[en(e,"replace")]),r("replaceAll",()=>j6(e),[en(e,"replace all")])],Be("button",{name:"close",onclick:()=>L2(e),"aria-label":en(e,"close"),type:"button"},["×"])])}commit(){let e=new E2({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Zo.of(e)}))}keydown(e){KD(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ud:dd)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),sx(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Zo)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(zi).top}}function en(t,e){return t.state.phrase(e)}const ec=30,tc=/[\s\.,:;?!]/;function rm(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),s=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-ec),o=Math.min(s,n+ec),a=t.state.sliceDoc(i,o);if(i!=r.from){for(let l=0;l<ec;l++)if(!tc.test(a[l+1])&&tc.test(a[l])){a=a.slice(l);break}}if(o!=s){for(let l=a.length-1;l>a.length-ec;l--)if(!tc.test(a[l-1])&&tc.test(a[l])){a=a.slice(0,l);break}}return ae.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const D6=ae.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),E6=[Gr,Bs.low(k6),D6];class R2{constructor(e,n,r,s){this.state=e,this.pos=n,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Tt(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),s=n.text.slice(r-n.from,this.pos-n.from),i=s.search(I2(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function ix(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function O6(t){let e=Object.create(null),n=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let i=1;i<s.length;i++)n[s[i]]=!0}let r=ix(e)+ix(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function M6(t){let e=t.map(s=>typeof s=="string"?{label:s}:s),[n,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:O6(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:n}:null}}class ox{constructor(e,n,r,s){this.completion=e,this.source=n,this.match=r,this.score=s}}function js(t){return t.selection.main.from}function I2(t,e){var n;let{source:r}=t,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?t:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const $2=ar.define();function A6(t,e,n,r){let{main:s}=t.selection,i=n-s.from,o=r-s.from;return{...t.changeByRange(a=>{if(a!=s&&n!=r&&t.sliceDoc(a.from+i,a.from+o)!=t.sliceDoc(n,r))return{range:a};let l=t.toText(e);return{changes:{from:a.from+i,to:r==s.from?a.to:a.from+o,insert:l},range:q.cursor(a.from+i+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const ax=new WeakMap;function T6(t){if(!Array.isArray(t))return t;let e=ax.get(t);return e||ax.set(t,e=M6(t)),e}const hd=je.define(),ea=je.define();class L6{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=Ut(e,n),s=Jn(r);this.chars.push(r);let i=e.slice(n,n+s),o=i.toUpperCase();this.folded.push(Ut(o==i?i.toLowerCase():o,0)),n+=s}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:s,precise:i,byWord:o}=this;if(n.length==1){let w=Ut(e,0),v=Jn(w),k=v==e.length?0:-100;if(w!=n[0])if(w==r[0])k+=-200;else return null;return this.ret(k,[0,v])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,d=0;if(a<0){for(let w=0,v=Math.min(e.length,200);w<v&&d<l;){let k=Ut(e,w);(k==n[d]||k==r[d])&&(s[d++]=w),w+=Jn(k)}if(d<l)return null}let u=0,h=0,f=!1,p=0,m=-1,x=-1,b=/[a-z]/.test(e),y=!0;for(let w=0,v=Math.min(e.length,200),k=0;w<v&&h<l;){let C=Ut(e,w);a<0&&(u<l&&C==n[u]&&(i[u++]=w),p<l&&(C==n[p]||C==r[p]?(p==0&&(m=w),x=w+1,p++):p=0));let N,S=C<255?C>=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(N=Mp(C))!=N.toLowerCase()?1:N!=N.toUpperCase()?2:0;(!w||S==1&&b||k==0&&S!=0)&&(n[h]==C||r[h]==C&&(f=!0)?o[h++]=w:o.length&&(y=!1)),k=S,w+=Jn(C)}return h==l&&o[0]==0&&y?this.result(-100+(f?-200:0),o,e):p==l&&m==0?this.ret(-200-e.length+(x==e.length?0:-100),[0,x]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==l?this.ret(-900-e.length,[m,x]):h==l?this.result(-100+(f?-200:0)+-700+(y?0:-1100),o,e):n.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,n,r){let s=[],i=0;for(let o of n){let a=o+(this.astral?Jn(Ut(r,o)):1);i&&s[i-1]==o?s[i-1]=a:(s[i++]=o,s[i++]=a)}return this.ret(e-r.length,s)}}class R6{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const bt=de.define({combine(t){return lr(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:I6,filterStrict:!1,compareCompletions:(e,n)=>(e.sortText||e.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>lx(e(r),n(r)),optionClass:(e,n)=>r=>lx(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function lx(t,e){return t?e?t+" "+e:t:e}function I6(t,e,n,r,s,i){let o=t.textDirection==ze.RTL,a=o,l=!1,d="top",u,h,f=e.left-s.left,p=s.right-e.right,m=r.right-r.left,x=r.bottom-r.top;if(a&&f<Math.min(m,p)?a=!1:!a&&p<Math.min(m,f)&&(a=!0),m<=(a?f:p))u=Math.max(s.top,Math.min(n.top,s.bottom-x))-e.top,h=Math.min(400,a?f:p);else{l=!0,h=Math.min(400,(o?e.right:s.right-e.left)-30);let w=s.bottom-e.bottom;w>=x||w>e.top?u=n.bottom-e.top:(d="bottom",u=e.bottom-n.top)}let b=(e.bottom-e.top)/i.offsetHeight,y=(e.right-e.left)/i.offsetWidth;return{style:`${d}: ${u/b}px; max-width: ${h/y}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function $6(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,s,i){let o=document.createElement("span");o.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let d=0;d<i.length;){let u=i[d++],h=i[d++];u>l&&o.appendChild(document.createTextNode(a.slice(l,u)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(a.slice(u,h))),f.className="cm-completionMatchedText",l=h}return l<a.length&&o.appendChild(document.createTextNode(a.slice(l))),o},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function nh(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/n);return{from:s*n,to:(s+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class B6{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let s=e.state.field(n),{options:i,selected:o}=s.open,a=e.state.facet(bt);this.optionContent=$6(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=nh(i.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:d}=e.state.field(n).open;for(let u=l.target,h;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(h=/-(\d+)$/.exec(u.id))&&+h[1]<d.length){this.applyCompletion(e,d[+h[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(bt).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:ea.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:o,disabled:a}=r.open;(!s.open||s.open.options!=i)&&(this.range=nh(i.length,o,e.state.facet(bt).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),a!=((n=s.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=nh(n.options.length,n.selected,this.view.state.facet(bt).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:s}=n.options[n.selected],{info:i}=s;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(s);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,s)}).catch(a=>Yt(this.view.state,a,"completion info")):(this.addInfoPane(o,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:i}=e;r.appendChild(s),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,s=this.range.from;r;r=r.nextSibling,s++)r.nodeName!="LI"||!r.id?s--:s==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&F6(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let o=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(i.bottom,n.bottom)-10||s.bottom<Math.max(i.top,n.top)+10?null:this.view.state.facet(bt).positionInfo(this.view,n,s,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const s=document.createElement("ul");s.id=n,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",o=>{o.target==s&&o.preventDefault()});let i=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:l}=e[o],{section:d}=a;if(d){let f=typeof d=="string"?d:d.name;if(f!=i&&(o>r.from||r.from==0))if(i=f,typeof d!="string"&&d.header)s.appendChild(d.header(d));else{let p=s.appendChild(document.createElement("completion-section"));p.textContent=f}}const u=s.appendChild(document.createElement("li"));u.id=n+"-"+o,u.setAttribute("role","option");let h=this.optionClass(a);h&&(u.className=h);for(let f of this.optionContent){let p=f(a,this.view.state,this.view,l);p&&u.appendChild(p)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function _6(t,e){return n=>new B6(n,t,e)}function F6(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/s:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/s)}function cx(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function z6(t,e){let n=[],r=null,s=null,i=u=>{n.push(u);let{section:h}=u.completion;if(h){r||(r=[]);let f=typeof h=="string"?h:h.name;r.some(p=>p.name==f)||r.push(typeof h=="string"?{name:f}:h)}},o=e.facet(bt);for(let u of t)if(u.hasResult()){let h=u.result.getMatch;if(u.result.filter===!1)for(let f of u.result.options)i(new ox(f,u.source,h?h(f):[],1e9-n.length));else{let f=e.sliceDoc(u.from,u.to),p,m=o.filterStrict?new R6(f):new L6(f);for(let x of u.result.options)if(p=m.match(x.label)){let b=x.displayLabel?h?h(x,p.matched):[]:p.matched,y=p.score+(x.boost||0);if(i(new ox(x,u.source,b,y)),typeof x.section=="object"&&x.section.rank==="dynamic"){let{name:w}=x.section;s||(s=Object.create(null)),s[w]=Math.max(y,s[w]||-1e9)}}}}if(r){let u=Object.create(null),h=0,f=(p,m)=>(p.rank==="dynamic"&&m.rank==="dynamic"?s[m.name]-s[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(p.name<m.name?-1:1);for(let p of r.sort(f))h-=1e5,u[p.name]=h;for(let p of n){let{section:m}=p.completion;m&&(p.score+=u[typeof m=="string"?m:m.name])}}let a=[],l=null,d=o.compareCompletions;for(let u of n.sort((h,f)=>f.score-h.score||d(h.completion,f.completion))){let h=u.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?a.push(u):cx(u.completion)>cx(l)&&(a[a.length-1]=u),l=u.completion}return a}class ni{constructor(e,n,r,s,i,o){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=o}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new ni(this.options,dx(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,s,i,o){if(s&&!o&&e.some(d=>d.isPending))return s.setDisabled();let a=z6(e,n);if(!a.length)return s&&e.some(d=>d.isPending)?s.setDisabled():null;let l=n.facet(bt).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let d=s.options[s.selected].completion;for(let u=0;u<a.length;u++)if(a[u].completion==d){l=u;break}}return new ni(a,dx(r,l),{pos:e.reduce((d,u)=>u.hasResult()?Math.min(d,u.from):d,1e8),create:G6,above:i.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new ni(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new ni(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class fd{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new fd(K6,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(bt),i=(r.override||n.languageDataAt("autocomplete",js(n)).map(T6)).map(l=>(this.active.find(u=>u.source==l)||new wn(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((l,d)=>l==this.active[d])&&(i=this.active);let o=this.open,a=e.effects.some(l=>l.is(sm));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||i.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!H6(i,this.active)||a?o=ni.build(i,n,this.id,o,r,a):o&&o.disabled&&!i.some(l=>l.isPending)&&(o=null),!o&&i.every(l=>!l.isPending)&&i.some(l=>l.hasResult())&&(i=i.map(l=>l.hasResult()?new wn(l.source,0):l));for(let l of e.effects)l.is(_2)&&(o=o&&o.setSelected(l.value,this.id));return i==this.active&&o==this.open?this:new fd(i,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?V6:W6}}function H6(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let s=n==t.length,i=r==e.length;if(s||i)return s==i;if(t[n++].result!=e[r++].result)return!1}}const V6={"aria-autocomplete":"list"},W6={};function dx(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const K6=[];function B2(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation($2);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class wn{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=B2(e,n),s=this;(r&8||r&16&&this.touches(e))&&(s=new wn(s.source,0)),r&4&&s.state==0&&(s=new wn(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(hd))s=new wn(s.source,1,i.value);else if(i.is(ea))s=new wn(s.source,0);else if(i.is(sm))for(let o of i.value)o.source==s.source&&(s=o);return s}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(js(e.state))}}class fi extends wn{constructor(e,n,r,s,i,o){super(e,3,n),this.limit=r,this.result=s,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=js(e.state);if(a>o||!s||n&2&&(js(e.startState)==this.from||a<this.limit))return new wn(this.source,n&4?1:0);let l=e.changes.mapPos(this.limit);return U6(s.validFor,e.state,i,o)?new fi(this.source,this.explicit,l,s,i,o):s.update&&(s=s.update(s,i,o,new R2(e.state,a,!1)))?new fi(this.source,this.explicit,l,s,s.from,(r=s.to)!==null&&r!==void 0?r:js(e.state)):new wn(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new fi(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new wn(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function U6(t,e,n,r){if(!t)return!1;let s=e.sliceDoc(n,r);return typeof t=="function"?t(s,n,r,e):I2(t,!0).test(s)}const sm=je.define({map(t,e){return t.map(n=>n.map(e))}}),_2=je.define(),Gt=Dt.define({create(){return fd.start()},update(t,e){return t.update(e)},provide:t=>[Gp.from(t,e=>e.tooltip),ae.contentAttributes.from(t,e=>e.attrs)]});function im(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Gt).active.find(s=>s.source==e.source);return r instanceof fi?(typeof n=="string"?t.dispatch({...A6(t.state,n,r.from,r.to),annotations:$2.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const G6=_6(Gt,im);function nc(t,e="option"){return n=>{let r=n.state.field(Gt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(bt).interactionDelay)return!1;let s=1,i;e=="page"&&(i=Dw(n,r.open.tooltip))&&(s=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+s*(t?1:-1):t?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),n.dispatch({effects:_2.of(a)}),!0}}const q6=t=>{let e=t.state.field(Gt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(bt).interactionDelay?!1:im(t,e.open.options[e.open.selected])},rh=t=>t.state.field(Gt,!1)?(t.dispatch({effects:hd.of(!0)}),!0):!1,Y6=t=>{let e=t.state.field(Gt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:ea.of(null)}),!0)};class X6{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Q6=50,J6=1e3,Z6=tt.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Gt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Gt),n=t.state.facet(bt);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Gt)==e)return;let r=t.transactions.some(i=>{let o=B2(i,n);return o&8||(i.selection||i.docChanged)&&!(o&3)});for(let i=0;i<this.running.length;i++){let o=this.running[i];if(r||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>Q6&&Date.now()-o.time>J6){for(let a of o.context.abortListeners)try{a()}catch(l){Yt(this.view.state,l)}o.context.abortListeners=null,this.running.splice(i--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(o=>o.is(hd)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(o=>o.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of t.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Gt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(bt).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=js(e),r=new R2(e,n,t.explicit,this.view),s=new X6(t,r);this.running.push(s),Promise.resolve(t.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:ea.of(null)}),Yt(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(bt).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(bt),r=this.view.state.field(Gt);for(let s=0;s<this.running.length;s++){let i=this.running[s];if(i.done===void 0)continue;if(this.running.splice(s--,1),i.done){let a=js(i.updates.length?i.updates[0].startState:this.view.state),l=Math.min(a,i.done.from+(i.active.explicit?0:1)),d=new fi(i.active.source,i.active.explicit,l,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:a);for(let u of i.updates)d=d.update(u,n);if(d.hasResult()){e.push(d);continue}}let o=r.active.find(a=>a.source==i.active.source);if(o&&o.isPending)if(i.done==null){let a=new wn(i.active.source,0);for(let l of i.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:sm.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Gt,!1);if(e&&e.tooltip&&this.view.state.facet(bt).closeOnBlur){let n=e.open&&Dw(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ea.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:hd.of(!1)}),20),this.composing=0}}}),eA=typeof navigator=="object"&&/Win/.test(navigator.platform),tA=Bs.highest(ae.domEventHandlers({keydown(t,e){let n=e.state.field(Gt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(eA&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],s=n.active.find(o=>o.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&im(e,r),!1}})),nA=ae.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),ta={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ks=je.define({map(t,e){let n=e.mapPos(t,-1,Ft.TrackAfter);return n??void 0}}),om=new class extends Xr{};om.startSide=1;om.endSide=-1;const F2=Dt.define({create(){return Ee.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(ks)&&(t=t.update({add:[om.range(n.value,n.value+1)]}));return t}});function rA(){return[iA,F2]}const sh="()[]{}<>«»»«[]{}";function z2(t){for(let e=0;e<sh.length;e+=2)if(sh.charCodeAt(e)==t)return sh.charAt(e+1);return Mp(t<128?t:t+1)}function H2(t,e){return t.languageDataAt("closeBrackets",e)[0]||ta}const sA=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),iA=ae.inputHandler.of((t,e,n,r)=>{if((sA?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(r.length>2||r.length==2&&Jn(Ut(r,0))==1||e!=s.from||n!=s.to)return!1;let i=lA(t.state,r);return i?(t.dispatch(i),!0):!1}),oA=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=H2(t,t.selection.main.head).brackets||ta.brackets,s=null,i=t.changeByRange(o=>{if(o.empty){let a=cA(t.doc,o.head);for(let l of r)if(l==a&&tu(t.doc,o.head)==z2(Ut(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:q.cursor(o.head-l.length)}}return{range:s=o}});return s||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},aA=[{key:"Backspace",run:oA}];function lA(t,e){let n=H2(t,t.selection.main.head),r=n.brackets||ta.brackets;for(let s of r){let i=z2(Ut(s,0));if(e==s)return i==s?hA(t,s,r.indexOf(s+s+s)>-1,n):dA(t,s,i,n.before||ta.before);if(e==i&&V2(t,t.selection.main.from))return uA(t,s,i)}return null}function V2(t,e){let n=!1;return t.field(F2).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function tu(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Jn(Ut(n,0)))}function cA(t,e){let n=t.sliceString(e-2,e);return Jn(Ut(n,0))==n.length?n:n.slice(1)}function dA(t,e,n,r){let s=null,i=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:ks.of(o.to+e.length),range:q.range(o.anchor+e.length,o.head+e.length)};let a=tu(t.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:o.head},effects:ks.of(o.head+e.length),range:q.cursor(o.head+e.length)}:{range:s=o}});return s?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function uA(t,e,n){let r=null,s=t.changeByRange(i=>i.empty&&tu(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:q.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function hA(t,e,n,r){let s=r.stringPrefixes||ta.stringPrefixes,i=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:ks.of(a.to+e.length),range:q.range(a.anchor+e.length,a.head+e.length)};let l=a.head,d=tu(t.doc,l),u;if(d==e){if(ux(t,l))return{changes:{insert:e+e,from:l},effects:ks.of(l+e.length),range:q.cursor(l+e.length)};if(V2(t,l)){let f=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:q.cursor(l+f.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=hx(t,l-2*e.length,s))>-1&&ux(t,u))return{changes:{insert:e+e+e+e,from:l},effects:ks.of(l+e.length),range:q.cursor(l+e.length)};if(t.charCategorizer(l)(d)!=We.Word&&hx(t,l,s)>-1&&!fA(t,l,e,s))return{changes:{insert:e+e,from:l},effects:ks.of(l+e.length),range:q.cursor(l+e.length)}}return{range:i=a}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ux(t,e){let n=Tt(t).resolveInner(e+1);return n.parent&&n.from==e}function fA(t,e,n,r){let s=Tt(t).resolveInner(e,-1),i=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=t.sliceDoc(s.from,Math.min(s.to,s.from+n.length+i)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=s.firstChild;for(;u&&u.from==s.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let d=s.to==e&&s.parent;if(!d)break;s=d}return!1}function hx(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=We.Word)return e;for(let s of n){let i=e-s.length;if(t.sliceDoc(i,e)==s&&r(t.sliceDoc(i-1,i))!=We.Word)return i}return-1}function pA(t={}){return[tA,Gt,bt.of(t),Z6,mA,nA]}const W2=[{key:"Ctrl-Space",run:rh},{mac:"Alt-`",run:rh},{mac:"Alt-i",run:rh},{key:"Escape",run:Y6},{key:"ArrowDown",run:nc(!0)},{key:"ArrowUp",run:nc(!1)},{key:"PageDown",run:nc(!0,"page")},{key:"PageUp",run:nc(!1,"page")},{key:"Enter",run:q6}],mA=Bs.highest(Ud.computeN([bt],t=>t.facet(bt).defaultKeymap?[W2]:[]));class fx{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class ms{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let s=r.facet(na).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((p,m)=>p.from-m.from||p.to-m.to),o=new Sr,a=[],l=0,d=r.doc.iter(),u=0,h=r.doc.length;for(let p=0;;){let m=p==i.length?null:i[p];if(!m&&!a.length)break;let x,b;if(a.length)x=l,b=a.reduce((v,k)=>Math.min(v,k.to),m&&m.from>x?m.from:1e8);else{if(x=m.from,x>h)break;b=m.to,a.push(m),p++}for(;p<i.length;){let v=i[p];if(v.from==x&&(v.to>v.from||v.to==x))a.push(v),p++,b=Math.min(v.to,b);else{b=Math.min(v.from,b);break}}b=Math.min(b,h);let y=!1;if(a.some(v=>v.from==x&&(v.to==b||b==h))&&(y=x==b,!y&&b-x<10)){let v=x-(u+d.value.length);v>0&&(d.next(v),u=x);for(let k=x;;){if(k>=b){y=!0;break}if(!d.lineBreak&&u+d.value.length>k)break;k=u+d.value.length,u+=d.value.length,d.next()}}let w=DA(a);if(y)o.add(x,x,ye.widget({widget:new CA(w),diagnostics:a.slice()}));else{let v=a.reduce((k,C)=>C.markClass?k+" "+C.markClass:k,"");o.add(x,b,ye.mark({class:"cm-lintRange cm-lintRange-"+w+v,diagnostics:a.slice(),inclusiveEnd:a.some(k=>k.to>b)}))}if(l=b,l==h)break;for(let v=0;v<a.length;v++)a[v].to<=l&&a.splice(v--,1)}let f=o.finish();return new ms(f,n,Ni(f))}}function Ni(t,e=null,n=0){let r=null;return t.between(n,1e9,(s,i,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new fx(s,i,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new fx(r.from,i,r.diagnostic)}}),r}function gA(t,e){let n=e.pos,r=e.end||n,s=t.state.facet(na).hideOn(t,n,r);if(s!=null)return s;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(K2))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function xA(t,e){return t.field(on,!1)?e:e.concat(je.appendConfig.of(EA))}const K2=je.define(),am=je.define(),U2=je.define(),on=Dt.define({create(){return new ms(ye.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,s=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=Ni(n,t.selected.diagnostic,i)||Ni(n,null,i)}!n.size&&s&&e.state.facet(na).autoPanel&&(s=null),t=new ms(n,s,r)}for(let n of e.effects)if(n.is(K2)){let r=e.state.facet(na).autoPanel?n.value.length?ra.open:null:t.panel;t=ms.init(n.value,r,e.state)}else n.is(am)?t=new ms(t.diagnostics,n.value?ra.open:null,t.selected):n.is(U2)&&(t=new ms(t.diagnostics,t.panel,n.value));return t},provide:t=>[Qo.from(t,e=>e.panel),ae.decorations.from(t,e=>e.diagnostics)]}),bA=ye.mark({class:"cm-lintRange cm-lintRange-active"});function yA(t,e,n){let{diagnostics:r}=t.state.field(on),s,i=-1,o=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,d,{spec:u})=>{if(e>=l&&e<=d&&(l==d||(e>l||n>0)&&(e<d||n<0)))return s=u.diagnostics,i=l,o=d,!1});let a=t.state.facet(na).tooltipFilter;return s&&a&&(s=a(s,t.state)),s?{pos:i,end:o,above:t.state.doc.lineAt(i).to<o,create(){return{dom:vA(t,s)}}}:null}function vA(t,e){return Be("ul",{class:"cm-tooltip-lint"},e.map(n=>q2(t,n,!1)))}const wA=t=>{let e=t.state.field(on,!1);(!e||!e.panel)&&t.dispatch({effects:xA(t.state,[am.of(!0)])});let n=Xo(t,ra.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},px=t=>{let e=t.state.field(on,!1);return!e||!e.panel?!1:(t.dispatch({effects:am.of(!1)}),!0)},kA=t=>{let e=t.state.field(on,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},SA=[{key:"Mod-Shift-m",run:wA,preventDefault:!0},{key:"F8",run:kA}],na=de.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...lr(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:mx,tooltipFilter:mx,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,s,i)=>e(r,s,i)||n(r,s,i):e:n,autoPanel:(e,n)=>e||n})}}});function mx(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function G2(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let s=n[r];if(/[a-zA-Z]/.test(s)&&!e.some(i=>i.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function q2(t,e,n){var r;let s=n?G2(e.actions):[];return Be("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Be("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,o)=>{let a=!1,l=p=>{if(p.preventDefault(),a)return;a=!0;let m=Ni(t.state.field(on).diagnostics,e);m&&i.apply(t,m.from,m.to)},{name:d}=i,u=s[o]?d.indexOf(s[o]):-1,h=u<0?d:[d.slice(0,u),Be("u",d.slice(u,u+1)),d.slice(u+1)],f=i.markClass?" "+i.markClass:"";return Be("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${d}${u<0?"":` (access key "${s[o]})"`}.`},h)}),e.source&&Be("div",{class:"cm-diagnosticSource"},e.source))}class CA extends cr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Be("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class gx{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=q2(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ra{constructor(e){this.view=e,this.items=[];let n=s=>{if(s.keyCode==27)px(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],o=G2(i.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==s.keyCode){let l=Ni(this.view.state.field(on).diagnostics,i);l&&i.actions[a].apply(e,l.from,l.to)}}else return;s.preventDefault()},r=s=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(s.target)&&this.moveSelection(i)};this.list=Be("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Be("div",{class:"cm-panel-lint"},this.list,Be("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>px(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(on).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(on),r=0,s=!1,i=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:d})=>{for(let u of d.diagnostics){if(o.has(u))continue;o.add(u);let h=-1,f;for(let p=r;p<this.items.length;p++)if(this.items[p].diagnostic==u){h=p;break}h<0?(f=new gx(this.view,u),this.items.splice(r,0,f),s=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),s=!0)),n&&f.diagnostic==n.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),i=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new gx(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let d=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/d:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(on),r=Ni(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:U2.of(r)})}static open(e){return new ra(e)}}function jA(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function rc(t){return jA(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const NA=ae.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:rc("#d11")},".cm-lintRange-warning":{backgroundImage:rc("orange")},".cm-lintRange-info":{backgroundImage:rc("#999")},".cm-lintRange-hint":{backgroundImage:rc("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function PA(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function DA(t){let e="hint",n=1;for(let r of t){let s=PA(r.severity);s>n&&(n=s,e=r.severity)}return e}const EA=[on,ae.decorations.compute([on],t=>{let{selected:e,panel:n}=t.field(on);return!e||!n||e.from==e.to?ye.none:ye.set([bA.range(e.from,e.to)])}),TE(yA,{hideOn:gA}),NA];var xx=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(aA)),e.defaultKeymap!==!1&&(r=r.concat(e6)),e.searchKeymap!==!1&&(r=r.concat(N6)),e.historyKeymap!==!1&&(r=r.concat(aM)),e.foldKeymap!==!1&&(r=r.concat(bO)),e.completionKeymap!==!1&&(r=r.concat(W2)),e.lintKeymap!==!1&&(r=r.concat(SA));var s=[];return e.lineNumbers!==!1&&s.push(WE()),e.highlightActiveLineGutter!==!1&&s.push(GE()),e.highlightSpecialChars!==!1&&s.push(lE()),e.history!==!1&&s.push(JO()),e.foldGutter!==!1&&s.push(kO()),e.drawSelection!==!1&&s.push(QD()),e.dropCursor!==!1&&s.push(nE()),e.allowMultipleSelections!==!1&&s.push(Ae.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(lO()),e.syntaxHighlighting!==!1&&s.push(Xp(NO,{fallback:!0})),e.bracketMatching!==!1&&s.push(TO()),e.closeBrackets!==!1&&s.push(rA()),e.autocompletion!==!1&&s.push(pA()),e.rectangularSelection!==!1&&s.push(kE()),n!==!1&&s.push(jE()),e.highlightActiveLine!==!1&&s.push(pE()),e.highlightSelectionMatches!==!1&&s.push(a6()),e.tabSize&&typeof e.tabSize=="number"&&s.push(qd.of(" ".repeat(e.tabSize))),s.concat([Ud.of(r.flat())]).filter(Boolean)};const OA="#e5c07b",bx="#e06c75",MA="#56b6c2",AA="#ffffff",Ac="#abb2bf",Uf="#7d8799",TA="#61afef",LA="#98c379",yx="#d19a66",RA="#c678dd",IA="#21252b",vx="#2c313a",wx="#282c34",ih="#353a42",$A="#3E4451",kx="#528bff",BA=ae.theme({"&":{color:Ac,backgroundColor:wx},".cm-content":{caretColor:kx},".cm-cursor, .cm-dropCursor":{borderLeftColor:kx},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:$A},".cm-panels":{backgroundColor:IA,color:Ac},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:wx,color:Uf,border:"none"},".cm-activeLineGutter":{backgroundColor:vx},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ih},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ih,borderBottomColor:ih},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:vx,color:Ac}}},{dark:!0}),_A=_i.define([{tag:U.keyword,color:RA},{tag:[U.name,U.deleted,U.character,U.propertyName,U.macroName],color:bx},{tag:[U.function(U.variableName),U.labelName],color:TA},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:yx},{tag:[U.definition(U.name),U.separator],color:Ac},{tag:[U.typeName,U.className,U.number,U.changed,U.annotation,U.modifier,U.self,U.namespace],color:OA},{tag:[U.operator,U.operatorKeyword,U.url,U.escape,U.regexp,U.link,U.special(U.string)],color:MA},{tag:[U.meta,U.comment],color:Uf},{tag:U.strong,fontWeight:"bold"},{tag:U.emphasis,fontStyle:"italic"},{tag:U.strikethrough,textDecoration:"line-through"},{tag:U.link,color:Uf,textDecoration:"underline"},{tag:U.heading,fontWeight:"bold",color:bx},{tag:[U.atom,U.bool,U.special(U.variableName)],color:yx},{tag:[U.processingInstruction,U.string,U.inserted],color:LA},{tag:U.invalid,color:AA}]),FA=[BA,Xp(_A)];var zA=ae.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),HA=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:o="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(Ud.of([t6])),a&&(typeof a=="boolean"?l.unshift(xx()):l.unshift(xx(a))),o&&l.unshift(bE(o)),i){case"light":l.push(zA);break;case"dark":l.push(FA);break;case"none":break;default:l.push(i);break}return r===!1&&l.push(ae.editable.of(!1)),s&&l.push(Ae.readOnly.of(!0)),[...l]},VA=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class WA{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class Sx{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var oh=null,KA=()=>typeof window>"u"?new Sx:(oh||(oh=new Sx),oh),Cx=ar.define(),UA=200,GA=[];function qA(t){var{value:e,selection:n,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:o,extensions:a=GA,autoFocus:l,theme:d="light",height:u=null,minHeight:h=null,maxHeight:f=null,width:p=null,minWidth:m=null,maxWidth:x=null,placeholder:b="",editable:y=!0,readOnly:w=!1,indentWithTab:v=!0,basicSetup:k=!0,root:C,initialState:N}=t,[S,D]=g.useState(),[E,M]=g.useState(),[P,A]=g.useState(),R=g.useState(()=>({current:null}))[0],j=g.useState(()=>({current:null}))[0],O=ae.theme({"&":{height:u,minHeight:h,maxHeight:f,width:p,minWidth:m,maxWidth:x},"& .cm-scroller":{height:"100% !important"}}),T=ae.updateListener.of(B=>{if(B.docChanged&&typeof r=="function"&&!B.transactions.some(F=>F.annotation(Cx))){R.current?R.current.reset():(R.current=new WA(()=>{if(j.current){var F=j.current;j.current=null,F()}R.current=null},UA),KA().add(R.current));var V=B.state.doc,W=V.toString();r(W,B)}s&&s(VA(B))}),$=HA({theme:d,editable:y,readOnly:w,placeholder:b,indentWithTab:v,basicSetup:k}),I=[T,O,...$];return o&&typeof o=="function"&&I.push(ae.updateListener.of(o)),I=I.concat(a),g.useLayoutEffect(()=>{if(S&&!P){var B={doc:e,selection:n,extensions:I},V=N?Ae.fromJSON(N.json,B,N.fields):Ae.create(B);if(A(V),!E){var W=new ae({state:V,parent:S,root:C});M(W),i&&i(W,V)}}return()=>{E&&(A(void 0),M(void 0))}},[S,P]),g.useEffect(()=>{t.container&&D(t.container)},[t.container]),g.useEffect(()=>()=>{E&&(E.destroy(),M(void 0)),R.current&&(R.current.cancel(),R.current=null)},[E]),g.useEffect(()=>{l&&E&&E.focus()},[l,E]),g.useEffect(()=>{E&&E.dispatch({effects:je.reconfigure.of(I)})},[d,a,u,h,f,p,m,x,b,y,w,v,k,r,o]),g.useEffect(()=>{if(e!==void 0){var B=E?E.state.doc.toString():"";if(E&&e!==B){var V=R.current&&!R.current.isDone,W=()=>{E&&e!==E.state.doc.toString()&&E.dispatch({changes:{from:0,to:E.state.doc.toString().length,insert:e||""},annotations:[Cx.of(!0)]})};V?j.current=W:W()}}},[e,E]),{state:P,setState:A,view:E,setView:M,container:S,setContainer:D}}var YA=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Y2=g.forwardRef((t,e)=>{var{className:n,value:r="",selection:s,extensions:i=[],onChange:o,onStatistics:a,onCreateEditor:l,onUpdate:d,autoFocus:u,theme:h="light",height:f,minHeight:p,maxHeight:m,width:x,minWidth:b,maxWidth:y,basicSetup:w,placeholder:v,indentWithTab:k,editable:C,readOnly:N,root:S,initialState:D}=t,E=HO(t,YA),M=g.useRef(null),{state:P,view:A,container:R,setContainer:j}=qA({root:S,value:r,autoFocus:u,theme:h,height:f,minHeight:p,maxHeight:m,width:x,minWidth:b,maxWidth:y,basicSetup:w,placeholder:v,indentWithTab:k,editable:C,readOnly:N,selection:s,onChange:o,onStatistics:a,onCreateEditor:l,onUpdate:d,extensions:i,initialState:D});g.useImperativeHandle(e,()=>({editor:M.current,state:P,view:A}),[M,R,P,A]);var O=g.useCallback($=>{M.current=$,j($)},[j]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var T=typeof h=="string"?"cm-theme-"+h:"cm-theme";return c.jsx("div",_f({ref:O,className:""+T+(n?" "+n:"")},E))});Y2.displayName="CodeMirror";const XA=()=>{const t=ae.theme({"&":{backgroundColor:"var(--dash-surface)",color:"var(--dash-text)",height:"100%"},".cm-editor":{height:"100% !important"},".cm-content":{color:"var(--dash-text)",caretColor:"var(--dash-accent)",fontFamily:"'JetBrains Mono', Menlo, monospace",padding:"1rem"},".cm-line":{color:"var(--dash-text)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--dash-accent)"},"& ::selection":{backgroundColor:"var(--dash-accent-selection) !important",color:"inherit !important"},".cm-gutters":{backgroundColor:"var(--dash-surface)",color:"var(--dash-text-muted)",border:"none",borderRight:"1px solid var(--dash-border)",paddingRight:"0.5rem"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5rem 0 1rem",minWidth:"3rem"},".cm-activeLineGutter":{backgroundColor:"var(--dash-accent-subtle)",color:"var(--dash-accent)",fontWeight:"600"},".cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--dash-accent) 8%, transparent)"},".cm-matchingBracket":{backgroundColor:"var(--dash-accent-subtle)",outline:"1px solid var(--dash-accent)"},".cm-scroller":{overflow:"auto !important",height:"100%",maxHeight:"100%"}}),e=_i.define([{tag:U.propertyName,color:"var(--dash-accent)"},{tag:U.string,color:"color-mix(in srgb, var(--dash-accent) 70%, var(--dash-text))"},{tag:U.number,color:"var(--dash-accent-hover)"},{tag:U.bool,color:"var(--dash-accent-hover)"},{tag:U.null,color:"var(--dash-text-muted)"},{tag:U.punctuation,color:"var(--dash-text-secondary)"},{tag:U.brace,color:"var(--dash-text-secondary)"},{tag:U.bracket,color:"var(--dash-text-secondary)"}]);return[t,Xp(e)]},QA=({value:t,onChange:e,onCursorLineChange:n,onEditorFocus:r,height:s="100%",readOnly:i=!1,className:o})=>{const a=g.useMemo(()=>[zO(),ae.lineWrapping,...XA()],[]),l=g.useMemo(()=>{if(n)return d=>{const u=d.state.selection.main.head,h=d.view.state.doc.lineAt(u).number-1;n(h)}},[n]);return c.jsx("div",{className:`h-full [&_.cm-editor]:h-full [&_.cm-editor]:outline-none [&_.cm-focused]:outline-none ${o??""}`.trim(),children:c.jsx(Y2,{value:t,height:s,extensions:a,onChange:e,onFocus:r,onUpdate:l,theme:"none",readOnly:i,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightActiveLine:!0,foldGutter:!1,dropCursor:!0,drawSelection:!1,allowMultipleSelections:!1,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!1,rectangularSelection:!1,crosshairCursor:!1,highlightSelectionMatches:!0}})})},lm=({width:t,isLoading:e,jsonText:n,cursorLine:r,syntaxError:s,onChange:i,onEditorFocus:o,onCursorLineChange:a,readOnly:l=!1,headerTitle:d,headerPath:u,headerActions:h})=>{const{t:f}=ne(),p=m=>{if(l||!m.target.closest(".cm-editor"))return;const b=m.currentTarget;b.scrollHeight<=b.clientHeight||(b.scrollTop+=m.deltaY)};return c.jsxs("div",{style:{width:`${t}%`},className:"bg-dash-surface border border-dash-border rounded-xl overflow-hidden flex flex-col shadow-sm min-w-0 h-full",children:[c.jsx("div",{className:"p-3 border-b border-dash-border bg-dash-surface-hover/50 shrink-0",children:c.jsxs("div",{className:"flex items-end justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h3",{className:"text-xs font-bold text-dash-text-secondary uppercase tracking-widest",children:d??f("jsonTab")}),u&&c.jsx("p",{className:"mt-1 mono text-[11px] text-dash-text-muted truncate",children:u})]}),h&&c.jsx("div",{className:"flex items-center gap-2 shrink-0",children:h})]})}),c.jsx("div",{className:"flex-1 min-h-0 overflow-auto",onWheelCapture:p,children:e?c.jsx("div",{className:"h-full flex items-center justify-center",children:c.jsx("div",{className:"animate-pulse text-dash-text-muted text-sm",children:f("loading")})}):l?c.jsx("pre",{className:"h-full overflow-auto p-4 font-mono text-xs leading-4 text-dash-text whitespace-pre m-0",children:n}):c.jsx(QA,{value:n,onChange:i,onEditorFocus:o,onCursorLineChange:a,readOnly:l,className:"[&_.cm-content]:text-xs [&_.cm-content]:leading-4 [&_.cm-gutters]:text-xs [&_.cm-gutters]:leading-4"})}),c.jsxs("div",{className:"px-4 py-2 bg-dash-surface-hover/30 border-t border-dash-border text-[10px] text-dash-text-muted flex justify-between uppercase tracking-widest font-bold",children:[c.jsxs("div",{className:"flex gap-4",children:[c.jsx("span",{children:"UTF-8"}),c.jsx("span",{children:"JSON"}),c.jsxs("span",{children:["L:",r+1]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[l&&c.jsx("span",{children:f("readOnly")}),s?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),c.jsx("span",{className:"text-red-500 normal-case",children:s})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-dash-accent"}),f("syntaxValid")]})]})]})]})},jx=({label:t,value:e})=>c.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-dash-bg border border-dash-border rounded-md",children:[c.jsxs("span",{className:"text-[9px] font-bold text-dash-text-muted uppercase",children:[t,":"]}),c.jsx("span",{className:"text-[10px] mono font-bold text-dash-text-secondary",children:e})]}),X2=({width:t,fieldDoc:e,activeFieldPath:n,extraContent:r,overrideBadge:s})=>{const{t:i,lang:o}=ne(),a=e??(n?Jv[n]??{path:n,type:"unknown",default:"n/a",description:"Help is being resolved for this field. Try editing the value or switching to the JSON view for schema-based details.",descriptionVi:"Đang tải trợ giúp cho trường này. Hãy thử chỉnh sửa giá trị hoặc chuyển sang chế độ JSON để xem mô tả suy ra từ schema."}:null);return c.jsxs("div",{style:{width:`${t}%`},className:"bg-dash-surface border border-dash-border rounded-xl flex flex-col shadow-sm overflow-hidden min-w-0",children:[c.jsx("div",{className:"p-3 border-b border-dash-border bg-dash-surface-hover/50 shrink-0",children:c.jsx("h3",{className:"text-xs font-bold text-dash-text-secondary uppercase tracking-widest",children:i("configurationHelp")})}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:a?c.jsxs("div",{className:"space-y-5 animate-in fade-in duration-500",children:[c.jsxs("header",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[c.jsx("span",{className:"text-[10px] bg-dash-accent-subtle text-dash-accent px-1.5 py-0.5 rounded font-mono uppercase font-bold",children:i("field")}),c.jsx("h2",{className:"text-base font-bold text-dash-text mono break-all",children:a.path}),s]}),c.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[c.jsx(jx,{label:i("type"),value:a.type}),c.jsx(jx,{label:i("default"),value:a.default})]})]}),c.jsxs("section",{children:[c.jsx("h4",{className:"text-[10px] font-bold text-dash-text-muted uppercase tracking-widest mb-2",children:i("description")}),c.jsx("p",{className:"text-sm text-dash-text-secondary leading-relaxed italic",children:o==="vi"?a.descriptionVi:a.description})]}),a.validValues&&c.jsxs("section",{children:[c.jsx("h4",{className:"text-[10px] font-bold text-dash-text-muted uppercase tracking-widest mb-2",children:i("validValues")}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.validValues.map(l=>c.jsx("span",{className:"px-2 py-0.5 bg-dash-bg border border-dash-border rounded text-[11px] mono text-dash-text",children:l},l))})]}),a.effect&&c.jsxs("section",{className:"bg-dash-accent-subtle/30 p-3 rounded-lg border border-dash-accent/10",children:[c.jsx("h4",{className:"text-[10px] font-bold text-dash-accent uppercase tracking-widest mb-1",children:i("systemEffect")}),c.jsx("p",{className:"text-[12px] text-dash-text-secondary leading-normal",children:o==="vi"&&a.effectVi?a.effectVi:a.effect})]}),a.example&&c.jsxs("section",{children:[c.jsx("h4",{className:"text-[10px] font-bold text-dash-text-muted uppercase tracking-widest mb-2",children:i("exampleUsage")}),c.jsx("div",{className:"bg-dash-bg p-3 rounded-lg border border-dash-border overflow-hidden",children:c.jsx("pre",{className:"text-[11px] mono text-dash-text-secondary whitespace-pre overflow-x-auto",children:a.example})})]}),r]}):c.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center opacity-40 space-y-4",children:[c.jsx("div",{className:"w-10 h-10 rounded-full bg-dash-bg border border-dash-border flex items-center justify-center text-lg",children:"?"}),c.jsxs("div",{className:"max-w-[180px]",children:[c.jsx("p",{className:"text-sm font-bold text-dash-text mb-1 italic",children:i("knowledgeBase")}),c.jsx("p",{className:"text-xs text-dash-text-secondary",children:i("clickToSeeHelp")})]})]})}),a&&c.jsx("div",{className:"p-3 bg-dash-surface-hover/20 border-t border-dash-border shrink-0",children:c.jsxs("p",{className:"text-[10px] text-dash-text-muted font-medium flex items-center gap-1.5 italic",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),i("extractedFrom")]})})]})},JA=({variant:t="development"})=>{const{t:e}=ne(),n={development:e("developmentFeature"),beta:e("betaFeature"),experimental:e("experimentalFeature")};return c.jsx("span",{className:"text-[9px] bg-orange-500/10 text-orange-500 px-2 py-0.5 rounded-full font-bold border border-orange-500/30 uppercase tracking-wider",children:n[t]})},Nx={codex:{heavy:{model:"gpt-5.4",effort:"xhigh"},balanced:{model:"gpt-5.4",effort:"high"},light:{model:"gpt-5.4-mini",effort:"medium"}},"gemini-cli":{heavy:{model:"gemini-3.1-pro-preview"},balanced:{model:"gemini-3.1-pro-preview"},light:{model:"gemini-3-flash-preview"}}},ZA={codex:"Codex","gemini-cli":"Gemini CLI"},Px=["heavy","balanced","light"];function Dx(t,e){return e.split(".").reduce((n,r)=>{if(n!=null&&typeof n=="object"&&r in n)return n[r]},t)}const Ex="bg-transparent border border-dash-border rounded px-2 py-1 text-sm text-dash-text placeholder:text-dash-text-muted focus:border-dash-accent focus:outline-none w-full",eT=({config:t,onChange:e})=>{const{t:n}=ne(),[r,s]=g.useState(!1),i=(l,d,u,h)=>{const f=`modelTaxonomy.${l}.${d}.${u}`;e(f,h===""?void 0:h)},o=l=>{for(const d of Px)e(`modelTaxonomy.${l}.${d}.model`,void 0),Nx[l]?.[d]?.effort!==void 0&&e(`modelTaxonomy.${l}.${d}.effort`,void 0)},a=l=>n(l==="heavy"?"taxonomyTierHeavy":l==="balanced"?"taxonomyTierBalanced":"taxonomyTierLight");return c.jsxs("div",{className:"bg-dash-surface border border-dash-border rounded-lg overflow-hidden flex flex-col h-full",children:[c.jsxs("button",{type:"button",onClick:()=>s(!r),className:"w-full flex items-center justify-between px-4 py-3 bg-dash-surface-hover/30 hover:bg-dash-surface-hover/50 transition-colors","aria-expanded":!r,"aria-controls":"section-model-taxonomy",children:[c.jsx("h3",{className:"text-sm font-bold text-dash-text uppercase tracking-wider",children:n("sectionModelTaxonomy")}),c.jsx("svg",{className:`w-4 h-4 text-dash-text-muted transition-transform duration-200 ${r?"":"rotate-180"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),!r&&c.jsx("div",{id:"section-model-taxonomy",className:"flex-1 overflow-y-auto min-h-0",children:c.jsxs("div",{className:"px-4 py-3 space-y-4",children:[c.jsx("p",{className:"text-xs text-dash-text-secondary",children:n("taxonomyDescription")}),Object.entries(Nx).map(([l,d])=>{const u=Object.values(d).some(h=>h.effort!==void 0);return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-xs font-semibold text-dash-text uppercase tracking-wider",children:ZA[l]??l}),c.jsx("button",{type:"button",onClick:()=>o(l),className:"text-xs text-dash-text-muted hover:text-dash-text px-2 py-0.5 rounded border border-dash-border hover:border-dash-accent transition-colors",children:n("taxonomyResetProvider")})]}),c.jsx("div",{className:"overflow-hidden rounded border border-dash-border",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-dash-surface-hover/40 border-b border-dash-border",children:[c.jsx("th",{className:"text-left px-3 py-2 text-dash-text-secondary font-medium w-1/4",children:n("taxonomyTier")}),c.jsx("th",{className:"text-left px-3 py-2 text-dash-text-secondary font-medium",children:n("taxonomyModel")}),u&&c.jsx("th",{className:"text-left px-3 py-2 text-dash-text-secondary font-medium w-1/4",children:n("taxonomyEffort")})]})}),c.jsx("tbody",{children:Px.map(h=>{const f=d[h],p=Dx(t,`modelTaxonomy.${l}.${h}.model`),m=Dx(t,`modelTaxonomy.${l}.${h}.effort`);return c.jsxs("tr",{className:"border-b border-dash-border last:border-0",children:[c.jsx("td",{className:"px-3 py-2 text-dash-text-secondary",children:a(h)}),c.jsx("td",{className:"px-3 py-2",children:c.jsx("input",{type:"text",className:Ex,placeholder:f?.model??"",value:p??"",onChange:x=>i(l,h,"model",x.target.value)})}),u&&c.jsx("td",{className:"px-3 py-2",children:f?.effort!==void 0?c.jsx("input",{type:"text",className:Ex,placeholder:f.effort,value:m??"",onChange:x=>i(l,h,"effort",x.target.value)}):null})]},h)})})]})})]},l)})]})})]})},tT=(t,e)=>{const[n,r]=g.useState(null);return g.useEffect(()=>{const s=t.split(`
|
|
278
|
-
`),i=[];let o=null;for(let a=0;a<=Math.min(e,s.length-1);a++){const l=s[a].trim(),d=l.match(/"([^"]+)"\s*:\s*{/);if(d){i.push(d[1]),a===e&&(o=i.join("."));continue}if(l==="}"||l==="},"){i.pop();continue}const u=l.match(/"([^"]+)"\s*:/);if(u){const h=u[1];if(a===e){o=i.length>0?`${i.join(".")}.${h}`:h;break}}}r(o)},[t,e]),n};function Q2(t){const{scope:e,fetchConfig:n,fetchSchema:r,saveConfig:s,onReset:i}=t,[o,a]=g.useState("{}"),[l,d]=g.useState(0),[u,h]=g.useState(null),[f,p]=g.useState(null),[m,x]=g.useState({}),[b,y]=g.useState({}),[w,v]=g.useState({}),[k,C]=g.useState(!0),[N,S]=g.useState(null),[D,E]=g.useState("idle"),[M,P]=g.useState(!1),[A,R]=g.useState(null),[j,O]=g.useState(null),T=tT(o,l),$=X4(j,T),I=g.useMemo(()=>Y4($,f),[$,f]);g.useEffect(()=>{(async()=>{S(null);try{const[X,se]=await Promise.all([n(),r()]),ie=X.local??X.config;x(ie),y(X.global??{}),v(X.sources),p(se),a(JSON.stringify(ie,null,2))}catch(X){const se=X instanceof Error?X.message:String(X);console.error("Failed to load config data:",X),S(se)}finally{C(!1)}})()},[n,r]),g.useEffect(()=>{try{JSON.parse(o),h(null)}catch(G){h(G instanceof Error?G.message:"Invalid JSON")}},[o]),g.useEffect(()=>{if(A==="json")try{const G=JSON.parse(o);x(G)}catch{}},[o,A]);const B=g.useCallback(G=>{O(null),R("json"),a(G)},[]),V=g.useCallback(()=>{O(null)},[]),W=g.useCallback((G,X)=>{O(G),R("form"),x(se=>{const ie=G4(se,G,X);return a(JSON.stringify(ie,null,2)),ie}),v(se=>({...se,[G]:e}))},[e]),F=g.useCallback(async()=>{if(!u){E("saving");try{const G=JSON.parse(o),se=await s(G)??G;x(se),a(JSON.stringify(se,null,2)),E("saved"),setTimeout(()=>E("idle"),2e3)}catch{E("error"),setTimeout(()=>E("idle"),3e3)}}},[o,u,s]),Q=g.useCallback(async()=>{if(P(!1),i){C(!0);try{const G=await i(),X=G.local??G.config;x(X),v(G.sources),a(JSON.stringify(X,null,2))}catch(G){console.error("Failed to reset:",G)}finally{C(!1)}}else{const G={};x(G),a(JSON.stringify(G,null,2))}},[i]);return{jsonText:o,config:m,globalConfig:b,sources:w,schema:f,isLoading:k,loadError:N,saveStatus:D,syntaxError:u,cursorLine:l,showResetConfirm:M,activeFieldPath:$,fieldDoc:I,handleJsonChange:B,handleJsonEditorFocus:V,handleFormChange:W,handleSave:F,handleReset:Q,setCursorLine:d,setFocusedFieldPath:O,setShowResetConfirm:P}}function cm({storageKey:t,defaultSizes:e,minSizes:n}){const[r,s]=g.useState(()=>{if(typeof window>"u")return e;const d=localStorage.getItem(t);if(d)try{const u=JSON.parse(d);if(Array.isArray(u)&&u.length===e.length){const h=u.reduce((f,p)=>f+p,0);if(Math.abs(h-100)<1)return u}}catch{}return e}),[i,o]=g.useState(!1);g.useEffect(()=>{localStorage.setItem(t,JSON.stringify(r))},[r,t]);const a=g.useCallback((d,u)=>{u.preventDefault(),o(!0);let h=u.currentTarget.parentElement;for(;h&&getComputedStyle(h).display!=="flex";)h=h.parentElement;if(!h)return;const p=h.getBoundingClientRect().width,m=u.clientX,x=[...r],b=w=>{const k=(w.clientX-m)/p*100,C=[...x],N=d,S=d+1;let D=x[N]+k,E=x[S]-k;D<n[N]&&(D=n[N],E=x[N]+x[S]-D),E<n[S]&&(E=n[S],D=x[N]+x[S]-E),C[N]=D,C[S]=E,s(C)},y=()=>{o(!1),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",y),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",b),document.addEventListener("mouseup",y),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[r,n]),l=g.useCallback(()=>{s(e)},[e]);return{sizes:r,isDragging:i,startDrag:a,reset:l}}const hl="/api";async function Ox(t){const e=`${hl}/ck-config`,n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch ck-config: ${n.status}`);return n.json()}async function Gf(t,e){const n=new URLSearchParams({scope:t});e&&n.set("projectId",e);const r=await fetch(`${hl}/ck-config?${n}`);if(!r.ok)throw new Error(`Failed to fetch ck-config: ${r.status}`);return r.json()}async function J2(t){const e=await fetch(`${hl}/ck-config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.json().catch(()=>({error:"Unknown error"}));throw new Error(n.error||`Failed to save ck-config: ${e.status}`)}return e.json()}async function Z2(){const t=await fetch(`${hl}/ck-config/schema`);if(!t.ok)throw new Error(`Failed to fetch schema: ${t.status}`);return t.json()}async function nT(t,e,n,r){const s=await fetch(`${hl}/ck-config/field`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:n,projectId:r,fieldPath:t,value:e})});if(!s.ok){const i=await s.json().catch(()=>({error:"Unknown error"}));throw new Error(i.error||`Failed to update field: ${s.status}`)}}function rT(t,e,n,r){const[s,i]=g.useState(()=>{if(typeof window>"u")return e;const d=localStorage.getItem(t);if(d){const u=Number.parseFloat(d);if(!Number.isNaN(u)&&u>=n&&u<=100-r)return u}return e}),[o,a]=g.useState(!1),l=g.useCallback(d=>{d.preventDefault(),a(!0);const u=d.target.closest("[data-vresize-container]");if(!u)return;const h=p=>{const m=u.getBoundingClientRect(),x=(p.clientY-m.top)/m.height*100;i(Math.max(n,Math.min(100-r,x)))},f=()=>{a(!1),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",h),document.addEventListener("mouseup",f),document.body.style.cursor="row-resize",document.body.style.userSelect="none"},[n,r]);return g.useEffect(()=>{localStorage.setItem(t,String(s))},[t,s]),{topPct:s,isDragging:o,startDrag:l}}const sT=()=>{const{t}=ne(),e=Lt(),{sizes:n,isDragging:r,startDrag:s}=cm({storageKey:"claudekit-global-config-panels",defaultSizes:[35,40,25],minSizes:[20,25,15]}),i=rT("claudekit-form-taxonomy-split",70,25,15),o=g.useCallback(async()=>await Ox(),[]),a=g.useCallback(async f=>{await J2({scope:"global",config:f})},[]),l=g.useCallback(async()=>await Ox(),[]),d=Q2({scope:"global",fetchConfig:o,fetchSchema:Z2,saveConfig:a,onReset:l}),u=g.useMemo(()=>[{id:"general",title:t("sectionGeneral"),fields:[{path:"codingLevel",label:t("fieldCodingLevel"),description:t("fieldCodingLevelDesc")},{path:"statusline",label:t("fieldStatusline"),description:t("fieldStatuslineDesc")},{path:"statuslineColors",label:t("fieldStatuslineColors"),description:t("fieldStatuslineColorsDesc")},{path:"locale.thinkingLanguage",label:t("fieldThinkingLanguage"),description:t("fieldThinkingLanguageDesc")},{path:"locale.responseLanguage",label:t("fieldResponseLanguage"),description:t("fieldResponseLanguageDesc")}]},{id:"paths",title:t("sectionPaths"),fields:[{path:"paths.docs",label:t("fieldDocsPath"),description:t("fieldDocsPathDesc")},{path:"paths.plans",label:t("fieldPlansPath"),description:t("fieldPlansPathDesc")},{path:"paths.globalPlans",label:t("fieldGlobalPlansPath"),description:t("fieldGlobalPlansPathDesc")}]},{id:"privacy",title:t("sectionPrivacy"),defaultCollapsed:!0,fields:[{path:"privacyBlock",label:t("fieldPrivacyBlock"),description:t("fieldPrivacyBlockDesc")},{path:"trust.enabled",label:t("fieldTrustEnabled"),description:t("fieldTrustEnabledDesc")},{path:"trust.passphrase",label:t("fieldTrustPassphrase"),description:t("fieldTrustPassphraseDesc")}]},{id:"project",title:t("sectionProject"),defaultCollapsed:!0,fields:[{path:"project.type",label:t("fieldProjectType"),description:t("fieldProjectTypeDesc")},{path:"project.packageManager",label:t("fieldPackageManager"),description:t("fieldPackageManagerDesc")},{path:"project.framework",label:t("fieldFramework"),description:t("fieldFrameworkDesc")}]},{id:"integrations",title:t("sectionIntegrations"),defaultCollapsed:!0,fields:[{path:"gemini.model",label:t("fieldGeminiModel"),description:t("fieldGeminiModelDesc")},{path:"skills.research.useGemini",label:t("fieldResearchUseGemini"),description:t("fieldResearchUseGeminiDesc")}]},{id:"hooks",title:t("sectionHooks"),defaultCollapsed:!0,fields:[{path:"hooks.session-init",label:t("fieldHookSessionInit"),description:t("fieldHookSessionInitDesc")},{path:"hooks.subagent-init",label:t("fieldHookSubagentInit"),description:t("fieldHookSubagentInitDesc")},{path:"hooks.descriptive-name",label:t("fieldHookDescriptiveName"),description:t("fieldHookDescriptiveNameDesc")},{path:"hooks.dev-rules-reminder",label:t("fieldHookDevRulesReminder"),description:t("fieldHookDevRulesReminderDesc")},{path:"hooks.usage-context-awareness",label:t("fieldHookUsageContextAwareness"),description:t("fieldHookUsageContextAwarenessDesc")},{path:"hooks.context-tracking",label:t("fieldHookContextTracking"),description:t("fieldHookContextTrackingDesc")},{path:"hooks.scout-block",label:t("fieldHookScoutBlock"),description:t("fieldHookScoutBlockDesc")},{path:"hooks.privacy-block",label:t("fieldHookPrivacyBlock"),description:t("fieldHookPrivacyBlockDesc")},{path:"hooks.simplify-gate",label:t("fieldHookSimplifyGate"),description:t("fieldHookSimplifyGateDesc")}]},{id:"simplify",title:t("sectionSimplify"),defaultCollapsed:!0,fields:[{path:"simplify.threshold.locDelta",label:t("fieldSimplifyThresholdLocDelta"),description:t("fieldSimplifyThresholdLocDeltaDesc")},{path:"simplify.threshold.fileCount",label:t("fieldSimplifyThresholdFileCount"),description:t("fieldSimplifyThresholdFileCountDesc")},{path:"simplify.threshold.singleFileLoc",label:t("fieldSimplifyThresholdSingleFileLoc"),description:t("fieldSimplifyThresholdSingleFileLocDesc")},{path:"simplify.gate.enabled",label:t("fieldSimplifyGateEnabled"),description:t("fieldSimplifyGateEnabledDesc")},{path:"simplify.gate.hardVerbs",label:t("fieldSimplifyGateHardVerbs"),description:t("fieldSimplifyGateHardVerbsDesc")},{path:"simplify.gate.softVerbs",label:t("fieldSimplifyGateSoftVerbs"),description:t("fieldSimplifyGateSoftVerbsDesc")}]},{id:"advanced",title:t("sectionAdvanced"),defaultCollapsed:!0,fields:[{path:"docs.maxLoc",label:t("fieldDocsMaxLoc"),description:t("fieldDocsMaxLocDesc")},{path:"plan.namingFormat",label:t("fieldPlanNamingFormat"),description:t("fieldPlanNamingFormatDesc")},{path:"plan.dateFormat",label:t("fieldPlanDateFormat"),description:t("fieldPlanDateFormatDesc")},{path:"plan.validation.mode",label:t("fieldPlanValidationMode"),description:t("fieldPlanValidationModeDesc")},{path:"plan.validation.minQuestions",label:t("fieldPlanMinQuestions"),description:t("fieldPlanMinQuestionsDesc")},{path:"plan.validation.maxQuestions",label:t("fieldPlanMaxQuestions"),description:t("fieldPlanMaxQuestionsDesc")},{path:"assertions",label:t("fieldAssertions"),description:t("fieldAssertionsDesc")}]}],[t]),h=d.showResetConfirm?c.jsxs("div",{className:"flex items-center gap-2 bg-red-500/10 border border-red-500/30 rounded-lg px-2 py-1 animate-in fade-in duration-200",children:[c.jsx("span",{className:"text-xs text-red-500 font-medium",children:t("confirmReset")}),c.jsx("button",{type:"button",onClick:d.handleReset,className:"px-2 py-0.5 rounded bg-red-500 text-white text-xs font-bold hover:bg-red-600 transition-colors",children:t("confirm")}),c.jsx("button",{type:"button",onClick:()=>d.setShowResetConfirm(!1),className:"px-2 py-0.5 rounded bg-dash-surface text-dash-text-secondary text-xs font-bold hover:bg-dash-surface-hover transition-colors border border-dash-border",children:t("cancel")})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>d.setShowResetConfirm(!0),className:"px-3 py-1.5 rounded-lg bg-dash-surface text-xs font-bold text-dash-text-secondary hover:bg-dash-surface-hover transition-colors border border-dash-border",children:t("resetToDefault")}),c.jsx("button",{type:"button",onClick:d.handleSave,disabled:!!d.syntaxError||d.saveStatus==="saving",className:`px-3 py-1.5 rounded-lg text-xs font-bold transition-all tracking-widest uppercase ${d.syntaxError?"bg-dash-surface text-dash-text-muted cursor-not-allowed border border-dash-border":d.saveStatus==="saved"?"bg-green-500 text-white shadow-lg shadow-green-500/20":d.saveStatus==="error"?"bg-red-500 text-white":"bg-dash-accent text-dash-bg hover:bg-dash-accent-hover shadow-lg shadow-dash-accent/20"}`,children:d.saveStatus==="saving"?t("saving"):d.saveStatus==="saved"?t("saved"):d.saveStatus==="error"?t("saveFailed"):t("saveChanges")})]});return c.jsxs("div",{className:"animate-in fade-in duration-300 w-full h-full flex flex-col transition-colors",children:[c.jsx(Qv,{title:t("globalConfig"),filePath:"~/.claude/.ck.json",onBack:()=>e(-1),onSave:d.handleSave,onReset:d.handleReset,saveStatus:d.saveStatus,syntaxError:d.syntaxError,showResetConfirm:d.showResetConfirm,setShowResetConfirm:d.setShowResetConfirm,showActions:!1,showFilePath:!1}),!d.isLoading&&d.loadError&&c.jsxs("div",{className:"mx-4 mt-2 px-3 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-xs text-red-500",children:[c.jsx("p",{className:"font-medium",children:t("configLoadFailed")}),c.jsxs("p",{className:"mt-1 break-words",children:[t("configLoadFailedDetail")," ",d.loadError]})]}),c.jsx("div",{className:"flex-1 flex min-h-0",children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{"data-vresize-container":!0,style:{width:`${n[0]}%`},className:"flex flex-col min-w-0 min-h-0",children:[c.jsx("div",{style:{height:`${d.isLoading?100:i.topPct}%`},className:"min-h-0",children:c.jsx(t1,{width:100,isLoading:d.isLoading,schema:d.schema,config:d.config,sources:d.sources,sections:u,onChange:d.handleFormChange})}),!d.isLoading&&c.jsxs(c.Fragment,{children:[c.jsx(kn,{direction:"vertical",isDragging:i.isDragging,onMouseDown:i.startDrag}),c.jsx("div",{style:{height:`${100-i.topPct}%`},className:"min-h-0",children:c.jsx(eT,{config:d.config,onChange:d.handleFormChange})})]})]}),c.jsx(kn,{direction:"horizontal",isDragging:r,onMouseDown:f=>s(0,f)}),c.jsx(lm,{width:n[1],isLoading:d.isLoading,jsonText:d.jsonText,cursorLine:d.cursorLine,syntaxError:d.syntaxError,onChange:d.handleJsonChange,onCursorLineChange:d.setCursorLine,headerPath:"~/.claude/.ck.json",headerActions:h}),c.jsx(kn,{direction:"horizontal",isDragging:r,onMouseDown:f=>s(1,f)}),c.jsx(X2,{width:n[2],fieldDoc:d.fieldDoc,activeFieldPath:d.activeFieldPath})]})})]})};function iT(t){const e=t.replace(/\\/g,"/"),n=e.split("/").filter(Boolean);return n.length<3?null:`${e.startsWith("/")?"/":""}${n.slice(0,-2).join("/")}`}function oT(){const[t]=sl(),e=t.get("projectId"),n=t.get("file"),r=n?iT(n):null,s=new URLSearchParams;return r&&(s.set("dir",r),s.set("view","kanban"),e&&s.set("projectId",e)),c.jsx(Av,{replace:!0,to:r?`/plans?${s.toString()}`:"/plans"})}function aT(){const[t,e]=g.useState([]),[n,r]=g.useState(!0),[s,i]=g.useState(null),o=g.useCallback(async()=>{try{r(!0),i(null);const a=await fetch("/api/mcp-servers");if(!a.ok)throw new Error(`Failed to fetch MCP servers: ${a.status}`);const l=await a.json();e(l.servers??[])}catch(a){i(a instanceof Error?a.message:"Failed to load MCP servers"),e([])}finally{r(!1)}},[]);return g.useEffect(()=>{o()},[o]),{servers:t,loading:n,error:s,reload:o}}function lT(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5 shrink-0 text-dash-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M12 5l7 7-7 7"})})}function cT({label:t,count:e}){return c.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[c.jsx("span",{className:"text-xs font-bold text-dash-text-muted uppercase tracking-wider flex-1",children:t}),c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-dash-accent-subtle text-dash-accent font-semibold",children:e})]})}function dT({server:t,selected:e,onClick:n}){return c.jsxs("button",{type:"button",onClick:n,className:["w-full flex items-start gap-2 px-3 py-2 rounded-md transition-colors text-left group",e?"bg-dash-accent/10 border border-dash-accent/30":"hover:bg-dash-surface-hover border border-transparent"].join(" "),children:[c.jsx(lT,{}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"text-sm font-semibold text-dash-accent font-mono",children:t.name}),c.jsx("p",{className:"text-xs text-dash-text-muted mt-0.5 truncate font-mono",children:t.command})]})]})}function uT({server:t}){const{t:e}=ne();return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("h2",{className:"text-base font-semibold text-dash-text font-mono truncate flex-1",children:t.name}),c.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-dash-accent-subtle text-dash-accent font-semibold shrink-0",children:e("sessionReadOnly")})]}),c.jsx("div",{className:"flex items-center gap-2 text-xs text-dash-text-muted",children:c.jsx("span",{className:"font-mono px-2 py-0.5 rounded bg-dash-surface border border-dash-border text-dash-accent",children:t.sourceLabel})}),c.jsx("div",{className:"rounded-lg border border-dash-border bg-dash-surface p-5 overflow-x-auto",children:c.jsx("table",{className:"w-full text-sm",children:c.jsxs("tbody",{children:[c.jsxs("tr",{className:"border-b border-dash-border",children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 shrink-0 align-top",children:e("mcpCommand")}),c.jsx("td",{className:"py-2 font-mono text-xs text-dash-text break-all",children:t.command})]}),t.args.length>0&&c.jsxs("tr",{className:"border-b border-dash-border",children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 align-top",children:e("mcpArgs")}),c.jsx("td",{className:"py-2 text-xs text-dash-text",children:c.jsx("div",{className:"flex flex-col gap-1",children:t.args.map((n,r)=>c.jsx("code",{className:"font-mono bg-dash-surface border border-dash-border rounded px-1.5 py-0.5 text-[11px] break-all",children:n},r))})})]}),t.env&&Object.keys(t.env).length>0&&c.jsxs("tr",{className:"border-b border-dash-border",children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 align-top",children:"env"}),c.jsx("td",{className:"py-2 text-xs text-dash-text",children:c.jsx("div",{className:"flex flex-col gap-1",children:Object.keys(t.env).map(n=>c.jsxs("code",{className:"font-mono bg-dash-surface border border-dash-border rounded px-1.5 py-0.5 text-[11px]",children:[n,"=",c.jsx("span",{className:"text-dash-text-muted",children:"***"})]},n))})})]}),c.jsxs("tr",{children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 align-top",children:e("mcpSource")}),c.jsx("td",{className:"py-2 text-xs text-dash-text font-mono",children:t.sourceLabel})]})]})})})]})}const hT=({message:t})=>c.jsx("div",{className:"flex items-center justify-center h-full text-sm text-dash-text-muted",children:t}),fT=()=>{const{t}=ne(),{servers:e,loading:n,error:r}=aT(),[s,i]=g.useState(""),[o,a]=g.useState(null),{size:l,isDragging:d,startDrag:u}=$i({storageKey:"ck-mcp-panel-width",defaultSize:380,minSize:260,maxSize:650}),h=x=>`${x.source}-${x.name}`,f=e.find(x=>h(x)===o)??null,p=g.useMemo(()=>{if(!s.trim())return e;const x=s.toLowerCase();return e.filter(b=>b.name.toLowerCase().includes(x)||b.command.toLowerCase().includes(x)||b.sourceLabel.toLowerCase().includes(x))},[e,s]),m=g.useMemo(()=>{const x=new Map;for(const b of p){const y=x.get(b.sourceLabel)??[];y.push(b),x.set(b.sourceLabel,y)}return x},[p]);return c.jsxs("div",{className:"flex h-full overflow-hidden",children:[c.jsxs("div",{style:{width:`${l}px`},className:"shrink-0 flex flex-col overflow-hidden border-r border-dash-border",children:[c.jsxs("div",{className:"shrink-0 px-4 pt-4 pb-3 border-b border-dash-border",children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-base font-bold text-dash-text",children:t("mcpTitle")}),!n&&!r&&c.jsx("p",{className:"text-xs text-dash-text-muted mt-0.5",children:e.length===0?t("mcpNoServers"):`${e.length} ${e.length===1?"server":"servers"} configured`}),c.jsx("p",{className:"text-[11px] text-dash-text-muted font-mono mt-0.5",children:"~/.claude.json + settings.json + .mcp.json"})]}),c.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-dash-accent-subtle text-dash-accent font-semibold shrink-0",children:t("sessionReadOnly")})]}),c.jsxs("div",{className:"relative",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-dash-text-muted pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),c.jsx("input",{type:"text",value:s,onChange:x=>i(x.target.value),placeholder:t("mcpServerName"),className:"w-full pl-9 pr-4 py-2 text-sm bg-dash-surface border border-dash-border rounded-lg text-dash-text placeholder:text-dash-text-muted focus:outline-none focus:border-dash-accent/50 transition-colors"}),s&&c.jsx("button",{type:"button",onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-dash-text-muted hover:text-dash-text transition-colors",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[n&&c.jsx("div",{className:"flex flex-1 items-center justify-center text-dash-text-muted text-sm p-8",children:t("loading")}),!n&&r&&c.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 dark:bg-red-900/20 p-4 text-red-600 dark:text-red-400 text-sm m-2",children:r}),!n&&!r&&m.size===0&&c.jsx("div",{className:"flex items-center justify-center p-8 text-dash-text-muted text-sm",children:t("mcpNoServers")}),!n&&!r&&m.size>0&&c.jsx("div",{className:"flex flex-col gap-2 pb-4",children:Array.from(m.entries()).map(([x,b])=>c.jsxs("div",{children:[m.size>1&&c.jsx(cT,{label:x,count:b.length}),c.jsx("div",{className:"space-y-0.5",children:b.map(y=>{const w=h(y);return c.jsx(dT,{server:y,selected:o===w,onClick:()=>a(w)},w)})})]},x))})]})]}),c.jsx(kn,{onMouseDown:u,isDragging:d,direction:"horizontal"}),c.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:f?c.jsx(uT,{server:f}):c.jsx(hT,{message:t("selectToView")})})]})};function sa(t){return`${t.provider}::${t.type}::${t.item}::${String(t.global)}`}const pT=["agent","command","skill","config","rules","hooks"],mT={agent:"migrateTypeAgents",command:"migrateTypeCommands",skill:"migrateTypeSkills",config:"migrateTypeConfig",rules:"migrateTypeRules",hooks:"migrateTypeHooks"},gT={agent:"border-dash-accent/30 text-dash-accent",command:"border-yellow-500/30 text-yellow-400",skill:"border-purple-500/30 text-purple-400",config:"border-teal-500/30 text-teal-400",rules:"border-rose-500/30 text-rose-400",hooks:"border-cyan-500/30 text-cyan-400"},xT=({type:t,candidates:e,selected:n,onToggleItem:r,onSelectAll:s,onDeselectAll:i})=>{const{t:o}=ne(),a=g.useMemo(()=>e.map(sa),[e]),l=a.filter(f=>n.has(f)).length,d=l===a.length,u=gT[t],h=o(mT[t]);return c.jsxs("div",{className:"border border-dash-border rounded-lg bg-dash-surface overflow-hidden",children:[c.jsxs("div",{className:"px-4 py-2.5 flex items-center justify-between border-b border-dash-border bg-dash-bg",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h4",{className:"text-sm font-semibold text-dash-text",children:h}),c.jsxs("span",{className:`px-2 py-0.5 text-xs rounded-md border ${u}`,children:[l,"/",e.length]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",onClick:()=>s(a),disabled:d,className:"dash-focus-ring px-2.5 py-1 text-[11px] rounded border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:o("migrateInstallSelectAll")}),c.jsx("button",{type:"button",onClick:()=>i(a),disabled:l===0,className:"dash-focus-ring px-2.5 py-1 text-[11px] rounded border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:o("migrateInstallDeselectAll")})]})]}),c.jsx("div",{className:"divide-y divide-dash-border/50",children:e.map(f=>{const p=sa(f),m=n.has(p);return c.jsxs("label",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-dash-surface-hover cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:m,onChange:()=>r(p),className:"h-4 w-4 rounded border-dash-border accent-dash-accent","aria-label":`${f.item} from ${f.provider}`}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("span",{className:"text-sm font-mono text-dash-text truncate",children:f.item}),f.isDirectoryItem&&c.jsx("span",{className:"text-[10px] uppercase px-1.5 py-0.5 rounded border border-purple-500/30 text-purple-400",children:o("migrateInstallDirItem")}),f.alreadyInstalled&&c.jsx("span",{className:"text-[10px] uppercase px-1.5 py-0.5 rounded border border-dash-border text-dash-text-muted",children:o("migrateInstallAlreadyInstalled")})]}),c.jsx("div",{className:"text-[11px] text-dash-text-muted mt-0.5",children:f.provider})]}),f.description&&c.jsx("p",{className:"hidden md:block text-xs text-dash-text-secondary max-w-[200px] truncate shrink-0",children:f.description})]},p)})})]})},bT=({candidates:t,selected:e,onSelectionChange:n,onInstall:r,isInstalling:s=!1})=>{const{t:i}=ne(),o=g.useMemo(()=>{const p=new Map;for(const m of t){const x=p.get(m.type)??[];x.push(m),p.set(m.type,x)}return pT.filter(m=>(p.get(m)?.length??0)>0).map(m=>({type:m,candidates:p.get(m)??[]}))},[t]),a=g.useMemo(()=>t.map(sa),[t]),l=g.useCallback(p=>{const m=new Set(e);m.has(p)?m.delete(p):m.add(p),n(m)},[e,n]),d=g.useCallback(p=>{const m=new Set(e);for(const x of p)m.add(x);n(m)},[e,n]),u=g.useCallback(p=>{const m=new Set(e);for(const x of p)m.delete(x);n(m)},[e,n]),h=g.useCallback(()=>{n(new Set(a))},[a,n]),f=g.useCallback(()=>{n(new Set)},[n]);return t.length===0?c.jsx("div",{className:"dash-panel p-8 text-center",children:c.jsx("p",{className:"text-dash-text-muted text-sm",children:i("migrateInstallNoCandidates")})}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[c.jsx("p",{className:"text-sm text-dash-text-secondary",children:i("migrateInstallSelectedCount").replace("{count}",String(e.size)).replace("{total}",String(t.length))}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",onClick:h,disabled:e.size===t.length,className:"dash-focus-ring px-3 py-1.5 text-xs rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:i("migrateInstallSelectAll")}),c.jsx("button",{type:"button",onClick:f,disabled:e.size===0,className:"dash-focus-ring px-3 py-1.5 text-xs rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:i("migrateInstallDeselectAll")})]})]}),o.map(({type:p,candidates:m})=>c.jsx(xT,{type:p,candidates:m,selected:e,onToggleItem:l,onSelectAll:d,onDeselectAll:u},p)),c.jsx("div",{className:"flex items-center justify-end pt-2",children:c.jsx("button",{type:"button",disabled:e.size===0||s,onClick:()=>r(e),className:"dash-focus-ring px-6 py-2.5 bg-dash-accent text-white rounded-md text-sm font-semibold hover:bg-dash-accent/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:s?i("migrateInstallInstalling"):i("migrateInstallCta").replace("{count}",String(e.size))})})]})};function yT(t){return new Set(t.map(sa))}function vT(t,e){const n=t.filter(l=>e.has(sa(l))),r=n.map(l=>({action:"install",item:l.item,type:l.type,provider:l.provider,global:l.global,targetPath:l.registryPath??l.sourcePath,reason:"User-selected install",reasonCode:"new-item",isDirectoryItem:l.isDirectoryItem})),s=l=>({agent:"agents",command:"commands",skill:"skills",config:"config",rules:"rules",hooks:"hooks"})[l],i={agents:!1,commands:!1,skills:!1,config:!1,rules:!1,hooks:!1},o={agents:[],commands:[],skills:[],config:[],rules:[],hooks:[]},a=new Set;for(const l of n){const d=s(l.type);i[d]=!0,o[d].push(l.item),a.add(l.provider)}return{actions:r,summary:{install:r.length,update:0,skip:0,conflict:0,delete:0},hasConflicts:!1,banners:[],meta:{include:i,providers:Array.from(a),items:o,mode:"install"}}}const Mx=[{key:"agent",labelKey:"migrateTypeAgents",badgeClass:"border-dash-accent/30 text-dash-accent"},{key:"command",labelKey:"migrateTypeCommands",badgeClass:"border-yellow-500/30 text-yellow-400"},{key:"skill",labelKey:"migrateTypeSkills",badgeClass:"border-purple-500/30 text-purple-400"},{key:"config",labelKey:"migrateTypeConfig",badgeClass:"border-teal-500/30 text-teal-400"},{key:"rules",labelKey:"migrateTypeRules",badgeClass:"border-rose-500/30 text-rose-400"},{key:"hooks",labelKey:"migrateTypeHooks",badgeClass:"border-cyan-500/30 text-cyan-400"}],wT=new Set([8203,8204,8205,8288,65279,8232,8233,8234,8235,8236,8237,8238,8294,8295,8296,8297]);function kT(t){return t===9||t===10||t===13?!0:t>=0&&t<=8||t>=11&&t<=31||t>=127&&t<=159||wT.has(t)}function gs(t){let e="";for(const n of t){const r=n.codePointAt(0);r!==void 0&&(kT(r)||(e+=n))}return e}function Ax(t){if(!t)return"-";const e=t.replace(/\\/g,"/"),n=e.match(/.*\/(\.[^/]+\/)/);if(n?.[1]){const s=(n.index??0)+n[0].length-n[1].length;return e.slice(s)}const r=e.split("/");return r.length>3?`.../${r.slice(-3).join("/")}`:e}function ri(t){return t.success?t.skipped?"skipped":"installed":"failed"}function ST(t){const e={installed:0,skipped:0,failed:0};for(const n of t){const r=ri(n);r==="installed"?e.installed+=1:r==="skipped"?e.skipped+=1:e.failed+=1}return e}function ek(t){switch(t){case"agent":case"command":case"skill":case"config":case"rules":case"hooks":case"unknown":return t;default:return"unknown"}}function CT(t,e){switch(t){case"failed":return{label:e("migrateStatusFailed"),className:"border-red-500/30 bg-red-500/10 text-red-400"};case"skipped":return{label:e("migrateStatusSkipped"),className:"border-yellow-500/30 bg-yellow-500/10 text-yellow-400"};default:return{label:e("migrateStatusInstalled"),className:"border-green-500/30 bg-green-500/10 text-green-400"}}}function jT(t){const e=new Map;for(const n of t){const r=ek(n.portableType),s=e.get(r)||[];s.push(n),e.set(r,s)}return e}function NT(t){return[ek(t.portableType),t.provider,t.providerDisplayName,t.itemName,t.path,t.success,t.skipped,t.overwritten,t.error,t.skipReason].map(n=>n===void 0?"":String(n)).join("|")}function PT(t){if(t.length===0)return!0;const e=t[0].provider;return t.every(n=>n.provider===e)}const pi=({label:t,count:e,className:n})=>e<=0?null:c.jsxs("span",{className:`inline-flex items-center gap-1 rounded-md border px-2.5 py-1 text-xs ${n}`,children:[c.jsx("span",{className:"font-semibold",children:e}),c.jsx("span",{children:t})]}),Tx=({labelKey:t,badgeClass:e,items:n,isExpanded:r,onToggle:s,singleProvider:i})=>{const{t:o}=ne(),a=n.filter(f=>ri(f)==="installed").length,l=n.filter(f=>ri(f)==="skipped").length,d=n.filter(f=>ri(f)==="failed").length,u=i?"md:grid-cols-[minmax(0,1.5fr)_minmax(0,1.35fr)_auto_minmax(0,1fr)]":"md:grid-cols-[minmax(0,1.2fr)_minmax(0,0.8fr)_minmax(0,1.2fr)_auto_minmax(0,1fr)]",h=new Map;return c.jsxs("div",{className:"rounded-xl border border-dash-border bg-dash-surface overflow-hidden",children:[c.jsxs("button",{type:"button",onClick:s,className:"w-full flex flex-wrap items-center gap-2 px-4 py-3 text-left hover:bg-dash-surface-hover transition-colors",children:[c.jsx("svg",{className:`w-3.5 h-3.5 text-dash-text-muted transition-transform ${r?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:c.jsx("path",{d:"M9 5l7 7-7 7"})}),c.jsx("p",{className:"text-sm font-semibold text-dash-text",children:o(t)}),c.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-semibold ${e}`,children:n.length}),c.jsx("span",{className:"hidden sm:block flex-1"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px]",children:[c.jsx(pi,{label:o("migrateStatusInstalled"),count:a,className:"border-green-500/30 bg-green-500/10 text-green-400"}),c.jsx(pi,{label:o("migrateStatusSkipped"),count:l,className:"border-yellow-500/30 bg-yellow-500/10 text-yellow-400"}),c.jsx(pi,{label:o("migrateStatusFailed"),count:d,className:"border-red-500/30 bg-red-500/10 text-red-400"})]})]}),r&&c.jsxs("div",{className:"border-t border-dash-border/80",children:[c.jsxs("div",{className:`hidden md:grid ${u} items-center gap-3 px-4 py-2 border-b border-dash-border/70 text-[10px] font-semibold uppercase tracking-wide text-dash-text-muted`,children:[c.jsx("p",{children:o("migrateItem")}),!i&&c.jsx("p",{children:o("migrateProvider")}),c.jsx("p",{children:o("migratePath")}),c.jsx("p",{children:o("migrateStatus")}),c.jsx("p",{children:o("migrateError")})]}),c.jsx("div",{className:"divide-y divide-dash-border/70",children:n.map(f=>{const p=NT(f),m=h.get(p)??0;h.set(p,m+1);const x=m===0?p:`${p}#${m}`,b=ri(f),y=CT(b,o),w=gs(f.itemName||Ax(f.path)),v=gs(f.providerDisplayName||f.provider||""),k=gs(f.path||""),C=gs(Ax(f.path)),N=gs(f.error||f.skipReason||"");return c.jsxs("div",{className:`grid gap-1.5 ${u} items-start px-4 py-2.5 hover:bg-dash-bg/60 transition-colors`,children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold text-dash-text truncate",title:w,children:w}),c.jsxs("div",{className:"mt-0.5 space-y-0.5 md:hidden",children:[!i&&c.jsx("p",{className:"text-[11px] text-dash-text-secondary truncate",children:v}),c.jsx("p",{className:"font-mono text-[11px] text-dash-text-muted truncate",title:k,children:C}),N&&c.jsx("p",{className:"text-[11px] text-red-400/80 line-clamp-2",title:N,children:N})]})]}),!i&&c.jsx("p",{className:"hidden md:block text-[11px] text-dash-text-secondary truncate",children:v}),c.jsx("p",{className:"hidden md:block font-mono text-[11px] text-dash-text-muted truncate",title:k,children:C}),c.jsx("span",{className:`inline-flex w-fit items-center rounded-full border px-2 py-0.5 text-[11px] font-medium ${y.className}`,children:y.label}),c.jsx("p",{className:`hidden md:block text-[11px] truncate ${N?"text-red-400/80":"text-dash-text-muted"}`,title:N,children:N||"-"})]},x)})})]})]})},DT=({results:t,onReset:e})=>{const{t:n}=ne(),[r,s]=g.useState(""),i=g.useDeferredValue(r),[o,a]=g.useState("all"),[l,d]=g.useState(()=>new Set(Mx.map(k=>k.key))),u=g.useMemo(()=>{const k=i.trim().toLowerCase();return t.results.filter(C=>{if(o!=="all"&&ri(C)!==o)return!1;if(!k)return!0;const N=(C.itemName||"").toLowerCase(),S=(C.path||"").toLowerCase(),D=(C.providerDisplayName||C.provider||"").toLowerCase();return N.includes(k)||S.includes(k)||D.includes(k)})},[t.results,i,o]),h=g.useMemo(()=>PT(u),[u]),f=g.useMemo(()=>{if(!h||u.length===0)return"";const k=Array.from(new Set(u.map(C=>C.providerDisplayName?.trim()||"").filter(C=>C.length>0)));return k.length===1?k[0]:u[0]?.provider||""},[u,h]),p=g.useMemo(()=>jT(u),[u]),m=g.useMemo(()=>ST(t.results),[t.results]),x=g.useMemo(()=>[...p.keys()],[p]),b=m.installed+m.skipped+m.failed,y=x.length>0&&x.every(k=>l.has(k)),w=k=>{d(C=>{const N=new Set(C);return N.has(k)?N.delete(k):N.add(k),N})},v=()=>{if(y){d(new Set);return}d(new Set(x))};return c.jsxs("div",{className:"dash-panel p-4 md:p-5 space-y-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-base font-semibold text-dash-text",children:[n("migrateSummaryTitle"),h&&f&&c.jsxs("span",{className:"text-dash-text-muted font-normal",children:[" ","· ",gs(f)]})]}),c.jsxs("p",{className:"text-xs text-dash-text-muted mt-1",children:[b," ",n("migrateSummarySubtitle")]})]}),c.jsx("button",{type:"button",onClick:e,className:"dash-focus-ring px-4 py-2 text-sm font-semibold rounded-md bg-dash-bg border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover",children:n("migrateSummaryNewMigration")})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[c.jsx(pi,{label:n("migrateStatusInstalled"),count:m.installed,className:"border-green-500/30 bg-green-500/10 text-green-400"}),c.jsx(pi,{label:n("migrateStatusSkipped"),count:m.skipped,className:"border-yellow-500/30 bg-yellow-500/10 text-yellow-400"}),c.jsx(pi,{label:n("migrateStatusFailed"),count:m.failed,className:"border-red-500/30 bg-red-500/10 text-red-400"})]}),t.warnings.length>0&&c.jsx("div",{className:"space-y-2",children:t.warnings.map((k,C)=>c.jsx("div",{className:"px-3 py-2 border border-yellow-500/30 bg-yellow-500/10 rounded-md text-xs text-yellow-400",children:gs(k)},C))}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 stroke-dash-text-muted",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"11",cy:"11",r:"8"}),c.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),c.jsx("input",{type:"text",value:r,onChange:k=>s(k.target.value),placeholder:n("migrateSummarySearchPlaceholder"),className:"dash-focus-ring w-full pl-9 pr-3 py-2 bg-dash-bg border border-dash-border rounded-lg text-dash-text text-sm focus:border-dash-accent transition-colors"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[["all","installed","skipped","failed"].map(k=>{const C=k==="all"?"migrateSummaryFilterAll":k==="installed"?"migrateStatusInstalled":k==="skipped"?"migrateStatusSkipped":"migrateStatusFailed";return c.jsx("button",{type:"button",onClick:()=>a(k),className:`dash-focus-ring px-3 py-1 text-xs font-medium rounded-full border transition-colors ${o===k?"bg-dash-accent/10 border-dash-accent text-dash-accent":"border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover hover:text-dash-text"}`,children:n(C)},k)}),c.jsx("button",{type:"button",onClick:v,className:"dash-focus-ring ml-1 px-3 py-1 text-xs font-medium rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover",children:n(y?"migrateSummaryCollapseAll":"migrateSummaryExpandAll")})]})]}),u.length===0?c.jsx("div",{className:"text-center py-8 text-sm text-dash-text-muted",children:n("migrateSummaryNoResults")}):c.jsxs("div",{className:"space-y-2.5",children:[Mx.map(k=>{const C=p.get(k.key);return!C||C.length===0?null:c.jsx(Tx,{labelKey:k.labelKey,badgeClass:k.badgeClass,items:C,isExpanded:l.has(k.key),onToggle:()=>w(k.key),singleProvider:h},k.key)}),(()=>{const k=p.get("unknown");return!k||k.length===0?null:c.jsx(Tx,{labelKey:"migrateTypeUnknown",badgeClass:"border-dash-border text-dash-text-muted",items:k,isExpanded:l.has("unknown"),onToggle:()=>w("unknown"),singleProvider:h})})()]})]})},ET=({pendingCount:t,nextMode:e,onConfirm:n,onCancel:r})=>{const{t:s}=ne(),i=g.useRef(null);g.useEffect(()=>{const a=i.current;if(!a)return;a.open||a.showModal();const l=d=>{d.preventDefault(),r()};return a.addEventListener("cancel",l),()=>{a.removeEventListener("cancel",l),a.open&&a.close()}},[r]);const o=s(e==="install"?"migrateModeInstall":"migrateModeReconcile");return c.jsxs("dialog",{ref:i,"aria-labelledby":"mode-confirm-title","aria-describedby":"mode-confirm-body",onClick:a=>{a.target===a.currentTarget&&r()},className:"fixed inset-0 z-50 m-auto h-auto max-w-sm rounded-xl border border-dash-border bg-dash-surface p-6 shadow-2xl backdrop:bg-black/50",children:[c.jsx("h2",{id:"mode-confirm-title",className:"mb-2 text-base font-semibold text-dash-text",children:s("migrateModeConfirmTitle")}),c.jsx("p",{id:"mode-confirm-body",className:"mb-5 text-sm text-dash-text-secondary",children:s("migrateModeConfirmBody").replace("{count}",String(t)).replace("{mode}",o)}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:r,className:"dash-focus-ring px-4 py-2 text-sm font-medium rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover",children:s("cancel")}),c.jsx("button",{type:"button",autoFocus:!0,onClick:n,className:"dash-focus-ring px-4 py-2 text-sm font-semibold rounded-md bg-dash-accent text-white hover:bg-dash-accent/90",children:s("migrateModeConfirmSwitch")})]})]})},OT=({mode:t,pendingCount:e,disabled:n=!1,onModeChange:r})=>{const{t:s}=ne(),[i,o]=g.useState(null),a=g.useCallback(u=>{u===t||n||(e>0?o(u):r(u))},[t,n,e,r]),l=g.useCallback(()=>{i&&(r(i),o(null))},[i,r]),d=g.useCallback(()=>{o(null)},[]);return c.jsxs(c.Fragment,{children:[c.jsx("div",{role:"tablist","aria-label":s("migrateModeLabel"),className:"inline-flex rounded-lg border border-dash-border bg-dash-bg overflow-hidden",children:["reconcile","install"].map(u=>{const h=t===u,f=u==="reconcile"?"migrateModeReconcile":"migrateModeInstall",p=u==="reconcile"?"migrateModeReconcileDesc":"migrateModeInstallDesc";return c.jsxs("button",{type:"button",role:"tab","aria-selected":h,"aria-controls":`migrate-${u}-panel`,id:`migrate-${u}-tab`,disabled:n,onClick:()=>a(u),className:`px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-dash-accent disabled:opacity-50 disabled:cursor-not-allowed ${h?"bg-dash-accent-subtle text-dash-accent":"text-dash-text-secondary hover:bg-dash-surface-hover hover:text-dash-text"}`,children:[c.jsx("span",{className:"block",children:s(f)}),c.jsx("span",{className:"block text-[10px] font-normal opacity-70",children:s(p)})]},u)})}),i&&c.jsx(ET,{pendingCount:e,nextMode:i,onConfirm:l,onCancel:d})]})},MT=500;function AT(t){return t>=0&&t<=8||t>=11&&t<=31||t>=127&&t<=159}function TT(t){let e="";for(const n of t){const r=n.codePointAt(0);r!==void 0&&(AT(r)||(e+=n))}return e}const LT=({diff:t,className:e=""})=>{const n=t.split(`
|
|
294
|
+
`),i=[];let o=null;for(let a=0;a<=Math.min(e,s.length-1);a++){const l=s[a].trim(),d=l.match(/"([^"]+)"\s*:\s*{/);if(d){i.push(d[1]),a===e&&(o=i.join("."));continue}if(l==="}"||l==="},"){i.pop();continue}const u=l.match(/"([^"]+)"\s*:/);if(u){const h=u[1];if(a===e){o=i.length>0?`${i.join(".")}.${h}`:h;break}}}r(o)},[t,e]),n};function Q2(t){const{scope:e,fetchConfig:n,fetchSchema:r,saveConfig:s,onReset:i}=t,[o,a]=g.useState("{}"),[l,d]=g.useState(0),[u,h]=g.useState(null),[f,p]=g.useState(null),[m,x]=g.useState({}),[b,y]=g.useState({}),[w,v]=g.useState({}),[k,C]=g.useState(!0),[N,S]=g.useState(null),[D,E]=g.useState("idle"),[M,P]=g.useState(!1),[A,R]=g.useState(null),[j,O]=g.useState(null),T=tT(o,l),$=X4(j,T),I=g.useMemo(()=>Y4($,f),[$,f]);g.useEffect(()=>{(async()=>{S(null);try{const[X,se]=await Promise.all([n(),r()]),ie=X.local??X.config;x(ie),y(X.global??{}),v(X.sources),p(se),a(JSON.stringify(ie,null,2))}catch(X){const se=X instanceof Error?X.message:String(X);console.error("Failed to load config data:",X),S(se)}finally{C(!1)}})()},[n,r]),g.useEffect(()=>{try{JSON.parse(o),h(null)}catch(G){h(G instanceof Error?G.message:"Invalid JSON")}},[o]),g.useEffect(()=>{if(A==="json")try{const G=JSON.parse(o);x(G)}catch{}},[o,A]);const B=g.useCallback(G=>{O(null),R("json"),a(G)},[]),V=g.useCallback(()=>{O(null)},[]),W=g.useCallback((G,X)=>{O(G),R("form"),x(se=>{const ie=G4(se,G,X);return a(JSON.stringify(ie,null,2)),ie}),v(se=>({...se,[G]:e}))},[e]),F=g.useCallback(async()=>{if(!u){E("saving");try{const G=JSON.parse(o),se=await s(G)??G;x(se),a(JSON.stringify(se,null,2)),E("saved"),setTimeout(()=>E("idle"),2e3)}catch{E("error"),setTimeout(()=>E("idle"),3e3)}}},[o,u,s]),Q=g.useCallback(async()=>{if(P(!1),i){C(!0);try{const G=await i(),X=G.local??G.config;x(X),v(G.sources),a(JSON.stringify(X,null,2))}catch(G){console.error("Failed to reset:",G)}finally{C(!1)}}else{const G={};x(G),a(JSON.stringify(G,null,2))}},[i]);return{jsonText:o,config:m,globalConfig:b,sources:w,schema:f,isLoading:k,loadError:N,saveStatus:D,syntaxError:u,cursorLine:l,showResetConfirm:M,activeFieldPath:$,fieldDoc:I,handleJsonChange:B,handleJsonEditorFocus:V,handleFormChange:W,handleSave:F,handleReset:Q,setCursorLine:d,setFocusedFieldPath:O,setShowResetConfirm:P}}function cm({storageKey:t,defaultSizes:e,minSizes:n}){const[r,s]=g.useState(()=>{if(typeof window>"u")return e;const d=localStorage.getItem(t);if(d)try{const u=JSON.parse(d);if(Array.isArray(u)&&u.length===e.length){const h=u.reduce((f,p)=>f+p,0);if(Math.abs(h-100)<1)return u}}catch{}return e}),[i,o]=g.useState(!1);g.useEffect(()=>{localStorage.setItem(t,JSON.stringify(r))},[r,t]);const a=g.useCallback((d,u)=>{u.preventDefault(),o(!0);let h=u.currentTarget.parentElement;for(;h&&getComputedStyle(h).display!=="flex";)h=h.parentElement;if(!h)return;const p=h.getBoundingClientRect().width,m=u.clientX,x=[...r],b=w=>{const k=(w.clientX-m)/p*100,C=[...x],N=d,S=d+1;let D=x[N]+k,E=x[S]-k;D<n[N]&&(D=n[N],E=x[N]+x[S]-D),E<n[S]&&(E=n[S],D=x[N]+x[S]-E),C[N]=D,C[S]=E,s(C)},y=()=>{o(!1),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",y),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",b),document.addEventListener("mouseup",y),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[r,n]),l=g.useCallback(()=>{s(e)},[e]);return{sizes:r,isDragging:i,startDrag:a,reset:l}}const hl="/api";async function Ox(t){const e=`${hl}/ck-config`,n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch ck-config: ${n.status}`);return n.json()}async function Gf(t,e){const n=new URLSearchParams({scope:t});e&&n.set("projectId",e);const r=await fetch(`${hl}/ck-config?${n}`);if(!r.ok)throw new Error(`Failed to fetch ck-config: ${r.status}`);return r.json()}async function J2(t){const e=await fetch(`${hl}/ck-config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.json().catch(()=>({error:"Unknown error"}));throw new Error(n.error||`Failed to save ck-config: ${e.status}`)}return e.json()}async function Z2(){const t=await fetch(`${hl}/ck-config/schema`);if(!t.ok)throw new Error(`Failed to fetch schema: ${t.status}`);return t.json()}async function nT(t,e,n,r){const s=await fetch(`${hl}/ck-config/field`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:n,projectId:r,fieldPath:t,value:e})});if(!s.ok){const i=await s.json().catch(()=>({error:"Unknown error"}));throw new Error(i.error||`Failed to update field: ${s.status}`)}}function rT(t,e,n,r){const[s,i]=g.useState(()=>{if(typeof window>"u")return e;const d=localStorage.getItem(t);if(d){const u=Number.parseFloat(d);if(!Number.isNaN(u)&&u>=n&&u<=100-r)return u}return e}),[o,a]=g.useState(!1),l=g.useCallback(d=>{d.preventDefault(),a(!0);const u=d.target.closest("[data-vresize-container]");if(!u)return;const h=p=>{const m=u.getBoundingClientRect(),x=(p.clientY-m.top)/m.height*100;i(Math.max(n,Math.min(100-r,x)))},f=()=>{a(!1),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",h),document.addEventListener("mouseup",f),document.body.style.cursor="row-resize",document.body.style.userSelect="none"},[n,r]);return g.useEffect(()=>{localStorage.setItem(t,String(s))},[t,s]),{topPct:s,isDragging:o,startDrag:l}}const sT=()=>{const{t}=ne(),e=Lt(),{sizes:n,isDragging:r,startDrag:s}=cm({storageKey:"claudekit-global-config-panels",defaultSizes:[35,40,25],minSizes:[20,25,15]}),i=rT("claudekit-form-taxonomy-split",70,25,15),o=g.useCallback(async()=>await Ox(),[]),a=g.useCallback(async f=>{await J2({scope:"global",config:f})},[]),l=g.useCallback(async()=>await Ox(),[]),d=Q2({scope:"global",fetchConfig:o,fetchSchema:Z2,saveConfig:a,onReset:l}),u=g.useMemo(()=>[{id:"general",title:t("sectionGeneral"),fields:[{path:"codingLevel",label:t("fieldCodingLevel"),description:t("fieldCodingLevelDesc")},{path:"statusline",label:t("fieldStatusline"),description:t("fieldStatuslineDesc")},{path:"statuslineColors",label:t("fieldStatuslineColors"),description:t("fieldStatuslineColorsDesc")},{path:"locale.thinkingLanguage",label:t("fieldThinkingLanguage"),description:t("fieldThinkingLanguageDesc")},{path:"locale.responseLanguage",label:t("fieldResponseLanguage"),description:t("fieldResponseLanguageDesc")}]},{id:"paths",title:t("sectionPaths"),fields:[{path:"paths.docs",label:t("fieldDocsPath"),description:t("fieldDocsPathDesc")},{path:"paths.plans",label:t("fieldPlansPath"),description:t("fieldPlansPathDesc")},{path:"paths.globalPlans",label:t("fieldGlobalPlansPath"),description:t("fieldGlobalPlansPathDesc")}]},{id:"privacy",title:t("sectionPrivacy"),defaultCollapsed:!0,fields:[{path:"privacyBlock",label:t("fieldPrivacyBlock"),description:t("fieldPrivacyBlockDesc")},{path:"trust.enabled",label:t("fieldTrustEnabled"),description:t("fieldTrustEnabledDesc")},{path:"trust.passphrase",label:t("fieldTrustPassphrase"),description:t("fieldTrustPassphraseDesc")}]},{id:"project",title:t("sectionProject"),defaultCollapsed:!0,fields:[{path:"project.type",label:t("fieldProjectType"),description:t("fieldProjectTypeDesc")},{path:"project.packageManager",label:t("fieldPackageManager"),description:t("fieldPackageManagerDesc")},{path:"project.framework",label:t("fieldFramework"),description:t("fieldFrameworkDesc")}]},{id:"integrations",title:t("sectionIntegrations"),defaultCollapsed:!0,fields:[{path:"gemini.model",label:t("fieldGeminiModel"),description:t("fieldGeminiModelDesc")},{path:"skills.research.useGemini",label:t("fieldResearchUseGemini"),description:t("fieldResearchUseGeminiDesc")}]},{id:"hooks",title:t("sectionHooks"),defaultCollapsed:!0,fields:[{path:"hooks.session-init",label:t("fieldHookSessionInit"),description:t("fieldHookSessionInitDesc")},{path:"hooks.subagent-init",label:t("fieldHookSubagentInit"),description:t("fieldHookSubagentInitDesc")},{path:"hooks.session-state",label:t("fieldHookSessionState"),description:t("fieldHookSessionStateDesc")},{path:"hooks.cook-after-plan-reminder",label:t("fieldHookCookAfterPlanReminder"),description:t("fieldHookCookAfterPlanReminderDesc")},{path:"hooks.descriptive-name",label:t("fieldHookDescriptiveName"),description:t("fieldHookDescriptiveNameDesc")},{path:"hooks.dev-rules-reminder",label:t("fieldHookDevRulesReminder"),description:t("fieldHookDevRulesReminderDesc")},{path:"hooks.plan-format-kanban",label:t("fieldHookPlanFormatKanban"),description:t("fieldHookPlanFormatKanbanDesc")},{path:"hooks.usage-quota-cache-refresh",label:t("fieldHookUsageQuotaCacheRefresh"),description:t("fieldHookUsageQuotaCacheRefreshDesc")},{path:"hooks.usage-context-awareness",label:t("fieldHookUsageContextAwareness"),description:t("fieldHookUsageContextAwarenessDesc")},{path:"hooks.context-tracking",label:t("fieldHookContextTracking"),description:t("fieldHookContextTrackingDesc")},{path:"hooks.scout-block",label:t("fieldHookScoutBlock"),description:t("fieldHookScoutBlockDesc")},{path:"hooks.privacy-block",label:t("fieldHookPrivacyBlock"),description:t("fieldHookPrivacyBlockDesc")},{path:"hooks.simplify-gate",label:t("fieldHookSimplifyGate"),description:t("fieldHookSimplifyGateDesc")}]},{id:"simplify",title:t("sectionSimplify"),defaultCollapsed:!0,fields:[{path:"simplify.threshold.locDelta",label:t("fieldSimplifyThresholdLocDelta"),description:t("fieldSimplifyThresholdLocDeltaDesc")},{path:"simplify.threshold.fileCount",label:t("fieldSimplifyThresholdFileCount"),description:t("fieldSimplifyThresholdFileCountDesc")},{path:"simplify.threshold.singleFileLoc",label:t("fieldSimplifyThresholdSingleFileLoc"),description:t("fieldSimplifyThresholdSingleFileLocDesc")},{path:"simplify.gate.enabled",label:t("fieldSimplifyGateEnabled"),description:t("fieldSimplifyGateEnabledDesc")},{path:"simplify.gate.hardVerbs",label:t("fieldSimplifyGateHardVerbs"),description:t("fieldSimplifyGateHardVerbsDesc")},{path:"simplify.gate.softVerbs",label:t("fieldSimplifyGateSoftVerbs"),description:t("fieldSimplifyGateSoftVerbsDesc")}]},{id:"advanced",title:t("sectionAdvanced"),defaultCollapsed:!0,fields:[{path:"docs.maxLoc",label:t("fieldDocsMaxLoc"),description:t("fieldDocsMaxLocDesc")},{path:"plan.namingFormat",label:t("fieldPlanNamingFormat"),description:t("fieldPlanNamingFormatDesc")},{path:"plan.dateFormat",label:t("fieldPlanDateFormat"),description:t("fieldPlanDateFormatDesc")},{path:"plan.validation.mode",label:t("fieldPlanValidationMode"),description:t("fieldPlanValidationModeDesc")},{path:"plan.validation.minQuestions",label:t("fieldPlanMinQuestions"),description:t("fieldPlanMinQuestionsDesc")},{path:"plan.validation.maxQuestions",label:t("fieldPlanMaxQuestions"),description:t("fieldPlanMaxQuestionsDesc")},{path:"assertions",label:t("fieldAssertions"),description:t("fieldAssertionsDesc")}]}],[t]),h=d.showResetConfirm?c.jsxs("div",{className:"flex items-center gap-2 bg-red-500/10 border border-red-500/30 rounded-lg px-2 py-1 animate-in fade-in duration-200",children:[c.jsx("span",{className:"text-xs text-red-500 font-medium",children:t("confirmReset")}),c.jsx("button",{type:"button",onClick:d.handleReset,className:"px-2 py-0.5 rounded bg-red-500 text-white text-xs font-bold hover:bg-red-600 transition-colors",children:t("confirm")}),c.jsx("button",{type:"button",onClick:()=>d.setShowResetConfirm(!1),className:"px-2 py-0.5 rounded bg-dash-surface text-dash-text-secondary text-xs font-bold hover:bg-dash-surface-hover transition-colors border border-dash-border",children:t("cancel")})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>d.setShowResetConfirm(!0),className:"px-3 py-1.5 rounded-lg bg-dash-surface text-xs font-bold text-dash-text-secondary hover:bg-dash-surface-hover transition-colors border border-dash-border",children:t("resetToDefault")}),c.jsx("button",{type:"button",onClick:d.handleSave,disabled:!!d.syntaxError||d.saveStatus==="saving",className:`px-3 py-1.5 rounded-lg text-xs font-bold transition-all tracking-widest uppercase ${d.syntaxError?"bg-dash-surface text-dash-text-muted cursor-not-allowed border border-dash-border":d.saveStatus==="saved"?"bg-green-500 text-white shadow-lg shadow-green-500/20":d.saveStatus==="error"?"bg-red-500 text-white":"bg-dash-accent text-dash-bg hover:bg-dash-accent-hover shadow-lg shadow-dash-accent/20"}`,children:d.saveStatus==="saving"?t("saving"):d.saveStatus==="saved"?t("saved"):d.saveStatus==="error"?t("saveFailed"):t("saveChanges")})]});return c.jsxs("div",{className:"animate-in fade-in duration-300 w-full h-full flex flex-col transition-colors",children:[c.jsx(Qv,{title:t("globalConfig"),filePath:"~/.claude/.ck.json",onBack:()=>e(-1),onSave:d.handleSave,onReset:d.handleReset,saveStatus:d.saveStatus,syntaxError:d.syntaxError,showResetConfirm:d.showResetConfirm,setShowResetConfirm:d.setShowResetConfirm,showActions:!1,showFilePath:!1}),!d.isLoading&&d.loadError&&c.jsxs("div",{className:"mx-4 mt-2 px-3 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-xs text-red-500",children:[c.jsx("p",{className:"font-medium",children:t("configLoadFailed")}),c.jsxs("p",{className:"mt-1 break-words",children:[t("configLoadFailedDetail")," ",d.loadError]})]}),c.jsx("div",{className:"flex-1 flex min-h-0",children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{"data-vresize-container":!0,style:{width:`${n[0]}%`},className:"flex flex-col min-w-0 min-h-0",children:[c.jsx("div",{style:{height:`${d.isLoading?100:i.topPct}%`},className:"min-h-0",children:c.jsx(t1,{width:100,isLoading:d.isLoading,schema:d.schema,config:d.config,sources:d.sources,sections:u,onChange:d.handleFormChange})}),!d.isLoading&&c.jsxs(c.Fragment,{children:[c.jsx(kn,{direction:"vertical",isDragging:i.isDragging,onMouseDown:i.startDrag}),c.jsx("div",{style:{height:`${100-i.topPct}%`},className:"min-h-0",children:c.jsx(eT,{config:d.config,onChange:d.handleFormChange})})]})]}),c.jsx(kn,{direction:"horizontal",isDragging:r,onMouseDown:f=>s(0,f)}),c.jsx(lm,{width:n[1],isLoading:d.isLoading,jsonText:d.jsonText,cursorLine:d.cursorLine,syntaxError:d.syntaxError,onChange:d.handleJsonChange,onCursorLineChange:d.setCursorLine,headerPath:"~/.claude/.ck.json",headerActions:h}),c.jsx(kn,{direction:"horizontal",isDragging:r,onMouseDown:f=>s(1,f)}),c.jsx(X2,{width:n[2],fieldDoc:d.fieldDoc,activeFieldPath:d.activeFieldPath})]})})]})};function iT(t){const e=t.replace(/\\/g,"/"),n=e.split("/").filter(Boolean);return n.length<3?null:`${e.startsWith("/")?"/":""}${n.slice(0,-2).join("/")}`}function oT(){const[t]=sl(),e=t.get("projectId"),n=t.get("file"),r=n?iT(n):null,s=new URLSearchParams;return r&&(s.set("dir",r),s.set("view","kanban"),e&&s.set("projectId",e)),c.jsx(Av,{replace:!0,to:r?`/plans?${s.toString()}`:"/plans"})}function aT(){const[t,e]=g.useState([]),[n,r]=g.useState(!0),[s,i]=g.useState(null),o=g.useCallback(async()=>{try{r(!0),i(null);const a=await fetch("/api/mcp-servers");if(!a.ok)throw new Error(`Failed to fetch MCP servers: ${a.status}`);const l=await a.json();e(l.servers??[])}catch(a){i(a instanceof Error?a.message:"Failed to load MCP servers"),e([])}finally{r(!1)}},[]);return g.useEffect(()=>{o()},[o]),{servers:t,loading:n,error:s,reload:o}}function lT(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5 shrink-0 text-dash-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M12 5l7 7-7 7"})})}function cT({label:t,count:e}){return c.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[c.jsx("span",{className:"text-xs font-bold text-dash-text-muted uppercase tracking-wider flex-1",children:t}),c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-dash-accent-subtle text-dash-accent font-semibold",children:e})]})}function dT({server:t,selected:e,onClick:n}){return c.jsxs("button",{type:"button",onClick:n,className:["w-full flex items-start gap-2 px-3 py-2 rounded-md transition-colors text-left group",e?"bg-dash-accent/10 border border-dash-accent/30":"hover:bg-dash-surface-hover border border-transparent"].join(" "),children:[c.jsx(lT,{}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"text-sm font-semibold text-dash-accent font-mono",children:t.name}),c.jsx("p",{className:"text-xs text-dash-text-muted mt-0.5 truncate font-mono",children:t.command})]})]})}function uT({server:t}){const{t:e}=ne();return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("h2",{className:"text-base font-semibold text-dash-text font-mono truncate flex-1",children:t.name}),c.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-dash-accent-subtle text-dash-accent font-semibold shrink-0",children:e("sessionReadOnly")})]}),c.jsx("div",{className:"flex items-center gap-2 text-xs text-dash-text-muted",children:c.jsx("span",{className:"font-mono px-2 py-0.5 rounded bg-dash-surface border border-dash-border text-dash-accent",children:t.sourceLabel})}),c.jsx("div",{className:"rounded-lg border border-dash-border bg-dash-surface p-5 overflow-x-auto",children:c.jsx("table",{className:"w-full text-sm",children:c.jsxs("tbody",{children:[c.jsxs("tr",{className:"border-b border-dash-border",children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 shrink-0 align-top",children:e("mcpCommand")}),c.jsx("td",{className:"py-2 font-mono text-xs text-dash-text break-all",children:t.command})]}),t.args.length>0&&c.jsxs("tr",{className:"border-b border-dash-border",children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 align-top",children:e("mcpArgs")}),c.jsx("td",{className:"py-2 text-xs text-dash-text",children:c.jsx("div",{className:"flex flex-col gap-1",children:t.args.map((n,r)=>c.jsx("code",{className:"font-mono bg-dash-surface border border-dash-border rounded px-1.5 py-0.5 text-[11px] break-all",children:n},r))})})]}),t.env&&Object.keys(t.env).length>0&&c.jsxs("tr",{className:"border-b border-dash-border",children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 align-top",children:"env"}),c.jsx("td",{className:"py-2 text-xs text-dash-text",children:c.jsx("div",{className:"flex flex-col gap-1",children:Object.keys(t.env).map(n=>c.jsxs("code",{className:"font-mono bg-dash-surface border border-dash-border rounded px-1.5 py-0.5 text-[11px]",children:[n,"=",c.jsx("span",{className:"text-dash-text-muted",children:"***"})]},n))})})]}),c.jsxs("tr",{children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs text-dash-text-muted w-28 align-top",children:e("mcpSource")}),c.jsx("td",{className:"py-2 text-xs text-dash-text font-mono",children:t.sourceLabel})]})]})})})]})}const hT=({message:t})=>c.jsx("div",{className:"flex items-center justify-center h-full text-sm text-dash-text-muted",children:t}),fT=()=>{const{t}=ne(),{servers:e,loading:n,error:r}=aT(),[s,i]=g.useState(""),[o,a]=g.useState(null),{size:l,isDragging:d,startDrag:u}=$i({storageKey:"ck-mcp-panel-width",defaultSize:380,minSize:260,maxSize:650}),h=x=>`${x.source}-${x.name}`,f=e.find(x=>h(x)===o)??null,p=g.useMemo(()=>{if(!s.trim())return e;const x=s.toLowerCase();return e.filter(b=>b.name.toLowerCase().includes(x)||b.command.toLowerCase().includes(x)||b.sourceLabel.toLowerCase().includes(x))},[e,s]),m=g.useMemo(()=>{const x=new Map;for(const b of p){const y=x.get(b.sourceLabel)??[];y.push(b),x.set(b.sourceLabel,y)}return x},[p]);return c.jsxs("div",{className:"flex h-full overflow-hidden",children:[c.jsxs("div",{style:{width:`${l}px`},className:"shrink-0 flex flex-col overflow-hidden border-r border-dash-border",children:[c.jsxs("div",{className:"shrink-0 px-4 pt-4 pb-3 border-b border-dash-border",children:[c.jsxs("div",{className:"flex items-start justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-base font-bold text-dash-text",children:t("mcpTitle")}),!n&&!r&&c.jsx("p",{className:"text-xs text-dash-text-muted mt-0.5",children:e.length===0?t("mcpNoServers"):`${e.length} ${e.length===1?"server":"servers"} configured`}),c.jsx("p",{className:"text-[11px] text-dash-text-muted font-mono mt-0.5",children:"~/.claude.json + settings.json + .mcp.json"})]}),c.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-dash-accent-subtle text-dash-accent font-semibold shrink-0",children:t("sessionReadOnly")})]}),c.jsxs("div",{className:"relative",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-dash-text-muted pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),c.jsx("input",{type:"text",value:s,onChange:x=>i(x.target.value),placeholder:t("mcpServerName"),className:"w-full pl-9 pr-4 py-2 text-sm bg-dash-surface border border-dash-border rounded-lg text-dash-text placeholder:text-dash-text-muted focus:outline-none focus:border-dash-accent/50 transition-colors"}),s&&c.jsx("button",{type:"button",onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-dash-text-muted hover:text-dash-text transition-colors",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[n&&c.jsx("div",{className:"flex flex-1 items-center justify-center text-dash-text-muted text-sm p-8",children:t("loading")}),!n&&r&&c.jsx("div",{className:"rounded-lg border border-red-300 bg-red-50 dark:bg-red-900/20 p-4 text-red-600 dark:text-red-400 text-sm m-2",children:r}),!n&&!r&&m.size===0&&c.jsx("div",{className:"flex items-center justify-center p-8 text-dash-text-muted text-sm",children:t("mcpNoServers")}),!n&&!r&&m.size>0&&c.jsx("div",{className:"flex flex-col gap-2 pb-4",children:Array.from(m.entries()).map(([x,b])=>c.jsxs("div",{children:[m.size>1&&c.jsx(cT,{label:x,count:b.length}),c.jsx("div",{className:"space-y-0.5",children:b.map(y=>{const w=h(y);return c.jsx(dT,{server:y,selected:o===w,onClick:()=>a(w)},w)})})]},x))})]})]}),c.jsx(kn,{onMouseDown:u,isDragging:d,direction:"horizontal"}),c.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:f?c.jsx(uT,{server:f}):c.jsx(hT,{message:t("selectToView")})})]})};function sa(t){return`${t.provider}::${t.type}::${t.item}::${String(t.global)}`}const pT=["agent","command","skill","config","rules","hooks"],mT={agent:"migrateTypeAgents",command:"migrateTypeCommands",skill:"migrateTypeSkills",config:"migrateTypeConfig",rules:"migrateTypeRules",hooks:"migrateTypeHooks"},gT={agent:"border-dash-accent/30 text-dash-accent",command:"border-yellow-500/30 text-yellow-400",skill:"border-purple-500/30 text-purple-400",config:"border-teal-500/30 text-teal-400",rules:"border-rose-500/30 text-rose-400",hooks:"border-cyan-500/30 text-cyan-400"},xT=({type:t,candidates:e,selected:n,onToggleItem:r,onSelectAll:s,onDeselectAll:i})=>{const{t:o}=ne(),a=g.useMemo(()=>e.map(sa),[e]),l=a.filter(f=>n.has(f)).length,d=l===a.length,u=gT[t],h=o(mT[t]);return c.jsxs("div",{className:"border border-dash-border rounded-lg bg-dash-surface overflow-hidden",children:[c.jsxs("div",{className:"px-4 py-2.5 flex items-center justify-between border-b border-dash-border bg-dash-bg",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h4",{className:"text-sm font-semibold text-dash-text",children:h}),c.jsxs("span",{className:`px-2 py-0.5 text-xs rounded-md border ${u}`,children:[l,"/",e.length]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",onClick:()=>s(a),disabled:d,className:"dash-focus-ring px-2.5 py-1 text-[11px] rounded border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:o("migrateInstallSelectAll")}),c.jsx("button",{type:"button",onClick:()=>i(a),disabled:l===0,className:"dash-focus-ring px-2.5 py-1 text-[11px] rounded border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:o("migrateInstallDeselectAll")})]})]}),c.jsx("div",{className:"divide-y divide-dash-border/50",children:e.map(f=>{const p=sa(f),m=n.has(p);return c.jsxs("label",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-dash-surface-hover cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:m,onChange:()=>r(p),className:"h-4 w-4 rounded border-dash-border accent-dash-accent","aria-label":`${f.item} from ${f.provider}`}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("span",{className:"text-sm font-mono text-dash-text truncate",children:f.item}),f.isDirectoryItem&&c.jsx("span",{className:"text-[10px] uppercase px-1.5 py-0.5 rounded border border-purple-500/30 text-purple-400",children:o("migrateInstallDirItem")}),f.alreadyInstalled&&c.jsx("span",{className:"text-[10px] uppercase px-1.5 py-0.5 rounded border border-dash-border text-dash-text-muted",children:o("migrateInstallAlreadyInstalled")})]}),c.jsx("div",{className:"text-[11px] text-dash-text-muted mt-0.5",children:f.provider})]}),f.description&&c.jsx("p",{className:"hidden md:block text-xs text-dash-text-secondary max-w-[200px] truncate shrink-0",children:f.description})]},p)})})]})},bT=({candidates:t,selected:e,onSelectionChange:n,onInstall:r,isInstalling:s=!1})=>{const{t:i}=ne(),o=g.useMemo(()=>{const p=new Map;for(const m of t){const x=p.get(m.type)??[];x.push(m),p.set(m.type,x)}return pT.filter(m=>(p.get(m)?.length??0)>0).map(m=>({type:m,candidates:p.get(m)??[]}))},[t]),a=g.useMemo(()=>t.map(sa),[t]),l=g.useCallback(p=>{const m=new Set(e);m.has(p)?m.delete(p):m.add(p),n(m)},[e,n]),d=g.useCallback(p=>{const m=new Set(e);for(const x of p)m.add(x);n(m)},[e,n]),u=g.useCallback(p=>{const m=new Set(e);for(const x of p)m.delete(x);n(m)},[e,n]),h=g.useCallback(()=>{n(new Set(a))},[a,n]),f=g.useCallback(()=>{n(new Set)},[n]);return t.length===0?c.jsx("div",{className:"dash-panel p-8 text-center",children:c.jsx("p",{className:"text-dash-text-muted text-sm",children:i("migrateInstallNoCandidates")})}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[c.jsx("p",{className:"text-sm text-dash-text-secondary",children:i("migrateInstallSelectedCount").replace("{count}",String(e.size)).replace("{total}",String(t.length))}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",onClick:h,disabled:e.size===t.length,className:"dash-focus-ring px-3 py-1.5 text-xs rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:i("migrateInstallSelectAll")}),c.jsx("button",{type:"button",onClick:f,disabled:e.size===0,className:"dash-focus-ring px-3 py-1.5 text-xs rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover disabled:opacity-40",children:i("migrateInstallDeselectAll")})]})]}),o.map(({type:p,candidates:m})=>c.jsx(xT,{type:p,candidates:m,selected:e,onToggleItem:l,onSelectAll:d,onDeselectAll:u},p)),c.jsx("div",{className:"flex items-center justify-end pt-2",children:c.jsx("button",{type:"button",disabled:e.size===0||s,onClick:()=>r(e),className:"dash-focus-ring px-6 py-2.5 bg-dash-accent text-white rounded-md text-sm font-semibold hover:bg-dash-accent/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:s?i("migrateInstallInstalling"):i("migrateInstallCta").replace("{count}",String(e.size))})})]})};function yT(t){return new Set(t.map(sa))}function vT(t,e){const n=t.filter(l=>e.has(sa(l))),r=n.map(l=>({action:"install",item:l.item,type:l.type,provider:l.provider,global:l.global,targetPath:l.registryPath??l.sourcePath,reason:"User-selected install",reasonCode:"new-item",isDirectoryItem:l.isDirectoryItem})),s=l=>({agent:"agents",command:"commands",skill:"skills",config:"config",rules:"rules",hooks:"hooks"})[l],i={agents:!1,commands:!1,skills:!1,config:!1,rules:!1,hooks:!1},o={agents:[],commands:[],skills:[],config:[],rules:[],hooks:[]},a=new Set;for(const l of n){const d=s(l.type);i[d]=!0,o[d].push(l.item),a.add(l.provider)}return{actions:r,summary:{install:r.length,update:0,skip:0,conflict:0,delete:0},hasConflicts:!1,banners:[],meta:{include:i,providers:Array.from(a),items:o,mode:"install"}}}const Mx=[{key:"agent",labelKey:"migrateTypeAgents",badgeClass:"border-dash-accent/30 text-dash-accent"},{key:"command",labelKey:"migrateTypeCommands",badgeClass:"border-yellow-500/30 text-yellow-400"},{key:"skill",labelKey:"migrateTypeSkills",badgeClass:"border-purple-500/30 text-purple-400"},{key:"config",labelKey:"migrateTypeConfig",badgeClass:"border-teal-500/30 text-teal-400"},{key:"rules",labelKey:"migrateTypeRules",badgeClass:"border-rose-500/30 text-rose-400"},{key:"hooks",labelKey:"migrateTypeHooks",badgeClass:"border-cyan-500/30 text-cyan-400"}],wT=new Set([8203,8204,8205,8288,65279,8232,8233,8234,8235,8236,8237,8238,8294,8295,8296,8297]);function kT(t){return t===9||t===10||t===13?!0:t>=0&&t<=8||t>=11&&t<=31||t>=127&&t<=159||wT.has(t)}function gs(t){let e="";for(const n of t){const r=n.codePointAt(0);r!==void 0&&(kT(r)||(e+=n))}return e}function Ax(t){if(!t)return"-";const e=t.replace(/\\/g,"/"),n=e.match(/.*\/(\.[^/]+\/)/);if(n?.[1]){const s=(n.index??0)+n[0].length-n[1].length;return e.slice(s)}const r=e.split("/");return r.length>3?`.../${r.slice(-3).join("/")}`:e}function ri(t){return t.success?t.skipped?"skipped":"installed":"failed"}function ST(t){const e={installed:0,skipped:0,failed:0};for(const n of t){const r=ri(n);r==="installed"?e.installed+=1:r==="skipped"?e.skipped+=1:e.failed+=1}return e}function ek(t){switch(t){case"agent":case"command":case"skill":case"config":case"rules":case"hooks":case"unknown":return t;default:return"unknown"}}function CT(t,e){switch(t){case"failed":return{label:e("migrateStatusFailed"),className:"border-red-500/30 bg-red-500/10 text-red-400"};case"skipped":return{label:e("migrateStatusSkipped"),className:"border-yellow-500/30 bg-yellow-500/10 text-yellow-400"};default:return{label:e("migrateStatusInstalled"),className:"border-green-500/30 bg-green-500/10 text-green-400"}}}function jT(t){const e=new Map;for(const n of t){const r=ek(n.portableType),s=e.get(r)||[];s.push(n),e.set(r,s)}return e}function NT(t){return[ek(t.portableType),t.provider,t.providerDisplayName,t.itemName,t.path,t.success,t.skipped,t.overwritten,t.error,t.skipReason].map(n=>n===void 0?"":String(n)).join("|")}function PT(t){if(t.length===0)return!0;const e=t[0].provider;return t.every(n=>n.provider===e)}const pi=({label:t,count:e,className:n})=>e<=0?null:c.jsxs("span",{className:`inline-flex items-center gap-1 rounded-md border px-2.5 py-1 text-xs ${n}`,children:[c.jsx("span",{className:"font-semibold",children:e}),c.jsx("span",{children:t})]}),Tx=({labelKey:t,badgeClass:e,items:n,isExpanded:r,onToggle:s,singleProvider:i})=>{const{t:o}=ne(),a=n.filter(f=>ri(f)==="installed").length,l=n.filter(f=>ri(f)==="skipped").length,d=n.filter(f=>ri(f)==="failed").length,u=i?"md:grid-cols-[minmax(0,1.5fr)_minmax(0,1.35fr)_auto_minmax(0,1fr)]":"md:grid-cols-[minmax(0,1.2fr)_minmax(0,0.8fr)_minmax(0,1.2fr)_auto_minmax(0,1fr)]",h=new Map;return c.jsxs("div",{className:"rounded-xl border border-dash-border bg-dash-surface overflow-hidden",children:[c.jsxs("button",{type:"button",onClick:s,className:"w-full flex flex-wrap items-center gap-2 px-4 py-3 text-left hover:bg-dash-surface-hover transition-colors",children:[c.jsx("svg",{className:`w-3.5 h-3.5 text-dash-text-muted transition-transform ${r?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:c.jsx("path",{d:"M9 5l7 7-7 7"})}),c.jsx("p",{className:"text-sm font-semibold text-dash-text",children:o(t)}),c.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-semibold ${e}`,children:n.length}),c.jsx("span",{className:"hidden sm:block flex-1"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px]",children:[c.jsx(pi,{label:o("migrateStatusInstalled"),count:a,className:"border-green-500/30 bg-green-500/10 text-green-400"}),c.jsx(pi,{label:o("migrateStatusSkipped"),count:l,className:"border-yellow-500/30 bg-yellow-500/10 text-yellow-400"}),c.jsx(pi,{label:o("migrateStatusFailed"),count:d,className:"border-red-500/30 bg-red-500/10 text-red-400"})]})]}),r&&c.jsxs("div",{className:"border-t border-dash-border/80",children:[c.jsxs("div",{className:`hidden md:grid ${u} items-center gap-3 px-4 py-2 border-b border-dash-border/70 text-[10px] font-semibold uppercase tracking-wide text-dash-text-muted`,children:[c.jsx("p",{children:o("migrateItem")}),!i&&c.jsx("p",{children:o("migrateProvider")}),c.jsx("p",{children:o("migratePath")}),c.jsx("p",{children:o("migrateStatus")}),c.jsx("p",{children:o("migrateError")})]}),c.jsx("div",{className:"divide-y divide-dash-border/70",children:n.map(f=>{const p=NT(f),m=h.get(p)??0;h.set(p,m+1);const x=m===0?p:`${p}#${m}`,b=ri(f),y=CT(b,o),w=gs(f.itemName||Ax(f.path)),v=gs(f.providerDisplayName||f.provider||""),k=gs(f.path||""),C=gs(Ax(f.path)),N=gs(f.error||f.skipReason||"");return c.jsxs("div",{className:`grid gap-1.5 ${u} items-start px-4 py-2.5 hover:bg-dash-bg/60 transition-colors`,children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold text-dash-text truncate",title:w,children:w}),c.jsxs("div",{className:"mt-0.5 space-y-0.5 md:hidden",children:[!i&&c.jsx("p",{className:"text-[11px] text-dash-text-secondary truncate",children:v}),c.jsx("p",{className:"font-mono text-[11px] text-dash-text-muted truncate",title:k,children:C}),N&&c.jsx("p",{className:"text-[11px] text-red-400/80 line-clamp-2",title:N,children:N})]})]}),!i&&c.jsx("p",{className:"hidden md:block text-[11px] text-dash-text-secondary truncate",children:v}),c.jsx("p",{className:"hidden md:block font-mono text-[11px] text-dash-text-muted truncate",title:k,children:C}),c.jsx("span",{className:`inline-flex w-fit items-center rounded-full border px-2 py-0.5 text-[11px] font-medium ${y.className}`,children:y.label}),c.jsx("p",{className:`hidden md:block text-[11px] truncate ${N?"text-red-400/80":"text-dash-text-muted"}`,title:N,children:N||"-"})]},x)})})]})]})},DT=({results:t,onReset:e})=>{const{t:n}=ne(),[r,s]=g.useState(""),i=g.useDeferredValue(r),[o,a]=g.useState("all"),[l,d]=g.useState(()=>new Set(Mx.map(k=>k.key))),u=g.useMemo(()=>{const k=i.trim().toLowerCase();return t.results.filter(C=>{if(o!=="all"&&ri(C)!==o)return!1;if(!k)return!0;const N=(C.itemName||"").toLowerCase(),S=(C.path||"").toLowerCase(),D=(C.providerDisplayName||C.provider||"").toLowerCase();return N.includes(k)||S.includes(k)||D.includes(k)})},[t.results,i,o]),h=g.useMemo(()=>PT(u),[u]),f=g.useMemo(()=>{if(!h||u.length===0)return"";const k=Array.from(new Set(u.map(C=>C.providerDisplayName?.trim()||"").filter(C=>C.length>0)));return k.length===1?k[0]:u[0]?.provider||""},[u,h]),p=g.useMemo(()=>jT(u),[u]),m=g.useMemo(()=>ST(t.results),[t.results]),x=g.useMemo(()=>[...p.keys()],[p]),b=m.installed+m.skipped+m.failed,y=x.length>0&&x.every(k=>l.has(k)),w=k=>{d(C=>{const N=new Set(C);return N.has(k)?N.delete(k):N.add(k),N})},v=()=>{if(y){d(new Set);return}d(new Set(x))};return c.jsxs("div",{className:"dash-panel p-4 md:p-5 space-y-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-base font-semibold text-dash-text",children:[n("migrateSummaryTitle"),h&&f&&c.jsxs("span",{className:"text-dash-text-muted font-normal",children:[" ","· ",gs(f)]})]}),c.jsxs("p",{className:"text-xs text-dash-text-muted mt-1",children:[b," ",n("migrateSummarySubtitle")]})]}),c.jsx("button",{type:"button",onClick:e,className:"dash-focus-ring px-4 py-2 text-sm font-semibold rounded-md bg-dash-bg border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover",children:n("migrateSummaryNewMigration")})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[c.jsx(pi,{label:n("migrateStatusInstalled"),count:m.installed,className:"border-green-500/30 bg-green-500/10 text-green-400"}),c.jsx(pi,{label:n("migrateStatusSkipped"),count:m.skipped,className:"border-yellow-500/30 bg-yellow-500/10 text-yellow-400"}),c.jsx(pi,{label:n("migrateStatusFailed"),count:m.failed,className:"border-red-500/30 bg-red-500/10 text-red-400"})]}),t.warnings.length>0&&c.jsx("div",{className:"space-y-2",children:t.warnings.map((k,C)=>c.jsx("div",{className:"px-3 py-2 border border-yellow-500/30 bg-yellow-500/10 rounded-md text-xs text-yellow-400",children:gs(k)},C))}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 stroke-dash-text-muted",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"11",cy:"11",r:"8"}),c.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),c.jsx("input",{type:"text",value:r,onChange:k=>s(k.target.value),placeholder:n("migrateSummarySearchPlaceholder"),className:"dash-focus-ring w-full pl-9 pr-3 py-2 bg-dash-bg border border-dash-border rounded-lg text-dash-text text-sm focus:border-dash-accent transition-colors"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[["all","installed","skipped","failed"].map(k=>{const C=k==="all"?"migrateSummaryFilterAll":k==="installed"?"migrateStatusInstalled":k==="skipped"?"migrateStatusSkipped":"migrateStatusFailed";return c.jsx("button",{type:"button",onClick:()=>a(k),className:`dash-focus-ring px-3 py-1 text-xs font-medium rounded-full border transition-colors ${o===k?"bg-dash-accent/10 border-dash-accent text-dash-accent":"border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover hover:text-dash-text"}`,children:n(C)},k)}),c.jsx("button",{type:"button",onClick:v,className:"dash-focus-ring ml-1 px-3 py-1 text-xs font-medium rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover",children:n(y?"migrateSummaryCollapseAll":"migrateSummaryExpandAll")})]})]}),u.length===0?c.jsx("div",{className:"text-center py-8 text-sm text-dash-text-muted",children:n("migrateSummaryNoResults")}):c.jsxs("div",{className:"space-y-2.5",children:[Mx.map(k=>{const C=p.get(k.key);return!C||C.length===0?null:c.jsx(Tx,{labelKey:k.labelKey,badgeClass:k.badgeClass,items:C,isExpanded:l.has(k.key),onToggle:()=>w(k.key),singleProvider:h},k.key)}),(()=>{const k=p.get("unknown");return!k||k.length===0?null:c.jsx(Tx,{labelKey:"migrateTypeUnknown",badgeClass:"border-dash-border text-dash-text-muted",items:k,isExpanded:l.has("unknown"),onToggle:()=>w("unknown"),singleProvider:h})})()]})]})},ET=({pendingCount:t,nextMode:e,onConfirm:n,onCancel:r})=>{const{t:s}=ne(),i=g.useRef(null);g.useEffect(()=>{const a=i.current;if(!a)return;a.open||a.showModal();const l=d=>{d.preventDefault(),r()};return a.addEventListener("cancel",l),()=>{a.removeEventListener("cancel",l),a.open&&a.close()}},[r]);const o=s(e==="install"?"migrateModeInstall":"migrateModeReconcile");return c.jsxs("dialog",{ref:i,"aria-labelledby":"mode-confirm-title","aria-describedby":"mode-confirm-body",onClick:a=>{a.target===a.currentTarget&&r()},className:"fixed inset-0 z-50 m-auto h-auto max-w-sm rounded-xl border border-dash-border bg-dash-surface p-6 shadow-2xl backdrop:bg-black/50",children:[c.jsx("h2",{id:"mode-confirm-title",className:"mb-2 text-base font-semibold text-dash-text",children:s("migrateModeConfirmTitle")}),c.jsx("p",{id:"mode-confirm-body",className:"mb-5 text-sm text-dash-text-secondary",children:s("migrateModeConfirmBody").replace("{count}",String(t)).replace("{mode}",o)}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:r,className:"dash-focus-ring px-4 py-2 text-sm font-medium rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover",children:s("cancel")}),c.jsx("button",{type:"button",autoFocus:!0,onClick:n,className:"dash-focus-ring px-4 py-2 text-sm font-semibold rounded-md bg-dash-accent text-white hover:bg-dash-accent/90",children:s("migrateModeConfirmSwitch")})]})]})},OT=({mode:t,pendingCount:e,disabled:n=!1,onModeChange:r})=>{const{t:s}=ne(),[i,o]=g.useState(null),a=g.useCallback(u=>{u===t||n||(e>0?o(u):r(u))},[t,n,e,r]),l=g.useCallback(()=>{i&&(r(i),o(null))},[i,r]),d=g.useCallback(()=>{o(null)},[]);return c.jsxs(c.Fragment,{children:[c.jsx("div",{role:"tablist","aria-label":s("migrateModeLabel"),className:"inline-flex rounded-lg border border-dash-border bg-dash-bg overflow-hidden",children:["reconcile","install"].map(u=>{const h=t===u,f=u==="reconcile"?"migrateModeReconcile":"migrateModeInstall",p=u==="reconcile"?"migrateModeReconcileDesc":"migrateModeInstallDesc";return c.jsxs("button",{type:"button",role:"tab","aria-selected":h,"aria-controls":`migrate-${u}-panel`,id:`migrate-${u}-tab`,disabled:n,onClick:()=>a(u),className:`px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-dash-accent disabled:opacity-50 disabled:cursor-not-allowed ${h?"bg-dash-accent-subtle text-dash-accent":"text-dash-text-secondary hover:bg-dash-surface-hover hover:text-dash-text"}`,children:[c.jsx("span",{className:"block",children:s(f)}),c.jsx("span",{className:"block text-[10px] font-normal opacity-70",children:s(p)})]},u)})}),i&&c.jsx(ET,{pendingCount:e,nextMode:i,onConfirm:l,onCancel:d})]})},MT=500;function AT(t){return t>=0&&t<=8||t>=11&&t<=31||t>=127&&t<=159}function TT(t){let e="";for(const n of t){const r=n.codePointAt(0);r!==void 0&&(AT(r)||(e+=n))}return e}const LT=({diff:t,className:e=""})=>{const n=t.split(`
|
|
279
295
|
`),r=n.slice(0,MT),s=n.length-r.length;return c.jsxs("pre",{className:`text-xs font-mono overflow-x-auto p-3 rounded bg-dash-bg border border-dash-border ${e}`,children:[r.map((i,o)=>{const a=TT(i);let l="text-dash-text";return a.startsWith("+")?l="text-green-400 bg-green-500/10":a.startsWith("-")?l="text-red-400 bg-red-500/10":a.startsWith("@@")&&(l="text-blue-400"),c.jsx("div",{className:l,children:a},`${o}:${a.slice(0,24)}`)}),s>0&&c.jsxs("div",{className:"text-dash-text-muted",children:["... truncated ",s," additional line(s)"]})]})};function RT(t){return t>=0&&t<=8||t>=11&&t<=31||t>=127&&t<=159}function ao(t){let e="";for(const n of t){const r=n.codePointAt(0);r!==void 0&&(RT(r)||(e+=n))}return e}const tk=({action:t,resolution:e,onResolve:n})=>{const{t:r}=ne(),[s,i]=g.useState(!1),o=t.ownedSections&&t.ownedSections.length>0;return c.jsxs("div",{className:"border border-dash-border rounded-lg p-4 mb-3 bg-dash-surface",children:[c.jsxs("div",{className:"flex justify-between items-start gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"font-mono text-sm text-dash-text truncate",children:[ao(t.provider),"/",ao(t.type),"/",ao(t.item)]}),c.jsx("p",{className:"text-xs text-dash-text-muted mt-1",children:ao(t.reason)}),t.targetPath&&c.jsx("p",{className:"text-xs text-dash-text-secondary mt-1 font-mono truncate",children:ao(t.targetPath)})]}),c.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[c.jsx("button",{type:"button",onClick:()=>n({type:"overwrite"}),className:`dash-focus-ring px-3 py-1.5 text-xs font-semibold rounded-md transition-colors ${e?.type==="overwrite"?"bg-dash-accent text-white":"bg-dash-bg border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover"}`,children:r("migrateConflictUseCK")}),c.jsx("button",{type:"button",onClick:()=>n({type:"keep"}),className:`dash-focus-ring px-3 py-1.5 text-xs font-semibold rounded-md transition-colors ${e?.type==="keep"?"bg-dash-accent text-white":"bg-dash-bg border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover"}`,children:r("migrateConflictKeepMine")}),o&&c.jsx("button",{type:"button",onClick:()=>n({type:"smart-merge"}),className:`dash-focus-ring px-3 py-1.5 text-xs font-semibold rounded-md transition-colors ${e?.type==="smart-merge"?"bg-dash-accent text-white":"bg-dash-bg border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover"}`,children:r("migrateConflictSmartMerge")}),t.diff&&c.jsx("button",{type:"button",onClick:()=>i(!s),className:"dash-focus-ring px-3 py-1.5 text-xs font-medium rounded-md border border-dash-border text-dash-text-secondary hover:bg-dash-surface-hover",children:r(s?"migrateConflictHideDiff":"migrateConflictShowDiff")})]})]}),s&&t.diff&&c.jsx(LT,{diff:t.diff,className:"mt-3"}),e&&c.jsxs("div",{className:"mt-2 text-xs text-green-400 flex items-center gap-1.5",children:[c.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:c.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),c.jsxs("span",{children:[r("migrateConflictResolved"),": ",IT(e.type,r)]})]})]})};function IT(t,e){switch(t){case"overwrite":return e("migrateConflictUseCK");case"keep":return e("migrateConflictKeepMine");case"smart-merge":return e("migrateConflictSmartMerge");case"resolved":return e("migrateConflictManual");default:return String(t)}}const $T=({banner:t,onRespectDeletionsOverride:e})=>{const{t:n}=ne(),r=t.kind==="empty-dir-respected";return c.jsxs("output",{"aria-live":"polite",className:`flex items-start gap-3 px-4 py-3 rounded-lg border ${r?"bg-dash-surface border-dash-border text-dash-text-secondary":"bg-blue-500/5 border-blue-500/20 text-blue-300"}`,children:[c.jsx("svg",{className:`w-4 h-4 mt-0.5 shrink-0 ${r?"text-dash-text-muted":"text-blue-400"}`,fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),c.jsx("div",{className:"flex-1 min-w-0",children:r?c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-xs font-medium",children:[n("migrateBanner_emptyDirRespected_title")," —"," ",c.jsx("span",{className:"font-mono",children:t.path})," ",n("migrateBanner_emptyDirRespected_body")]}),e&&c.jsxs("button",{type:"button",onClick:e,className:"dash-focus-ring mt-1.5 text-xs font-medium text-dash-accent hover:underline",children:[n("migrateBanner_reinstallCta")," →"]})]}):c.jsxs("p",{className:"text-xs font-medium",children:[n("migrateBanner_emptyDir_title")," — ",c.jsx("span",{className:"font-mono",children:t.path}),":"," ",c.jsx("span",{className:"font-semibold",children:t.itemCount})," ",n("migrateBanner_emptyDir_body")]})})]})},Lx=[{key:"install",labelKey:"migrateActionInstall",activeClass:"border-green-400 text-green-400",badgeClass:"bg-green-500/10 border-green-500/30 text-green-400"},{key:"update",labelKey:"migrateActionUpdate",activeClass:"border-yellow-400 text-yellow-400",badgeClass:"bg-yellow-500/10 border-yellow-500/30 text-yellow-400"},{key:"delete",labelKey:"migrateActionDelete",activeClass:"border-dash-text-secondary text-dash-text-secondary",badgeClass:"bg-dash-bg border-dash-border text-dash-text-secondary"},{key:"skip",labelKey:"migrateActionSkip",activeClass:"border-dash-text-muted text-dash-text-muted",badgeClass:"bg-dash-bg border-dash-border text-dash-text-muted"}],nk=["agent","command","skill","config","rules","hooks"],BT={agent:"migrateTypeAgents",command:"migrateTypeCommands",skill:"migrateTypeSkills",config:"migrateTypeConfig",rules:"migrateTypeRules",hooks:"migrateTypeHooks"},_T={agent:"border-dash-accent/30 text-dash-accent",command:"border-yellow-500/30 text-yellow-400",skill:"border-purple-500/30 text-purple-400",config:"border-teal-500/30 text-teal-400",rules:"border-rose-500/30 text-rose-400",hooks:"border-cyan-500/30 text-cyan-400"},mi=200,FT={install:["skip"],update:["skip"],delete:["skip"],skip:["install"]},zT=new Set(["user-deleted-respected","user-edits-preserved","target-state-unknown"]);function rk(t,e){return e!=="skip"?!0:t.reasonCode!==void 0&&zT.has(t.reasonCode)}function HT(t){return t>=0&&t<=8||t>=11&&t<=31||t>=127&&t<=159}function sc(t){let e="";for(const n of t){const r=n.codePointAt(0);r!==void 0&&(HT(r)||(e+=n))}return e}function VT(t){return{"new-item":"migrateReason_newItem","new-provider-for-item":"migrateReason_newProviderForItem","target-deleted-source-changed":"migrateReason_targetDeletedSourceChanged","target-dir-empty-reinstall":"migrateReason_targetDirEmptyReinstall","force-reinstall":"migrateReason_forceReinstall","force-overwrite":"migrateReason_forceOverwrite","registry-upgrade-reinstall":"migrateReason_registryUpgradeReinstall","source-changed":"migrateReason_sourceChanged","registry-upgrade-heal":"migrateReason_registryUpgradeHeal","no-changes":"migrateReason_noChanges","user-edits-preserved":"migrateReason_userEditsPreserved","user-deleted-respected":"migrateReason_userDeletedRespected","target-up-to-date-backfill":"migrateReason_targetUpToDateBackfill","provider-checksum-unavailable":"migrateReason_providerChecksumUnavailable","target-state-unknown":"migrateReason_targetStateUnknown","source-removed-orphan":"migrateReason_sourceRemovedOrphan","renamed-cleanup":"migrateReason_renamedCleanup","path-migrated-cleanup":"migrateReason_pathMigratedCleanup","both-changed":"migrateReason_bothChanged","target-state-unknown-source-changed":"migrateReason_targetStateUnknownSourceChanged"}[t]??"migrateReason_targetStateUnknown"}function WT(t){const e={install:[],update:[],delete:[],skip:[],conflict:[]};for(const n of t)n.action==="conflict"?(e.install.push(n),e.conflict.push(n)):(n.action==="install"||n.action==="update"||n.action==="delete"||n.action==="skip")&&e[n.action].push(n);return e}function KT(t){const e=new Map;for(const n of t){const r=e.get(n.type)??[];r.push(n),e.set(n.type,r)}return e}function UT(t,e,n){return[...t].sort((r,s)=>{const i=e.get(n(r))==="skip"?1:0,o=e.get(n(s))==="skip"?1:0;return i-o})}const GT=({plan:t,resolutions:e,onResolve:n,actionKey:r,flips:s,onFlip:i,onRespectDeletionsOverride:o})=>{const{t:a}=ne(),l=g.useMemo(()=>WT(t.actions),[t.actions]),d=g.useMemo(()=>Lx.filter(v=>l[v.key].length>0),[l]),[u,h]=g.useState(()=>{for(const v of Lx)if(l[v.key].length>0)return v.key;return"install"});g.useEffect(()=>{l[u]?.length===0&&d.length>0&&h(d[0].key)},[l,u,d]);const[f,p]=g.useState(!1),m=g.useMemo(()=>UT(l[u]??[],s,r),[l,u,s,r]),x=g.useMemo(()=>KT(m),[m]),b=u==="skip",y=u==="update"&&(l.update.length??0)>10,w=!b&&!y;return c.jsxs("div",{className:"space-y-4",children:[t.banners.length>0&&c.jsx("div",{className:"space-y-2",children:t.banners.map((v,k)=>c.jsx($T,{banner:v,onRespectDeletionsOverride:o},`banner-${k}`))}),l.conflict.length>0&&c.jsx(YT,{conflicts:l.conflict,resolutions:e,onResolve:n,actionKey:r,open:f,onToggle:()=>p(v=>!v)}),c.jsxs("div",{className:"flex flex-wrap gap-2 text-xs",children:[t.summary.install>0&&c.jsxs("div",{className:"px-2.5 py-1 rounded-md bg-green-500/10 border border-green-500/30 text-green-400",children:[t.summary.install," ",a("migrateActionInstall")]}),t.summary.update>0&&c.jsxs("div",{className:"px-2.5 py-1 rounded-md bg-yellow-500/10 border border-yellow-500/30 text-yellow-400",children:[t.summary.update," ",a("migrateActionUpdate")]}),t.summary.skip>0&&c.jsxs("div",{className:"px-2.5 py-1 rounded-md bg-dash-bg border border-dash-border text-dash-text-muted",children:[t.summary.skip," ",a("migrateActionSkip")]}),t.summary.conflict>0&&c.jsxs("div",{className:"px-2.5 py-1 rounded-md bg-red-500/10 border border-red-500/30 text-red-400",children:[t.summary.conflict," ",a("migrateActionConflict")]}),t.summary.delete>0&&c.jsxs("div",{className:"px-2.5 py-1 rounded-md bg-dash-bg border border-dash-border text-dash-text-secondary",children:[t.summary.delete," ",a("migrateActionDelete")]})]}),d.length>1&&c.jsx("div",{className:"flex gap-1 border-b border-dash-border",role:"tablist",children:d.map(v=>{const k=u===v.key,C=l[v.key].length;return c.jsxs("button",{type:"button",role:"tab","aria-selected":k,onClick:()=>h(v.key),className:`px-3 py-2 text-xs font-medium border-b-2 transition-colors ${k?v.activeClass:"border-transparent text-dash-text-muted hover:text-dash-text-secondary"}`,children:[a(v.labelKey)," ",c.jsx("span",{className:`ml-1 px-1.5 py-0.5 rounded text-[10px] border ${v.badgeClass}`,"aria-label":`${C} items`,children:C})]},v.key)})}),b?c.jsx(qT,{typeGroups:x,activeTab:u,flips:s,onFlip:i,actionKey:r}):c.jsx("div",{className:"space-y-3",children:nk.map(v=>{const k=x.get(v);return!k||k.length===0?null:c.jsxs(sk,{type:v,count:k.length,defaultExpanded:w,children:[k.slice(0,mi).map(C=>c.jsx(ik,{action:C,sourceTab:u,flipDecision:s.get(r(C)),onFlip:N=>i(C,N),hasConflict:C.action==="conflict",resolutions:e,onResolve:n,actionKey:r},r(C))),k.length>mi&&c.jsxs("div",{className:"text-xs text-dash-text-muted px-1",children:["... ",k.length-mi," more"]})]},`${u}:${v}`)})})]})},qT=({typeGroups:t,activeTab:e,flips:n,onFlip:r,actionKey:s})=>{const{t:i}=ne(),[o,a]=g.useState(!1),l=g.useMemo(()=>{let d=0;for(const u of t.values())d+=u.length;return d},[t]);return c.jsxs("div",{className:"border border-dash-border rounded-lg bg-dash-surface",children:[c.jsxs("button",{type:"button","aria-expanded":o,onClick:()=>a(d=>!d),className:"w-full px-4 py-3 flex items-center justify-between text-left hover:bg-dash-surface-hover transition-colors",children:[c.jsxs("span",{className:"text-sm text-dash-text-muted",children:[i(o?"migrateHideSkippedItems":"migrateShowSkippedItems"),c.jsxs("span",{className:"ml-2 text-xs text-dash-text-muted opacity-70",children:["(",l,")"]})]}),c.jsx("svg",{"aria-hidden":"true",className:`w-4 h-4 text-dash-text-muted transition-transform ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o&&c.jsx("div",{className:"px-4 pb-4 space-y-3",children:nk.map(d=>{const u=t.get(d);return!u||u.length===0?null:c.jsxs(sk,{type:d,count:u.length,defaultExpanded:!1,children:[u.slice(0,mi).map(h=>c.jsx(ik,{action:h,sourceTab:e,flipDecision:n.get(s(h)),onFlip:f=>r(h,f),hasConflict:!1,resolutions:new Map,onResolve:()=>{},actionKey:s},s(h))),u.length>mi&&c.jsxs("div",{className:"text-xs text-dash-text-muted px-1",children:["... ",u.length-mi," more"]})]},`${e}:${d}`)})})]})},YT=({conflicts:t,resolutions:e,onResolve:n,actionKey:r,open:s,onToggle:i})=>{const{t:o}=ne(),a=g.useMemo(()=>t.filter(l=>e.has(r(l))).length,[t,e,r]);return c.jsxs("div",{className:"border border-red-500/30 rounded-lg bg-red-500/5",children:[c.jsxs("div",{className:"px-4 py-3 flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("svg",{className:"w-4 h-4 text-red-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),c.jsxs("span",{className:"text-sm font-medium text-red-400",children:[o("migrateConflictBanner_title")," (",t.length,")"]}),a>0&&c.jsxs("span",{className:"text-xs text-green-400",children:[a,"/",t.length," resolved"]})]}),c.jsx("button",{type:"button",onClick:i,"aria-expanded":s,className:"dash-focus-ring px-3 py-1 text-xs font-medium rounded-md bg-red-500/10 border border-red-500/30 text-red-400 hover:bg-red-500/20 transition-colors",children:o(s?"migrateConflictBanner_hide":"migrateConflictBanner_cta")})]}),s&&c.jsx("div",{className:"px-4 pb-4 space-y-3",children:t.map(l=>c.jsx(tk,{action:l,resolution:e.get(r(l))??null,onResolve:d=>n(l,d)},r(l)))})]})},sk=({type:t,count:e,defaultExpanded:n=!0,children:r})=>{const{t:s}=ne(),[i,o]=g.useState(n),a=_T[t],l=s(BT[t]);return c.jsxs("div",{className:"border border-dash-border rounded-lg bg-dash-surface",children:[c.jsxs("button",{type:"button","aria-expanded":i,onClick:()=>o(d=>!d),className:"w-full px-4 py-2.5 flex items-center justify-between text-left hover:bg-dash-surface-hover transition-colors",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h4",{className:"text-sm font-semibold text-dash-text",children:l}),c.jsx("span",{className:`px-2 py-0.5 text-xs rounded-md border ${a}`,children:e})]}),c.jsx("svg",{"aria-hidden":"true",className:`w-4 h-4 text-dash-text-muted transition-transform ${i?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&c.jsx("div",{className:"px-4 pt-1 pb-4 space-y-2",children:r})]})},ik=({action:t,sourceTab:e,flipDecision:n,onFlip:r,hasConflict:s,resolutions:i,onResolve:o,actionKey:a})=>{const{t:l}=ne(),[d,u]=g.useState(!1),h=n?n==="skip":t.action==="skip",f=!h,p=!h||rk(t,e),m=`${sc(t.provider)}/${sc(t.item)}`,x=t.reasonCopy??(t.reasonCode?l(VT(t.reasonCode)):sc(t.reason)),b=y=>{r(y.target.checked?"execute":"skip")};return c.jsx("div",{className:`px-3 py-2 bg-dash-bg rounded-md border border-dash-border transition-opacity ${h?"opacity-50":"opacity-100"}`,children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("input",{type:"checkbox",checked:f,onChange:b,disabled:!p,"aria-label":`${l("migrateFlip_toggleItem")}: ${m}`,className:"mt-0.5 shrink-0 accent-dash-accent cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[c.jsx("span",{className:"font-mono text-xs text-dash-text truncate",children:m}),s&&c.jsx("button",{type:"button",onClick:()=>u(y=>!y),className:"dash-focus-ring shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded border border-red-500/40 bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors",children:l("migrateConflictBadge")})]}),c.jsx("div",{className:"text-xs text-dash-text-muted mt-0.5",children:x}),t.targetPath&&c.jsx("div",{className:"text-xs text-dash-text-secondary mt-0.5 font-mono truncate",children:sc(t.targetPath)}),s&&d&&c.jsx("div",{className:"mt-2",children:c.jsx(tk,{action:t,resolution:i.get(a(t))??null,onResolve:y=>o(t,y)})})]}),c.jsx(XT,{sourceTab:e,action:t,isSkipped:h,onFlip:r})]})})},XT=({sourceTab:t,action:e,isSkipped:n,onFlip:r})=>{const{t:s}=ne(),[i,o]=g.useState(!1),a=g.useRef(null);g.useEffect(()=>{if(!i)return;const h=f=>{a.current&&!a.current.contains(f.target)&&o(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[i]);const l=FT[t],d=l.includes("install")&&rk(e,t);return(n?d||t!=="skip":l.length>0)?c.jsxs("div",{ref:a,className:"relative shrink-0",children:[c.jsx("button",{type:"button",onClick:()=>o(h=>!h),"aria-label":"More actions","aria-haspopup":"true","aria-expanded":i,className:"dash-focus-ring p-1 rounded text-dash-text-muted hover:text-dash-text hover:bg-dash-surface-hover transition-colors",children:c.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:c.jsx("path",{d:"M10 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4z"})})}),i&&c.jsxs("div",{className:"absolute right-0 top-6 z-10 min-w-[140px] bg-dash-surface border border-dash-border rounded-lg shadow-lg py-1",children:[n&&(d||t!=="skip")&&c.jsx("button",{type:"button",onClick:()=>{r("execute"),o(!1)},className:"w-full px-3 py-1.5 text-xs text-left text-dash-text hover:bg-dash-surface-hover",children:s("migrateFlip_moveToInstall")}),!n&&c.jsx("button",{type:"button",onClick:()=>{r("skip"),o(!1)},className:"w-full px-3 py-1.5 text-xs text-left text-dash-text hover:bg-dash-surface-hover",children:s("migrateFlip_moveToSkip")})]})]}):null};var QT=function(e){return typeof window<"u"?matchMedia&&matchMedia("(prefers-color-scheme: ".concat(e,")")):{matches:!1}},ah,JT=g.createContext({appearance:"light",setAppearance:function(){},isDarkMode:!1,themeMode:"light",setThemeMode:function(){},browserPrefers:(ah=QT("dark"))!==null&&ah!==void 0&&ah.matches?"dark":"light"}),ZT=function(){return g.useContext(JT)};const ok=(t,e)=>{if(e)return"row";switch(t){case"horizontal":return"row";case"horizontal-reverse":return"row-reverse";case"vertical":default:return"column";case"vertical-reverse":return"column-reverse"}},e7=t=>{if(t)return["space-between","space-around","space-evenly"].includes(t)},t7=(t,e)=>ok(t,e)==="row",Gs=t=>typeof t=="number"?`${t}px`:t,n7=({visible:t,flex:e,gap:n,direction:r,horizontal:s,align:i,justify:o,distribution:a,height:l,width:d,padding:u,paddingInline:h,paddingBlock:f,prefixCls:p,as:m="div",className:x,style:b,children:y,wrap:w,ref:v,...k})=>{const C=o||a,S=t7(r,s)&&!d&&e7(C)?"100%":Gs(d),D={...e!==void 0?{"--lobe-flex":String(e)}:{},...r||s?{"--lobe-flex-direction":ok(r,s)}:{},...w!==void 0?{"--lobe-flex-wrap":w}:{},...C!==void 0?{"--lobe-flex-justify":C}:{},...i!==void 0?{"--lobe-flex-align":i}:{},...S!==void 0?{"--lobe-flex-width":S}:{},...l!==void 0?{"--lobe-flex-height":Gs(l)}:{},...u!==void 0?{"--lobe-flex-padding":Gs(u)}:{},...h!==void 0?{"--lobe-flex-padding-inline":Gs(h)}:{},...f!==void 0?{"--lobe-flex-padding-block":Gs(f)}:{},...n!==void 0?{"--lobe-flex-gap":Gs(n)}:{},...b},E="lobe-flex",M=[E,t===!1?`${E}--hidden`:void 0,p?`${p}-flex`:void 0,x].filter(Boolean).join(" ");return c.jsx(m,{ref:v,...k,className:M,style:D,children:y})};var ak=g.memo(n7);const r7=({children:t,ref:e,...n})=>c.jsx(ak,{...n,align:"center",justify:"center",ref:e,children:t});var s7=r7;const i7=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function o7(t){return Array.from(t.match(i7)??[])}function a7(t){return o7(t).map(n=>n.toLowerCase()).join("-")}var lk={exports:{}},ck={};/**
|
|
280
296
|
* @license React
|
|
281
297
|
* use-sync-external-store-shim.production.js
|